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__Forums__New.b031c079.asy...

16 lines
65 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[131,6],{"500L":function(je,Y,t){"use strict";t.d(Y,"a",function(){return fe});var Le=t("DZo9"),me=t("8z0m"),De=t("+L6B"),de=t("2/Rp"),Ee=t("2qtc"),M=t("kLXV"),d=t("9og8"),se=t("k1fw"),ie=t("oBTY"),R=t("miYZ"),S=t("tsqr"),C=t("tJVT"),ne=t("q1tI"),J=t.n(ne),Oe=t("m3rI"),Ue=t("wzkS"),k=t("y5JW");function y(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */y=function(){return N};var N={},q=Object.prototype,I=q.hasOwnProperty,ae=Object.defineProperty||function(n,e,r){n[e]=r.value},Q=typeof Symbol=="function"?Symbol:{},z=Q.iterator||"@@iterator",X=Q.asyncIterator||"@@asyncIterator",ue=Q.toStringTag||"@@toStringTag";function D(n,e,r){return Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),n[e]}try{D({},"")}catch(n){D=function(r,f,h){return r[f]=h}}function ye(n,e,r,f){var h=e&&e.prototype instanceof $?e:$,v=Object.create(h.prototype),B=new s(f||[]);return ae(v,"_invoke",{value:_(n,r,B)}),v}function w(n,e,r){try{return{type:"normal",arg:n.call(e,r)}}catch(f){return{type:"throw",arg:f}}}N.wrap=ye;var P={};function $(){}function x(){}function re(){}var le={};D(le,z,function(){return this});var U=Object.getPrototypeOf,L=U&&U(U(a([])));L&&L!==q&&I.call(L,z)&&(le=L);var u=re.prototype=$.prototype=Object.create(le);function o(n){["next","throw","return"].forEach(function(e){D(n,e,function(r){return this._invoke(e,r)})})}function l(n,e){function r(h,v,B,H){var W=w(n[h],n,v);if(W.type!=="throw"){var ve=W.arg,m=ve.value;return m&&typeof m=="object"&&I.call(m,"__await")?e.resolve(m.__await).then(function(c){r("next",c,B,H)},function(c){r("throw",c,B,H)}):e.resolve(m).then(function(c){ve.value=c,B(ve)},function(c){return r("throw",c,B,H)})}H(W.arg)}var f;ae(this,"_invoke",{value:function(v,B){function H(){return new e(function(W,ve){r(v,B,W,ve)})}return f=f?f.then(H,H):H()}})}function _(n,e,r){var f="suspendedStart";return function(h,v){if(f==="executing")throw new Error("Generator is already running");if(f==="completed"){if(h==="throw")throw v;return i()}for(r.method=h,r.arg=v;;){var B=r.delegate;if(B){var H=O(B,r);if(H){if(H===P)continue;return H}}if(r.method==="next")r.sent=r._sent=r.arg;else if(r.method==="throw"){if(f==="suspendedStart")throw f="completed",r.arg;r.dispatchException(r.arg)}else r.method==="return"&&r.abrupt("return",r.arg);f="executing";var W=w(n,e,r);if(W.type==="normal"){if(f=r.done?"completed":"suspendedYield",W.arg===P)continue;return{value:W.arg,done:r.done}}W.type==="throw"&&(f="completed",r.method="throw",r.arg=W.arg)}}}function O(n,e){var r=e.method,f=n.iterator[r];if(f===void 0)return e.delegate=null,r==="throw"&&n.iterator.return&&(e.method="return",e.arg=void 0,O(n,e),e.method==="throw")||r!=="return"&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),P;var h=w(f,n.iterator,e.arg);if(h.type==="throw")return e.method="throw",e.arg=h.arg,e.delegate=null,P;var v=h.arg;return v?v.done?(e[n.resultName]=v.value,e.next=n.nextLoc,e.method!=="return"&&(e.method="next",e.arg=void 0),e.delegate=null,P):v:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,P)}function g(n){var e={tryLoc:n[0]};1 in n&&(e.catchLoc=n[1]),2 in n&&(e.finallyLoc=n[2],e.afterLoc=n[3]),this.tryEntries.push(e)}function j(n){var e=n.completion||{};e.type="normal",delete e.arg,n.completion=e}function s(n){this.tryEntries=[{tryLoc:"root"}],n.forEach(g,this),this.reset(!0)}function a(n){if(n){var e=n[z];if(e)return e.call(n);if(typeof n.next=="function")return n;if(!isNaN(n.length)){var r=-1,f=function h(){for(;++r<n.length;)if(I.call(n,r))return h.value=n[r],h.done=!1,h;return h.value=void 0,h.done=!0,h};return f.next=f}}return{next:i}}function i(){return{value:void 0,done:!0}}return x.prototype=re,ae(u,"constructor",{value:re,configurable:!0}),ae(re,"constructor",{value:x,configurable:!0}),x.displayName=D(re,ue,"GeneratorFunction"),N.isGeneratorFunction=function(n){var e=typeof n=="function"&&n.constructor;return!!e&&(e===x||(e.displayName||e.name)==="GeneratorFunction")},N.mark=function(n){return Object.setPrototypeOf?Object.setPrototypeOf(n,re):(n.__proto__=re,D(n,ue,"GeneratorFunction")),n.prototype=Object.create(u),n},N.awrap=function(n){return{__await:n}},o(l.prototype),D(l.prototype,X,function(){return this}),N.AsyncIterator=l,N.async=function(n,e,r,f,h){h===void 0&&(h=Promise);var v=new l(ye(n,e,r,f),h);return N.isGeneratorFunction(e)?v:v.next().then(function(B){return B.done?B.value:v.next()})},o(u),D(u,ue,"Generator"),D(u,z,function(){return this}),D(u,"toString",function(){return"[object Generator]"}),N.keys=function(n){var e=Object(n),r=[];for(var f in e)r.push(f);return r.reverse(),function h(){for(;r.length;){var v=r.pop();if(v in e)return h.value=v,h.done=!1,h}return h.done=!0,h}},N.values=a,s.prototype={constructor:s,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(j),!e)for(var r in this)r.charAt(0)==="t"&&I.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=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 r=this;function f(ve,m){return B.type="throw",B.arg=e,r.next=ve,m&&(r.method="next",r.arg=void 0),!!m}for(var h=this.tryEntries.length-1;h>=0;--h){var v=this.tryEntries[h],B=v.completion;if(v.tryLoc==="root")return f("end");if(v.tryLoc<=this.prev){var H=I.call(v,"catchLoc"),W=I.call(v,"finallyLoc");if(H&&W){if(this.prev<v.catchLoc)return f(v.catchLoc,!0);if(this.prev<v.finallyLoc)return f(v.finallyLoc)}else if(H){if(this.prev<v.catchLoc)return f(v.catchLoc,!0)}else{if(!W)throw new Error("try statement without catch or finally");if(this.prev<v.finallyLoc)return f(v.finallyLoc)}}}},abrupt:function(e,r){for(var f=this.tryEntries.length-1;f>=0;--f){var h=this.tryEntries[f];if(h.tryLoc<=this.prev&&I.call(h,"finallyLoc")&&this.prev<h.finallyLoc){var v=h;break}}v&&(e==="break"||e==="continue")&&v.tryLoc<=r&&r<=v.finallyLoc&&(v=null);var B=v?v.completion:{};return B.type=e,B.arg=r,v?(this.method="next",this.next=v.finallyLoc,P):this.complete(B)},complete:function(e,r){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"&&r&&(this.next=r),P},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var f=this.tryEntries[r];if(f.finallyLoc===e)return this.complete(f.completion,f.afterLoc),j(f),P}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var f=this.tryEntries[r];if(f.tryLoc===e){var h=f.completion;if(h.type==="throw"){var v=h.arg;j(f)}return v}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,f){return this.delegate={iterator:a(e),resultName:r,nextLoc:f},this.method==="next"&&(this.arg=void 0),P}},N}function fe(N){var q=[];return N&&N.length>0&&(q=N.map(function(I){return{uid:I.id,id:I.id,name:I.title+k.c+I.filesize,url:I.url,filesize:I.filesize,status:"done",response:{id:I.id}}})),q}Y.b=function(N){var q=N.value,I=N.onChange,ae=N.className,Q=N.maxSize,z=Q===void 0?150:Q,X=N.title,ue=X===void 0?"\u4E0A\u4F20\u9644\u4EF6":X,D=N.showRemoveModal,ye=D===void 0?!1:D,w=N.accept,P=w===void 0?"":w,$=N.number,x=$===void 0?1e3:$,re=Object(ne.useState)(!1),le=Object(C.a)(re,2),U=le[0],L=le[1],u=Object(ne.useState)([]),o=Object(C.a)(u,2),l=o[0],_=o[1],O={multiple:!0,disabled:U,accept:P,withCredentials:!0,fileList:q,beforeUpload:function(s,a){var i=s.size/1024/1024;return l.concat(a).length>x?(S.b.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(x,"\u4E2A\u6587\u4EF6")),!1):i<z?!0:(S.b.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(z,"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(Oe.a.API_SERVER,"/api/attachments.json"),onChange:function(s){var a=Object(ie.a)(s.fileList);a.length>=x?L(!0):L(!1),_(Object(ie.a)(a)),a=a.map(function(i){var n;if(i==null||((n=i.response)===null||n===void 0)?void 0:n.id){var e;i.url="/api/attachments/".concat(i==null||((e=i.response)===null||e===void 0)?void 0:e.id)}return i.name.indexOf(k.c)===-1&&(i.name="".concat(i.name).concat(k.c).concat(Object(k.a)(i.size))),Object(se.a)({},i)}),console.log("info:",s),I(a)},onRemove:function(){var j=Object(d.a)(y().mark(function a(i){var n;return y().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(n=function(){var f=Object(d.a)(y().mark(function h(){var v,B;return y().wrap(function(W){for(;;)switch(W.prev=W.next){case 0:if(v=i.response?i.response.id:i.id,!v){W.next=8;break}return W.next=4,Object(Ue.d)(i.response?i.response.id:i.uid);case 4:return B=W.sent,W.abrupt("return",B);case 8:return W.abrupt("return",!0);case 9:case"end":return W.stop()}},h)}));return function(){return f.apply(this,arguments)}}(),!ye){r.next=5;break}return r.abrupt("return",new Promise(function(f,h){M.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:J.a.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:function(){var v=Object(d.a)(y().mark(function H(){var W;return y().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,n();case 2:W=m.sent,S.b.success("\u5220\u9664\u6210\u529F"),f(!0);case 5:case"end":return m.stop()}},H)}));function B(){return v.apply(this,arguments)}return B}(),onCancel:function(){return f(!1)}})}));case 5:return r.next=7,n();case 7:return r.abrupt("return",r.sent);case 8:case"end":return r.stop()}},a)}));function s(a){return j.apply(this,arguments)}return s}()};function g(j){j.preventDefault(),j.stopPropagation()}return J.a.createElement("div",{className:"multi-upload ".concat(ae||"")},J.a.createElement(me.a,O,J.a.createElement(de.a,{disabled:U,type:"primary",ghost:!0},ue),J.a.createElement("span",{onClick:g,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",z,"M) ")))}},"7/Dv":function(je,Y,t){je.exports={bg:"bg___2rJyo",flexRow:"flexRow___2xuIa",flexJustifyCenter:"flexJustifyCenter___Z3bJt",flexAlignEnd:"flexAlignEnd___v7Ww-",flexAlignCenter:"flexAlignCenter___223DA",flexColumn:"flexColumn___3CNqR",formWrap:"formWrap___2b6uL",titleWrap:"titleWrap___1CMQA",fieldWrap:"fieldWrap___2BRrD",mdWrap:"mdWrap___3UYzt",backgroundFa:"backgroundFa___32wpj",button:"button___MHDAn"}},"7ahc":function(je,Y,t){"use strict";t.d(Y,"a",function(){return q});var Le=t("k1fw"),me=t("0Owb"),De=t("+L6B"),de=t("2/Rp"),Ee=t("y8nQ"),M=t("Vl3Y"),d=t("tJVT"),se=t("OaEy"),ie=t("2fM7"),R=t("q1tI"),S=t.n(R),C=t("VrN/"),ne=t.n(C),J=t("p77/"),Oe=t.n(J),Ue=t("c5Ni"),k=t.n(Ue),y=ie.a.Option,fe={labelCol:{span:4},wrapperCol:{span:20}},N={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"]};Y.b=function(I){var ae=I.callback,Q=I.onCancel,z=Object(R.useState)("python"),X=Object(d.a)(z,2),ue=X[0],D=X[1];function ye(P){D(N[P][1])}function w(P){ae(P)}return S.a.createElement(M.a,Object(me.a)({},fe,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:w}),S.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},S.a.createElement(ie.a,{onChange:ye},Object.keys(N).map(function(P){return S.a.createElement(y,{key:P,value:P},N[P][0])}))),S.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},S.a.createElement(q,{mode:ue})),S.a.createElement("div",{className:"flex-container flex-end"},S.a.createElement(de.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),S.a.createElement(de.a,{type:"ghost",onClick:Q},"\u53D6\u6D88")))};function q(I){var ae=I.value,Q=I.onChange,z=I.mode,X=I.options,ue=X===void 0?{}:X,D=Object(R.useRef)(),ye=Object(R.useState)(),w=Object(d.a)(ye,2),P=w[0],$=w[1];return Object(R.useEffect)(function(){if(P){var x=function(le){var U=le.getValue();Q&&Q(U)};return P.on("change",x),function(){P.off("change",x)}}},[P,Q]),Object(R.useEffect)(function(){P&&P.setOption("mode",z)},[P,z]),Object(R.useEffect)(function(){P&&((ae!==P.getValue()||ae==="")&&setTimeout(function(){P.setValue(ae||" ")},300))},[P,ae]),Object(R.useEffect)(function(){if(D.current&&!P){var x=ne.a.fromTextArea(D.current,Object(Le.a)({mode:z,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},ue));$(x)}},[D.current,P]),S.a.createElement("div",{className:"my-codemirror-container"},S.a.createElement("textarea",{ref:D}))}},"9Bee":function(je,Y,t){"use strict";var Le=t("k1fw"),me=t("q1tI"),De=t.n(me),de=t("vg9a"),Ee=t("tJVT"),M=t("DlQD"),d=t.n(M),se=t("rUJ1");function ie(U,L){var u=U.match(/^(\s+)(?:```)/);if(u===null)return L;var o=u[1];return L.split(`
`).map(function(l){var _=l.match(/^\s+/);if(_===null)return l;var O=Object(Ee.a)(_,1),g=O[0];return g.length>=o.length?l.slice(o.length):l}).join(`
`)}var R=[],S=["<ul>"],C=new d.a.Renderer,ne=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function J(){R.length=0,S=["<ul>"]}var Oe={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function Ue(U,L,u,o){if(L>=U.length||U[L].level<=u)return L;var l=U[L];o.push("<li><a href='#"+l.anchor+"'>"+l.text+"</a>"),L++;var _=[];return L=Ue(U,L,l.level,_),_.length>0&&(o.push("<ul>"),_.forEach(function(O){o.push(O)}),o.push("</ul>")),o.push("</li>"),L=Ue(U,L,u,o),L}function k(){return Ue(R,0,0,S),S.push("</ul>"),S.join("")}var y={heading:function(L){var u=ne.exec(L);if(u)return{type:"heading",raw:u[0],depth:u[1].length,text:u[2]}},fences:function(L){var u=this.rules.block.fences.exec(L);if(u){var o=u[0],l=ie(o,u[3]||""),_=u[2]?u[2].trim():u[2];if(["latex","katex","math"].indexOf(_)>=0){var O=q(),g=l;l=O,I[O]={type:"block",expression:g}}return{type:"code",raw:o,lang:_,text:l}}}},fe=/(?:\${2})([^\n`]+?)(?:\${2})/gi,N=0,q=function(){return"__special_katext_id_".concat(N++,"__")},I={};function ae(){return I}function Q(){N=0,I={}}function z(U){return U=U.replace(fe,function(L,u){var o=q();return I[o]={type:"inline",expression:u},o}),U}var X=C.listitem;C.listitem=function(U){return X(z(U))};var ue=C.paragraph;C.paragraph=function(U){return ue(z(U))};var D=C.tablecell;C.tablecell=function(U,L){return D(z(U),L)},C.code=function(U,L,u){var o=(L||"").match(/\S*/)[0];return o?["latex","katex","math"].indexOf(o)>=0?"<p class='editormd-tex'>".concat(U,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(L,'">').concat(u?U:Object(se.escape)(U,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(u?U:Object(se.escape)(U,!0))+"</code></pre>"},C.heading=function(U,L,u){var o=this.options.headerPrefix+u.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return R.push({anchor:o,level:L,text:U}),"<h"+L+' id="'+o+'">'+U+"</h"+L+">"},d.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),d.a.use({tokenizer:y,renderer:C});var ye=d.a,w=t("SJMd"),P=t("m3rI"),$=t("Oy/b"),x=/<pre[^>]*>/g;function re(U){var L=document.createElement("div");return L.innerHTML=U,L.childNodes.length===0?"":L.childNodes[0].nodeValue}var le=Y.a=function(U){var L=U.value,u=L===void 0?"":L,o=U.className,l=U.showTextOnly,_=U.showLines,O=U.style,g=O===void 0?{}:O,j=String(u),s=Object(me.useMemo)(function(){try{var e=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,r=/\"\/api\/attachments\/|\"\/attachments\/download\//g,f=/\(\s+\/files\/uploads\/|\(\/files\/uploads\//g;j=j.replace(e,"("+P.a.API_SERVER+"/api/attachments/").replace(r,'"'+P.a.API_SERVER+"/api/attachments/").replace(f,'"'+P.a.API_SERVER+"/files/uploads/")}catch(H){}var h=ye(j);setTimeout(function(){return n()},300);var v=ae();if(j.match(/\[TOC\]/)&&(h=h.replace("<p>[TOC]</p>",k()),J()),h=h.replace(/(__special_katext_id_\d+__)/g,function(H,W){var ve=v[W],m=ve.type,c=ve.expression;return Object($.renderToString)(re(c)||"",{displayMode:m==="block",throwOnError:!1,output:"html"})}),h=h.replace(/▁/g,"\u2581\u2581\u2581"),Q(),l){var B=document.createElement("div");return B.innerHTML=h,B.innerText}return h},[j]),a=Object(me.useRef)();Oe.WebkitLineClamp=_,_&&(g=Object(Le.a)(Object(Le.a)({},g),Oe));function i(e){var r=e.target;if(r.tagName.toUpperCase()==="A"){var f=r.getAttribute("href");if(f.startsWith("#")){e.preventDefault();var h=document.getElementById(f.replace("#",""));h&&h.scrollIntoView(!0)}}}var n=function(){};return Object(me.useEffect)(function(){if(a.current&&s&&(s.match(x)&&window.PR.prettyPrint()),a.current)return a.current.addEventListener("click",i),function(){a.current.removeEventListener("click",i),Q(),J()}},[s,a.current,i]),De.a.createElement(De.a.Fragment,null,De.a.createElement("div",{ref:a,style:Object(Le.a)({},g),className:"".concat(o||""," markdown-body "),dangerouslySetInnerHTML:{__html:s}}))}},"9VGf":function(je,Y,t){"use strict";t.d(Y,"a",function(){return De});var Le=t("q1tI"),me=t.n(Le);function De(de,Ee){var M=Object(Le.useRef)();Object(Le.useEffect)(function(){M.current=de}),Object(Le.useEffect)(function(){function d(){M.current()}if(Ee!==null){var se=setInterval(d,Ee);return function(){return clearInterval(se)}}},[Ee])}},BjJ7:function(je,Y,t){"use strict";t.d(Y,"d",function(){return me}),t.d(Y,"c",function(){return De}),t.d(Y,"e",function(){return de}),t.d(Y,"b",function(){return Ee}),t.d(Y,"a",function(){return d});var Le=t("m3rI");function me(se){var ie=!0;if(se.length>0){for(var R=0;R<se.length;R++)if(se[R].compile_success==0||!se[R].compile_success){ie=!1;break}}else ie=!1;return ie}function De(se){for(var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",R=[],S=0;S<se.length;S++){var C=se[S],ne=ie?"".concat(ie,"/").concat(C.name):"".concat(C.name);R.push({title:C.name,isLeaf:!(C.type==="tree"),key:ne})}return R}function de(se,ie,R){for(var S=0;S<se.length;S++){var C=se[S];if(C.key===ie){C.children=R;break}C.children&&de(C.children,ie,R)}return se}function Ee(se,ie,R){var S;return function(){var C=this,ne=arguments,J=function(){S=null,R||se.apply(C,ne)},Oe=R&&!S;clearTimeout(S),S=setTimeout(J,ie),Oe&&se.apply(C,ne)}}var M=!0,d=Le.a.API_SERVER},"C+DQ":function(je,Y,t){},CKgm:function(je,Y,t){"use strict";t.r(Y);var Le=t("+L6B"),me=t("2/Rp"),De=t("5NDa"),de=t("5rEg"),Ee=t("sPJy"),M=t("bE4q"),d=t("miYZ"),se=t("tsqr"),ie=t("9og8"),R=t("k1fw"),S=t("y8nQ"),C=t("Vl3Y"),ne=t("tJVT"),J=t("PpiC"),Oe=t("OaEy"),Ue=t("2fM7"),k=t("q1tI"),y=t.n(k),fe=t("Ty5D"),N=t("9kvl"),q=t("55Ip"),I=t("Ot1p"),ae=t("500L"),Q=t("h+Ho"),z=t("7/Dv"),X=t.n(z);function ue(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ue=function(){return w};var w={},P=Object.prototype,$=P.hasOwnProperty,x=Object.defineProperty||function(m,c,E){m[c]=E.value},re=typeof Symbol=="function"?Symbol:{},le=re.iterator||"@@iterator",U=re.asyncIterator||"@@asyncIterator",L=re.toStringTag||"@@toStringTag";function u(m,c,E){return Object.defineProperty(m,c,{value:E,enumerable:!0,configurable:!0,writable:!0}),m[c]}try{u({},"")}catch(m){u=function(E,A,F){return E[A]=F}}function o(m,c,E,A){var F=c&&c.prototype instanceof O?c:O,T=Object.create(F.prototype),he=new H(A||[]);return x(T,"_invoke",{value:f(m,E,he)}),T}function l(m,c,E){try{return{type:"normal",arg:m.call(c,E)}}catch(A){return{type:"throw",arg:A}}}w.wrap=o;var _={};function O(){}function g(){}function j(){}var s={};u(s,le,function(){return this});var a=Object.getPrototypeOf,i=a&&a(a(W([])));i&&i!==P&&$.call(i,le)&&(s=i);var n=j.prototype=O.prototype=Object.create(s);function e(m){["next","throw","return"].forEach(function(c){u(m,c,function(E){return this._invoke(c,E)})})}function r(m,c){function E(F,T,he,Re){var Ce=l(m[F],m,T);if(Ce.type!=="throw"){var Se=Ce.arg,oe=Se.value;return oe&&typeof oe=="object"&&$.call(oe,"__await")?c.resolve(oe.__await).then(function(b){E("next",b,he,Re)},function(b){E("throw",b,he,Re)}):c.resolve(oe).then(function(b){Se.value=b,he(Se)},function(b){return E("throw",b,he,Re)})}Re(Ce.arg)}var A;x(this,"_invoke",{value:function(T,he){function Re(){return new c(function(Ce,Se){E(T,he,Ce,Se)})}return A=A?A.then(Re,Re):Re()}})}function f(m,c,E){var A="suspendedStart";return function(F,T){if(A==="executing")throw new Error("Generator is already running");if(A==="completed"){if(F==="throw")throw T;return ve()}for(E.method=F,E.arg=T;;){var he=E.delegate;if(he){var Re=h(he,E);if(Re){if(Re===_)continue;return Re}}if(E.method==="next")E.sent=E._sent=E.arg;else if(E.method==="throw"){if(A==="suspendedStart")throw A="completed",E.arg;E.dispatchException(E.arg)}else E.method==="return"&&E.abrupt("return",E.arg);A="executing";var Ce=l(m,c,E);if(Ce.type==="normal"){if(A=E.done?"completed":"suspendedYield",Ce.arg===_)continue;return{value:Ce.arg,done:E.done}}Ce.type==="throw"&&(A="completed",E.method="throw",E.arg=Ce.arg)}}}function h(m,c){var E=c.method,A=m.iterator[E];if(A===void 0)return c.delegate=null,E==="throw"&&m.iterator.return&&(c.method="return",c.arg=void 0,h(m,c),c.method==="throw")||E!=="return"&&(c.method="throw",c.arg=new TypeError("The iterator does not provide a '"+E+"' method")),_;var F=l(A,m.iterator,c.arg);if(F.type==="throw")return c.method="throw",c.arg=F.arg,c.delegate=null,_;var T=F.arg;return T?T.done?(c[m.resultName]=T.value,c.next=m.nextLoc,c.method!=="return"&&(c.method="next",c.arg=void 0),c.delegate=null,_):T:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,_)}function v(m){var c={tryLoc:m[0]};1 in m&&(c.catchLoc=m[1]),2 in m&&(c.finallyLoc=m[2],c.afterLoc=m[3]),this.tryEntries.push(c)}function B(m){var c=m.completion||{};c.type="normal",delete c.arg,m.completion=c}function H(m){this.tryEntries=[{tryLoc:"root"}],m.forEach(v,this),this.reset(!0)}function W(m){if(m){var c=m[le];if(c)return c.call(m);if(typeof m.next=="function")return m;if(!isNaN(m.length)){var E=-1,A=function F(){for(;++E<m.length;)if($.call(m,E))return F.value=m[E],F.done=!1,F;return F.value=void 0,F.done=!0,F};return A.next=A}}return{next:ve}}function ve(){return{value:void 0,done:!0}}return g.prototype=j,x(n,"constructor",{value:j,configurable:!0}),x(j,"constructor",{value:g,configurable:!0}),g.displayName=u(j,L,"GeneratorFunction"),w.isGeneratorFunction=function(m){var c=typeof m=="function"&&m.constructor;return!!c&&(c===g||(c.displayName||c.name)==="GeneratorFunction")},w.mark=function(m){return Object.setPrototypeOf?Object.setPrototypeOf(m,j):(m.__proto__=j,u(m,L,"GeneratorFunction")),m.prototype=Object.create(n),m},w.awrap=function(m){return{__await:m}},e(r.prototype),u(r.prototype,U,function(){return this}),w.AsyncIterator=r,w.async=function(m,c,E,A,F){F===void 0&&(F=Promise);var T=new r(o(m,c,E,A),F);return w.isGeneratorFunction(c)?T:T.next().then(function(he){return he.done?he.value:T.next()})},e(n),u(n,L,"Generator"),u(n,le,function(){return this}),u(n,"toString",function(){return"[object Generator]"}),w.keys=function(m){var c=Object(m),E=[];for(var A in c)E.push(A);return E.reverse(),function F(){for(;E.length;){var T=E.pop();if(T in c)return F.value=T,F.done=!1,F}return F.done=!0,F}},w.values=W,H.prototype={constructor:H,reset:function(c){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(B),!c)for(var E in this)E.charAt(0)==="t"&&$.call(this,E)&&!isNaN(+E.slice(1))&&(this[E]=void 0)},stop:function(){this.done=!0;var c=this.tryEntries[0].completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var E=this;function A(Se,oe){return he.type="throw",he.arg=c,E.next=Se,oe&&(E.method="next",E.arg=void 0),!!oe}for(var F=this.tryEntries.length-1;F>=0;--F){var T=this.tryEntries[F],he=T.completion;if(T.tryLoc==="root")return A("end");if(T.tryLoc<=this.prev){var Re=$.call(T,"catchLoc"),Ce=$.call(T,"finallyLoc");if(Re&&Ce){if(this.prev<T.catchLoc)return A(T.catchLoc,!0);if(this.prev<T.finallyLoc)return A(T.finallyLoc)}else if(Re){if(this.prev<T.catchLoc)return A(T.catchLoc,!0)}else{if(!Ce)throw new Error("try statement without catch or finally");if(this.prev<T.finallyLoc)return A(T.finallyLoc)}}}},abrupt:function(c,E){for(var A=this.tryEntries.length-1;A>=0;--A){var F=this.tryEntries[A];if(F.tryLoc<=this.prev&&$.call(F,"finallyLoc")&&this.prev<F.finallyLoc){var T=F;break}}T&&(c==="break"||c==="continue")&&T.tryLoc<=E&&E<=T.finallyLoc&&(T=null);var he=T?T.completion:{};return he.type=c,he.arg=E,T?(this.method="next",this.next=T.finallyLoc,_):this.complete(he)},complete:function(c,E){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&E&&(this.next=E),_},finish:function(c){for(var E=this.tryEntries.length-1;E>=0;--E){var A=this.tryEntries[E];if(A.finallyLoc===c)return this.complete(A.completion,A.afterLoc),B(A),_}},catch:function(c){for(var E=this.tryEntries.length-1;E>=0;--E){var A=this.tryEntries[E];if(A.tryLoc===c){var F=A.completion;if(F.type==="throw"){var T=F.arg;B(A)}return T}}throw new Error("illegal catch attempt")},delegateYield:function(c,E,A){return this.delegate={iterator:W(c),resultName:E,nextLoc:A},this.method==="next"&&(this.arg=void 0),_}},w}var D=Ue.a.Option,ye=function(P){var $,x,re,le=P.forumsDetail,U=P.globalSetting,L=P.loading,u=P.dispatch,o=Object(J.a)(P,["forumsDetail","globalSetting","loading","dispatch"]),l=Object(fe.m)(),_=C.a.useForm(),O=Object(ne.a)(_,1),g=O[0],j=Object(k.useState)({}),s=Object(ne.a)(j,2),a=s[0],i=s[1],n=Object(k.useState)(0),e=Object(ne.a)(n,2),r=e[0],f=e[1],h=Object(k.useState)(!1),v=Object(ne.a)(h,2),B=v[0],H=v[1],W=Object(k.useState)({}),ve=Object(ne.a)(W,2),m=ve[0],c=ve[1],E=Object(k.useState)(1),A=Object(ne.a)(E,2),F=A[0],T=A[1];Object(k.useEffect)(function(){if(he(),l.memoId)H(!0),Re();else{H(!1);var oe={forum_id:5};i(Object(R.a)({},oe)),g.setFieldsValue(Object(R.a)({},oe))}},[l.memoId]);var he=function(){var oe=Object(ie.a)(ue().mark(function b(){var ce;return ue().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(Q.f)({});case 2:ce=Z.sent,c(ce||{});case 4:case"end":return Z.stop()}},b)}));return function(){return oe.apply(this,arguments)}}(),Re=function(){var oe=Object(ie.a)(ue().mark(function b(){var ce,ee,Z;return ue().wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Object(Q.e)({id:l.memoId});case 2:if(te.t0=te.sent,te.t0){te.next=5;break}te.t0={};case 5:ee=te.t0,Z={subject:ee.subject,content:ee.content,attachments:Object(ae.a)(ee.attachments),forum_id:ee.forum_id,memo_tags:(ce=ee.memo_tags)===null||ce===void 0?void 0:ce.map(function(Ie){return Ie.id})},i(Object(R.a)({},Z)),g.setFieldsValue(Object(R.a)({},Z));case 9:case"end":return te.stop()}},b)}));return function(){return oe.apply(this,arguments)}}(),Ce=function(){var oe=Object(ie.a)(ue().mark(function b(ce){var ee,Z,be,te;return ue().wrap(function(ge){for(;;)switch(ge.prev=ge.next){case 0:if(be=Object(R.a)(Object(R.a)({id:B?l.memoId:null},a),{},{attachment_ids:(ee=a.attachments)===null||ee===void 0||((Z=ee.filter(function(Ne){var Ae;return(Ae=Ne.response)===null||Ae===void 0?void 0:Ae.id}))===null||Z===void 0)?void 0:Z.map(function(Ne){var Ae;return(Ae=Ne.response)===null||Ae===void 0?void 0:Ae.id}),tags:a.memo_tags}),!B){ge.next=7;break}return ge.next=4,Object(Q.n)(be);case 4:ge.t0=ge.sent,ge.next=10;break;case 7:return ge.next=9,Object(Q.j)(be);case 9:ge.t0=ge.sent;case 10:te=ge.t0,f(0),(te==null?void 0:te.status)===0&&(se.b.success(te==null?void 0:te.message),F===1?N.c.push("/forums/".concat(B?l==null?void 0:l.memoId:te==null?void 0:te.memo_id)):N.c.push("/forums/".concat(B?l==null?void 0:l.memoId:te==null?void 0:te.memo_id,"/edit")));case 13:case"end":return ge.stop()}},b)}));return function(ce){return oe.apply(this,arguments)}}(),Se=function(){document.body.scrollIntoView(),window.location.href.includes("new")?N.c.goBack():N.c.push("/forums/".concat(l.memoId))};return y.a.createElement("section",{className:X.a.bg},y.a.createElement("section",{className:"animated fadeIn mb10"},y.a.createElement("aside",{className:"mt10"},y.a.createElement(M.a,{separator:"/"},y.a.createElement(M.a.Item,null,y.a.createElement(q.Link,{to:"/forums"},"\u4EA4\u6D41\u95EE\u7B54")),y.a.createElement(M.a.Item,null,"\u8BE6\u60C5")))),y.a.createElement("aside",{className:"bg-white font16 pt20 pb20 pl20"},B?"\u7F16\u8F91\u8BDD\u9898":"\u53D1\u5E03\u8BDD\u9898"),y.a.createElement(C.a,{form:g,className:X.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(b,ce){console.log(ce,"values"),i(Object(R.a)(Object(R.a)({},a),b))},onFinish:Ce,onFinishFailed:function(){f(0)}},y.a.createElement("div",{className:X.a.fieldWrap},y.a.createElement(C.a.Item,{name:"subject",label:y.a.createElement("span",{className:"font16"},"\u8BDD\u9898\u540D\u79F0: "),rules:[{required:!0,message:"\u8BF7\u5148\u8F93\u5165\u8BDD\u9898\u540D\u79F0"}]},y.a.createElement(de.a,{maxLength:50,suffix:"".concat((($=a.subject)===null||$===void 0?void 0:$.length)||0,"/50")}))),y.a.createElement("div",{className:X.a.mdWrap},y.a.createElement(C.a.Item,{name:"content",label:y.a.createElement("span",{className:"font16"},"\u5185\u5BB9: "),rules:[{required:!0,message:"\u8BF7\u5148\u8F93\u5165\u8BDD\u9898\u5185\u5BB9"}]},y.a.createElement(I.a,{height:600,id:"forums-new-content",watch:!0,defaultValue:a.content})),y.a.createElement("div",null,y.a.createElement(C.a.Item,{name:"attachments",style:{width:350}},y.a.createElement(ae.b,{showRemoveModal:!0})))),y.a.createElement("div",{className:X.a.mdWrap},y.a.createElement(C.a.Item,{name:"forum_id",label:y.a.createElement("span",{className:"font16"},"\u8BDD\u9898\u7C7B\u578B: "),rules:[{required:!0,message:"\u8BF7\u5148\u9009\u62E9\u8BDD\u9898\u7C7B\u578B"}]},y.a.createElement(Ue.a,{style:{width:300}},m==null||((x=m.forums)===null||x===void 0)?void 0:x.map(function(oe){return y.a.createElement(D,{key:oe.id,value:oe.id},oe.name)})))),a.forum_id===5&&y.a.createElement("div",{className:X.a.mdWrap},y.a.createElement(C.a.Item,{name:"memo_tags",label:y.a.createElement("span",{className:"font16"},"\u6280\u672F\u6807\u7B7E: "),rules:[{required:!0,message:"\u8BF7\u5148\u9009\u62E9\u6280\u672F\u6807\u7B7E"}]},y.a.createElement(Ue.a,{style:{width:300},placeholder:"\u8BF7\u9009\u62E9\u6280\u672F\u6807\u7B7E",mode:"multiple",tokenSeparators:[";"],filterOption:function(b,ce){return ce.props.children.toLocaleLowerCase().indexOf(b.toLocaleLowerCase())!=-1}},m==null||((re=m.tag_list)===null||re===void 0)?void 0:re.map(function(oe){return y.a.createElement(D,{key:oe.id,value:oe.id},oe.name)})))),y.a.createElement("div",{className:X.a.backgroundFa},y.a.createElement("div",{className:"pt40 mb30"},y.a.createElement(C.a.Item,null,y.a.createElement(me.a,{size:"large",type:"primary",className:"".concat(X.a.button," mr20"),htmlType:"submit",loading:r===1,onClick:function(){T(1),f(1)}},"\u63D0\u4EA4"),y.a.createElement(me.a,{size:"large",type:"primary",className:"".concat(X.a.button," mr20"),htmlType:"submit",loading:r===2,onClick:function(){T(2),f(2)}},"\u4FDD\u5B58"),y.a.createElement(me.a,{size:"large",type:"primary",ghost:!0,className:"".concat(X.a.button," mr20"),onClick:Se},"\u53D6\u6D88"))))))};Y.default=Object(N.a)(function(w){var P=w.forumsDetail,$=w.loading,x=w.globalSetting;return{forumsDetail:P,globalSetting:x,loading:$.models.forumsDetail}})(ye)},HmJG:function(je,Y,t){},M8RZ:function(je,Y,t){"use strict";t.d(Y,"a",function(){return ie});var Le=t("fWQN"),me=t("mtLc"),De=t("yKVA"),de=t("879j"),Ee=t("q1tI"),M=t.n(Ee),d=t("i8i4"),se=t.n(d),ie=function(R){Object(De.a)(C,R);var S=Object(de.a)(C);function C(ne){var J;Object(Le.a)(this,C),J=S.call(this,ne);var Oe=window.document;return J.node=Oe.createElement("div"),Oe.body.appendChild(J.node),J}return Object(me.a)(C,[{key:"render",value:function(){var J=this.props.children;return Object(d.createPortal)(J,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),C}(M.a.Component)},Ot1p:function(je,Y,t){"use strict";var Le=t("2qtc"),me=t("kLXV"),De=t("rAM+"),de=t("tJVT"),Ee=t("jrin"),M=t("q1tI"),d=t.n(M),se=t("VrN/"),ie=t.n(se),R=t("bdgK"),S=t("p77/"),C=t("Bd2K"),ne=t("ELLl"),J=t("19Vz"),Oe=t("lZu9"),Ue=t("kSUc"),k=t("9Bee"),y=t("0Owb"),fe=t("dejd"),N=t("C+DQ"),q=[{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 I(b){var ce=b.onActionCallback,ee=b.title,Z=b.icon,be=b.actionName,te=b.className,Ie=te===void 0?"":te,ge=b.children;function Ne(){ce(be)}return d.a.createElement("a",{title:ee,className:Ie,onClick:Ne},d.a.createElement("i",{className:"md-iconfont ".concat(Z)}),ge)}var ae=function(b){var ce=b.watch,ee=b.showNullButton,Z=b.onActionCallback,be=b.fullScreen,te=b.insertTemp,Ie=[].concat(q,[{title:"".concat(ce?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(ce?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return d.a.createElement("ul",{className:"markdown-toolbar-container"},Ie.map(function(ge,Ne){return d.a.createElement("li",{key:Ne},ge.actionName?d.a.createElement(I,Object(y.a)({},ge,{onActionCallback:Z})):d.a.createElement("span",{className:"v-line"}))}),ee?d.a.createElement("li",null,d.a.createElement(I,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Z},d.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,te&&d.a.createElement("li",null,d.a.createElement(I,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(te),onActionCallback:Z},d.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),d.a.createElement("li",{className:"btn-full-screen"},d.a.createElement(I,{icon:"".concat(be?"icon-shrink":"icon-enlarge"),title:be?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Z})))},Q=t("M8RZ"),z=t("+L6B"),X=t("2/Rp"),ue=t("y8nQ"),D=t("Vl3Y"),ye=t("5NDa"),w=t("5rEg"),P={labelCol:{span:4},wrapperCol:{span:20}},$=function(b){var ce=b.callback,ee=b.onCancel;function Z(be){ce(be)}return d.a.createElement(D.a,Object(y.a)({},P,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Z}),d.a.createElement(D.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},d.a.createElement(w.a,null)),d.a.createElement(D.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},d.a.createElement(w.a,null)),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(X.a,{type:"ghost",onClick:ee},"\u53D6\u6D88")))},x=t("7ahc"),re=t("HmJG"),le=t("BjJ7"),U=D.a.useForm,L={width:280,marginRight:10},u={labelCol:{span:5},wrapperCol:{span:19}},o=function(b){var ce=b.callback,ee=b.onCancel,Z=U(),be=Object(de.a)(Z,1),te=be[0];function Ie(Ae){ce(Ae)}function ge(Ae){te.setFieldsValue({src:"/api/attachments/".concat(Ae.id)})}function Ne(Ae){var He=Ae.target.files[0];_(He,ge)}return d.a.createElement(D.a,Object(y.a)({form:te},u,{className:"upload-image-panel",onFinish:Ie}),d.a.createElement(D.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},d.a.createElement("div",{className:"flex-container"},d.a.createElement(D.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},d.a.createElement(w.a,{style:L})),d.a.createElement(l,{onFileChange:Ne}))),d.a.createElement(D.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u63CF\u8FF0"}]},d.a.createElement(w.a,{style:{width:264}})),d.a.createElement(D.a.Item,{style:{textAlign:"right"}},d.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(X.a,{type:"ghost",onClick:ee},"\u53D6\u6D88")))};function l(b){var ce=b.onFileChange;return d.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",d.a.createElement("input",{type:"file",accept:"image/*",onChange:ce}))}function _(b,ce){if(!b)throw new String("\u6CA1\u6709\u6587\u4EF6");var ee=new FormData;ee.append("editormd-image-file",b),ee.append("file_param_name","editormd-image-file"),ee.append("byxhr","true");var Z=new window.XMLHttpRequest;Z.withCredentials=!0,Z.addEventListener("load",function(be){ce(JSON.parse(be.target.responseText))},!1),Z.addEventListener("error",function(be){console.error(be)},!1),Z.open("POST","".concat(le.a,"/api/attachments.json")),Z.send(ee)}var O=t("giR+"),g=t("fyUT"),j=t("7Kak"),s=t("9yH6"),a=s.a.Group,i={margin:"0 8px"},n=function(b){var ce=b.callback,ee=b.onCancel;function Z(be){ce(be)}return d.a.createElement(D.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Z},d.a.createElement("div",{className:"flex-container"},d.a.createElement("span",{style:i},"\u5355\u5143\u683C\u6570\uFF1A"),d.a.createElement("span",{style:i},"\u884C\u6570"),d.a.createElement(D.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},d.a.createElement(g.a,null)),d.a.createElement("span",{style:i},"\u5217\u6570"),d.a.createElement(D.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},d.a.createElement(g.a,null))),d.a.createElement("div",{className:"flex-container",style:{marginTop:12}},d.a.createElement("span",{style:i},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),d.a.createElement(D.a.Item,{name:"align"},d.a.createElement(a,null,d.a.createElement(s.a,{value:"default"},d.a.createElement("i",{className:"fa fa-align-justify"})),d.a.createElement(s.a,{value:"left"},d.a.createElement("i",{className:"fa fa-align-left"})),d.a.createElement(s.a,{value:"center"},d.a.createElement("i",{className:"fa fa-align-center"})),d.a.createElement(s.a,{value:"right"},d.a.createElement("i",{className:"fa fa-align-right"}))))),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(X.a,{type:"ghost",onClick:ee},"\u53D6\u6D88")))},e="link",r="upload-image",f="code-block",h="add-table",v="------------",B={default:v,left:":".concat(v),center:":".concat(v,":"),right:"".concat(v,":")},H=t("9VGf"),W,ve;function m(){}var c=0,E=1e4,A="\u2581",F=`
**\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 T(b){return/^\d+$/.test(b)?"".concat(b,"px"):b}var he=navigator.platform.toUpperCase().indexOf("MAC")>=0,Re=he?"Cmd":"Ctrl",Ce=(W={},Object(Ee.a)(W,Re+"-B","bold"),Object(Ee.a)(W,Re+"-I","italic"),W),Se=(ve={},Object(Ee.a)(ve,e,"\u6DFB\u52A0\u94FE\u63A5"),Object(Ee.a)(ve,f,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(Ee.a)(ve,r,"\u6DFB\u52A0\u56FE\u7247"),Object(Ee.a)(ve,h,"\u6DFB\u52A0\u8868\u683C"),ve),oe=Y.a=function(b){var ce=b.defaultValue,ee=ce===void 0?"":ce,Z=b.onChange,be=b.width,te=be===void 0?"100%":be,Ie=b.height,ge=Ie===void 0?400:Ie,Ne=b.miniToolbar,Ae=Ne===void 0?!1:Ne,He=b.isFocus,tt=He===void 0?!1:He,rt=b.watch,St=b.insertTemp,ct=b.id,Ye=ct===void 0?"markdown-editor-id":ct,dt=b.showResizeBar,Nt=dt===void 0?!1:dt,mt=b.noStorage,It=mt===void 0?!1:mt,ft=b.showNullButton,Bt=ft===void 0?!1:ft,_t=b.fullScreen,Je=_t===void 0?!1:_t,nt=b.onBlur,at=b.onCMBeforeChange,ht=b.className,xt=ht===void 0?"":ht,pt=b.placeholder,Wt=pt===void 0?"":pt,Et=b.values,ot=Et===void 0?"":Et,Ft=Object(M.useState)(null),vt=Object(de.a)(Ft,2),p=vt[0],Kt=vt[1],kt=Object(M.useState)(ee),gt=Object(de.a)(kt,2),it=gt[0],Qe=gt[1],Gt=Object(M.useState)(rt),yt=Object(de.a)(Gt,2),Fe=yt[0],bt=yt[1],Vt=Object(M.useState)(Je),Ot=Object(de.a)(Vt,2),Ke=Ot[0],Pt=Ot[1],$t=Object(M.useState)(""),Lt=Object(de.a)($t,2),ke=Lt[0],Ge=Lt[1],Xt=Object(M.useState)(0),Rt=Object(de.a)(Xt,2),Ve=Rt[0],ut=Rt[1],zt=Object(M.useState)(ge),Dt=Object(de.a)(zt,2),lt=Dt[0],Ut=Dt[1],Ht=Object(M.useState)(!1),Ct=Object(de.a)(Ht,2),qt=Ct[0],st=Ct[1],$e=Object(M.useRef)(),Xe=Object(M.useRef)(),Ze=Object(M.useRef)(),qe=Object(M.useRef)();Object(M.useEffect)(function(){Qe(ot),p==null||p.setValue(ot)},[ot]),Object(M.useEffect)(function(){if($e.current){var V=function(_e,pe){var Pe=pe.clipboardData;if(Pe){var Me=Pe.types.toString(),Te=Pe.items;if(Me==="text/html,Files"||Me==="Files"||Pe.types.indexOf("Files")){var we,Be,We=Te[1];Me==="Files"&&(We=Te[0]),((we=We)===null||we===void 0?void 0:we.kind)==="file"&&((Be=We)===null||Be===void 0?void 0:Be.type.match(/^image\//i))&&_(We.getAsFile(),function(xe){xe.id?K.replaceSelection("![,](/api/attachments/".concat(xe.id,")")):(xe==null?void 0:xe.status)===401&&(document.location.href="/user/login")})}else return!0}return!0},K=ie.a.fromTextArea($e.current,{mode:"markdown",lineNumbers:!Ae,lineWrapping:!0,value:ee,autoCloseTags:!0,autoCloseBrackets:!0});return tt&&K.focus(),K.on("paste",V),Kt(K),function(){K.off("paste",V)}}},[]);var Mt=Object(M.useCallback)(function(){if(Xe.current)try{var V=Xe.current.getElementsByClassName("markdown-toolbar-container")[0].offsetHeight,K=Xe.current.getElementsByClassName("markdown-editor-body")[0];Ke?K.style.height="calc(100vh - ".concat(V,"px)"):K.style.height="".concat(lt-V,"px")}catch(G){console.log(G,"---- to set md editor body height")}},[lt,Xe,Ke]);Object(M.useEffect)(function(){function V(){var G=new R.default(function(_e){var pe=Object(De.a)(_e),Pe;try{for(pe.s();!(Pe=pe.n()).done;){var Me=Pe.value;(Me.target.offsetHeight>0||Me.target.offsetWidth>0)&&(Mt(),p.setSize("100%","100%"),p.refresh())}}catch(Te){pe.e(Te)}finally{pe.f()}});return G.observe($e.current.parentElement),G}if(p){var K=V();return function(){K.unobserve($e.current.parentElement)}}},[p,Mt]),Object(M.useEffect)(function(){if(p){for(var V=[],K=function(){var Me=_e[G];pe=Object(de.a)(Me,2);var Te=pe[0],we=pe[1],Be=Object(Ee.a)({},Te,function(){At(we)});V.push(Be),p.addKeyMap(Be)},G=0,_e=Object.entries(Ce);G<_e.length;G++){var pe;K()}return function(){for(var Pe=0,Me=V;Pe<Me.length;Pe++){var Te=Me[Pe];p.removeKeyMap(Te)}}}},[p]),Object(M.useEffect)(function(){Je!==Ke&&Pt(Je)},[Je]),Object(H.a)(function(){if(!It&&Ve>0){var V=new Date().getTime(),K=window.sessionStorage.getItem(Ye);V>=Ve+E&&(!K||K!==it)&&(window.sessionStorage.setItem(Ye,it),st(!0))}},E),Object(M.useEffect)(function(){bt(rt)},[p,rt]),Object(M.useEffect)(function(){p&&(tt&&p.focus())},[p,tt]),Object(M.useEffect)(function(){if(Fe&&p){var V=function(_e){var pe=_e.target;if(qe.current){var Pe=pe.scrollTop/pe.scrollHeight;qe.current.scrollTop=qe.current.scrollHeight*Pe}},K=p.getScrollerElement();return K.addEventListener("scroll",V),function(){K.removeEventListener("scroll",V)}}},[p,Fe]),Object(M.useEffect)(function(){if(p&&at){var V=function(G,_e){at(G,_e)};return p.on("beforeChange",V),function(){p.off("beforeChange",V)}}},[p,at]),Object(M.useEffect)(function(){if(p&&nt){var V=function(){nt(p.getValue())};return p.on("blur",V),function(){p.off("blur",V)}}},[p,nt]),Object(M.useEffect)(function(){if(p){var V=function(G){var _e=G.getValue();Qe(_e),ut(new Date().getTime()),G.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Z&&Z(_e)};return p.on("change",V),function(){p.off("change",V)}}},[p,Z]),Object(M.useEffect)(function(){p&&(ee==null?(p.setValue(""),Qe("")):ee!==p.getValue()&&(p.setValue(ee),Qe(ee),p.setCursor(p.lineCount(),0)))},[p,ee]);var At=Object(M.useCallback)(function(V){var K=p.getCursor(),G=p.getSelection(),_e=G.split(`
`);switch(V){case"bold":return p.replaceSelection("**"+G+"**"),G===""&&p.setCursor(K.line,K.ch+2),p.focus();case"italic":return p.replaceSelection("*"+G+"*"),G===""&&p.setCursor(K.line,K.ch+1),p.focus();case"code":return p.replaceSelection("`"+G+"`"),G===""&&p.setCursor(K.line,K.ch+1),p.focus();case"inline-latex":return p.replaceSelection("`$$"+G+"$$`"),G===""&&p.setCursor(K.line,K.ch+3),p.focus();case"latex":return p.replaceSelection("```latex\n"+G+"\n```"),p.setCursor(K.line+1,G.length+1),p.focus();case"line-break":return p.replaceSelection(`<br/>
`),p.focus();case"list-ul":return G===""?p.replaceSelection("- "+G):p.replaceSelection(_e.map(function(pe){return pe===""?"":"- ".concat(pe)}).join(`
`)),p.focus();case"list-ol":return G===""?p.replaceSelection("1. "+G):p.replaceSelection(_e.map(function(pe,Pe){return pe===""?"":"".concat(Pe+1,". ").concat(pe)}).join(`
`)),p.focus();case"add-null-ch":return G===""&&p.setCursor(K.line,K.ch+1),p.replaceSelection(A),p.focus();case"inster-template-1":return G===""&&p.setCursor(K.line,K.ch),p.replaceSelection(F),p.focus();case"eraser":return p.setValue(""),p.focus();case"trigger-watch":return bt(!Fe),p.focus();case"trigger-full-screen":return Pt(!Ke),p.focus();case e:Ge(e);return;case f:Ge(f);return;case r:Ge(r);return;case h:Ge(h);return;default:throw new Error}},[p,Fe,Ke]),et=Object(M.useCallback)(function(V){Ge("");switch(ke){case e:var K=V.title,G=V.link;return p.replaceSelection("[".concat(K,"](").concat(G,")")),p.focus();case f:var _e=V.language,pe=V.content;return p.replaceSelection(["```"+_e,pe,"```"].join(`
`)),p.focus();case r:var Pe=V.src,Me=V.alt;return p.replaceSelection("![ ".concat(Me," ]( ").concat(Pe,' "').concat(Me,'" )')),p.focus();case h:for(var Te=V.row,we=V.col,Be=V.align,We=`
`,xe=0;xe<Te;xe++){for(var jt=[],Tt=[],wt=0;wt<we;wt++)xe===1&&Tt.push(B[Be]),jt.push(" ");xe===1&&(We+="| ".concat(Tt.join(" | "),` |
`)),We+="| ".concat(jt.join(we===1?"":" | "),` |
`)}return p.replaceSelection(We+`
`),p.focus();default:throw new Error}},[p,ke]),Yt=Object(M.useMemo)(function(){switch(ke){case e:return d.a.createElement($,{callback:et,onCancel:ze});case f:return d.a.createElement(x.b,{callback:et,onCancel:ze});case r:return d.a.createElement(o,{callback:et,onCancel:ze});case h:return d.a.createElement(n,{callback:et,onCancel:ze});default:return null}},[ke]);function ze(){Ge("")}Object(M.useEffect)(function(){if(Ze.current){var V=function(Te){pe=!0,Pe=Te.pageY},K=function(){pe=!1},G=function(Te){if(pe){var we=Te.pageY-Pe;we<0&&(we=0),we>300&&(we=300);var Be=ge+we+"px";Ut(Be)}},_e=Ze.current,pe=!1,Pe=0;return _e.addEventListener("mousedown",V),document.addEventListener("mousemove",G),document.addEventListener("mouseup",K),function(){_e.removeEventListener("mousedown",V),document.removeEventListener("mousemove",G),document.removeEventListener("mouseup",K)}}},[p,Ze]),Object(M.useEffect)(function(){Ut(ge)},[ge]);var Jt=T(te),Qt=T(lt),Zt={width:Jt,height:Qt},er=Object(M.useMemo)(function(){if(Ve){var V=new Date(Ve),K=V.getHours(),G=V.getMinutes(),_e=V.getSeconds();return K=K<10?"0"+K:K,G=G<10?"0"+G:G,_e=_e<10?"0"+_e:_e,"".concat(K,":").concat(G,":").concat(_e)}return 0},[Ve]);function tr(){window.sessionStorage.removeItem(Ye),st(!1),ut(0)}function rr(){st(!1),ut(0),p.setValue(window.sessionStorage.getItem(Ye))}return d.a.createElement(M.Fragment,null,d.a.createElement("div",{className:"markdown-editor-wrapper",ref:Xe},d.a.createElement("div",{className:"markdown-editor-container ".concat(xt," ").concat(Fe?"on-preview":""," ").concat(Ae?"mini":""," ").concat(Ke?"full-screen":""),style:Zt},d.a.createElement(ae,{insertTemp:St,watch:Fe,fullScreen:Ke,showNullButton:Bt,onActionCallback:At}),d.a.createElement("div",{className:"markdown-editor-body"},d.a.createElement("div",{className:"codemirror-container"},d.a.createElement("textarea",{ref:$e,placeholder:Wt})),Fe?d.a.createElement("div",{ref:qe,className:"preview-container"},d.a.createElement(k.a,{value:it})):null))),Nt?d.a.createElement("a",{ref:Ze,className:"editor-resize"}):null,d.a.createElement(Q.a,null,Se[ke]?d.a.createElement(me.a,{centered:!0,title:Se[ke],visible:!0,onCancel:ze,footer:null},Yt):null))}},dejd:function(je,Y,t){},kSUc:function(je,Y,t){},wzkS:function(je,Y,t){"use strict";t.d(Y,"c",function(){return de}),t.d(Y,"b",function(){return Ee}),t.d(Y,"d",function(){return M}),t.d(Y,"a",function(){return se}),t.d(Y,"e",function(){return ie});var Le=t("9og8"),me=t("ErOA");function De(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */De=function(){return R};var R={},S=Object.prototype,C=S.hasOwnProperty,ne=Object.defineProperty||function(u,o,l){u[o]=l.value},J=typeof Symbol=="function"?Symbol:{},Oe=J.iterator||"@@iterator",Ue=J.asyncIterator||"@@asyncIterator",k=J.toStringTag||"@@toStringTag";function y(u,o,l){return Object.defineProperty(u,o,{value:l,enumerable:!0,configurable:!0,writable:!0}),u[o]}try{y({},"")}catch(u){y=function(l,_,O){return l[_]=O}}function fe(u,o,l,_){var O=o&&o.prototype instanceof I?o:I,g=Object.create(O.prototype),j=new le(_||[]);return ne(g,"_invoke",{value:P(u,l,j)}),g}function N(u,o,l){try{return{type:"normal",arg:u.call(o,l)}}catch(_){return{type:"throw",arg:_}}}R.wrap=fe;var q={};function I(){}function ae(){}function Q(){}var z={};y(z,Oe,function(){return this});var X=Object.getPrototypeOf,ue=X&&X(X(U([])));ue&&ue!==S&&C.call(ue,Oe)&&(z=ue);var D=Q.prototype=I.prototype=Object.create(z);function ye(u){["next","throw","return"].forEach(function(o){y(u,o,function(l){return this._invoke(o,l)})})}function w(u,o){function l(O,g,j,s){var a=N(u[O],u,g);if(a.type!=="throw"){var i=a.arg,n=i.value;return n&&typeof n=="object"&&C.call(n,"__await")?o.resolve(n.__await).then(function(e){l("next",e,j,s)},function(e){l("throw",e,j,s)}):o.resolve(n).then(function(e){i.value=e,j(i)},function(e){return l("throw",e,j,s)})}s(a.arg)}var _;ne(this,"_invoke",{value:function(g,j){function s(){return new o(function(a,i){l(g,j,a,i)})}return _=_?_.then(s,s):s()}})}function P(u,o,l){var _="suspendedStart";return function(O,g){if(_==="executing")throw new Error("Generator is already running");if(_==="completed"){if(O==="throw")throw g;return L()}for(l.method=O,l.arg=g;;){var j=l.delegate;if(j){var s=$(j,l);if(s){if(s===q)continue;return s}}if(l.method==="next")l.sent=l._sent=l.arg;else if(l.method==="throw"){if(_==="suspendedStart")throw _="completed",l.arg;l.dispatchException(l.arg)}else l.method==="return"&&l.abrupt("return",l.arg);_="executing";var a=N(u,o,l);if(a.type==="normal"){if(_=l.done?"completed":"suspendedYield",a.arg===q)continue;return{value:a.arg,done:l.done}}a.type==="throw"&&(_="completed",l.method="throw",l.arg=a.arg)}}}function $(u,o){var l=o.method,_=u.iterator[l];if(_===void 0)return o.delegate=null,l==="throw"&&u.iterator.return&&(o.method="return",o.arg=void 0,$(u,o),o.method==="throw")||l!=="return"&&(o.method="throw",o.arg=new TypeError("The iterator does not provide a '"+l+"' method")),q;var O=N(_,u.iterator,o.arg);if(O.type==="throw")return o.method="throw",o.arg=O.arg,o.delegate=null,q;var g=O.arg;return g?g.done?(o[u.resultName]=g.value,o.next=u.nextLoc,o.method!=="return"&&(o.method="next",o.arg=void 0),o.delegate=null,q):g:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,q)}function x(u){var o={tryLoc:u[0]};1 in u&&(o.catchLoc=u[1]),2 in u&&(o.finallyLoc=u[2],o.afterLoc=u[3]),this.tryEntries.push(o)}function re(u){var o=u.completion||{};o.type="normal",delete o.arg,u.completion=o}function le(u){this.tryEntries=[{tryLoc:"root"}],u.forEach(x,this),this.reset(!0)}function U(u){if(u){var o=u[Oe];if(o)return o.call(u);if(typeof u.next=="function")return u;if(!isNaN(u.length)){var l=-1,_=function O(){for(;++l<u.length;)if(C.call(u,l))return O.value=u[l],O.done=!1,O;return O.value=void 0,O.done=!0,O};return _.next=_}}return{next:L}}function L(){return{value:void 0,done:!0}}return ae.prototype=Q,ne(D,"constructor",{value:Q,configurable:!0}),ne(Q,"constructor",{value:ae,configurable:!0}),ae.displayName=y(Q,k,"GeneratorFunction"),R.isGeneratorFunction=function(u){var o=typeof u=="function"&&u.constructor;return!!o&&(o===ae||(o.displayName||o.name)==="GeneratorFunction")},R.mark=function(u){return Object.setPrototypeOf?Object.setPrototypeOf(u,Q):(u.__proto__=Q,y(u,k,"GeneratorFunction")),u.prototype=Object.create(D),u},R.awrap=function(u){return{__await:u}},ye(w.prototype),y(w.prototype,Ue,function(){return this}),R.AsyncIterator=w,R.async=function(u,o,l,_,O){O===void 0&&(O=Promise);var g=new w(fe(u,o,l,_),O);return R.isGeneratorFunction(o)?g:g.next().then(function(j){return j.done?j.value:g.next()})},ye(D),y(D,k,"Generator"),y(D,Oe,function(){return this}),y(D,"toString",function(){return"[object Generator]"}),R.keys=function(u){var o=Object(u),l=[];for(var _ in o)l.push(_);return l.reverse(),function O(){for(;l.length;){var g=l.pop();if(g in o)return O.value=g,O.done=!1,O}return O.done=!0,O}},R.values=U,le.prototype={constructor:le,reset:function(o){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(re),!o)for(var l in this)l.charAt(0)==="t"&&C.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=void 0)},stop:function(){this.done=!0;var o=this.tryEntries[0].completion;if(o.type==="throw")throw o.arg;return this.rval},dispatchException:function(o){if(this.done)throw o;var l=this;function _(i,n){return j.type="throw",j.arg=o,l.next=i,n&&(l.method="next",l.arg=void 0),!!n}for(var O=this.tryEntries.length-1;O>=0;--O){var g=this.tryEntries[O],j=g.completion;if(g.tryLoc==="root")return _("end");if(g.tryLoc<=this.prev){var s=C.call(g,"catchLoc"),a=C.call(g,"finallyLoc");if(s&&a){if(this.prev<g.catchLoc)return _(g.catchLoc,!0);if(this.prev<g.finallyLoc)return _(g.finallyLoc)}else if(s){if(this.prev<g.catchLoc)return _(g.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<g.finallyLoc)return _(g.finallyLoc)}}}},abrupt:function(o,l){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc<=this.prev&&C.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var g=O;break}}g&&(o==="break"||o==="continue")&&g.tryLoc<=l&&l<=g.finallyLoc&&(g=null);var j=g?g.completion:{};return j.type=o,j.arg=l,g?(this.method="next",this.next=g.finallyLoc,q):this.complete(j)},complete:function(o,l){if(o.type==="throw")throw o.arg;return o.type==="break"||o.type==="continue"?this.next=o.arg:o.type==="return"?(this.rval=this.arg=o.arg,this.method="return",this.next="end"):o.type==="normal"&&l&&(this.next=l),q},finish:function(o){for(var l=this.tryEntries.length-1;l>=0;--l){var _=this.tryEntries[l];if(_.finallyLoc===o)return this.complete(_.completion,_.afterLoc),re(_),q}},catch:function(o){for(var l=this.tryEntries.length-1;l>=0;--l){var _=this.tryEntries[l];if(_.tryLoc===o){var O=_.completion;if(O.type==="throw"){var g=O.arg;re(_)}return g}}throw new Error("illegal catch attempt")},delegateYield:function(o,l,_){return this.delegate={iterator:U(o),resultName:l,nextLoc:_},this.method==="next"&&(this.arg=void 0),q}},R}function de(R){return Object(me.c)("libraries/".concat(R,".json"))}function Ee(){return Object(me.c)("library_tags.json")}function M(R){return d.apply(this,arguments)}function d(){return d=Object(Le.a)(De().mark(function R(S){var C;return De().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,Object(me.b)("attachments/".concat(S,".json"));case 2:return C=J.sent,J.abrupt("return",C.status===0);case 4:case"end":return J.stop()}},R)})),d.apply(this,arguments)}function se(R){return Object(me.f)("libraries.json",R)}function ie(R,S){return Object(me.g)("libraries/".concat(R,".json"),S)}},y5JW:function(je,Y,t){"use strict";t.d(Y,"c",function(){return Oe}),t.d(Y,"a",function(){return Ue});var Le=t("DZo9"),me=t("8z0m"),De=t("+L6B"),de=t("2/Rp"),Ee=t("9og8"),M=t("k1fw"),d=t("oBTY"),se=t("miYZ"),ie=t("tsqr"),R=t("q1tI"),S=t.n(R),C=t("m3rI"),ne=t("wzkS");function J(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */J=function(){return k};var k={},y=Object.prototype,fe=y.hasOwnProperty,N=Object.defineProperty||function(s,a,i){s[a]=i.value},q=typeof Symbol=="function"?Symbol:{},I=q.iterator||"@@iterator",ae=q.asyncIterator||"@@asyncIterator",Q=q.toStringTag||"@@toStringTag";function z(s,a,i){return Object.defineProperty(s,a,{value:i,enumerable:!0,configurable:!0,writable:!0}),s[a]}try{z({},"")}catch(s){z=function(i,n,e){return i[n]=e}}function X(s,a,i,n){var e=a&&a.prototype instanceof ye?a:ye,r=Object.create(e.prototype),f=new O(n||[]);return N(r,"_invoke",{value:u(s,i,f)}),r}function ue(s,a,i){try{return{type:"normal",arg:s.call(a,i)}}catch(n){return{type:"throw",arg:n}}}k.wrap=X;var D={};function ye(){}function w(){}function P(){}var $={};z($,I,function(){return this});var x=Object.getPrototypeOf,re=x&&x(x(g([])));re&&re!==y&&fe.call(re,I)&&($=re);var le=P.prototype=ye.prototype=Object.create($);function U(s){["next","throw","return"].forEach(function(a){z(s,a,function(i){return this._invoke(a,i)})})}function L(s,a){function i(e,r,f,h){var v=ue(s[e],s,r);if(v.type!=="throw"){var B=v.arg,H=B.value;return H&&typeof H=="object"&&fe.call(H,"__await")?a.resolve(H.__await).then(function(W){i("next",W,f,h)},function(W){i("throw",W,f,h)}):a.resolve(H).then(function(W){B.value=W,f(B)},function(W){return i("throw",W,f,h)})}h(v.arg)}var n;N(this,"_invoke",{value:function(r,f){function h(){return new a(function(v,B){i(r,f,v,B)})}return n=n?n.then(h,h):h()}})}function u(s,a,i){var n="suspendedStart";return function(e,r){if(n==="executing")throw new Error("Generator is already running");if(n==="completed"){if(e==="throw")throw r;return j()}for(i.method=e,i.arg=r;;){var f=i.delegate;if(f){var h=o(f,i);if(h){if(h===D)continue;return h}}if(i.method==="next")i.sent=i._sent=i.arg;else if(i.method==="throw"){if(n==="suspendedStart")throw n="completed",i.arg;i.dispatchException(i.arg)}else i.method==="return"&&i.abrupt("return",i.arg);n="executing";var v=ue(s,a,i);if(v.type==="normal"){if(n=i.done?"completed":"suspendedYield",v.arg===D)continue;return{value:v.arg,done:i.done}}v.type==="throw"&&(n="completed",i.method="throw",i.arg=v.arg)}}}function o(s,a){var i=a.method,n=s.iterator[i];if(n===void 0)return a.delegate=null,i==="throw"&&s.iterator.return&&(a.method="return",a.arg=void 0,o(s,a),a.method==="throw")||i!=="return"&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),D;var e=ue(n,s.iterator,a.arg);if(e.type==="throw")return a.method="throw",a.arg=e.arg,a.delegate=null,D;var r=e.arg;return r?r.done?(a[s.resultName]=r.value,a.next=s.nextLoc,a.method!=="return"&&(a.method="next",a.arg=void 0),a.delegate=null,D):r:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,D)}function l(s){var a={tryLoc:s[0]};1 in s&&(a.catchLoc=s[1]),2 in s&&(a.finallyLoc=s[2],a.afterLoc=s[3]),this.tryEntries.push(a)}function _(s){var a=s.completion||{};a.type="normal",delete a.arg,s.completion=a}function O(s){this.tryEntries=[{tryLoc:"root"}],s.forEach(l,this),this.reset(!0)}function g(s){if(s){var a=s[I];if(a)return a.call(s);if(typeof s.next=="function")return s;if(!isNaN(s.length)){var i=-1,n=function e(){for(;++i<s.length;)if(fe.call(s,i))return e.value=s[i],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:j}}function j(){return{value:void 0,done:!0}}return w.prototype=P,N(le,"constructor",{value:P,configurable:!0}),N(P,"constructor",{value:w,configurable:!0}),w.displayName=z(P,Q,"GeneratorFunction"),k.isGeneratorFunction=function(s){var a=typeof s=="function"&&s.constructor;return!!a&&(a===w||(a.displayName||a.name)==="GeneratorFunction")},k.mark=function(s){return Object.setPrototypeOf?Object.setPrototypeOf(s,P):(s.__proto__=P,z(s,Q,"GeneratorFunction")),s.prototype=Object.create(le),s},k.awrap=function(s){return{__await:s}},U(L.prototype),z(L.prototype,ae,function(){return this}),k.AsyncIterator=L,k.async=function(s,a,i,n,e){e===void 0&&(e=Promise);var r=new L(X(s,a,i,n),e);return k.isGeneratorFunction(a)?r:r.next().then(function(f){return f.done?f.value:r.next()})},U(le),z(le,Q,"Generator"),z(le,I,function(){return this}),z(le,"toString",function(){return"[object Generator]"}),k.keys=function(s){var a=Object(s),i=[];for(var n in a)i.push(n);return i.reverse(),function e(){for(;i.length;){var r=i.pop();if(r in a)return e.value=r,e.done=!1,e}return e.done=!0,e}},k.values=g,O.prototype={constructor:O,reset:function(a){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)for(var i in this)i.charAt(0)==="t"&&fe.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=void 0)},stop:function(){this.done=!0;var a=this.tryEntries[0].completion;if(a.type==="throw")throw a.arg;return this.rval},dispatchException:function(a){if(this.done)throw a;var i=this;function n(B,H){return f.type="throw",f.arg=a,i.next=B,H&&(i.method="next",i.arg=void 0),!!H}for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e],f=r.completion;if(r.tryLoc==="root")return n("end");if(r.tryLoc<=this.prev){var h=fe.call(r,"catchLoc"),v=fe.call(r,"finallyLoc");if(h&&v){if(this.prev<r.catchLoc)return n(r.catchLoc,!0);if(this.prev<r.finallyLoc)return n(r.finallyLoc)}else if(h){if(this.prev<r.catchLoc)return n(r.catchLoc,!0)}else{if(!v)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return n(r.finallyLoc)}}}},abrupt:function(a,i){for(var n=this.tryEntries.length-1;n>=0;--n){var e=this.tryEntries[n];if(e.tryLoc<=this.prev&&fe.call(e,"finallyLoc")&&this.prev<e.finallyLoc){var r=e;break}}r&&(a==="break"||a==="continue")&&r.tryLoc<=i&&i<=r.finallyLoc&&(r=null);var f=r?r.completion:{};return f.type=a,f.arg=i,r?(this.method="next",this.next=r.finallyLoc,D):this.complete(f)},complete:function(a,i){if(a.type==="throw")throw a.arg;return a.type==="break"||a.type==="continue"?this.next=a.arg:a.type==="return"?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):a.type==="normal"&&i&&(this.next=i),D},finish:function(a){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.finallyLoc===a)return this.complete(n.completion,n.afterLoc),_(n),D}},catch:function(a){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc===a){var e=n.completion;if(e.type==="throw"){var r=e.arg;_(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(a,i,n){return this.delegate={iterator:g(a),resultName:i,nextLoc:n},this.method==="next"&&(this.arg=void 0),D}},k}var Oe="\u3000\u3000";function Ue(k){var y=["Bytes","KB","MB","GB","TB"];if(k==0)return"0 Byte";var fe=parseInt(""+Math.floor(Math.log(k)/Math.log(1024)),10);return(k/Math.pow(1024,fe)).toFixed(1)+" "+y[fe]}Y.b=function(k){var y=k.value,fe=y===void 0?[]:y,N=k.onChange,q=k.className,I=k.maxSize,ae=I===void 0?150:I,Q=k.title,z=Q===void 0?"\u6587\u4EF6\u4E0A\u4F20":Q,X=k.accept,ue=X===void 0?null:X,D={multiple:!1,fileList:fe,accept:ue,withCredentials:!0,beforeUpload:function(P){var $=P.size/1024/1024;return $<ae?!0:(ie.b.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(ae,"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(x){return x.name.indexOf(Oe)===-1&&(x.name="".concat(x.name).concat(Oe).concat(Ue(x.size))),Object(M.a)({},x)}),N($)},onRemove:function(){var w=Object(Ee.a)(J().mark(function $(x){var re,le;return J().wrap(function(L){for(;;)switch(L.prev=L.next){case 0:if(re=x.response?x.response.id:x.uid,!re){L.next=8;break}return L.next=4,Object(ne.d)(x.response?x.response.id:x.id);case 4:return le=L.sent,L.abrupt("return",le);case 8:return L.abrupt("return",!0);case 9:case"end":return L.stop()}},$)}));function P($){return w.apply(this,arguments)}return P}()};function ye(w){w.preventDefault(),w.stopPropagation()}return S.a.createElement("div",{className:"single-upload ".concat(q||"")},S.a.createElement(me.a,D,S.a.createElement(de.a,{type:"primary",title:fe.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:fe.length>0,ghost:!0},z),S.a.createElement("span",{onClick:ye,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",ae,"M) ")))}}}]);