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