You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Classrooms__Lists__Commo...

16 lines
63 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[49,6],{"500L":function(Pe,z,n){"use strict";n.d(z,"a",function(){return Q});var _e=n("DZo9"),ue=n("8z0m"),he=n("+L6B"),ee=n("2/Rp"),ce=n("2qtc"),R=n("kLXV"),d=n("9og8"),Z=n("k1fw"),ne=n("oBTY"),b=n("miYZ"),M=n("tsqr"),C=n("tJVT"),U=n("q1tI"),V=n.n(U),pe=n("m3rI"),Ee=n("wzkS"),I=n("y5JW");function ae(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ae=function(){return A};var A={},te=Object.prototype,T=te.hasOwnProperty,J=typeof Symbol=="function"?Symbol:{},D=J.iterator||"@@iterator",H=J.asyncIterator||"@@asyncIterator",B=J.toStringTag||"@@toStringTag";function w(a,e,l){return Object.defineProperty(a,e,{value:l,enumerable:!0,configurable:!0,writable:!0}),a[e]}try{w({},"")}catch(a){w=function(l,f,o){return l[f]=o}}function W(a,e,l,f){var o=e&&e.prototype instanceof P?e:P,t=Object.create(o.prototype),i=new m(f||[]);return t._invoke=function(p,y,v){var L="suspendedStart";return function(K,re){if(L==="executing")throw new Error("Generator is already running");if(L==="completed"){if(K==="throw")throw re;return c()}for(v.method=K,v.arg=re;;){var X=v.delegate;if(X){var ie=g(X,v);if(ie){if(ie===j)continue;return ie}}if(v.method==="next")v.sent=v._sent=v.arg;else if(v.method==="throw"){if(L==="suspendedStart")throw L="completed",v.arg;v.dispatchException(v.arg)}else v.method==="return"&&v.abrupt("return",v.arg);L="executing";var ve=oe(p,y,v);if(ve.type==="normal"){if(L=v.done?"completed":"suspendedYield",ve.arg===j)continue;return{value:ve.arg,done:v.done}}ve.type==="throw"&&(L="completed",v.method="throw",v.arg=ve.arg)}}}(a,l,i),t}function oe(a,e,l){try{return{type:"normal",arg:a.call(e,l)}}catch(f){return{type:"throw",arg:f}}}A.wrap=W;var j={};function P(){}function $(){}function N(){}var Y={};w(Y,D,function(){return this});var q=Object.getPrototypeOf,u=q&&q(q(s([])));u&&u!==te&&T.call(u,D)&&(Y=u);var r=N.prototype=P.prototype=Object.create(Y);function _(a){["next","throw","return"].forEach(function(e){w(a,e,function(l){return this._invoke(e,l)})})}function h(a,e){function l(o,t,i,p){var y=oe(a[o],a,t);if(y.type!=="throw"){var v=y.arg,L=v.value;return L&&typeof L=="object"&&T.call(L,"__await")?e.resolve(L.__await).then(function(K){l("next",K,i,p)},function(K){l("throw",K,i,p)}):e.resolve(L).then(function(K){v.value=K,i(v)},function(K){return l("throw",K,i,p)})}p(y.arg)}var f;this._invoke=function(o,t){function i(){return new e(function(p,y){l(o,t,p,y)})}return f=f?f.then(i,i):i()}}function g(a,e){var l=a.iterator[e.method];if(l===void 0){if(e.delegate=null,e.method==="throw"){if(a.iterator.return&&(e.method="return",e.arg=void 0,g(a,e),e.method==="throw"))return j;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return j}var f=oe(l,a.iterator,e.arg);if(f.type==="throw")return e.method="throw",e.arg=f.arg,e.delegate=null,j;var o=f.arg;return o?o.done?(e[a.resultName]=o.value,e.next=a.nextLoc,e.method!=="return"&&(e.method="next",e.arg=void 0),e.delegate=null,j):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,j)}function O(a){var e={tryLoc:a[0]};1 in a&&(e.catchLoc=a[1]),2 in a&&(e.finallyLoc=a[2],e.afterLoc=a[3]),this.tryEntries.push(e)}function F(a){var e=a.completion||{};e.type="normal",delete e.arg,a.completion=e}function m(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(O,this),this.reset(!0)}function s(a){if(a){var e=a[D];if(e)return e.call(a);if(typeof a.next=="function")return a;if(!isNaN(a.length)){var l=-1,f=function o(){for(;++l<a.length;)if(T.call(a,l))return o.value=a[l],o.done=!1,o;return o.value=void 0,o.done=!0,o};return f.next=f}}return{next:c}}function c(){return{value:void 0,done:!0}}return $.prototype=N,w(r,"constructor",N),w(N,"constructor",$),$.displayName=w(N,B,"GeneratorFunction"),A.isGeneratorFunction=function(a){var e=typeof a=="function"&&a.constructor;return!!e&&(e===$||(e.displayName||e.name)==="GeneratorFunction")},A.mark=function(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,N):(a.__proto__=N,w(a,B,"GeneratorFunction")),a.prototype=Object.create(r),a},A.awrap=function(a){return{__await:a}},_(h.prototype),w(h.prototype,H,function(){return this}),A.AsyncIterator=h,A.async=function(a,e,l,f,o){o===void 0&&(o=Promise);var t=new h(W(a,e,l,f),o);return A.isGeneratorFunction(e)?t:t.next().then(function(i){return i.done?i.value:t.next()})},_(r),w(r,B,"Generator"),w(r,D,function(){return this}),w(r,"toString",function(){return"[object Generator]"}),A.keys=function(a){var e=[];for(var l in a)e.push(l);return e.reverse(),function f(){for(;e.length;){var o=e.pop();if(o in a)return f.value=o,f.done=!1,f}return f.done=!0,f}},A.values=s,m.prototype={constructor:m,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(F),!e)for(var l in this)l.charAt(0)==="t"&&T.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if(e.type==="throw")throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var l=this;function f(v,L){return i.type="throw",i.arg=e,l.next=v,L&&(l.method="next",l.arg=void 0),!!L}for(var o=this.tryEntries.length-1;o>=0;--o){var t=this.tryEntries[o],i=t.completion;if(t.tryLoc==="root")return f("end");if(t.tryLoc<=this.prev){var p=T.call(t,"catchLoc"),y=T.call(t,"finallyLoc");if(p&&y){if(this.prev<t.catchLoc)return f(t.catchLoc,!0);if(this.prev<t.finallyLoc)return f(t.finallyLoc)}else if(p){if(this.prev<t.catchLoc)return f(t.catchLoc,!0)}else{if(!y)throw new Error("try statement without catch or finally");if(this.prev<t.finallyLoc)return f(t.finallyLoc)}}}},abrupt:function(e,l){for(var f=this.tryEntries.length-1;f>=0;--f){var o=this.tryEntries[f];if(o.tryLoc<=this.prev&&T.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var t=o;break}}t&&(e==="break"||e==="continue")&&t.tryLoc<=l&&l<=t.finallyLoc&&(t=null);var i=t?t.completion:{};return i.type=e,i.arg=l,t?(this.method="next",this.next=t.finallyLoc,j):this.complete(i)},complete:function(e,l){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&l&&(this.next=l),j},finish:function(e){for(var l=this.tryEntries.length-1;l>=0;--l){var f=this.tryEntries[l];if(f.finallyLoc===e)return this.complete(f.completion,f.afterLoc),F(f),j}},catch:function(e){for(var l=this.tryEntries.length-1;l>=0;--l){var f=this.tryEntries[l];if(f.tryLoc===e){var o=f.completion;if(o.type==="throw"){var t=o.arg;F(f)}return t}}throw new Error("illegal catch attempt")},delegateYield:function(e,l,f){return this.delegate={iterator:s(e),resultName:l,nextLoc:f},this.method==="next"&&(this.arg=void 0),j}},A}function Q(A){var te=[];return A&&A.length>0&&(te=A.map(function(T){return{uid:T.id,id:T.id,name:T.title+I.c+T.filesize,url:T.url,filesize:T.filesize,status:"done",response:{id:T.id}}})),te}z.b=function(A){var te=A.value,T=A.onChange,J=A.className,D=A.maxSize,H=D===void 0?150:D,B=A.title,w=B===void 0?"\u4E0A\u4F20\u9644\u4EF6":B,W=A.showRemoveModal,oe=W===void 0?!1:W,j=A.accept,P=j===void 0?"":j,$=A.number,N=$===void 0?1e3:$,Y=Object(U.useState)(!1),q=Object(C.a)(Y,2),u=q[0],r=q[1],_=Object(U.useState)([]),h=Object(C.a)(_,2),g=h[0],O=h[1],F={multiple:!0,disabled:u,accept:P,withCredentials:!0,fileList:te,beforeUpload:function(c,a){var e=c.size/1024/1024;return g.concat(a).length>N?(M.b.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(N,"\u4E2A\u6587\u4EF6")),!1):e<H?!0:(M.b.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(H,"MB),\u5EFA\u8BAE\u4E0A\u4F20\u5230\u767E\u5EA6\u4E91\u7B49\u5176\u5B83\u5171\u4EAB\u5DE5\u5177\u91CC\uFF0C\u7136\u540E\u518Dtxt\u6587\u6863\u91CC\u7ED9\u51FA\u94FE\u63A5\u4EE5\u53CA\u5171\u4EAB\u5BC6\u7801\u5E76\u4E0A\u4F20")),!1)},action:"".concat(pe.a.API_SERVER,"/api/attachments.json"),onChange:function(c){var a=Object(ne.a)(c.fileList);a.length>=N?r(!0):r(!1),O(Object(ne.a)(a)),a=a.map(function(e){var l;if(e==null||((l=e.response)===null||l===void 0)?void 0:l.id){var f;e.url="/api/attachments/".concat(e==null||((f=e.response)===null||f===void 0)?void 0:f.id)}return e.name.indexOf(I.c)===-1&&(e.name="".concat(e.name).concat(I.c).concat(Object(I.a)(e.size))),Object(Z.a)({},e)}),console.log("info:",c),T(a)},onRemove:function(){var s=Object(d.a)(ae().mark(function a(e){var l;return ae().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(l=function(){var t=Object(d.a)(ae().mark(function i(){var p,y;return ae().wrap(function(L){for(;;)switch(L.prev=L.next){case 0:if(p=e.response?e.response.id:e.id,!p){L.next=8;break}return L.next=4,Object(Ee.d)(e.response?e.response.id:e.uid);case 4:return y=L.sent,L.abrupt("return",y);case 8:return L.abrupt("return",!0);case 9:case"end":return L.stop()}},i)}));return function(){return t.apply(this,arguments)}}(),!oe){o.next=5;break}return o.abrupt("return",new Promise(function(t,i){R.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:V.a.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:function(){var p=Object(d.a)(ae().mark(function v(){var L;return ae().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return re.next=2,l();case 2:L=re.sent,M.b.success("\u5220\u9664\u6210\u529F"),t(!0);case 5:case"end":return re.stop()}},v)}));function y(){return p.apply(this,arguments)}return y}(),onCancel:function(){return t(!1)}})}));case 5:return o.next=7,l();case 7:return o.abrupt("return",o.sent);case 8:case"end":return o.stop()}},a)}));function c(a){return s.apply(this,arguments)}return c}()};function m(s){s.preventDefault(),s.stopPropagation()}return V.a.createElement("div",{className:"multi-upload ".concat(J||"")},V.a.createElement(ue.a,F,V.a.createElement(ee.a,{disabled:u,type:"primary",ghost:!0},w),V.a.createElement("span",{onClick:m,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",H,"M) ")))}},"7ahc":function(Pe,z,n){"use strict";n.d(z,"a",function(){return te});var _e=n("k1fw"),ue=n("0Owb"),he=n("+L6B"),ee=n("2/Rp"),ce=n("y8nQ"),R=n("Vl3Y"),d=n("tJVT"),Z=n("OaEy"),ne=n("2fM7"),b=n("q1tI"),M=n.n(b),C=n("VrN/"),U=n.n(C),V=n("p77/"),pe=n.n(V),Ee=n("c5Ni"),I=n.n(Ee),ae=ne.a.Option,Q={labelCol:{span:4},wrapperCol:{span:20}},A={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};z.b=function(T){var J=T.callback,D=T.onCancel,H=Object(b.useState)("python"),B=Object(d.a)(H,2),w=B[0],W=B[1];function oe(P){W(A[P][1])}function j(P){J(P)}return M.a.createElement(R.a,Object(ue.a)({},Q,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:j}),M.a.createElement(R.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},M.a.createElement(ne.a,{onChange:oe},Object.keys(A).map(function(P){return M.a.createElement(ae,{key:P,value:P},A[P][0])}))),M.a.createElement(R.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},M.a.createElement(te,{mode:w})),M.a.createElement("div",{className:"flex-container flex-end"},M.a.createElement(ee.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),M.a.createElement(ee.a,{type:"ghost",onClick:D},"\u53D6\u6D88")))};function te(T){var J=T.value,D=T.onChange,H=T.mode,B=T.options,w=B===void 0?{}:B,W=Object(b.useRef)(),oe=Object(b.useState)(),j=Object(d.a)(oe,2),P=j[0],$=j[1];return Object(b.useEffect)(function(){if(P){var N=function(q){var u=q.getValue();D&&D(u)};return P.on("change",N),function(){P.off("change",N)}}},[P,D]),Object(b.useEffect)(function(){P&&P.setOption("mode",H)},[P,H]),Object(b.useEffect)(function(){P&&((J!==P.getValue()||J==="")&&setTimeout(function(){P.setValue(J||" ")},300))},[P,J]),Object(b.useEffect)(function(){if(W.current&&!P){var N=U.a.fromTextArea(W.current,Object(_e.a)({mode:H,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},w));$(N)}},[W.current,P]),M.a.createElement("div",{className:"my-codemirror-container"},M.a.createElement("textarea",{ref:W}))}},"9Bee":function(Pe,z,n){"use strict";var _e=n("k1fw"),ue=n("q1tI"),he=n.n(ue),ee=n("vg9a"),ce=n("tJVT"),R=n("DlQD"),d=n.n(R),Z=n("rUJ1");function ne(u,r){var _=u.match(/^(\s+)(?:```)/);if(_===null)return r;var h=_[1];return r.split(`
`).map(function(g){var O=g.match(/^\s+/);if(O===null)return g;var F=Object(ce.a)(O,1),m=F[0];return m.length>=h.length?g.slice(h.length):g}).join(`
`)}var b=[],M=["<ul>"],C=new d.a.Renderer,U=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function V(){b.length=0,M=["<ul>"]}var pe={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function Ee(u,r,_,h){if(r>=u.length||u[r].level<=_)return r;var g=u[r];h.push("<li><a href='#"+g.anchor+"'>"+g.text+"</a>"),r++;var O=[];return r=Ee(u,r,g.level,O),O.length>0&&(h.push("<ul>"),O.forEach(function(F){h.push(F)}),h.push("</ul>")),h.push("</li>"),r=Ee(u,r,_,h),r}function I(){return Ee(b,0,0,M),M.push("</ul>"),M.join("")}var ae={heading:function(r){var _=U.exec(r);if(_)return{type:"heading",raw:_[0],depth:_[1].length,text:_[2]}},fences:function(r){var _=this.rules.block.fences.exec(r);if(_){var h=_[0],g=ne(h,_[3]||""),O=_[2]?_[2].trim():_[2];if(["latex","katex","math"].indexOf(O)>=0){var F=te(),m=g;g=F,T[F]={type:"block",expression:m}}return{type:"code",raw:h,lang:O,text:g}}}},Q=/(?:\${2})([^\n`]+?)(?:\${2})/gi,A=0,te=function(){return"__special_katext_id_".concat(A++,"__")},T={};function J(){return T}function D(){A=0,T={}}function H(u){return u=u.replace(Q,function(r,_){var h=te();return T[h]={type:"inline",expression:_},h}),u}var B=C.listitem;C.listitem=function(u){return B(H(u))};var w=C.paragraph;C.paragraph=function(u){return w(H(u))};var W=C.tablecell;C.tablecell=function(u,r){return W(H(u),r)},C.code=function(u,r,_){var h=(r||"").match(/\S*/)[0];return h?["latex","katex","math"].indexOf(h)>=0?"<p class='editormd-tex'>".concat(u,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(r,'">').concat(_?u:Object(Z.escape)(u,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(_?u:Object(Z.escape)(u,!0))+"</code></pre>"},C.heading=function(u,r,_){var h=this.options.headerPrefix+_.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return b.push({anchor:h,level:r,text:u}),"<h"+r+' id="'+h+'">'+u+"</h"+r+">"},d.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),d.a.use({tokenizer:ae,renderer:C});var oe=d.a,j=n("SJMd"),P=n("m3rI"),$=n("Oy/b"),N=/<pre[^>]*>/g;function Y(u){var r=document.createElement("div");return r.innerHTML=u,r.childNodes.length===0?"":r.childNodes[0].nodeValue}var q=z.a=function(u){var r=u.value,_=r===void 0?"":r,h=u.className,g=u.showTextOnly,O=u.showLines,F=u.style,m=F===void 0?{}:F,s=String(_),c=Object(ue.useMemo)(function(){try{var f=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,o=/\"\/api\/attachments\/|\"\/attachments\/download\//g,t=/\(\s+\/files\/uploads\/|\(\/files\/uploads\//g;s=s.replace(f,"("+P.a.API_SERVER+"/api/attachments/").replace(o,'"'+P.a.API_SERVER+"/api/attachments/").replace(t,'"'+P.a.API_SERVER+"/files/uploads/")}catch(v){}var i=oe(s);setTimeout(function(){return l()},300);var p=J();if(s.match(/\[TOC\]/)&&(i=i.replace("<p>[TOC]</p>",I()),V()),i=i.replace(/(__special_katext_id_\d+__)/g,function(v,L){var K=p[L],re=K.type,X=K.expression;return Object($.renderToString)(Y(X)||"",{displayMode:re==="block",throwOnError:!1,output:"html"})}),i=i.replace(/▁/g,"\u2581\u2581\u2581"),D(),g){var y=document.createElement("div");return y.innerHTML=i,y.innerText}return i},[s]),a=Object(ue.useRef)();pe.WebkitLineClamp=O,O&&(m=Object(_e.a)(Object(_e.a)({},m),pe));function e(f){var o=f.target;if(o.tagName.toUpperCase()==="A"){var t=o.getAttribute("href");if(t.startsWith("#")){f.preventDefault();var i=document.getElementById(t.replace("#",""));i&&i.scrollIntoView(!0)}}}var l=function(){};return Object(ue.useEffect)(function(){if(a.current&&c&&(c.match(N)&&window.PR.prettyPrint()),a.current)return a.current.addEventListener("click",e),function(){a.current.removeEventListener("click",e),D(),V()}},[c,a.current,e]),he.a.createElement(he.a.Fragment,null,he.a.createElement("div",{ref:a,style:Object(_e.a)({},m),className:"".concat(h||""," markdown-body "),dangerouslySetInnerHTML:{__html:c}}))}},"9VGf":function(Pe,z,n){"use strict";n.d(z,"a",function(){return he});var _e=n("q1tI"),ue=n.n(_e);function he(ee,ce){var R=Object(_e.useRef)();Object(_e.useEffect)(function(){R.current=ee}),Object(_e.useEffect)(function(){function d(){R.current()}if(ce!==null){var Z=setInterval(d,ce);return function(){return clearInterval(Z)}}},[ce])}},BjJ7:function(Pe,z,n){"use strict";n.d(z,"d",function(){return ue}),n.d(z,"c",function(){return he}),n.d(z,"e",function(){return ee}),n.d(z,"b",function(){return ce}),n.d(z,"a",function(){return d});var _e=n("m3rI");function ue(Z){var ne=!0;if(Z.length>0){for(var b=0;b<Z.length;b++)if(Z[b].compile_success==0||!Z[b].compile_success){ne=!1;break}}else ne=!1;return ne}function he(Z){for(var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",b=[],M=0;M<Z.length;M++){var C=Z[M],U=ne?"".concat(ne,"/").concat(C.name):"".concat(C.name);b.push({title:C.name,isLeaf:!(C.type==="tree"),key:U})}return b}function ee(Z,ne,b){for(var M=0;M<Z.length;M++){var C=Z[M];if(C.key===ne){C.children=b;break}C.children&&ee(C.children,ne,b)}return Z}function ce(Z,ne,b){var M;return function(){var C=this,U=arguments,V=function(){M=null,b||Z.apply(C,U)},pe=b&&!M;clearTimeout(M),M=setTimeout(V,ne),pe&&Z.apply(C,U)}}var R=!0,d=_e.a.API_SERVER},"C+DQ":function(Pe,z,n){},HmJG:function(Pe,z,n){},M8RZ:function(Pe,z,n){"use strict";n.d(z,"a",function(){return ne});var _e=n("fWQN"),ue=n("mtLc"),he=n("yKVA"),ee=n("879j"),ce=n("q1tI"),R=n.n(ce),d=n("i8i4"),Z=n.n(d),ne=function(b){Object(he.a)(C,b);var M=Object(ee.a)(C);function C(U){var V;Object(_e.a)(this,C),V=M.call(this,U);var pe=window.document;return V.node=pe.createElement("div"),pe.body.appendChild(V.node),V}return Object(ue.a)(C,[{key:"render",value:function(){var V=this.props.children;return Object(d.createPortal)(V,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),C}(R.a.Component)},Ot1p:function(Pe,z,n){"use strict";var _e=n("2qtc"),ue=n("kLXV"),he=n("rAM+"),ee=n("tJVT"),ce=n("jrin"),R=n("q1tI"),d=n.n(R),Z=n("VrN/"),ne=n.n(Z),b=n("bdgK"),M=n("p77/"),C=n("Bd2K"),U=n("ELLl"),V=n("19Vz"),pe=n("lZu9"),Ee=n("kSUc"),I=n("9Bee"),ae=n("0Owb"),Q=n("dejd"),A=n("C+DQ"),te=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function T(S){var ye=S.onActionCallback,de=S.title,me=S.icon,ge=S.actionName,De=S.className,Ae=De===void 0?"":De,Ue=S.children;function Me(){ye(ge)}return d.a.createElement("a",{title:de,className:Ae,onClick:Me},d.a.createElement("i",{className:"md-iconfont ".concat(me)}),Ue)}var J=function(S){var ye=S.watch,de=S.showNullButton,me=S.onActionCallback,ge=S.fullScreen,De=S.insertTemp,Ae=[].concat(te,[{title:"".concat(ye?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(ye?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return d.a.createElement("ul",{className:"markdown-toolbar-container"},Ae.map(function(Ue,Me){return d.a.createElement("li",{key:Me},Ue.actionName?d.a.createElement(T,Object(ae.a)({},Ue,{onActionCallback:me})):d.a.createElement("span",{className:"v-line"}))}),de?d.a.createElement("li",null,d.a.createElement(T,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:me},d.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,De&&d.a.createElement("li",null,d.a.createElement(T,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(De),onActionCallback:me},d.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),d.a.createElement("li",{className:"btn-full-screen"},d.a.createElement(T,{icon:"".concat(ge?"icon-shrink":"icon-enlarge"),title:ge?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:me})))},D=n("M8RZ"),H=n("+L6B"),B=n("2/Rp"),w=n("y8nQ"),W=n("Vl3Y"),oe=n("5NDa"),j=n("5rEg"),P={labelCol:{span:4},wrapperCol:{span:20}},$=function(S){var ye=S.callback,de=S.onCancel;function me(ge){ye(ge)}return d.a.createElement(W.a,Object(ae.a)({},P,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:me}),d.a.createElement(W.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},d.a.createElement(j.a,null)),d.a.createElement(W.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},d.a.createElement(j.a,null)),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(B.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(B.a,{type:"ghost",onClick:de},"\u53D6\u6D88")))},N=n("7ahc"),Y=n("HmJG"),q=n("BjJ7"),u=W.a.useForm,r={width:280,marginRight:10},_={labelCol:{span:5},wrapperCol:{span:19}},h=function(S){var ye=S.callback,de=S.onCancel,me=u(),ge=Object(ee.a)(me,1),De=ge[0];function Ae(Te){ye(Te)}function Ue(Te){De.setFieldsValue({src:"/api/attachments/".concat(Te.id)})}function Me(Te){var Ge=Te.target.files[0];O(Ge,Ue)}return d.a.createElement(W.a,Object(ae.a)({form:De},_,{className:"upload-image-panel",onFinish:Ae}),d.a.createElement(W.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},d.a.createElement("div",{className:"flex-container"},d.a.createElement(W.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},d.a.createElement(j.a,{style:r})),d.a.createElement(g,{onFileChange:Me}))),d.a.createElement(W.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u63CF\u8FF0"}]},d.a.createElement(j.a,{style:{width:264}})),d.a.createElement(W.a.Item,{style:{textAlign:"right"}},d.a.createElement(B.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(B.a,{type:"ghost",onClick:de},"\u53D6\u6D88")))};function g(S){var ye=S.onFileChange;return d.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",d.a.createElement("input",{type:"file",accept:"image/*",onChange:ye}))}function O(S,ye){if(!S)throw new String("\u6CA1\u6709\u6587\u4EF6");var de=new FormData;de.append("editormd-image-file",S),de.append("file_param_name","editormd-image-file"),de.append("byxhr","true");var me=new window.XMLHttpRequest;me.withCredentials=!0,me.addEventListener("load",function(ge){ye(JSON.parse(ge.target.responseText))},!1),me.addEventListener("error",function(ge){console.error(ge)},!1),me.open("POST","".concat(q.a,"/api/attachments.json")),me.send(de)}var F=n("giR+"),m=n("fyUT"),s=n("7Kak"),c=n("9yH6"),a=c.a.Group,e={margin:"0 8px"},l=function(S){var ye=S.callback,de=S.onCancel;function me(ge){ye(ge)}return d.a.createElement(W.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:me},d.a.createElement("div",{className:"flex-container"},d.a.createElement("span",{style:e},"\u5355\u5143\u683C\u6570\uFF1A"),d.a.createElement("span",{style:e},"\u884C\u6570"),d.a.createElement(W.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},d.a.createElement(m.a,null)),d.a.createElement("span",{style:e},"\u5217\u6570"),d.a.createElement(W.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},d.a.createElement(m.a,null))),d.a.createElement("div",{className:"flex-container",style:{marginTop:12}},d.a.createElement("span",{style:e},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),d.a.createElement(W.a.Item,{name:"align"},d.a.createElement(a,null,d.a.createElement(c.a,{value:"default"},d.a.createElement("i",{className:"fa fa-align-justify"})),d.a.createElement(c.a,{value:"left"},d.a.createElement("i",{className:"fa fa-align-left"})),d.a.createElement(c.a,{value:"center"},d.a.createElement("i",{className:"fa fa-align-center"})),d.a.createElement(c.a,{value:"right"},d.a.createElement("i",{className:"fa fa-align-right"}))))),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(B.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(B.a,{type:"ghost",onClick:de},"\u53D6\u6D88")))},f="link",o="upload-image",t="code-block",i="add-table",p="------------",y={default:p,left:":".concat(p),center:":".concat(p,":"),right:"".concat(p,":")},v=n("9VGf"),L,K;function re(){}var X=0,ie=1e4,ve="\u2581",Ke=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Ie(S){return/^\d+$/.test(S)?"".concat(S,"px"):S}var Be=navigator.platform.toUpperCase().indexOf("MAC")>=0,Ce=Be?"Cmd":"Ctrl",wt=(L={},Object(ce.a)(L,Ce+"-B","bold"),Object(ce.a)(L,Ce+"-I","italic"),L),ut=(K={},Object(ce.a)(K,f,"\u6DFB\u52A0\u94FE\u63A5"),Object(ce.a)(K,t,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(ce.a)(K,o,"\u6DFB\u52A0\u56FE\u7247"),Object(ce.a)(K,i,"\u6DFB\u52A0\u8868\u683C"),K),Zt=z.a=function(S){var ye=S.defaultValue,de=ye===void 0?"":ye,me=S.onChange,ge=S.width,De=ge===void 0?"100%":ge,Ae=S.height,Ue=Ae===void 0?400:Ae,Me=S.miniToolbar,Te=Me===void 0?!1:Me,Ge=S.isFocus,Qe=Ge===void 0?!1:Ge,Ze=S.watch,jt=S.insertTemp,st=S.id,Ve=st===void 0?"markdown-editor-id":st,lt=S.showResizeBar,St=lt===void 0?!1:lt,ct=S.noStorage,Nt=ct===void 0?!1:ct,dt=S.showNullButton,It=dt===void 0?!1:dt,mt=S.fullScreen,$e=mt===void 0?!1:mt,qe=S.onBlur,et=S.onCMBeforeChange,ft=S.className,Bt=ft===void 0?"":ft,_t=S.placeholder,xt=_t===void 0?"":_t,ht=S.values,tt=ht===void 0?"":ht,Wt=Object(R.useState)(null),pt=Object(ee.a)(Wt,2),E=pt[0],Ft=pt[1],kt=Object(R.useState)(de),Et=Object(ee.a)(kt,2),rt=Et[0],Xe=Et[1],Kt=Object(R.useState)(Ze),vt=Object(ee.a)(Kt,2),we=vt[0],yt=vt[1],Gt=Object(R.useState)($e),gt=Object(ee.a)(Gt,2),je=gt[0],Ot=gt[1],Vt=Object(R.useState)(""),bt=Object(ee.a)(Vt,2),Se=bt[0],Ne=bt[1],$t=Object(R.useState)(0),Pt=Object(ee.a)($t,2),xe=Pt[0],nt=Pt[1],Xt=Object(R.useState)(Ue),Lt=Object(ee.a)(Xt,2),at=Lt[0],Rt=Lt[1],zt=Object(R.useState)(!1),Ut=Object(ee.a)(zt,2),qt=Ut[0],ot=Ut[1],We=Object(R.useRef)(),Fe=Object(R.useRef)(),ze=Object(R.useRef)(),He=Object(R.useRef)();Object(R.useEffect)(function(){Xe(tt),E==null||E.setValue(tt)},[tt]),Object(R.useEffect)(function(){if(We.current){var G=function(se,le){var fe=le.clipboardData;if(fe){var Oe=fe.types.toString(),Le=fe.items;if(Oe==="text/html,Files"||Oe==="Files"||fe.types.indexOf("Files")){var be=Le[1];Oe==="Files"&&(be=Le[0]),be.kind==="file"&&be.type.match(/^image\//i)&&O(be.getAsFile(),function(Re){Re.id?x.replaceSelection("![,](/api/attachments/".concat(Re.id,")")):(Re==null?void 0:Re.status)===401&&(document.location.href="/user/login")})}else return!0}return!0},x=ne.a.fromTextArea(We.current,{mode:"markdown",lineNumbers:!Te,lineWrapping:!0,value:de,autoCloseTags:!0,autoCloseBrackets:!0});return Qe&&x.focus(),x.on("paste",G),Ft(x),function(){x.off("paste",G)}}},[]);var Dt=Object(R.useCallback)(function(){if(Fe.current)try{var G=Fe.current.getElementsByClassName("markdown-toolbar-container")[0].offsetHeight,x=Fe.current.getElementsByClassName("markdown-editor-body")[0];je?x.style.height="calc(100vh - ".concat(G,"px)"):x.style.height="".concat(at-G,"px")}catch(k){console.log(k,"---- to set md editor body height")}},[at,Fe,je]);Object(R.useEffect)(function(){function G(){var k=new b.default(function(se){var le=Object(he.a)(se),fe;try{for(le.s();!(fe=le.n()).done;){var Oe=fe.value;(Oe.target.offsetHeight>0||Oe.target.offsetWidth>0)&&(Dt(),E.setSize("100%","100%"),E.refresh())}}catch(Le){le.e(Le)}finally{le.f()}});return k.observe(We.current.parentElement),k}if(E){var x=G();return function(){x.unobserve(We.current.parentElement)}}},[E,Dt]),Object(R.useEffect)(function(){if(E){for(var G=[],x=function(){var Oe=se[k];le=Object(ee.a)(Oe,2);var Le=le[0],be=le[1],Re=Object(ce.a)({},Le,function(){Ct(be)});G.push(Re),E.addKeyMap(Re)},k=0,se=Object.entries(wt);k<se.length;k++){var le;x()}return function(){var fe=Object(he.a)(G),Oe;try{for(fe.s();!(Oe=fe.n()).done;){var Le=Oe.value;E.removeKeyMap(Le)}}catch(be){fe.e(be)}finally{fe.f()}}}},[E]),Object(R.useEffect)(function(){$e!==je&&Ot($e)},[$e]),Object(v.a)(function(){if(!Nt&&xe>0){var G=new Date().getTime(),x=window.sessionStorage.getItem(Ve);G>=xe+ie&&(!x||x!==rt)&&(window.sessionStorage.setItem(Ve,rt),ot(!0))}},ie),Object(R.useEffect)(function(){yt(Ze)},[E,Ze]),Object(R.useEffect)(function(){E&&(Qe&&E.focus())},[E,Qe]),Object(R.useEffect)(function(){if(we&&E){var G=function(se){var le=se.target;if(He.current){var fe=le.scrollTop/le.scrollHeight;He.current.scrollTop=He.current.scrollHeight*fe}},x=E.getScrollerElement();return x.addEventListener("scroll",G),function(){x.removeEventListener("scroll",G)}}},[E,we]),Object(R.useEffect)(function(){if(E&&et){var G=function(k,se){et(k,se)};return E.on("beforeChange",G),function(){E.off("beforeChange",G)}}},[E,et]),Object(R.useEffect)(function(){if(E&&qe){var G=function(){qe(E.getValue())};return E.on("blur",G),function(){E.off("blur",G)}}},[E,qe]),Object(R.useEffect)(function(){if(E){var G=function(k){var se=k.getValue();Xe(se),nt(new Date().getTime()),k.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),me&&me(se)};return E.on("change",G),function(){E.off("change",G)}}},[E,me]),Object(R.useEffect)(function(){E&&(de==null?(E.setValue(""),Xe("")):de!==E.getValue()&&(E.setValue(de),Xe(de),E.setCursor(E.lineCount(),0)))},[E,de]);var Ct=Object(R.useCallback)(function(G){var x=E.getCursor(),k=E.getSelection(),se=k.split(`
`);switch(G){case"bold":return E.replaceSelection("**"+k+"**"),k===""&&E.setCursor(x.line,x.ch+2),E.focus();case"italic":return E.replaceSelection("*"+k+"*"),k===""&&E.setCursor(x.line,x.ch+1),E.focus();case"code":return E.replaceSelection("`"+k+"`"),k===""&&E.setCursor(x.line,x.ch+1),E.focus();case"inline-latex":return E.replaceSelection("`$$"+k+"$$`"),k===""&&E.setCursor(x.line,x.ch+3),E.focus();case"latex":return E.replaceSelection("```latex\n"+k+"\n```"),E.setCursor(x.line+1,k.length+1),E.focus();case"line-break":return E.replaceSelection(`<br/>
`),E.focus();case"list-ul":return k===""?E.replaceSelection("- "+k):E.replaceSelection(se.map(function(le){return le===""?"":"- ".concat(le)}).join(`
`)),E.focus();case"list-ol":return k===""?E.replaceSelection("1. "+k):E.replaceSelection(se.map(function(le,fe){return le===""?"":"".concat(fe+1,". ").concat(le)}).join(`
`)),E.focus();case"add-null-ch":return k===""&&E.setCursor(x.line,x.ch+1),E.replaceSelection(ve),E.focus();case"inster-template-1":return k===""&&E.setCursor(x.line,x.ch),E.replaceSelection(Ke),E.focus();case"eraser":return E.setValue(""),E.focus();case"trigger-watch":return yt(!we),E.focus();case"trigger-full-screen":return Ot(!je),E.focus();case f:Ne(f);return;case t:Ne(t);return;case o:Ne(o);return;case i:Ne(i);return;default:throw new Error}},[E,we,je]),Ye=Object(R.useCallback)(function(G){Ne("");switch(Se){case f:var x=G.title,k=G.link;return E.replaceSelection("[".concat(x,"](").concat(k,")")),E.focus();case t:var se=G.language,le=G.content;return E.replaceSelection(["```"+se,le,"```"].join(`
`)),E.focus();case o:var fe=G.src,Oe=G.alt;return E.replaceSelection("![ ".concat(Oe," ]( ").concat(fe,' "').concat(Oe,'" )')),E.focus();case i:for(var Le=G.row,be=G.col,Re=G.align,it=`
`,Je=0;Je<Le;Je++){for(var At=[],Mt=[],Tt=0;Tt<be;Tt++)Je===1&&Mt.push(y[Re]),At.push(" ");Je===1&&(it+="| ".concat(Mt.join(" | "),` |
`)),it+="| ".concat(At.join(be===1?"":" | "),` |
`)}return E.replaceSelection(it+`
`),E.focus();default:throw new Error}},[E,Se]),Ht=Object(R.useMemo)(function(){switch(Se){case f:return d.a.createElement($,{callback:Ye,onCancel:ke});case t:return d.a.createElement(N.b,{callback:Ye,onCancel:ke});case o:return d.a.createElement(h,{callback:Ye,onCancel:ke});case i:return d.a.createElement(l,{callback:Ye,onCancel:ke});default:return null}},[Se]);function ke(){Ne("")}Object(R.useEffect)(function(){if(ze.current){var G=function(Le){le=!0,fe=Le.pageY},x=function(){le=!1},k=function(Le){if(le){var be=Le.pageY-fe;be<0&&(be=0),be>300&&(be=300);var Re=Ue+be+"px";Rt(Re)}},se=ze.current,le=!1,fe=0;return se.addEventListener("mousedown",G),document.addEventListener("mousemove",k),document.addEventListener("mouseup",x),function(){se.removeEventListener("mousedown",G),document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",x)}}},[E,ze]),Object(R.useEffect)(function(){Rt(Ue)},[Ue]);var Yt=Ie(De),Jt=Ie(at),Qt={width:Yt,height:Jt},er=Object(R.useMemo)(function(){if(xe){var G=new Date(xe),x=G.getHours(),k=G.getMinutes(),se=G.getSeconds();return x=x<10?"0"+x:x,k=k<10?"0"+k:k,se=se<10?"0"+se:se,"".concat(x,":").concat(k,":").concat(se)}return 0},[xe]);function tr(){window.sessionStorage.removeItem(Ve),ot(!1),nt(0)}function rr(){ot(!1),nt(0),E.setValue(window.sessionStorage.getItem(Ve))}return d.a.createElement(R.Fragment,null,d.a.createElement("div",{className:"markdown-editor-wrapper",ref:Fe},d.a.createElement("div",{className:"markdown-editor-container ".concat(Bt," ").concat(we?"on-preview":""," ").concat(Te?"mini":""," ").concat(je?"full-screen":""),style:Qt},d.a.createElement(J,{insertTemp:jt,watch:we,fullScreen:je,showNullButton:It,onActionCallback:Ct}),d.a.createElement("div",{className:"markdown-editor-body"},d.a.createElement("div",{className:"codemirror-container"},d.a.createElement("textarea",{ref:We,placeholder:xt})),we?d.a.createElement("div",{ref:He,className:"preview-container"},d.a.createElement(I.a,{value:rt})):null))),St?d.a.createElement("a",{ref:ze,className:"editor-resize"}):null,d.a.createElement(D.a,null,ut[Se]?d.a.createElement(ue.a,{centered:!0,title:ut[Se],visible:!0,onCancel:ke,footer:null},Ht):null))}},dejd:function(Pe,z,n){},gnOq:function(Pe,z,n){"use strict";n.r(z);var _e=n("+L6B"),ue=n("2/Rp"),he=n("5NDa"),ee=n("5rEg"),ce=n("sPJy"),R=n("bE4q"),d=n("k1fw"),Z=n("9og8"),ne=n("y8nQ"),b=n("Vl3Y"),M=n("tJVT"),C=n("q1tI"),U=n.n(C),V=n("9kvl"),pe=n("55Ip"),Ee=n("Ot1p"),I=n("XYT7"),ae=n("we55"),Q=n.n(ae),A=n("500L"),te=n("1vsH");function T(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */T=function(){return D};var D={},H=Object.prototype,B=H.hasOwnProperty,w=typeof Symbol=="function"?Symbol:{},W=w.iterator||"@@iterator",oe=w.asyncIterator||"@@asyncIterator",j=w.toStringTag||"@@toStringTag";function P(o,t,i){return Object.defineProperty(o,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),o[t]}try{P({},"")}catch(o){P=function(i,p,y){return i[p]=y}}function $(o,t,i,p){var y=t&&t.prototype instanceof q?t:q,v=Object.create(y.prototype),L=new e(p||[]);return v._invoke=function(K,re,X){var ie="suspendedStart";return function(ve,Ke){if(ie==="executing")throw new Error("Generator is already running");if(ie==="completed"){if(ve==="throw")throw Ke;return f()}for(X.method=ve,X.arg=Ke;;){var Ie=X.delegate;if(Ie){var Be=s(Ie,X);if(Be){if(Be===Y)continue;return Be}}if(X.method==="next")X.sent=X._sent=X.arg;else if(X.method==="throw"){if(ie==="suspendedStart")throw ie="completed",X.arg;X.dispatchException(X.arg)}else X.method==="return"&&X.abrupt("return",X.arg);ie="executing";var Ce=N(K,re,X);if(Ce.type==="normal"){if(ie=X.done?"completed":"suspendedYield",Ce.arg===Y)continue;return{value:Ce.arg,done:X.done}}Ce.type==="throw"&&(ie="completed",X.method="throw",X.arg=Ce.arg)}}}(o,i,L),v}function N(o,t,i){try{return{type:"normal",arg:o.call(t,i)}}catch(p){return{type:"throw",arg:p}}}D.wrap=$;var Y={};function q(){}function u(){}function r(){}var _={};P(_,W,function(){return this});var h=Object.getPrototypeOf,g=h&&h(h(l([])));g&&g!==H&&B.call(g,W)&&(_=g);var O=r.prototype=q.prototype=Object.create(_);function F(o){["next","throw","return"].forEach(function(t){P(o,t,function(i){return this._invoke(t,i)})})}function m(o,t){function i(y,v,L,K){var re=N(o[y],o,v);if(re.type!=="throw"){var X=re.arg,ie=X.value;return ie&&typeof ie=="object"&&B.call(ie,"__await")?t.resolve(ie.__await).then(function(ve){i("next",ve,L,K)},function(ve){i("throw",ve,L,K)}):t.resolve(ie).then(function(ve){X.value=ve,L(X)},function(ve){return i("throw",ve,L,K)})}K(re.arg)}var p;this._invoke=function(y,v){function L(){return new t(function(K,re){i(y,v,K,re)})}return p=p?p.then(L,L):L()}}function s(o,t){var i=o.iterator[t.method];if(i===void 0){if(t.delegate=null,t.method==="throw"){if(o.iterator.return&&(t.method="return",t.arg=void 0,s(o,t),t.method==="throw"))return Y;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return Y}var p=N(i,o.iterator,t.arg);if(p.type==="throw")return t.method="throw",t.arg=p.arg,t.delegate=null,Y;var y=p.arg;return y?y.done?(t[o.resultName]=y.value,t.next=o.nextLoc,t.method!=="return"&&(t.method="next",t.arg=void 0),t.delegate=null,Y):y:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,Y)}function c(o){var t={tryLoc:o[0]};1 in o&&(t.catchLoc=o[1]),2 in o&&(t.finallyLoc=o[2],t.afterLoc=o[3]),this.tryEntries.push(t)}function a(o){var t=o.completion||{};t.type="normal",delete t.arg,o.completion=t}function e(o){this.tryEntries=[{tryLoc:"root"}],o.forEach(c,this),this.reset(!0)}function l(o){if(o){var t=o[W];if(t)return t.call(o);if(typeof o.next=="function")return o;if(!isNaN(o.length)){var i=-1,p=function y(){for(;++i<o.length;)if(B.call(o,i))return y.value=o[i],y.done=!1,y;return y.value=void 0,y.done=!0,y};return p.next=p}}return{next:f}}function f(){return{value:void 0,done:!0}}return u.prototype=r,P(O,"constructor",r),P(r,"constructor",u),u.displayName=P(r,j,"GeneratorFunction"),D.isGeneratorFunction=function(o){var t=typeof o=="function"&&o.constructor;return!!t&&(t===u||(t.displayName||t.name)==="GeneratorFunction")},D.mark=function(o){return Object.setPrototypeOf?Object.setPrototypeOf(o,r):(o.__proto__=r,P(o,j,"GeneratorFunction")),o.prototype=Object.create(O),o},D.awrap=function(o){return{__await:o}},F(m.prototype),P(m.prototype,oe,function(){return this}),D.AsyncIterator=m,D.async=function(o,t,i,p,y){y===void 0&&(y=Promise);var v=new m($(o,t,i,p),y);return D.isGeneratorFunction(t)?v:v.next().then(function(L){return L.done?L.value:v.next()})},F(O),P(O,j,"Generator"),P(O,W,function(){return this}),P(O,"toString",function(){return"[object Generator]"}),D.keys=function(o){var t=[];for(var i in o)t.push(i);return t.reverse(),function p(){for(;t.length;){var y=t.pop();if(y in o)return p.value=y,p.done=!1,p}return p.done=!0,p}},D.values=l,e.prototype={constructor:e,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(a),!t)for(var i in this)i.charAt(0)==="t"&&B.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var i=this;function p(X,ie){return L.type="throw",L.arg=t,i.next=X,ie&&(i.method="next",i.arg=void 0),!!ie}for(var y=this.tryEntries.length-1;y>=0;--y){var v=this.tryEntries[y],L=v.completion;if(v.tryLoc==="root")return p("end");if(v.tryLoc<=this.prev){var K=B.call(v,"catchLoc"),re=B.call(v,"finallyLoc");if(K&&re){if(this.prev<v.catchLoc)return p(v.catchLoc,!0);if(this.prev<v.finallyLoc)return p(v.finallyLoc)}else if(K){if(this.prev<v.catchLoc)return p(v.catchLoc,!0)}else{if(!re)throw new Error("try statement without catch or finally");if(this.prev<v.finallyLoc)return p(v.finallyLoc)}}}},abrupt:function(t,i){for(var p=this.tryEntries.length-1;p>=0;--p){var y=this.tryEntries[p];if(y.tryLoc<=this.prev&&B.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var v=y;break}}v&&(t==="break"||t==="continue")&&v.tryLoc<=i&&i<=v.finallyLoc&&(v=null);var L=v?v.completion:{};return L.type=t,L.arg=i,v?(this.method="next",this.next=v.finallyLoc,Y):this.complete(L)},complete:function(t,i){if(t.type==="throw")throw t.arg;return t.type==="break"||t.type==="continue"?this.next=t.arg:t.type==="return"?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):t.type==="normal"&&i&&(this.next=i),Y},finish:function(t){for(var i=this.tryEntries.length-1;i>=0;--i){var p=this.tryEntries[i];if(p.finallyLoc===t)return this.complete(p.completion,p.afterLoc),a(p),Y}},catch:function(t){for(var i=this.tryEntries.length-1;i>=0;--i){var p=this.tryEntries[i];if(p.tryLoc===t){var y=p.completion;if(y.type==="throw"){var v=y.arg;a(p)}return v}}throw new Error("illegal catch attempt")},delegateYield:function(t,i,p){return this.delegate={iterator:l(t),resultName:i,nextLoc:p},this.method==="next"&&(this.arg=void 0),Y}},D}var J=function(H){var B,w=H.shixunHomeworks,W=H.newCourse,oe=H.globalSetting,j=H.loading,P=H.dispatch,$=H.match,N=b.a.useForm(),Y=Object(M.a)(N,1),q=Y[0],u=Object(C.useState)({}),r=Object(M.a)(u,2),_=r[0],h=r[1],g=Object(C.useState)(),O=Object(M.a)(g,2),F=O[0],m=O[1],s=Object(C.useRef)(),c=w.commonHomeWorkAddDefaultData;Object(C.useEffect)(function(){var l,f=$.params,o=f.coursesId,t=f.categoryId;s.current=(l=$.params)===null||l===void 0?void 0:l.courseId,m(!!s.current),s.current&&a(),P({type:"shixunHomeworks/addCommonHomeWorkDefaultData",payload:{category:t,coursesId:o,type:1}})},[]);var a=function(){var l=Object(Z.a)(T().mark(function f(){var o;return T().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,P({type:"newCourse/getEditCourseData",payload:{id:s.current}});case 2:o=i.sent,o&&(q.setFieldsValue({name:o.name}),q.setFieldsValue({intro:o.description}),q.setFieldsValue({notice:o.learning_notes}),h({name:o.name,intro:o.description,notice:o.learning_notes}));case 4:case"end":return i.stop()}},f)}));return function(){return l.apply(this,arguments)}}(),e=function(){var l=Object(Z.a)(T().mark(function f(o){var t,i,p,y,v,L,K;return T().wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return t=Object(d.a)({},_),t.attachment_ids&&(t.attachment_ids=t==null||((i=t.attachment_ids)===null||i===void 0)?void 0:i.map(function(ie){return ie.response.id})),t.reference_attachment_ids&&(t.reference_attachment_ids=t==null||((p=t.reference_attachment_ids)===null||p===void 0)?void 0:p.map(function(ie){return ie.response.id})),y=$.params,v=y.coursesId,L=y.categoryId,X.next=6,Object(I.a)(Object(d.a)(Object(d.a)({coursesId:v,category:L},t),{},{base_on_project:!0,type:1}));case 6:K=X.sent,(K==null?void 0:K.status)===0&&(Object(te.P)(["\u6559\u5B66\u8BFE\u5802","\u666E\u901A\u4F5C\u4E1A","\u65B0\u5EFA\u666E\u901A\u4F5C\u4E1A"]),V.c.push("/classrooms/".concat($.params.coursesId,"/common_homework/").concat(K.homework_id,"/detail")));case 8:case"end":return X.stop()}},f)}));return function(o){return l.apply(this,arguments)}}();return U.a.createElement("section",{className:Q.a.bg},c.course_name&&U.a.createElement("section",{className:"animated fadeIn"},U.a.createElement("aside",{className:"mt10"},c.category&&U.a.createElement(R.a,{separator:">"},U.a.createElement(R.a.Item,null,U.a.createElement(pe.Link,{to:"/classrooms/".concat(c.course_id,"/common_homework")},c.course_name)),U.a.createElement(R.a.Item,null,U.a.createElement(pe.Link,{to:"/classrooms/".concat(c.course_id,"/common_homework")},c.category.category_name)),U.a.createElement(R.a.Item,null,"\u65B0\u5EFA\u8BE6\u60C5")))),U.a.createElement("aside",{className:"font24 bold mt20 mb20"},"\u65B0\u5EFA\u666E\u901A\u4F5C\u4E1A"),U.a.createElement(b.a,{form:q,className:Q.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(){console.log("onchange: ",q.getFieldsValue()),h(Object(d.a)({},q.getFieldsValue()))},onFinish:e},U.a.createElement("div",{className:Q.a.fieldWrap},U.a.createElement(b.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u9898"}]},U.a.createElement(ee.a,{maxLength:60,suffix:"".concat(((B=_.name)===null||B===void 0?void 0:B.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),U.a.createElement("div",{className:Q.a.mdWrap},U.a.createElement(b.a.Item,{name:"description",label:"\u7B80\u4ECB:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:5e3,message:"\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"}]},U.a.createElement(Ee.a,{watch:!0,defaultValue:_.intro})),U.a.createElement("div",null,U.a.createElement(b.a.Item,{name:"attachment_ids"},U.a.createElement(A.b,null)))),U.a.createElement("div",{className:Q.a.mdWrap},U.a.createElement(b.a.Item,{name:"reference_answer",label:"\u53C2\u8003\u7B54\u6848:"},U.a.createElement(Ee.a,{watch:!0,defaultValue:_.notice})),U.a.createElement("div",null,U.a.createElement(b.a.Item,{name:"reference_attachment_ids"},U.a.createElement(A.b,null)))),U.a.createElement("div",{className:Q.a.backgroundFa},U.a.createElement("div",{className:"pt40 mb30"},U.a.createElement(b.a.Item,null,U.a.createElement(ue.a,{size:"large",type:"primary",className:"".concat(Q.a.button," mr20"),htmlType:"submit",loading:j["newCourse/editCourse"]||j["newCourse/submitCourse"]},"\u63D0\u4EA4"),U.a.createElement(ue.a,{size:"large",type:"primary",ghost:!0,className:Q.a.button,onClick:function(){return V.c.push("/classrooms/".concat($.params.coursesId,"/common_homework"))}},"\u53D6\u6D88"))))))};z.default=Object(V.a)(function(D){var H=D.shixunHomeworks,B=D.newCourse,w=D.loading,W=D.globalSetting;return{shixunHomeworks:H,newCourse:B,globalSetting:W,loading:w.effects}})(J)},kSUc:function(Pe,z,n){},we55:function(Pe,z,n){Pe.exports={bg:"bg___3PaSA",flexRow:"flexRow___1k1iY",flexJustifyCenter:"flexJustifyCenter___MzzvD",flexAlignEnd:"flexAlignEnd___1KYBf",flexAlignCenter:"flexAlignCenter___3XoYY",flexColumn:"flexColumn___28jeJ",formWrap:"formWrap___2IoYS",titleWrap:"titleWrap___2LenH",fieldWrap:"fieldWrap___3zhLT",mdWrap:"mdWrap___3fVSN",backgroundFa:"backgroundFa___21qxJ",button:"button___3eTeL"}},wzkS:function(Pe,z,n){"use strict";n.d(z,"c",function(){return ee}),n.d(z,"b",function(){return ce}),n.d(z,"d",function(){return R}),n.d(z,"a",function(){return Z}),n.d(z,"e",function(){return ne});var _e=n("9og8"),ue=n("ErOA");function he(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */he=function(){return b};var b={},M=Object.prototype,C=M.hasOwnProperty,U=typeof Symbol=="function"?Symbol:{},V=U.iterator||"@@iterator",pe=U.asyncIterator||"@@asyncIterator",Ee=U.toStringTag||"@@toStringTag";function I(u,r,_){return Object.defineProperty(u,r,{value:_,enumerable:!0,configurable:!0,writable:!0}),u[r]}try{I({},"")}catch(u){I=function(_,h,g){return _[h]=g}}function ae(u,r,_,h){var g=r&&r.prototype instanceof te?r:te,O=Object.create(g.prototype),F=new N(h||[]);return O._invoke=function(m,s,c){var a="suspendedStart";return function(e,l){if(a==="executing")throw new Error("Generator is already running");if(a==="completed"){if(e==="throw")throw l;return q()}for(c.method=e,c.arg=l;;){var f=c.delegate;if(f){var o=j(f,c);if(o){if(o===A)continue;return o}}if(c.method==="next")c.sent=c._sent=c.arg;else if(c.method==="throw"){if(a==="suspendedStart")throw a="completed",c.arg;c.dispatchException(c.arg)}else c.method==="return"&&c.abrupt("return",c.arg);a="executing";var t=Q(m,s,c);if(t.type==="normal"){if(a=c.done?"completed":"suspendedYield",t.arg===A)continue;return{value:t.arg,done:c.done}}t.type==="throw"&&(a="completed",c.method="throw",c.arg=t.arg)}}}(u,_,F),O}function Q(u,r,_){try{return{type:"normal",arg:u.call(r,_)}}catch(h){return{type:"throw",arg:h}}}b.wrap=ae;var A={};function te(){}function T(){}function J(){}var D={};I(D,V,function(){return this});var H=Object.getPrototypeOf,B=H&&H(H(Y([])));B&&B!==M&&C.call(B,V)&&(D=B);var w=J.prototype=te.prototype=Object.create(D);function W(u){["next","throw","return"].forEach(function(r){I(u,r,function(_){return this._invoke(r,_)})})}function oe(u,r){function _(g,O,F,m){var s=Q(u[g],u,O);if(s.type!=="throw"){var c=s.arg,a=c.value;return a&&typeof a=="object"&&C.call(a,"__await")?r.resolve(a.__await).then(function(e){_("next",e,F,m)},function(e){_("throw",e,F,m)}):r.resolve(a).then(function(e){c.value=e,F(c)},function(e){return _("throw",e,F,m)})}m(s.arg)}var h;this._invoke=function(g,O){function F(){return new r(function(m,s){_(g,O,m,s)})}return h=h?h.then(F,F):F()}}function j(u,r){var _=u.iterator[r.method];if(_===void 0){if(r.delegate=null,r.method==="throw"){if(u.iterator.return&&(r.method="return",r.arg=void 0,j(u,r),r.method==="throw"))return A;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return A}var h=Q(_,u.iterator,r.arg);if(h.type==="throw")return r.method="throw",r.arg=h.arg,r.delegate=null,A;var g=h.arg;return g?g.done?(r[u.resultName]=g.value,r.next=u.nextLoc,r.method!=="return"&&(r.method="next",r.arg=void 0),r.delegate=null,A):g:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,A)}function P(u){var r={tryLoc:u[0]};1 in u&&(r.catchLoc=u[1]),2 in u&&(r.finallyLoc=u[2],r.afterLoc=u[3]),this.tryEntries.push(r)}function $(u){var r=u.completion||{};r.type="normal",delete r.arg,u.completion=r}function N(u){this.tryEntries=[{tryLoc:"root"}],u.forEach(P,this),this.reset(!0)}function Y(u){if(u){var r=u[V];if(r)return r.call(u);if(typeof u.next=="function")return u;if(!isNaN(u.length)){var _=-1,h=function g(){for(;++_<u.length;)if(C.call(u,_))return g.value=u[_],g.done=!1,g;return g.value=void 0,g.done=!0,g};return h.next=h}}return{next:q}}function q(){return{value:void 0,done:!0}}return T.prototype=J,I(w,"constructor",J),I(J,"constructor",T),T.displayName=I(J,Ee,"GeneratorFunction"),b.isGeneratorFunction=function(u){var r=typeof u=="function"&&u.constructor;return!!r&&(r===T||(r.displayName||r.name)==="GeneratorFunction")},b.mark=function(u){return Object.setPrototypeOf?Object.setPrototypeOf(u,J):(u.__proto__=J,I(u,Ee,"GeneratorFunction")),u.prototype=Object.create(w),u},b.awrap=function(u){return{__await:u}},W(oe.prototype),I(oe.prototype,pe,function(){return this}),b.AsyncIterator=oe,b.async=function(u,r,_,h,g){g===void 0&&(g=Promise);var O=new oe(ae(u,r,_,h),g);return b.isGeneratorFunction(r)?O:O.next().then(function(F){return F.done?F.value:O.next()})},W(w),I(w,Ee,"Generator"),I(w,V,function(){return this}),I(w,"toString",function(){return"[object Generator]"}),b.keys=function(u){var r=[];for(var _ in u)r.push(_);return r.reverse(),function h(){for(;r.length;){var g=r.pop();if(g in u)return h.value=g,h.done=!1,h}return h.done=!0,h}},b.values=Y,N.prototype={constructor:N,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!r)for(var _ in this)_.charAt(0)==="t"&&C.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=void 0)},stop:function(){this.done=!0;var r=this.tryEntries[0].completion;if(r.type==="throw")throw r.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var _=this;function h(c,a){return F.type="throw",F.arg=r,_.next=c,a&&(_.method="next",_.arg=void 0),!!a}for(var g=this.tryEntries.length-1;g>=0;--g){var O=this.tryEntries[g],F=O.completion;if(O.tryLoc==="root")return h("end");if(O.tryLoc<=this.prev){var m=C.call(O,"catchLoc"),s=C.call(O,"finallyLoc");if(m&&s){if(this.prev<O.catchLoc)return h(O.catchLoc,!0);if(this.prev<O.finallyLoc)return h(O.finallyLoc)}else if(m){if(this.prev<O.catchLoc)return h(O.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<O.finallyLoc)return h(O.finallyLoc)}}}},abrupt:function(r,_){for(var h=this.tryEntries.length-1;h>=0;--h){var g=this.tryEntries[h];if(g.tryLoc<=this.prev&&C.call(g,"finallyLoc")&&this.prev<g.finallyLoc){var O=g;break}}O&&(r==="break"||r==="continue")&&O.tryLoc<=_&&_<=O.finallyLoc&&(O=null);var F=O?O.completion:{};return F.type=r,F.arg=_,O?(this.method="next",this.next=O.finallyLoc,A):this.complete(F)},complete:function(r,_){if(r.type==="throw")throw r.arg;return r.type==="break"||r.type==="continue"?this.next=r.arg:r.type==="return"?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):r.type==="normal"&&_&&(this.next=_),A},finish:function(r){for(var _=this.tryEntries.length-1;_>=0;--_){var h=this.tryEntries[_];if(h.finallyLoc===r)return this.complete(h.completion,h.afterLoc),$(h),A}},catch:function(r){for(var _=this.tryEntries.length-1;_>=0;--_){var h=this.tryEntries[_];if(h.tryLoc===r){var g=h.completion;if(g.type==="throw"){var O=g.arg;$(h)}return O}}throw new Error("illegal catch attempt")},delegateYield:function(r,_,h){return this.delegate={iterator:Y(r),resultName:_,nextLoc:h},this.method==="next"&&(this.arg=void 0),A}},b}function ee(b){return Object(ue.c)("libraries/".concat(b,".json"))}function ce(){return Object(ue.c)("library_tags.json")}function R(b){return d.apply(this,arguments)}function d(){return d=Object(_e.a)(he().mark(function b(M){var C;return he().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,Object(ue.b)("attachments/".concat(M,".json"));case 2:return C=V.sent,V.abrupt("return",C.status===0);case 4:case"end":return V.stop()}},b)})),d.apply(this,arguments)}function Z(b){return Object(ue.f)("libraries.json",b)}function ne(b,M){return Object(ue.g)("libraries/".concat(b,".json"),M)}},y5JW:function(Pe,z,n){"use strict";n.d(z,"c",function(){return pe}),n.d(z,"a",function(){return Ee});var _e=n("DZo9"),ue=n("8z0m"),he=n("+L6B"),ee=n("2/Rp"),ce=n("9og8"),R=n("k1fw"),d=n("oBTY"),Z=n("miYZ"),ne=n("tsqr"),b=n("q1tI"),M=n.n(b),C=n("m3rI"),U=n("wzkS");function V(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */V=function(){return I};var I={},ae=Object.prototype,Q=ae.hasOwnProperty,A=typeof Symbol=="function"?Symbol:{},te=A.iterator||"@@iterator",T=A.asyncIterator||"@@asyncIterator",J=A.toStringTag||"@@toStringTag";function D(m,s,c){return Object.defineProperty(m,s,{value:c,enumerable:!0,configurable:!0,writable:!0}),m[s]}try{D({},"")}catch(m){D=function(c,a,e){return c[a]=e}}function H(m,s,c,a){var e=s&&s.prototype instanceof W?s:W,l=Object.create(e.prototype),f=new g(a||[]);return l._invoke=function(o,t,i){var p="suspendedStart";return function(y,v){if(p==="executing")throw new Error("Generator is already running");if(p==="completed"){if(y==="throw")throw v;return F()}for(i.method=y,i.arg=v;;){var L=i.delegate;if(L){var K=r(L,i);if(K){if(K===w)continue;return K}}if(i.method==="next")i.sent=i._sent=i.arg;else if(i.method==="throw"){if(p==="suspendedStart")throw p="completed",i.arg;i.dispatchException(i.arg)}else i.method==="return"&&i.abrupt("return",i.arg);p="executing";var re=B(o,t,i);if(re.type==="normal"){if(p=i.done?"completed":"suspendedYield",re.arg===w)continue;return{value:re.arg,done:i.done}}re.type==="throw"&&(p="completed",i.method="throw",i.arg=re.arg)}}}(m,c,f),l}function B(m,s,c){try{return{type:"normal",arg:m.call(s,c)}}catch(a){return{type:"throw",arg:a}}}I.wrap=H;var w={};function W(){}function oe(){}function j(){}var P={};D(P,te,function(){return this});var $=Object.getPrototypeOf,N=$&&$($(O([])));N&&N!==ae&&Q.call(N,te)&&(P=N);var Y=j.prototype=W.prototype=Object.create(P);function q(m){["next","throw","return"].forEach(function(s){D(m,s,function(c){return this._invoke(s,c)})})}function u(m,s){function c(e,l,f,o){var t=B(m[e],m,l);if(t.type!=="throw"){var i=t.arg,p=i.value;return p&&typeof p=="object"&&Q.call(p,"__await")?s.resolve(p.__await).then(function(y){c("next",y,f,o)},function(y){c("throw",y,f,o)}):s.resolve(p).then(function(y){i.value=y,f(i)},function(y){return c("throw",y,f,o)})}o(t.arg)}var a;this._invoke=function(e,l){function f(){return new s(function(o,t){c(e,l,o,t)})}return a=a?a.then(f,f):f()}}function r(m,s){var c=m.iterator[s.method];if(c===void 0){if(s.delegate=null,s.method==="throw"){if(m.iterator.return&&(s.method="return",s.arg=void 0,r(m,s),s.method==="throw"))return w;s.method="throw",s.arg=new TypeError("The iterator does not provide a 'throw' method")}return w}var a=B(c,m.iterator,s.arg);if(a.type==="throw")return s.method="throw",s.arg=a.arg,s.delegate=null,w;var e=a.arg;return e?e.done?(s[m.resultName]=e.value,s.next=m.nextLoc,s.method!=="return"&&(s.method="next",s.arg=void 0),s.delegate=null,w):e:(s.method="throw",s.arg=new TypeError("iterator result is not an object"),s.delegate=null,w)}function _(m){var s={tryLoc:m[0]};1 in m&&(s.catchLoc=m[1]),2 in m&&(s.finallyLoc=m[2],s.afterLoc=m[3]),this.tryEntries.push(s)}function h(m){var s=m.completion||{};s.type="normal",delete s.arg,m.completion=s}function g(m){this.tryEntries=[{tryLoc:"root"}],m.forEach(_,this),this.reset(!0)}function O(m){if(m){var s=m[te];if(s)return s.call(m);if(typeof m.next=="function")return m;if(!isNaN(m.length)){var c=-1,a=function e(){for(;++c<m.length;)if(Q.call(m,c))return e.value=m[c],e.done=!1,e;return e.value=void 0,e.done=!0,e};return a.next=a}}return{next:F}}function F(){return{value:void 0,done:!0}}return oe.prototype=j,D(Y,"constructor",j),D(j,"constructor",oe),oe.displayName=D(j,J,"GeneratorFunction"),I.isGeneratorFunction=function(m){var s=typeof m=="function"&&m.constructor;return!!s&&(s===oe||(s.displayName||s.name)==="GeneratorFunction")},I.mark=function(m){return Object.setPrototypeOf?Object.setPrototypeOf(m,j):(m.__proto__=j,D(m,J,"GeneratorFunction")),m.prototype=Object.create(Y),m},I.awrap=function(m){return{__await:m}},q(u.prototype),D(u.prototype,T,function(){return this}),I.AsyncIterator=u,I.async=function(m,s,c,a,e){e===void 0&&(e=Promise);var l=new u(H(m,s,c,a),e);return I.isGeneratorFunction(s)?l:l.next().then(function(f){return f.done?f.value:l.next()})},q(Y),D(Y,J,"Generator"),D(Y,te,function(){return this}),D(Y,"toString",function(){return"[object Generator]"}),I.keys=function(m){var s=[];for(var c in m)s.push(c);return s.reverse(),function a(){for(;s.length;){var e=s.pop();if(e in m)return a.value=e,a.done=!1,a}return a.done=!0,a}},I.values=O,g.prototype={constructor:g,reset:function(s){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(h),!s)for(var c in this)c.charAt(0)==="t"&&Q.call(this,c)&&!isNaN(+c.slice(1))&&(this[c]=void 0)},stop:function(){this.done=!0;var s=this.tryEntries[0].completion;if(s.type==="throw")throw s.arg;return this.rval},dispatchException:function(s){if(this.done)throw s;var c=this;function a(i,p){return f.type="throw",f.arg=s,c.next=i,p&&(c.method="next",c.arg=void 0),!!p}for(var e=this.tryEntries.length-1;e>=0;--e){var l=this.tryEntries[e],f=l.completion;if(l.tryLoc==="root")return a("end");if(l.tryLoc<=this.prev){var o=Q.call(l,"catchLoc"),t=Q.call(l,"finallyLoc");if(o&&t){if(this.prev<l.catchLoc)return a(l.catchLoc,!0);if(this.prev<l.finallyLoc)return a(l.finallyLoc)}else if(o){if(this.prev<l.catchLoc)return a(l.catchLoc,!0)}else{if(!t)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return a(l.finallyLoc)}}}},abrupt:function(s,c){for(var a=this.tryEntries.length-1;a>=0;--a){var e=this.tryEntries[a];if(e.tryLoc<=this.prev&&Q.call(e,"finallyLoc")&&this.prev<e.finallyLoc){var l=e;break}}l&&(s==="break"||s==="continue")&&l.tryLoc<=c&&c<=l.finallyLoc&&(l=null);var f=l?l.completion:{};return f.type=s,f.arg=c,l?(this.method="next",this.next=l.finallyLoc,w):this.complete(f)},complete:function(s,c){if(s.type==="throw")throw s.arg;return s.type==="break"||s.type==="continue"?this.next=s.arg:s.type==="return"?(this.rval=this.arg=s.arg,this.method="return",this.next="end"):s.type==="normal"&&c&&(this.next=c),w},finish:function(s){for(var c=this.tryEntries.length-1;c>=0;--c){var a=this.tryEntries[c];if(a.finallyLoc===s)return this.complete(a.completion,a.afterLoc),h(a),w}},catch:function(s){for(var c=this.tryEntries.length-1;c>=0;--c){var a=this.tryEntries[c];if(a.tryLoc===s){var e=a.completion;if(e.type==="throw"){var l=e.arg;h(a)}return l}}throw new Error("illegal catch attempt")},delegateYield:function(s,c,a){return this.delegate={iterator:O(s),resultName:c,nextLoc:a},this.method==="next"&&(this.arg=void 0),w}},I}var pe="\u3000\u3000";function Ee(I){var ae=["Bytes","KB","MB","GB","TB"];if(I==0)return"0 Byte";var Q=parseInt(""+Math.floor(Math.log(I)/Math.log(1024)),10);return(I/Math.pow(1024,Q)).toFixed(1)+" "+ae[Q]}z.b=function(I){var ae=I.value,Q=ae===void 0?[]:ae,A=I.onChange,te=I.className,T=I.maxSize,J=T===void 0?150:T,D=I.title,H=D===void 0?"\u6587\u4EF6\u4E0A\u4F20":D,B=I.accept,w=B===void 0?null:B,W={multiple:!1,fileList:Q,accept:w,withCredentials:!0,beforeUpload:function(P){var $=P.size/1024/1024;return $<J?!0:(ne.b.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(J,"MB),\u5EFA\u8BAE\u4E0A\u4F20\u5230\u767E\u5EA6\u4E91\u7B49\u5176\u5B83\u5171\u4EAB\u5DE5\u5177\u91CC\uFF0C\u7136\u540E\u518Dtxt\u6587\u6863\u91CC\u7ED9\u51FA\u94FE\u63A5\u4EE5\u53CA\u5171\u4EAB\u5BC6\u7801\u5E76\u4E0A\u4F20")),!1)},action:"".concat(C.a.API_SERVER,"/api/attachments.json"),onChange:function(P){var $=Object(d.a)(P.fileList);$=$.map(function(N){return N.name.indexOf(pe)===-1&&(N.name="".concat(N.name).concat(pe).concat(Ee(N.size))),Object(R.a)({},N)}),A($)},onRemove:function(){var j=Object(ce.a)(V().mark(function $(N){var Y,q;return V().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(Y=N.response?N.response.id:N.uid,!Y){r.next=8;break}return r.next=4,Object(U.d)(N.response?N.response.id:N.id);case 4:return q=r.sent,r.abrupt("return",q);case 8:return r.abrupt("return",!0);case 9:case"end":return r.stop()}},$)}));function P($){return j.apply(this,arguments)}return P}()};function oe(j){j.preventDefault(),j.stopPropagation()}return M.a.createElement("div",{className:"single-upload ".concat(te||"")},M.a.createElement(ue.a,W,M.a.createElement(ee.a,{type:"primary",title:Q.length>0?"\u6BCF\u6B21\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u8D44\u6E90\uFF0C \u5220\u9664\u4E0B\u9762\u8D44\u6E90\u53EF\u91CD\u65B0\u4E0A\u4F20 ":"",disabled:Q.length>0,ghost:!0},H),M.a.createElement("span",{onClick:oe,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",J,"M) ")))}}}]);