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.
1 line
64 KiB
1 line
64 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[117,6],{"500L":function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));n("DZo9");var r=n("8z0m"),a=(n("+L6B"),n("2/Rp")),o=(n("2qtc"),n("kLXV")),i=n("9og8"),c=n("k1fw"),l=n("oBTY"),u=(n("miYZ"),n("tsqr")),s=n("tJVT"),f=n("q1tI"),h=n.n(f),p=n("m3rI"),m=n("wzkS"),d=n("y5JW");function v(){v=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(S){l=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new k(a||[]);return r(i,"_invoke",{value:j(e,n,c)}),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(S){return{type:"throw",arg:S}}}e.wrap=u;var f={};function h(){}function p(){}function m(){}var d={};l(d,o,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g(_([])));y&&y!==t&&n.call(y,o)&&(d=y);var b=m.prototype=h.prototype=Object.create(d);function w(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function a(r,o,i,c){var l=s(e[r],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){a("next",e,i,c)}),(function(e){a("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return a("throw",e,i,c)}))}c(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){a(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function j(e,t,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return N()}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var c=O(i,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function O(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,O(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var a=s(r,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,f;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function _(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:N}}function N(){return{value:void 0,done:!0}}return p.prototype=m,r(b,"constructor",{value:m,configurable:!0}),r(m,"constructor",{value:p,configurable:!0}),p.displayName=l(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,l(e,c,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},w(E.prototype),l(E.prototype,i,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,o){void 0===o&&(o=Promise);var i=new E(u(t,n,r,a),o);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},w(b),l(b,c,"Generator"),l(b,o,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=_,k.prototype={constructor:k,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(L),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),L(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;L(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:_(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function g(e){var t=[];return e&&e.length>0&&(t=e.map((function(e){return{uid:e.id,id:e.id,name:e.title+d["c"]+e.filesize,url:e.url,filesize:e.filesize,status:"done",response:{id:e.id}}}))),t}t["b"]=function(e){var t=e.value,n=e.onChange,g=e.className,y=e.maxSize,b=void 0===y?300:y,w=e.title,E=void 0===w?"\u4e0a\u4f20\u9644\u4ef6":w,j=e.showRemoveModal,O=void 0!==j&&j,x=e.accept,L=void 0===x?"":x,k=e.number,_=void 0===k?1e3:k,N=Object(f["useState"])(!1),S=Object(s["a"])(N,2),C=S[0],I=S[1],T=Object(f["useState"])([]),P=Object(s["a"])(T,2),R=P[0],F=P[1],V={multiple:!0,disabled:C,accept:L,withCredentials:!0,fileList:t,beforeUpload:function(e,t){var n=e.size/1024/1024;return R.concat(t).length>_?(u["b"].error("\u6700\u591a\u53ea\u80fd\u4e0a\u4f20".concat(_,"\u4e2a\u6587\u4ef6")),!1):n<b||(u["b"].error("\u8be5\u6587\u4ef6\u65e0\u6cd5\u4e0a\u4f20\u3002\u8d85\u8fc7\u6587\u4ef6\u5927\u5c0f\u9650\u5236(".concat(b,"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)},data:function(e){return e.newfilename=encodeURIComponent(e.name),e},action:"".concat(p["a"].API_SERVER,"/api/attachments.json"),onChange:function(e){var t=Object(l["a"])(e.fileList);t.length>=_?I(!0):I(!1),F(Object(l["a"])(t)),t=t.map((function(e){var t,n;(null===e||void 0===e||null===(t=e.response)||void 0===t?void 0:t.id)&&(e.url="/api/attachments/".concat(null===e||void 0===e||null===(n=e.response)||void 0===n?void 0:n.id));return-1===e.name.indexOf(d["c"])&&(e.name="".concat(e.name).concat(d["c"]).concat(Object(d["a"])(e.size))),Object(c["a"])({},e)})),console.log("info:",e),n(t)},onRemove:function(){var e=Object(i["a"])(v().mark((function e(t){var n;return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=function(){var e=Object(i["a"])(v().mark((function e(){var n,r;return v().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=t.response?t.response.id:t.id,!n){e.next=8;break}return e.next=4,Object(m["d"])(t.response?t.response.id:t.uid);case 4:return r=e.sent,e.abrupt("return",r);case 8:return e.abrupt("return",!0);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),!O){e.next=5;break}return e.abrupt("return",new Promise((function(e,t){o["a"].confirm({centered:!0,width:530,okText:"\u786e\u5b9a",cancelText:"\u53d6\u6d88",title:"\u63d0\u793a",content:h.a.createElement("div",{className:"tc font16"},"\u662f\u5426\u786e\u8ba4\u5220\u9664?"),onOk:function(){var t=Object(i["a"])(v().mark((function t(){return v().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,n();case 2:t.sent,u["b"].success("\u5220\u9664\u6210\u529f"),e(!0);case 5:case"end":return t.stop()}}),t)})));function r(){return t.apply(this,arguments)}return r}(),onCancel:function(){return e(!1)}})})));case 5:return e.next=7,n();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e)})));function t(t){return e.apply(this,arguments)}return t}()};function A(e){e.preventDefault(),e.stopPropagation()}return h.a.createElement("div",{className:"multi-upload ".concat(g||"")},h.a.createElement(r["a"],V,h.a.createElement(a["a"],{disabled:C,type:"primary",ghost:!0},E),h.a.createElement("span",{onClick:A,style:{marginLeft:10}},"(\u5355\u4e2a\u6587\u4ef6\u6700\u5927",b,"M) ")))}},"7/Dv":function(e,t,n){e.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(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var r=n("k1fw"),a=n("0Owb"),o=(n("+L6B"),n("2/Rp")),i=(n("y8nQ"),n("Vl3Y")),c=n("tJVT"),l=(n("OaEy"),n("2fM7")),u=n("q1tI"),s=n.n(u),f=n("VrN/"),h=n.n(f),p=(n("p77/"),n("c5Ni"),l["a"].Option),m={labelCol:{span:4},wrapperCol:{span:20}},d={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"]};function v(e){var t=e.value,n=e.onChange,a=e.mode,o=e.options,i=void 0===o?{}:o,l=Object(u["useRef"])(),f=Object(u["useState"])(),p=Object(c["a"])(f,2),m=p[0],d=p[1];return Object(u["useEffect"])((function(){if(m){var e=function(e){var t=e.getValue();n&&n(t)};return m.on("change",e),function(){m.off("change",e)}}}),[m,n]),Object(u["useEffect"])((function(){m&&m.setOption("mode",a)}),[m,a]),Object(u["useEffect"])((function(){m&&(t===m.getValue()&&""!==t||setTimeout((function(){m.setValue(t||" ")}),300))}),[m,t]),Object(u["useEffect"])((function(){if(l.current&&!m){var e=h.a.fromTextArea(l.current,Object(r["a"])({mode:a,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},i));d(e)}}),[l.current,m]),s.a.createElement("div",{className:"my-codemirror-container"},s.a.createElement("textarea",{ref:l}))}t["b"]=function(e){var t=e.callback,n=e.onCancel,r=Object(u["useState"])("python"),f=Object(c["a"])(r,2),h=f[0],g=f[1];function y(e){g(d[e][1])}function b(e){t(e)}return s.a.createElement(i["a"],Object(a["a"])({},m,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:b}),s.a.createElement(i["a"].Item,{label:"\u4ee3\u7801\u8bed\u8a00",name:"language"},s.a.createElement(l["a"],{onChange:y},Object.keys(d).map((function(e){return s.a.createElement(p,{key:e,value:e},d[e][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(v,{mode:h})),s.a.createElement("div",{className:"flex-container flex-end"},s.a.createElement(o["a"],{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786e\u5b9a"),s.a.createElement(o["a"],{type:"ghost",onClick:n},"\u53d6\u6d88")))}},"9Bee":function(e,t,n){"use strict";var r=n("q1tI"),a=n.n(r),o=(n("vg9a"),n("tJVT")),i=n("DlQD"),c=n.n(i),l=n("rUJ1");function u(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var r=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);if(null===t)return e;var n=Object(o["a"])(t,1),a=n[0];return a.length>=r.length?e.slice(r.length):e})).join("\n")}var s=[],f=["<ul>"],h=new c.a.Renderer,p=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function m(){s.length=0,f=["<ul>"]}function d(e,t,n,r){if(t>=e.length||e[t].level<=n)return t;var a=e[t];r.push("<li><a href='#"+a.anchor+"'>"+a.text+"</a>"),t++;var o=[];return t=d(e,t,a.level,o),o.length>0&&(r.push("<ul>"),o.forEach((function(e){r.push(e)})),r.push("</ul>")),r.push("</li>"),t=d(e,t,n,r),t}function v(){return d(s,0,0,f),f.push("</ul>"),f.join("")}var g={heading:function(e){var t=p.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}},fences:function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],r=u(n,t[3]||""),a=t[2]?t[2].trim():t[2];if(["latex","katex","math"].indexOf(a)>=0){var o=w(),i=r;r=o,E[o]={type:"block",expression:i}}return{type:"code",raw:n,lang:a,text:r}}}},y=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,w=function(){return"__special_katext_id_".concat(b++,"__")},E={};function j(){return E}function O(){b=0,E={}}function x(e){return e=e.replace(y,(function(e,t){var n=w();return E[n]={type:"inline",expression:t},n})),e}var L=h.listitem;h.listitem=function(e){return L(x(e))};var k=h.paragraph;h.paragraph=function(e){return k(x(e))};var _=h.tablecell;h.tablecell=function(e,t){return _(x(e),t)},h.code=function(e,t,n){var r=(t||"").match(/\S*/)[0];return r?["latex","katex","math"].indexOf(r)>=0?"<p class='editormd-tex'>".concat(e,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(t,'">').concat(n?e:Object(l["escape"])(e,!0),"</code></pre>\n"):'<pre class="prettyprint linenums"><code>'+(n?e:Object(l["escape"])(e,!0))+"</code></pre>"},h.heading=function(e,t,n){var r=this.options.headerPrefix+n.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return s.push({anchor:r,level:t,text:e}),"<h"+t+' id="'+r+'">'+e+"</h"+t+">"},c.a.setOptions({silent:!0,smartypants:!0,gfm:!0,pedantic:!1}),c.a.use({tokenizer:g,renderer:h});var N=c.a,S=(n("SJMd"),n("m3rI")),C=n("Oy/b"),I=n("Xjjk"),T=n.n(I),P=/<pre[^>]*>/g;function R(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue}t["a"]=function(e){var t=e.value,n=void 0===t?"":t,o=e.className,i=e.style,c=void 0===i?{}:i,l=String(n),u=Object(r["useMemo"])((function(){try{var e=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,t=/\"\/api\/attachments\/|\"\/attachments\/download\//g,n=/\(\s+\/files\/uploads\/|\(\/files\/uploads\//g;l=l.replace(e,"("+S["a"].API_SERVER+"/api/attachments/").replace(t,'"'+S["a"].API_SERVER+"/api/attachments/").replace(n,'"'+S["a"].API_SERVER+"/files/uploads/")}catch(o){}l=T()(l);var r=N(l),a=j();return l.match(/\[TOC\]/)&&(r=r.replace("<p>[TOC]</p>",v()),m()),r=r.replace(/(__special_katext_id_\d+__)/g,(function(e,t){var n=a[t],r=n.type,o=n.expression;return Object(C["renderToString"])(R(o)||"",{displayMode:"block"===r,throwOnError:!1,output:"html"})})),r=r.replace(/\u2581/g,"\u2581\u2581\u2581"),O(),r}),[l]),s=Object(r["useRef"])();function f(e){var t=e.target;if("A"===t.tagName.toUpperCase()){var n=t.getAttribute("href");if(n.startsWith("#")){e.preventDefault();var r=document.getElementById(n.replace("#",""));r&&r.scrollIntoView(!0)}}}return Object(r["useEffect"])((function(){if(s.current&&u&&u.match(P)&&window.PR.prettyPrint(),s.current)return s.current.addEventListener("click",f),function(){s.current.removeEventListener("click",f),O(),m()}}),[u,s.current,f]),a.a.createElement("div",{ref:s,style:c,className:"".concat(o||""," markdown-body"),dangerouslySetInnerHTML:{__html:u}})}},"9VGf":function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n("q1tI");function a(e,t){var n=Object(r["useRef"])();Object(r["useEffect"])((function(){n.current=e})),Object(r["useEffect"])((function(){function e(){n.current()}if(null!==t){var r=setInterval(e,t);return function(){return clearInterval(r)}}}),[t])}},BjJ7:function(e,t,n){"use strict";n.d(t,"d",(function(){return a})),n.d(t,"c",(function(){return o})),n.d(t,"e",(function(){return i})),n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return l}));var r=n("m3rI");function a(e){var t=!0;if(e.length>0){for(var n=0;n<e.length;n++)if(0==e[n].compile_success||!e[n].compile_success){t=!1;break}}else t=!1;return t}function o(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=[],r=0;r<e.length;r++){var a=e[r],o=t?"".concat(t,"/").concat(a.name):"".concat(a.name);n.push({title:a.name,isLeaf:"tree"!==a.type,key:o})}return n}function i(e,t,n){for(var r=0;r<e.length;r++){var a=e[r];if(a.key===t){a.children=n;break}a.children&&i(a.children,t,n)}return e}function c(e,t,n){var r;return function(){var a=this,o=arguments,i=function(){r=null,n||e.apply(a,o)},c=n&&!r;clearTimeout(r),r=setTimeout(i,t),c&&e.apply(a,o)}}var l=r["a"].API_SERVER},"C+DQ":function(e,t,n){},CKgm:function(e,t,n){"use strict";n.r(t);n("+L6B");var r=n("2/Rp"),a=(n("5NDa"),n("5rEg")),o=(n("sPJy"),n("bE4q")),i=(n("miYZ"),n("tsqr")),c=n("9og8"),l=n("k1fw"),u=(n("y8nQ"),n("Vl3Y")),s=n("tJVT"),f=n("PpiC"),h=(n("OaEy"),n("2fM7")),p=n("q1tI"),m=n.n(p),d=n("Ty5D"),v=n("9kvl"),g=n("55Ip"),y=n("Ot1p"),b=n("500L"),w=n("h+Ho"),E=n("7/Dv"),j=n.n(E);function O(){O=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(S){l=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new k(a||[]);return r(i,"_invoke",{value:E(e,n,c)}),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(S){return{type:"throw",arg:S}}}e.wrap=u;var f={};function h(){}function p(){}function m(){}var d={};l(d,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(_([])));g&&g!==t&&n.call(g,o)&&(d=g);var y=m.prototype=h.prototype=Object.create(d);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function a(r,o,i,c){var l=s(e[r],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){a("next",e,i,c)}),(function(e){a("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return a("throw",e,i,c)}))}c(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){a(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function E(e,t,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return N()}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var c=j(i,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function j(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,j(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var a=s(r,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,f;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function _(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:N}}function N(){return{value:void 0,done:!0}}return p.prototype=m,r(y,"constructor",{value:m,configurable:!0}),r(m,"constructor",{value:p,configurable:!0}),p.displayName=l(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,a,o){void 0===o&&(o=Promise);var i=new w(u(t,n,r,a),o);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=_,k.prototype={constructor:k,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(L),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),L(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;L(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:_(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}var x=h["a"].Option,L=function(e){e.forumsDetail,e.globalSetting,e.loading,e.dispatch,Object(f["a"])(e,["forumsDetail","globalSetting","loading","dispatch"]);var t,n,E,L=Object(d["m"])(),k=u["a"].useForm(),_=Object(s["a"])(k,1),N=_[0],S=Object(p["useState"])({}),C=Object(s["a"])(S,2),I=C[0],T=C[1],P=Object(p["useState"])(0),R=Object(s["a"])(P,2),F=R[0],V=R[1],A=Object(p["useState"])(!1),G=Object(s["a"])(A,2),B=G[0],M=G[1],q=Object(p["useState"])({}),D=Object(s["a"])(q,2),z=D[0],J=D[1],W=Object(p["useState"])(1),Y=Object(s["a"])(W,2),H=Y[0],U=Y[1];Object(p["useEffect"])((function(){if(Q(),L.memoId)M(!0),Z();else{M(!1);var e={forum_id:5};T(Object(l["a"])({},e)),N.setFieldsValue(Object(l["a"])({},e))}}),[L.memoId]);var Q=function(){var e=Object(c["a"])(O().mark((function e(){var t;return O().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(w["f"])({});case 2:t=e.sent,J(t||{});case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Z=function(){var e=Object(c["a"])(O().mark((function e(){var t,n,r;return O().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(w["e"])({id:L.memoId});case 2:if(e.t0=e.sent,e.t0){e.next=5;break}e.t0={};case 5:n=e.t0,r={subject:n.subject,content:n.content,attachments:Object(b["a"])(n.attachments),forum_id:n.forum_id,memo_tags:null===(t=n.memo_tags)||void 0===t?void 0:t.map((function(e){return e.id}))},T(Object(l["a"])({},r)),N.setFieldsValue(Object(l["a"])({},r));case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),K=function(){var e=Object(c["a"])(O().mark((function e(t){var n,r,a,o;return O().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(a=Object(l["a"])(Object(l["a"])({id:B?L.memoId:null},I),{},{attachment_ids:null===(n=I.attachments)||void 0===n||null===(r=n.filter((function(e){var t;return null===(t=e.response)||void 0===t?void 0:t.id})))||void 0===r?void 0:r.map((function(e){var t;return null===(t=e.response)||void 0===t?void 0:t.id})),tags:I.memo_tags}),!B){e.next=7;break}return e.next=4,Object(w["n"])(a);case 4:e.t0=e.sent,e.next=10;break;case 7:return e.next=9,Object(w["j"])(a);case 9:e.t0=e.sent;case 10:o=e.t0,V(0),0===(null===o||void 0===o?void 0:o.status)&&(i["b"].success(null===o||void 0===o?void 0:o.message),1===H?v["c"].push("/forums/".concat(B?null===L||void 0===L?void 0:L.memoId:null===o||void 0===o?void 0:o.memo_id)):v["c"].push("/forums/".concat(B?null===L||void 0===L?void 0:L.memoId:null===o||void 0===o?void 0:o.memo_id,"/edit")));case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),$=function(){document.body.scrollIntoView(),window.location.href.includes("new")?v["c"].goBack():v["c"].push("/forums/".concat(L.memoId))};return m.a.createElement("section",{className:j.a.bg},m.a.createElement("section",{className:"animated fadeIn mb10"},m.a.createElement("aside",{className:"mt10"},m.a.createElement(o["a"],{separator:"/"},m.a.createElement(o["a"].Item,null,m.a.createElement(g["Link"],{to:"/forums"},"\u4ea4\u6d41\u95ee\u7b54")),m.a.createElement(o["a"].Item,null,"\u8be6\u60c5")))),m.a.createElement("aside",{className:"bg-white font16 pt20 pb20 pl20"},B?"\u7f16\u8f91\u8bdd\u9898":"\u53d1\u5e03\u8bdd\u9898"),m.a.createElement(u["a"],{form:N,className:j.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(e,t){console.log(t,"values"),T(Object(l["a"])(Object(l["a"])({},I),e))},onFinish:K,onFinishFailed:function(){V(0)}},m.a.createElement("div",{className:j.a.fieldWrap},m.a.createElement(u["a"].Item,{name:"subject",label:m.a.createElement("span",{className:"font16"},"\u8bdd\u9898\u540d\u79f0: "),rules:[{required:!0,message:"\u8bf7\u5148\u8f93\u5165\u8bdd\u9898\u540d\u79f0"}]},m.a.createElement(a["a"],{maxLength:50,suffix:"".concat((null===(t=I.subject)||void 0===t?void 0:t.length)||0,"/50")}))),m.a.createElement("div",{className:j.a.mdWrap},m.a.createElement(u["a"].Item,{name:"content",label:m.a.createElement("span",{className:"font16"},"\u5185\u5bb9: "),rules:[{required:!0,message:"\u8bf7\u5148\u8f93\u5165\u8bdd\u9898\u5185\u5bb9"}]},m.a.createElement(y["a"],{height:600,id:"forums-new-content",watch:!0,defaultValue:I.content})),m.a.createElement("div",null,m.a.createElement(u["a"].Item,{name:"attachments",style:{width:350}},m.a.createElement(b["b"],{showRemoveModal:!0})))),m.a.createElement("div",{className:j.a.mdWrap},m.a.createElement(u["a"].Item,{name:"forum_id",label:m.a.createElement("span",{className:"font16"},"\u8bdd\u9898\u7c7b\u578b: "),rules:[{required:!0,message:"\u8bf7\u5148\u9009\u62e9\u8bdd\u9898\u7c7b\u578b"}]},m.a.createElement(h["a"],{style:{width:300}},null===z||void 0===z||null===(n=z.forums)||void 0===n?void 0:n.map((function(e){return m.a.createElement(x,{key:e.id,value:e.id},e.name)}))))),5===I.forum_id&&m.a.createElement("div",{className:j.a.mdWrap},m.a.createElement(u["a"].Item,{name:"memo_tags",label:m.a.createElement("span",{className:"font16"},"\u6280\u672f\u6807\u7b7e: "),rules:[{required:!0,message:"\u8bf7\u5148\u9009\u62e9\u6280\u672f\u6807\u7b7e"}]},m.a.createElement(h["a"],{style:{width:300},placeholder:"\u8bf7\u9009\u62e9\u6280\u672f\u6807\u7b7e",mode:"multiple",tokenSeparators:[";"],filterOption:function(e,t){return-1!=t.props.children.toLocaleLowerCase().indexOf(e.toLocaleLowerCase())}},null===z||void 0===z||null===(E=z.tag_list)||void 0===E?void 0:E.map((function(e){return m.a.createElement(x,{key:e.id,value:e.id},e.name)}))))),m.a.createElement("div",{className:j.a.backgroundFa},m.a.createElement("div",{className:"pt40 mb30"},m.a.createElement(u["a"].Item,null,m.a.createElement(r["a"],{size:"large",type:"primary",className:"".concat(j.a.button," mr20"),htmlType:"submit",loading:1===F,onClick:function(){U(1),V(1)}},"\u63d0\u4ea4"),m.a.createElement(r["a"],{size:"large",type:"primary",className:"".concat(j.a.button," mr20"),htmlType:"submit",loading:2===F,onClick:function(){U(2),V(2)}},"\u4fdd\u5b58"),m.a.createElement(r["a"],{size:"large",type:"primary",ghost:!0,className:"".concat(j.a.button," mr20"),onClick:$},"\u53d6\u6d88"))))))};t["default"]=Object(v["a"])((function(e){var t=e.forumsDetail,n=e.loading,r=e.globalSetting;return{forumsDetail:t,globalSetting:r,loading:n.models.forumsDetail}}))(L)},HmJG:function(e,t,n){},M8RZ:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n("fWQN"),a=n("mtLc"),o=n("yKVA"),i=n("879j"),c=n("q1tI"),l=n.n(c),u=n("i8i4"),s=function(e){Object(o["a"])(n,e);var t=Object(i["a"])(n);function n(e){var a;Object(r["a"])(this,n),a=t.call(this,e);var o=window.document;return a.node=o.createElement("div"),o.body.appendChild(a.node),a}return Object(a["a"])(n,[{key:"render",value:function(){var e=this.props.children;return Object(u["createPortal"])(e,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),n}(l.a.Component)},Ot1p:function(e,t,n){"use strict";n("2qtc");var r=n("kLXV"),a=n("rAM+"),o=n("tJVT"),i=n("jrin"),c=n("q1tI"),l=n.n(c),u=n("VrN/"),s=n.n(u),f=n("bdgK"),h=(n("p77/"),n("Bd2K"),n("ELLl"),n("19Vz"),n("lZu9"),n("kSUc"),n("9Bee")),p=n("0Owb"),m=(n("dejd"),n("C+DQ"),[{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 d(e){var t=e.onActionCallback,n=e.title,r=e.icon,a=e.actionName,o=e.className,i=void 0===o?"":o,c=e.children;function u(){t(a)}return l.a.createElement("a",{title:n,className:i,onClick:u},l.a.createElement("i",{className:"md-iconfont ".concat(r)}),c)}var v=function(e){var t=e.watch,n=e.showNullButton,r=e.onActionCallback,a=e.fullScreen,o=[].concat(m,[{title:"".concat(t?"\u5173\u95ed\u5b9e\u65f6\u9884\u89c8":"\u5f00\u542f\u5b9e\u65f6\u9884\u89c8"),icon:"".concat(t?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return l.a.createElement("ul",{className:"markdown-toolbar-container"},o.map((function(e,t){return l.a.createElement("li",{key:t},e.actionName?l.a.createElement(d,Object(p["a"])({},e,{onActionCallback:r})):l.a.createElement("span",{className:"v-line"}))})),n?l.a.createElement("li",null,l.a.createElement(d,{icon:"icon-edit",className:"btn-null",title:"\u589e\u52a0\u586b\u7a7a",actionName:"add-null-ch",onActionCallback:r},l.a.createElement("span",{className:"fill-tip"},"\u70b9\u51fb\u63d2\u5165\b\u586b\u7a7a\u9879"))):null,l.a.createElement("li",{className:"btn-full-screen"},l.a.createElement(d,{icon:"".concat(a?"icon-shrink":"icon-enlarge"),title:a?"\u5173\u95ed\u5168\u5c4f":"\u5f00\u542f\u5168\u5c4f",actionName:"trigger-full-screen",onActionCallback:r})))},g=n("M8RZ"),y=(n("+L6B"),n("2/Rp")),b=(n("y8nQ"),n("Vl3Y")),w=(n("5NDa"),n("5rEg")),E={labelCol:{span:4},wrapperCol:{span:20}},j=function(e){var t=e.callback,n=e.onCancel;function r(e){t(e)}return l.a.createElement(b["a"],Object(p["a"])({},E,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:r}),l.a.createElement(b["a"].Item,{label:"\u94fe\u63a5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u94fe\u63a5\u5730\u5740"}]},l.a.createElement(w["a"],null)),l.a.createElement(b["a"].Item,{label:"\u94fe\u63a5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u94fe\u63a5\u6807\u9898"}]},l.a.createElement(w["a"],null)),l.a.createElement("div",{className:"flex-container flex-end"},l.a.createElement(y["a"],{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786e\u5b9a"),l.a.createElement(y["a"],{type:"ghost",onClick:n},"\u53d6\u6d88")))},O=n("7ahc"),x=(n("HmJG"),n("BjJ7")),L=b["a"].useForm,k={width:280,marginRight:10},_={labelCol:{span:5},wrapperCol:{span:19}},N=function(e){var t=e.callback,n=e.onCancel,r=L(),a=Object(o["a"])(r,1),i=a[0];function c(e){t(e)}function u(e){i.setFieldsValue({src:"/api/attachments/".concat(e.id)})}function s(e){var t=e.target.files[0];C(t,u)}return l.a.createElement(b["a"],Object(p["a"])({form:i},_,{className:"upload-image-panel",onFinish:c}),l.a.createElement(b["a"].Item,{label:"\u56fe\u7247\u5730\u5740",required:!0},l.a.createElement("div",{className:"flex-container"},l.a.createElement(b["a"].Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u56fe\u7247\u5730\u5740"}]},l.a.createElement(w["a"],{style:k})),l.a.createElement(S,{onFileChange:s}))),l.a.createElement(b["a"].Item,{label:"\u56fe\u7247\u63cf\u8ff0",name:"alt",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u56fe\u7247\u63cf\u8ff0"}]},l.a.createElement(w["a"],{style:{width:264}})),l.a.createElement(b["a"].Item,{style:{textAlign:"right"}},l.a.createElement(y["a"],{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786e\u5b9a"),l.a.createElement(y["a"],{type:"ghost",onClick:n},"\u53d6\u6d88")))};function S(e){var t=e.onFileChange;return l.a.createElement("a",{className:"upload-button"},"\u672c\u5730\u4e0a\u4f20",l.a.createElement("input",{type:"file",accept:"image/*",onChange:t}))}function C(e,t){if(!e)throw new String("\u6ca1\u6709\u6587\u4ef6");var n=new FormData;n.append("editormd-image-file",e),n.append("file_param_name","editormd-image-file"),n.append("byxhr","true");var r=new window.XMLHttpRequest;r.withCredentials=!0,r.addEventListener("load",(function(e){t(JSON.parse(e.target.responseText))}),!1),r.addEventListener("error",(function(e){console.error(e)}),!1),r.open("POST","".concat(x["a"],"/api/attachments.json")),r.send(n)}n("giR+");var I,T,P=n("fyUT"),R=(n("7Kak"),n("9yH6")),F=R["a"].Group,V={margin:"0 8px"},A=function(e){var t=e.callback,n=e.onCancel;function r(e){t(e)}return l.a.createElement(b["a"],{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:r},l.a.createElement("div",{className:"flex-container"},l.a.createElement("span",{style:V},"\u5355\u5143\u683c\u6570\uff1a"),l.a.createElement("span",{style:V},"\u884c\u6570"),l.a.createElement(b["a"].Item,{name:"row",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u884c\u6570"}]},l.a.createElement(P["a"],null)),l.a.createElement("span",{style:V},"\u5217\u6570"),l.a.createElement(b["a"].Item,{name:"col",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u5217\u6570"}]},l.a.createElement(P["a"],null))),l.a.createElement("div",{className:"flex-container",style:{marginTop:12}},l.a.createElement("span",{style:V},"\u5bf9\u9f50\u65b9\u5f0f\uff1a"),l.a.createElement(b["a"].Item,{name:"align"},l.a.createElement(F,null,l.a.createElement(R["a"],{value:"default"},l.a.createElement("i",{className:"fa fa-align-justify"})),l.a.createElement(R["a"],{value:"left"},l.a.createElement("i",{className:"fa fa-align-left"})),l.a.createElement(R["a"],{value:"center"},l.a.createElement("i",{className:"fa fa-align-center"})),l.a.createElement(R["a"],{value:"right"},l.a.createElement("i",{className:"fa fa-align-right"}))))),l.a.createElement("div",{className:"flex-container flex-end"},l.a.createElement(y["a"],{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786e\u5b9a"),l.a.createElement(y["a"],{type:"ghost",onClick:n},"\u53d6\u6d88")))},G="link",B="upload-image",M="code-block",q="add-table",D="------------",z={default:D,left:":".concat(D),center:":".concat(D,":"),right:"".concat(D,":")},J=n("9VGf");var W=1e4,Y="\u2581";function H(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var U=navigator.platform.toUpperCase().indexOf("MAC")>=0,Q=U?"Cmd":"Ctrl",Z=(I={},Object(i["a"])(I,Q+"-B","bold"),Object(i["a"])(I,Q+"-I","italic"),I),K=(T={},Object(i["a"])(T,G,"\u6dfb\u52a0\u94fe\u63a5"),Object(i["a"])(T,M,"\u6dfb\u52a0\u4ee3\u7801\u5757"),Object(i["a"])(T,B,"\u6dfb\u52a0\u56fe\u7247"),Object(i["a"])(T,q,"\u6dfb\u52a0\u8868\u683c"),T);t["a"]=function(e){var t=e.defaultValue,n=void 0===t?"":t,u=e.onChange,p=e.width,m=void 0===p?"100%":p,d=e.height,y=void 0===d?400:d,b=e.miniToolbar,w=void 0!==b&&b,E=e.isFocus,x=void 0!==E&&E,L=e.watch,k=e.id,_=void 0===k?"markdown-editor-id":k,S=e.showResizeBar,I=void 0!==S&&S,T=e.noStorage,P=void 0!==T&&T,R=e.showNullButton,F=void 0!==R&&R,V=e.fullScreen,D=void 0!==V&&V,U=e.onBlur,Q=e.onCMBeforeChange,$=e.className,X=void 0===$?"":$,ee=e.placeholder,te=void 0===ee?"":ee,ne=e.values,re=void 0===ne?"":ne,ae=Object(c["useState"])(null),oe=Object(o["a"])(ae,2),ie=oe[0],ce=oe[1],le=Object(c["useState"])(n),ue=Object(o["a"])(le,2),se=ue[0],fe=ue[1],he=Object(c["useState"])(L),pe=Object(o["a"])(he,2),me=pe[0],de=pe[1],ve=Object(c["useState"])(D),ge=Object(o["a"])(ve,2),ye=ge[0],be=ge[1],we=Object(c["useState"])(""),Ee=Object(o["a"])(we,2),je=Ee[0],Oe=Ee[1],xe=Object(c["useState"])(0),Le=Object(o["a"])(xe,2),ke=Le[0],_e=Le[1],Ne=Object(c["useState"])(y),Se=Object(o["a"])(Ne,2),Ce=Se[0],Ie=Se[1],Te=Object(c["useState"])(!1),Pe=Object(o["a"])(Te,2),Re=(Pe[0],Pe[1]),Fe=Object(c["useRef"])(),Ve=Object(c["useRef"])(),Ae=Object(c["useRef"])(),Ge=Object(c["useRef"])();Object(c["useEffect"])((function(){fe(re),null===ie||void 0===ie||ie.setValue(re)}),[re]),Object(c["useEffect"])((function(){if(Fe.current){var e=function(e,n){var r=n.clipboardData;if(r){var a=r.types.toString(),o=r.items;if("text/html,Files"!==a&&"Files"!==a)return!0;var i=o[1];"Files"===a&&(i=o[0]),"file"===i.kind&&i.type.match(/^image\//i)&&C(i.getAsFile(),(function(e){e.id?t.replaceSelection("")):401===(null===e||void 0===e?void 0:e.status)&&(document.location.href="/user/login")}))}return!0},t=s.a.fromTextArea(Fe.current,{mode:"markdown",inputStyle:"contenteditable",lineNumbers:!w,lineWrapping:!0,value:n,autoCloseTags:!0,autoCloseBrackets:!0});return t.on("paste",e),ce(t),function(){t.off("paste",e)}}}),[]);var Be=Object(c["useCallback"])((function(){if(Ve.current)try{var e=Ve.current.getElementsByClassName("markdown-toolbar-container")[0].offsetHeight,t=Ve.current.getElementsByClassName("markdown-editor-body")[0];t.style.height=ye?"calc(100vh - ".concat(e,"px)"):"".concat(Ce-e,"px")}catch(n){console.log(n,"---- to set md editor body height")}}),[Ce,Ve,ye]);Object(c["useEffect"])((function(){function e(){var e=new f["default"]((function(e){var t,n=Object(a["a"])(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;(r.target.offsetHeight>0||r.target.offsetWidth>0)&&(Be(),ie.setSize("100%","100%"),ie.refresh())}}catch(o){n.e(o)}finally{n.f()}}));return e.observe(Fe.current.parentElement),e}if(ie){var t=e();return function(){t.unobserve(Fe.current.parentElement)}}}),[ie,Be]),Object(c["useEffect"])((function(){if(ie){for(var e=[],t=function(){var t=r[n];a=Object(o["a"])(t,2);var c=a[0],l=a[1],u=Object(i["a"])({},c,(function(){Me(l)}));e.push(u),ie.addKeyMap(u)},n=0,r=Object.entries(Z);n<r.length;n++){var a;t()}return function(){for(var t=0,n=e;t<n.length;t++){var r=n[t];ie.removeKeyMap(r)}}}}),[ie]),Object(c["useEffect"])((function(){D!==ye&&be(D)}),[D]),Object(J["a"])((function(){if(!P&&ke>0){var e=(new Date).getTime(),t=window.sessionStorage.getItem(_);e>=ke+W&&(!t||t!==se)&&(window.sessionStorage.setItem(_,se),Re(!0))}}),W),Object(c["useEffect"])((function(){de(L)}),[ie,L]),Object(c["useEffect"])((function(){ie&&x&&ie.focus()}),[ie,x]),Object(c["useEffect"])((function(){if(me&&ie){var e=function(e){var t=e.target;if(Ge.current){var n=t.scrollTop/t.scrollHeight;Ge.current.scrollTop=Ge.current.scrollHeight*n}},t=ie.getScrollerElement();return t.addEventListener("scroll",e),function(){t.removeEventListener("scroll",e)}}}),[ie,me]),Object(c["useEffect"])((function(){if(ie&&Q){var e=function(e,t){Q(e,t)};return ie.on("beforeChange",e),function(){ie.off("beforeChange",e)}}}),[ie,Q]),Object(c["useEffect"])((function(){if(ie&&U){var e=function(){U(ie.getValue())};return ie.on("blur",e),function(){ie.off("blur",e)}}}),[ie,U]),Object(c["useEffect"])((function(){if(ie){var e=function(e){var t=e.getValue();fe(t),_e((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),u&&u(t)};return ie.on("change",e),function(){ie.off("change",e)}}}),[ie,u]),Object(c["useEffect"])((function(){ie&&(null===n||void 0===n?(ie.setValue(""),fe("")):n!==ie.getValue()&&(ie.setValue(n),fe(n)))}),[ie,n]);var Me=Object(c["useCallback"])((function(e){var t=ie.getCursor(),n=ie.getSelection(),r=n.split("\n");switch(e){case"bold":return ie.replaceSelection("**"+n+"**"),""===n&&ie.setCursor(t.line,t.ch+2),ie.focus();case"italic":return ie.replaceSelection("*"+n+"*"),""===n&&ie.setCursor(t.line,t.ch+1),ie.focus();case"code":return ie.replaceSelection("`"+n+"`"),""===n&&ie.setCursor(t.line,t.ch+1),ie.focus();case"inline-latex":return ie.replaceSelection("`$$"+n+"$$`"),""===n&&ie.setCursor(t.line,t.ch+3),ie.focus();case"latex":return ie.replaceSelection("```latex\n"+n+"\n```"),ie.setCursor(t.line+1,n.length+1),ie.focus();case"line-break":return ie.replaceSelection("<br/>\n"),ie.focus();case"list-ul":return""===n?ie.replaceSelection("- "+n):ie.replaceSelection(r.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),ie.focus();case"list-ol":return""===n?ie.replaceSelection("1. "+n):ie.replaceSelection(r.map((function(e,t){return""===e?"":"".concat(t+1,". ").concat(e)})).join("\n")),ie.focus();case"add-null-ch":return""===n&&ie.setCursor(t.line,t.ch+1),ie.replaceSelection(Y),ie.focus();case"eraser":return ie.setValue(""),ie.focus();case"trigger-watch":return de(!me),ie.focus();case"trigger-full-screen":return be(!ye),ie.focus();case G:return void Oe(G);case M:return void Oe(M);case B:return void Oe(B);case q:return void Oe(q);default:throw new Error}}),[ie,me,ye]),qe=Object(c["useCallback"])((function(e){switch(Oe(""),je){case G:var t=e.title,n=e.link;return ie.replaceSelection("[".concat(t,"](").concat(n,")")),ie.focus();case M:var r=e.language,a=e.content;return ie.replaceSelection(["```"+r,a,"```"].join("\n")),ie.focus();case B:var o=e.src,i=e.alt;return ie.replaceSelection(".concat(o,' "').concat(i,'" )')),ie.focus();case q:for(var c=e.row,l=e.col,u=e.align,s="\n",f=0;f<c;f++){for(var h=[],p=[],m=0;m<l;m++)1===f&&p.push(z[u]),h.push(" ");1===f&&(s+="| ".concat(p.join(" | ")," |\n")),s+="| ".concat(h.join(1===l?"":" | ")," |\n")}return ie.replaceSelection(s+"\n"),ie.focus();default:throw new Error}}),[ie,je]),De=Object(c["useMemo"])((function(){switch(je){case G:return l.a.createElement(j,{callback:qe,onCancel:ze});case M:return l.a.createElement(O["b"],{callback:qe,onCancel:ze});case B:return l.a.createElement(N,{callback:qe,onCancel:ze});case q:return l.a.createElement(A,{callback:qe,onCancel:ze});default:return null}}),[je]);function ze(){Oe("")}Object(c["useEffect"])((function(){if(Ae.current){var e=function(e){a=!0,o=e.pageY},t=function(){a=!1},n=function(e){if(a){var t=e.pageY-o;t<0&&(t=0),t>300&&(t=300);var n=y+t+"px";Ie(n)}},r=Ae.current,a=!1,o=0;return r.addEventListener("mousedown",e),document.addEventListener("mousemove",n),document.addEventListener("mouseup",t),function(){r.removeEventListener("mousedown",e),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",t)}}}),[ie,Ae]),Object(c["useEffect"])((function(){Ie(y)}),[y]);var Je=H(m),We=H(Ce),Ye={width:Je,height:We};Object(c["useMemo"])((function(){if(ke){var e=new Date(ke),t=e.getHours(),n=e.getMinutes(),r=e.getSeconds();return t=t<10?"0"+t:t,n=n<10?"0"+n:n,r=r<10?"0"+r:r,"".concat(t,":").concat(n,":").concat(r)}return 0}),[ke]);return l.a.createElement(c["Fragment"],null,l.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ve},l.a.createElement("div",{className:"markdown-editor-container ".concat(X," ").concat(me?"on-preview":""," ").concat(w?"mini":""," ").concat(ye?"full-screen":""),style:Ye},l.a.createElement(v,{watch:me,fullScreen:ye,showNullButton:F,onActionCallback:Me}),l.a.createElement("div",{className:"markdown-editor-body"},l.a.createElement("div",{className:"codemirror-container"},l.a.createElement("textarea",{ref:Fe,placeholder:te})),me?l.a.createElement("div",{ref:Ge,className:"preview-container"},l.a.createElement(h["a"],{value:se})):null))),I?l.a.createElement("a",{ref:Ae,className:"editor-resize"}):null,l.a.createElement(g["a"],null,K[je]?l.a.createElement(r["a"],{centered:!0,title:K[je],visible:!0,onCancel:ze,footer:null},De):null))}},dejd:function(e,t,n){},kSUc:function(e,t,n){},wzkS:function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return c})),n.d(t,"d",(function(){return l})),n.d(t,"a",(function(){return s})),n.d(t,"e",(function(){return f}));var r=n("9og8"),a=n("ErOA");function o(){o=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(S){u=function(e,t,n){return e[t]=n}}function s(e,t,n,a){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),c=new k(a||[]);return r(i,"_invoke",{value:j(e,n,c)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(S){return{type:"throw",arg:S}}}e.wrap=s;var h={};function p(){}function m(){}function d(){}var v={};u(v,i,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g(_([])));y&&y!==t&&n.call(y,i)&&(v=y);var b=d.prototype=p.prototype=Object.create(v);function w(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function a(r,o,i,c){var l=f(e[r],e,o);if("throw"!==l.type){var u=l.arg,s=u.value;return s&&"object"==typeof s&&n.call(s,"__await")?t.resolve(s.__await).then((function(e){a("next",e,i,c)}),(function(e){a("throw",e,i,c)})):t.resolve(s).then((function(e){u.value=e,i(u)}),(function(e){return a("throw",e,i,c)}))}c(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){a(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function j(e,t,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return N()}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var c=O(i,n);if(c){if(c===h)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=f(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function O(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,O(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var a=f(r,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,h;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function _(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:N}}function N(){return{value:void 0,done:!0}}return m.prototype=d,r(b,"constructor",{value:d,configurable:!0}),r(d,"constructor",{value:m,configurable:!0}),m.displayName=u(d,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,u(e,l,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},w(E.prototype),u(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,o){void 0===o&&(o=Promise);var i=new E(s(t,n,r,a),o);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},w(b),u(b,l,"Generator"),u(b,i,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=_,k.prototype={constructor:k,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(L),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),L(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;L(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:_(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},e}function i(e){return Object(a["c"])("libraries/".concat(e,".json"))}function c(){return Object(a["c"])("library_tags.json")}function l(e){return u.apply(this,arguments)}function u(){return u=Object(r["a"])(o().mark((function e(t){var n;return o().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("attachments/".concat(t,".json"));case 2:return n=e.sent,e.abrupt("return",0===n.status);case 4:case"end":return e.stop()}}),e)}))),u.apply(this,arguments)}function s(e){return Object(a["f"])("libraries.json",e)}function f(e,t){return Object(a["g"])("libraries/".concat(e,".json"),t)}},y5JW:function(e,t,n){"use strict";n.d(t,"c",(function(){return m})),n.d(t,"a",(function(){return d}));n("DZo9");var r=n("8z0m"),a=(n("+L6B"),n("2/Rp")),o=n("9og8"),i=n("k1fw"),c=n("oBTY"),l=(n("miYZ"),n("tsqr")),u=n("q1tI"),s=n.n(u),f=n("m3rI"),h=n("wzkS");function p(){p=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(S){l=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new k(a||[]);return r(i,"_invoke",{value:j(e,n,c)}),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(S){return{type:"throw",arg:S}}}e.wrap=u;var f={};function h(){}function m(){}function d(){}var v={};l(v,o,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g(_([])));y&&y!==t&&n.call(y,o)&&(v=y);var b=d.prototype=h.prototype=Object.create(v);function w(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function a(r,o,i,c){var l=s(e[r],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){a("next",e,i,c)}),(function(e){a("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return a("throw",e,i,c)}))}c(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){a(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function j(e,t,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return N()}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var c=O(i,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function O(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,O(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var a=s(r,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,f;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function _(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:N}}function N(){return{value:void 0,done:!0}}return m.prototype=d,r(b,"constructor",{value:d,configurable:!0}),r(d,"constructor",{value:m,configurable:!0}),m.displayName=l(d,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,l(e,c,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},w(E.prototype),l(E.prototype,i,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,o){void 0===o&&(o=Promise);var i=new E(u(t,n,r,a),o);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},w(b),l(b,c,"Generator"),l(b,o,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=_,k.prototype={constructor:k,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(L),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),L(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;L(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:_(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}var m="\u3000\u3000";function d(e){var t=["Bytes","KB","MB","GB","TB"];if(0==e)return"0 Byte";var n=parseInt(""+Math.floor(Math.log(e)/Math.log(1024)),10);return(e/Math.pow(1024,n)).toFixed(1)+" "+t[n]}t["b"]=function(e){var t=e.value,n=void 0===t?[]:t,u=e.onChange,v=e.className,g=e.maxSize,y=void 0===g?150:g,b=e.title,w=void 0===b?"\u6587\u4ef6\u4e0a\u4f20":b,E=e.accept,j=void 0===E?null:E,O={multiple:!1,fileList:n,accept:j,withCredentials:!0,beforeUpload:function(e){e.newname=encodeURIComponent(e.name);var t=e.size/1024/1024;return t<y||(l["b"].error("\u8be5\u6587\u4ef6\u65e0\u6cd5\u4e0a\u4f20\u3002\u8d85\u8fc7\u6587\u4ef6\u5927\u5c0f\u9650\u5236(".concat(y,"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)},data:function(e){return e.newfilename=encodeURIComponent(e.name),e},action:"".concat(f["a"].API_SERVER,"/api/attachments.json"),onChange:function(e){var t=Object(c["a"])(e.fileList);t=t.map((function(e){return-1===e.name.indexOf(m)&&(e.name="".concat(e.name).concat(m).concat(d(e.size))),Object(i["a"])({},e)})),u(t)},onRemove:function(){var e=Object(o["a"])(p().mark((function e(t){var n,r;return p().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=t.response?t.response.id:t.uid,!n){e.next=8;break}return e.next=4,Object(h["d"])(t.response?t.response.id:t.id);case 4:return r=e.sent,e.abrupt("return",r);case 8:return e.abrupt("return",!0);case 9:case"end":return e.stop()}}),e)})));function t(t){return e.apply(this,arguments)}return t}()};function x(e){e.preventDefault(),e.stopPropagation()}return s.a.createElement("div",{className:"single-upload ".concat(v||"")},s.a.createElement(r["a"],O,s.a.createElement(a["a"],{type:"primary",title:n.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:n.length>0,ghost:!0},w),s.a.createElement("span",{onClick:x,style:{marginLeft:10}},"(\u5355\u4e2a\u6587\u4ef6\u6700\u5927",y,"M) ")))}}}]); |