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

345 lines
725 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[175,7,8,17],{"+NIl":function(Qe,Ie,h){(function(V){V(h("VrN/"))})(function(V){"use strict";V.defineMode("stex",function(ve,se){"use strict";function xe(F,L){F.cmdState.push(L)}function me(F){return F.cmdState.length>0?F.cmdState[F.cmdState.length-1]:null}function re(F){var L=F.cmdState.pop();L&&L.closeBracket()}function U(F){for(var L=F.cmdState,G=L.length-1;G>=0;G--){var W=L[G];if(W.name=="DEFAULT")continue;return W}return{styleIdentifier:function(){return null}}}function k(F,L,G){return function(){this.name=F,this.bracketNo=0,this.style=L,this.styles=G,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var O={};O.importmodule=k("importmodule","tag",["string","builtin"]),O.documentclass=k("documentclass","tag",["","atom"]),O.usepackage=k("usepackage","tag",["atom"]),O.begin=k("begin","tag",["atom"]),O.end=k("end","tag",["atom"]),O.label=k("label","tag",["atom"]),O.ref=k("ref","tag",["atom"]),O.eqref=k("eqref","tag",["atom"]),O.cite=k("cite","tag",["atom"]),O.bibitem=k("bibitem","tag",["atom"]),O.Bibitem=k("Bibitem","tag",["atom"]),O.RBibitem=k("RBibitem","tag",["atom"]),O.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function T(F,L){F.f=L}function A(F,L){var G;if(F.match(/^\\[a-zA-Z@]+/)){var W=F.current().slice(1);return G=O.hasOwnProperty(W)?O[W]:O.DEFAULT,G=new G,xe(L,G),T(L,te),G.style}if(F.match(/^\\[$&%#{}_]/))return"tag";if(F.match(/^\\[,;!\/\\]/))return"tag";if(F.match("\\["))return T(L,function(b,fe){return M(b,fe,"\\]")}),"keyword";if(F.match("\\("))return T(L,function(b,fe){return M(b,fe,"\\)")}),"keyword";if(F.match("$$"))return T(L,function(b,fe){return M(b,fe,"$$")}),"keyword";if(F.match("$"))return T(L,function(b,fe){return M(b,fe,"$")}),"keyword";var ee=F.next();if(ee=="%")return F.skipToEnd(),"comment";if(ee=="}"||ee=="]"){if(G=me(L),G)G.closeBracket(ee),T(L,te);else return"error";return"bracket"}else return ee=="{"||ee=="["?(G=O.DEFAULT,G=new G,xe(L,G),"bracket"):/\d/.test(ee)?(F.eatWhile(/[\w.%]/),"atom"):(F.eatWhile(/[\w\-_]/),G=U(L),G.name=="begin"&&(G.argument=F.current()),G.styleIdentifier())}function M(F,L,G){if(F.eatSpace())return null;if(G&&F.match(G))return T(L,A),"keyword";if(F.match(/^\\[a-zA-Z@]+/))return"tag";if(F.match(/^[a-zA-Z]+/))return"variable-2";if(F.match(/^\\[$&%#{}_]/))return"tag";if(F.match(/^\\[,;!\/]/))return"tag";if(F.match(/^[\^_&]/))return"tag";if(F.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(F.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var W=F.next();return W=="{"||W=="}"||W=="["||W=="]"||W=="("||W==")"?"bracket":W=="%"?(F.skipToEnd(),"comment"):"error"}function te(F,L){var G=F.peek(),W;return G=="{"||G=="["?(W=me(L),W.openBracket(G),F.eat(G),T(L,A),"bracket"):/[ \t\r]/.test(G)?(F.eat(G),null):(T(L,A),re(L),A(F,L))}return{startState:function(){var F=se.inMathMode?function(L,G){return M(L,G)}:A;return{cmdState:[],f:F}},copyState:function(F){return{cmdState:F.cmdState.slice(),f:F.f}},token:function(F,L){return L.f(F,L)},blankLine:function(F){F.f=A,F.cmdState.length=0},lineComment:"%"}}),V.defineMIME("text/x-stex","stex"),V.defineMIME("text/x-latex","stex")})},"+RXH":function(Qe,Ie,h){Qe.exports=h.p+"static/shu.a39bf729.svg"},"+yhJ":function(Qe,Ie,h){Qe.exports=h.p+"static/xixi.d492fb65.svg"},"0eGx":function(Qe,Ie,h){Qe.exports=h.p+"static/zhong.c1924b73.svg"},"19Vz":function(Qe,Ie,h){(function(V){V(h("VrN/"))})(function(V){V.defineOption("placeholder","",function(k,O,T){var A=T&&T!=V.Init;if(O&&!A)k.on("blur",me),k.on("change",re),k.on("swapDoc",re),V.on(k.getInputField(),"compositionupdate",k.state.placeholderCompose=function(){xe(k)}),re(k);else if(!O&&A){k.off("blur",me),k.off("change",re),k.off("swapDoc",re),V.off(k.getInputField(),"compositionupdate",k.state.placeholderCompose),ve(k);var M=k.getWrapperElement();M.className=M.className.replace(" CodeMirror-empty","")}O&&!k.hasFocus()&&me(k)});function ve(k){k.state.placeholder&&(k.state.placeholder.parentNode.removeChild(k.state.placeholder),k.state.placeholder=null)}function se(k){ve(k);var O=k.state.placeholder=document.createElement("pre");O.style.cssText="height: 0; overflow: visible",O.style.direction=k.getOption("direction"),O.className="CodeMirror-placeholder CodeMirror-line-like";var T=k.getOption("placeholder");typeof T=="string"&&(T=document.createTextNode(T)),O.appendChild(T),k.display.lineSpace.insertBefore(O,k.display.lineSpace.firstChild)}function xe(k){setTimeout(function(){var O=!1,T=k.getInputField();T.nodeName=="TEXTAREA"?O=!T.value:k.lineCount()==1&&(O=!/[^\u200b]/.test(T.querySelector(".CodeMirror-line").textContent)),O?se(k):ve(k)},20)}function me(k){U(k)&&se(k)}function re(k){var O=k.getWrapperElement(),T=U(k);O.className=O.className.replace(" CodeMirror-empty","")+(T?" CodeMirror-empty":""),T?se(k):ve(k)}function U(k){return k.lineCount()===1&&k.getLine(0)===""}})},"1eCo":function(Qe,Ie,h){(function(V){V(h("VrN/"))})(function(V){"use strict";var ve={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},se={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};V.defineMode("xml",function(xe,me){var re=xe.indentUnit,U={},k=me.htmlMode?ve:se;for(var O in k)U[O]=k[O];for(var O in me)U[O]=me[O];var T,A;function M(C,J){function z(ae){return J.tokenize=ae,ae(C,J)}var E=C.next();if(E=="<")return C.eat("!")?C.eat("[")?C.match("CDATA[")?z(L("atom","]]>")):null:C.match("--")?z(L("comment","-->")):C.match("DOCTYPE",!0,!0)?(C.eatWhile(/[\w\._\-]/),z(G(1))):null:C.eat("?")?(C.eatWhile(/[\w\._\-]/),J.tokenize=L("meta","?>"),"meta"):(T=C.eat("/")?"closeTag":"openTag",J.tokenize=te,"tag bracket");if(E=="&"){var P;return C.eat("#")?C.eat("x")?P=C.eatWhile(/[a-fA-F\d]/)&&C.eat(";"):P=C.eatWhile(/[\d]/)&&C.eat(";"):P=C.eatWhile(/[\w\.\-:]/)&&C.eat(";"),P?"atom":"error"}else return C.eatWhile(/[^&<]/),null}M.isInText=!0;function te(C,J){var z=C.next();if(z==">"||z=="/"&&C.eat(">"))return J.tokenize=M,T=z==">"?"endTag":"selfcloseTag","tag bracket";if(z=="=")return T="equals",null;if(z=="<"){J.tokenize=M,J.state=fe,J.tagName=J.tagStart=null;var E=J.tokenize(C,J);return E?E+" tag error":"tag error"}else return/[\'\"]/.test(z)?(J.tokenize=F(z),J.stringStartCol=C.column(),J.tokenize(C,J)):(C.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function F(C){var J=function(z,E){for(;!z.eol();)if(z.next()==C){E.tokenize=te;break}return"string"};return J.isInAttribute=!0,J}function L(C,J){return function(z,E){for(;!z.eol();){if(z.match(J)){E.tokenize=M;break}z.next()}return C}}function G(C){return function(J,z){for(var E;(E=J.next())!=null;){if(E=="<")return z.tokenize=G(C+1),z.tokenize(J,z);if(E==">")if(C==1){z.tokenize=M;break}else return z.tokenize=G(C-1),z.tokenize(J,z)}return"meta"}}function W(C,J,z){this.prev=C.context,this.tagName=J,this.indent=C.indented,this.startOfLine=z,(U.doNotIndent.hasOwnProperty(J)||C.context&&C.context.noIndent)&&(this.noIndent=!0)}function ee(C){C.context&&(C.context=C.context.prev)}function b(C,J){for(var z;;){if(!C.context)return;if(z=C.context.tagName,!U.contextGrabbers.hasOwnProperty(z)||!U.contextGrabbers[z].hasOwnProperty(J))return;ee(C)}}function fe(C,J,z){return C=="openTag"?(z.tagStart=J.column(),Se):C=="closeTag"?he:fe}function Se(C,J,z){return C=="word"?(z.tagName=J.current(),A="tag",ne):U.allowMissingTagName&&C=="endTag"?(A="tag bracket",ne(C,J,z)):(A="error",Se)}function he(C,J,z){if(C=="word"){var E=J.current();return z.context&&z.context.tagName!=E&&U.implicitlyClosed.hasOwnProperty(z.context.tagName)&&ee(z),z.context&&z.context.tagName==E||U.matchClosing===!1?(A="tag",H):(A="tag error",g)}else return U.allowMissingTagName&&C=="endTag"?(A="tag bracket",H(C,J,z)):(A="error",g)}function H(C,J,z){return C!="endTag"?(A="error",H):(ee(z),fe)}function g(C,J,z){return A="error",H(C,J,z)}function ne(C,J,z){if(C=="word")return A="attribute",S;if(C=="endTag"||C=="selfcloseTag"){var E=z.tagName,P=z.tagStart;return z.tagName=z.tagStart=null,C=="selfcloseTag"||U.autoSelfClosers.hasOwnProperty(E)?b(z,E):(b(z,E),z.context=new W(z,E,P==z.indented)),fe}return A="error",ne}function S(C,J,z){return C=="equals"?Y:(U.allowMissing||(A="error"),ne(C,J,z))}function Y(C,J,z){return C=="string"?w:C=="word"&&U.allowUnquoted?(A="string",ne):(A="error",ne(C,J,z))}function w(C,J,z){return C=="string"?w:ne(C,J,z)}return{startState:function(C){var J={tokenize:M,state:fe,indented:C||0,tagName:null,tagStart:null,context:null};return C!=null&&(J.baseIndent=C),J},token:function(C,J){if(!J.tagName&&C.sol()&&(J.indented=C.indentation()),C.eatSpace())return null;T=null;var z=J.tokenize(C,J);return(z||T)&&z!="comment"&&(A=null,J.state=J.state(T||z,C,J),A&&(z=A=="error"?z+" error":A)),z},indent:function(C,J,z){var E=C.context;if(C.tokenize.isInAttribute)return C.tagStart==C.indented?C.stringStartCol+1:C.indented+re;if(E&&E.noIndent)return V.Pass;if(C.tokenize!=te&&C.tokenize!=M)return z?z.match(/^(\s*)/)[0].length:0;if(C.tagName)return U.multilineTagIndentPastTag!==!1?C.tagStart+C.tagName.length+2:C.tagStart+re*(U.multilineTagIndentFactor||1);if(U.alignCDATA&&/<!\[CDATA\[/.test(J))return 0;var P=J&&/^<(\/)?([\w_:\.-]*)/.exec(J);if(P&&P[1])for(;E;)if(E.tagName==P[2]){E=E.prev;break}else if(U.implicitlyClosed.hasOwnProperty(E.tagName))E=E.prev;else break;else if(P)for(;E;){var ae=U.contextGrabbers[E.tagName];if(ae&&ae.hasOwnProperty(P[2]))E=E.prev;else break}for(;E&&E.prev&&!E.startOfLine;)E=E.prev;return E?E.indent+re:C.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:U.htmlMode?"html":"xml",helperType:U.htmlMode?"html":"xml",skipAttribute:function(C){C.state==Y&&(C.state=ne)},xmlCurrentTag:function(C){return C.tagName?{name:C.tagName,close:C.type=="closeTag"}:null},xmlCurrentContext:function(C){for(var J=[],z=C.context;z;z=z.prev)z.tagName&&J.push(z.tagName);return J.reverse()}}}),V.defineMIME("text/xml","xml"),V.defineMIME("application/xml","xml"),V.mimeModes.hasOwnProperty("text/html")||V.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"2sxD":function(Qe,Ie,h){Qe.exports={list:"list___3_VOx",head:"head___37dUf",name:"name___1VbnU",right:"right___gDdSx",body:"body___1wO_8",top:"top___cjRoo",bottom:"bottom___O44ku",l:"l___3de2t",ListGroup:"ListGroup___22jzr",a:"a___3Rx6Z",b:"b___S9Ybp",c:"c___3CVXw",c1:"c1___3b8Zq",radio:"radio___LnwQZ",d:"d___2-cs-"}},"51dB":function(Qe,Ie,h){Qe.exports=h.p+"static/sc.c1696770.svg"},"5MlY":function(Qe,Ie,h){Qe.exports=h.p+"static/sm.8ccb50bf.svg"},"6+eU":function(Qe,Ie,h){"use strict";h.d(Ie,"a",function(){return H});var V=h("wx14"),ve=h("rePB"),se=h("VTBJ"),xe=h("1OyB"),me=h("vuIU"),re=h("Ji7U"),U=h("LK+K"),k=h("q1tI"),O=h.n(k),T=h("TSYQ"),A=h.n(T),M=function(ne){var S,Y="".concat(ne.rootPrefixCls,"-item"),w=A()(Y,"".concat(Y,"-").concat(ne.page),(S={},Object(ve.a)(S,"".concat(Y,"-active"),ne.active),Object(ve.a)(S,ne.className,!!ne.className),Object(ve.a)(S,"".concat(Y,"-disabled"),!ne.page),S)),C=function(){ne.onClick(ne.page)},J=function(E){ne.onKeyPress(E,ne.onClick,ne.page)};return O.a.createElement("li",{title:ne.showTitle?ne.page:null,className:w,onClick:C,onKeyPress:J,tabIndex:"0"},ne.itemRender(ne.page,"page",O.a.createElement("a",{rel:"nofollow"},ne.page)))},te=M,F={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},L=function(g){Object(re.a)(S,g);var ne=Object(U.a)(S);function S(){var Y;Object(xe.a)(this,S);for(var w=arguments.length,C=new Array(w),J=0;J<w;J++)C[J]=arguments[J];return Y=ne.call.apply(ne,[this].concat(C)),Y.state={goInputText:""},Y.buildOptionText=function(z){return"".concat(z," ").concat(Y.props.locale.items_per_page)},Y.changeSize=function(z){Y.props.changeSize(Number(z))},Y.handleChange=function(z){Y.setState({goInputText:z.target.value})},Y.handleBlur=function(z){var E=Y.props,P=E.goButton,ae=E.quickGo,B=E.rootPrefixCls,be=Y.state.goInputText;if(P||be==="")return;if(z.relatedTarget&&(z.relatedTarget.className.indexOf("".concat(B,"-prev"))>=0||z.relatedTarget.className.indexOf("".concat(B,"-next"))>=0))return;Y.setState({goInputText:""}),ae(Y.getValidValue())},Y.go=function(z){var E=Y.state.goInputText;if(E==="")return;(z.keyCode===F.ENTER||z.type==="click")&&(Y.setState({goInputText:""}),Y.props.quickGo(Y.getValidValue()))},Y}return Object(me.a)(S,[{key:"getValidValue",value:function(){var w=this.state,C=w.goInputText,J=w.current;return!C||isNaN(C)?J:Number(C)}},{key:"getPageSizeOptions",value:function(){var w=this.props,C=w.pageSize,J=w.pageSizeOptions;return J.some(function(z){return z.toString()===C.toString()})?J:J.concat([C.toString()]).sort(function(z,E){var P=isNaN(Number(z))?0:Number(z),ae=isNaN(Number(E))?0:Number(E);return P-ae})}},{key:"render",value:function(){var w=this,C=this.props,J=C.pageSize,z=C.locale,E=C.rootPrefixCls,P=C.changeSize,ae=C.quickGo,B=C.goButton,be=C.selectComponentClass,D=C.buildOptionText,p=C.selectPrefixCls,ue=C.disabled,Be=this.state.goInputText,Pe="".concat(E,"-options"),ze=be,Te=null,we=null,X=null;if(!P&&!ae)return null;var K=this.getPageSizeOptions();if(P&&ze){var le=K.map(function(N,_){return O.a.createElement(ze.Option,{key:_,value:N.toString()},(D||w.buildOptionText)(N))});Te=O.a.createElement(ze,{disabled:ue,prefixCls:p,showSearch:!1,className:"".concat(Pe,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(J||K[0]).toString(),onChange:this.changeSize,getPopupContainer:function(_){return _.parentNode}},le)}return ae&&(B&&(X=typeof B=="boolean"?O.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:ue,className:"".concat(Pe,"-quick-jumper-button")},z.jump_to_confirm):O.a.createElement("span",{onClick:this.go,onKeyUp:this.go},B)),we=O.a.createElement("div",{className:"".concat(Pe,"-quick-jumper")},z.jump_to,O.a.createElement("input",{disabled:ue,type:"text",value:Be,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),z.page,X)),O.a.createElement("li",{className:"".concat(Pe)},Te,we)}}]),S}(O.a.Component);L.defaultProps={pageSizeOptions:["10","20","50","100"]};var G=L,W=h("N2Kk");function ee(){}function b(g){return typeof g=="number"&&isFinite(g)&&Math.floor(g)===g}function fe(g,ne,S){return S}function Se(g,ne,S){var Y=typeof g=="undefined"?ne.pageSize:g;return Math.floor((S.total-1)/Y)+1}var he=function(g){Object(re.a)(S,g);var ne=Object(U.a)(S);function S(Y){var w;Object(xe.a)(this,S),w=ne.call(this,Y),w.getJumpPrevPage=function(){return Math.max(1,w.state.current-(w.props.showLessItems?3:5))},w.getJumpNextPage=function(){return Math.min(Se(void 0,w.state,w.props),w.state.current+(w.props.showLessItems?3:5))},w.getItemIcon=function(P,ae){var B=w.props.prefixCls,be=P||O.a.createElement("button",{type:"button","aria-label":ae,className:"".concat(B,"-item-link")});return typeof P=="function"&&(be=O.a.createElement(P,Object(se.a)({},w.props))),be},w.savePaginationNode=function(P){w.paginationNode=P},w.isValid=function(P){return b(P)&&P!==w.state.current},w.shouldDisplayQuickJumper=function(){var P=w.props,ae=P.showQuickJumper,B=P.pageSize,be=P.total;return be<=B?!1:ae},w.handleKeyDown=function(P){(P.keyCode===F.ARROW_UP||P.keyCode===F.ARROW_DOWN)&&P.preventDefault()},w.handleKeyUp=function(P){var ae=w.getValidValue(P),B=w.state.currentInputValue;ae!==B&&w.setState({currentInputValue:ae}),P.keyCode===F.ENTER?w.handleChange(ae):P.keyCode===F.ARROW_UP?w.handleChange(ae-1):P.keyCode===F.ARROW_DOWN&&w.handleChange(ae+1)},w.changePageSize=function(P){var ae=w.state.current,B=Se(P,w.state,w.props);ae=ae>B?B:ae,B===0&&(ae=w.state.current),typeof P=="number"&&("pageSize"in w.props||w.setState({pageSize:P}),"current"in w.props||w.setState({current:ae,currentInputValue:ae})),w.props.onShowSizeChange(ae,P),"onChange"in w.props&&w.props.onChange&&w.props.onChange(ae,P)},w.handleChange=function(P){var ae=w.props.disabled,B=P;if(w.isValid(B)&&!ae){var be=Se(void 0,w.state,w.props);B>be?B=be:B<1&&(B=1),"current"in w.props||w.setState({current:B,currentInputValue:B});var D=w.state.pageSize;return w.props.onChange(B,D),B}return w.state.current},w.prev=function(){w.hasPrev()&&w.handleChange(w.state.current-1)},w.next=function(){w.hasNext()&&w.handleChange(w.state.current+1)},w.jumpPrev=function(){w.handleChange(w.getJumpPrevPage())},w.jumpNext=function(){w.handleChange(w.getJumpNextPage())},w.hasPrev=function(){return w.state.current>1},w.hasNext=function(){return w.state.current<Se(void 0,w.state,w.props)},w.runIfEnter=function(P,ae){if(P.key==="Enter"||P.charCode===13){for(var B=arguments.length,be=new Array(B>2?B-2:0),D=2;D<B;D++)be[D-2]=arguments[D];ae.apply(void 0,be)}},w.runIfEnterPrev=function(P){w.runIfEnter(P,w.prev)},w.runIfEnterNext=function(P){w.runIfEnter(P,w.next)},w.runIfEnterJumpPrev=function(P){w.runIfEnter(P,w.jumpPrev)},w.runIfEnterJumpNext=function(P){w.runIfEnter(P,w.jumpNext)},w.handleGoTO=function(P){(P.keyCode===F.ENTER||P.type==="click")&&w.handleChange(w.state.currentInputValue)};var C=Y.onChange!==ee,J="current"in Y;J&&!C&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var z=Y.defaultCurrent;"current"in Y&&(z=Y.current);var E=Y.defaultPageSize;return"pageSize"in Y&&(E=Y.pageSize),z=Math.min(z,Se(E,void 0,Y)),w.state={current:z,currentInputValue:z,pageSize:E},w}return Object(me.a)(S,[{key:"componentDidUpdate",value:function(w,C){var J=this.props.prefixCls;if(C.current!==this.state.current&&this.paginationNode){var z=this.paginationNode.querySelector(".".concat(J,"-item-").concat(C.current));z&&document.activeElement===z&&z.blur()}}},{key:"getValidValue",value:function(w){var C=w.target.value,J=Se(void 0,this.state,this.props),z=this.state.currentInputValue,E;return C===""?E=C:isNaN(Number(C))?E=z:C>=J?E=J:E=Number(C),E}},{key:"getShowSizeChanger",value:function(){var w=this.props,C=w.showSizeChanger,J=w.total,z=w.totalBoundaryShowSizeChanger;return typeof C!="undefined"?C:J>z}},{key:"renderPrev",value:function(w){var C=this.props,J=C.prevIcon,z=C.itemRender,E=z(w,"prev",this.getItemIcon(J,"prev page")),P=!this.hasPrev();return Object(k.isValidElement)(E)?Object(k.cloneElement)(E,{disabled:P}):E}},{key:"renderNext",value:function(w){var C=this.props,J=C.nextIcon,z=C.itemRender,E=z(w,"next",this.getItemIcon(J,"next page")),P=!this.hasNext();return Object(k.isValidElement)(E)?Object(k.cloneElement)(E,{disabled:P}):E}},{key:"render",value:function(){var w=this,C=this.props,J=C.prefixCls,z=C.className,E=C.style,P=C.disabled,ae=C.hideOnSinglePage,B=C.total,be=C.locale,D=C.showQuickJumper,p=C.showLessItems,ue=C.showTitle,Be=C.showTotal,Pe=C.simple,ze=C.itemRender,Te=C.showPrevNextJumpers,we=C.jumpPrevIcon,X=C.jumpNextIcon,K=C.selectComponentClass,le=C.selectPrefixCls,N=C.pageSizeOptions,_=this.state,pe=_.current,Ue=_.pageSize,Ze=_.currentInputValue;if(ae===!0&&B<=Ue)return null;var Ae=Se(void 0,this.state,this.props),De=[],Re=null,Me=null,Xe=null,qe=null,ot=null,Ke=D&&D.goButton,Ve=p?1:2,At=pe-1>0?pe-1:0,gt=pe+1<Ae?pe+1:Ae,kt=Object.keys(this.props).reduce(function(x,R){return(R.substr(0,5)==="data-"||R.substr(0,5)==="aria-"||R==="role")&&(x[R]=w.props[R]),x},{});if(Pe)return Ke&&(typeof Ke=="boolean"?ot=O.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},be.jump_to_confirm):ot=O.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Ke),ot=O.a.createElement("li",{title:ue?"".concat(be.jump_to).concat(pe,"/").concat(Ae):null,className:"".concat(J,"-simple-pager")},ot)),O.a.createElement("ul",Object(V.a)({className:A()(J,"".concat(J,"-simple"),Object(ve.a)({},"".concat(J,"-disabled"),P),z),style:E,ref:this.savePaginationNode},kt),O.a.createElement("li",{title:ue?be.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:A()("".concat(J,"-prev"),Object(ve.a)({},"".concat(J,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(At)),O.a.createElement("li",{title:ue?"".concat(pe,"/").concat(Ae):null,className:"".concat(J,"-simple-pager")},O.a.createElement("input",{type:"text",value:Ze,disabled:P,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),O.a.createElement("span",{className:"".concat(J,"-slash")},"/"),Ae),O.a.createElement("li",{title:ue?be.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:A()("".concat(J,"-next"),Object(ve.a)({},"".concat(J,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(gt)),ot);if(Ae<=3+Ve*2){var ct={locale:be,rootPrefixCls:J,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:ue,itemRender:ze};Ae||De.push(O.a.createElement(te,Object(V.a)({},ct,{key:"noPager",page:Ae,className:"".concat(J,"-disabled")})));for(var Pt=1;Pt<=Ae;Pt+=1){var xt=pe===Pt;De.push(O.a.createElement(te,Object(V.a)({},ct,{key:Pt,page:Pt,active:xt})))}}else{var bt=p?be.prev_3:be.prev_5,Ne=p?be.next_3:be.next_5;Te&&(Re=O.a.createElement("li",{title:ue?bt:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:A()("".concat(J,"-jump-prev"),Object(ve.a)({},"".concat(J,"-jump-prev-custom-icon"),!!we))},ze(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(we,"prev page"))),Me=O.a.createElement("li",{title:ue?Ne:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:A()("".concat(J,"-jump-next"),Object(ve.a)({},"".concat(J,"-jump-next-custom-icon"),!!X))},ze(this.getJumpNextPage(),"jump-next",this.getItemIcon(X,"next page")))),qe=O.a.createElement(te,{locale:be,last:!0,rootPrefixCls:J,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ae,page:Ae,active:!1,showTitle:ue,itemRender:ze}),Xe=O.a.createElement(te,{locale:be,rootPrefixCls:J,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:ue,itemRender:ze});var Ut=Math.max(1,pe-Ve),Rt=Math.min(pe+Ve,Ae);pe-1<=Ve&&(Rt=1+Ve*2),Ae-pe<=Ve&&(Ut=Ae-Ve*2);for(var je=Ut;je<=Rt;je+=1){var We=pe===je;De.push(O.a.createElement(te,{locale:be,rootPrefixCls:J,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:je,page:je,active:We,showTitle:ue,itemRender:ze}))}pe-1>=Ve*2&&pe!==1+2&&(De[0]=Object(k.cloneElement)(De[0],{className:"".concat(J,"-item-after-jump-prev")}),De.unshift(Re)),Ae-pe>=Ve*2&&pe!==Ae-2&&(De[De.length-1]=Object(k.cloneElement)(De[De.length-1],{className:"".concat(J,"-item-before-jump-next")}),De.push(Me)),Ut!==1&&De.unshift(Xe),Rt!==Ae&&De.push(qe)}var $=null;Be&&($=O.a.createElement("li",{className:"".concat(J,"-total-text")},Be(B,[B===0?0:(pe-1)*Ue+1,pe*Ue>B?B:pe*Ue])));var q=!this.hasPrev()||!Ae,Q=!this.hasNext()||!Ae;return O.a.createElement("ul",Object(V.a)({className:A()(J,z,Object(ve.a)({},"".concat(J,"-disabled"),P)),style:E,unselectable:"unselectable",ref:this.savePaginationNode},kt),$,O.a.createElement("li",{title:ue?be.prev_page:null,onClick:this.prev,tabIndex:q?null:0,onKeyPress:this.runIfEnterPrev,className:A()("".concat(J,"-prev"),Object(ve.a)({},"".concat(J,"-disabled"),q)),"aria-disabled":q},this.renderPrev(At)),De,O.a.createElement("li",{title:ue?be.next_page:null,onClick:this.next,tabIndex:Q?null:0,onKeyPress:this.runIfEnterNext,className:A()("".concat(J,"-next"),Object(ve.a)({},"".concat(J,"-disabled"),Q)),"aria-disabled":Q},this.renderNext(gt)),O.a.createElement(G,{disabled:P,locale:be,rootPrefixCls:J,selectComponentClass:K,selectPrefixCls:le,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:pe,pageSize:Ue,pageSizeOptions:N,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ke}))}}],[{key:"getDerivedStateFromProps",value:function(w,C){var J={};if("current"in w&&(J.current=w.current,w.current!==C.current&&(J.currentInputValue=J.current)),"pageSize"in w&&w.pageSize!==C.pageSize){var z=C.current,E=Se(w.pageSize,C,w);z=z>E?E:z,"current"in w||(J.current=z,J.currentInputValue=z),J.pageSize=w.pageSize}return J}}]),S}(O.a.Component);he.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:ee,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:ee,locale:W.a,style:{},itemRender:fe,totalBoundaryShowSizeChanger:50};var H=he},"6K3P":function(Qe,Ie,h){Qe.exports=h.p+"static/jinshi.9b74f304.svg"},"7Cbv":function(Qe,Ie,h){"use strict";var V=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),ve=new Uint8Array(16);function se(){if(!V)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return V(ve)}var xe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function me(te){return typeof te=="string"&&xe.test(te)}for(var re=me,U=[],k=0;k<256;++k)U.push((k+256).toString(16).substr(1));function O(te){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=(U[te[F+0]]+U[te[F+1]]+U[te[F+2]]+U[te[F+3]]+"-"+U[te[F+4]]+U[te[F+5]]+"-"+U[te[F+6]]+U[te[F+7]]+"-"+U[te[F+8]]+U[te[F+9]]+"-"+U[te[F+10]]+U[te[F+11]]+U[te[F+12]]+U[te[F+13]]+U[te[F+14]]+U[te[F+15]]).toLowerCase();if(!re(L))throw TypeError("Stringified UUID is invalid");return L}var T=O;function A(te,F,L){te=te||{};var G=te.random||(te.rng||se)();if(G[6]=G[6]&15|64,G[8]=G[8]&63|128,F){L=L||0;for(var W=0;W<16;++W)F[L+W]=G[W];return F}return T(G)}var M=Ie.a=A},"7ahc":function(Qe,Ie,h){"use strict";h.d(Ie,"a",function(){return Se});var V=h("k1fw"),ve=h("0Owb"),se=h("+L6B"),xe=h("2/Rp"),me=h("y8nQ"),re=h("Vl3Y"),U=h("tJVT"),k=h("OaEy"),O=h("2fM7"),T=h("q1tI"),A=h.n(T),M=h("VrN/"),te=h.n(M),F=h("p77/"),L=h.n(F),G=h("c5Ni"),W=h.n(G),ee=O.a.Option,b={labelCol:{span:4},wrapperCol:{span:20}},fe={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"]};Ie.b=function(he){var H=he.callback,g=he.onCancel,ne=Object(T.useState)("python"),S=Object(U.a)(ne,2),Y=S[0],w=S[1];function C(z){w(fe[z][1])}function J(z){H(z)}return A.a.createElement(re.a,Object(ve.a)({},b,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:J}),A.a.createElement(re.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},A.a.createElement(O.a,{onChange:C},Object.keys(fe).map(function(z){return A.a.createElement(ee,{key:z,value:z},fe[z][0])}))),A.a.createElement(re.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},A.a.createElement(Se,{mode:Y})),A.a.createElement("div",{className:"flex-container flex-end"},A.a.createElement(xe.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(xe.a,{type:"ghost",onClick:g},"\u53D6\u6D88")))};function Se(he){var H=he.value,g=he.onChange,ne=he.mode,S=he.options,Y=S===void 0?{}:S,w=Object(T.useRef)(),C=Object(T.useState)(),J=Object(U.a)(C,2),z=J[0],E=J[1];return Object(T.useEffect)(function(){if(z){function P(ae){var B=ae.getValue();g&&g(B)}return z.on("change",P),function(){z.off("change",P)}}},[z,g]),Object(T.useEffect)(function(){z&&z.setOption("mode",ne)},[z,ne]),Object(T.useEffect)(function(){z&&((H!==z.getValue()||H==="")&&setTimeout(function(){z.setValue(H||" ")},300))},[z,H]),Object(T.useEffect)(function(){if(w.current&&!z){var P=te.a.fromTextArea(w.current,Object(V.a)({mode:ne,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Y));E(P)}},[w.current,z]),A.a.createElement("div",{className:"my-codemirror-container"},A.a.createElement("textarea",{ref:w}))}},"7ixt":function(Qe,Ie,h){"use strict";h.d(Ie,"a",function(){return se});var V={adjustX:1,adjustY:1},ve=[0,0],se={left:{points:["cr","cl"],overflow:V,offset:[-4,0],targetOffset:ve},right:{points:["cl","cr"],overflow:V,offset:[4,0],targetOffset:ve},top:{points:["bc","tc"],overflow:V,offset:[0,-4],targetOffset:ve},bottom:{points:["tc","bc"],overflow:V,offset:[0,4],targetOffset:ve},topLeft:{points:["bl","tl"],overflow:V,offset:[0,-4],targetOffset:ve},leftTop:{points:["tr","tl"],overflow:V,offset:[-4,0],targetOffset:ve},topRight:{points:["br","tr"],overflow:V,offset:[0,-4],targetOffset:ve},rightTop:{points:["tl","tr"],overflow:V,offset:[4,0],targetOffset:ve},bottomRight:{points:["tr","br"],overflow:V,offset:[0,4],targetOffset:ve},rightBottom:{points:["bl","br"],overflow:V,offset:[4,0],targetOffset:ve},bottomLeft:{points:["tl","bl"],overflow:V,offset:[0,4],targetOffset:ve},leftBottom:{points:["br","bl"],overflow:V,offset:[-4,0],targetOffset:ve}},xe=se},"7qnI":function(Qe,Ie,h){"use strict";var V=h("5Dmo"),ve=h("3S7+"),se=h("fWQN"),xe=h("mtLc"),me=h("yKVA"),re=h("879j"),U=h("5NDa"),k=h("5rEg"),O=h("q1tI"),T=h.n(O),A=h("O2Wb"),M=h.n(A),te=k.a.TextArea,F=function(L){Object(me.a)(W,L);var G=Object(re.a)(W);function W(){return Object(se.a)(this,W),G.apply(this,arguments)}return Object(xe.a)(W,[{key:"render",value:function(){var b=this,fe=this.props,Se=fe.index,he=fe.onAnswerChange,H=fe.addChildAnswer,g=fe.exerciseIsPublish,ne=fe.answers,S=fe.activeOptionErrorIndex,Y=fe.flex,w=Y===void 0?"0 0 1000px":Y;return T.a.createElement("div",{className:M.a.flex},T.a.createElement("div",{className:"".concat(M.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",Se+1,"):"),T.a.createElement("div",{className:"".concat(M.a.flex," ").concat(M.a.flex1),style:{flexDirection:"column"}},ne.map(function(C,J){var z="".concat(Se,"-").concat(J);return T.a.createElement("div",{className:"".concat(M.a.flex," ").concat(M.a.flex1),key:J},T.a.createElement("div",{className:M.a.flex1,style:{flex:w}},T.a.createElement("div",null,T.a.createElement(te,{className:z===S?M.a.error:"",spellCheck:!1,rows:4,value:C||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(J==0?"":"(\u53EF\u9009)"),onChange:function(P){return he(Se,J,P.target.value)},style:{minHeight:95}}))),!g&&T.a.createElement(T.a.Fragment,null,J!=0&&T.a.createElement(ve.a,{title:"\u5220\u9664"},T.a.createElement("i",{className:"".concat(M.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return b.props.deleteChildAnswer(Se,J)},style:{float:"right"}})),J===0&&T.a.createElement(ve.a,{title:"\u5220\u9664"},T.a.createElement("i",{className:"".concat(M.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return b.props.deleteChildAnswermain(Se,J)},style:{float:"right"}})),T.a.createElement(ve.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},T.a.createElement("i",{className:"".concat(M.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return H(Se)},style:{float:"right",visibility:J==ne.length-1?"":"hidden"}}))))})))}}]),W}(O.Component);Ie.a=F},"815F":function(Qe,Ie,h){"use strict";h.d(Ie,"e",function(){return U}),h.d(Ie,"c",function(){return O}),h.d(Ie,"d",function(){return T}),h.d(Ie,"a",function(){return M}),h.d(Ie,"f",function(){return te}),h.d(Ie,"b",function(){return F});var V=h("KQm4"),ve=h("VTBJ"),se=h("Ff2n"),xe=h("Zm9Q"),me=h("Kwbf"),re=h("OZM5");function U(L,G){return L!=null?L:G}function k(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],G=new Map;function W(ee){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(ee||[]).forEach(function(fe){var Se=fe.key,he=fe.children;Object(me.a)(Se!=null,"Tree node must have a certain key: [".concat(b).concat(Se,"]"));var H=String(Se);Object(me.a)(!G.has(H)||Se===null||Se===void 0,"Same 'key' exist in the Tree: ".concat(H)),G.set(H,!0),W(he,"".concat(b).concat(H," > "))})}W(L)}function O(L){function G(W){var ee=Object(xe.a)(W);return ee.map(function(b){if(!Object(re.i)(b))return Object(me.a)(!b,"Tree/TreeNode can only accept TreeNode as children."),null;var fe=b.key,Se=b.props,he=Se.children,H=Object(se.a)(Se,["children"]),g=Object(ve.a)({key:fe},H),ne=G(he);return ne.length&&(g.children=ne),g}).filter(function(b){return b})}return G(L)}function T(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],W=new Set(G===!0?[]:G),ee=[];function b(fe){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return fe.map(function(he,H){var g=Object(re.h)(Se?Se.pos:"0",H),ne=U(he.key,g),S=Object(ve.a)(Object(ve.a)({},he),{},{parent:Se,pos:g,children:null,data:he,isStart:[].concat(Object(V.a)(Se?Se.isStart:[]),[H===0]),isEnd:[].concat(Object(V.a)(Se?Se.isEnd:[]),[H===fe.length-1])});return ee.push(S),G===!0||W.has(ne)?S.children=b(he.children||[],S):S.children=[],S})}return b(L),ee}function A(L,G,W){var ee;W?typeof W=="string"?ee=function(Se){return Se[W]}:typeof W=="function"&&(ee=function(Se){return W(Se)}):ee=function(Se,he){return U(Se.key,he)};function b(fe,Se,he){var H=fe?fe.children:L,g=fe?Object(re.h)(he.pos,Se):"0";if(fe){var ne=ee(fe,g),S={node:fe,index:Se,pos:g,key:ne,parentPos:he.node?he.pos:null,level:he.level+1};G(S)}H&&H.forEach(function(Y,w){b(Y,w,{node:fe,pos:g,level:he?he.level+1:-1})})}b(null)}function M(L){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W=G.initWrapper,ee=G.processEntity,b=G.onProcessFinished,fe=arguments.length>2?arguments[2]:void 0,Se={},he={},H={posEntities:Se,keyEntities:he};return W&&(H=W(H)||H),A(L,function(g){var ne=g.node,S=g.index,Y=g.pos,w=g.key,C=g.parentPos,J=g.level,z={node:ne,index:S,key:w,pos:Y,level:J},E=U(w,Y);Se[Y]=z,he[E]=z,z.parent=Se[C],z.parent&&(z.parent.children=z.parent.children||[],z.parent.children.push(z)),ee&&ee(z,H)},fe),b&&b(H),H}function te(L,G){var W=G.expandedKeys,ee=G.selectedKeys,b=G.loadedKeys,fe=G.loadingKeys,Se=G.checkedKeys,he=G.halfCheckedKeys,H=G.dragOverNodeKey,g=G.dropPosition,ne=G.keyEntities,S=ne[L],Y={eventKey:L,expanded:W.indexOf(L)!==-1,selected:ee.indexOf(L)!==-1,loaded:b.indexOf(L)!==-1,loading:fe.indexOf(L)!==-1,checked:Se.indexOf(L)!==-1,halfChecked:he.indexOf(L)!==-1,pos:String(S?S.pos:""),dragOver:H===L&&g===0,dragOverGapTop:H===L&&g===-1,dragOverGapBottom:H===L&&g===1};return Y}function F(L){var G=L.data,W=L.expanded,ee=L.selected,b=L.checked,fe=L.loaded,Se=L.loading,he=L.halfChecked,H=L.dragOver,g=L.dragOverGapTop,ne=L.dragOverGapBottom,S=L.pos,Y=L.active,w=Object(ve.a)(Object(ve.a)({},G),{},{expanded:W,selected:ee,checked:b,loaded:fe,loading:Se,halfChecked:he,dragOver:H,dragOverGapTop:g,dragOverGapBottom:ne,pos:S,active:Y});return"props"in w||Object.defineProperty(w,"props",{get:function(){return Object(me.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),L}}),w}},"8EBN":function(Qe,Ie,h){(function(V){V(h("VrN/"))})(function(V){"use strict";V.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var ve=0;ve<V.modeInfo.length;ve++){var se=V.modeInfo[ve];se.mimes&&(se.mime=se.mimes[0])}V.findModeByMIME=function(xe){xe=xe.toLowerCase();for(var me=0;me<V.modeInfo.length;me++){var re=V.modeInfo[me];if(re.mime==xe)return re;if(re.mimes){for(var U=0;U<re.mimes.length;U++)if(re.mimes[U]==xe)return re}}if(/\+xml$/.test(xe))return V.findModeByMIME("application/xml");if(/\+json$/.test(xe))return V.findModeByMIME("application/json")},V.findModeByExtension=function(xe){xe=xe.toLowerCase();for(var me=0;me<V.modeInfo.length;me++){var re=V.modeInfo[me];if(re.ext){for(var U=0;U<re.ext.length;U++)if(re.ext[U]==xe)return re}}},V.findModeByFileName=function(xe){for(var me=0;me<V.modeInfo.length;me++){var re=V.modeInfo[me];if(re.file&&re.file.test(xe))return re}var U=xe.lastIndexOf("."),k=U>-1&&xe.substring(U+1,xe.length);if(k)return V.findModeByExtension(k)},V.findModeByName=function(xe){xe=xe.toLowerCase();for(var me=0;me<V.modeInfo.length;me++){var re=V.modeInfo[me];if(re.name.toLowerCase()==xe)return re;if(re.alias){for(var U=0;U<re.alias.length;U++)if(re.alias[U].toLowerCase()==xe)return re}}}})},"8hTe":function(Qe,Ie,h){Qe.exports={button:"button___1wy9m"}},"9Bee":function(Qe,Ie,h){"use strict";var V=h("DYRE"),ve=h("zeV3"),se=h("+L6B"),xe=h("2/Rp"),me=h("k1fw"),re=h("9og8"),U=h("tJVT"),k=h("WmNS"),O=h.n(k),T=h("q1tI"),A=h.n(T),M=h("vg9a"),te=h("DlQD"),F=h.n(te),L=h("rUJ1");function G(d,o){var r=d.match(/^(\s+)(?:```)/);if(r===null)return o;var u=r[1];return o.split(`
`).map(function(v){var c=v.match(/^\s+/);if(c===null)return v;var oe=Object(U.a)(c,1),Je=oe[0];return Je.length>=u.length?v.slice(u.length):v}).join(`
`)}var W=[],ee=["<ul>"],b=new F.a.Renderer,fe=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Se(){W.length=0,ee=["<ul>"]}var he={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function H(d,o,r,u){if(o>=d.length||d[o].level<=r)return o;var v=d[o];u.push("<li><a href='#"+v.anchor+"'>"+v.text+"</a>"),o++;var c=[];return o=H(d,o,v.level,c),c.length>0&&(u.push("<ul>"),c.forEach(function(oe){u.push(oe)}),u.push("</ul>")),u.push("</li>"),o=H(d,o,r,u),o}function g(){return H(W,0,0,ee),ee.push("</ul>"),ee.join("")}var ne={heading:function(o){var r=fe.exec(o);if(r)return{type:"heading",raw:r[0],depth:r[1].length,text:r[2]}},fences:function(o){var r=this.rules.block.fences.exec(o);if(r){var u=r[0],v=G(u,r[3]||""),c=r[2]?r[2].trim():r[2];if(["latex","katex","math"].indexOf(c)>=0){var oe=w(),Je=v;v=oe,C[oe]={type:"block",expression:Je}}return{type:"code",raw:u,lang:c,text:v}}}},S=/(?:\${2})([^\n`]+?)(?:\${2})/gi,Y=0,w=function(){return"__special_katext_id_".concat(Y++,"__")},C={};function J(){return C}function z(){Y=0,C={}}function E(d){return d=d.replace(S,function(o,r){var u=w();return C[u]={type:"inline",expression:r},u}),d}var P=b.listitem;b.listitem=function(d){return P(E(d))};var ae=b.paragraph;b.paragraph=function(d){return ae(E(d))};var B=b.tablecell;b.tablecell=function(d,o){return B(E(d),o)},b.code=function(d,o,r){var u=(o||"").match(/\S*/)[0];return u?["latex","katex","math"].indexOf(u)>=0?"<p class='editormd-tex'>".concat(d,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(o,'">').concat(r?d:Object(L.escape)(d,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(r?d:Object(L.escape)(d,!0))+"</code></pre>"},b.heading=function(d,o,r){var u=this.options.headerPrefix+r.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return W.push({anchor:u,level:o,text:d}),"<h"+o+' id="'+u+'">'+d+"</h"+o+">"},F.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),F.a.use({tokenizer:ne,renderer:b});var be=F.a,D=h("SJMd"),p=h("ulZh"),ue=h.n(p),Be=h("m3rI"),Pe=h("Oy/b"),ze=h("p5ED"),Te=h("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var we=function(d,o){return(we=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,u){r.__proto__=u}||function(r,u){for(var v in u)Object.prototype.hasOwnProperty.call(u,v)&&(r[v]=u[v])})(d,o)};function X(d,o){function r(){this.constructor=d}we(d,o),d.prototype=o===null?Object.create(o):(r.prototype=o.prototype,new r)}function K(d,o,r,u){return new(r||(r=Promise))(function(v,c){function oe(Bt){try{_e(u.next(Bt))}catch(Ee){c(Ee)}}function Je(Bt){try{_e(u.throw(Bt))}catch(Ee){c(Ee)}}function _e(Bt){var Ee;Bt.done?v(Bt.value):(Ee=Bt.value,Ee instanceof r?Ee:new r(function(ce){ce(Ee)})).then(oe,Je)}_e((u=u.apply(d,o||[])).next())})}function le(d,o){var r,u,v,c,oe={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return c={next:Je(0),throw:Je(1),return:Je(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function Je(_e){return function(Bt){return function(Ee){if(r)throw new TypeError("Generator is already executing.");for(;oe;)try{if(r=1,u&&(v=2&Ee[0]?u.return:Ee[0]?u.throw||((v=u.return)&&v.call(u),0):u.next)&&!(v=v.call(u,Ee[1])).done)return v;switch(u=0,v&&(Ee=[2&Ee[0],v.value]),Ee[0]){case 0:case 1:v=Ee;break;case 4:return oe.label++,{value:Ee[1],done:!1};case 5:oe.label++,u=Ee[1],Ee=[0];continue;case 7:Ee=oe.ops.pop(),oe.trys.pop();continue;default:if(!(v=oe.trys,(v=v.length>0&&v[v.length-1])||Ee[0]!==6&&Ee[0]!==2)){oe=0;continue}if(Ee[0]===3&&(!v||Ee[1]>v[0]&&Ee[1]<v[3])){oe.label=Ee[1];break}if(Ee[0]===6&&oe.label<v[1]){oe.label=v[1],v=Ee;break}if(v&&oe.label<v[2]){oe.label=v[2],oe.ops.push(Ee);break}v[2]&&oe.ops.pop(),oe.trys.pop();continue}Ee=o.call(d,oe)}catch(ce){Ee=[6,ce],u=0}finally{r=v=0}if(5&Ee[0])throw Ee[1];return{value:Ee[0]?Ee[1]:void 0,done:!0}}([_e,Bt])}}}function N(){for(var d=0,o=0,r=arguments.length;o<r;o++)d+=arguments[o].length;var u=Array(d),v=0;for(o=0;o<r;o++)for(var c=arguments[o],oe=0,Je=c.length;oe<Je;oe++,v++)u[v]=c[oe];return u}var _=function(){function d(){}return d.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},d.setAttributes=function(o,r){for(var u=0,v=r;u<v.length;u++){var c=v[u],oe=c[0],Je=c[1];o.setAttribute(oe,Je)}},d.createRect=function(o,r,u){var v=document.createElementNS("http://www.w3.org/2000/svg","rect");return v.setAttribute("width",o.toString()),v.setAttribute("height",r.toString()),u&&d.setAttributes(v,u),v},d.createLine=function(o,r,u,v,c){var oe=document.createElementNS("http://www.w3.org/2000/svg","line");return oe.setAttribute("x1",o.toString()),oe.setAttribute("y1",r.toString()),oe.setAttribute("x2",u.toString()),oe.setAttribute("y2",v.toString()),c&&d.setAttributes(oe,c),oe},d.createPolygon=function(o,r){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),r&&d.setAttributes(u,r),u},d.createCircle=function(o,r){var u=document.createElementNS("http://www.w3.org/2000/svg","circle");return u.setAttribute("cx",(o/2).toString()),u.setAttribute("cy",(o/2).toString()),u.setAttribute("r",o.toString()),r&&d.setAttributes(u,r),u},d.createEllipse=function(o,r,u){var v=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return v.setAttribute("cx",(o/2).toString()),v.setAttribute("cy",(r/2).toString()),v.setAttribute("rx",(o/2).toString()),v.setAttribute("ry",(r/2).toString()),u&&d.setAttributes(v,u),v},d.createGroup=function(o){var r=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&d.setAttributes(r,o),r},d.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},d.createMarker=function(o,r,u,v,c,oe,Je){var _e=document.createElementNS("http://www.w3.org/2000/svg","marker");return d.setAttributes(_e,[["id",o],["orient",r],["markerWidth",u.toString()],["markerHeight",v.toString()],["refX",c.toString()],["refY",oe.toString()]]),_e.appendChild(Je),_e},d.createText=function(o){var r=document.createElementNS("http://www.w3.org/2000/svg","text");return r.setAttribute("x","0"),r.setAttribute("y","0"),o&&d.setAttributes(r,o),r},d.createTSpan=function(o,r){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,r&&d.setAttributes(u,r),u},d.createImage=function(o){var r=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&d.setAttributes(r,o),r},d.createPoint=function(o,r){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=r,u},d.createPath=function(o,r){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),r&&d.setAttributes(u,r),u},d}(),pe=function(){function d(){}return d.addKey=function(o){d.key=o},Object.defineProperty(d,"isLicensed",{get:function(){return!!d.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(d.key)},enumerable:!1,configurable:!0}),d}(),Ue=function(){function d(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return d.prototype.rasterize=function(o,r,u){var v=this;return new Promise(function(c){var oe=u!==void 0?u:document.createElement("canvas");o===null&&(v.markersOnly=!0,v.naturalSize=!1);var Je=document.createElementNS("http://www.w3.org/2000/svg","svg");Je.setAttribute("xmlns","http://www.w3.org/2000/svg"),Je.setAttribute("width",r.width.baseVal.valueAsString),Je.setAttribute("height",r.height.baseVal.valueAsString),Je.setAttribute("viewBox","0 0 "+r.viewBox.baseVal.width.toString()+" "+r.viewBox.baseVal.height.toString()),Je.innerHTML=r.innerHTML,v.naturalSize===!0?(Je.width.baseVal.value=o.naturalWidth,Je.height.baseVal.value=o.naturalHeight):v.width!==void 0&&v.height!==void 0&&(Je.width.baseVal.value=v.width,Je.height.baseVal.value=v.height),oe.width=Je.width.baseVal.value,oe.height=Je.height.baseVal.value;var _e=Je.outerHTML,Bt=oe.getContext("2d");v.markersOnly!==!0&&Bt.drawImage(o,0,0,oe.width,oe.height);var Ee=window.URL,ce=new Image(oe.width,oe.height);ce.setAttribute("crossOrigin","anonymous");var Ye=new Blob([_e],{type:"image/svg+xml"}),Ot=Ee.createObjectURL(Ye);ce.onload=function(){Bt.drawImage(ce,0,0),Ee.revokeObjectURL(Ot);var Mt=oe.toDataURL(v.imageType,v.imageQuality);c(Mt)},ce.src=Ot})},d}(),Ze=function(){},Ae=function(){function d(o){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(d.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),d.prototype.addClass=function(o){return this.styleSheet===void 0&&this.addStyleSheet(),o.name=""+this.classNamePrefix+o.localName,this.classes.push(o),this.styleSheet.sheet.insertRule("."+o.name+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length),o},d.prototype.addRule=function(o){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(o),this.styleSheet.sheet.insertRule(o.selector+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length)},d.prototype.addStyleSheet=function(){var o;this.styleSheet=document.createElement("style"),((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).appendChild(this.styleSheet),this.addRule(new De("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new De("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new De("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Re("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Re("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},d.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},d}(),De=function(d,o){this.selector=d,this.style=o},Re=function(d,o){this.localName=d,this.style=o},Me=function(){function d(o,r,u,v,c){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=o,this.displayMode=r,this.markerItems=u,this.uiStyleSettings=v,this.styles=c,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return d.prototype.show=function(o){var r=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var u=document.createElement("div");u.className=this.toolbarBlockStyleClass.name,u.style.whiteSpace="nowrap",this.uiContainer.appendChild(u),this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(c){var oe=document.createElement("div");oe.className=""+r.toolbarButtonStyleClass.name,oe.setAttribute("data-type-name",c.typeName),oe.innerHTML=c.icon,oe.addEventListener("click",function(){r.markerToolbarButtonClicked(oe,c)}),r.buttons.push(oe),r.markerButtons.push(oe)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var v=document.createElement("div");v.className=this.toolbarBlockStyleClass.name,v.style.whiteSpace="nowrap",v.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(v),this.addActionButton(v,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(v,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},d.prototype.addButtonClickListener=function(o){this.buttonClickListeners.push(o)},d.prototype.removeButtonClickListener=function(o){this.buttonClickListeners.indexOf(o)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(o),1)},d.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},d.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var o=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var r=0;r<this.markerButtons.length;r++)r<o||r===o&&this.markerButtons.length-1===o?this.markerButtonBlock.appendChild(this.markerButtons[r]):(r===o&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[r]))}},d.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},d.prototype.resetButtonStyles=function(){var o=this;this.buttons.forEach(function(r){r.className=r.className.replace(o.uiStyleSettings.toolbarButtonStyleColorsClassName?o.uiStyleSettings.toolbarButtonStyleColorsClassName:o.toolbarButtonStyleColorsClass.name,"").trim(),r.className=r.className.replace(o.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?o.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:o.toolbarActiveButtonStyleColorsClass.name,"").trim(),r.className+=" "+(o.uiStyleSettings.toolbarButtonStyleColorsClassName?o.uiStyleSettings.toolbarButtonStyleColorsClassName:o.toolbarButtonStyleColorsClass.name)})},d.prototype.addActionButton=function(o,r,u){var v=this,c=document.createElement("div");switch(c.className=""+this.toolbarButtonStyleClass.name,c.innerHTML=r,c.setAttribute("data-action",u),c.addEventListener("click",function(){v.actionToolbarButtonClicked(c,u)}),u){case"select":c.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":c.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":c.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":c.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":c.style.fill=this.uiStyleSettings.closeButtonColor}o.appendChild(c),this.buttons.push(c)},d.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Re("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Re("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Re("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Re("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new Re("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var o=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Re("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*o)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*o)+`px;
padding: `+o+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Re("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Re("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new De("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new De("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},d.prototype.markerToolbarButtonClicked=function(o,r){this.setActiveButton(o),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("marker",r)}),this.markerButtonOverflowBlock.style.display="none"},d.prototype.actionToolbarButtonClicked=function(o,r){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("action",r)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},d.prototype.setActiveButton=function(o){this.resetButtonStyles(),o.className=o.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),o.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},d.prototype.setActiveMarkerButton=function(o){var r=this.markerButtons.find(function(u){return u.getAttribute("data-type-name")===o});r&&this.setActiveButton(r)},d.prototype.setCurrentMarker=function(o){var r=this;this.currentMarker=o,this.buttons.filter(function(u){return/delete|notes/.test(u.getAttribute("data-action"))}).forEach(function(u){r.currentMarker===void 0?(u.style.fillOpacity="0.4",u.style.pointerEvents="none"):(u.style.fillOpacity="1",u.style.pointerEvents="all")})},d}(),Xe=function(){function d(o,r,u,v){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=r,this.uiStyleSettings=u,this.styles=v,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return d.prototype.addStyles=function(){var o;this.toolboxStyleClass=this.styles.addClass(new Re("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new Re("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var r=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Re("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Re("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Re("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new Re("toolbox-panel-row_colors",`
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Re("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*r)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*r)+`px;
padding: `+r+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Re("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Re("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new De("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new De("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},d.prototype.show=function(o){var r;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolboxStyleClass.name+" "+((r=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&r!==void 0?r:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},d.prototype.setPanelButtons=function(o){var r,u,v=this;this.panels=o,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((r=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&r!==void 0?r:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((u=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&u!==void 0?u:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(c){var oe;c.uiStyleSettings=v.uiStyleSettings;var Je=document.createElement("div");Je.className=v.toolboxButtonStyleClass.name+" "+((oe=v.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&oe!==void 0?oe:v.toolboxButtonStyleColorsClass.name),Je.innerHTML=c.icon,Je.title=c.title,Je.addEventListener("click",function(){v.panelButtonClick(c)}),v.panelButtons.push(Je),v.buttonRow.appendChild(Je)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},d.prototype.panelButtonClick=function(o){var r=this,u=-1;if(o!==this.activePanel){u=this.panels.indexOf(o),this.panelRow.innerHTML="";var v=o.getUi();v.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(v),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=o}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){r.displayMode==="inline"?r.panelRow.style.display="none":r.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(c,oe){var Je,_e;c.className=r.toolboxButtonStyleClass.name+" "+(oe===u?""+((Je=r.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Je!==void 0?Je:r.toolboxActiveButtonStyleColorsClass.name):""+((_e=r.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&_e!==void 0?_e:r.toolboxButtonStyleColorsClass.name))})},d}(),qe=function(d,o){this.title=d,this.icon=o},ot=function(d){function o(r,u,v,c){var oe=d.call(this,r,c||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return oe.colors=[],oe.addTransparent=!1,oe.colorBoxes=[],oe.colors=u,oe.currentColor=v,oe.setCurrentColor=oe.setCurrentColor.bind(oe),oe.getColorBox=oe.getColorBox.bind(oe),oe}return X(o,d),o.prototype.getUi=function(){var r=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.whiteSpace="nowrap",this.colors.forEach(function(v){var c=r.getColorBox(v);u.appendChild(c),r.colorBoxes.push(c)}),u},o.prototype.getColorBox=function(r){var u=this,v=this.uiStyleSettings.toolbarHeight/4,c=this.uiStyleSettings.toolbarHeight-v,oe=document.createElement("div");oe.style.display="inline-block",oe.style.boxSizing="content-box",oe.style.width=c-2+"px",oe.style.height=c-2+"px",oe.style.padding="1px",oe.style.marginRight="2px",oe.style.marginBottom="2px",oe.style.borderWidth="2px",oe.style.borderStyle="solid",oe.style.borderRadius=(c+2)/2+"px",oe.style.borderColor=r===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",oe.addEventListener("click",function(){u.setCurrentColor(r,oe)});var Je=document.createElement("div");return Je.style.display="inline-block",Je.style.width=c-2+"px",Je.style.height=c-2+"px",Je.style.backgroundColor=r,Je.style.borderRadius=c/2+"px",r==="transparent"&&(Je.style.fill=this.uiStyleSettings.toolboxAccentColor,Je.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),oe.appendChild(Je),oe},o.prototype.setCurrentColor=function(r,u){var v=this;this.currentColor=r,this.colorBoxes.forEach(function(c){c.style.borderColor=c===u?v.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(r)},o}(qe),Ke=function(){function d(o,r,u){this._state="new",this._isSelected=!1,this._container=o,this._overlayContainer=r,this.globalSettings=u,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(d.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),d.prototype.ownsTarget=function(o){return!1},Object.defineProperty(d.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),d.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},d.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},d.prototype.pointerDown=function(o,r){},d.prototype.dblClick=function(o,r){},d.prototype.manipulate=function(o){},d.prototype.pointerUp=function(o){this.stateChanged()},d.prototype.dispose=function(){},d.prototype.addMarkerVisualToContainer=function(o){this.container.childNodes.length>0?this.container.insertBefore(o,this.container.childNodes[0]):this.container.appendChild(o)},d.prototype.getState=function(){return{typeName:d.typeName,state:this.state,notes:this.notes}},d.prototype.restoreState=function(o){this._state=o.state,this.notes=o.notes},d.prototype.scale=function(o,r){},d.prototype.colorChanged=function(o){this.onColorChanged&&this.onColorChanged(o),this.stateChanged()},d.prototype.fillColorChanged=function(o){this.onFillColorChanged&&this.onFillColorChanged(o),this.stateChanged()},d.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var o=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),o.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(o)&&this.onStateChanged(this)}},d.typeName="MarkerBase",d}(),Ve=function(){function d(){this.findGripByVisual=this.findGripByVisual.bind(this)}return d.prototype.findGripByVisual=function(o){return this.topLeft.ownsTarget(o)?this.topLeft:this.topCenter.ownsTarget(o)?this.topCenter:this.topRight.ownsTarget(o)?this.topRight:this.centerLeft.ownsTarget(o)?this.centerLeft:this.centerRight.ownsTarget(o)?this.centerRight:this.bottomLeft.ownsTarget(o)?this.bottomLeft:this.bottomCenter.ownsTarget(o)?this.bottomCenter:this.bottomRight.ownsTarget(o)?this.bottomRight:void 0},d}(),At=function(){function d(){this.GRIP_SIZE=10,this.visual=_.createGroup(),this.visual.appendChild(_.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(_.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return d.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},d}(),gt=function(){function d(){}return d.toITransformMatrix=function(o){return{a:o.a,b:o.b,c:o.c,d:o.d,e:o.e,f:o.f}},d.toSVGMatrix=function(o,r){return o.a=r.a,o.b=r.b,o.c=r.c,o.d=r.d,o.e=r.e,o.f=r.f,o},d}(),kt=function(d){function o(r,u,v){var c=d.call(this,r,u,v)||this;return c.left=0,c.top=0,c.width=0,c.height=0,c.defaultSize={x:50,y:20},c.offsetX=0,c.offsetY=0,c.rotationAngle=0,c.CB_DISTANCE=10,c._suppressMarkerCreateEvent=!1,c.container.transform.baseVal.appendItem(_.createTransform()),c.setupControlBox(),c}return X(o,d),Object.defineProperty(o.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"visual",{get:function(){return this._visual},set:function(r){this._visual=r;var u=_.createTransform();this._visual.transform.baseVal.appendItem(u)},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(r){return!!d.prototype.ownsTarget.call(this,r)||!!(this.controlGrips.findGripByVisual(r)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(r))},o.prototype.pointerDown=function(r,u){d.prototype.pointerDown.call(this,r,u),this.state==="new"&&(this.left=r.x,this.top=r.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var v=this.unrotatePoint(r);if(this.manipulationStartX=v.x,this.manipulationStartY=v.y,this.offsetX=v.x-this.left,this.offsetY=v.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(u),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(u)){this.activeGrip=this.rotatorGrip;var c=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=c.x-this.width/2,this.top=c.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var oe=this.container.transform.baseVal.getItem(0);oe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(oe,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},o.prototype.pointerUp=function(r){var u=this.state;d.prototype.pointerUp.call(this,r),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(r),this._state="select",u==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},o.prototype.moveVisual=function(r){this.visual.style.transform="translate("+r.x+"px, "+r.y+"px)"},o.prototype.manipulate=function(r){var u=this.unrotatePoint(r);this.state==="creating"?this.resize(r):this.state==="move"?(this.left=this.manipulationStartLeft+(u.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(u.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(u):this.state==="rotate"&&this.rotate(r)},o.prototype.resize=function(r){var u=this.manipulationStartLeft,v=this.manipulationStartWidth,c=this.manipulationStartTop,oe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:u=this.manipulationStartLeft+r.x-this.manipulationStartX,v=this.manipulationStartWidth+this.manipulationStartLeft-u;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:v=this.manipulationStartWidth+r.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:c=this.manipulationStartTop+r.y-this.manipulationStartY,oe=this.manipulationStartHeight+this.manipulationStartTop-c;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:oe=this.manipulationStartHeight+r.y-this.manipulationStartY}v>=0?(this.left=u,this.width=v):(this.left=u+v,this.width=-v),oe>=0?(this.top=c,this.height=oe):(this.top=c+oe,this.height=-oe),this.setSize()},o.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},o.prototype.rotate=function(r){if(Math.abs(r.x-this.centerX)>.1){var u=Math.sign(r.x-this.centerX);this.rotationAngle=180*Math.atan((r.y-this.centerY)/(r.x-this.centerX))/Math.PI+90*u,this.applyRotation()}},o.prototype.applyRotation=function(){var r=this.container.transform.baseVal.getItem(0);r.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(r,0)},o.prototype.rotatePoint=function(r){if(this.rotationAngle===0)return r;var u=this.container.getCTM(),v=_.createPoint(r.x,r.y);return{x:(v=v.matrixTransform(u)).x,y:v.y}},o.prototype.unrotatePoint=function(r){if(this.rotationAngle===0)return r;var u=this.container.getCTM();u=u.inverse();var v=_.createPoint(r.x,r.y);return{x:(v=v.matrixTransform(u)).x,y:v.y}},o.prototype.select=function(){d.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){d.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=_.createGroup();var r=_.createTransform();r.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(r),this.container.appendChild(this.controlBox),this.controlRect=_.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=_.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Ve,this.addControlGrips(),this.controlBox.style.display="none"},o.prototype.adjustControlBox=function(){var r=this.controlBox.transform.baseVal.getItem(0);r.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(r,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},o.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},o.prototype.createGrip=function(){var r=new At;return r.visual.transform.baseVal.appendItem(_.createTransform()),this.controlBox.appendChild(r.visual),r},o.prototype.positionGrips=function(){var r=this.controlGrips.topLeft.GRIP_SIZE,u=-r/2,v=u,c=(this.width+this.CB_DISTANCE)/2-r/2,oe=(this.height+this.CB_DISTANCE)/2-r/2,Je=this.height+this.CB_DISTANCE-r/2,_e=this.width+this.CB_DISTANCE-r/2;this.positionGrip(this.controlGrips.topLeft.visual,u,v),this.positionGrip(this.controlGrips.topCenter.visual,c,v),this.positionGrip(this.controlGrips.topRight.visual,_e,v),this.positionGrip(this.controlGrips.centerLeft.visual,u,oe),this.positionGrip(this.controlGrips.centerRight.visual,_e,oe),this.positionGrip(this.controlGrips.bottomLeft.visual,u,Je),this.positionGrip(this.controlGrips.bottomCenter.visual,c,Je),this.positionGrip(this.controlGrips.bottomRight.visual,_e,Je),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,c,v-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(r,u,v){var c=r.transform.baseVal.getItem(0);c.setTranslate(u,v),r.transform.baseVal.replaceItem(c,0)},o.prototype.hideControlBox=function(){this.controlBox.style.display="none"},o.prototype.showControlBox=function(){this.controlBox.style.display=""},o.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:gt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:gt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},d.prototype.getState.call(this))},o.prototype.restoreState=function(r){d.prototype.restoreState.call(this,r);var u=r;this.left=u.left,this.top=u.top,this.width=u.width,this.height=u.height,this.rotationAngle=u.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(gt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(gt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},o.prototype.scale=function(r,u){d.prototype.scale.call(this,r,u);var v=this.rotatePoint({x:this.left,y:this.top}),c=this.unrotatePoint({x:v.x*r,y:v.y*u});this.left=c.x,this.top=c.y,this.width=this.width*r,this.height=this.height*u,this.adjustControlBox()},o}(Ke),ct=function(d){function o(r,u,v){var c=d.call(this,r,u,v)||this;return c.fillColor="transparent",c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.opacity=1,c.setStrokeColor=c.setStrokeColor.bind(c),c.setFillColor=c.setFillColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.createVisual=c.createVisual.bind(c),c}return X(o,d),o.prototype.ownsTarget=function(r){return!(!d.prototype.ownsTarget.call(this,r)&&r!==this.visual)},o.prototype.createVisual=function(){this.visual=_.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(r,u){d.prototype.pointerDown.call(this,r,u),this.state==="new"&&(this.createVisual(),this.moveVisual(r),this._state="creating")},o.prototype.manipulate=function(r){d.prototype.manipulate.call(this,r)},o.prototype.resize=function(r){d.prototype.resize.call(this,r),this.setSize()},o.prototype.setSize=function(){d.prototype.setSize.call(this),_.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(r){d.prototype.pointerUp.call(this,r),this.setSize()},o.prototype.setStrokeColor=function(r){this.strokeColor=r,this.visual&&_.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(r),this.stateChanged()},o.prototype.setFillColor=function(r){this.fillColor=r,this.visual&&_.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(r){this.strokeWidth=r,this.visual&&_.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(r){this.strokeDasharray=r,this.visual&&_.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},d.prototype.getState.call(this))},o.prototype.restoreState=function(r){var u=r;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),d.prototype.restoreState.call(this,r),this.setSize()},o.prototype.scale=function(r,u){d.prototype.scale.call(this,r,u),this.setSize()},o.title="Rectangle marker",o}(kt),Pt=function(d){function o(r,u,v,c){var oe=d.call(this,r,c||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return oe.widths=[],oe.widthBoxes=[],oe.widths=u,oe.currentWidth=v,oe.setCurrentWidth=oe.setCurrentWidth.bind(oe),oe}return X(o,d),o.prototype.getUi=function(){var r=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.widths.forEach(function(v){var c=document.createElement("div");c.style.display="flex",c.style.flexGrow="2",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.borderColor=v===r.currentWidth?r.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){r.setCurrentWidth(v,c)}),u.appendChild(c);var oe=document.createElement("div");oe.innerText=v.toString(),oe.style.marginRight="5px",c.appendChild(oe);var Je=document.createElement("div");Je.style.minHeight="20px",Je.style.flexGrow="2",Je.style.display="flex",Je.style.alignItems="center";var _e=document.createElement("hr");_e.style.minWidth="20px",_e.style.border="0px",_e.style.borderTop=v+"px solid "+r.uiStyleSettings.toolboxColor,_e.style.flexGrow="2",Je.appendChild(_e),c.appendChild(Je),r.widthBoxes.push(c)}),u},o.prototype.setCurrentWidth=function(r,u){var v=this;this.currentWidth=r,this.widthBoxes.forEach(function(c){c.style.borderColor=c===u?v.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(qe),xt=function(d){function o(r,u,v,c){var oe=d.call(this,r,c||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return oe.styles=[],oe.styleBoxes=[],oe.styles=u,oe.currentStyle=v,oe.setCurrentStyle=oe.setCurrentStyle.bind(oe),oe}return X(o,d),o.prototype.getUi=function(){var r=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.styles.forEach(function(v){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.overflow="hidden",c.style.maxWidth=100/r.styles.length-5+"%",c.style.borderColor=v===r.currentStyle?r.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){r.setCurrentStyle(v,c)}),u.appendChild(c);var oe=document.createElement("div");oe.style.minHeight="20px",oe.style.flexGrow="2",oe.style.overflow="hidden";var Je=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+r.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(v!==""?'stroke-dasharray="'+v+'"':"")+` />
</svg>`;oe.innerHTML=Je,c.appendChild(oe),r.styleBoxes.push(c)}),u},o.prototype.setCurrentStyle=function(r,u){var v=this;this.currentStyle=r,this.styleBoxes.forEach(function(c){c.style.borderColor=c===u?v.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(qe),bt=function(d){function o(r,u,v){var c=d.call(this,r,u,v)||this;return c.strokeColor=v.defaultColor,c.strokeWidth=v.defaultStrokeWidth,c.strokeDasharray=v.defaultStrokeDasharray,c.strokePanel=new ot("Line color",v.defaultColorSet,v.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Pt("Line width",v.defaultStrokeWidths,v.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new xt("Line style",v.defaultStrokeDasharrays,v.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return X(o,d),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=d.prototype.getState.call(this);return r.typeName=o.typeName,r},o.typeName="FrameMarker",o.title="Frame marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',o}(ct),Ne=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},Ut=function(d){function o(r,u,v){var c=d.call(this,r,u,v)||this;return c.x1=0,c.y1=0,c.x2=0,c.y2=0,c.defaultLength=50,c.manipulationStartX=0,c.manipulationStartY=0,c.manipulationStartX1=0,c.manipulationStartY1=0,c.manipulationStartX2=0,c.manipulationStartY2=0,c.setupControlBox(),c}return X(o,d),o.prototype.ownsTarget=function(r){return!!d.prototype.ownsTarget.call(this,r)||!(!this.grip1.ownsTarget(r)&&!this.grip2.ownsTarget(r))},o.prototype.pointerDown=function(r,u){d.prototype.pointerDown.call(this,r,u),this.manipulationStartX=r.x,this.manipulationStartY=r.y,this.state==="new"&&(this.x1=r.x,this.y1=r.y,this.x2=r.x,this.y2=r.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(u)?this.activeGrip=this.grip1:this.grip2.ownsTarget(u)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},o.prototype.pointerUp=function(r){var u=this.state;d.prototype.pointerUp.call(this,r),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(r),this._state="select",u==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},o.prototype.adjustVisual=function(){},o.prototype.manipulate=function(r){this.state==="creating"?this.resize(r):this.state==="move"?(this.x1=this.manipulationStartX1+r.x-this.manipulationStartX,this.y1=this.manipulationStartY1+r.y-this.manipulationStartY,this.x2=this.manipulationStartX2+r.x-this.manipulationStartX,this.y2=this.manipulationStartY2+r.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(r)},o.prototype.resize=function(r){switch(this.activeGrip){case this.grip1:this.x1=r.x,this.y1=r.y;break;case this.grip2:case void 0:this.x2=r.x,this.y2=r.y}this.adjustVisual(),this.adjustControlBox()},o.prototype.select=function(){d.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){d.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=_.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},o.prototype.adjustControlBox=function(){this.positionGrips()},o.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},o.prototype.createGrip=function(){var r=new At;return r.visual.transform.baseVal.appendItem(_.createTransform()),this.controlBox.appendChild(r.visual),r},o.prototype.positionGrips=function(){var r=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-r/2,this.y1-r/2),this.positionGrip(this.grip2.visual,this.x2-r/2,this.y2-r/2)},o.prototype.positionGrip=function(r,u,v){var c=r.transform.baseVal.getItem(0);c.setTranslate(u,v),r.transform.baseVal.replaceItem(c,0)},o.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},d.prototype.getState.call(this))},o.prototype.restoreState=function(r){d.prototype.restoreState.call(this,r);var u=r;this.x1=u.x1,this.y1=u.y1,this.x2=u.x2,this.y2=u.y2},o.prototype.scale=function(r,u){d.prototype.scale.call(this,r,u),this.x1=this.x1*r,this.y1=this.y1*u,this.x2=this.x2*r,this.y2=this.y2*u,this.adjustVisual(),this.adjustControlBox()},o}(Ke),Rt=function(d){function o(r,u,v){var c=d.call(this,r,u,v)||this;return c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.setStrokeColor=c.setStrokeColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.strokeColor=v.defaultColor,c.strokeWidth=v.defaultStrokeWidth,c.strokeDasharray=v.defaultStrokeDasharray,c.strokePanel=new ot("Line color",v.defaultColorSet,v.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Pt("Line width",v.defaultStrokeWidths,v.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new xt("Line style",v.defaultStrokeDasharrays,v.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return X(o,d),o.prototype.ownsTarget=function(r){return!(!d.prototype.ownsTarget.call(this,r)&&r!==this.visual&&r!==this.selectorLine&&r!==this.visibleLine)},o.prototype.createVisual=function(){this.visual=_.createGroup(),this.selectorLine=_.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=_.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(r,u){d.prototype.pointerDown.call(this,r,u),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},o.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),_.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),_.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),_.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setStrokeColor=function(r){this.strokeColor=r,this.adjustVisual(),this.colorChanged(r)},o.prototype.setStrokeWidth=function(r){this.strokeWidth=r,this.adjustVisual()},o.prototype.setStrokeDasharray=function(r){this.strokeDasharray=r,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},d.prototype.getState.call(this));return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){d.prototype.restoreState.call(this,r);var u=r;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.createVisual(),this.adjustVisual()},o.typeName="LineMarker",o.title="Line marker",o.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',o}(Ut),je=function(d){function o(r,u,v,c){var oe=d.call(this,r,c||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return oe.fonts=[],oe.fontBoxes=[],oe.fonts=u,oe.currentFont=v,oe.setCurrentFont=oe.setCurrentFont.bind(oe),oe}return X(o,d),o.prototype.getUi=function(){var r=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.flexGrow="2",this.fonts.forEach(function(v){var c=document.createElement("div");c.style.display="inline-block",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.overflow="hidden",c.style.maxWidth=100/r.fonts.length-5+"%",c.style.borderColor=v===r.currentFont?r.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){r.setCurrentFont(v,c)}),u.appendChild(c);var oe=document.createElement("div");oe.style.display="flex",oe.style.minHeight="20px",oe.style.flexGrow="2",oe.style.fontFamily=v,oe.style.overflow="hidden";var Je=document.createElement("div");Je.style.whiteSpace="nowrap",Je.style.overflow="hidden",Je.style.textOverflow="ellipsis",Je.innerHTML="The quick brown fox jumps over the lazy dog",oe.appendChild(Je),c.appendChild(oe),r.fontBoxes.push(c)}),u},o.prototype.setCurrentFont=function(r,u){var v=this;this.currentFont=r,this.fontBoxes.forEach(function(c){c.style.borderColor=c===u?v.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(qe),We=function(d){function o(r,u,v){var c=d.call(this,r,u,v)||this;return c.color="transparent",c.padding=5,c.DEFAULT_TEXT="your text here",c.text=c.DEFAULT_TEXT,c.isMoved=!1,c.color=v.defaultColor,c.fontFamily=v.defaultFontFamily,c.defaultSize={x:100,y:30},c.setColor=c.setColor.bind(c),c.setFont=c.setFont.bind(c),c.renderText=c.renderText.bind(c),c.sizeText=c.sizeText.bind(c),c.textEditDivClicked=c.textEditDivClicked.bind(c),c.showTextEditor=c.showTextEditor.bind(c),c.setSize=c.setSize.bind(c),c.positionTextEditor=c.positionTextEditor.bind(c),c.colorPanel=new ot("Color",v.defaultColorSet,v.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.fontFamilyPanel=new je("Font",v.defaultFontFamilies,v.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c}return X(o,d),o.prototype.ownsTarget=function(r){if(d.prototype.ownsTarget.call(this,r)||r===this.visual||r===this.textElement||r===this.bgRectangle)return!0;var u=!1;return this.textElement.childNodes.forEach(function(v){v===r&&(u=!0)}),u},o.prototype.createVisual=function(){this.visual=_.createGroup(),this.bgRectangle=_.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=_.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(_.createTransform()),this.textElement.transform.baseVal.appendItem(_.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},o.prototype.pointerDown=function(r,u){d.prototype.pointerDown.call(this,r,u),this.isMoved=!1,this.pointerDownPoint=r,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(r),this._state="creating")},o.prototype.renderText=function(){var r=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(u){r.textElement.appendChild(_.createTSpan(u.trim()===""?" ":u.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},o.prototype.getTextScale=function(){var r=this.textElement.getBBox(),u=1;if(r.width>0&&r.height>0){var v=(1*this.width-this.width*this.padding*2/100)/r.width,c=(1*this.height-this.height*this.padding*2/100)/r.height;u=Math.min(v,c)}return u},o.prototype.getTextPosition=function(r){var u=this.textElement.getBBox(),v=0,c=0;return u.width>0&&u.height>0&&(v=(this.width-u.width*r)/2,c=this.height/2-u.height*r/2),{x:v,y:c}},o.prototype.sizeText=function(){var r=this.textElement.getBBox(),u=this.getTextScale(),v=this.getTextPosition(u);v.y-=r.y*u,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+v.x+"px, "+v.y+"px) scale("+u+", "+u+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(v.x,v.y),this.textElement.transform.baseVal.getItem(1).setScale(u,u))},o.prototype.manipulate=function(r){d.prototype.manipulate.call(this,r),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(r.x-this.pointerDownPoint.x)>5||Math.abs(r.y-this.pointerDownPoint.y)>5)},o.prototype.resize=function(r){d.prototype.resize.call(this,r),this.isMoved=!0,this.setSize(),this.sizeText()},o.prototype.setSize=function(){d.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(_.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),_.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},o.prototype.pointerUp=function(r){var u=this.state;u==="creating"&&(this._suppressMarkerCreateEvent=!0),d.prototype.pointerUp.call(this,r),this.setSize(),(u==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},o.prototype.showTextEditor=function(){var r=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(u){u.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var u=Number.parseFloat(r.textEditor.style.fontSize);r.textEditor.clientWidth>=Number.parseInt(r.textEditor.style.maxWidth)&&u>.9;)u-=.1,r.textEditor.style.fontSize=Math.max(u,.9)+"em"}),this.textEditor.addEventListener("keyup",function(u){u.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(u){if(u.clipboardData){var v=u.clipboardData.getData("text"),c=window.getSelection();if(!c.rangeCount)return!1;c.deleteFromDocument(),c.getRangeAt(0).insertNode(document.createTextNode(v)),u.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){r.textEditDivClicked(r.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},o.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var r=this.getTextScale(),u=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),v=this.textElement.getBBox(),c={x:v.width*r,y:v.height*r};u.x-=c.x/2,u.y-=c.y/2,this.textEditor.style.top=u.y+"px",this.textEditor.style.left=u.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-u.x+"px",this.textEditor.style.fontSize=Math.max(16*r,12)+"px",this.textElement.style.display="none"}},o.prototype.textEditDivClicked=function(r){this.text=r.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},o.prototype.select=function(){d.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},o.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),d.prototype.deselect.call(this)},o.prototype.dblClick=function(r,u){d.prototype.dblClick.call(this,r,u),this.showTextEditor()},o.prototype.setColor=function(r){this.textElement&&_.setAttributes(this.textElement,[["fill",r]]),this.color=r,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(r)},o.prototype.setFont=function(r){this.textElement&&_.setAttributes(this.textElement,[["font-family",r]]),this.fontFamily=r,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},o.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},o.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},d.prototype.getState.call(this));return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){var u=r;this.color=u.color,this.fontFamily=u.fontFamily,this.padding=u.padding,this.text=u.text,this.createVisual(),d.prototype.restoreState.call(this,r),this.setSize()},o.prototype.scale=function(r,u){d.prototype.scale.call(this,r,u),this.setSize(),this.sizeText(),this.positionTextEditor()},o.typeName="TextMarker",o.title="Text marker",o.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',o}(kt),$=function(d){function o(r,u,v){var c=d.call(this,r,u,v)||this;return c.color="transparent",c.lineWidth=3,c.drawing=!1,c.pixelRatio=1,c.color=v.defaultColor,c.lineWidth=v.defaultStrokeWidth,c.pixelRatio=v.freehandPixelRatio,c.setColor=c.setColor.bind(c),c.addCanvas=c.addCanvas.bind(c),c.finishCreation=c.finishCreation.bind(c),c.setLineWidth=c.setLineWidth.bind(c),c.colorPanel=new ot("Color",v.defaultColorSet,v.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.lineWidthPanel=new Pt("Line width",v.defaultStrokeWidths,v.defaultStrokeWidth),c.lineWidthPanel.onWidthChanged=c.setLineWidth,c}return X(o,d),o.prototype.ownsTarget=function(r){return!(!d.prototype.ownsTarget.call(this,r)&&r!==this.visual&&r!==this.drawingImage)},o.prototype.createVisual=function(){this.visual=_.createGroup(),this.drawingImage=_.createImage(),this.visual.appendChild(this.drawingImage);var r=_.createTransform();this.visual.transform.baseVal.appendItem(r),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(r,u){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(r.x,r.y),this.drawing=!0):d.prototype.pointerDown.call(this,r,u)},o.prototype.manipulate=function(r){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(r.x,r.y),this.canvasContext.stroke()):d.prototype.manipulate.call(this,r)},o.prototype.resize=function(r){d.prototype.resize.call(this,r),_.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),_.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(r){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):d.prototype.pointerUp.call(this,r)},o.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},o.prototype.select=function(){this.state==="creating"&&this.finishCreation(),d.prototype.select.call(this)},o.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),d.prototype.deselect.call(this)},o.prototype.finishCreation=function(){for(var r=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),u=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],v=u[0],c=u[1],oe=u[2],Je=u[3],_e=!1,Bt=0;Bt<this.canvasElement.height;Bt++)for(var Ee=0;Ee<this.canvasElement.width;Ee++)r.data[Bt*this.canvasElement.width*4+4*Ee+3]>0&&(_e=!0,Bt<c&&(c=Bt),Ee<v&&(v=Ee),Bt>Je&&(Je=Bt),Ee>oe&&(oe=Ee));if(_e){this.left=v/this.pixelRatio,this.top=c/this.pixelRatio,this.width=(oe-v)/this.pixelRatio,this.height=(Je-c)/this.pixelRatio;var ce=document.createElement("canvas");ce.width=oe-v,ce.height=Je-c,ce.getContext("2d").putImageData(this.canvasContext.getImageData(v,c,oe-v,Je-c),0,0),this.drawingImgUrl=ce.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){_.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),_.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},o.prototype.setColor=function(r){this.color=r,this.colorChanged(r)},o.prototype.setLineWidth=function(r){this.lineWidth=r},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=Object.assign({drawingImgUrl:this.drawingImgUrl},d.prototype.getState.call(this));return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){this.createVisual(),d.prototype.restoreState.call(this,r),this.drawingImgUrl=r.drawingImgUrl,this.setDrawingImage()},o.prototype.scale=function(r,u){d.prototype.scale.call(this,r,u),this.setDrawingImage()},o.typeName="FreehandMarker",o.title="Freehand marker",o.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',o}(kt),q=function(d){function o(r,u,v){var c=d.call(this,r,v||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return c.typeBoxes=[],c.currentType=u,c.setCurrentType=c.setCurrentType.bind(c),c}return X(o,d),o.prototype.getUi=function(){var r=this,u=document.createElement("div");u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2";for(var v=function(Je){var _e="both";switch(Je){case 0:_e="both";break;case 1:_e="start";break;case 2:_e="end";break;case 3:_e="none"}var Bt=document.createElement("div");if(Bt.style.display="flex",Bt.style.flexGrow="2",Bt.style.alignItems="center",Bt.style.justifyContent="space-between",Bt.style.padding="5px",Bt.style.borderWidth="2px",Bt.style.borderStyle="solid",Bt.style.borderColor=_e===c.currentType?c.uiStyleSettings.toolboxAccentColor:"transparent",Bt.addEventListener("click",function(){r.setCurrentType(_e,Bt)}),u.appendChild(Bt),_e==="both"||_e==="start"){var Ee=document.createElement("div");Ee.style.display="flex",Ee.style.alignItems="center",Ee.style.minHeight="20px",Ee.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Ee.style.marginLeft="5px",Bt.appendChild(Ee)}var ce=document.createElement("div");ce.style.display="flex",ce.style.alignItems="center",ce.style.minHeight="20px",ce.style.flexGrow="2";var Ye=document.createElement("hr");if(Ye.style.minWidth="20px",Ye.style.border="0px",Ye.style.borderTop="3px solid "+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee"),Ye.style.flexGrow="2",ce.appendChild(Ye),Bt.appendChild(ce),_e==="both"||_e==="end"){var Ot=document.createElement("div");Ot.style.display="flex",Ot.style.alignItems="center",Ot.style.minHeight="20px",Ot.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Ot.style.marginRight="5px",Bt.appendChild(Ot)}c.typeBoxes.push(Bt)},c=this,oe=0;oe<4;oe++)v(oe);return u},o.prototype.setCurrentType=function(r,u){var v=this;this.currentType=r,this.typeBoxes.forEach(function(c){c.style.borderColor=c===u?v.uiStyleSettings!==void 0?v.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(qe),Q=function(d){function o(r,u,v){var c=d.call(this,r,u,v)||this;return c.arrowType="end",c.arrowBaseHeight=10,c.arrowBaseWidth=10,c.getArrowPoints=c.getArrowPoints.bind(c),c.setArrowType=c.setArrowType.bind(c),c.arrowTypePanel=new q("Arrow type","end"),c.arrowTypePanel.onArrowTypeChanged=c.setArrowType,c}return X(o,d),o.prototype.ownsTarget=function(r){return!(!d.prototype.ownsTarget.call(this,r)&&r!==this.arrow1&&r!==this.arrow2)},o.prototype.getArrowPoints=function(r,u){var v=this.arrowBaseWidth+2*this.strokeWidth,c=this.arrowBaseHeight+2*this.strokeWidth;return r-v/2+","+(u+c/2)+" "+r+","+(u-c/2)+" "+(r+v/2)+","+(u+c/2)},o.prototype.createTips=function(){this.arrow1=_.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(_.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=_.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(_.createTransform()),this.visual.appendChild(this.arrow2)},o.prototype.pointerDown=function(r,u){d.prototype.pointerDown.call(this,r,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(d.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",_.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),_.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var r=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),u=this.arrow1.transform.baseVal.getItem(0);u.setRotate(r,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(u,0);var v=this.arrow2.transform.baseVal.getItem(0);v.setRotate(r+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(v,0)}},o.prototype.setArrowType=function(r){this.arrowType=r,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=Object.assign({arrowType:this.arrowType},d.prototype.getState.call(this));return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){d.prototype.restoreState.call(this,r);var u=r;this.arrowType=u.arrowType,this.createTips(),this.adjustVisual()},o.typeName="ArrowMarker",o.title="Arrow marker",o.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',o}(Rt),x=function(d){function o(r,u,v){var c=d.call(this,r,u,v)||this;return c.fillColor=v.defaultFillColor,c.strokeWidth=0,c.fillPanel=new ot("Color",v.defaultColorSet,v.defaultFillColor),c.fillPanel.onColorChanged=c.setFillColor,c}return X(o,d),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=d.prototype.getState.call(this);return r.typeName=o.typeName,r},o.typeName="CoverMarker",o.title="Cover marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',o}(ct),R=function(d){function o(r,u,v,c){var oe=d.call(this,r,c||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return oe.opacities=[],oe.opacityBoxes=[],oe.opacities=u,oe.currentOpacity=v,oe.setCurrentOpacity=oe.setCurrentOpacity.bind(oe),oe}return X(o,d),o.prototype.getUi=function(){var r=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",u.style.justifyContent="space-between",this.opacities.forEach(function(v){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="center",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.borderColor=v===r.currentOpacity?r.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){r.setCurrentOpacity(v,c)}),u.appendChild(c);var oe=document.createElement("div");oe.innerText=100*v+"%",c.appendChild(oe),r.opacityBoxes.push(c)}),u},o.prototype.setCurrentOpacity=function(r,u){var v=this;this.currentOpacity=r,this.opacityBoxes.forEach(function(c){c.style.borderColor=c===u?v.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(qe),j=function(d){function o(r,u,v){var c=d.call(this,r,u,v)||this;return c.setOpacity=c.setOpacity.bind(c),c.fillColor=v.defaultHighlightColor,c.strokeWidth=0,c.opacity=v.defaultHighlightOpacity,c.fillPanel=new ot("Color",v.defaultColorSet,c.fillColor),c.fillPanel.onColorChanged=c.setFillColor,c.opacityPanel=new R("Opacity",v.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return X(o,d),o.prototype.setOpacity=function(r){this.opacity=r,this.visual&&_.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=d.prototype.getState.call(this);return r.typeName=o.typeName,r},o.typeName="HighlightMarker",o.title="Highlight marker",o.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',o}(x),I='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',de=function(d){function o(r,u,v){var c=d.call(this,r,u,v)||this;return c.bgColor="transparent",c.tipPosition={x:0,y:0},c.tipBase1Position={x:0,y:0},c.tipBase2Position={x:0,y:0},c.tipMoving=!1,c.color=v.defaultStrokeColor,c.bgColor=v.defaultFillColor,c.fontFamily=v.defaultFontFamily,c.defaultSize={x:100,y:30},c.setBgColor=c.setBgColor.bind(c),c.getTipPoints=c.getTipPoints.bind(c),c.positionTip=c.positionTip.bind(c),c.setTipPoints=c.setTipPoints.bind(c),c.colorPanel=new ot("Text color",v.defaultColorSet,c.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),c.colorPanel.onColorChanged=c.setColor,c.bgColorPanel=new ot("Fill color",v.defaultColorSet,c.bgColor,I),c.bgColorPanel.onColorChanged=c.setBgColor,c.fontFamilyPanel=new je("Font",v.defaultFontFamilies,v.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c.tipGrip=new At,c.tipGrip.visual.transform.baseVal.appendItem(_.createTransform()),c.controlBox.appendChild(c.tipGrip.visual),c}return X(o,d),o.prototype.ownsTarget=function(r){return d.prototype.ownsTarget.call(this,r)||this.tipGrip.ownsTarget(r)||this.tip===r},o.prototype.createTip=function(){_.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=_.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},o.prototype.pointerDown=function(r,u){this.state==="new"&&d.prototype.pointerDown.call(this,r,u),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(u)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):d.prototype.pointerDown.call(this,r,u)},o.prototype.pointerUp=function(r){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,d.prototype.pointerUp.call(this,r);else{var u=this.state==="creating";d.prototype.pointerUp.call(this,r),this.setTipPoints(u),this.positionTip()}},o.prototype.manipulate=function(r){if(this.tipMoving){var u=this.unrotatePoint(r);this.tipPosition={x:u.x-this.manipulationStartLeft,y:u.y-this.manipulationStartTop},this.positionTip()}else d.prototype.manipulate.call(this,r)},o.prototype.setBgColor=function(r){this.bgRectangle&&this.tip&&(_.setAttributes(this.bgRectangle,[["fill",r]]),_.setAttributes(this.tip,[["fill",r]])),this.bgColor=r,this.fillColorChanged(r)},o.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},o.prototype.setTipPoints=function(r){r===void 0&&(r=!1);var u=Math.min(this.height/2,15),v=this.height/5;r&&(this.tipPosition={x:u+v/2,y:this.height+20});var c=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?c<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(v=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:0},this.tipBase2Position={x:u+v,y:0}):(this.tipBase1Position={x:0,y:u},this.tipBase2Position={x:0,y:u+v}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?c<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(v=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-v,y:0},this.tipBase2Position={x:this.width-u,y:0}):(this.tipBase1Position={x:this.width,y:u},this.tipBase2Position={x:this.width,y:u+v}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?c<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(v=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-v,y:this.height},this.tipBase2Position={x:this.width-u,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-u-v},this.tipBase2Position={x:this.width,y:this.height-u}):c<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(v=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:this.height},this.tipBase2Position={x:u+v,y:this.height}):(this.tipBase1Position={x:0,y:this.height-u},this.tipBase2Position={x:0,y:this.height-u-v})},o.prototype.resize=function(r){d.prototype.resize.call(this,r),this.positionTip()},o.prototype.positionTip=function(){_.setAttributes(this.tip,[["points",this.getTipPoints()]]);var r=this.tipGrip.visual.transform.baseVal.getItem(0);r.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(r,0)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),o.prototype.select=function(){this.positionTip(),d.prototype.select.call(this)},o.prototype.getState=function(){var r=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},d.prototype.getState.call(this));return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){var u=r;this.bgColor=u.bgColor,this.tipPosition=u.tipPosition,d.prototype.restoreState.call(this,r),this.createTip(),this.setTipPoints()},o.prototype.scale=function(r,u){d.prototype.scale.call(this,r,u),this.tipPosition={x:this.tipPosition.x*r,y:this.tipPosition.y*u},this.positionTip()},o.typeName="CalloutMarker",o.title="Callout marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',o}(We),Ce=function(d){function o(r,u,v){var c=d.call(this,r,u,v)||this;return c.fillColor="transparent",c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.opacity=1,c.strokeColor=v.defaultColor,c.strokeWidth=v.defaultStrokeWidth,c.strokeDasharray=v.defaultStrokeDasharray,c.fillColor=v.defaultFillColor,c.setStrokeColor=c.setStrokeColor.bind(c),c.setFillColor=c.setFillColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.setOpacity=c.setOpacity.bind(c),c.createVisual=c.createVisual.bind(c),c.strokePanel=new ot("Line color",N(v.defaultColorSet,["transparent"]),v.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.fillPanel=new ot("Fill color",N(v.defaultColorSet,["transparent"]),c.fillColor,I),c.fillPanel.onColorChanged=c.setFillColor,c.strokeWidthPanel=new Pt("Line width",v.defaultStrokeWidths,v.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new xt("Line style",v.defaultStrokeDasharrays,v.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c.opacityPanel=new R("Opacity",v.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return X(o,d),o.prototype.ownsTarget=function(r){return!(!d.prototype.ownsTarget.call(this,r)&&r!==this.visual)},o.prototype.createVisual=function(){this.visual=_.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(r,u){d.prototype.pointerDown.call(this,r,u),this.state==="new"&&(this.createVisual(),this.moveVisual(r),this._state="creating")},o.prototype.manipulate=function(r){d.prototype.manipulate.call(this,r)},o.prototype.resize=function(r){d.prototype.resize.call(this,r),this.setSize()},o.prototype.setSize=function(){d.prototype.setSize.call(this),_.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},o.prototype.pointerUp=function(r){d.prototype.pointerUp.call(this,r),this.setSize()},o.prototype.setStrokeColor=function(r){this.strokeColor=r,this.visual&&_.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(r),this.stateChanged()},o.prototype.setFillColor=function(r){this.fillColor=r,this.visual&&_.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(r),this.stateChanged()},o.prototype.setStrokeWidth=function(r){this.strokeWidth=r,this.visual&&_.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(r){this.strokeDasharray=r,this.visual&&_.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(r){this.opacity=r,this.visual&&_.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},d.prototype.getState.call(this));return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){var u=r;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),d.prototype.restoreState.call(this,r),this.setSize()},o.prototype.scale=function(r,u){d.prototype.scale.call(this,r,u),this.setSize()},o.typeName="EllipseMarker",o.title="Ellipse marker",o.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',o}(kt),Oe=function(d){function o(r,u,v){return d.call(this,r,u,v)||this}return X(o,d),Object.defineProperty(o.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(r){return!(!d.prototype.ownsTarget.call(this,r)&&r!==this.tip1&&r!==this.tip2)},o.prototype.createTips=function(){this.tip1=_.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(_.createTransform()),this.visual.appendChild(this.tip1),this.tip2=_.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(_.createTransform()),this.visual.appendChild(this.tip2)},o.prototype.pointerDown=function(r,u){d.prototype.pointerDown.call(this,r,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(d.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(_.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),_.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var r=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),u=this.tip1.transform.baseVal.getItem(0);u.setRotate(r,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(u,0);var v=this.tip2.transform.baseVal.getItem(0);v.setRotate(r+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(v,0)}},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=d.prototype.getState.call(this);return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){d.prototype.restoreState.call(this,r),this.createTips(),this.adjustVisual()},o.typeName="MeasurementMarker",o.title="Measurement marker",o.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',o}(Rt),_t=function(d){function o(r,u,v){var c=d.call(this,r,u,v)||this;return c.strokePanel.colors=v.defaultColorSet,c.fillColor="transparent",c}return X(o,d),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=d.prototype.getState.call(this);return r.typeName=o.typeName,r},o.typeName="EllipseFrameMarker",o.title="Ellipse frame marker",o.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',o}(Ce),at=function(){function d(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(d.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),d.prototype.addUndoStep=function(o){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(o)||(this.undoStack.push(o),JSON.stringify(this.lastRedoStep)!==JSON.stringify(o)&&this.redoStack.splice(0,this.redoStack.length))},d.prototype.replaceLastUndoStep=function(o){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=o)},d.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},d.prototype.undo=function(){if(this.undoStack.length>1){var o=this.undoStack.pop();return o!==void 0&&this.redoStack.push(o),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},d.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},d}(),ge=function(d){function o(r,u,v){var c=d.call(this,r,u,v)||this;return c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.curveX=0,c.curveY=0,c.manipulationStartCurveX=0,c.manipulationStartCurveY=0,c.setStrokeColor=c.setStrokeColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.positionGrips=c.positionGrips.bind(c),c.addControlGrips=c.addControlGrips.bind(c),c.adjustVisual=c.adjustVisual.bind(c),c.setupControlBox=c.setupControlBox.bind(c),c.resize=c.resize.bind(c),c.strokeColor=v.defaultColor,c.strokeWidth=v.defaultStrokeWidth,c.strokeDasharray=v.defaultStrokeDasharray,c.strokePanel=new ot("Line color",v.defaultColorSet,v.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Pt("Line width",v.defaultStrokeWidths,v.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new xt("Line style",v.defaultStrokeDasharrays,v.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return X(o,d),o.prototype.ownsTarget=function(r){return!(!d.prototype.ownsTarget.call(this,r)&&r!==this.visual&&r!==this.selectorCurve&&r!==this.visibleCurve&&!this.curveGrip.ownsTarget(r))},o.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},o.prototype.createVisual=function(){this.visual=_.createGroup(),this.selectorCurve=_.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=_.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(r,u){d.prototype.pointerDown.call(this,r,u),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=r.x,this.curveY=r.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(u)&&(this.activeGrip=this.curveGrip,this._state="resize")},o.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),_.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),_.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),_.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){d.prototype.setupControlBox.call(this),this.curveControlLine1=_.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=_.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},o.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,d.prototype.addControlGrips.call(this)},o.prototype.positionGrips=function(){d.prototype.positionGrips.call(this);var r=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-r/2,this.curveY-r/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},o.prototype.manipulate=function(r){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+r.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+r.y-this.manipulationStartY),d.prototype.manipulate.call(this,r)},o.prototype.resize=function(r){this.activeGrip===this.curveGrip&&(this.curveX=r.x,this.curveY=r.y),d.prototype.resize.call(this,r),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},o.prototype.setStrokeColor=function(r){this.strokeColor=r,this.adjustVisual(),this.colorChanged(r)},o.prototype.setStrokeWidth=function(r){this.strokeWidth=r,this.adjustVisual()},o.prototype.setStrokeDasharray=function(r){this.strokeDasharray=r,this.adjustVisual()},o.prototype.scale=function(r,u){this.curveX=this.curveX*r,this.curveY=this.curveY*u,d.prototype.scale.call(this,r,u)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var r=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},d.prototype.getState.call(this));return r.typeName=o.typeName,r},o.prototype.restoreState=function(r){d.prototype.restoreState.call(this,r);var u=r;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.curveX=u.curveX,this.curveY=u.curveY,this.createVisual(),this.adjustVisual()},o.typeName="CurveMarker",o.title="Curve marker",o.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',o}(Ut),lt=function(){function d(o,r){r===void 0&&(r=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=o,this.cancelable=r}return Object.defineProperty(d.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),d.prototype.preventDefault=function(){this._defaultPrevented=!0},d}(),Et=function(d){function o(r,u,v){var c=d.call(this,r,!1)||this;return c.dataUrl=u,c.state=v,c}return X(o,d),o}(lt),et=function(d){function o(r,u,v){v===void 0&&(v=!1);var c=d.call(this,r,v)||this;return c.marker=u,c}return X(o,d),o}(lt),Ft=function(){function d(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return d.prototype.addEventListener=function(o,r){this[o].push(r)},d.prototype.removeEventListener=function(o,r){var u=this[o].indexOf(r);u>-1&&this[o].splice(u,1)},d}(),tt=function(){function d(o){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ne,this._isOpen=!1,this.undoRedoManager=new at,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Ft,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=d.instanceCounter++,this.styles=new Ae(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=o,this.targetRoot=document.body,this.width=o.clientWidth,this.height=o.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(d.prototype,"ALL_MARKER_TYPES",{get:function(){return[bt,$,Q,We,_t,Ce,j,de,Oe,x,Rt,ge]},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[bt,$,Q,We,Ce,j,de]},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"BASIC_MARKER_TYPES",{get:function(){return[bt,$,Q,We,j]},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(o){var r=this;this._availableMarkerTypes.splice(0),o.forEach(function(u){if(typeof u=="string"){var v=r.ALL_MARKER_TYPES.find(function(c){return c.typeName===u});v!==void 0&&r._availableMarkerTypes.push(v)}else r._availableMarkerTypes.push(u)})},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(o){this._zoomLevel=o,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),d.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),pe.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},d.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&Ze.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Ze.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(r){return r(new lt(o))})},d.prototype.render=function(){return K(this,void 0,void 0,function(){var o;return le(this,function(r){switch(r.label){case 0:return this.setCurrentMarker(),(o=new Ue).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.markersOnly=this.renderMarkersOnly,o.width=this.renderWidth,o.height=this.renderHeight,[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return r.sent(),[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,r.sent()]}})})},d.prototype.close=function(o){var r=this;if(o===void 0&&(o=!1),this.isOpen){var u=!1;o||this.eventListeners.beforeclose.forEach(function(v){var c=new lt(r,!0);v(c),c.defaultPrevented&&(u=!0)}),u||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(v){return v(new lt(r))}),this.detachEvents(),this._isOpen=!1)}},d.prototype.addMarkersToToolbar=function(){for(var o,r=[],u=0;u<arguments.length;u++)r[u]=arguments[u];(o=this._availableMarkerTypes).push.apply(o,r)},d.prototype.addRenderEventListener=function(o){this.addEventListener("render",function(r){o(r.dataUrl,r.state)})},d.prototype.removeRenderEventListener=function(o){},d.prototype.addCloseEventListener=function(o){this.addEventListener("close",function(){o()})},d.prototype.removeCloseEventListener=function(o){},d.prototype.setupResizeObserver=function(){var o=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){o.resize(o.target.clientWidth,o.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return o.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},d.prototype.onPopupTargetResize=function(){var o=1*this.target.clientWidth/this.target.clientHeight,r=this.editorCanvas.clientWidth/o>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*o:this.editorCanvas.clientWidth,u=r<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/o;this.resize(r,u)},d.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},d.prototype.resize=function(o,r){this._isResizing=!0;var u=o/this.imageWidth,v=r/this.imageHeight;this.imageWidth=Math.round(o),this.imageHeight=Math.round(r),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(u,v),this._isResizing=!1},d.prototype.scaleMarkers=function(o,r){var u,v=this;this._currentMarker&&this._currentMarker instanceof We?this._currentMarker.scale(o,r):(u=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(c){c!==v._currentMarker&&c.scale(o,r)}),u!==void 0&&this.setCurrentMarker(u)},d.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},d.prototype.setTopLeft=function(){var o=this.editingTarget.getBoundingClientRect(),r=this.editorCanvas.getBoundingClientRect();this.left=o.left-r.left,this.top=o.top-r.top},d.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},d.prototype.addDefs=function(){for(var o,r=[],u=0;u<arguments.length;u++)r[u]=arguments[u];this.defs=_.createDefs(),this.addDefsToImage(),(o=this.defs).append.apply(o,r)},d.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},d.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},d.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},d.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},d.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},d.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},d.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},d.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var o=document.createElement("a");o.href="https://markerjs.com/",o.target="_blank",o.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',o.title="Powered by marker.js",o.style.display="grid",o.style.alignItems="center",o.style.justifyItems="center",o.style.padding="3px",o.style.width="20px",o.style.height="20px",this.logoUI.appendChild(o),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},d.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},d.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},d.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},d.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Me(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Xe(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},d.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},d.prototype.removeMarker=function(o){this.markerImage.removeChild(o.container),this.markers.indexOf(o)>-1&&this.markers.splice(this.markers.indexOf(o),1),o.dispose()},d.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},d.prototype.toolbarButtonClicked=function(o,r){if(o==="marker"&&r!==void 0)this.createNewMarker(r);else if(o==="action")switch(r){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},d.prototype.deleteSelectedMarker=function(){var o=this;if(this._currentMarker!==void 0){var r=!1;if(this.eventListeners.markerbeforedelete.forEach(function(v){var c=new et(o,o._currentMarker,!0);v(c),c.defaultPrevented&&(r=!0)}),!r){var u=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(v){return v(new et(o,u))})}}},d.prototype.clear=function(){var o=this,r=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(oe){var Je=new et(o,void 0,!0);oe(Je),Je.defaultPrevented&&(r=!0)}),!r)){this.setCurrentMarker();for(var u=function(oe){var Je=v.markers[oe];v.setCurrentMarker(v.markers[oe]),v._currentMarker.dispose(),v.markerImage.removeChild(v._currentMarker.container),v.markers.splice(v.markers.indexOf(v._currentMarker),1),v.eventListeners.markerdelete.forEach(function(_e){return _e(new et(o,Je))})},v=this,c=this.markers.length-1;c>=0;c--)u(c);this.addUndoStep()}},Object.defineProperty(d.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),d.prototype.showNotesEditor=function(){var o;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(o=this._currentMarker.notes)!==null&&o!==void 0?o:"",this.overlayContainer.appendChild(this.notesArea))},d.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},d.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},d.prototype.addUndoStep=function(){var o=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var r=this.getState(),u=this.undoRedoManager.getLastUndoStep();if(!u||u.width===r.width&&u.height===r.height){var v=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(r),v<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(c){return c(new lt(o))})}else this.undoRedoManager.replaceLastUndoStep(r),this.eventListeners.statechange.forEach(function(c){return c(new lt(o))})}},d.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},d.prototype.undoStep=function(){var o=this,r=this.undoRedoManager.undo();r!==void 0&&(this.restoreState(r),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(u){return u(new lt(o))}))},d.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},d.prototype.redoStep=function(){var o=this,r=this.undoRedoManager.redo();r!==void 0&&(this.restoreState(r),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(u){return u(new lt(o))}))},d.prototype.stepZoom=function(){var o=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=o<this.zoomSteps.length-1?this.zoomSteps[o+1]:this.zoomSteps[0]},d.prototype.panTo=function(o){this.contentDiv.scrollBy({left:this.prevPanPoint.x-o.x,top:this.prevPanPoint.y-o.y}),this.prevPanPoint=o},d.prototype.startRenderAndClose=function(){return K(this,void 0,void 0,function(){var o,r,u=this;return le(this,function(v){switch(v.label){case 0:return[4,this.render()];case 1:return o=v.sent(),r=this.getState(),this.eventListeners.render.forEach(function(c){return c(new Et(u,o,r))}),this.close(!0),[2]}})})},d.prototype.getState=function(o){o===!0&&this.setCurrentMarker();var r={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(u){return r.markers.push(u.getState())}),r},d.prototype.restoreState=function(o){var r=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);o.markers.forEach(function(u){var v=r._availableMarkerTypes.find(function(oe){return oe.typeName===u.typeName});if(v!==void 0){var c=r.addNewMarker(v);c.restoreState(u),r.markers.push(c)}}),o.width&&o.height&&(o.width!==this.imageWidth||o.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/o.width,this.imageHeight/o.height),this.eventListeners.restorestate.forEach(function(u){return u(new lt(r))})},d.prototype.addNewMarker=function(o){var r=_.createGroup();return this.markerImage.appendChild(r),new o(r,this.overlayContainer,this.settings)},d.prototype.createNewMarker=function(o){var r,u=this;(r=typeof o=="string"?this._availableMarkerTypes.find(function(v){return v.typeName===o}):o)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(r),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(r.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(v){return v(new et(u,u._currentMarker))}))},d.prototype.markerCreated=function(o){var r=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(o),this.setCurrentMarker(o),o instanceof $&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker($):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(u){return u(new et(r,r._currentMarker))})},d.prototype.colorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=o,this.settings.defaultStrokeColor=o)},d.prototype.fillColorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=o)},d.prototype.markerStateChanged=function(o){var r=this;this.eventListeners.markerchange.forEach(function(u){return u(new et(r,o))})},d.prototype.setCurrentMarker=function(o){var r=this;this._currentMarker!==o&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(u){return u(new et(r,r._currentMarker))})),this._currentMarker=o,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(u){return u(new et(r,r._currentMarker))}))},d.prototype.onPointerDown=function(o){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||o.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var r=this.markers.find(function(u){return u.ownsTarget(o.target)});r!==void 0?(this.setCurrentMarker(r),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(o.clientX,o.clientY),o.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:o.clientX,y:o.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(o.clientX,o.clientY))},d.prototype.onDblClick=function(o){if(this._isFocused||this.focus(),this.mode==="select"){var r=this.markers.find(function(u){return u.ownsTarget(o.target)});r!==void 0&&r!==this._currentMarker&&this.setCurrentMarker(r),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(o.clientX,o.clientY),o.target):this.setCurrentMarker()}},d.prototype.onPointerMove=function(o){this.touchPoints!==1&&o.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||o.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(o.clientX,o.clientY)):this.zoomLevel>1&&this.panTo({x:o.clientX,y:o.clientY}))},d.prototype.onPointerUp=function(o){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(o.clientX,o.clientY)),this.isDragging=!1,this.addUndoStep()},d.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},d.prototype.onKeyUp=function(o){this._currentMarker===void 0||this.notesArea!==void 0||o.key!=="Delete"&&o.key!=="Backspace"||this.deleteSelectedMarker()},d.prototype.clientToLocalCoordinates=function(o,r){var u=this.markerImage.getBoundingClientRect();return{x:(o-u.left)/this.zoomLevel,y:(r-u.top)/this.zoomLevel}},d.prototype.onWindowResize=function(){this.positionUI()},d.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},d.prototype.addLicenseKey=function(o){pe.addKey(o)},d.prototype.addEventListener=function(o,r){this.eventListeners.addEventListener(o,r)},d.prototype.removeEventListener=function(o,r){this.eventListeners.removeEventListener(o,r)},d.prototype.renderState=function(o){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(o),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(d.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),d.prototype.focus=function(){var o=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(r){return r(new lt(o))}))},d.prototype.blur=function(){var o=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(r){return r(new lt(o))}))},d.instanceCounter=0,d}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var zt=function(d,o){return(zt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,u){r.__proto__=u}||function(r,u){for(var v in u)Object.prototype.hasOwnProperty.call(u,v)&&(r[v]=u[v])})(d,o)};function It(d,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=d}zt(d,o),d.prototype=o===null?Object.create(o):(r.prototype=o.prototype,new r)}function vt(d,o,r,u){return new(r||(r=Promise))(function(v,c){function oe(Bt){try{_e(u.next(Bt))}catch(Ee){c(Ee)}}function Je(Bt){try{_e(u.throw(Bt))}catch(Ee){c(Ee)}}function _e(Bt){var Ee;Bt.done?v(Bt.value):(Ee=Bt.value,Ee instanceof r?Ee:new r(function(ce){ce(Ee)})).then(oe,Je)}_e((u=u.apply(d,o||[])).next())})}function $t(d,o){var r,u,v,c,oe={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return c={next:Je(0),throw:Je(1),return:Je(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function Je(_e){return function(Bt){return function(Ee){if(r)throw new TypeError("Generator is already executing.");for(;oe;)try{if(r=1,u&&(v=2&Ee[0]?u.return:Ee[0]?u.throw||((v=u.return)&&v.call(u),0):u.next)&&!(v=v.call(u,Ee[1])).done)return v;switch(u=0,v&&(Ee=[2&Ee[0],v.value]),Ee[0]){case 0:case 1:v=Ee;break;case 4:return oe.label++,{value:Ee[1],done:!1};case 5:oe.label++,u=Ee[1],Ee=[0];continue;case 7:Ee=oe.ops.pop(),oe.trys.pop();continue;default:if(!(v=oe.trys,(v=v.length>0&&v[v.length-1])||Ee[0]!==6&&Ee[0]!==2)){oe=0;continue}if(Ee[0]===3&&(!v||Ee[1]>v[0]&&Ee[1]<v[3])){oe.label=Ee[1];break}if(Ee[0]===6&&oe.label<v[1]){oe.label=v[1],v=Ee;break}if(v&&oe.label<v[2]){oe.label=v[2],oe.ops.push(Ee);break}v[2]&&oe.ops.pop(),oe.trys.pop();continue}Ee=o.call(d,oe)}catch(ce){Ee=[6,ce],u=0}finally{r=v=0}if(5&Ee[0])throw Ee[1];return{value:Ee[0]?Ee[1]:void 0,done:!0}}([_e,Bt])}}}var Lt=function(){function d(){}return d.addKey=function(o){d.key=o},Object.defineProperty(d,"isLicensed",{get:function(){return!!d.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(d.key)},enumerable:!1,configurable:!0}),d}(),Fe=function(){function d(){}return d.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},d.setAttributes=function(o,r){for(var u=0,v=r;u<v.length;u++){var c=v[u],oe=c[0],Je=c[1];o.setAttribute(oe,Je)}},d.createRect=function(o,r,u){var v=document.createElementNS("http://www.w3.org/2000/svg","rect");return v.setAttribute("width",o.toString()),v.setAttribute("height",r.toString()),u&&d.setAttributes(v,u),v},d.createLine=function(o,r,u,v,c){var oe=document.createElementNS("http://www.w3.org/2000/svg","line");return oe.setAttribute("x1",o.toString()),oe.setAttribute("y1",r.toString()),oe.setAttribute("x2",u.toString()),oe.setAttribute("y2",v.toString()),c&&d.setAttributes(oe,c),oe},d.createPolygon=function(o,r){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),r&&d.setAttributes(u,r),u},d.createCircle=function(o,r){var u=document.createElementNS("http://www.w3.org/2000/svg","circle");return u.setAttribute("cx",(o/2).toString()),u.setAttribute("cy",(o/2).toString()),u.setAttribute("r",o.toString()),r&&d.setAttributes(u,r),u},d.createEllipse=function(o,r,u){var v=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return v.setAttribute("cx",(o/2).toString()),v.setAttribute("cy",(r/2).toString()),v.setAttribute("rx",(o/2).toString()),v.setAttribute("ry",(r/2).toString()),u&&d.setAttributes(v,u),v},d.createGroup=function(o){var r=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&d.setAttributes(r,o),r},d.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},d.createMarker=function(o,r,u,v,c,oe,Je){var _e=document.createElementNS("http://www.w3.org/2000/svg","marker");return d.setAttributes(_e,[["id",o],["orient",r],["markerWidth",u.toString()],["markerHeight",v.toString()],["refX",c.toString()],["refY",oe.toString()]]),_e.appendChild(Je),_e},d.createText=function(o){var r=document.createElementNS("http://www.w3.org/2000/svg","text");return r.setAttribute("x","0"),r.setAttribute("y","0"),o&&d.setAttributes(r,o),r},d.createTSpan=function(o,r){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,r&&d.setAttributes(u,r),u},d.createImage=function(o){var r=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&d.setAttributes(r,o),r},d.createPoint=function(o,r){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=r,u},d.createPath=function(o,r){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),r&&d.setAttributes(u,r),u},d.createElement=function(o,r){var u=document.createElementNS("http://www.w3.org/2000/svg",o);return r&&d.setAttributes(u,r),u},d.getHollowRectanglePath=function(o,r,u,v,c,oe,Je,_e){return"M"+o+","+r+"V"+(r+v)+"H"+(o+u)+"V"+r+"H"+c+"V"+oe+"H"+(c+Je)+"V"+(oe+_e)+"H"+c+"V"+r+"Z"},d}(),ut=function(){function d(o){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(d.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),d.prototype.addClass=function(o){return this.styleSheet===void 0&&this.addStyleSheet(),o.name=""+this.classNamePrefix+o.localName,this.classes.push(o),this.styleSheet.sheet.insertRule("."+o.name+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length),o},d.prototype.addRule=function(o){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(o),this.styleSheet.sheet.insertRule(o.selector+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length)},d.prototype.addStyleSheet=function(){var o;this.styleSheet=document.createElement("style"),((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).appendChild(this.styleSheet),this.addRule(new nt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new nt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new nt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new dt("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new dt("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},d.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},d}(),nt=function(d,o){this.selector=d,this.style=o},dt=function(d,o){this.localName=d,this.style=o},Kt=function(){function d(){this.blocks=[],this.display=""}return d.prototype.addButtonBlock=function(o){o.className=this.blockClassName,o.buttonClassName=this.buttonClassName,o.buttonColorsClassName=this.buttonColorsClassName,o.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(o)},d.prototype.addElementBlock=function(o){o.className===void 0&&(o.className=this.blockClassName),this.blocks.push(o)},d.prototype.getUI=function(){var o=document.createElement("div");return o.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,o.style.display=this.display,this.blocks.forEach(function(r){return o.appendChild(r.getUI())}),o},d}(),Vt=function(){function d(){}return d.prototype.getUI=function(){var o=document.createElement("div");if(o.className=this.className,this.minWidth!==void 0&&(o.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":o.style.justifyContent="flex-start";break;case"center":o.style.justifyContent="center";break;case"end":o.style.justifyContent="flex-end"}return o.style.whiteSpace="nowrap",o},d}(),an=function(d){function o(){var r=d!==null&&d.apply(this,arguments)||this;return r.buttons=[],r}return It(o,d),o.prototype.addButton=function(r){r.className=this.buttonClassName,r.colorsClassName=this.buttonColorsClassName,r.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(r)},o.prototype.getUI=function(){var r=d.prototype.getUI.call(this);return this.buttons.forEach(function(u){return r.appendChild(u.getUI())}),r},o}(Vt),Gt=function(){function d(o,r){this._isActive=!1,this._isHidden=!1,this._icon=o,this.title=r,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(d.prototype,"icon",{get:function(){return this._icon},set:function(o){this._icon=o,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isActive",{get:function(){return this._isActive},set:function(o){this._isActive=o,this.adjustClassName()},enumerable:!1,configurable:!0}),d.prototype.getUI=function(){var o=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return o.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},d.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},d.prototype.hide=function(){this._isHidden=!0},d}(),Ct=function(d){function o(){var r=d!==null&&d.apply(this,arguments)||this;return r.elements=[],r}return It(o,d),o.prototype.addElement=function(r){this.elements.push(r)},o.prototype.getUI=function(){var r=d.prototype.getUI.call(this);return this.elements.forEach(function(u){return r.appendChild(u)}),r},o}(Vt),tn=function(){function d(o,r){this.horizontal=o,this.vertical=r}return Object.defineProperty(d.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),d.prototype.getVerticalLength=function(o){return o/this.ratio},d.prototype.getHorizontalLength=function(o){return o*this.ratio},d}(),Nt=function(){function d(){}return d.getIcon=function(o,r){if(o>0&&r>0){var u=new tn(o,r),v=u.ratio>=1?20:u.getHorizontalLength(20),c=u.ratio<1?20:u.getVerticalLength(20),oe=document.createElementNS("http://www.w3.org/2000/svg","svg");oe.setAttribute("xmlns","http://www.w3.org/2000/svg"),oe.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(oe);var Je=Fe.createDefs();oe.appendChild(Je);var _e=Fe.createElement("clipPath",[["id","text-bg-clip"]]);Je.appendChild(_e);var Bt=Fe.createPath(Fe.getHollowRectanglePath((24-v)/2,(24-c)/2,v,c,(24-v)/2+2,(24-c)/2+2,v-4,c-4));oe.appendChild(Bt);var Ee=Fe.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ee.appendChild(Fe.createTSpan(o+":"+r)),oe.appendChild(Ee);var ce=Ee.getBBox();Fe.setAttributes(Ee,[["x",((24-ce.width)/2).toString()],["y",((24-ce.height)/2-ce.y).toString()]]);var Ye=Fe.createPath(Fe.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(ce.width))/2,(24-Math.ceil(ce.height))/2,Math.ceil(ce.width),Math.ceil(ce.height)));return _e.appendChild(Ye),Fe.setAttributes(Bt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(oe),oe.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},d}(),ln=function(d){function o(r,u,v){var c=d.call(this,r,u)||this;return c.isDropdownOpen=!1,c.onClick=c.dropdownButtonClicked,c.dropdownButtons=v,c}return It(o,d),o.prototype.setupDropdown=function(){var r=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(u){u.className=r.className,u.colorsClassName=r.colorsClassName,r.dropdownBlock.appendChild(u.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},o.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},o.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},o.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},o.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},o.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},o}(Gt),Xt=function(){function d(o,r){this.GRIP_SIZE=10,this.color=o,this.fillColor=r,this.visual=Fe.createGroup(),this.visual.appendChild(Fe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Fe.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return d.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},d.prototype.setCenter=function(o,r){this.visual.childNodes.forEach(function(u){return Fe.setAttributes(u,[["cx",o.toString()],["cy",r.toString()]])})},d}(),hn=function(){function d(o,r,u,v){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=o,this.canvasHeight=r,this.margin=u,this.container=v,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(d.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(o){this._aspectRatio=o,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.gridContainer&&Fe.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(o){this._zoomFactor=o,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),d.prototype.open=function(){var o=this;this.cropShadeElement=Fe.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Fe.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var r=0;r<this.numberOfGridLines;r++)this.horizontalGridLines.push(Fe.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Fe.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(u){return o.gridContainer.appendChild(u)}),this.verticalGridLines.forEach(function(u){return o.gridContainer.appendChild(u)}),this.cropRectElement=Fe.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Xt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Xt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Xt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Xt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},d.prototype.setCropRectangle=function(o){this.cropRect=o;var r=Object.assign({},this.cropRect);this.zoomFactor!==1&&(r.width=this.cropRect.width*this.zoomFactor,r.height=this.cropRect.height*this.zoomFactor,r.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-r.width/2,r.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-r.height/2),Fe.setAttributes(this.cropRectElement,[["x",r.x.toString()],["y",r.y.toString()],["width",r.width.toString()],["height",r.height.toString()]]);var u=r.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(c,oe){var Je=r.y+u*(oe+1);Fe.setAttributes(c,[["x1",""+r.x],["y1",""+Je],["x2",""+(r.x+r.width)],["y2",""+Je]])});var v=r.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(c,oe){var Je=r.x+v*(oe+1);Fe.setAttributes(c,[["x1",""+Je],["y1",""+r.y],["x2",""+Je],["y2",""+(r.y+r.height)]])}),Fe.setAttributes(this.cropShadeElement,[["d",Fe.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,r.x,r.y,r.width,r.height)]]),this.topLeftGrip.setCenter(r.x,r.y),this.topRightGrip.setCenter(r.x+r.width,r.y),this.bottomLeftGrip.setCenter(r.x,r.y+r.height),this.bottomRightGrip.setCenter(r.x+r.width,r.y+r.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},d.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},d.prototype.clientToLocalCoordinates=function(o,r){var u=this.container.getBoundingClientRect();return{x:o-u.left+this.margin,y:r-u.top+this.margin}},d.prototype.onPointerDown=function(o){this.container.setPointerCapture(o.pointerId),this.previousPoint=this.clientToLocalCoordinates(o.clientX,o.clientY),this.cropRectElement===o.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(o.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(o.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(o.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(o.target)&&(this.activeGrip=this.bottomRightGrip)},d.prototype.onPointerMove=function(o){if(this.isMoving)this.move(this.clientToLocalCoordinates(o.clientX,o.clientY));else if(this.activeGrip){var r=this.clientToLocalCoordinates(o.clientX,o.clientY);this.resize(r)}o.preventDefault()},d.prototype.onPointerUp=function(o){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(o.pointerId)},d.prototype.move=function(o){var r=o.x-this.previousPoint.x,u=o.y-this.previousPoint.y;this.zoomFactor!==1&&(r=-r/this.zoomFactor,u=-u/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+r),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+u),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=o},d.prototype.resize=function(o){var r=Object.assign({},this.cropRect),u=o.x-this.previousPoint.x,v=o.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:r.x+u<this.margin&&(u=this.margin-r.x),r.x+=u,r.width=this.cropRect.x+this.cropRect.width-r.x;break;case this.bottomRightGrip:case this.topRightGrip:r.width+u>this.canvasWidth*this.zoomFactor&&(u=this.canvasWidth*this.zoomFactor-r.width),r.width+=u}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(r.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(u),r.height=this.aspectRatio.getVerticalLength(r.width)):(r.y+=v,r.height=this.cropRect.y+this.cropRect.height-r.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?r.height=this.aspectRatio.getVerticalLength(r.width):r.height+=v}r.width<10&&(r.x=this.cropRect.x,r.width=10),r.height<10&&(r.y=this.cropRect.y,r.height=10),this.previousPoint=o,r.x>=this.margin&&r.y>=this.margin&&r.x-this.margin+r.width<=this.canvasWidth&&r.y-this.margin+r.height<=this.canvasHeight&&(this.cropRect=r,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},d.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var o=this.cropRect.x+this.cropRect.width/2,r=this.cropRect.y+this.cropRect.height/2,u=this.aspectRatio.getHorizontalLength(this.cropRect.height),v=this.aspectRatio.getVerticalLength(this.cropRect.width);u/this.canvasWidth<v/this.canvasHeight?this.cropRect.width=u:this.cropRect.height=v,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=o-this.cropRect.width/2,this.cropRect.y=r-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},d.prototype.getRescaledRect=function(o,r,u,v,c,oe){var Je=u/o,_e=v/r;return{x:(c.x-oe)*Je+oe,y:(c.y-oe)*_e+oe,width:c.width*Je,height:c.height*_e}},d.prototype.scaleCanvas=function(o,r){var u=this.getRescaledRect(this.canvasWidth,this.canvasHeight,o,r,this.cropRect,this.margin);this.canvasWidth=o,this.canvasHeight=r,this.onCropChange&&this.onCropChange(u),this.setCropRectangle(u)},d}(),Kn=function(){function d(o){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=o,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(d.prototype,"angle",{get:function(){return this._angle},set:function(o){this._angle=o,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),d.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},d.prototype.onPointerDown=function(o){this.controlContainer.setPointerCapture(o.pointerId),this.isDragging=!0,this.previousPoint={x:o.clientX,y:o.clientY}},d.prototype.onPointerMove=function(o){this.isDragging&&(this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.previousPoint.x=o.clientX)},d.prototype.onPointerUp=function(o){this.isDragging&&this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(o.pointerId)},d.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var o=this.angleLabelText.getBBox();Fe.setAttributes(this.angleLabelElement,[["x",((this.width-o.width)/2).toString()],["y",(this.height/2).toString()]])}},d.prototype.positionScaleShape=function(){if(this.scaleShape){var o=this.scaleShape.transform.baseVal.getItem(0);o.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(o,0)}},d.prototype.getVisual=function(){var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("width",this.width+"px"),o.setAttribute("height",this.height+"px"),o.setAttribute("viewBox","0 0 "+this.width+" "+this.height),o.style.flexShrink="0",document.body.appendChild(o);for(var r="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,u=1;u<=this.width/5+10;u++){var v=u%5==0?this.height/3:this.height/6;r+="h4v"+-v+"h1v"+v}r+="v1H0Z",this.scaleShape=Fe.createPath(r);var c=Fe.createTransform();this.scaleShape.transform.baseVal.appendItem(c),o.appendChild(this.scaleShape),this.angleLabelElement=Fe.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Fe.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var oe=Fe.createTSpan("");return oe.innerHTML="&deg;",this.angleLabelElement.appendChild(oe),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},d}(),nn=function(){function d(){this.naturalSize=!1,this.imageType="image/png"}return d.prototype.rasterize=function(o,r,u,v,c,oe,Je){var _e=this;return new Promise(function(Bt){var Ee=document.createElement("canvas");Ee.width=o.width.baseVal.value-2*v,Ee.height=o.height.baseVal.value-2*v;var ce=1,Ye=1;_e.naturalSize===!0?(ce=r.naturalWidth/(o.width.baseVal.value-2*v)/oe,Ye=r.naturalHeight/(o.height.baseVal.value-2*v)/Je,Ee.width=r.naturalWidth/oe,Ee.height=r.naturalHeight/Je):_e.width!==void 0&&_e.height!==void 0&&(ce=_e.width/u.width,Ye=_e.height/u.height,Ee.width*=ce,Ee.height*=Ye);var Ot=Ee.getContext("2d");Ot.translate(Ee.width/2,Ee.height/2),Ot.rotate(c*Math.PI/180),Ot.scale(oe,Je),Ot.translate(-Ee.width/2,-Ee.height/2),Ot.drawImage(r,0,0,Ee.width,Ee.height);var Mt=document.createElement("canvas");Mt.width=u.width*ce,Mt.height=u.height*Ye,Mt.getContext("2d").putImageData(Ot.getImageData((u.x-v)*ce,(u.y-v)*Ye,u.width*ce,u.height*Ye),0,0),Bt(Mt.toDataURL(_e.imageType,_e.imageQuality))})},d}(),$e=function(){function d(o){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=d.instanceCounter++,this.styles=new ut(this.instanceNo),this.target=o,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(d.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(o){this._zoomToCropEnabled=o,o?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"gridLines",{get:function(){return this._gridLines},set:function(o){this._gridLines=o,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(o){this._rotationAngle=o,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"aspectRatio",{get:function(){var o;return(o=this._aspectRatio)!==null&&o!==void 0?o:this.aspectRatios[0]},set:function(o){this._aspectRatio=o},enumerable:!1,configurable:!0}),d.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},d.prototype.show=function(){this.showUI(),this.open()},d.prototype.close=function(o){o===void 0&&(o=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),o||this.closeEventListeners.forEach(function(r){return r()}),this._isOpen=!1)},d.prototype.addRenderEventListener=function(o){this.renderEventListeners.push(o)},d.prototype.removeRenderEventListener=function(o){this.renderEventListeners.indexOf(o)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(o),1)},d.prototype.addCloseEventListener=function(o){this.closeEventListeners.push(o)},d.prototype.removeCloseEventListener=function(o){this.closeEventListeners.indexOf(o)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(o),1)},d.prototype.setupResizeObserver=function(){var o=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){o.resize(o.target.clientWidth,o.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},d.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var o=1*this.target.clientWidth/this.target.clientHeight,r=this.contentDiv.clientWidth/o>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*o:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,u=r+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/o;this.resize(r,u)}},d.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},d.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",Fe.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},d.prototype.resize=function(o,r){this.imageWidth=Math.round(o),this.imageHeight=Math.round(r),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},d.prototype.setEditingTarget=function(){var o=document.createElement("canvas");o.width=this.target.naturalWidth,o.height=this.target.naturalHeight,o.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var r=o.toDataURL();Fe.setAttributes(this.editingTarget,[["href",r]]),this.setEditingTargetSize()},d.prototype.setTopLeft=function(){var o=this.target.getBoundingClientRect(),r=this.editorCanvas.getBoundingClientRect();this.left=o.left-r.left-this.CANVAS_MARGIN,this.top=o.top-r.top-this.CANVAS_MARGIN},d.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=Fe.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Fe.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Fe.createGroup(),this.editingTargetRotationScaleContainer=Fe.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=Fe.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var r=Fe.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(r),this.editingTargetContainer=Fe.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},d.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},d.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Fe.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new hn(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},d.prototype.zoomToCrop=function(){if(this.cropRect){var o=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,r=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=o+"px "+r+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-o+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-r+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},d.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},d.prototype.cropRectChanged=function(o){this.cropRect=o,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},d.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},d.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},d.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},d.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var o=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,r=this.target.offsetTop>o+this.CANVAS_MARGIN?this.target.offsetTop-(o+this.CANVAS_MARGIN):0;this.coverDiv.style.top=r+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},d.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},d.prototype.addTopToolbar=function(){var o=this;this.topToolbar=new Kt,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var r=new an;r.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(r);var u=[];this.aspectRatios.forEach(function(Ye){var Ot=new Gt(Nt.getIcon(Ye.horizontal,Ye.vertical),Ye.horizontal===0&&Ye.vertical===0?"FREE":Ye.horizontal+":"+Ye.vertical);Ot.onClick=function(){return o.ratioButtonClicked(Ye)},u.push(Ot)}),this.aspectRatioButton=new ln(Nt.getIcon(0,0),"Aspect ratio",u),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,r.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var v=new Gt('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");v.isActive=this.isGridVisible,v.onClick=function(){o.isGridVisible=!o.isGridVisible,v.isActive=o.isGridVisible},r.addButton(v);var c=new Gt('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(c.isActive=this.zoomToCropEnabled,c.onClick=function(){o.zoomToCropEnabled=!o.zoomToCropEnabled,c.isActive=o.zoomToCropEnabled},r.addButton(c),!Lt.isLicensed){var oe=new Ct;this.topToolbar.addElementBlock(oe);var Je=document.createElement("div");Je.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var _e=document.createElement("a");_e.style.color="currentColor",_e.href="https://markerjs.com/products/cropro",_e.target="_blank",_e.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',Je.appendChild(_e),oe.addElement(Je)}var Bt=new an;Bt.minWidth=3*this.toolbarHeight+"px",Bt.contentAlign="end",this.topToolbar.addButtonBlock(Bt);var Ee=new Gt('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");Ee.onClick=this.startRenderAndClose,Bt.addButton(Ee),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ee.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var ce=new Gt('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");ce.onClick=this.close,Bt.addButton(ce),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(ce.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},d.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new Kt,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var r=new an;r.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(r);var u=new Gt('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");u.onClick=this.rotateLeftButtonClicked,r.addButton(u);var v=new Gt('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");v.onClick=this.rotateRightButtonClicked,r.addButton(v);var c=new Ct;c.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(c),this.straightener=new Kn("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(Bt){o.rotateBy(Bt),o.straightener.angle=o.rotationAngle},c.addElement(this.straightener.getUI());var oe=new an;oe.minWidth=2*this.toolbarHeight+"px",oe.contentAlign="end",this.bottomToolbar.addButtonBlock(oe);var Je=new Gt('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");Je.onClick=this.flipHorizontallyButtonClicked,oe.addButton(Je);var _e=new Gt('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");_e.onClick=this.flipVerticallyButtonClicked,oe.addButton(_e)},d.prototype.ratioButtonClicked=function(o){this.aspectRatio=o,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},d.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Nt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},d.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new tn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},d.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},d.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},d.prototype.restoreState=function(o){if(o){var r=this.cropLayer.getRescaledRect(o.width,o.height,this.imageWidth,this.imageHeight,o.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(r),this.cropRectChanged(r),this.flippedHorizontally=o.flippedHorizontally,this.flippedVertically=o.flippedVertically,this.applyFlip(),this.rotationAngle=o.rotationAngle,this.applyRotation()}},d.prototype.clientToLocalCoordinates=function(o,r){var u=this.cropImage.getBoundingClientRect();return{x:o-u.left,y:r-u.top}},d.prototype.onWindowResize=function(){this.positionUI()},d.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var o=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},d.prototype.rotateLeftButtonClicked=function(){var o=this.rotationAngle-90;this.rotationAngle%90!=0&&(o+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(o)},d.prototype.rotateRightButtonClicked=function(){var o=this.rotationAngle+90;this.rotationAngle%90!=0&&(o-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(o)},d.prototype.rotateTo=function(o){o=(o=o>180?o-360:o)<=-180?o+360:o,this.rotationAngle=o,this.applyRotation()},d.prototype.rotateBy=function(o){this.rotateTo((this.rotationAngle+o)%360)},d.prototype.applyRotation=function(){var o=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var r=this.editingTargetRotationContainer.transform.baseVal.getItem(0);r.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(r,0);var u=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/u.width,this.imageHeight/u.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=o},d.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},d.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},d.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},d.prototype.startRenderAndClose=function(){return vt(this,void 0,void 0,function(){var o,r;return $t(this,function(u){switch(u.label){case 0:return[4,this.render()];case 1:return o=u.sent(),r=this.getState(),this.renderEventListeners.forEach(function(v){return v(o,r)}),this.close(!0),[2]}})})},d.prototype.render=function(){return vt(this,void 0,void 0,function(){var o;return $t(this,function(r){switch(r.label){case 0:return(o=new nn).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.width=this.renderWidth,o.height=this.renderHeight,this.unzoomFromCrop(),Fe.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,o.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return r.sent(),[4,o.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,r.sent()]}})})},d.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new dt("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new dt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new dt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new dt("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*o)+`px;
height: `+(this.toolbarHeight-2*o)+`px;
padding: `+o+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new dt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new dt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new nt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new nt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new dt("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new dt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new dt("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new dt("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*o)+`px;
padding: `+o+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new dt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},d.instanceCounter=0,d}(),st=h("8hTe"),fn=h.n(st),gn=/<pre[^>]*>/g;function On(d){var o=document.createElement("div");return o.innerHTML=d,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var Bn=Ie.a=function(d){var o=d.value,r=o===void 0?"":o,u=d.edit,v=u===void 0?!1:u,c=d.className,oe=d.showTextOnly,Je=d.showLines,_e=d.replaces,Bt=d.zoomImg,Ee=d.hasMask,ce=d.style,Ye=ce===void 0?{}:ce,Ot=d.stylesPrev,Mt=Ot===void 0?{}:Ot,Tt=String(r),Dt=Object(T.useRef)(),cn=Object(T.useRef)(),Nn=Object(T.useState)(""),Cn=Object(U.a)(Nn,2),pn=Cn[0],Wn=Cn[1],jn=Object(T.useState)("office"),ti=Object(U.a)(jn,2),xi=ti[0],Fn=ti[1],Xn=function(){var yn=new $e(cn.current);yn.displayMode="popup",yn.addRenderEventListener(function(){var di=Object(re.a)(O.a.mark(function vn(ni){var An;return O.a.wrap(function(ii){for(;;)switch(ii.prev=ii.next){case 0:return Dt.current.style.display="none",ii.next=3,Object(Te.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ni}});case 3:An=ii.sent,An!=null&&An.id&&_e(cn.current.getAttribute("src").replace(Be.a.API_SERVER,""),"/api/attachments/".concat(An==null?void 0:An.id,"?type=").concat(An.content_type));case 5:case"end":return ii.stop()}},vn)}));return function(vn){return di.apply(this,arguments)}}()),yn.show()},$i=function(){var yn=new tt(cn.current);yn.settings.displayMode="popup",yn.addEventListener("render",function(){var di=Object(re.a)(O.a.mark(function vn(ni){var An;return O.a.wrap(function(ii){for(;;)switch(ii.prev=ii.next){case 0:if(Dt.current.style.display="none",!cn.current){ii.next=6;break}return ii.next=4,Object(Te.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ni.dataUrl}});case 4:An=ii.sent,An!=null&&An.id&&_e(cn.current.getAttribute("src").replace(Be.a.API_SERVER,""),"/api/attachments/".concat(An==null?void 0:An.id,"?type=").concat(An.content_type));case 6:case"end":return ii.stop()}},vn)}));return function(vn){return di.apply(this,arguments)}}()),yn.show(),window.markerArea=yn},ri=Object(T.useMemo)(function(){try{var $n=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,yn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,di=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Tt=Tt.replace($n,"("+Be.a.API_SERVER+"/api/attachments/").replace(yn,'"'+Be.a.API_SERVER+"/api/attachments/").replace(di,'"'+Be.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`),Tt=Tt.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
`)}catch(Si){}var vn=be(Tt),ni=J();if(Tt.match(/\[TOC\]/)&&(vn=vn.replace("<p>[TOC]</p>",g()),Se()),vn=vn.replace(/(__special_katext_id_\d+__)/g,function(Si,ii){var Zn=ni[ii],Yi=Zn.type,Ji=Zn.expression;return Object(Pe.renderToString)(On(Ji)||"",{displayMode:Yi==="block",throwOnError:!1,output:"html"})}),vn=vn.replace(/▁/g,"\u2581\u2581\u2581"),z(),oe){var An=document.createElement("div");return An.innerHTML=vn,An.innerText}return setTimeout(function(){return la()},500),vn},[Tt]),wn=Object(T.useRef)();he.WebkitLineClamp=Je,Je&&(Ye=Object(me.a)(Object(me.a)({},Ye),he));function Hi($n){var yn=$n.target;if(yn.tagName.toUpperCase()==="IMG"){if(Bt){var di=yn.getAttribute("src");Wn(di),Fn("image")}}else if(yn.tagName.toUpperCase()==="A"){var vn=yn.getAttribute("href");if(vn.indexOf("office")>-1)$n.preventDefault(),Wn(vn),Fn("office");else if(vn.indexOf("application/pdf")>-1)$n.preventDefault(),Wn(vn),Fn("pdf");else if(vn.indexOf("type=text")>-1)$n.preventDefault(),Wn(vn),Fn("html");else if(vn.startsWith("#")){$n.preventDefault();var ni=document.getElementById(vn.replace("#",""));ni&&ni.scrollIntoView(!0)}}}var la=function(){var yn,di=(yn=wn.current)===null||yn===void 0?void 0:yn.querySelectorAll("video");di==null||di.forEach(function(vn){if(vn.oncontextmenu=function(){return!1},vn.src.indexOf(".m3u8")>-1&&!vn.canPlayType("application/vnd.apple.mpegurl")){if(ue.a.isSupported()){var ni=new ue.a;ni.loadSource(vn.src),ni.attachMedia(vn)}}})};Object(T.useEffect)(function(){if(wn.current&&ri&&(ri.match(gn)&&window.PR.prettyPrint()),wn.current)return wn.current.addEventListener("click",Hi),function(){wn.current.removeEventListener("click",Hi),z(),Se()}},[ri,wn.current,Hi]);var ia=function(yn){if(!v)return;yn.target.nodeName==="IMG"?(Dt.current.style.display="flex",Dt.current.style.width=yn.target.clientWidth+"px",Dt.current.style.height=yn.target.clientHeight+"px",Dt.current.style.top=yn.target.offsetTop+"px",Dt.current.style.left=yn.target.offsetLeft+"px",cn.current.src=yn.target.getAttribute("src")):Dt.current.style.display="none"};return A.a.createElement("div",{style:{position:"relative"}},A.a.createElement("div",{ref:wn,style:Object(me.a)({},Ye),className:"".concat(c||""," markdown-body ").concat(fn.a.mdBody),onMouseOver:ia,dangerouslySetInnerHTML:{__html:ri}}),A.a.createElement("div",{ref:Dt,className:fn.a.button},A.a.createElement(ve.a,null,A.a.createElement(xe.a,{onClick:function(){return Xn()}},"\u88C1\u526A"),A.a.createElement(xe.a,{onClick:function(){return $i()}},"\u7F16\u8F91"))),A.a.createElement("img",{ref:cn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),A.a.createElement(ze.a,{close:!0,data:pn,hasMask:Ee,type:pn!=null&&pn.length?xi:"",style:Object(me.a)({},Mt),onClose:function(){return Wn("")}}))}},"9VGf":function(Qe,Ie,h){"use strict";h.d(Ie,"a",function(){return se});var V=h("q1tI"),ve=h.n(V);function se(xe,me){var re=Object(V.useRef)();Object(V.useEffect)(function(){re.current=xe}),Object(V.useEffect)(function(){function U(){re.current()}if(me!==null){var k=setInterval(U,me);return function(){return clearInterval(k)}}},[me])}},"A+k2":function(Qe,Ie,h){Qe.exports={tabs:"tabs___2hYAP",active:"active___2Xkwd"}},Bd2K:function(Qe,Ie,h){(function(V){V(h("VrN/"),h("osHv"))})(function(V){V.defineOption("autoCloseTags",!1,function(O,T,A){if(A!=V.Init&&A&&O.removeKeyMap("autoCloseTags"),!T)return;var M={name:"autoCloseTags"};(typeof T!="object"||T.whenClosing!==!1)&&(M["'/'"]=function(te){return re(te)}),(typeof T!="object"||T.whenOpening!==!1)&&(M["'>'"]=function(te){return xe(te)}),O.addKeyMap(M)});var ve=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],se=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function xe(O){if(O.getOption("disableInput"))return V.Pass;for(var T=O.listSelections(),A=[],M=O.getOption("autoCloseTags"),te=0;te<T.length;te++){if(!T[te].empty())return V.Pass;var F=T[te].head,L=O.getTokenAt(F),G=V.innerMode(O.getMode(),L.state),W=G.state,ee=G.mode.xmlCurrentTag&&G.mode.xmlCurrentTag(W),b=ee&&ee.name;if(!b)return V.Pass;var fe=G.mode.configuration=="html",Se=typeof M=="object"&&M.dontCloseTags||fe&&ve,he=typeof M=="object"&&M.indentTags||fe&&se;L.end>F.ch&&(b=b.slice(0,b.length-L.end+F.ch));var H=b.toLowerCase();if(!b||L.type=="string"&&(L.end!=F.ch||!/[\"\']/.test(L.string.charAt(L.string.length-1))||L.string.length==1)||L.type=="tag"&&ee.close||L.string.indexOf("/")==F.ch-L.start-1||Se&&U(Se,H)>-1||k(O,G.mode.xmlCurrentContext&&G.mode.xmlCurrentContext(W)||[],b,F,!0))return V.Pass;var g=typeof M=="object"&&M.emptyTags;if(g&&U(g,b)>-1){A[te]={text:"/>",newPos:V.Pos(F.line,F.ch+2)};continue}var ne=he&&U(he,H)>-1;A[te]={indent:ne,text:">"+(ne?`
`:"")+"</"+b+">",newPos:ne?V.Pos(F.line+1,0):V.Pos(F.line,F.ch+1)}}for(var S=typeof M=="object"&&M.dontIndentOnAutoClose,te=T.length-1;te>=0;te--){var Y=A[te];O.replaceRange(Y.text,T[te].head,T[te].anchor,"+insert");var w=O.listSelections().slice(0);w[te]={head:Y.newPos,anchor:Y.newPos},O.setSelections(w),!S&&Y.indent&&(O.indentLine(Y.newPos.line,null,!0),O.indentLine(Y.newPos.line+1,null,!0))}}function me(O,T){for(var A=O.listSelections(),M=[],te=T?"/":"</",F=O.getOption("autoCloseTags"),L=typeof F=="object"&&F.dontIndentOnSlash,G=0;G<A.length;G++){if(!A[G].empty())return V.Pass;var W=A[G].head,ee=O.getTokenAt(W),b=V.innerMode(O.getMode(),ee.state),fe=b.state;if(T&&(ee.type=="string"||ee.string.charAt(0)!="<"||ee.start!=W.ch-1))return V.Pass;var Se,he=b.mode.name!="xml"&&O.getMode().name=="htmlmixed";if(he&&b.mode.name=="javascript")Se=te+"script";else if(he&&b.mode.name=="css")Se=te+"style";else{var H=b.mode.xmlCurrentContext&&b.mode.xmlCurrentContext(fe);if(!H||H.length&&k(O,H,H[H.length-1],W))return V.Pass;Se=te+H[H.length-1]}O.getLine(W.line).charAt(ee.end)!=">"&&(Se+=">"),M[G]=Se}if(O.replaceSelections(M),A=O.listSelections(),!L)for(var G=0;G<A.length;G++)(G==A.length-1||A[G].head.line<A[G+1].head.line)&&O.indentLine(A[G].head.line)}function re(O){return O.getOption("disableInput")?V.Pass:me(O,!0)}V.commands.closeTag=function(O){return me(O)};function U(O,T){if(O.indexOf)return O.indexOf(T);for(var A=0,M=O.length;A<M;++A)if(O[A]==T)return A;return-1}function k(O,T,A,M,te){if(!V.scanForClosingTag)return!1;var F=Math.min(O.lastLine()+1,M.line+500),L=V.scanForClosingTag(O,M,null,F);if(!L||L.tag!=A)return!1;for(var G=te?1:0,W=T.length-1;W>=0&&T[W]==A;W--)++G;M=L.to;for(var W=1;W<G;W++){var ee=V.scanForClosingTag(O,M,null,F);if(!ee||ee.tag!=A)return!1;M=ee.to}return!0}})},BjJ7:function(Qe,Ie,h){"use strict";h.d(Ie,"d",function(){return ve}),h.d(Ie,"c",function(){return se}),h.d(Ie,"e",function(){return xe}),h.d(Ie,"b",function(){return me}),h.d(Ie,"a",function(){return U});var V=h("m3rI");function ve(k){var O=!0;if(k.length>0){for(var T=0;T<k.length;T++)if(k[T].compile_success==0||!k[T].compile_success){O=!1;break}}else O=!1;return O}function se(k){for(var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",T=[],A=0;A<k.length;A++){var M=k[A],te=O?"".concat(O,"/").concat(M.name):"".concat(M.name);T.push({title:M.name,isLeaf:!(M.type==="tree"),key:te})}return T}function xe(k,O,T){for(var A=0;A<k.length;A++){var M=k[A];if(M.key===O){M.children=T;break}M.children&&xe(M.children,O,T)}return k}function me(k,O,T){var A;return function(){var M=this,te=arguments,F=function(){A=null,T||k.apply(M,te)},L=T&&!A;clearTimeout(A),A=setTimeout(F,O),L&&k.apply(M,te)}}var re=!0,U=V.a.API_SERVER},"C+DQ":function(Qe,Ie,h){},D1Df:function(Qe,Ie,h){"use strict";function V(E){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V=function(ae){return typeof ae}:V=function(ae){return ae&&typeof Symbol=="function"&&ae.constructor===Symbol&&ae!==Symbol.prototype?"symbol":typeof ae},V(E)}function ve(){return ve=Object.assign||function(E){for(var P=1;P<arguments.length;P++){var ae=arguments[P];for(var B in ae)Object.prototype.hasOwnProperty.call(ae,B)&&(E[B]=ae[B])}return E},ve.apply(this,arguments)}function se(E,P){var ae=Object.keys(E);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(E);P&&(B=B.filter(function(be){return Object.getOwnPropertyDescriptor(E,be).enumerable})),ae.push.apply(ae,B)}return ae}function xe(E){for(var P=1;P<arguments.length;P++){var ae=arguments[P]!=null?arguments[P]:{};P%2?se(ae,!0).forEach(function(B){L(E,B,ae[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(ae)):se(ae).forEach(function(B){Object.defineProperty(E,B,Object.getOwnPropertyDescriptor(ae,B))})}return E}function me(E,P){if(E==null)return{};var ae=re(E,P),B,be;if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(E);for(be=0;be<D.length;be++){if(B=D[be],P.indexOf(B)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(E,B))continue;ae[B]=E[B]}}return ae}function re(E,P){if(E==null)return{};var ae={},B=Object.keys(E),be,D;for(D=0;D<B.length;D++){if(be=B[D],P.indexOf(be)>=0)continue;ae[be]=E[be]}return ae}function U(E,P){if(!(E instanceof P))throw new TypeError("Cannot call a class as a function")}function k(E,P){for(var ae=0;ae<P.length;ae++){var B=P[ae];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(E,B.key,B)}}function O(E,P,ae){return P&&k(E.prototype,P),ae&&k(E,ae),E}function T(E,P){return P&&(V(P)==="object"||typeof P=="function")?P:M(E)}function A(E){return A=Object.setPrototypeOf?Object.getPrototypeOf:function(ae){return ae.__proto__||Object.getPrototypeOf(ae)},A(E)}function M(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function te(E,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(P&&P.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),P&&F(E,P)}function F(E,P){return F=Object.setPrototypeOf||function(B,be){return B.__proto__=be,B},F(E,P)}function L(E,P,ae){return P in E?Object.defineProperty(E,P,{value:ae,enumerable:!0,configurable:!0,writable:!0}):E[P]=ae,E}var G=h("q1tI"),W=h("17x9"),ee=h("H38U"),b=h("aRTE");function fe(E){for(var P="",ae=0;ae<E.length;ae++){var B=E.charCodeAt(ae);B<128?P+=String.fromCharCode(B):B<2048?(P+=String.fromCharCode(192|B>>6),P+=String.fromCharCode(128|B&63)):B<55296||B>=57344?(P+=String.fromCharCode(224|B>>12),P+=String.fromCharCode(128|B>>6&63),P+=String.fromCharCode(128|B&63)):(ae++,B=65536+((B&1023)<<10|E.charCodeAt(ae)&1023),P+=String.fromCharCode(240|B>>18),P+=String.fromCharCode(128|B>>12&63),P+=String.fromCharCode(128|B>>6&63),P+=String.fromCharCode(128|B&63))}return P}var Se={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},he={},H=4,g=.1;function ne(E){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,ae=[];return E.forEach(function(B,be){var D=null;B.forEach(function(p,ue){if(!p&&D!==null){ae.push("M".concat(D+P," ").concat(be+P,"h").concat(ue-D,"v1H").concat(D+P,"z")),D=null;return}if(ue===B.length-1){if(!p)return;D===null?ae.push("M".concat(ue+P,",").concat(be+P," h1v1H").concat(ue+P,"z")):ae.push("M".concat(D+P,",").concat(be+P," h").concat(ue+1-D,"v1H").concat(D+P,"z"));return}p&&D===null&&(D=ue)})}),ae.join("")}function S(E,P){return E.slice().map(function(ae,B){return B<P.y||B>=P.y+P.h?ae:ae.map(function(be,D){return D<P.x||D>=P.x+P.w?be:!1})})}function Y(E,P){var ae=E.imageSettings,B=E.size,be=E.includeMargin;if(ae==null)return null;var D=be?H:0,p=P.length+D*2,ue=Math.floor(B*g),Be=p/B,Pe=(ae.width||ue)*Be,ze=(ae.height||ue)*Be,Te=ae.x==null?P.length/2-Pe/2:ae.x*Be,we=ae.y==null?P.length/2-ze/2:ae.y*Be,X=null;if(ae.excavate){var K=Math.floor(Te),le=Math.floor(we),N=Math.ceil(Pe+Te-K),_=Math.ceil(ze+we-le);X={x:K,y:le,w:N,h:_}}return{x:Te,y:we,h:ze,w:Pe,excavation:X}}var w=function(){try{new Path2D().addPath(new Path2D)}catch(E){return!1}return!0}(),C=function(E){te(P,E);function P(){var ae,B;U(this,P);for(var be=arguments.length,D=new Array(be),p=0;p<be;p++)D[p]=arguments[p];return B=T(this,(ae=A(P)).call.apply(ae,[this].concat(D))),L(M(B),"_canvas",void 0),L(M(B),"_image",void 0),L(M(B),"state",{imgLoaded:!1}),L(M(B),"handleImageLoad",function(){B.setState({imgLoaded:!0})}),B}return O(P,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var B=this.props,be=B.value,D=B.size,p=B.level,ue=B.bgColor,Be=B.fgColor,Pe=B.includeMargin,ze=B.imageSettings,Te=new ee(-1,b[p]);if(Te.addData(fe(be)),Te.make(),this._canvas!=null){var we=this._canvas,X=we.getContext("2d");if(!X)return;var K=Te.modules;if(K===null)return;var le=Pe?H:0,N=K.length+le*2,_=Y(this.props,K);ze!=null&&_!=null&&(_.excavation!=null&&(K=S(K,_.excavation)));var pe=window.devicePixelRatio||1;we.height=we.width=D*pe;var Ue=D/N*pe;X.scale(Ue,Ue),X.fillStyle=ue,X.fillRect(0,0,N,N),X.fillStyle=Be,w?X.fill(new Path2D(ne(K,le))):K.forEach(function(Ze,Ae){Ze.forEach(function(De,Re){De&&X.fillRect(Re+le,Ae+le,1,1)})}),this.state.imgLoaded&&this._image&&_!=null&&X.drawImage(this._image,_.x+le,_.y+le,_.w,_.h)}}},{key:"render",value:function(){var B=this,be=this.props,D=be.value,p=be.size,ue=be.level,Be=be.bgColor,Pe=be.fgColor,ze=be.style,Te=be.includeMargin,we=be.imageSettings,X=me(be,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),K=xe({height:p,width:p},ze),le=null,N=we&&we.src;return we!=null&&N!=null&&(le=G.createElement("img",{src:N,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(pe){return B._image=pe}})),G.createElement(G.Fragment,null,G.createElement("canvas",ve({style:K,height:p,width:p,ref:function(pe){return B._canvas=pe}},X)),le)}}]),P}(G.PureComponent);L(C,"defaultProps",Se);var J=function(E){te(P,E);function P(){return U(this,P),T(this,A(P).apply(this,arguments))}return O(P,[{key:"render",value:function(){var B=this.props,be=B.value,D=B.size,p=B.level,ue=B.bgColor,Be=B.fgColor,Pe=B.includeMargin,ze=B.imageSettings,Te=me(B,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),we=new ee(-1,b[p]);we.addData(fe(be)),we.make();var X=we.modules;if(X===null)return null;var K=Pe?H:0,le=X.length+K*2,N=Y(this.props,X),_=null;ze!=null&&N!=null&&(N.excavation!=null&&(X=S(X,N.excavation)),_=G.createElement("image",{xlinkHref:ze.src,height:N.h,width:N.w,x:N.x+K,y:N.y+K,preserveAspectRatio:"none"}));var pe=ne(X,K);return G.createElement("svg",ve({shapeRendering:"crispEdges",height:D,width:D,viewBox:"0 0 ".concat(le," ").concat(le)},Te),G.createElement("path",{fill:ue,d:"M0,0 h".concat(le,"v").concat(le,"H0z")}),G.createElement("path",{fill:Be,d:pe}),_)}}]),P}(G.PureComponent);L(J,"defaultProps",Se);var z=function(P){var ae=P.renderAs,B=me(P,["renderAs"]),be=ae==="svg"?J:C;return G.createElement(be,B)};z.defaultProps=xe({renderAs:"canvas"},Se),Qe.exports=z},DlQD:function(Qe,Ie,h){(function(V,ve){Qe.exports=ve()})(this,function(){"use strict";function V($,q){for(var Q=0;Q<q.length;Q++){var x=q[Q];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty($,x.key,x)}}function ve($,q,Q){return q&&V($.prototype,q),Q&&V($,Q),$}function se($,q){if(!$)return;if(typeof $=="string")return xe($,q);var Q=Object.prototype.toString.call($).slice(8,-1);if(Q==="Object"&&$.constructor&&(Q=$.constructor.name),Q==="Map"||Q==="Set")return Array.from($);if(Q==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Q))return xe($,q)}function xe($,q){(q==null||q>$.length)&&(q=$.length);for(var Q=0,x=new Array(q);Q<q;Q++)x[Q]=$[Q];return x}function me($,q){var Q;if(typeof Symbol=="undefined"||$[Symbol.iterator]==null){if(Array.isArray($)||(Q=se($))||q&&$&&typeof $.length=="number"){Q&&($=Q);var x=0;return function(){return x>=$.length?{done:!0}:{done:!1,value:$[x++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return Q=$[Symbol.iterator](),Q.next.bind(Q)}function re($,q){return q={exports:{}},$(q,q.exports),q.exports}var U=re(function($){function q(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function Q(x){$.exports.defaults=x}$.exports={defaults:q(),getDefaults:q,changeDefaults:Q}}),k=U.defaults,O=U.getDefaults,T=U.changeDefaults,A=/[&<>"']/,M=/[&<>"']/g,te=/[<>"']|&(?!#?\w+;)/,F=/[<>"']|&(?!#?\w+;)/g,L={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},G=function(q){return L[q]};function W($,q){if(q){if(A.test($))return $.replace(M,G)}else if(te.test($))return $.replace(F,G);return $}var ee=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function b($){return $.replace(ee,function(q,Q){return Q=Q.toLowerCase(),Q==="colon"?":":Q.charAt(0)==="#"?Q.charAt(1)==="x"?String.fromCharCode(parseInt(Q.substring(2),16)):String.fromCharCode(+Q.substring(1)):""})}var fe=/(^|[^\[])\^/g;function Se($,q){$=$.source||$,q=q||"";var Q={replace:function(R,j){return j=j.source||j,j=j.replace(fe,"$1"),$=$.replace(R,j),Q},getRegex:function(){return new RegExp($,q)}};return Q}var he=/[^\w:]/g,H=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function g($,q,Q){if($){var x;try{x=decodeURIComponent(b(Q)).replace(he,"").toLowerCase()}catch(R){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}q&&!H.test(Q)&&(Q=C(q,Q));try{Q=encodeURI(Q).replace(/%25/g,"%")}catch(R){return null}return Q}var ne={},S=/^[^:]+:\/*[^/]*$/,Y=/^([^:]+:)[\s\S]*$/,w=/^([^:]+:\/*[^/]*)[\s\S]*$/;function C($,q){ne[" "+$]||(S.test($)?ne[" "+$]=$+"/":ne[" "+$]=P($,"/",!0)),$=ne[" "+$];var Q=$.indexOf(":")===-1;return q.substring(0,2)==="//"?Q?q:$.replace(Y,"$1")+q:q.charAt(0)==="/"?Q?q:$.replace(w,"$1")+q:$+q}var J={exec:function(){}};function z($){for(var q=1,Q,x;q<arguments.length;q++){Q=arguments[q];for(x in Q)Object.prototype.hasOwnProperty.call(Q,x)&&($[x]=Q[x])}return $}function E($,q){var Q=$.replace(/\|/g,function(j,I,de){for(var Ce=!1,Oe=I;--Oe>=0&&de[Oe]==="\\";)Ce=!Ce;return Ce?"|":" |"}),x=Q.split(/ \|/),R=0;if(x.length>q)x.splice(q);else for(;x.length<q;)x.push("");for(;R<x.length;R++)x[R]=x[R].trim().replace(/\\\|/g,"|");return x}function P($,q,Q){var x=$.length;if(x===0)return"";for(var R=0;R<x;){var j=$.charAt(x-R-1);if(j===q&&!Q)R++;else if(j!==q&&Q)R++;else break}return $.substr(0,x-R)}function ae($,q){if($.indexOf(q[1])===-1)return-1;for(var Q=$.length,x=0,R=0;R<Q;R++)if($[R]==="\\")R++;else if($[R]===q[0])x++;else if($[R]===q[1]&&(x--,x<0))return R;return-1}function B($){$&&$.sanitize&&!$.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var be={escape:W,unescape:b,edit:Se,cleanUrl:g,resolveUrl:C,noopTest:J,merge:z,splitCells:E,rtrim:P,findClosingBracket:ae,checkSanitizeDeprecation:B},D=U.defaults,p=be.rtrim,ue=be.splitCells,Be=be.escape,Pe=be.findClosingBracket;function ze($,q,Q){var x=q.href,R=q.title?Be(q.title):null,j=$[1].replace(/\\([\[\]])/g,"$1");return $[0].charAt(0)!=="!"?{type:"link",raw:Q,href:x,title:R,text:j}:{type:"image",raw:Q,href:x,title:R,text:Be(j)}}function Te($,q){var Q=$.match(/^(\s+)(?:```)/);if(Q===null)return q;var x=Q[1];return q.split(`
`).map(function(R){var j=R.match(/^\s+/);if(j===null)return R;var I=j[0];return I.length>=x.length?R.slice(x.length):R}).join(`
`)}var we=function(){function $(Q){this.options=Q||D}var q=$.prototype;return q.space=function(x){var R=this.rules.block.newline.exec(x);if(R)return R[0].length>1?{type:"space",raw:R[0]}:{raw:`
`}},q.code=function(x,R){var j=this.rules.block.code.exec(x);if(j){var I=R[R.length-1];if(I&&I.type==="paragraph")return{raw:j[0],text:j[0].trimRight()};var de=j[0].replace(/^ {4}/gm,"");return{type:"code",raw:j[0],codeBlockStyle:"indented",text:this.options.pedantic?de:p(de,`
`)}}},q.fences=function(x){var R=this.rules.block.fences.exec(x);if(R){var j=R[0],I=Te(j,R[3]||"");return{type:"code",raw:j,lang:R[2]?R[2].trim():R[2],text:I}}},q.heading=function(x){var R=this.rules.block.heading.exec(x);if(R)return{type:"heading",raw:R[0],depth:R[1].length,text:R[2]}},q.nptable=function(x){var R=this.rules.block.nptable.exec(x);if(R){var j={type:"table",header:ue(R[1].replace(/^ *| *\| *$/g,"")),align:R[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:R[3]?R[3].replace(/\n$/,"").split(`
`):[],raw:R[0]};if(j.header.length===j.align.length){var I=j.align.length,de;for(de=0;de<I;de++)/^ *-+: *$/.test(j.align[de])?j.align[de]="right":/^ *:-+: *$/.test(j.align[de])?j.align[de]="center":/^ *:-+ *$/.test(j.align[de])?j.align[de]="left":j.align[de]=null;for(I=j.cells.length,de=0;de<I;de++)j.cells[de]=ue(j.cells[de],j.header.length);return j}}},q.hr=function(x){var R=this.rules.block.hr.exec(x);if(R)return{type:"hr",raw:R[0]}},q.blockquote=function(x){var R=this.rules.block.blockquote.exec(x);if(R){var j=R[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:R[0],text:j}}},q.list=function(x){var R=this.rules.block.list.exec(x);if(R){for(var j=R[0],I=R[2],de=I.length>1,Ce=I[I.length-1]===")",Oe={type:"list",raw:j,ordered:de,start:de?+I.slice(0,-1):"",loose:!1,items:[]},_t=R[0].match(this.rules.block.item),at=!1,ge,lt,Et,et,Ft,tt,zt,It=_t.length,vt=0;vt<It;vt++)ge=_t[vt],j=ge,lt=ge.length,ge=ge.replace(/^ *([*+-]|\d+[.)]) */,""),~ge.indexOf(`
`)&&(lt-=ge.length,ge=this.options.pedantic?ge.replace(/^ {1,4}/gm,""):ge.replace(new RegExp("^ {1,"+lt+"}","gm"),"")),vt!==It-1&&(Et=this.rules.block.bullet.exec(_t[vt+1])[0],(de?Et.length===1||!Ce&&Et[Et.length-1]===")":Et.length>1||this.options.smartLists&&Et!==I)&&(et=_t.slice(vt+1).join(`
`),Oe.raw=Oe.raw.substring(0,Oe.raw.length-et.length),vt=It-1)),Ft=at||/\n\n(?!\s*$)/.test(ge),vt!==It-1&&(at=ge.charAt(ge.length-1)===`
`,Ft||(Ft=at)),Ft&&(Oe.loose=!0),tt=/^\[[ xX]\] /.test(ge),zt=void 0,tt&&(zt=ge[1]!==" ",ge=ge.replace(/^\[[ xX]\] +/,"")),Oe.items.push({type:"list_item",raw:j,task:tt,checked:zt,loose:Ft,text:ge});return Oe}},q.html=function(x){var R=this.rules.block.html.exec(x);if(R)return{type:this.options.sanitize?"paragraph":"html",raw:R[0],pre:!this.options.sanitizer&&(R[1]==="pre"||R[1]==="script"||R[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(R[0]):Be(R[0]):R[0]}},q.def=function(x){var R=this.rules.block.def.exec(x);if(R){R[3]&&(R[3]=R[3].substring(1,R[3].length-1));var j=R[1].toLowerCase().replace(/\s+/g," ");return{tag:j,raw:R[0],href:R[2],title:R[3]}}},q.table=function(x){var R=this.rules.block.table.exec(x);if(R){var j={type:"table",header:ue(R[1].replace(/^ *| *\| *$/g,"")),align:R[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:R[3]?R[3].replace(/\n$/,"").split(`
`):[]};if(j.header.length===j.align.length){j.raw=R[0];var I=j.align.length,de;for(de=0;de<I;de++)/^ *-+: *$/.test(j.align[de])?j.align[de]="right":/^ *:-+: *$/.test(j.align[de])?j.align[de]="center":/^ *:-+ *$/.test(j.align[de])?j.align[de]="left":j.align[de]=null;for(I=j.cells.length,de=0;de<I;de++)j.cells[de]=ue(j.cells[de].replace(/^ *\| *| *\| *$/g,""),j.header.length);return j}}},q.lheading=function(x){var R=this.rules.block.lheading.exec(x);if(R)return{type:"heading",raw:R[0],depth:R[2].charAt(0)==="="?1:2,text:R[1]}},q.paragraph=function(x){var R=this.rules.block.paragraph.exec(x);if(R)return{type:"paragraph",raw:R[0],text:R[1].charAt(R[1].length-1)===`
`?R[1].slice(0,-1):R[1]}},q.text=function(x,R){var j=this.rules.block.text.exec(x);if(j){var I=R[R.length-1];return I&&I.type==="text"?{raw:j[0],text:j[0]}:{type:"text",raw:j[0],text:j[0]}}},q.escape=function(x){var R=this.rules.inline.escape.exec(x);if(R)return{type:"escape",raw:R[0],text:Be(R[1])}},q.tag=function(x,R,j){var I=this.rules.inline.tag.exec(x);if(I)return!R&&/^<a /i.test(I[0])?R=!0:R&&/^<\/a>/i.test(I[0])&&(R=!1),!j&&/^<(pre|code|kbd|script)(\s|>)/i.test(I[0])?j=!0:j&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(I[0])&&(j=!1),{type:this.options.sanitize?"text":"html",raw:I[0],inLink:R,inRawBlock:j,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(I[0]):Be(I[0]):I[0]}},q.link=function(x){var R=this.rules.inline.link.exec(x);if(R){var j=Pe(R[2],"()");if(j>-1){var I=R[0].indexOf("!")===0?5:4,de=I+R[1].length+j;R[2]=R[2].substring(0,j),R[0]=R[0].substring(0,de).trim(),R[3]=""}var Ce=R[2],Oe="";if(this.options.pedantic){var _t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ce);_t?(Ce=_t[1],Oe=_t[3]):Oe=""}else Oe=R[3]?R[3].slice(1,-1):"";Ce=Ce.trim().replace(/^<([\s\S]*)>$/,"$1");var at=ze(R,{href:Ce&&Ce.replace(this.rules.inline._escapes,"$1"),title:Oe&&Oe.replace(this.rules.inline._escapes,"$1")},R[0]);return at}},q.reflink=function(x,R){var j;if((j=this.rules.inline.reflink.exec(x))||(j=this.rules.inline.nolink.exec(x))){var I=(j[2]||j[1]).replace(/\s+/g," ");if(I=R[I.toLowerCase()],!I||!I.href){var de=j[0].charAt(0);return{type:"text",raw:de,text:de}}var Ce=ze(j,I,j[0]);return Ce}},q.strong=function(x,R,j){j===void 0&&(j="");var I=this.rules.inline.strong.start.exec(x);if(I&&(!I[1]||I[1]&&(j===""||this.rules.inline.punctuation.exec(j)))){R=R.slice(-1*x.length);var de=I[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;de.lastIndex=0;for(var Ce;(I=de.exec(R))!=null;)if(Ce=this.rules.inline.strong.middle.exec(R.slice(0,I.index+3)),Ce)return{type:"strong",raw:x.slice(0,Ce[0].length),text:x.slice(2,Ce[0].length-2)}}},q.em=function(x,R,j){j===void 0&&(j="");var I=this.rules.inline.em.start.exec(x);if(I&&(!I[1]||I[1]&&(j===""||this.rules.inline.punctuation.exec(j)))){R=R.slice(-1*x.length);var de=I[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;de.lastIndex=0;for(var Ce;(I=de.exec(R))!=null;)if(Ce=this.rules.inline.em.middle.exec(R.slice(0,I.index+2)),Ce)return{type:"em",raw:x.slice(0,Ce[0].length),text:x.slice(1,Ce[0].length-1)}}},q.codespan=function(x){var R=this.rules.inline.code.exec(x);if(R){var j=R[2].replace(/\n/g," "),I=/[^ ]/.test(j),de=j.startsWith(" ")&&j.endsWith(" ");return I&&de&&(j=j.substring(1,j.length-1)),j=Be(j,!0),{type:"codespan",raw:R[0],text:j}}},q.br=function(x){var R=this.rules.inline.br.exec(x);if(R)return{type:"br",raw:R[0]}},q.del=function(x){var R=this.rules.inline.del.exec(x);if(R)return{type:"del",raw:R[0],text:R[1]}},q.autolink=function(x,R){var j=this.rules.inline.autolink.exec(x);if(j){var I,de;return j[2]==="@"?(I=Be(this.options.mangle?R(j[1]):j[1]),de="mailto:"+I):(I=Be(j[1]),de=I),{type:"link",raw:j[0],text:I,href:de,tokens:[{type:"text",raw:I,text:I}]}}},q.url=function(x,R){var j;if(j=this.rules.inline.url.exec(x)){var I,de;if(j[2]==="@")I=Be(this.options.mangle?R(j[0]):j[0]),de="mailto:"+I;else{var Ce;do Ce=j[0],j[0]=this.rules.inline._backpedal.exec(j[0])[0];while(Ce!==j[0]);I=Be(j[0]),j[1]==="www."?de="http://"+I:de=I}return{type:"link",raw:j[0],text:I,href:de,tokens:[{type:"text",raw:I,text:I}]}}},q.inlineText=function(x,R,j){var I=this.rules.inline.text.exec(x);if(I){var de;return R?de=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(I[0]):Be(I[0]):I[0]:de=Be(this.options.smartypants?j(I[0]):I[0]),{type:"text",raw:I[0],text:de}}},$}(),X=be.noopTest,K=be.edit,le=be.merge,N={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:X,table:X,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};N._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,N._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,N.def=K(N.def).replace("label",N._label).replace("title",N._title).getRegex(),N.bullet=/(?:[*+-]|\d{1,9}[.)])/,N.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,N.item=K(N.item,"gm").replace(/bull/g,N.bullet).getRegex(),N.list=K(N.list).replace(/bull/g,N.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+N.def.source+")").getRegex(),N._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",N._comment=/<!--(?!-?>)[\s\S]*?-->/,N.html=K(N.html,"i").replace("comment",N._comment).replace("tag",N._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),N.paragraph=K(N._paragraph).replace("hr",N.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",N._tag).getRegex(),N.blockquote=K(N.blockquote).replace("paragraph",N.paragraph).getRegex(),N.normal=le({},N),N.gfm=le({},N.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),N.gfm.nptable=K(N.gfm.nptable).replace("hr",N.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",N._tag).getRegex(),N.gfm.table=K(N.gfm.table).replace("hr",N.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",N._tag).getRegex(),N.pedantic=le({},N.normal,{html:K(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",N._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:X,paragraph:K(N.normal._paragraph).replace("hr",N.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",N.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var _={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:X,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:X,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};_._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",_.punctuation=K(_.punctuation).replace(/punctuation/g,_._punctuation).getRegex(),_._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",_._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",_.em.start=K(_.em.start).replace(/punctuation/g,_._punctuation).getRegex(),_.em.middle=K(_.em.middle).replace(/punctuation/g,_._punctuation).replace(/overlapSkip/g,_._overlapSkip).getRegex(),_.em.endAst=K(_.em.endAst,"g").replace(/punctuation/g,_._punctuation).getRegex(),_.em.endUnd=K(_.em.endUnd,"g").replace(/punctuation/g,_._punctuation).getRegex(),_.strong.start=K(_.strong.start).replace(/punctuation/g,_._punctuation).getRegex(),_.strong.middle=K(_.strong.middle).replace(/punctuation/g,_._punctuation).replace(/blockSkip/g,_._blockSkip).getRegex(),_.strong.endAst=K(_.strong.endAst,"g").replace(/punctuation/g,_._punctuation).getRegex(),_.strong.endUnd=K(_.strong.endUnd,"g").replace(/punctuation/g,_._punctuation).getRegex(),_.blockSkip=K(_._blockSkip,"g").getRegex(),_.overlapSkip=K(_._overlapSkip,"g").getRegex(),_._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,_._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,_._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,_.autolink=K(_.autolink).replace("scheme",_._scheme).replace("email",_._email).getRegex(),_._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,_.tag=K(_.tag).replace("comment",N._comment).replace("attribute",_._attribute).getRegex(),_._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,_._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,_._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,_.link=K(_.link).replace("label",_._label).replace("href",_._href).replace("title",_._title).getRegex(),_.reflink=K(_.reflink).replace("label",_._label).getRegex(),_.reflinkSearch=K(_.reflinkSearch,"g").replace("reflink",_.reflink).replace("nolink",_.nolink).getRegex(),_.normal=le({},_),_.pedantic=le({},_.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:K(/^!?\[(label)\]\((.*?)\)/).replace("label",_._label).getRegex(),reflink:K(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_._label).getRegex()}),_.gfm=le({},_.normal,{escape:K(_.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),_.gfm.url=K(_.gfm.url,"i").replace("email",_.gfm._extended_email).getRegex(),_.breaks=le({},_.gfm,{br:K(_.br).replace("{2,}","*").getRegex(),text:K(_.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var pe={block:N,inline:_},Ue=U.defaults,Ze=pe.block,Ae=pe.inline;function De($){return $.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function Re($){var q="",Q,x,R=$.length;for(Q=0;Q<R;Q++)x=$.charCodeAt(Q),Math.random()>.5&&(x="x"+x.toString(16)),q+="&#"+x+";";return q}var Me=function(){function $(Q){this.tokens=[],this.tokens.links=Object.create(null),this.options=Q||Ue,this.options.tokenizer=this.options.tokenizer||new we,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var x={block:Ze.normal,inline:Ae.normal};this.options.pedantic?(x.block=Ze.pedantic,x.inline=Ae.pedantic):this.options.gfm&&(x.block=Ze.gfm,this.options.breaks?x.inline=Ae.breaks:x.inline=Ae.gfm),this.tokenizer.rules=x}$.lex=function(x,R){var j=new $(R);return j.lex(x)};var q=$.prototype;return q.lex=function(x){return x=x.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(x,this.tokens,!0),this.inline(this.tokens),this.tokens},q.blockTokens=function(x,R,j){R===void 0&&(R=[]),j===void 0&&(j=!0),x=x.replace(/^ +$/gm,"");for(var I,de,Ce,Oe;x;){if(I=this.tokenizer.space(x)){x=x.substring(I.raw.length),I.type&&R.push(I);continue}if(I=this.tokenizer.code(x,R)){x=x.substring(I.raw.length),I.type?R.push(I):(Oe=R[R.length-1],Oe.raw+=`
`+I.raw,Oe.text+=`
`+I.text);continue}if(I=this.tokenizer.fences(x)){x=x.substring(I.raw.length),R.push(I);continue}if(I=this.tokenizer.heading(x)){x=x.substring(I.raw.length),R.push(I);continue}if(I=this.tokenizer.nptable(x)){x=x.substring(I.raw.length),R.push(I);continue}if(I=this.tokenizer.hr(x)){x=x.substring(I.raw.length),R.push(I);continue}if(I=this.tokenizer.blockquote(x)){x=x.substring(I.raw.length),I.tokens=this.blockTokens(I.text,[],j),R.push(I);continue}if(I=this.tokenizer.list(x)){for(x=x.substring(I.raw.length),Ce=I.items.length,de=0;de<Ce;de++)I.items[de].tokens=this.blockTokens(I.items[de].text,[],!1);R.push(I);continue}if(I=this.tokenizer.html(x)){x=x.substring(I.raw.length),R.push(I);continue}if(j&&(I=this.tokenizer.def(x))){x=x.substring(I.raw.length),this.tokens.links[I.tag]||(this.tokens.links[I.tag]={href:I.href,title:I.title});continue}if(I=this.tokenizer.table(x)){x=x.substring(I.raw.length),R.push(I);continue}if(I=this.tokenizer.lheading(x)){x=x.substring(I.raw.length),R.push(I);continue}if(j&&(I=this.tokenizer.paragraph(x))){x=x.substring(I.raw.length),R.push(I);continue}if(I=this.tokenizer.text(x,R)){x=x.substring(I.raw.length),I.type?R.push(I):(Oe=R[R.length-1],Oe.raw+=`
`+I.raw,Oe.text+=`
`+I.text);continue}if(x){var _t="Infinite loop on byte: "+x.charCodeAt(0);if(this.options.silent){console.error(_t);break}else throw new Error(_t)}}return R},q.inline=function(x){var R,j,I,de,Ce,Oe,_t=x.length;for(R=0;R<_t;R++){Oe=x[R];switch(Oe.type){case"paragraph":case"text":case"heading":{Oe.tokens=[],this.inlineTokens(Oe.text,Oe.tokens);break}case"table":{for(Oe.tokens={header:[],cells:[]},de=Oe.header.length,j=0;j<de;j++)Oe.tokens.header[j]=[],this.inlineTokens(Oe.header[j],Oe.tokens.header[j]);for(de=Oe.cells.length,j=0;j<de;j++)for(Ce=Oe.cells[j],Oe.tokens.cells[j]=[],I=0;I<Ce.length;I++)Oe.tokens.cells[j][I]=[],this.inlineTokens(Ce[I],Oe.tokens.cells[j][I]);break}case"blockquote":{this.inline(Oe.tokens);break}case"list":{for(de=Oe.items.length,j=0;j<de;j++)this.inline(Oe.items[j].tokens);break}}}return x},q.inlineTokens=function(x,R,j,I,de){R===void 0&&(R=[]),j===void 0&&(j=!1),I===void 0&&(I=!1),de===void 0&&(de="");var Ce,Oe=x,_t;if(this.tokens.links){var at=Object.keys(this.tokens.links);if(at.length>0)for(;(_t=this.tokenizer.rules.inline.reflinkSearch.exec(Oe))!=null;)at.includes(_t[0].slice(_t[0].lastIndexOf("[")+1,-1))&&(Oe=Oe.slice(0,_t.index)+"["+"a".repeat(_t[0].length-2)+"]"+Oe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(_t=this.tokenizer.rules.inline.blockSkip.exec(Oe))!=null;)Oe=Oe.slice(0,_t.index)+"["+"a".repeat(_t[0].length-2)+"]"+Oe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;x;){if(Ce=this.tokenizer.escape(x)){x=x.substring(Ce.raw.length),R.push(Ce);continue}if(Ce=this.tokenizer.tag(x,j,I)){x=x.substring(Ce.raw.length),j=Ce.inLink,I=Ce.inRawBlock,R.push(Ce);continue}if(Ce=this.tokenizer.link(x)){x=x.substring(Ce.raw.length),Ce.type==="link"&&(Ce.tokens=this.inlineTokens(Ce.text,[],!0,I)),R.push(Ce);continue}if(Ce=this.tokenizer.reflink(x,this.tokens.links)){x=x.substring(Ce.raw.length),Ce.type==="link"&&(Ce.tokens=this.inlineTokens(Ce.text,[],!0,I)),R.push(Ce);continue}if(Ce=this.tokenizer.strong(x,Oe,de)){x=x.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],j,I),R.push(Ce);continue}if(Ce=this.tokenizer.em(x,Oe,de)){x=x.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],j,I),R.push(Ce);continue}if(Ce=this.tokenizer.codespan(x)){x=x.substring(Ce.raw.length),R.push(Ce);continue}if(Ce=this.tokenizer.br(x)){x=x.substring(Ce.raw.length),R.push(Ce);continue}if(Ce=this.tokenizer.del(x)){x=x.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],j,I),R.push(Ce);continue}if(Ce=this.tokenizer.autolink(x,Re)){x=x.substring(Ce.raw.length),R.push(Ce);continue}if(!j&&(Ce=this.tokenizer.url(x,Re))){x=x.substring(Ce.raw.length),R.push(Ce);continue}if(Ce=this.tokenizer.inlineText(x,I,De)){x=x.substring(Ce.raw.length),de=Ce.raw.slice(-1),R.push(Ce);continue}if(x){var ge="Infinite loop on byte: "+x.charCodeAt(0);if(this.options.silent){console.error(ge);break}else throw new Error(ge)}}return R},ve($,null,[{key:"rules",get:function(){return{block:Ze,inline:Ae}}}]),$}(),Xe=U.defaults,qe=be.cleanUrl,ot=be.escape,Ke=function(){function $(Q){this.options=Q||Xe}var q=$.prototype;return q.code=function(x,R,j){var I=(R||"").match(/\S*/)[0];if(this.options.highlight){var de=this.options.highlight(x,I);de!=null&&de!==x&&(j=!0,x=de)}return I?'<pre><code class="'+this.options.langPrefix+ot(I,!0)+'">'+(j?x:ot(x,!0))+`</code></pre>
`:"<pre><code>"+(j?x:ot(x,!0))+`</code></pre>
`},q.blockquote=function(x){return`<blockquote>
`+x+`</blockquote>
`},q.html=function(x){return x},q.heading=function(x,R,j,I){return this.options.headerIds?"<h"+R+' id="'+this.options.headerPrefix+I.slug(j)+'">'+x+"</h"+R+`>
`:"<h"+R+">"+x+"</h"+R+`>
`},q.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},q.list=function(x,R,j){var I=R?"ol":"ul",de=R&&j!==1?' start="'+j+'"':"";return"<"+I+de+`>
`+x+"</"+I+`>
`},q.listitem=function(x){return"<li>"+x+`</li>
`},q.checkbox=function(x){return"<input "+(x?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},q.paragraph=function(x){return"<p>"+x+`</p>
`},q.table=function(x,R){return R&&(R="<tbody>"+R+"</tbody>"),`<table>
<thead>
`+x+`</thead>
`+R+`</table>
`},q.tablerow=function(x){return`<tr>
`+x+`</tr>
`},q.tablecell=function(x,R){var j=R.header?"th":"td",I=R.align?"<"+j+' align="'+R.align+'">':"<"+j+">";return I+x+"</"+j+`>
`},q.strong=function(x){return"<strong>"+x+"</strong>"},q.em=function(x){return"<em>"+x+"</em>"},q.codespan=function(x){return"<code>"+x+"</code>"},q.br=function(){return this.options.xhtml?"<br/>":"<br>"},q.del=function(x){return"<del>"+x+"</del>"},q.link=function(x,R,j){if(x=qe(this.options.sanitize,this.options.baseUrl,x),x===null)return j;var I='<a href="'+ot(x)+'"';return R&&(I+=' title="'+R+'"'),I+=">"+j+"</a>",I},q.image=function(x,R,j){if(x=qe(this.options.sanitize,this.options.baseUrl,x),x===null)return j;var I='<img src="'+x+'" alt="'+j+'"';return R&&(I+=' title="'+R+'"'),I+=this.options.xhtml?"/>":">",I},q.text=function(x){return x},$}(),Ve=function(){function $(){}var q=$.prototype;return q.strong=function(x){return x},q.em=function(x){return x},q.codespan=function(x){return x},q.del=function(x){return x},q.html=function(x){return x},q.text=function(x){return x},q.link=function(x,R,j){return""+j},q.image=function(x,R,j){return""+j},q.br=function(){return""},$}(),At=function(){function $(){this.seen={}}var q=$.prototype;return q.slug=function(x){var R=x.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(R)){var j=R;do this.seen[j]++,R=j+"-"+this.seen[j];while(this.seen.hasOwnProperty(R))}return this.seen[R]=0,R},$}(),gt=U.defaults,kt=be.unescape,ct=function(){function $(Q){this.options=Q||gt,this.options.renderer=this.options.renderer||new Ke,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ve,this.slugger=new At}$.parse=function(x,R){var j=new $(R);return j.parse(x)};var q=$.prototype;return q.parse=function(x,R){R===void 0&&(R=!0);var j="",I,de,Ce,Oe,_t,at,ge,lt,Et,et,Ft,tt,zt,It,vt,$t,Lt,Fe,ut=x.length;for(I=0;I<ut;I++){et=x[I];switch(et.type){case"space":continue;case"hr":{j+=this.renderer.hr();continue}case"heading":{j+=this.renderer.heading(this.parseInline(et.tokens),et.depth,kt(this.parseInline(et.tokens,this.textRenderer)),this.slugger);continue}case"code":{j+=this.renderer.code(et.text,et.lang,et.escaped);continue}case"table":{for(lt="",ge="",Oe=et.header.length,de=0;de<Oe;de++)ge+=this.renderer.tablecell(this.parseInline(et.tokens.header[de]),{header:!0,align:et.align[de]});for(lt+=this.renderer.tablerow(ge),Et="",Oe=et.cells.length,de=0;de<Oe;de++){for(at=et.tokens.cells[de],ge="",_t=at.length,Ce=0;Ce<_t;Ce++)ge+=this.renderer.tablecell(this.parseInline(at[Ce]),{header:!1,align:et.align[Ce]});Et+=this.renderer.tablerow(ge)}j+=this.renderer.table(lt,Et);continue}case"blockquote":{Et=this.parse(et.tokens),j+=this.renderer.blockquote(Et);continue}case"list":{for(Ft=et.ordered,tt=et.start,zt=et.loose,Oe=et.items.length,Et="",de=0;de<Oe;de++)vt=et.items[de],$t=vt.checked,Lt=vt.task,It="",vt.task&&(Fe=this.renderer.checkbox($t),zt?vt.tokens.length>0&&vt.tokens[0].type==="text"?(vt.tokens[0].text=Fe+" "+vt.tokens[0].text,vt.tokens[0].tokens&&vt.tokens[0].tokens.length>0&&vt.tokens[0].tokens[0].type==="text"&&(vt.tokens[0].tokens[0].text=Fe+" "+vt.tokens[0].tokens[0].text)):vt.tokens.unshift({type:"text",text:Fe}):It+=Fe),It+=this.parse(vt.tokens,zt),Et+=this.renderer.listitem(It,Lt,$t);j+=this.renderer.list(Et,Ft,tt);continue}case"html":{j+=this.renderer.html(et.text);continue}case"paragraph":{j+=this.renderer.paragraph(this.parseInline(et.tokens));continue}case"text":{for(Et=et.tokens?this.parseInline(et.tokens):et.text;I+1<ut&&x[I+1].type==="text";)et=x[++I],Et+=`
`+(et.tokens?this.parseInline(et.tokens):et.text);j+=R?this.renderer.paragraph(Et):Et;continue}default:{var nt='Token with "'+et.type+'" type was not found.';if(this.options.silent){console.error(nt);return}else throw new Error(nt)}}}return j},q.parseInline=function(x,R){R=R||this.renderer;var j="",I,de,Ce=x.length;for(I=0;I<Ce;I++){de=x[I];switch(de.type){case"escape":{j+=R.text(de.text);break}case"html":{j+=R.html(de.text);break}case"link":{j+=R.link(de.href,de.title,this.parseInline(de.tokens,R));break}case"image":{j+=R.image(de.href,de.title,de.text);break}case"strong":{j+=R.strong(this.parseInline(de.tokens,R));break}case"em":{j+=R.em(this.parseInline(de.tokens,R));break}case"codespan":{j+=R.codespan(de.text);break}case"br":{j+=R.br();break}case"del":{j+=R.del(this.parseInline(de.tokens,R));break}case"text":{j+=R.text(de.text);break}default:{var Oe='Token with "'+de.type+'" type was not found.';if(this.options.silent){console.error(Oe);return}else throw new Error(Oe)}}}return j},$}(),Pt=be.merge,xt=be.checkSanitizeDeprecation,bt=be.escape,Ne=U.getDefaults,Ut=U.changeDefaults,Rt=U.defaults;function je($,q,Q){if(typeof $=="undefined"||$===null)throw new Error("marked(): input parameter is undefined or null");if(typeof $!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call($)+", string expected");if(typeof q=="function"&&(Q=q,q=null),q=Pt({},je.defaults,q||{}),xt(q),Q){var x=q.highlight,R;try{R=Me.lex($,q)}catch(Ce){return Q(Ce)}var j=function(Oe){var _t;if(!Oe)try{_t=ct.parse(R,q)}catch(at){Oe=at}return q.highlight=x,Oe?Q(Oe):Q(null,_t)};if(!x||x.length<3)return j();if(delete q.highlight,!R.length)return j();var I=0;je.walkTokens(R,function(Ce){Ce.type==="code"&&(I++,setTimeout(function(){x(Ce.text,Ce.lang,function(Oe,_t){if(Oe)return j(Oe);_t!=null&&_t!==Ce.text&&(Ce.text=_t,Ce.escaped=!0),I--,I===0&&j()})},0))}),I===0&&j();return}try{var de=Me.lex($,q);return q.walkTokens&&je.walkTokens(de,q.walkTokens),ct.parse(de,q)}catch(Ce){if(Ce.message+=`
Please report this to https://github.com/markedjs/marked.`,q.silent)return"<p>An error occurred:</p><pre>"+bt(Ce.message+"",!0)+"</pre>";throw Ce}}je.options=je.setOptions=function($){return Pt(je.defaults,$),Ut(je.defaults),je},je.getDefaults=Ne,je.defaults=Rt,je.use=function($){var q=Pt({},$);if($.renderer&&function(){var x=je.defaults.renderer||new Ke,R=function(de){var Ce=x[de];x[de]=function(){for(var Oe=arguments.length,_t=new Array(Oe),at=0;at<Oe;at++)_t[at]=arguments[at];var ge=$.renderer[de].apply(x,_t);return ge===!1&&(ge=Ce.apply(x,_t)),ge}};for(var j in $.renderer)R(j);q.renderer=x}(),$.tokenizer&&function(){var x=je.defaults.tokenizer||new we,R=function(de){var Ce=x[de];x[de]=function(){for(var Oe=arguments.length,_t=new Array(Oe),at=0;at<Oe;at++)_t[at]=arguments[at];var ge=$.tokenizer[de].apply(x,_t);return ge===!1&&(ge=Ce.apply(x,_t)),ge}};for(var j in $.tokenizer)R(j);q.tokenizer=x}(),$.walkTokens){var Q=je.defaults.walkTokens;q.walkTokens=function(x){$.walkTokens(x),Q&&Q(x)}}je.setOptions(q)},je.walkTokens=function($,q){for(var Q=me($),x;!(x=Q()).done;){var R=x.value;q(R);switch(R.type){case"table":{for(var j=me(R.tokens.header),I;!(I=j()).done;){var de=I.value;je.walkTokens(de,q)}for(var Ce=me(R.tokens.cells),Oe;!(Oe=Ce()).done;)for(var _t=Oe.value,at=me(_t),ge;!(ge=at()).done;){var lt=ge.value;je.walkTokens(lt,q)}break}case"list":{je.walkTokens(R.items,q);break}default:R.tokens&&je.walkTokens(R.tokens,q)}}},je.Parser=ct,je.parser=ct.parse,je.Renderer=Ke,je.TextRenderer=Ve,je.Lexer=Me,je.lexer=Me.lex,je.Tokenizer=we,je.Slugger=At,je.parse=je;var We=je;return We})},"Dvv+":function(Qe,Ie,h){"use strict";h.r(Ie);var V=h("cWXX"),ve=h("/ezw"),se=h("+L6B"),xe=h("2/Rp"),me=h("7Kak"),re=h("9yH6"),U=h("giR+"),k=h("fyUT"),O=h("9og8"),T=h("k1fw"),A=h("y8nQ"),M=h("Vl3Y"),te=h("tJVT"),F=h("5NDa"),L=h("5rEg"),G=h("WmNS"),W=h.n(G),ee=h("q1tI"),b=h.n(ee),fe=h("Ty5D"),Se=h("9kvl"),he=h("m3fD"),H=h.n(he),g=h("A+k2"),ne=h.n(g),S=function(de){var Ce=de.value,Oe=Ce===void 0?[]:Ce,_t=de.onChange,at=de.className,ge=at===void 0?"":at;return b.a.createElement("div",{className:"".concat(ne.a.tabs," ").concat(ge," ")},b.a.createElement("div",{onClick:function(){return _t(0)},className:Oe===0?ne.a.active:""},b.a.createElement("div",null,"1"),b.a.createElement("div",null,"\u5F55\u5165\u4FE1\u606F")," "),b.a.createElement("div",{onClick:function(){return _t(1)},className:Oe===1?ne.a.active:""},b.a.createElement("div",null,"2"),b.a.createElement("div",null,"\u914D\u7F6E\u7EC4\u5377")))},Y=S,w=h("2qtc"),C=h("kLXV"),J=h("sRBo"),z=h("kaz8"),E=h("5Dmo"),P=h("3S7+"),ae=h("miYZ"),B=h("tsqr"),be=h("oBTY"),D=h("IlMy"),p=h.n(D),ue=h("WCUW"),Be=h("QSKd"),Pe=h.n(Be),ze=h("Hfvn"),Te=h.n(ze),we=h("HPRh"),X=h.n(we),K=h("+RXH"),le=h.n(K),N=h("+yhJ"),_=h.n(N),pe=h("RZ/O"),Ue=h.n(pe),Ze=h("exQ7"),Ae=h.n(Ze),De=h("HG2Q"),Re=h.n(De),Me=h("k4n4"),Xe=h("eS0+"),qe=h("PpiC"),ot=h("K5AI"),Ke=h.n(ot),Ve=h("LvDl"),At=z.a.Group,gt=function(de){var Ce=de.value,Oe=Ce===void 0?[]:Ce,_t=de.onChange,at=de.options,ge=de.search,lt=Object(qe.a)(de,["value","onChange","options","search"]),Et=b.a.useState(!1),et=Object(te.a)(Et,2),Ft=et[0],tt=et[1];Object(ee.useEffect)(function(){var Lt,Fe=at==null||((Lt=at.tag_disciplines)===null||Lt===void 0)?void 0:Lt.map(function(nt){return nt.id}),ut=Oe==null?void 0:Oe.filter(function(nt){return Fe.includes(nt)});tt(ut.length===(Fe==null?void 0:Fe.length))},[Oe]);var zt=function(Fe){var ut,nt,dt=at==null||((ut=at.tag_disciplines)===null||ut===void 0)?void 0:ut.map(function(Gt){return Gt.id}),Kt=Oe==null?void 0:Oe.filter(function(Gt){return dt.includes(Gt)}),Vt=Object(Ve.uniq)([].concat(Object(be.a)(Oe),Object(be.a)(Fe)));if(Kt.length>Fe.length){var an=Object(Ve.xor)(Kt,Fe);console.log(an,"newLevel"),Vt=Vt.filter(function(Gt){return!an.includes(Gt)})}_t(Vt),tt(Fe.length===(at==null||((nt=at.tag_disciplines)===null||nt===void 0)?void 0:nt.length))},It=function(Fe){var ut,nt=at==null||((ut=at.tag_disciplines)===null||ut===void 0)?void 0:ut.map(function(dt){return dt.id});_t(Fe.target.checked?Object(Ve.uniq)([].concat(Object(be.a)(Oe),Object(be.a)(nt))):Oe==null?void 0:Oe.filter(function(dt){return!nt.includes(dt)})),tt(Fe.target.checked)};console.log(at,"options");var vt=function(){var Fe,ut,nt=(at==null?void 0:at.tag_disciplines)||[];if(ge){var dt;nt=(dt=nt)===null||dt===void 0?void 0:dt.filter(function(Kt){var Vt;return Kt==null||((Vt=Kt.name)===null||Vt===void 0)?void 0:Vt.includes(ge)})}return nt=(Fe=nt)===null||Fe===void 0?void 0:Fe.map(function(Kt){return Object(T.a)(Object(T.a)({},Kt),{},{label:"".concat(Kt.name,"(".concat(Kt==null?void 0:Kt.item_count,")")),value:Kt.id})}),nt=(ut=nt)===null||ut===void 0?void 0:ut.filter(function(Kt){return Kt.item_count!==0}),nt},$t=function(){var Fe=!1;if(!ge)Fe=!0;else{var ut;(ut=at.tag_disciplines)===null||ut===void 0||ut.forEach(function(nt){if(!Fe){var dt;Fe=((dt=nt.name)===null||dt===void 0?void 0:dt.includes(ge))&&nt.item_count!==0}})}return Fe};return(at==null?void 0:at.item_count)===0||!$t()?b.a.createElement(b.a.Fragment,null):b.a.createElement("div",{className:Ke.a.cInput},b.a.createElement("div",{className:Ke.a.cl},b.a.createElement(z.a,{checked:Ft,onChange:It},b.a.createElement("span",{className:Ke.a.box},b.a.createElement("span",{className:"font14 c-light-primary"},b.a.createElement("span",{title:at==null?void 0:at.name,className:Ke.a.box1}," ",at==null?void 0:at.name),b.a.createElement("span",null," ","(".concat(at==null?void 0:at.item_count,")"))),b.a.createElement("i",{className:"iconfont icon-lujing font12 ml5"})))),b.a.createElement("div",{className:Ke.a.cr},b.a.createElement(At,{options:vt(),value:Oe,onChange:zt})))},kt=gt,ct=h("ErOA"),Pt=h("ozfa"),xt=h("MJZm"),bt=h("0Owb"),Ne=h("tmPe"),Ut=h.n(Ne),Rt=function(de){var Ce=de.value,Oe=de.onChange,_t=de.defaultValue,at=de.treeData,ge=at===void 0?[]:at,lt=Object(qe.a)(de,["value","onChange","defaultValue","treeData"]);return b.a.createElement("div",{className:Ut.a.customTree},b.a.createElement(xt.a,Object(bt.a)({multiple:!0,showIcon:!0,selectedKeys:Ce,defaultExpandedKeys:_t,treeData:ge,onSelect:Oe},lt)))},je=Rt,We=h("sbIO"),$=L.a.Search,q=function(de){var Ce,Oe=de.formValue,_t=de.setFatherTabs,at=de.tabs,ge=de.editData,lt=de.dispatch,Et=Object(fe.i)().id,et=Object(ee.useState)(["mine"]),Ft=Object(te.a)(et,2),tt=Ft[0],zt=Ft[1],It=Object(ee.useState)(!0),vt=Object(te.a)(It,2),$t=vt[0],Lt=vt[1],Fe=Object(ee.useState)(!1),ut=Object(te.a)(Fe,2),nt=ut[0],dt=ut[1],Kt=Object(ee.useState)(!1),Vt=Object(te.a)(Kt,2),an=Vt[0],Gt=Vt[1],Ct=Object(ee.useState)(""),tn=Object(te.a)(Ct,2),Nt=tn[0],ln=tn[1],Xt=Object(ee.useState)(!1),hn=Object(te.a)(Xt,2),Kn=hn[0],nn=hn[1],$e=Object(ee.useState)(!1),st=Object(te.a)($e,2),fn=st[0],gn=st[1],On=Object(ee.useState)({}),Bn=Object(te.a)(On,2),d=Bn[0],o=Bn[1],r=Object(ee.useState)([]),u=Object(te.a)(r,2),v=u[0],c=u[1],oe=Object(ee.useState)([]),Je=Object(te.a)(oe,2),_e=Je[0],Bt=Je[1],Ee=Object(ee.useState)([]),ce=Object(te.a)(Ee,2),Ye=ce[0],Ot=ce[1],Mt=Object(ee.useState)([]),Tt=Object(te.a)(Mt,2),Dt=Tt[0],cn=Tt[1],Nn=Object(ee.useState)(null),Cn=Object(te.a)(Nn,2),pn=Cn[0],Wn=Cn[1],jn=Object(ee.useRef)([]),ti=Object(ee.useState)(!1),xi=Object(te.a)(ti,2),Fn=xi[0],Xn=xi[1],$i=Object(ee.useState)([]),ri=Object(te.a)($i,2),wn=ri[0],Hi=ri[1],la=Object(ee.useState)([0]),ia=Object(te.a)(la,2),$n=ia[0],yn=ia[1],di=Object(ee.useState)([]),vn=Object(te.a)(di,2),ni=vn[0],An=vn[1],Si=Object(ee.useRef)([]),ii=Object(ee.useState)(!1),Zn=Object(te.a)(ii,2),Yi=Zn[0],Ji=Zn[1],aa=Object(ee.useState)([]),Sa=Object(te.a)(aa,2),Sn=Sa[0],Qi=Sa[1],Ti=Object(ee.useState)([]),ua=Object(te.a)(Ti,2),Pi=ua[0],oa=ua[1],ra=Object(ee.useRef)([]),eo=Object(ee.useState)([]),to=Object(te.a)(eo,2),To=to[0],no=to[1],Ia=Object(ee.useState)(!1),Ht=Object(te.a)(Ia,2),qt=Ht[0],Jt=Ht[1],rn=Object(ee.useRef)([]),mn=Object(ee.useState)(0),_n=Object(te.a)(mn,2),dn=_n[0],Mn=_n[1],Yn=ni==null?void 0:ni.filter(function(pt){return wn==null?void 0:wn.includes(pt.id)}),un=Pi==null?void 0:Pi.filter(function(pt){return Sn==null?void 0:Sn.includes(pt.id)});Object(ee.useEffect)(function(){hi()},[]),Object(ee.useEffect)(function(){return at===1&&(lt({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),lt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1})),function(){lt({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),lt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}},[at]),Object(ee.useEffect)(function(){Et?ge&&Tn():(da(tt),ma(),Lt(!1))},[ge]),Object(ee.useEffect)(function(){Nt&&ca()},[Nt]);var ca=function(){var rt=null;_e==null||_e.forEach(function(He){var Le;(Le=He.sub_disciplines)===null||Le===void 0||Le.forEach(function(mt){var ft;(ft=mt.tag_disciplines)===null||ft===void 0||ft.forEach(function(yt){var Qt,on=((Qt=yt.name)===null||Qt===void 0?void 0:Qt.includes(Nt))&&yt.item_count!==0;on&&!rt&&(rt=He.id)})})}),rt&&Wn(rt)},kn=function(rt){function He(Le){var mt=Le.children,ft=Array.isArray(mt)&&mt.length>0,yt=Le==null?void 0:Le.group_id;return rn.current.push({name:Le==null?void 0:Le.name,id:yt,count:Le==null?void 0:Le.count}),{title:b.a.createElement("div",{title:Le==null?void 0:Le.name,className:p.a.name},Le==null?void 0:Le.name,"\uFF08".concat(Le==null?void 0:Le.count,"\uFF09")),value:yt,name:Le==null?void 0:Le.name,key:yt,count:Le==null?void 0:Le.count,id:yt,icon:b.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:ft?mt==null?void 0:mt.map(function(Qt){return He(Qt)}):[]}}return rt==null?void 0:rt.map(function(Le){return He(Le)})},hi=function(){var pt=Object(O.a)(W.a.mark(function rt(){var He,Le;return W.a.wrap(function(ft){for(;;)switch(ft.prev=ft.next){case 0:return ft.next=2,Object(ue.x)({});case 2:He=ft.sent,rn.current=[{id:0,name:"\u6839\u76EE\u5F55",count:He==null?void 0:He.root_count}],He!=null&&He.data&&(Le=[{title:b.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:p.a.name},"\u6839\u76EE\u5F55","\uFF08".concat((He==null?void 0:He.root_count)||0,"\uFF09")),value:0,id:0,key:0,count:He==null?void 0:He.root_count,name:"\u6839\u76EE\u5F55",icon:b.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:kn(He.data||[])}],An(rn.current),no(Le));case 5:case"end":return ft.stop()}},rt)}));return function(){return pt.apply(this,arguments)}}(),Tn=function(){var pt=Object(O.a)(W.a.mark(function rt(){var He,Le,mt,ft,yt,Qt,on,Pn,xn,Ln,En,ai,Hn,zn,pi,si,qn,mi;return W.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return Ln=ge==null||((He=ge.tag_disciplines)===null||He===void 0)?void 0:He.map(function(bn){return bn.tag_discipline_id}),En=ge==null||((Le=ge.groups)===null||Le===void 0)?void 0:Le.map(function(bn){return bn.id}),ai={source:ge==null||((mt=ge.examination_bank)===null||mt===void 0)?void 0:mt.source,group_ids:En,tag_discipline_ids:Ln,teach_group_ids:ge==null?void 0:ge.teach_group_ids},en.next=5,Object(ct.a)("/api/examination_intelligent_settings/form_paper.json",{method:"post",body:ai});case 5:if(Hn=en.sent,!((Hn==null?void 0:Hn.status)===-1)){en.next=8;break}return en.abrupt("return");case 8:zn=Hn==null?void 0:Hn.filter(function(bn){var Jn;return!!(bn!=null&&(Jn=bn.item_banks)!==null&&Jn!==void 0&&Jn.length)}),zn=zn.map(function(bn){return Object(T.a)(Object(T.a)({},bn),{},{scoreTotal:0,score:0,questionTotal:0})}),zn=(ft=zn)===null||ft===void 0?void 0:ft.map(function(bn,Jn){var gi,li,Mi;return Object(T.a)(Object(T.a)({},bn),{},{score:(ge==null||((gi=ge.score_settings)===null||gi===void 0||((li=gi.find(function(Li){return Li.item_type===(bn==null?void 0:bn.item_type)}))===null||li===void 0))?void 0:li.score)||0,item_banks:bn==null||((Mi=bn.item_banks)===null||Mi===void 0)?void 0:Mi.map(function(Li){var Un;return Object(T.a)(Object(T.a)({},Li),{},{tag_disciplines:Li==null||((Un=Li.tag_disciplines)===null||Un===void 0)?void 0:Un.map(function(Vn){var vi;return Object(T.a)(Object(T.a)({},Vn),{},{difficulties:Vn==null||((vi=Vn.difficulties)===null||vi===void 0)?void 0:vi.map(function(ki){var yi=ge==null?void 0:ge.contents.find(function(ji){return ji.item_type===bn.item_type&&ji.sub_discipline_id===Li.sub_discipline_id&&ji.tag_discipline_id===Vn.tag_discipline_id&&ji.difficulty===ki.difficulty});return yi?Object(T.a)(Object(T.a)({},ki),{},{num:yi==null?void 0:yi.quanlity}):Object(T.a)({},ki)})})})})})})}),pi=ka(zn),si=pi.panel,qn=pi.score_num_item,zn=(yt=zn)===null||yt===void 0?void 0:yt.map(function(bn,Jn){var gi,li=(si==null||((gi=si[Jn])===null||gi===void 0)?void 0:gi.reduce(function(Mi,Li){return Mi+Li},0))||0;return Object(T.a)(Object(T.a)({},bn),{},{scoreTotal:li*(qn[Jn]||0),questionTotal:li})}),mi=[],ge==null||((Qt=ge.sort_by_item_type)===null||Qt===void 0)||Qt.forEach(function(bn){var Jn=zn.find(function(gi){var li,Mi=(li=Ra.find(function(Li){return Li.type===(gi==null?void 0:gi.item_type)}))===null||li===void 0?void 0:li.name;return Mi===bn});mi.push(Jn)}),mi=Object(Ve.compact)(mi),da(ge==null||((on=ge.examination_bank)===null||on===void 0)?void 0:on.source),ma(),zt(ge==null||((Pn=ge.examination_bank)===null||Pn===void 0)?void 0:Pn.source),cn(Ln),jn.current=Ln,Hi(En),Qi((ge==null?void 0:ge.teach_group_ids)||[]),Mn(ge==null||((xn=ge.groups)===null||xn===void 0)?void 0:xn.map(function(bn){return bn.count}).reduce(function(bn,Jn){return bn+Jn},0)),Si.current=En,yn(En!=null&&En.length?En:[0]),c(Object(Ve.cloneDeep)(mi)),Lt(!1);case 29:case"end":return en.stop()}},rt)}));return function(){return pt.apply(this,arguments)}}(),zi=function(){var pt=Object(O.a)(W.a.mark(function rt(){var He;return W.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:He={source:tt,group_ids:wn,tag_discipline_ids:Dt,teach_group_ids:Sn},ha(He),jn.current=Dt,nn(!1);case 4:case"end":return mt.stop()}},rt)}));return function(){return pt.apply(this,arguments)}}(),da=function(){var pt=Object(O.a)(W.a.mark(function rt(He){var Le,mt,ft,yt,Qt,on;return W.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:return xn.next=2,Object(ct.a)("/api/disciplines.json",{method:"get",params:{source:"question",question_source:He}});case 2:ft=xn.sent,yt=[],ft==null||((Le=ft.disciplines)===null||Le===void 0)||Le.forEach(function(Ln){var En;Ln==null||((En=Ln.sub_disciplines)===null||En===void 0)||En.forEach(function(ai){yt=yt.concat((ai==null?void 0:ai.tag_disciplines)||[])})}),Qt=null,on=ft==null||((mt=ft.disciplines)===null||mt===void 0)?void 0:mt.map(function(Ln){var En,ai=Ln==null||((En=Ln.sub_disciplines)===null||En===void 0)?void 0:En.reduce(function(Hn,zn){return Hn+zn.item_count},0);return!Qt&&ai!==0&&(Qt=Ln.id),Object(T.a)(Object(T.a)({},Ln),{},{item_count:ai})}),console.log(on,48767874),Bt(on),Ot(yt),Wn(Qt);case 11:case"end":return xn.stop()}},rt)}));return function(He){return pt.apply(this,arguments)}}(),ma=function(){var pt=Object(O.a)(W.a.mark(function rt(){var He;return W.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:return mt.next=2,Object(ct.a)("/api/teach_groups.json",{method:"get",params:{is_random_exam:!0}});case 2:He=mt.sent,oa((He==null?void 0:He.groups)||[]);case 4:case"end":return mt.stop()}},rt)}));return function(){return pt.apply(this,arguments)}}(),ha=function(){var pt=Object(O.a)(W.a.mark(function rt(He){var Le,mt;return W.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return Lt(!0),yt.next=3,Object(ct.a)("/api/examination_intelligent_settings/form_paper.json",{method:"post",body:He});case 3:Le=yt.sent,mt=Le==null?void 0:Le.filter(function(Qt){var on;return!!(Qt!=null&&(on=Qt.item_banks)!==null&&on!==void 0&&on.length)}),mt=mt.map(function(Qt){return Object(T.a)(Object(T.a)({},Qt),{},{scoreTotal:0,score:0,questionTotal:0})}),c(mt),Lt(!1);case 8:case"end":return yt.stop()}},rt)}));return function(He){return pt.apply(this,arguments)}}(),Po=function(){cn(jn.current),nn(!1),ln("")},er=function(rt){cn(rt)},io=function(){for(var rt=Ye==null?void 0:Ye.filter(function(Pn){return Dt==null?void 0:Dt.includes(Pn.id)}),He=Object(be.a)(rt),Le=0,mt=[],ft=0;ft<He.length;ft++){for(var yt="",Qt=0;Qt<mt.length;Qt++)if(mt[Qt][0].parent_name==He[ft].parent_name){Le=1,yt=Qt;break}if(Le==1)mt[yt].push(He[ft]),Le=0;else if(Le==0){var on=new Array;on.push(He[ft]),mt.push(on)}}return mt},Ao=function(rt,He){var Le,mt,ft=Object(Ve.cloneDeep)(v);ft[He]=rt;var yt=ka([ft[He]]),Qt=yt==null||((Le=yt.panel)===null||Le===void 0||((mt=Le[0])===null||mt===void 0))?void 0:mt.reduce(function(Pn,xn){return Pn+xn},0);ft[He].questionTotal=Qt,c(ft);var on=document.getElementsByClassName("customError");on==null||on.forEach(function(Pn){var xn;Pn==null||((xn=Pn.classList)===null||xn===void 0)||xn.remove("customError")})},ka=function(rt){var He={contents:[],panel:[],score_num_item:[],score_total:[],error_tips:[]};return rt==null||rt.forEach(function(Le,mt){var ft,yt,Qt;He.panel.push([]),He.score_num_item.push(Le==null?void 0:Le.score),He.score_total.push(Le==null?void 0:Le.scoreTotal),(ft=He.error_tips)===null||ft===void 0||ft.push({name:(yt=Ra.find(function(on){return on.type===(Le==null?void 0:Le.item_type)}))===null||yt===void 0?void 0:yt.name,score:(Le==null?void 0:Le.score)||0,scoreTotal:Le==null?void 0:Le.scoreTotal,item_type:Le==null?void 0:Le.item_type}),Le==null||((Qt=Le.item_banks)===null||Qt===void 0)||Qt.forEach(function(on){var Pn;on==null||((Pn=on.tag_disciplines)===null||Pn===void 0)||Pn.forEach(function(xn){var Ln;xn==null||((Ln=xn.difficulties)===null||Ln===void 0)||Ln.forEach(function(En){En.num&&(He.panel[mt].push(En.num),He.contents.push({difficulty:En.difficulty,item_type:Le.item_type,items_count:En.num,sub_discipline_id:on.sub_discipline_id,tag_discipline_id:xn.tag_discipline_id}))})})})}),He},Mo=function(){var pt=Object(O.a)(W.a.mark(function rt(He){var Le,mt,ft,yt,Qt,on,Pn,xn,Ln,En,ai,Hn,zn,pi,si,qn,mi;return W.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:if(!(!wn.length&&!Dt.length&&!Sn.length)){en.next=3;break}return B.b.warn("\u5FC5\u987B\u9009\u62E9\u8003\u5BDF\u8303\u56F4\u6216\u8BD5\u9898\u6587\u4EF6\u5939\u6216\u6559\u7814\u56E2\u961F\u7684\u5176\u4E2D\u4E00\u9879"),en.abrupt("return");case 3:Le=[],mt=[],ft=ka(v),yt=0;case 7:if(!(yt<ft.error_tips.length)){en.next=23;break}if(Pn=ft==null||((Qt=ft.panel)===null||Qt===void 0||((on=Qt[yt])===null||on===void 0))?void 0:on.reduce(function(bn,Jn){return bn+Jn},0),!(ft.error_tips[yt].score===0&&Pn!==0)){en.next=14;break}return Ln=document.getElementById("".concat((xn=ft.error_tips[yt])===null||xn===void 0?void 0:xn.item_type,"_score")),Ln.classList.add("customError"),Ln.scrollIntoView({block:"start",behavior:"smooth"}),en.abrupt("return");case 14:if(!(ft.error_tips[yt].score!==0&&Pn===0)){en.next=19;break}return ai=document.getElementById("".concat((En=ft.error_tips[yt])===null||En===void 0?void 0:En.item_type,"_sum")),ai.classList.add("customError"),ai.scrollIntoView({block:"start",behavior:"smooth"}),en.abrupt("return");case 19:ft.error_tips[yt].score!==0&&Pn!==0&&(Le==null||Le.push({item_type:(Hn=ft.error_tips[yt])===null||Hn===void 0?void 0:Hn.item_type,score:((zn=ft.error_tips[yt])===null||zn===void 0?void 0:zn.score)||0}),mt.push(ft.error_tips[yt].name));case 20:yt++,en.next=7;break;case 23:if(!(Le.length===0)){en.next=26;break}return B.b.warn("\u4E0D\u5141\u8BB8\u6BCF\u4E2A\u9898\u578B\u7684\u603B\u5206\u548C\u62BD\u9898\u6570\u91CF\u90FD\u4E3A0"),en.abrupt("return");case 26:if(dt(!0),pi=Object(T.a)({contents:ft.contents,group_ids:wn,teach_group_ids:Sn,score_settings:Le,source:tt,sub_discipline_id:0,sort_by_item_type:mt,tag_discipline_ids:Dt},Oe),!He){en.next=36;break}return si=Object(T.a)(Object(T.a)({},pi),He),en.next=32,Object(ct.a)("/api/examination_banks/save_question_list.json",{method:"post",body:si});case 32:return qn=en.sent,qn.status===0&&B.b.success("\u4FDD\u5B58\u6210\u529F"),dt(!1),en.abrupt("return");case 36:if(mi={},!ge){en.next=43;break}return en.next=40,Object(ct.a)("/api/examination_banks/".concat(ge==null?void 0:ge.id,"/update_random_exam.json"),{method:"post",body:pi});case 40:mi=en.sent,en.next=46;break;case 43:return en.next=45,Object(ct.a)("/api/examination_banks/create_random_exam.json",{method:"post",body:pi});case 45:mi=en.sent;case 46:mi.status===0&&(B.b.success("\u64CD\u4F5C\u6210\u529F"),Se.d.push("/paperlibrary?defaultActiveKey=0")),dt(!1);case 48:case"end":return en.stop()}},rt)}));return function(He){return pt.apply(this,arguments)}}(),ao=function(){var pt=Object(O.a)(W.a.mark(function rt(He,Le){var mt,ft,yt,Qt,on,Pn,xn,Ln,En,ai,Hn,zn,pi,si,qn,mi,Ai,en,bn,Jn,gi,li,Mi;return W.a.wrap(function(Un){for(;;)switch(Un.prev=Un.next){case 0:if(!(!wn.length&&!Dt.length&&!Sn.length)){Un.next=3;break}return B.b.warn("\u5FC5\u987B\u9009\u62E9\u8003\u5BDF\u8303\u56F4\u6216\u8BD5\u9898\u6587\u4EF6\u5939\u6216\u6559\u7814\u56E2\u961F\u7684\u5176\u4E2D\u4E00\u9879"),Un.abrupt("return");case 3:mt=[],ft=[],yt=ka(v),Qt=0;case 7:if(!(Qt<yt.error_tips.length)){Un.next=23;break}if(xn=yt==null||((on=yt.panel)===null||on===void 0||((Pn=on[Qt])===null||Pn===void 0))?void 0:Pn.reduce(function(Vn,vi){return Vn+vi},0),!(yt.error_tips[Qt].score===0&&xn!==0)){Un.next=14;break}return En=document.getElementById("".concat((Ln=yt.error_tips[Qt])===null||Ln===void 0?void 0:Ln.item_type,"_score")),En.classList.add("customError"),En.scrollIntoView({block:"start",behavior:"smooth"}),Un.abrupt("return");case 14:if(!(yt.error_tips[Qt].score!==0&&xn===0)){Un.next=19;break}return Hn=document.getElementById("".concat((ai=yt.error_tips[Qt])===null||ai===void 0?void 0:ai.item_type,"_sum")),Hn.classList.add("customError"),Hn.scrollIntoView({block:"start",behavior:"smooth"}),Un.abrupt("return");case 19:yt.error_tips[Qt].score!==0&&xn!==0&&(mt==null||mt.push({item_type:(zn=yt.error_tips[Qt])===null||zn===void 0?void 0:zn.item_type,score:((pi=yt.error_tips[Qt])===null||pi===void 0?void 0:pi.score)||0}),ft.push(yt.error_tips[Qt].name));case 20:Qt++,Un.next=7;break;case 23:if(!(mt.length===0)){Un.next=26;break}return B.b.warn("\u4E0D\u5141\u8BB8\u6BCF\u4E2A\u9898\u578B\u7684\u603B\u5206\u548C\u62BD\u9898\u6570\u91CF\u90FD\u4E3A0"),Un.abrupt("return");case 26:if(Gt(!0),si=Object(T.a)({contents:yt.contents,group_ids:wn,teach_group_ids:Sn,score_settings:mt,sort_by_item_type:ft,tag_discipline_ids:Dt,source:tt,sub_discipline_id:0},Oe),!(He!==void 0&&!(He!=null&&He.single_question_id))){Un.next=36;break}return si.seleted_item_bank_ids=He==null?void 0:He.seleted_item_bank_ids,Un.next=32,Object(ct.a)("/api/examination_banks/toggle_random_questions.json",{method:"post",body:si});case 32:return qn=Un.sent,qn!=null&&qn.questions&&(Ai=Object(Ve.cloneDeep)(d),Ai.questionList=Ai==null||((mi=Ai.questionList)===null||mi===void 0)?void 0:mi.map(function(Vn){if(Vn.type===Le.type){var vi;return Object(T.a)(Object(T.a)({},Vn),{},{questions:(qn==null||((vi=qn.questions)===null||vi===void 0)?void 0:vi.questions)||[]})}return Vn}),o(Ai)),Gt(!1),Un.abrupt("return");case 36:if(!(He!=null&&He!==void 0&&He.single_question_id)){Un.next=45;break}return si.seleted_item_bank_ids=He==null?void 0:He.seleted_item_bank_ids,si.single_question_id=He==null?void 0:He.single_question_id,Un.next=41,Object(ct.a)("/api/examination_banks/toggle_random_questions.json",{method:"post",body:si});case 41:return en=Un.sent,en&&(Jn=Object(Ve.cloneDeep)(d),Jn.questionList=Jn==null||((bn=Jn.questionList)===null||bn===void 0)?void 0:bn.map(function(Vn){if(Vn.type===Le.type){var vi,ki,yi=Object(Ve.cloneDeep)(Vn==null?void 0:Vn.questions);return yi.splice(Le.index,1,en==null||((vi=en.questions)===null||vi===void 0||((ki=vi.questions)===null||ki===void 0))?void 0:ki[0]),console.log(Vn==null?void 0:Vn.questions,yi,Le.index,"new_questions"),Object(T.a)(Object(T.a)({},Vn),{},{questions:yi})}return Vn}),o(Jn)),Gt(!1),Un.abrupt("return");case 45:return Un.next=47,Object(ct.a)("/api/examination_banks/preview_random_questions.json",{method:"post",body:si});case 47:gi=Un.sent,gi.exam&&(li=Lo(gi),Mi=[],ft==null||ft.forEach(function(Vn){var vi,ki=li==null||((vi=li.questionList)===null||vi===void 0)?void 0:vi.find(function(yi){var ji,oo=(ji=Ra.find(function(ro){return ro.type===(yi==null?void 0:yi.type)}))===null||ji===void 0?void 0:ji.name;return oo===Vn});Mi.push(ki)}),Mi=Object(Ve.compact)(Mi),li.questionList=Mi,o(Object(T.a)({},li)),console.log(JSON.stringify(li)),gn(!0),document.body.scrollIntoView()),Gt(!1);case 50:case"end":return Un.stop()}},rt)}));return function(He,Le){return pt.apply(this,arguments)}}(),Ra=[{type:"SINGLE",name:"\u5355\u9009\u9898"},{type:"MULTIPLE",name:"\u591A\u9009\u9898"},{type:"COMPLETION",name:"\u586B\u7A7A\u9898"},{type:"JUDGMENT",name:"\u5224\u65AD\u9898"},{type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},{type:"PROGRAM",name:"\u7F16\u7A0B\u9898"},{type:"PRACTICAL",name:"\u5B9E\u8BAD\u9898"},{type:"COMBINATION",name:"\u7EC4\u5408\u9898"}],tr=function(){var rt=ka(v),He=rt.panel,Le=rt.score_total;return Le=Le.reduce(function(mt,ft){return mt+ft},0),He=Object(Ve.flatten)(He).reduce(function(mt,ft){return mt+ft},0),b.a.createElement("div",{className:p.a.total},b.a.createElement("div",null,b.a.createElement("img",{src:_.a}),b.a.createElement("span",null,"\u9898\u6570(\u9053)"),b.a.createElement("aside",null,He)),b.a.createElement("aside",null),b.a.createElement("div",null,b.a.createElement("img",{src:Ue.a}),b.a.createElement("span",null,"\u603B\u5206(\u5206)"),b.a.createElement("aside",null,Le)))},ga=function(rt,He,Le){return rt[He]=rt.splice(Le,1,rt[He])[0],rt},qi=function(rt){var He=[],Le=Object(Ve.cloneDeep)(v);Le.length>1&&rt!==0&&(He=ga(Le,rt,rt-1)),c(He)},Ba=function(rt){var He=[],Le=Object(Ve.cloneDeep)(v);Le.length>1&&rt!==Le.length-1&&(He=ga(Le,rt,rt+1)),c(He)},Oa=function(){var pt=Object(O.a)(W.a.mark(function rt(He){var Le,mt,ft,yt;return W.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:if(ft=Object(be.a)(tt),tt.includes(He)?ft=ft.filter(function(Pn){return Pn!==He}):ft.push(He),!(ft.length===0)){on.next=5;break}return B.b.warn("\u8BD5\u9898\u6765\u6E90\u4E3A\u5FC5\u9009\u9879"),on.abrupt("return");case 5:(Le=ft)!==null&&Le!==void 0&&Le.includes("mine")||(Hi([]),Si.current=[]),(mt=ft)!==null&&mt!==void 0&&mt.includes("teach_groups")||(Qi([]),ra.current=[]),zt(ft),da(ft),cn([]),jn.current=[],yt={source:ft,group_ids:Si.current,tag_discipline_ids:[],teach_group_ids:ra.current},ha(yt);case 13:case"end":return on.stop()}},rt)}));return function(He){return pt.apply(this,arguments)}}(),Lo=function(rt){var He={1:"\u4E00",2:"\u4E8C",3:"\u4E09",4:"\u56DB",5:"\u4E94",6:"\u516D",7:"\u4E03"};if(!rt)return;var Le=rt||{},mt=Le.exam,ft=Le.single_questions,yt=Le.multiple_questions,Qt=Le.judgement_questions,on=Le.program_questions,Pn=Le.completion_questions,xn=Le.subjective_questions,Ln=Le.practical_questions,En=Le.combination_questions,ai=[Object(T.a)({type:"SINGLE",name:"\u5355\u9009\u9898"},ft),Object(T.a)({type:"MULTIPLE",name:"\u591A\u9009\u9898"},yt),Object(T.a)({type:"COMPLETION",name:"\u586B\u7A7A\u9898"},Pn),Object(T.a)({type:"JUDGMENT",name:"\u5224\u65AD\u9898"},Qt),Object(T.a)({type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},xn),Object(T.a)({type:"PROGRAM",name:"\u7F16\u7A0B\u9898"},on),Object(T.a)({type:"PRACTICAL",name:"\u5B9E\u8BAD\u9898"},Ln),Object(T.a)({type:"COMBINATION",name:"\u7EC4\u5408\u9898"},En)],Hn=[],zn=0,pi=0,si=ai.filter(function(qn){return qn.questions_count>0}).map(function(qn,mi){var Ai;return(Ai=qn.questions)===null||Ai===void 0||Ai.forEach(function(en){Hn.push(en.id),zn=zn+en.score,pi=pi+1}),Object(T.a)(Object(T.a)({},qn),{number:He[mi+1]})});return{all_questions_count:pi,all_score:zn,questionList:si,ids:Hn,exam:mt}},Zi=function(rt){var He,Le,mt=Object(Ve.cloneDeep)(d),ft=Object(Ve.cloneDeep)(v);mt.questionList=mt==null||((He=mt.questionList)===null||He===void 0)?void 0:He.map(function(yt){return yt.type===rt.type?Object(T.a)(Object(T.a)({},yt),{},{questions_score:rt.scoreTotal}):yt}),ft=(Le=ft)===null||Le===void 0?void 0:Le.map(function(yt){return yt.item_type===rt.type?Object(T.a)(Object(T.a)({},yt),{},{score:rt.score,scoreTotal:rt.scoreTotal}):yt}),c(ft),o(mt),console.log(rt,d,v)},ea=_e==null||((Ce=_e.find(function(pt){return pt.id===pn}))===null||Ce===void 0)?void 0:Ce.sub_disciplines,Ta=io();return fn?b.a.createElement(We.a,{loading:nt,submit:Mo,goBack:function(){return gn(!1)},data:d,onTypeScore:Zi,onExchange:ao}):b.a.createElement("section",{className:p.a.wrap,style:{display:at?"flex":"none"}},b.a.createElement("div",{id:"id_left",className:p.a.left,onMouseEnter:function(rt){var He=document.getElementById("id_left");He.style.overflowY="auto"},onMouseLeave:function(rt){var He=document.getElementById("id_left");He.style.overflowY="hidden"}},b.a.createElement(ve.a,{loading:$t,active:!0,paragraph:{rows:5}},v.map(function(pt,rt){var He;return b.a.createElement("div",{className:p.a.list,key:rt},b.a.createElement("div",{className:p.a.name},b.a.createElement("b",null),b.a.createElement("span",null,(He=Ra.find(function(Le){return Le.type===(pt==null?void 0:pt.item_type)}))===null||He===void 0?void 0:He.name)),b.a.createElement("aside",null,b.a.createElement("div",null,"\u5171",b.a.createElement("span",{className:p.a.b},pt.questionTotal),"\u9898",b.a.createElement("span",{className:p.a.l},"|"),"\u5171",b.a.createElement("span",{className:p.a.r},pt.scoreTotal),"\u5206"),b.a.createElement("div",null,rt>0?b.a.createElement(P.a,{getPopupContainer:function(mt){return document.getElementById("id_left")},title:"\u4E0A\u79FB"},b.a.createElement("span",{onClick:function(){return qi(rt)},className:"mb20",style:{transform:"rotate(270deg)"}}," ",b.a.createElement("i",{className:"icon-jiantou1"}))):b.a.createElement("span",{className:"mb20",style:{transform:"rotate(270deg)",cursor:"not-allowed"}}," ",b.a.createElement("i",{className:"icon-jiantou1"})),rt<v.length-1?b.a.createElement(P.a,{getPopupContainer:function(mt){return document.getElementById("id_left")},title:"\u4E0B\u79FB"},b.a.createElement("span",{onClick:function(){return Ba(rt)},style:{transform:"rotate(90deg)"}}," ",b.a.createElement("i",{className:"icon-jiantou1"}))):b.a.createElement("span",{style:{transform:"rotate(90deg)",cursor:"not-allowed"}}," ",b.a.createElement("i",{className:"icon-jiantou1"})))))})),tr()),b.a.createElement("div",{className:p.a.right},b.a.createElement(Y,{className:p.a.tabs,value:1,onChange:function(){return _t(0)}}),b.a.createElement("section",{className:p.a.topWarp},b.a.createElement("div",{className:p.a.title},b.a.createElement("b",null),b.a.createElement("span",null,"\u62BD\u9898\u7EC4\u5377"),b.a.createElement("div",null,"STEP2")," "),b.a.createElement("div",{className:p.a.source},b.a.createElement("b",null,"*"),b.a.createElement("span",null,"\u8BD5\u9898\u6765\u6E90"),b.a.createElement("aside",null,b.a.createElement("div",{onClick:function(){return Oa("mine")}}," ",b.a.createElement(z.a,{checked:tt==null?void 0:tt.includes("mine")}),b.a.createElement("span",{style:{color:tt!=null&&tt.includes("mine")?"#007DFE":"#666666"}},"\u4EC5\u6211\u521B\u5EFA\u7684")),b.a.createElement("div",{className:"mb20",onClick:function(){return Oa("teach_groups")}}," ",b.a.createElement(z.a,{checked:tt==null?void 0:tt.includes("teach_groups")}),b.a.createElement("span",{style:{color:tt!=null&&tt.includes("teach_groups")?"#007DFE":"#666666"}},"\u6559\u7814\u5171\u4EAB")),b.a.createElement("div",{onClick:function(){return Oa("public")}},b.a.createElement(z.a,{checked:tt==null?void 0:tt.includes("public")}),b.a.createElement("span",{style:{color:tt!=null&&tt.includes("public")?"#007DFE":"#666666"}},"\u516C\u5171\u9898\u5E93"))),b.a.createElement("aside",null,(tt==null?void 0:tt.includes("mine"))&&b.a.createElement("div",{style:{marginBottom:14},className:p.a.folder,onClick:function(){Jt(!0),Xn(!0),Si.current=wn,Mn((Yn==null?void 0:Yn.map(function(rt){return rt.count}).reduce(function(rt,He){return rt+He},0))||0)}},b.a.createElement("img",{src:Te.a}),b.a.createElement("span",null,"\u9009\u62E9\u8BD5\u9898\u6587\u4EF6\u5939"),b.a.createElement(P.a,{title:"\u9009\u4E2D\u9879\u4EC5\u5305\u62EC\u8BE5\u6587\u4EF6\u5939\u4E0B\u7684\u8BD5\u9898\uFF0C\u4E0D\u5305\u62EC\u5B50\u6587\u4EF6\u5939\uFF0C\u4E14\u7CFB\u7EDF\u53D6\u60A8\u9009\u4E2D\u7684\u6587\u4EF6\u5939\u548C\u8003\u67E5\u8303\u56F4\u4E2D\u7684\u8BD5\u9898\u7684\u5E76\u96C6\u4F5C\u4E3A\u968F\u673A\u5BF9\u8C61\u3002"},b.a.createElement("img",{src:Pe.a}))),(tt==null?void 0:tt.includes("teach_groups"))&&b.a.createElement("div",{className:p.a.folder,onClick:function(){Ji(!0),ra.current=Sn}},b.a.createElement("img",{src:Ae.a}),b.a.createElement("span",null,"\u9009\u62E9\u6559\u7814\u56E2\u961F")))),(tt==null?void 0:tt.includes("mine"))&&b.a.createElement("div",{className:p.a.choice},b.a.createElement("div",{className:p.a.name},b.a.createElement("b",null),b.a.createElement("span",null,"\u5DF2\u9009\u6587\u4EF6\u5939")),b.a.createElement(Me.a,{type:2,value:Yn,onChange:function(rt){var He=wn.filter(function(mt){return mt!==rt}),Le={source:tt,group_ids:He,tag_discipline_ids:Dt,teach_group_ids:Sn};ha(Le),Hi(He),Si.current=He}})),(tt==null?void 0:tt.includes("teach_groups"))&&b.a.createElement("div",{className:p.a.choice},b.a.createElement("div",{className:p.a.name},b.a.createElement("b",null),b.a.createElement("span",null,"\u5DF2\u9009\u6559\u7814\u56E2\u961F")),b.a.createElement(Me.a,{icon:Re.a,type:2,value:un,onChange:function(rt){var He=Sn.filter(function(mt){return mt!==rt}),Le={source:tt,group_ids:wn,tag_discipline_ids:Dt,teach_group_ids:He};ha(Le),Qi(He),ra.current=He}})),b.a.createElement("div",{className:p.a.range},b.a.createElement("div",{className:p.a.name},b.a.createElement("b",null),b.a.createElement("span",null,"\u8003\u5BDF\u8303\u56F4")),b.a.createElement("div",{onClick:function(){if(pn===null){B.b.warn("\u8003\u5BDF\u8303\u56F4\u6CA1\u6709\u77E5\u8BC6\u70B9\u53EF\u4EE5\u9009\u62E9");return}jn.current=Dt,nn(!0)},className:p.a.btn},b.a.createElement("img",{src:X.a})," \u9009\u62E9\u8303\u56F4"),b.a.createElement("div",{className:p.a.name},b.a.createElement("b",{className:p.a.num}),b.a.createElement("span",null,"\u5DF2\u9009\u77E5\u8BC6\u70B9")),b.a.createElement("div",{className:p.a.knWarp},Ta==null?void 0:Ta.map(function(pt,rt){return b.a.createElement(b.a.Fragment,{key:rt},b.a.createElement("div",{className:p.a.kn},b.a.createElement("span",null,rt+1)," ",b.a.createElement("span",null,pt==null?void 0:pt[0].parent_name)),b.a.createElement(Me.a,{type:1,value:pt==null?void 0:pt.filter(function(He){return!!He.item_count}),onChange:function(Le){var mt=Dt.filter(function(yt){return yt!==Le}),ft={source:tt,group_ids:wn,tag_discipline_ids:mt,teach_group_ids:Sn};ha(ft),cn(mt),jn.current=mt}}))})))),console.log("-----",v),b.a.createElement(ve.a,{loading:$t,active:!0,paragraph:{rows:5}},v.map(function(pt,rt){return b.a.createElement(Xe.a,{key:rt,value:pt,onChange:function(Le){return Ao(Le,rt)}})}),b.a.createElement("div",{className:p.a.btns},b.a.createElement(xe.a,{onClick:function(){_t(0),document.body.scrollIntoView()}},"\u4E0A\u4E00\u6B65"),b.a.createElement(xe.a,{loading:nt,onClick:function(){return Mo()}},"\u63D0\u4EA4"),b.a.createElement(xe.a,{loading:an,onClick:function(){return ao()},type:"primary"},"\u9884\u89C8")))),b.a.createElement(C.a,{centered:!0,closable:!1,destroyOnClose:!0,className:p.a.modal,visible:Kn,title:null,width:"1200px",onOk:zi,onCancel:Po},b.a.createElement("div",{className:p.a.modalBody},b.a.createElement("div",{className:p.a.left},b.a.createElement("div",{className:p.a.title},b.a.createElement("img",{src:le.a}),b.a.createElement("span",null,"\u8BD5\u9898\u8303\u56F4")),b.a.createElement("div",{className:p.a.l},_e==null?void 0:_e.map(function(pt){var rt=null,He=!1;if(!Nt)He=!0;else{var Le;(Le=pt.sub_disciplines)===null||Le===void 0||Le.forEach(function(mt){var ft;(ft=mt.tag_disciplines)===null||ft===void 0||ft.forEach(function(yt){if(!He){var Qt;He=((Qt=yt.name)===null||Qt===void 0?void 0:Qt.includes(Nt))&&yt.item_count!==0}})})}return b.a.createElement(b.a.Fragment,{key:pt.id},!!pt.item_count&&He&&b.a.createElement("div",{onClick:function(){return Wn(pt.id)},className:"".concat(p.a.name," ").concat(pt.id===pn?p.a.active:"")},b.a.createElement("b",null),b.a.createElement("span",null,pt.name)))}))),b.a.createElement("div",{className:p.a.right},b.a.createElement("div",{className:p.a.inputWarp},b.a.createElement($,{onChange:function(rt){return ln(rt.target.value)},placeholder:"\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9",value:Nt})),b.a.createElement("div",{className:p.a.l},ea==null?void 0:ea.map(function(pt,rt){var He,Le=Object(T.a)(Object(T.a)({},pt),{},{tag_disciplines:pt==null||((He=pt.tag_disciplines)===null||He===void 0)?void 0:He.filter(function(mt){return mt.item_count!==0})});return b.a.createElement(kt,{search:Nt,onChange:er,key:pt.id,value:Dt,options:Le})}))))),b.a.createElement(C.a,{centered:!0,title:"\u9009\u62E9\u6587\u4EF6\u5939",visible:Fn,width:718,destroyOnClose:!0,onCancel:function(){Hi(Si.current),Xn(!1),Mn(0)},footer:b.a.createElement("div",{style:{display:"flex",alignItems:"center"}},b.a.createElement("span",{style:{flex:"1",textAlign:"left"}},"\u5DF2\u9009",wn.length||0,"\u4E2A\u6587\u4EF6\u5939\uFF0C\u5171\uFF08",dn||0,"\uFF09\u9053\u9898"),b.a.createElement(xe.a,{onClick:function(){Hi(Si.current),Mn(0),Xn(!1)}},"\u53D6\u6D88"),b.a.createElement(xe.a,{type:"primary",onClick:function(){var rt={source:tt,group_ids:wn,tag_discipline_ids:Dt,teach_group_ids:Sn};ha(rt),Si.current=wn,Xn(!1)}},"\u786E\u8BA4"))},b.a.createElement("aside",{className:p.a.exportModal},qt&&b.a.createElement(je,{treeData:To,defaultValue:$n,value:wn,onChange:function(rt,He){var Le;Mn((Le=He.selectedNodes)===null||Le===void 0?void 0:Le.map(function(mt){return mt.count}).reduce(function(mt,ft){return mt+ft},0)),Hi(rt)}}))),b.a.createElement(C.a,{centered:!0,title:"\u9009\u62E9\u6559\u7814\u56E2\u961F",visible:Yi,width:718,destroyOnClose:!0,onCancel:function(){Qi(ra.current),Ji(!1)},onOk:function(){var rt={source:tt,group_ids:wn,tag_discipline_ids:Dt,teach_group_ids:Sn};ha(rt),ra.current=Sn,Ji(!1)}},b.a.createElement("aside",{className:p.a.teachModal},b.a.createElement("div",{className:p.a.head},b.a.createElement("div",{className:p.a.li}),b.a.createElement("div",{className:p.a.li},"\u56E2\u961F\u540D\u79F0"),b.a.createElement("div",{className:p.a.li},"\u5171\u4EAB\u9898\u76EE\u6570\u91CF")),b.a.createElement("div",{className:p.a.wraps},Pi==null?void 0:Pi.map(function(pt){return b.a.createElement("div",{key:pt.id,className:p.a.body},b.a.createElement("div",{className:p.a.li},b.a.createElement(z.a,{onChange:function(){var He=pt.id,Le=Object(be.a)(Sn);Sn.includes(He)?Le=Le.filter(function(mt){return mt!==He}):Le.push(He),Qi(Le)},checked:Sn==null?void 0:Sn.includes(pt.id)})),b.a.createElement("div",{title:pt.name,className:p.a.li},pt.name),b.a.createElement("div",{className:p.a.li},pt.item_bank_count))})))))},Q=q,x=L.a.TextArea,R=function(de){var Ce=de.paperlibrary,Oe=de.user,_t=de.globalSetting,at=de.dispatch,ge=Object(ee.useState)(0),lt=Object(te.a)(ge,2),Et=lt[0],et=lt[1],Ft=M.a.useForm(),tt=Object(te.a)(Ft,1),zt=tt[0],It=Object(ee.useState)({}),vt=Object(te.a)(It,2),$t=vt[0],Lt=vt[1],Fe=Object(ee.useState)(!0),ut=Object(te.a)(Fe,2),nt=ut[0],dt=ut[1],Kt=Object(ee.useState)(null),Vt=Object(te.a)(Kt,2),an=Vt[0],Gt=Vt[1],Ct=Object(fe.i)().id;console.log(Ct,"editId"),Object(ee.useEffect)(function(){return at({type:"globalSetting/footerToggle",payload:!1}),function(){at({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(ee.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]);var tn=function(Kn){Lt(Object(T.a)({},zt.getFieldsValue()))};Object(ee.useEffect)(function(){if(Ct){Nt();return}dt(!1)},[Ct]);var Nt=function(){var hn=Object(O.a)(W.a.mark(function Kn(){var nn,$e,st,fn,gn,On;return W.a.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,Object(ct.a)("/api/examination_banks/".concat(Ct,"/edit_random_exam.json"),{method:"get",params:{}});case 2:nn=d.sent,nn!=null&&nn.examination_bank&&(On={difficulty:nn==null||(($e=nn.examination_bank)===null||$e===void 0)?void 0:$e.difficulty,exam_notes:nn==null||((st=nn.examination_bank)===null||st===void 0)?void 0:st.exam_notes,name:nn==null||((fn=nn.examination_bank)===null||fn===void 0)?void 0:fn.name,time:nn==null||((gn=nn.examination_bank)===null||gn===void 0)?void 0:gn.time},dt(!1),Lt(Object(T.a)({},On)),zt.setFieldsValue(Object(T.a)({},On)),Gt(Object(T.a)(Object(T.a)({},nn),{},{id:Ct})));case 4:case"end":return d.stop()}},Kn)}));return function(){return hn.apply(this,arguments)}}(),ln=function(){var hn=Object(O.a)(W.a.mark(function Kn(nn){return W.a.wrap(function(st){for(;;)switch(st.prev=st.next){case 0:if(!(nn===0)){st.next=3;break}return et(nn),st.abrupt("return");case 3:return st.next=5,zt.validateFields();case 5:et(nn);case 6:case"end":return st.stop()}},Kn)}));return function(nn){return hn.apply(this,arguments)}}(),Xt=function(Kn){var nn=parseInt(Kn);return Object(Ve.isNaN)(nn)?"":nn};return b.a.createElement("section",{className:H.a.wrap},b.a.createElement(ve.a,{loading:nt,active:!0,paragraph:{rows:5}},b.a.createElement("div",{className:H.a.crumbs},b.a.createElement("b",null),b.a.createElement("span",{className:"current",onClick:function(){return Se.d.push("/")}},"\u9996\u9875>"),b.a.createElement("span",{className:"current",onClick:function(){return Se.d.push("/paperlibrary")}},"\u8BD5\u5377\u5E93>"),b.a.createElement("span",{style:{color:"#bebebe"}},"\u968F\u673A\u7EC4\u5377")),Et===0&&b.a.createElement(Y,{value:Et,onChange:ln}),Et===0&&b.a.createElement("section",{className:H.a.oneWrap},b.a.createElement("div",{className:H.a.title},b.a.createElement("b",null),b.a.createElement("span",null,"\u57FA\u672C\u4FE1\u606F"),b.a.createElement("div",null,"STEP1")," "),b.a.createElement(M.a,{className:H.a.formWrap,form:zt,layout:"horizontal",onValuesChange:tn},b.a.createElement(M.a.Item,{label:"\u8BD5\u5377\u540D\u79F0",name:"name",rules:[{required:!0,message:"\u8BD5\u5377\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"},{pattern:/^(?!(\s+$))/,message:"\u8F93\u5165\u6846\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C"}]},b.a.createElement(L.a,{className:H.a.in,bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0\uFF0C\u6700\u591A60\u4E2A\u5B57",maxLength:60})),b.a.createElement("div",{style:{position:"relative"}},b.a.createElement(M.a.Item,{label:"\u7B54\u9898\u65F6\u957F:",name:"time",rules:[{required:!0,message:"\u7B54\u9898\u65F6\u957F\u4E0D\u80FD\u4E3A\u7A7A"}]},b.a.createElement(k.a,{min:1,parser:Xt,max:9999,placeholder:"\u8BF7\u8F93\u5165\u7B54\u9898\u65F6\u957F",style:{width:190}})),b.a.createElement("span",{style:{position:"absolute",top:26,left:310}},"\u5206\u949F")),b.a.createElement(M.a.Item,{label:"\u8BD5\u9898\u96BE\u5EA6",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},b.a.createElement(re.a.Group,{style:{display:"flex",width:286,justifyContent:"space-between"},size:"large"},b.a.createElement(re.a.Button,{className:H.a.rb,value:1},"\u7B80\u5355"),b.a.createElement(re.a.Button,{className:H.a.rb,value:2},"\u9002\u4E2D"),b.a.createElement(re.a.Button,{className:H.a.rb,value:3},"\u56F0\u96BE"))),b.a.createElement(M.a.Item,{label:"\u8003\u8BD5\u987B\u77E5",name:"exam_notes"},b.a.createElement(x,{placeholder:"\u8003\u751F\u5FC5\u987B\u4E25\u683C\u9075\u5B88\u8003\u573A\u7EAA\u5F8B\uFF0C\u4E0D\u51C6\u5192\u540D\u9876\u66FF\uFF0C\u4E0D\u51C6\u6709\u4EFB\u4F55\u4F5C\u5F0A\u884C\u4E3A\u3002\u5982\u53D1\u73B0\u8FDD\u7EAA\uFF0C\u5E76\u7ED9\u4E88\u4E25\u5389\u5904\u5206\u3002",rows:4,maxLength:300}))),b.a.createElement("div",{className:H.a.btns},b.a.createElement(xe.a,{className:"mr40",onClick:function(){return Se.d.push("/paperlibrary")}},"\u8FD4\u56DE"),b.a.createElement(xe.a,{type:"primary",onClick:Object(O.a)(W.a.mark(function hn(){return W.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:return nn.next=2,zt.validateFields();case 2:et(1);case 3:case"end":return nn.stop()}},hn)}))},"\u4E0B\u4E00\u6B65"))),b.a.createElement(Q,{tabs:Et,dispatch:at,editData:an,setFatherTabs:et,formValue:$t})))},j=Ie.default=Object(Se.a)(function(I){var de=I.paperlibrary,Ce=I.user,Oe=I.globalSetting;return{paperlibrary:de,user:Ce,globalSetting:Oe}})(R)},"E/GV":function(Qe,Ie,h){Qe.exports=h.p+"static/swenjianjia.1640bf70.svg"},ELLl:function(Qe,Ie,h){(function(V){V(h("VrN/"))})(function(V){var ve={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},se=V.Pos;V.defineOption("autoCloseBrackets",!1,function(L,G,W){W&&W!=V.Init&&(L.removeKeyMap(me),L.state.closeBrackets=null),G&&(re(xe(G,"pairs")),L.state.closeBrackets=G,L.addKeyMap(me))});function xe(L,G){return G=="pairs"&&typeof L=="string"?L:typeof L=="object"&&L[G]!=null?L[G]:ve[G]}var me={Backspace:O,Enter:T};function re(L){for(var G=0;G<L.length;G++){var W=L.charAt(G),ee="'"+W+"'";me[ee]||(me[ee]=U(W))}}re(ve.pairs+"`");function U(L){return function(G){return M(G,L)}}function k(L){var G=L.state.closeBrackets;if(!G||G.override)return G;var W=L.getModeAt(L.getCursor());return W.closeBrackets||G}function O(L){var G=k(L);if(!G||L.getOption("disableInput"))return V.Pass;for(var W=xe(G,"pairs"),ee=L.listSelections(),b=0;b<ee.length;b++){if(!ee[b].empty())return V.Pass;var fe=te(L,ee[b].head);if(!fe||W.indexOf(fe)%2!=0)return V.Pass}for(var b=ee.length-1;b>=0;b--){var Se=ee[b].head;L.replaceRange("",se(Se.line,Se.ch-1),se(Se.line,Se.ch+1),"+delete")}}function T(L){var G=k(L),W=G&&xe(G,"explode");if(!W||L.getOption("disableInput"))return V.Pass;for(var ee=L.listSelections(),b=0;b<ee.length;b++){if(!ee[b].empty())return V.Pass;var fe=te(L,ee[b].head);if(!fe||W.indexOf(fe)%2!=0)return V.Pass}L.operation(function(){var Se=L.lineSeparator()||`
`;L.replaceSelection(Se+Se,null),L.execCommand("goCharLeft"),ee=L.listSelections();for(var he=0;he<ee.length;he++){var H=ee[he].head.line;L.indentLine(H,null,!0),L.indentLine(H+1,null,!0)}})}function A(L){var G=V.cmpPos(L.anchor,L.head)>0;return{anchor:new se(L.anchor.line,L.anchor.ch+(G?-1:1)),head:new se(L.head.line,L.head.ch+(G?1:-1))}}function M(L,G){var W=k(L);if(!W||L.getOption("disableInput"))return V.Pass;var ee=xe(W,"pairs"),b=ee.indexOf(G);if(b==-1)return V.Pass;for(var fe=xe(W,"closeBefore"),Se=xe(W,"triples"),he=ee.charAt(b+1)==G,H=L.listSelections(),g=b%2==0,ne,S=0;S<H.length;S++){var Y=H[S],w=Y.head,C,J=L.getRange(w,se(w.line,w.ch+1));if(g&&!Y.empty())C="surround";else if((he||!g)&&J==G)he&&F(L,w)?C="both":Se.indexOf(G)>=0&&L.getRange(w,se(w.line,w.ch+3))==G+G+G?C="skipThree":C="skip";else if(he&&w.ch>1&&Se.indexOf(G)>=0&&L.getRange(se(w.line,w.ch-2),w)==G+G){if(w.ch>2&&/\bstring/.test(L.getTokenTypeAt(se(w.line,w.ch-2))))return V.Pass;C="addFour"}else if(he){var z=w.ch==0?" ":L.getRange(se(w.line,w.ch-1),w);if(!V.isWordChar(J)&&z!=G&&!V.isWordChar(z))C="both";else return V.Pass}else if(g&&(J.length===0||/\s/.test(J)||fe.indexOf(J)>-1))C="both";else return V.Pass;if(!ne)ne=C;else if(ne!=C)return V.Pass}var E=b%2?ee.charAt(b-1):G,P=b%2?G:ee.charAt(b+1);L.operation(function(){if(ne=="skip")L.execCommand("goCharRight");else if(ne=="skipThree")for(var ae=0;ae<3;ae++)L.execCommand("goCharRight");else if(ne=="surround"){for(var B=L.getSelections(),ae=0;ae<B.length;ae++)B[ae]=E+B[ae]+P;L.replaceSelections(B,"around"),B=L.listSelections().slice();for(var ae=0;ae<B.length;ae++)B[ae]=A(B[ae]);L.setSelections(B)}else ne=="both"?(L.replaceSelection(E+P,null),L.triggerElectric(E+P),L.execCommand("goCharLeft")):ne=="addFour"&&(L.replaceSelection(E+E+E+E,"before"),L.execCommand("goCharRight"))})}function te(L,G){var W=L.getRange(se(G.line,G.ch-1),se(G.line,G.ch+1));return W.length==2?W:null}function F(L,G){var W=L.getTokenAt(se(G.line,G.ch+1));return/\bstring/.test(W.type)&&W.start==G.ch&&(G.ch==0||!/\bstring/.test(L.getTokenTypeAt(G)))}})},FTkQ:function(Qe,Ie){Qe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABjUlEQVQ4T61VsUoDQRB9s+eVYifkUlqIWCW3sbBMqYUR0cbfUPETxPgZ2giigpZaCnKXpBK1sMydpIx25+7ISu5ILhsjclvuzLx5M292lmA57PtuF2gIYIMBSYBn3BiICAg1cF0GrqjVSvLhlL+IqtVNEDUZWLAlS+8IeAPzvtduXw77ZYAMiEjKI2LeY2AskQ2cAGaiEy8MDwnQxicL7Ep5bDL+xmqijahZDsODDHBQ5sVfmVn6xmDeMuWTESAGnqf1bBpz09MSsESx729r4DwfIIA6hPjUSt2AaP7Hztwj5nXHdd0vpR7yMQzsUOT7pwzsjgEKsVIKgiCu1Za1UvfGLhynXgqCp6hSkSxEYCn9jLq+/wJgcawk5l4KYECN3YBlCVLWo4GvhmGfgVlrj4ZAjX0KmBmZD8Owj4IAMQAsvGSrKKR1zet0QpsosZQrmvnRKsqksZlxnFWVJAkT3Y6MDbAmgDlFdGcdm8IH22Qp9OmltAtdDoPlWez6SpkWtmCHFTNCvQMN/scX8A1e4fnIOEHt8AAAAABJRU5ErkJggg=="},Gytx:function(Qe,Ie){Qe.exports=function(V,ve,se,xe){var me=se?se.call(xe,V,ve):void 0;if(me!==void 0)return!!me;if(V===ve)return!0;if(typeof V!="object"||!V||typeof ve!="object"||!ve)return!1;var re=Object.keys(V),U=Object.keys(ve);if(re.length!==U.length)return!1;for(var k=Object.prototype.hasOwnProperty.bind(ve),O=0;O<re.length;O++){var T=re[O];if(!k(T))return!1;var A=V[T],M=ve[T];if(me=se?se.call(xe,A,M,T):void 0,me===!1||me===void 0&&A!==M)return!1}return!0}},H38U:function(Qe,Ie,h){var V=h("f4xo"),ve=h("rcnY"),se=h("wU8J"),xe=h("Iq15"),me=h("dWSS");function re(k,O){this.typeNumber=k,this.errorCorrectLevel=O,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var U=re.prototype;U.addData=function(k){var O=new V(k);this.dataList.push(O),this.dataCache=null},U.isDark=function(k,O){if(k<0||this.moduleCount<=k||O<0||this.moduleCount<=O)throw new Error(k+","+O);return this.modules[k][O]},U.getModuleCount=function(){return this.moduleCount},U.make=function(){if(this.typeNumber<1){var k=1;for(k=1;k<40;k++){for(var O=ve.getRSBlocks(k,this.errorCorrectLevel),T=new se,A=0,M=0;M<O.length;M++)A+=O[M].dataCount;for(var M=0;M<this.dataList.length;M++){var te=this.dataList[M];T.put(te.mode,4),T.put(te.getLength(),xe.getLengthInBits(te.mode,k)),te.write(T)}if(T.getLengthInBits()<=A*8)break}this.typeNumber=k}this.makeImpl(!1,this.getBestMaskPattern())},U.makeImpl=function(k,O){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var T=0;T<this.moduleCount;T++){this.modules[T]=new Array(this.moduleCount);for(var A=0;A<this.moduleCount;A++)this.modules[T][A]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(k,O),this.typeNumber>=7&&this.setupTypeNumber(k),this.dataCache==null&&(this.dataCache=re.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,O)},U.setupPositionProbePattern=function(k,O){for(var T=-1;T<=7;T++){if(k+T<=-1||this.moduleCount<=k+T)continue;for(var A=-1;A<=7;A++){if(O+A<=-1||this.moduleCount<=O+A)continue;0<=T&&T<=6&&(A==0||A==6)||0<=A&&A<=6&&(T==0||T==6)||2<=T&&T<=4&&2<=A&&A<=4?this.modules[k+T][O+A]=!0:this.modules[k+T][O+A]=!1}}},U.getBestMaskPattern=function(){for(var k=0,O=0,T=0;T<8;T++){this.makeImpl(!0,T);var A=xe.getLostPoint(this);(T==0||k>A)&&(k=A,O=T)}return O},U.createMovieClip=function(k,O,T){var A=k.createEmptyMovieClip(O,T),M=1;this.make();for(var te=0;te<this.modules.length;te++)for(var F=te*M,L=0;L<this.modules[te].length;L++){var G=L*M,W=this.modules[te][L];W&&(A.beginFill(0,100),A.moveTo(G,F),A.lineTo(G+M,F),A.lineTo(G+M,F+M),A.lineTo(G,F+M),A.endFill())}return A},U.setupTimingPattern=function(){for(var k=8;k<this.moduleCount-8;k++){if(this.modules[k][6]!=null)continue;this.modules[k][6]=k%2==0}for(var O=8;O<this.moduleCount-8;O++){if(this.modules[6][O]!=null)continue;this.modules[6][O]=O%2==0}},U.setupPositionAdjustPattern=function(){for(var k=xe.getPatternPosition(this.typeNumber),O=0;O<k.length;O++)for(var T=0;T<k.length;T++){var A=k[O],M=k[T];if(this.modules[A][M]!=null)continue;for(var te=-2;te<=2;te++)for(var F=-2;F<=2;F++)te==-2||te==2||F==-2||F==2||te==0&&F==0?this.modules[A+te][M+F]=!0:this.modules[A+te][M+F]=!1}},U.setupTypeNumber=function(k){for(var O=xe.getBCHTypeNumber(this.typeNumber),T=0;T<18;T++){var A=!k&&(O>>T&1)==1;this.modules[Math.floor(T/3)][T%3+this.moduleCount-8-3]=A}for(var T=0;T<18;T++){var A=!k&&(O>>T&1)==1;this.modules[T%3+this.moduleCount-8-3][Math.floor(T/3)]=A}},U.setupTypeInfo=function(k,O){for(var T=this.errorCorrectLevel<<3|O,A=xe.getBCHTypeInfo(T),M=0;M<15;M++){var te=!k&&(A>>M&1)==1;M<6?this.modules[M][8]=te:M<8?this.modules[M+1][8]=te:this.modules[this.moduleCount-15+M][8]=te}for(var M=0;M<15;M++){var te=!k&&(A>>M&1)==1;M<8?this.modules[8][this.moduleCount-M-1]=te:M<9?this.modules[8][15-M-1+1]=te:this.modules[8][15-M-1]=te}this.modules[this.moduleCount-8][8]=!k},U.mapData=function(k,O){for(var T=-1,A=this.moduleCount-1,M=7,te=0,F=this.moduleCount-1;F>0;F-=2)for(F==6&&F--;;){for(var L=0;L<2;L++)if(this.modules[A][F-L]==null){var G=!1;te<k.length&&(G=(k[te]>>>M&1)==1);var W=xe.getMask(O,A,F-L);W&&(G=!G),this.modules[A][F-L]=G,M--,M==-1&&(te++,M=7)}if(A+=T,A<0||this.moduleCount<=A){A-=T,T=-T;break}}},re.PAD0=236,re.PAD1=17,re.createData=function(k,O,T){for(var A=ve.getRSBlocks(k,O),M=new se,te=0;te<T.length;te++){var F=T[te];M.put(F.mode,4),M.put(F.getLength(),xe.getLengthInBits(F.mode,k)),F.write(M)}for(var L=0,te=0;te<A.length;te++)L+=A[te].dataCount;if(M.getLengthInBits()>L*8)throw new Error("code length overflow. ("+M.getLengthInBits()+">"+L*8+")");for(M.getLengthInBits()+4<=L*8&&M.put(0,4);M.getLengthInBits()%8!=0;)M.putBit(!1);for(;!(M.getLengthInBits()>=L*8);){if(M.put(re.PAD0,8),M.getLengthInBits()>=L*8)break;M.put(re.PAD1,8)}return re.createBytes(M,A)},re.createBytes=function(k,O){for(var T=0,A=0,M=0,te=new Array(O.length),F=new Array(O.length),L=0;L<O.length;L++){var G=O[L].dataCount,W=O[L].totalCount-G;A=Math.max(A,G),M=Math.max(M,W),te[L]=new Array(G);for(var ee=0;ee<te[L].length;ee++)te[L][ee]=255&k.buffer[ee+T];T+=G;var b=xe.getErrorCorrectPolynomial(W),fe=new me(te[L],b.getLength()-1),Se=fe.mod(b);F[L]=new Array(b.getLength()-1);for(var ee=0;ee<F[L].length;ee++){var he=ee+Se.getLength()-F[L].length;F[L][ee]=he>=0?Se.get(he):0}}for(var H=0,ee=0;ee<O.length;ee++)H+=O[ee].totalCount;for(var g=new Array(H),ne=0,ee=0;ee<A;ee++)for(var L=0;L<O.length;L++)ee<te[L].length&&(g[ne++]=te[L][ee]);for(var ee=0;ee<M;ee++)for(var L=0;L<O.length;L++)ee<F[L].length&&(g[ne++]=F[L][ee]);return g},Qe.exports=re},HG2Q:function(Qe,Ie,h){Qe.exports=h.p+"static/sren.1cbce50b.svg"},HPRh:function(Qe,Ie,h){Qe.exports=h.p+"static/median.766cb706.svg"},Hfvn:function(Qe,Ie,h){Qe.exports=h.p+"static/wenjian.ea3b4170.svg"},HmJG:function(Qe,Ie,h){},IlMy:function(Qe,Ie,h){Qe.exports={flex_box_center:"flex_box_center___1Rd7-",flex_space_between:"flex_space_between___1qdJI",flex_box_vertical_center:"flex_box_vertical_center___3PScB",flex_box_center_end:"flex_box_center_end___gmzWk",flex_box_column:"flex_box_column___qhFY7",wrap:"wrap___2CDxR",left:"left___21M_k",list:"list___ahv58",name:"name___3cBep",b:"b___1CRFh",r:"r___2F_9I",l:"l___3XCXI",total:"total___2VTdV",topWarp:"topWarp___y9feY",right:"right___U2Z5M",tabs:"tabs___3eZK5",title:"title___3iKxF",source:"source___3rkh5",folder:"folder___AxGOK",choice:"choice___1AdWh",range:"range___23nFr",btn:"btn___1QiCj",knWarp:"knWarp___3eQQ5",kn:"kn___1OLj0",btns:"btns___26z5C",modalBody:"modalBody___1b2lK",active:"active___kELz6",inputWarp:"inputWarp___1leis",modal:"modal___1Ehn0",exportModal:"exportModal___1Vsj-",teachModal:"teachModal___CwfeZ",head:"head___2_Y6a",wraps:"wraps___3-f7m",body:"body___2Jb5Z"}},Iq15:function(Qe,Ie,h){var V=h("nVVt"),ve=h("dWSS"),se=h("dQei"),xe={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},me={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,G18:1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,G15_MASK:1<<14|1<<12|1<<10|1<<4|1<<1,getBCHTypeInfo:function(re){for(var U=re<<10;me.getBCHDigit(U)-me.getBCHDigit(me.G15)>=0;)U^=me.G15<<me.getBCHDigit(U)-me.getBCHDigit(me.G15);return(re<<10|U)^me.G15_MASK},getBCHTypeNumber:function(re){for(var U=re<<12;me.getBCHDigit(U)-me.getBCHDigit(me.G18)>=0;)U^=me.G18<<me.getBCHDigit(U)-me.getBCHDigit(me.G18);return re<<12|U},getBCHDigit:function(re){for(var U=0;re!=0;)U++,re>>>=1;return U},getPatternPosition:function(re){return me.PATTERN_POSITION_TABLE[re-1]},getMask:function(re,U,k){switch(re){case xe.PATTERN000:return(U+k)%2==0;case xe.PATTERN001:return U%2==0;case xe.PATTERN010:return k%3==0;case xe.PATTERN011:return(U+k)%3==0;case xe.PATTERN100:return(Math.floor(U/2)+Math.floor(k/3))%2==0;case xe.PATTERN101:return U*k%2+U*k%3==0;case xe.PATTERN110:return(U*k%2+U*k%3)%2==0;case xe.PATTERN111:return(U*k%3+(U+k)%2)%2==0;default:throw new Error("bad maskPattern:"+re)}},getErrorCorrectPolynomial:function(re){for(var U=new ve([1],0),k=0;k<re;k++)U=U.multiply(new ve([1,se.gexp(k)],0));return U},getLengthInBits:function(re,U){if(1<=U&&U<10)switch(re){case V.MODE_NUMBER:return 10;case V.MODE_ALPHA_NUM:return 9;case V.MODE_8BIT_BYTE:return 8;case V.MODE_KANJI:return 8;default:throw new Error("mode:"+re)}else if(U<27)switch(re){case V.MODE_NUMBER:return 12;case V.MODE_ALPHA_NUM:return 11;case V.MODE_8BIT_BYTE:return 16;case V.MODE_KANJI:return 10;default:throw new Error("mode:"+re)}else if(U<41)switch(re){case V.MODE_NUMBER:return 14;case V.MODE_ALPHA_NUM:return 13;case V.MODE_8BIT_BYTE:return 16;case V.MODE_KANJI:return 12;default:throw new Error("mode:"+re)}else throw new Error("type:"+U)},getLostPoint:function(re){for(var U=re.getModuleCount(),k=0,O=0;O<U;O++)for(var T=0;T<U;T++){for(var A=0,M=re.isDark(O,T),te=-1;te<=1;te++){if(O+te<0||U<=O+te)continue;for(var F=-1;F<=1;F++){if(T+F<0||U<=T+F)continue;if(te==0&&F==0)continue;M==re.isDark(O+te,T+F)&&A++}}A>5&&(k+=3+A-5)}for(var O=0;O<U-1;O++)for(var T=0;T<U-1;T++){var L=0;re.isDark(O,T)&&L++,re.isDark(O+1,T)&&L++,re.isDark(O,T+1)&&L++,re.isDark(O+1,T+1)&&L++,(L==0||L==4)&&(k+=3)}for(var O=0;O<U;O++)for(var T=0;T<U-6;T++)re.isDark(O,T)&&!re.isDark(O,T+1)&&re.isDark(O,T+2)&&re.isDark(O,T+3)&&re.isDark(O,T+4)&&!re.isDark(O,T+5)&&re.isDark(O,T+6)&&(k+=40);for(var T=0;T<U;T++)for(var O=0;O<U-6;O++)re.isDark(O,T)&&!re.isDark(O+1,T)&&re.isDark(O+2,T)&&re.isDark(O+3,T)&&re.isDark(O+4,T)&&!re.isDark(O+5,T)&&re.isDark(O+6,T)&&(k+=40);for(var G=0,T=0;T<U;T++)for(var O=0;O<U;O++)re.isDark(O,T)&&G++;var W=Math.abs(100*G/U/U-50)/5;return k+=W*10,k}};Qe.exports=me},K5AI:function(Qe,Ie,h){Qe.exports={cInput:"cInput___2BJRi",cl:"cl___AbKoK",box:"box___3gRA9",box1:"box1___S3u_s",cr:"cr___16yEi"}},LdHM:function(Qe,Ie,h){"use strict";h.d(Ie,"b",function(){return fe}),h.d(Ie,"a",function(){return he});var V=h("1OyB"),ve=h("vuIU"),se=h("Ji7U"),xe=h("LK+K"),me=h("q1tI"),re=h("rePB"),U=h("Ff2n"),k=h("ODXe"),O=h("4IlW"),T=h("bX4T"),A=h("YrtM"),M=h("TSYQ"),te=h.n(M),F=h("+nKL"),L=h("8OUc"),G=function(ue,Be){var Pe=ue.prefixCls,ze=ue.id,Te=ue.flattenOptions,we=ue.childrenAsData,X=ue.values,K=ue.searchValue,le=ue.multiple,N=ue.defaultActiveFirstOption,_=ue.height,pe=ue.itemHeight,Ue=ue.notFoundContent,Ze=ue.open,Ae=ue.menuItemSelectedIcon,De=ue.virtual,Re=ue.onSelect,Me=ue.onToggleOpen,Xe=ue.onActiveValue,qe=ue.onScroll,ot=ue.onMouseEnter,Ke="".concat(Pe,"-item"),Ve=Object(A.a)(function(){return Te},[Ze,Te],function(We,$){return $[0]&&We[1]!==$[1]}),At=me.useRef(null),gt=function($){$.preventDefault()},kt=function($){At.current&&At.current.scrollTo({index:$})},ct=function($){for(var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Q=Ve.length,x=0;x<Q;x+=1){var R=($+x*q+Q)%Q,j=Ve[R],I=j.group,de=j.data;if(!I&&!de.disabled)return R}return-1},Pt=me.useState(function(){return ct(0)}),xt=Object(k.a)(Pt,2),bt=xt[0],Ne=xt[1],Ut=function($){Ne($);var q=Ve[$];if(!q){Xe(null,-1);return}Xe(q.data.value,$)};me.useEffect(function(){Ut(N!==!1?ct(0):-1)},[Ve.length,K]),me.useEffect(function(){var We=setTimeout(function(){if(!le&&Ze&&X.size===1){var $=Array.from(X)[0],q=Ve.findIndex(function(Q){var x=Q.data;return x.value===$});Ut(q),kt(q)}});return function(){return clearTimeout(We)}},[Ze]);var Rt=function($){$!==void 0&&Re($,{selected:!X.has($)}),le||Me(!1)};if(me.useImperativeHandle(Be,function(){return{onKeyDown:function($){var q=$.which;switch(q){case O.a.UP:case O.a.DOWN:{var Q=0;if(q===O.a.UP?Q=-1:q===O.a.DOWN&&(Q=1),Q!==0){var x=ct(bt+Q,Q);kt(x),Ut(x)}break}case O.a.ENTER:{var R=Ve[bt];R&&!R.data.disabled?Rt(R.data.value):Rt(void 0),Ze&&$.preventDefault();break}case O.a.ESC:Me(!1)}},onKeyUp:function(){},scrollTo:function($){kt($)}}}),Ve.length===0)return me.createElement("div",{role:"listbox",id:"".concat(ze,"_list"),className:"".concat(Ke,"-empty"),onMouseDown:gt},Ue);function je(We){var $=Ve[We];if(!$)return null;var q=$.data||{},Q=q.value,x=q.label,R=q.children,j=Object(T.a)(q,!0),I=we?R:x;return $?me.createElement("div",Object.assign({"aria-label":typeof I=="string"?I:null},j,{key:We,role:"option",id:"".concat(ze,"_list_").concat(We),"aria-selected":X.has(Q)}),Q):null}return me.createElement(me.Fragment,null,me.createElement("div",{role:"listbox",id:"".concat(ze,"_list"),style:{height:0,width:0,overflow:"hidden"}},je(bt-1),je(bt),je(bt+1)),me.createElement(F.a,{itemKey:"key",ref:At,data:Ve,height:_,itemHeight:pe,fullHeight:!1,onMouseDown:gt,onScroll:qe,virtual:De,onMouseEnter:ot},function(We,$){var q,Q=We.group,x=We.groupOption,R=We.data,j=R.label,I=R.key;if(Q)return me.createElement("div",{className:te()(Ke,"".concat(Ke,"-group"))},j!==void 0?j:I);var de=R.disabled,Ce=R.value,Oe=R.title,_t=R.children,at=R.style,ge=R.className,lt=Object(U.a)(R,["disabled","value","title","children","style","className"]),Et=X.has(Ce),et="".concat(Ke,"-option"),Ft=te()(Ke,et,ge,(q={},Object(re.a)(q,"".concat(et,"-grouped"),x),Object(re.a)(q,"".concat(et,"-active"),bt===$&&!de),Object(re.a)(q,"".concat(et,"-disabled"),de),Object(re.a)(q,"".concat(et,"-selected"),Et),q)),tt=we?_t:j,zt=!Ae||typeof Ae=="function"||Et;return me.createElement("div",Object.assign({},lt,{"aria-selected":Et,className:Ft,title:Oe,onMouseMove:function(){if(bt===$||de)return;Ut($)},onClick:function(){de||Rt(Ce)},style:at}),me.createElement("div",{className:"".concat(et,"-content")},tt||Ce),me.isValidElement(Ae)||Et,zt&&me.createElement(L.a,{className:"".concat(Ke,"-option-state"),customizeIcon:Ae,customizeIconProps:{isSelected:Et}},Et?"\u2713":null))}))},W=me.forwardRef(G);W.displayName="OptionList";var ee=W,b=function(){return null};b.isSelectOption=!0;var fe=b,Se=function(){return null};Se.isSelectOptGroup=!0;var he=Se,H=h("VTBJ"),g=h("Zm9Q");function ne(p){var ue=p.key,Be=p.props,Pe=Be.children,ze=Be.value,Te=Object(U.a)(Be,["children","value"]);return Object(H.a)({key:ue,value:ze!==void 0?ze:ue,children:Pe},Te)}function S(p){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(g.a)(p).map(function(Be,Pe){if(!me.isValidElement(Be)||!Be.type)return null;var ze=Be.type.isSelectOptGroup,Te=Be.key,we=Be.props,X=we.children,K=Object(U.a)(we,["children"]);return ue||!ze?ne(Be):Object(H.a)(Object(H.a)({key:"__RC_SELECT_GRP__".concat(Te===null?Pe:Te,"__"),label:Te},K),{},{options:S(X)})}).filter(function(Be){return Be})}var Y=h("2Qr1"),w=h("qNPg"),C=h("U8pU"),J=h("Kwbf"),z=h("WKfj");function E(p){var ue=p.mode,Be=p.options,Pe=p.children,ze=p.backfill,Te=p.allowClear,we=p.placeholder,X=p.getInputElement,K=p.showSearch,le=p.onSearch,N=p.defaultOpen,_=p.autoFocus,pe=p.labelInValue,Ue=p.value,Ze=p.inputValue,Ae=p.optionLabelProp,De=ue==="multiple"||ue==="tags",Re=K!==void 0?K:De||ue==="combobox",Me=Be||S(Pe);if(Object(J.a)(ue!=="tags"||Me.every(function(Ke){return!Ke.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),ue==="tags"||ue==="combobox"){var Xe=Me.some(function(Ke){return Ke.options?Ke.options.some(function(Ve){return typeof("value"in Ve?Ve.value:Ve.key)=="number"}):typeof("value"in Ke?Ke.value:Ke.key)=="number"});Object(J.a)(!Xe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(J.a)(ue!=="combobox"||!Ae,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(J.a)(ue==="combobox"||!ze,"`backfill` only works with `combobox` mode."),Object(J.a)(ue==="combobox"||!X,"`getInputElement` only work with `combobox` mode."),Object(J.b)(ue!=="combobox"||!X||!Te||!we,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),le&&!Re&&ue!=="combobox"&&ue!=="tags"&&Object(J.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(J.b)(!N||_,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ue!=null){var qe=Object(z.d)(Ue);Object(J.a)(!pe||qe.every(function(Ke){return Object(C.a)(Ke)==="object"&&("key"in Ke||"value"in Ke)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(J.a)(!De||Array.isArray(Ue),"`value` should be array when `mode` is `multiple` or `tags`")}if(Pe){var ot=null;Object(g.a)(Pe).some(function(Ke){if(!me.isValidElement(Ke)||!Ke.type)return!1;var Ve=Ke.type;if(Ve.isSelectOption)return!1;if(Ve.isSelectOptGroup){var At=Object(g.a)(Ke.props.children).every(function(gt){return!me.isValidElement(gt)||!Ke.type||gt.type.isSelectOption?!0:(ot=gt.type,!1)});return!At}return ot=Ve,!0}),ot&&Object(J.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ot.displayName||ot.name||ot,"`.")),Object(J.a)(Ze===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var P=E,ae=Object(w.a)({prefixCls:"rc-select",components:{optionList:ee},convertChildrenToData:S,flattenOptions:Y.d,getLabeledValue:Y.e,filterOptions:Y.b,isValueDisabled:Y.g,findValueOption:Y.c,warningProps:P,fillOptionsWithMissingValue:Y.a}),B=function(p){Object(se.a)(Be,p);var ue=Object(xe.a)(Be);function Be(){var Pe;return Object(V.a)(this,Be),Pe=ue.apply(this,arguments),Pe.selectRef=me.createRef(),Pe.focus=function(){Pe.selectRef.current.focus()},Pe.blur=function(){Pe.selectRef.current.blur()},Pe}return Object(ve.a)(Be,[{key:"render",value:function(){return me.createElement(ae,Object.assign({ref:this.selectRef},this.props))}}]),Be}(me.Component);B.Option=fe,B.OptGroup=he;var be=B,D=Ie.c=be},M8RZ:function(Qe,Ie,h){"use strict";h.d(Ie,"a",function(){return O});var V=h("fWQN"),ve=h("mtLc"),se=h("yKVA"),xe=h("879j"),me=h("q1tI"),re=h.n(me),U=h("i8i4"),k=h.n(U),O=function(T){Object(se.a)(M,T);var A=Object(xe.a)(M);function M(te){var F;Object(V.a)(this,M),F=A.call(this,te);var L=window.document;return F.node=L.createElement("div"),L.body.appendChild(F.node),F}return Object(ve.a)(M,[{key:"render",value:function(){var F=this.props.children;return Object(U.createPortal)(F,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),M}(re.a.Component)},NvD2:function(Qe,Ie,h){"use strict";h.d(Ie,"a",function(){return re});var V=h("Kwbf");function ve(U,k){var O=new Set;return U.forEach(function(T){k.has(T)||O.add(T)}),O}function se(U){var k=U||{},O=k.disabled,T=k.disableCheckbox,A=k.checkable;return!!(O||T)||A===!1}function xe(U,k,O,T){for(var A=new Set(U),M=new Set,te=0;te<=O;te+=1){var F=k.get(te)||new Set;F.forEach(function(ee){var b=ee.key,fe=ee.node,Se=ee.children,he=Se===void 0?[]:Se;A.has(b)&&!T(fe)&&he.filter(function(H){return!T(H.node)}).forEach(function(H){A.add(H.key)})})}for(var L=new Set,G=O;G>=0;G-=1){var W=k.get(G)||new Set;W.forEach(function(ee){var b=ee.parent,fe=ee.node;if(T(fe)||!ee.parent||L.has(ee.parent.key))return;if(T(ee.parent.node)){L.add(b.key);return}var Se=!0,he=!1;(b.children||[]).filter(function(H){return!T(H.node)}).forEach(function(H){var g=H.key,ne=A.has(g);Se&&!ne&&(Se=!1),!he&&(ne||M.has(g))&&(he=!0)}),Se&&A.add(b.key),he&&M.add(b.key),L.add(b.key)})}return{checkedKeys:Array.from(A),halfCheckedKeys:Array.from(ve(M,A))}}function me(U,k,O,T,A){for(var M=new Set(U),te=new Set(k),F=0;F<=T;F+=1){var L=O.get(F)||new Set;L.forEach(function(b){var fe=b.key,Se=b.node,he=b.children,H=he===void 0?[]:he;!M.has(fe)&&!te.has(fe)&&!A(Se)&&H.filter(function(g){return!A(g.node)}).forEach(function(g){M.delete(g.key)})})}te=new Set;for(var G=new Set,W=T;W>=0;W-=1){var ee=O.get(W)||new Set;ee.forEach(function(b){var fe=b.parent,Se=b.node;if(A(Se)||!b.parent||G.has(b.parent.key))return;if(A(b.parent.node)){G.add(fe.key);return}var he=!0,H=!1;(fe.children||[]).filter(function(g){return!A(g.node)}).forEach(function(g){var ne=g.key,S=M.has(ne);he&&!S&&(he=!1),!H&&(S||te.has(ne))&&(H=!0)}),he||M.delete(fe.key),H&&te.add(fe.key),G.add(fe.key)})}return{checkedKeys:Array.from(M),halfCheckedKeys:Array.from(ve(te,M))}}function re(U,k,O,T){var A=[],M;T?M=T:M=se;var te=new Set(U.filter(function(W){var ee=!!O[W];return ee||A.push(W),ee})),F=new Map,L=0;Object.keys(O).forEach(function(W){var ee=O[W],b=ee.level,fe=F.get(b);fe||(fe=new Set,F.set(b,fe)),fe.add(ee),L=Math.max(L,b)}),Object(V.a)(!A.length,"Tree missing follow keys: ".concat(A.slice(0,100).map(function(W){return"'".concat(W,"'")}).join(", ")));var G;return k===!0?G=xe(te,F,L,M):G=me(te,k.halfCheckedKeys,F,L,M),G}},O2Wb:function(Qe,Ie,h){Qe.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OLES:function(Qe,Ie,h){"use strict";var V=h("U8pU"),ve=h("VTBJ"),se=h("Ff2n"),xe=h("q1tI"),me=h("uciX"),re=h("7ixt"),U=function(te){var F=te.overlay,L=te.prefixCls,G=te.id,W=te.overlayInnerStyle;return xe.createElement("div",{className:"".concat(L,"-inner"),id:G,role:"tooltip",style:W},typeof F=="function"?F():F)},k=U,O=function(te,F){var L=te.overlayClassName,G=te.trigger,W=G===void 0?["hover"]:G,ee=te.mouseEnterDelay,b=ee===void 0?0:ee,fe=te.mouseLeaveDelay,Se=fe===void 0?.1:fe,he=te.overlayStyle,H=te.prefixCls,g=H===void 0?"rc-tooltip":H,ne=te.children,S=te.onVisibleChange,Y=te.afterVisibleChange,w=te.transitionName,C=te.animation,J=te.placement,z=J===void 0?"right":J,E=te.align,P=E===void 0?{}:E,ae=te.destroyTooltipOnHide,B=ae===void 0?!1:ae,be=te.defaultVisible,D=te.getTooltipContainer,p=te.overlayInnerStyle,ue=Object(se.a)(te,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Be=Object(xe.useRef)(null);Object(xe.useImperativeHandle)(F,function(){return Be.current});var Pe=Object(ve.a)({},ue);"visible"in te&&(Pe.popupVisible=te.visible);var ze=function(){var le=te.arrowContent,N=le===void 0?null:le,_=te.overlay,pe=te.id;return[xe.createElement("div",{className:"".concat(g,"-arrow"),key:"arrow"},N),xe.createElement(k,{key:"content",prefixCls:g,id:pe,overlay:_,overlayInnerStyle:p})]},Te=!1,we=!1;if(typeof B=="boolean")Te=B;else if(B&&Object(V.a)(B)==="object"){var X=B.keepParent;Te=X===!0,we=X===!1}return xe.createElement(me.a,Object.assign({popupClassName:L,prefixCls:g,popup:ze,action:W,builtinPlacements:re.a,popupPlacement:z,ref:Be,popupAlign:P,getPopupContainer:D,onPopupVisibleChange:S,afterPopupVisibleChange:Y,popupTransitionName:w,popupAnimation:C,defaultPopupVisible:be,destroyPopupOnHide:Te,autoDestroy:we,mouseLeaveDelay:Se,popupStyle:he,mouseEnterDelay:b},Pe),ne)},T=Object(xe.forwardRef)(O),A=Ie.a=T},OZM5:function(Qe,Ie,h){"use strict";h.d(Ie,"b",function(){return T}),h.d(Ie,"a",function(){return A}),h.d(Ie,"k",function(){return M}),h.d(Ie,"h",function(){return te}),h.d(Ie,"i",function(){return F}),h.d(Ie,"g",function(){return L}),h.d(Ie,"c",function(){return G}),h.d(Ie,"d",function(){return W}),h.d(Ie,"j",function(){return fe}),h.d(Ie,"e",function(){return Se}),h.d(Ie,"f",function(){return he});var V=h("KQm4"),ve=h("U8pU"),se=h("Ff2n"),xe=h("q1tI"),me=h.n(xe),re=h("Kwbf"),U=h("WaYH"),k=.25,O=2;function T(H,g){var ne=H.slice(),S=ne.indexOf(g);return S>=0&&ne.splice(S,1),ne}function A(H,g){var ne=H.slice();return ne.indexOf(g)===-1&&ne.push(g),ne}function M(H){return H.split("-")}function te(H,g){return"".concat(H,"-").concat(g)}function F(H){return H&&H.type&&H.type.isTreeNode}function L(H,g){var ne=[H],S=g[H];function Y(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];w.forEach(function(C){var J=C.key,z=C.children;ne.push(J),Y(z)})}return Y(S.children),ne}function G(H,g){var ne=H.clientY,S=g.selectHandle.getBoundingClientRect(),Y=S.top,w=S.bottom,C=S.height,J=Math.max(C*k,O);return ne<=Y+J?-1:ne>=w-J?1:0}function W(H,g){if(!H)return;var ne=g.multiple;return ne?H.slice():H.length?[H[0]]:H}var ee=function(g){return g};function b(H,g){if(!H)return[];var ne=g||{},S=ne.processProps,Y=S===void 0?ee:S,w=Array.isArray(H)?H:[H];return w.map(function(C){var J=C.children,z=Object(se.a)(C,["children"]),E=b(J,g);return me.a.createElement(U.a,Object.assign({},Y(z)),E)})}function fe(H){if(!H)return null;var g;if(Array.isArray(H))g={checkedKeys:H,halfCheckedKeys:void 0};else if(Object(ve.a)(H)==="object")g={checkedKeys:H.checked||void 0,halfCheckedKeys:H.halfChecked||void 0};else return Object(re.a)(!1,"`checkedKeys` is not an array or an object"),null;return g}function Se(H,g){var ne=new Set;function S(Y){if(ne.has(Y))return;var w=g[Y];if(!w)return;ne.add(Y);var C=w.parent,J=w.node;if(J.disabled)return;C&&S(C.key)}return(H||[]).forEach(function(Y){S(Y)}),Object(V.a)(ne)}function he(H){var g={};return Object.keys(H).forEach(function(ne){(ne.startsWith("data-")||ne.startsWith("aria-"))&&(g[ne]=H[ne])}),g}},Ot1p:function(Qe,Ie,h){"use strict";var V=h("2qtc"),ve=h("kLXV"),se=h("rAM+"),xe=h("miYZ"),me=h("tsqr"),re=h("9og8"),U=h("tJVT"),k=h("jrin"),O=h("WmNS"),T=h.n(O),A=h("q1tI"),M=h.n(A),te=h("VrN/"),F=h.n(te),L=h("bdgK"),G=h("p77/"),W=h("Bd2K"),ee=h("ELLl"),b=h("19Vz"),fe=h("lZu9"),Se=h("+NIl"),he=h("kSUc"),H=h("9Bee"),g=function(ge){var lt=ge.value,Et=lt===void 0?"":lt,et=ge.className,Ft=ge.showTextOnly,tt=ge.showLines,zt=ge.style,It=zt===void 0?{}:zt,vt=Object(A.useMemo)(function(){return""},[Et]);return M.a.createElement(M.a.Fragment,null,M.a.createElement("div",{dangerouslySetInnerHTML:{__html:vt}}))},ne=h("Q9mQ"),S=h("diRs"),Y=h("0Owb"),w=h("dejd"),C=h("C+DQ"),J=h("D1Df"),z=h.n(J),E=h("1vsH"),P=h("m3rI"),ae=[{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 B(ge){var lt=ge.onActionCallback,Et=ge.title,et=ge.icon,Ft=ge.actionName,tt=ge.className,zt=tt===void 0?"":tt,It=ge.children;function vt(){lt(Ft)}return M.a.createElement("a",{title:Et,className:zt,onClick:vt},M.a.createElement("i",{className:"md-iconfont ".concat(et)}),It)}var be=function(ge){var lt=ge.watch,Et=ge.showNullButton,et=ge.onActionCallback,Ft=ge.fullScreen,tt=ge.insertTemp,zt=ge.hidetoolBar,It=ge.uuid,vt=ge.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(E.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(E.E)("_educoder_session"),"&key=").concat(It,"&api=").concat(encodeURIComponent(P.a.PROXY_SERVER)));var $t=[].concat(ae,[{title:"".concat(lt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(lt?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return M.a.createElement("ul",{className:"markdown-toolbar-container"},!zt&&$t.map(function(Lt,Fe){return M.a.createElement("li",{key:Fe},Lt.actionName?M.a.createElement(B,Object(Y.a)({},Lt,{onActionCallback:et})):M.a.createElement("span",{className:"v-line"}))}),Et?M.a.createElement("li",null,M.a.createElement(B,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:et},M.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,tt&&M.a.createElement("li",null,M.a.createElement(B,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(tt),onActionCallback:et},M.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),M.a.createElement("li",null,M.a.createElement(S.a,{title:"\u6253\u5F00\u624B\u673A\u626B\u4E00\u626B",content:M.a.createElement("div",null,M.a.createElement(z.a,{size:150,fgColor:"#000",value:"https://test2.educoder.net/upload.html?_educoder_session_login=".concat(Object(E.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(E.E)("_educoder_session"),"&key=").concat(It,"&api=").concat(encodeURIComponent(P.a.PROXY_SERVER))}))},M.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return vt(!0)}},"\u624B\u673A\u4E0A\u4F20\u6587\u4EF6"))),M.a.createElement("li",{className:"btn-full-screen"},M.a.createElement(B,{icon:"".concat(Ft?"icon-shrink":"icon-enlarge"),title:Ft?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:et})))},D=h("M8RZ"),p=h("+L6B"),ue=h("2/Rp"),Be=h("y8nQ"),Pe=h("Vl3Y"),ze=h("5NDa"),Te=h("5rEg"),we={labelCol:{span:4},wrapperCol:{span:20}},X=function(ge){var lt=ge.callback,Et=ge.onCancel;function et(Ft){lt(Ft)}return M.a.createElement(Pe.a,Object(Y.a)({},we,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:et}),M.a.createElement(Pe.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},M.a.createElement(Te.a,null)),M.a.createElement(Pe.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},M.a.createElement(Te.a,null)),M.a.createElement("div",{className:"flex-container flex-end"},M.a.createElement(ue.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),M.a.createElement(ue.a,{type:"ghost",onClick:Et},"\u53D6\u6D88")))},K=h("7ahc"),le=h("k1fw"),N=h("HmJG"),_=h("BjJ7"),pe=Pe.a.useForm,Ue={width:280,marginRight:10},Ze={labelCol:{span:5},wrapperCol:{span:19}},Ae=function(ge){var lt=ge.callback,Et=ge.onCancel,et=pe(),Ft=Object(U.a)(et,1),tt=Ft[0],zt=Object(A.useRef)();function It(Lt){lt(Object(le.a)(Object(le.a)({},Lt),{},{name:zt.current}))}function vt(Lt,Fe){tt.setFieldsValue({src:"/api/attachments/".concat(Lt.id,"?type=").concat(Lt.content_type),type:Fe.type})}function $t(Lt){var Fe=Lt.target.files[0];zt.current=Fe.name,Re(Fe,vt)}return M.a.createElement(Pe.a,Object(Y.a)({form:tt},Ze,{className:"upload-image-panel",onFinish:It}),M.a.createElement(Pe.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},M.a.createElement("div",{className:"flex-container"},M.a.createElement(Pe.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},M.a.createElement(Te.a,{style:Ue})),M.a.createElement(De,{onFileChange:$t}))),M.a.createElement(Pe.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},M.a.createElement(Te.a,{style:{width:264}})),M.a.createElement(Pe.a.Item,{style:{textAlign:"right"}},M.a.createElement(ue.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),M.a.createElement(ue.a,{type:"ghost",onClick:Et},"\u53D6\u6D88")))};function De(ge){var lt=ge.onFileChange;return M.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",M.a.createElement("input",{type:"file",onChange:lt}))}function Re(ge,lt){if(!ge)throw new String("\u6CA1\u6709\u6587\u4EF6");var Et=new FormData;Et.append("editormd-image-file",ge),Et.append("file_param_name","editormd-image-file"),Et.append("byxhr","true");var et=new window.XMLHttpRequest;et.withCredentials=!0,et.addEventListener("load",function(Ft){lt(JSON.parse(Ft.target.responseText),ge)},!1),et.addEventListener("error",function(Ft){console.error(Ft)},!1),et.open("POST","".concat(_.a,"/api/attachments.json")),et.send(Et)}var Me=h("giR+"),Xe=h("fyUT"),qe=h("7Kak"),ot=h("9yH6"),Ke=ot.a.Group,Ve={margin:"0 8px"},At=function(ge){var lt=ge.callback,Et=ge.onCancel;function et(Ft){lt(Ft)}return M.a.createElement(Pe.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:et},M.a.createElement("div",{className:"flex-container"},M.a.createElement("span",{style:Ve},"\u5355\u5143\u683C\u6570\uFF1A"),M.a.createElement("span",{style:Ve},"\u884C\u6570"),M.a.createElement(Pe.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},M.a.createElement(Xe.a,null)),M.a.createElement("span",{style:Ve},"\u5217\u6570"),M.a.createElement(Pe.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},M.a.createElement(Xe.a,null))),M.a.createElement("div",{className:"flex-container",style:{marginTop:12}},M.a.createElement("span",{style:Ve},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),M.a.createElement(Pe.a.Item,{name:"align"},M.a.createElement(Ke,null,M.a.createElement(ot.a,{value:"default"},M.a.createElement("i",{className:"fa fa-align-justify"})),M.a.createElement(ot.a,{value:"left"},M.a.createElement("i",{className:"fa fa-align-left"})),M.a.createElement(ot.a,{value:"center"},M.a.createElement("i",{className:"fa fa-align-center"})),M.a.createElement(ot.a,{value:"right"},M.a.createElement("i",{className:"fa fa-align-right"}))))),M.a.createElement("div",{className:"flex-container flex-end"},M.a.createElement(ue.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),M.a.createElement(ue.a,{type:"ghost",onClick:Et},"\u53D6\u6D88")))},gt=h("ErOA"),kt=h("7Cbv"),ct="link",Pt="upload-image",xt="code-block",bt="add-table",Ne="------------",Ut={default:Ne,left:":".concat(Ne),center:":".concat(Ne,":"),right:"".concat(Ne,":")},Rt=h("9VGf"),je,We;function $(){}var q=0,Q=1e4,x="\u2581",R=`
**\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 j(ge){return/^\d+$/.test(ge)?"".concat(ge,"px"):ge}var I=navigator.platform.toUpperCase().indexOf("MAC")>=0,de=I?"Cmd":"Ctrl",Ce=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],Oe=(je={},Object(k.a)(je,de+"-B","bold"),Object(k.a)(je,de+"-I","italic"),je),_t=(We={},Object(k.a)(We,ct,"\u6DFB\u52A0\u94FE\u63A5"),Object(k.a)(We,xt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(k.a)(We,Pt,"\u6DFB\u52A0\u6587\u4EF6"),Object(k.a)(We,bt,"\u6DFB\u52A0\u8868\u683C"),We),at=Ie.a=function(ge){var lt=ge.defaultValue,Et=lt===void 0?"":lt,et=ge.onChange,Ft=ge.width,tt=Ft===void 0?"100%":Ft,zt=ge.height,It=zt===void 0?400:zt,vt=ge.miniToolbar,$t=vt===void 0?!1:vt,Lt=ge.isFocus,Fe=Lt===void 0?!1:Lt,ut=ge.watch,nt=ge.insertTemp,dt=ge.mode,Kt=dt===void 0?"markdown":dt,Vt=ge.id,an=Vt===void 0?"markdown-editor-id":Vt,Gt=ge.showResizeBar,Ct=Gt===void 0?!1:Gt,tn=ge.noStorage,Nt=tn===void 0?!1:tn,ln=ge.showNullButton,Xt=ln===void 0?!1:ln,hn=ge.hidetoolBar,Kn=hn===void 0?!1:hn,nn=ge.fullScreen,$e=nn===void 0?!1:nn,st=ge.onBlur,fn=ge.onCMBeforeChange,gn=ge.onFullScreen,On=ge.className,Bn=On===void 0?"":On,d=ge.disablePaste,o=d===void 0?!1:d,r=ge.placeholder,u=r===void 0?"":r,v=ge.values,c=v===void 0?"":v,oe=Object(A.useState)(null),Je=Object(U.a)(oe,2),_e=Je[0],Bt=Je[1],Ee=Object(A.useState)(Et),ce=Object(U.a)(Ee,2),Ye=ce[0],Ot=ce[1],Mt=Object(A.useState)(ut),Tt=Object(U.a)(Mt,2),Dt=Tt[0],cn=Tt[1],Nn=Object(A.useState)($e),Cn=Object(U.a)(Nn,2),pn=Cn[0],Wn=Cn[1],jn=Object(A.useState)(""),ti=Object(U.a)(jn,2),xi=ti[0],Fn=ti[1],Xn=Object(A.useState)(0),$i=Object(U.a)(Xn,2),ri=$i[0],wn=$i[1],Hi=Object(A.useState)(It),la=Object(U.a)(Hi,2),ia=la[0],$n=la[1],yn=Object(A.useState)(!1),di=Object(U.a)(yn,2),vn=di[0],ni=di[1],An=Object(A.useRef)(Object(kt.a)()),Si=Object(A.useRef)(!1),ii=Object(A.useRef)(),Zn=Object(A.useRef)(),Yi=Object(A.useRef)(),Ji=Object(A.useRef)(),aa=Object(A.useRef)(),Sa=function(){var Ht=Object(re.a)(T.a.mark(function qt(){var Jt,rn;return T.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:return _n.next=2,Object(gt.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:An.current}});case 2:rn=_n.sent,rn!=null&&(Jt=rn.attachments)!==null&&Jt!==void 0&&Jt.length&&(console.log("cm:",_e,Zn),rn.attachments.map(function(dn){dn.content_type.indexOf("image")>-1?_e.replaceSelection("![,](/api/attachments/".concat(dn.id,"?type=").concat(dn.content_type,")")):dn.content_type.indexOf("video")>-1?_e.replaceSelection('<video width="100%" controls src="'.concat(P.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):dn.content_type.indexOf("pdf")>-1?_e.replaceSelection('<a href="'.concat(P.a.API_SERVER,"/api/attachments/").concat(dn.id,"?type=").concat(dn.content_type,'&disposition=inline" target="_blank">').concat(dn.name,"</a>")):_e.replaceSelection("[".concat(dn.name,"](").concat(P.a.API_SERVER,"/api/attachments/").concat(dn.id,"?type=").concat(dn.content_type,")"))}));case 4:case"end":return _n.stop()}},qt)}));return function(){return Ht.apply(this,arguments)}}();Object(A.useEffect)(function(){Ot(c),_e==null||_e.setValue(c)},[c]),Object(A.useEffect)(function(){gn==null||gn(pn)},[pn]),Object(A.useEffect)(function(){if(Zn.current){var Ht=F.a.fromTextArea(Zn.current,{mode:Kt,lineNumbers:!$t,lineWrapping:!0,value:Et,autoCloseTags:!0,autoCloseBrackets:!0});Fe&&Ht.focus();function qt(Jt,rn){if(o){rn.preventDefault();return}var mn=rn.clipboardData;if(mn){var _n=mn.types.toString(),dn=mn.items;if(_n==="Files"||mn.types.indexOf("Files")>-1){if(rn.preventDefault(),Kt=="stex")return;try{var Mn,Yn=dn[1];((Mn=dn[0])===null||Mn===void 0?void 0:Mn.kind)==="file"&&(Yn=dn[0]);var un=Yn.getAsFile(),ca=un.name.split(".").pop();Re(un,function(kn){if(kn.id){var hi,Tn,zi;(un==null||((hi=un.type)===null||hi===void 0)?void 0:hi.indexOf("image"))>-1?Ht.replaceSelection("![,](/api/attachments/".concat(kn.id,"?type=").concat(kn.content_type,")")):(un==null||((Tn=un.type)===null||Tn===void 0)?void 0:Tn.indexOf("video"))>-1?Ht.replaceSelection('<video width="100%" controls src="'.concat(P.a.API_SERVER,"/api/attachments/").concat(kn.id,'"></video>')):(un==null||((zi=un.type)===null||zi===void 0)?void 0:zi.indexOf("pdf"))>-1?Ht.replaceSelection('<a href="'.concat(P.a.API_SERVER,"/api/attachments/").concat(kn.id,"?type=").concat(un.type,'&disposition=inline" target="_blank">').concat(un.name,"</a>")):Ce.includes(ca)?Ht.replaceSelection('<a href="'.concat(P.a.API_SERVER,"/api/attachments/").concat(kn.id,'?type=office&disposition=inline" target="_blank">').concat(un.name,"</a>")):Ht.replaceSelection("[".concat(un.name,"](").concat(P.a.API_SERVER,"/api/attachments/").concat(kn.id,"?type=").concat(kn.content_type,")"))}else(kn==null?void 0:kn.status)===401&&(document.location.href="/user/login")})}catch(kn){me.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Ht.on("paste",qt),Ht.on("dragleave",function(Jt,rn){Yi.current.classList.remove("mouse-hover-md")}),Ht.on("dragover",function(Jt,rn){Yi.current.classList.add("mouse-hover-md")}),Ht.on("drop",function(Jt,rn){Yi.current.classList.add("mouse-hover-md");var mn;if(mn=rn.dataTransfer.files,mn.length>0){rn.preventDefault(),rn.stopPropagation();for(var _n=function(Yn){var un=mn[Yn],ca=un.name.split(".").pop();Re(un,function(kn){if(kn.id){var hi,Tn,zi;(un==null||((hi=un.type)===null||hi===void 0)?void 0:hi.indexOf("image"))>-1?Ht.replaceSelection("![,](/api/attachments/".concat(kn.id,"?type=").concat(kn.content_type,")")):(un==null||((Tn=un.type)===null||Tn===void 0)?void 0:Tn.indexOf("video"))>-1?Ht.replaceSelection('<video width="100%" controls src="'.concat(P.a.API_SERVER,"/api/attachments/").concat(kn.id,'"></video>')):(un==null||((zi=un.type)===null||zi===void 0)?void 0:zi.indexOf("pdf"))>-1?Ht.replaceSelection('<a href="'.concat(P.a.API_SERVER,"/api/attachments/").concat(kn.id,"?type=").concat(un.type,'&disposition=inline" target="_blank">').concat(un.name,"</a>")):Ce.includes(ca)?Ht.replaceSelection('<a href="'.concat(P.a.API_SERVER,"/api/attachments/").concat(kn.id,'?type=office&disposition=inline" target="_blank">').concat(un.name,"</a>")):Ht.replaceSelection("[".concat(un.name,"](").concat(P.a.API_SERVER,"/api/attachments/").concat(kn.id,"?type=").concat(kn.content_type,")"))}else(kn==null?void 0:kn.status)===401&&(document.location.href="/user/login")})},dn=0;dn<mn.length;dn++)_n(dn)}}),Bt(Ht),function(){Ht.off("paste",qt)}}},[]);var Sn=Object(A.useCallback)(function(){if(Yi.current)try{}catch(Ht){console.log(Ht,"---- to set md editor body height")}},[ia,Yi,pn]);Object(A.useEffect)(function(){function Ht(){var Jt=new L.default(function(rn){var mn=Object(se.a)(rn),_n;try{for(mn.s();!(_n=mn.n()).done;){var dn=_n.value;(dn.target.offsetHeight>0||dn.target.offsetWidth>0)&&(Sn(),_e.setSize("100%","100%"),_e.refresh())}}catch(Mn){mn.e(Mn)}finally{mn.f()}});return Jt.observe(Zn.current.parentElement),Jt}if(_e){var qt=Ht();return function(){qt.unobserve(Zn.current.parentElement)}}},[_e,Sn]),Object(A.useEffect)(function(){if(_e){for(var Ht=[],qt=function(){var dn=rn[Jt];mn=Object(U.a)(dn,2);var Mn=mn[0],Yn=mn[1],un=Object(k.a)({},Mn,function(){Qi(Yn)});Ht.push(un),_e.addKeyMap(un)},Jt=0,rn=Object.entries(Oe);Jt<rn.length;Jt++){var mn;qt()}return ii.current=setInterval(function(){Si.current&&Sa()},4e3),function(){clearInterval(ii.current);var _n=Object(se.a)(Ht),dn;try{for(_n.s();!(dn=_n.n()).done;){var Mn=dn.value;_e.removeKeyMap(Mn)}}catch(Yn){_n.e(Yn)}finally{_n.f()}}}},[_e]),Object(A.useEffect)(function(){$e!==pn&&Wn($e)},[$e]),Object(Rt.a)(function(){if(!Nt&&ri>0){var Ht=new Date().getTime(),qt=window.sessionStorage.getItem(an);Ht>=ri+Q&&(!qt||qt!==Ye)&&(window.sessionStorage.setItem(an,Ye),ni(!0))}},Q),Object(A.useEffect)(function(){cn(ut)},[_e,ut]),Object(A.useEffect)(function(){_e&&(Fe&&_e.focus())},[_e,Fe]),Object(A.useEffect)(function(){if(Dt&&_e){var Ht=_e.getScrollerElement();function qt(Jt){var rn=Jt.target;if(aa.current){var mn=rn.scrollTop/rn.scrollHeight;aa.current.scrollTop=aa.current.scrollHeight*mn}}return Ht.addEventListener("scroll",qt),function(){Ht.removeEventListener("scroll",qt)}}},[_e,Dt]),Object(A.useEffect)(function(){if(_e&&fn){function Ht(qt,Jt){fn(qt,Jt)}return _e.on("beforeChange",Ht),function(){_e.off("beforeChange",Ht)}}},[_e,fn]),Object(A.useEffect)(function(){if(_e&&st){function Ht(){st(_e.getValue())}return _e.on("blur",Ht),function(){_e.off("blur",Ht)}}},[_e,st]),Object(A.useEffect)(function(){if(_e){function Ht(qt){var Jt=qt.getValue();Ot(Jt),wn(new Date().getTime()),qt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),et&&et(Jt)}return _e.on("change",Ht),function(){_e.off("change",Ht)}}},[_e,et]),Object(A.useEffect)(function(){_e&&(Et==null?(_e.setValue(""),Ot("")):Et!==_e.getValue()&&(_e.setValue(Et),Ot(Et),_e.setCursor(_e.lineCount(),0)))},[_e,Et]);var Qi=Object(A.useCallback)(function(Ht){var qt=_e.getCursor(),Jt=_e.getSelection(),rn=Jt.split(`
`);switch(Ht){case"bold":return _e.replaceSelection("**"+Jt+"**"),Jt===""&&_e.setCursor(qt.line,qt.ch+2),_e.focus();case"italic":return _e.replaceSelection("*"+Jt+"*"),Jt===""&&_e.setCursor(qt.line,qt.ch+1),_e.focus();case"code":return _e.replaceSelection("`"+Jt+"`"),Jt===""&&_e.setCursor(qt.line,qt.ch+1),_e.focus();case"inline-latex":return _e.replaceSelection("`$$"+Jt+"$$`"),Jt===""&&_e.setCursor(qt.line,qt.ch+3),_e.focus();case"latex":return _e.replaceSelection("```latex\n"+Jt+"\n```"),_e.setCursor(qt.line+1,Jt.length+1),_e.focus();case"line-break":return _e.replaceSelection(`<br/>
`),_e.focus();case"list-ul":return Jt===""?_e.replaceSelection("- "+Jt):_e.replaceSelection(rn.map(function(mn){return mn===""?"":"- ".concat(mn)}).join(`
`)),_e.focus();case"list-ol":return Jt===""?_e.replaceSelection("1. "+Jt):_e.replaceSelection(rn.map(function(mn,_n){return mn===""?"":"".concat(_n+1,". ").concat(mn)}).join(`
`)),_e.focus();case"add-null-ch":return Jt===""&&_e.setCursor(qt.line,qt.ch+1),_e.replaceSelection(x),_e.focus();case"inster-template-1":return Jt===""&&_e.setCursor(qt.line,qt.ch),_e.replaceSelection(R),_e.focus();case"eraser":return _e.setValue(""),_e.focus();case"trigger-watch":return cn(!Dt),_e.focus();case"trigger-full-screen":return Wn(!pn),_e.focus();case ct:Fn(ct);return;case xt:Fn(xt);return;case Pt:Fn(Pt);return;case bt:Fn(bt);return;default:throw new Error}},[_e,Dt,pn]),Ti=Object(A.useCallback)(function(Ht){Fn("");switch(xi){case ct:var qt=Ht.title,Jt=Ht.link;return _e.replaceSelection("[".concat(qt,"](").concat(Jt,")")),_e.focus();case xt:var rn=Ht.language,mn=Ht.content;return _e.replaceSelection(["```"+rn,mn,"```"].join(`
`)),_e.focus();case Pt:var _n=Ht.src,dn=Ht.alt,Mn=Ht.name;return _n.indexOf("type=image")>-1?_e.replaceSelection("![ ".concat(dn||""," ]( ").concat(_n,' "').concat(dn||"",'" )')):_n.indexOf("type=application/pdf")>-1?_e.replaceSelection('<a href="'.concat(_n,'&disposition=inline" target="_blank">').concat(Mn,"</a>")):_e.replaceSelection('<a href="'.concat(_n,'" target="_blank">').concat(Mn,"</a>")),_e.focus();case bt:for(var Yn=Ht.row,un=Ht.col,ca=Ht.align,kn=`
`,hi=0;hi<Yn;hi++){for(var Tn=[],zi=[],da=0;da<un;da++)hi===1&&zi.push(Ut[ca]),Tn.push(" ");hi===1&&(kn+="| ".concat(zi.join(" | "),` |
`)),kn+="| ".concat(Tn.join(un===1?"":" | "),` |
`)}return _e.replaceSelection(kn+`
`),_e.focus();default:throw new Error}},[_e,xi]),ua=Object(A.useMemo)(function(){switch(xi){case ct:return M.a.createElement(X,{callback:Ti,onCancel:Pi});case xt:return M.a.createElement(K.b,{callback:Ti,onCancel:Pi});case Pt:return M.a.createElement(Ae,{callback:Ti,onCancel:Pi});case bt:return M.a.createElement(At,{callback:Ti,onCancel:Pi});default:return null}},[xi]);function Pi(){Fn("")}Object(A.useEffect)(function(){if(Ji.current){var Ht=Ji.current,qt=!1,Jt=0;function rn(dn){qt=!0,Jt=dn.pageY}function mn(){qt=!1}function _n(dn){if(qt){var Mn=dn.pageY-Jt;Mn<0&&(Mn=0),Mn>300&&(Mn=300);var Yn=It+Mn+"px";$n(Yn)}}return Ht.addEventListener("mousedown",rn),document.addEventListener("mousemove",_n),document.addEventListener("mouseup",mn),function(){Ht.removeEventListener("mousedown",rn),document.removeEventListener("mousemove",_n),document.removeEventListener("mouseup",mn)}}},[_e,Ji]),Object(A.useEffect)(function(){$n(It)},[It]);var oa=j(tt),ra=j(ia),eo={width:oa,height:ra},to=Object(A.useMemo)(function(){if(ri){var Ht=new Date(ri),qt=Ht.getHours(),Jt=Ht.getMinutes(),rn=Ht.getSeconds();return qt=qt<10?"0"+qt:qt,Jt=Jt<10?"0"+Jt:Jt,rn=rn<10?"0"+rn:rn,"".concat(qt,":").concat(Jt,":").concat(rn)}return 0},[ri]);function To(){window.sessionStorage.removeItem(an),ni(!1),wn(0)}function no(){ni(!1),wn(0),_e.setValue(window.sessionStorage.getItem(an))}function Ia(Ht,qt){var Jt=_e.getValue();Jt=Jt.replace(Ht,qt),Ot(Jt),_e==null||_e.setValue(Jt)}return M.a.createElement(A.Fragment,null,M.a.createElement("div",{className:"markdown-editor-wrapper",ref:Yi},M.a.createElement("div",{className:"markdown-editor-container ".concat(Bn," ").concat(Dt?"on-preview":""," ").concat($t?"mini":""," ").concat(pn?"full-screen":""),style:eo},M.a.createElement(be,{insertTemp:nt,watch:Dt,fullScreen:pn,showNullButton:Xt,onActionCallback:Qi,hidetoolBar:Kn,uuid:An.current,setOpenPhones:function(){Si.current=!0}}),M.a.createElement("div",{className:"markdown-editor-body"},M.a.createElement("div",{className:"codemirror-container"},M.a.createElement("textarea",{ref:Zn,placeholder:u})),Dt?M.a.createElement("div",{ref:aa,className:"preview-container"},Kt==="stex"&&M.a.createElement(g,{value:Ye}),Kt!=="stex"&&M.a.createElement(H.a,{edit:!0,value:Ye,replaces:Ia})):null))),Ct?M.a.createElement("a",{ref:Ji,className:"editor-resize"}):null,M.a.createElement(D.a,null,_t[xi]?M.a.createElement(ve.a,{centered:!0,title:_t[xi],visible:!0,onCancel:Pi,footer:null},ua):null))}},PGNT:function(Qe,Ie,h){Qe.exports={wrap:"wrap___orWmH",modal:"modal___142IN",titleWrap:"titleWrap___2UWGN",required:"required___lXOtq",title:"title___2wqMf",colorGray:"colorGray___3FkLm",choiceWrap:"choiceWrap___3pbic",answer:"answer___30LSv",activeAnswer:"activeAnswer___3ayAN",deleteIcon:"deleteIcon___2HHly",addIcon:"addIcon___29vcx",editorWrap:"editorWrap___ANVP6",htmlWrap:"htmlWrap___38sLf",radio:"radio___15wok",color333:"color333___sNPjh",color999:"color999___1ofkl",fold:"fold___6rnoE",head:"head___2muph"}},PsQE:function(Qe,Ie,h){Qe.exports={flex_box_center:"flex_box_center___2PkN_",flex_space_between:"flex_space_between___36cDA",flex_box_vertical_center:"flex_box_vertical_center___2c88u",flex_box_center_end:"flex_box_center_end___14cXO",flex_box_column:"flex_box_column___3nalt",wrap:"wrap___3xZrs",left:"left___19hOK",title:"title___3Ti2k",total:"total___3MRC5",list:"list___3pdfL",name:"name___2IcTs",b:"b___2W0Sn",r:"r___2Tpj8",l:"l___1rMKQ",tag:"tag___jj2X5",right:"right___16831",examName:"examName___2TmgX",t:"t___1CJZd",num:"num___1qX6C",topWarp:"topWarp___3WuSr",head:"head___3z9Hq",so:"so___m2B6Z",btn:"btn___20VL7",content:"content___2tTuo",titleWrap:"titleWrap___1cYdQ",single:"single___1BKtz",analysis:"analysis___1qm4Y",text:"text___1JQUf",btnsElse:"btnsElse___2IzAs",btnsWrap:"btnsWrap___3ib37",btns:"btns___2DbBT",modalColumn:"modalColumn___1zs36",modalRow:"modalRow___14b2N",sup:"sup___1CIjI",popover:"popover___Mmcvb"}},QSKd:function(Qe,Ie,h){Qe.exports=h.p+"static/wenhao.50b63ac4.svg"},"RZ/O":function(Qe,Ie,h){Qe.exports=h.p+"static/bi.9c9b0364.svg"},SJMd:function(Qe,Ie){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var h,V,ve,se=!1,xe,me;window.PR_SHOULD_USE_CONTINUATION=!0;var re,U;(function(){var k=window,O=["break,continue,do,else,for,if,return,while"],T=[O,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],A=[T,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],M=[A,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],te=[A,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],F=[A,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],L="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",G=[A,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],W="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",ee=[O,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],b=[O,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],fe=[O,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Se=[M,F,te,G,W,ee,b,fe],he=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,H="str",g="kwd",ne="com",S="typ",Y="lit",w="pun",C="pln",J="tag",z="dec",E="src",P="atn",ae="atv",B="nocode",be="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function D(Re){for(var Me=0,Xe=!1,qe=!1,ot=0,Ke=Re.length;ot<Ke;++ot){var Ve=Re[ot];if(Ve.ignoreCase)qe=!0;else if(/[a-z]/i.test(Ve.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Xe=!0,qe=!1;break}}var At={b:8,t:9,n:10,v:11,f:12,r:13};function gt(bt){var Ne=bt.charCodeAt(0);if(Ne!==92)return Ne;var Ut=bt.charAt(1);return Ne=At[Ut],Ne||("0"<=Ut&&Ut<="7"?parseInt(bt.substring(1),8):Ut==="u"||Ut==="x"?parseInt(bt.substring(2),16):bt.charCodeAt(1))}function kt(bt){if(bt<32)return(bt<16?"\\x0":"\\x")+bt.toString(16);var Ne=String.fromCharCode(bt);return Ne==="\\"||Ne==="-"||Ne==="]"||Ne==="^"?"\\"+Ne:Ne}function ct(bt){var Ne=bt.substring(1,bt.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),Ut=[],Rt=Ne[0]==="^",je=["["];Rt&&je.push("^");for(var We=Rt?1:0,$=Ne.length;We<$;++We){var q=Ne[We];if(/\\[bdsw]/i.test(q))je.push(q);else{var Q=gt(q),x;We+2<$&&Ne[We+1]==="-"?(x=gt(Ne[We+2]),We+=2):x=Q,Ut.push([Q,x]),x<65||Q>122||(x<65||Q>90||Ut.push([Math.max(65,Q)|32,Math.min(x,90)|32]),x<97||Q>122||Ut.push([Math.max(97,Q)&~32,Math.min(x,122)&~32]))}}Ut.sort(function(de,Ce){return de[0]-Ce[0]||Ce[1]-de[1]});for(var R=[],j=[],We=0;We<Ut.length;++We){var I=Ut[We];I[0]<=j[1]+1?j[1]=Math.max(j[1],I[1]):R.push(j=I)}for(var We=0;We<R.length;++We){var I=R[We];je.push(kt(I[0])),I[1]>I[0]&&(I[1]+1>I[0]&&je.push("-"),je.push(kt(I[1])))}return je.push("]"),je.join("")}function Pt(bt){for(var Ne=bt.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),Ut=Ne.length,Rt=[],je=0,We=0;je<Ut;++je){var $=Ne[je];if($==="(")++We;else if($.charAt(0)==="\\"){var q=+$.substring(1);q&&(q<=We?Rt[q]=-1:Ne[je]=kt(q))}}for(var je=1;je<Rt.length;++je)Rt[je]===-1&&(Rt[je]=++Me);for(var je=0,We=0;je<Ut;++je){var $=Ne[je];if($==="(")++We,Rt[We]||(Ne[je]="(?:");else if($.charAt(0)==="\\"){var q=+$.substring(1);q&&q<=We&&(Ne[je]="\\"+Rt[q])}}for(var je=0;je<Ut;++je)Ne[je]==="^"&&Ne[je+1]!=="^"&&(Ne[je]="");if(bt.ignoreCase&&Xe)for(var je=0;je<Ut;++je){var $=Ne[je],Q=$.charAt(0);$.length>=2&&Q==="["?Ne[je]=ct($):Q!=="\\"&&(Ne[je]=$.replace(/[a-zA-Z]/g,function(j){var I=j.charCodeAt(0);return"["+String.fromCharCode(I&~32,I|32)+"]"}))}return Ne.join("")}for(var xt=[],ot=0,Ke=Re.length;ot<Ke;++ot){var Ve=Re[ot];if(Ve.global||Ve.multiline)throw new Error(""+Ve);xt.push("(?:"+Pt(Ve)+")")}return new RegExp(xt.join("|"),qe?"gi":"g")}function p(Re,Me){var Xe=/(?:^|\s)nocode(?:\s|$)/,qe=[],ot=0,Ke=[],Ve=0;function At(gt){var kt=gt.nodeType;if(kt==1){if(Xe.test(gt.className))return;for(var ct=gt.firstChild;ct;ct=ct.nextSibling)At(ct);var Pt=gt.nodeName.toLowerCase();(Pt==="br"||Pt==="li")&&(qe[Ve]=`
`,Ke[Ve<<1]=ot++,Ke[Ve++<<1|1]=gt)}else if(kt==3||kt==4){var xt=gt.nodeValue;xt.length&&(Me?xt=xt.replace(/\r\n?/g,`
`):xt=xt.replace(/[ \t\r\n]+/g," "),qe[Ve]=xt,Ke[Ve<<1]=ot,ot+=xt.length,Ke[Ve++<<1|1]=gt)}}return At(Re),{sourceCode:qe.join("").replace(/\n$/,""),spans:Ke}}function ue(Re,Me,Xe,qe,ot){if(!Xe)return;var Ke={sourceNode:Re,pre:1,langExtension:null,numberLines:null,sourceCode:Xe,spans:null,basePos:Me,decorations:null};qe(Ke),ot.push.apply(ot,Ke.decorations)}var Be=/\S/;function Pe(Re){for(var Me=void 0,Xe=Re.firstChild;Xe;Xe=Xe.nextSibling){var qe=Xe.nodeType;Me=qe===1?Me?Re:Xe:qe===3&&Be.test(Xe.nodeValue)?Re:Me}return Me===Re?void 0:Me}function ze(Re,Me){var Xe={},qe;(function(){for(var Ve=Re.concat(Me),At=[],gt={},kt=0,ct=Ve.length;kt<ct;++kt){var Pt=Ve[kt],xt=Pt[3];if(xt)for(var bt=xt.length;--bt>=0;)Xe[xt.charAt(bt)]=Pt;var Ne=Pt[1],Ut=""+Ne;gt.hasOwnProperty(Ut)||(At.push(Ne),gt[Ut]=null)}At.push(/[\0-\uffff]/),qe=D(At)})();var ot=Me.length,Ke=function(Ve){for(var At=Ve.sourceCode,gt=Ve.basePos,kt=Ve.sourceNode,ct=[gt,C],Pt=0,xt=At.match(qe)||[],bt={},Ne=0,Ut=xt.length;Ne<Ut;++Ne){var Rt=xt[Ne],je=bt[Rt],We=void 0,$;if(typeof je=="string")$=!1;else{var q=Xe[Rt.charAt(0)];if(q)We=Rt.match(q[1]),je=q[0];else{for(var Q=0;Q<ot;++Q)if(q=Me[Q],We=Rt.match(q[1]),We){je=q[0];break}We||(je=C)}$=je.length>=5&&je.substring(0,5)==="lang-",$&&!(We&&typeof We[1]=="string")&&($=!1,je=E),$||(bt[Rt]=je)}var x=Pt;if(Pt+=Rt.length,!$)ct.push(gt+x,je);else{var R=We[1],j=Rt.indexOf(R),I=j+R.length;We[2]&&(I=Rt.length-We[2].length,j=I-R.length);var de=je.substring(5);ue(kt,gt+x,Rt.substring(0,j),Ke,ct),ue(kt,gt+x+j,R,_(de,R),ct),ue(kt,gt+x+I,Rt.substring(I),Ke,ct)}}Ve.decorations=ct};return Ke}function Te(Re){var Me=[],Xe=[];Re.tripleQuotedStrings?Me.push([H,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Re.multiLineStrings?Me.push([H,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Me.push([H,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Re.verbatimStrings&&Xe.push([H,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var qe=Re.hashComments;qe&&(Re.cStyleComments?(qe>1?Me.push([ne,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Me.push([ne,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Xe.push([H,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Me.push([ne,/^#[^\r\n]*/,null,"#"])),Re.cStyleComments&&(Xe.push([ne,/^\/\/[^\r\n]*/,null]),Xe.push([ne,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ot=Re.regexLiterals;if(ot){var Ke=ot>1?"":`
\r`,Ve=Ke?".":"[\\S\\s]",At="/(?=[^/*"+Ke+"])(?:[^/\\x5B\\x5C"+Ke+"]|\\x5C"+Ve+"|\\x5B(?:[^\\x5C\\x5D"+Ke+"]|\\x5C"+Ve+")*(?:\\x5D|$))+/";Xe.push(["lang-regex",RegExp("^"+be+"("+At+")")])}var gt=Re.types;gt&&Xe.push([S,gt]);var kt=(""+Re.keywords).replace(/^ | $/g,"");kt.length&&Xe.push([g,new RegExp("^(?:"+kt.replace(/[\s,]+/g,"|")+")\\b"),null]),Me.push([C,/^\s+/,null,` \r
\xA0`]);var ct="^.[^\\s\\w.$@'\"`/\\\\]*";return Re.regexLiterals&&(ct+="(?!s*/)"),Xe.push([Y,/^@[a-z_$][a-z_$@0-9]*/i,null],[S,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[C,/^[a-z_$][a-z_$@0-9]*/i,null],[Y,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[C,/^\\[\s\S]?/,null],[w,new RegExp(ct),null]),ze(Me,Xe)}var we=Te({keywords:Se,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function X(Re,Me,Xe){for(var qe=/(?:^|\s)nocode(?:\s|$)/,ot=/\r\n?|\n/,Ke=Re.ownerDocument,Ve=Ke.createElement("li");Re.firstChild;)Ve.appendChild(Re.firstChild);var At=[Ve];function gt(Ne){var Ut=Ne.nodeType;if(Ut==1&&!qe.test(Ne.className))if(Ne.nodeName==="br")kt(Ne),Ne.parentNode&&Ne.parentNode.removeChild(Ne);else for(var Rt=Ne.firstChild;Rt;Rt=Rt.nextSibling)gt(Rt);else if((Ut==3||Ut==4)&&Xe){var je=Ne.nodeValue,We=je.match(ot);if(We){var $=je.substring(0,We.index);Ne.nodeValue=$;var q=je.substring(We.index+We[0].length);if(q){var Q=Ne.parentNode;Q.insertBefore(Ke.createTextNode(q),Ne.nextSibling)}kt(Ne),$||Ne.parentNode.removeChild(Ne)}}}function kt(Ne){for(;!Ne.nextSibling;)if(Ne=Ne.parentNode,!Ne)return;function Ut(We,$){var q=$?We.cloneNode(!1):We,Q=We.parentNode;if(Q){var x=Ut(Q,1),R=We.nextSibling;x.appendChild(q);for(var j=R;j;j=R)R=j.nextSibling,x.appendChild(j)}return q}for(var Rt=Ut(Ne.nextSibling,0),je;(je=Rt.parentNode)&&je.nodeType===1;)Rt=je;At.push(Rt)}for(var ct=0;ct<At.length;++ct)gt(At[ct]);Me===(Me|0)&&At[0].setAttribute("value",Me);var Pt=Ke.createElement("ol");Pt.className="linenums";for(var xt=Math.max(0,Me-1|0)||0,ct=0,bt=At.length;ct<bt;++ct)Ve=At[ct],Ve.className="L"+(ct+xt)%10,Ve.firstChild||Ve.appendChild(Ke.createTextNode("\xA0")),Pt.appendChild(Ve);Re.appendChild(Pt)}function K(Re){var Me=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Me=Me&&+Me[1]<=8;var Xe=/\n/g,qe=Re.sourceCode,ot=qe.length,Ke=0,Ve=Re.spans,At=Ve.length,gt=0,kt=Re.decorations,ct=kt.length,Pt=0;kt[ct]=ot;var xt,bt;for(bt=xt=0;bt<ct;)kt[bt]!==kt[bt+2]?(kt[xt++]=kt[bt++],kt[xt++]=kt[bt++]):bt+=2;for(ct=xt,bt=xt=0;bt<ct;){for(var Ne=kt[bt],Ut=kt[bt+1],Rt=bt+2;Rt+2<=ct&&kt[Rt+1]===Ut;)Rt+=2;kt[xt++]=Ne,kt[xt++]=Ut,bt=Rt}ct=kt.length=xt;var je=Re.sourceNode,We="";je&&(We=je.style.display,je.style.display="none");try{for(var $=null;gt<At;){var q=Ve[gt],Q=Ve[gt+2]||ot,x=kt[Pt+2]||ot,Rt=Math.min(Q,x),R=Ve[gt+1],j;if(R.nodeType!==1&&(j=qe.substring(Ke,Rt))){Me&&(j=j.replace(Xe,"\r")),R.nodeValue=j;var I=R.ownerDocument,de=I.createElement("span");de.className=kt[Pt+1];var Ce=R.parentNode;Ce.replaceChild(de,R),de.appendChild(R),Ke<Q&&(Ve[gt+1]=R=I.createTextNode(qe.substring(Rt,Q)),Ce.insertBefore(R,de.nextSibling))}Ke=Rt,Ke>=Q&&(gt+=2),Ke>=x&&(Pt+=2)}}finally{je&&(je.style.display=We)}}var le={};function N(Re,Me){for(var Xe=Me.length;--Xe>=0;){var qe=Me[Xe];le.hasOwnProperty(qe)?k.console&&console.warn("cannot override language handler %s",qe):le[qe]=Re}}function _(Re,Me){return Re&&le.hasOwnProperty(Re)||(Re=/^\s*</.test(Me)?"default-markup":"default-code"),le[Re]}N(we,["default-code"]),N(ze([],[[C,/^[^<?]+/],[z,/^<!\w[^>]*(?:>|$)/],[ne,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[w,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),N(ze([[C,/^[\s]+/,null,` \r
`],[ae,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[J,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[w,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),N(ze([],[[ae,/^[\s\S]+/]]),["uq.val"]),N(Te({keywords:M,hashComments:!0,cStyleComments:!0,types:he}),["c","cc","cpp","cxx","cyc","m"]),N(Te({keywords:"null,true,false"}),["json"]),N(Te({keywords:F,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:he}),["cs"]),N(Te({keywords:te,cStyleComments:!0}),["java"]),N(Te({keywords:fe,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),N(Te({keywords:ee,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),N(Te({keywords:W,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),N(Te({keywords:b,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),N(Te({keywords:G,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),N(Te({keywords:L,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),N(ze([],[[H,/^[\s\S]+/]]),["regex"]);function pe(Re){var Me=Re.langExtension;try{var Xe=p(Re.sourceNode,Re.pre),qe=Xe.sourceCode;Re.sourceCode=qe,Re.spans=Xe.spans,Re.basePos=0,_(Me,qe)(Re),K(Re)}catch(ot){k.console&&console.log(ot&&ot.stack||ot)}}function Ue(Re,Me,Xe){var qe=Xe||!1,ot=Me||null,Ke=document.createElement("div");Ke.innerHTML="<pre>"+Re+"</pre>",Ke=Ke.firstChild,qe&&X(Ke,qe,!0);var Ve={langExtension:ot,numberLines:qe,sourceNode:Ke,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return pe(Ve),Ke.innerHTML}function Ze(Re,Me){var Xe=Me||document.body,qe=Xe.ownerDocument||document;function ot(q){return Xe.getElementsByTagName(q)}for(var Ke=[ot("pre"),ot("code"),ot("xmp")],Ve=[],At=0;At<Ke.length;++At)for(var gt=0,kt=Ke[At].length;gt<kt;++gt)Ve.push(Ke[At][gt]);Ke=null;var ct=Date;ct.now||(ct={now:function(){return+new Date}});var Pt=0,xt=/\blang(?:uage)?-([\w.]+)(?!\S)/,bt=/\bprettyprint\b/,Ne=/\bprettyprinted\b/,Ut=/pre|xmp/i,Rt=/^code$/i,je=/^(?:pre|code|xmp)$/i,We={};function $(){for(var q=k.PR_SHOULD_USE_CONTINUATION?ct.now()+250:Infinity;Pt<Ve.length&&ct.now()<q;Pt++){for(var Q=Ve[Pt],x=We,R=Q;R=R.previousSibling;){var j=R.nodeType,I=(j===7||j===8)&&R.nodeValue;if(I?!/^\??prettify\b/.test(I):j!==3||/\S/.test(R.nodeValue))break;if(I){x={},I.replace(/\b(\w+)=([\w:.%+-]+)/g,function(It,vt,$t){x[vt]=$t});break}}var de=Q.className;if((x!==We||bt.test(de))&&!Ne.test(de)){for(var Ce=!1,Oe=Q.parentNode;Oe;Oe=Oe.parentNode){var _t=Oe.tagName;if(je.test(_t)&&Oe.className&&bt.test(Oe.className)){Ce=!0;break}}if(!Ce){Q.className+=" prettyprinted";var at=x.lang;if(!at){at=de.match(xt);var ge;!at&&(ge=Pe(Q))&&Rt.test(ge.tagName)&&(at=ge.className.match(xt)),at&&(at=at[1])}var lt;if(Ut.test(Q.tagName))lt=1;else{var Et=Q.currentStyle,et=qe.defaultView,Ft=Et?Et.whiteSpace:et&&et.getComputedStyle?et.getComputedStyle(Q,null).getPropertyValue("white-space"):0;lt=Ft&&Ft.substring(0,3)==="pre"}var tt=x.linenums;(tt=tt==="true"||+tt)||(tt=de.match(/\blinenums\b(?::(\d+))?/),tt=tt?tt[1]&&tt[1].length?+tt[1]:!0:!1),tt&&X(Q,tt,lt);var zt={langExtension:at,sourceNode:Q,numberLines:tt,pre:lt,sourceCode:null,basePos:null,spans:null,decorations:null};pe(zt)}}}Pt<Ve.length?k.setTimeout($,250):typeof Re=="function"&&Re()}$()}var Ae=k.PR={createSimpleLexer:ze,registerLangHandler:N,sourceDecorator:Te,PR_ATTRIB_NAME:P,PR_ATTRIB_VALUE:ae,PR_COMMENT:ne,PR_DECLARATION:z,PR_KEYWORD:g,PR_LITERAL:Y,PR_NOCODE:B,PR_PLAIN:C,PR_PUNCTUATION:w,PR_SOURCE:E,PR_STRING:H,PR_TAG:J,PR_TYPE:S,prettyPrintOne:se?k.prettyPrintOne=Ue:re=Ue,prettyPrint:U=se?k.prettyPrint=Ze:U=Ze},De=k.define;typeof De=="function"&&De.amd&&De("google-code-prettify",[],function(){return Ae})})()},"VrN/":function(Qe,Ie,h){(function(V,ve){Qe.exports=ve()})(this,function(){"use strict";var V=navigator.userAgent,ve=navigator.platform,se=/gecko\/\d/i.test(V),xe=/MSIE \d/.test(V),me=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(V),re=/Edge\/(\d+)/.exec(V),U=xe||me||re,k=U&&(xe?document.documentMode||6:+(re||me)[1]),O=!re&&/WebKit\//.test(V),T=O&&/Qt\/\d+\.\d+/.test(V),A=!re&&/Chrome\//.test(V),M=/Opera\//.test(V),te=/Apple Computer/.test(navigator.vendor),F=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(V),L=/PhantomJS/.test(V),G=!re&&/AppleWebKit/.test(V)&&/Mobile\/\w+/.test(V),W=/Android/.test(V),ee=G||W||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(V),b=G||/Mac/.test(ve),fe=/\bCrOS\b/.test(V),Se=/win/i.test(ve),he=M&&V.match(/Version\/(\d*\.\d*)/);he&&(he=Number(he[1])),he&&he>=15&&(M=!1,O=!0);var H=b&&(T||M&&(he==null||he<12.11)),g=se||U&&k>=9;function ne(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var S=function(e,t){var i=e.className,n=ne(t).exec(i);if(n){var a=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(a?n[1]+a:"")}};function Y(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function w(e,t){return Y(e).appendChild(t)}function C(e,t,i,n){var a=document.createElement(e);if(i&&(a.className=i),n&&(a.style.cssText=n),typeof t=="string")a.appendChild(document.createTextNode(t));else if(t)for(var s=0;s<t.length;++s)a.appendChild(t[s]);return a}function J(e,t,i,n){var a=C(e,t,i,n);return a.setAttribute("role","presentation"),a}var z;document.createRange?z=function(e,t,i,n){var a=document.createRange();return a.setEnd(n||e,i),a.setStart(e,t),a}:z=function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(a){return n}return n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",t),n};function E(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function P(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function ae(e,t){var i=e.className;ne(t).test(i)||(e.className+=(i?" ":"")+t)}function B(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!ne(i[n]).test(t)&&(t+=" "+i[n]);return t}var be=function(e){e.select()};G?be=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:U&&(be=function(e){try{e.select()}catch(t){}});function D(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function p(e,t,i){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(i!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function ue(e,t,i,n,a){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var s=n||0,l=a||0;;){var f=e.indexOf(" ",s);if(f<0||f>=t)return l+(t-s);l+=f-s,l+=i-l%i,s=f+1}}var Be=function(){this.id=null,this.f=null,this.time=0,this.handler=D(this.onTimeout,this)};Be.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Be.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function Pe(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var ze=50,Te={toString:function(){return"CodeMirror.Pass"}},we={scroll:!1},X={origin:"*mouse"},K={origin:"+move"};function le(e,t,i){for(var n=0,a=0;;){var s=e.indexOf(" ",n);s==-1&&(s=e.length);var l=s-n;if(s==e.length||a+l>=t)return n+Math.min(l,t-a);if(a+=s-n,a+=i-a%i,n=s+1,a>=t)return n}}var N=[""];function _(e){for(;N.length<=e;)N.push(pe(N)+" ");return N[e]}function pe(e){return e[e.length-1]}function Ue(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function Ze(e,t,i){for(var n=0,a=i(t);n<e.length&&i(e[n])<=a;)n++;e.splice(n,0,t)}function Ae(){}function De(e,t){var i;return Object.create?i=Object.create(e):(Ae.prototype=e,i=new Ae),t&&p(t,i),i}var Re=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Me(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Re.test(e))}function Xe(e,t){return t?t.source.indexOf("\\w")>-1&&Me(e)?!0:t.test(e):Me(e)}function qe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ot=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Ke(e){return e.charCodeAt(0)>=768&&ot.test(e)}function Ve(e,t,i){for(;(i<0?t>0:t<e.length)&&Ke(e.charAt(t));)t+=i;return t}function At(e,t,i){for(var n=t>i?-1:1;;){if(t==i)return t;var a=(t+i)/2,s=n<0?Math.ceil(a):Math.floor(a);if(s==t)return e(s)?t:i;e(s)?i=s:t=s+n}}function gt(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var a=!1,s=0;s<e.length;++s){var l=e[s];(l.from<i&&l.to>t||t==i&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,i),l.level==1?"rtl":"ltr",s),a=!0)}a||n(t,i,"ltr")}var kt=null;function ct(e,t,i){var n;kt=null;for(var a=0;a<e.length;++a){var s=e[a];if(s.from<t&&s.to>t)return a;s.to==t&&(s.from!=s.to&&i=="before"?n=a:kt=a),s.from==t&&(s.from!=s.to&&i!="before"?n=a:kt=a)}return n!=null?n:kt}var Pt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(y){return y<=247?e.charAt(y):1424<=y&&y<=1524?"R":1536<=y&&y<=1785?t.charAt(y-1536):1774<=y&&y<=2220?"r":8192<=y&&y<=8203?"w":y==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,a=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,f=/[1n]/;function m(y,Z,ie){this.level=y,this.from=Z,this.to=ie}return function(y,Z){var ie=Z=="ltr"?"L":"R";if(y.length==0||Z=="ltr"&&!n.test(y))return!1;for(var ke=y.length,ye=[],Ge=0;Ge<ke;++Ge)ye.push(i(y.charCodeAt(Ge)));for(var it=0,ht=ie;it<ke;++it){var wt=ye[it];wt=="m"?ye[it]=ht:ht=wt}for(var jt=0,St=ie;jt<ke;++jt){var Wt=ye[jt];Wt=="1"&&St=="r"?ye[jt]="n":s.test(Wt)&&(St=Wt,Wt=="r"&&(ye[jt]="R"))}for(var Zt=1,Yt=ye[0];Zt<ke-1;++Zt){var sn=ye[Zt];sn=="+"&&Yt=="1"&&ye[Zt+1]=="1"?ye[Zt]="1":sn==","&&Yt==ye[Zt+1]&&(Yt=="1"||Yt=="n")&&(ye[Zt]=Yt),Yt=sn}for(var In=0;In<ke;++In){var Ei=ye[In];if(Ei==",")ye[In]="N";else if(Ei=="%"){var Qn=void 0;for(Qn=In+1;Qn<ke&&ye[Qn]=="%";++Qn);for(var Vi=In&&ye[In-1]=="!"||Qn<ke&&ye[Qn]=="1"?"1":"N",Bi=In;Bi<Qn;++Bi)ye[Bi]=Vi;In=Qn-1}}for(var ui=0,Fi=ie;ui<ke;++ui){var wi=ye[ui];Fi=="L"&&wi=="1"?ye[ui]="L":s.test(wi)&&(Fi=wi)}for(var fi=0;fi<ke;++fi)if(a.test(ye[fi])){var ci=void 0;for(ci=fi+1;ci<ke&&a.test(ye[ci]);++ci);for(var ei=(fi?ye[fi-1]:ie)=="L",Wi=(ci<ke?ye[ci]:ie)=="L",Za=ei==Wi?ei?"L":"R":ie,wa=fi;wa<ci;++wa)ye[wa]=Za;fi=ci-1}for(var Oi=[],sa,Ci=0;Ci<ke;)if(l.test(ye[Ci])){var Rr=Ci;for(++Ci;Ci<ke&&l.test(ye[Ci]);++Ci);Oi.push(new m(0,Rr,Ci))}else{var pa=Ci,ja=Oi.length,Ua=Z=="rtl"?1:0;for(++Ci;Ci<ke&&ye[Ci]!="L";++Ci);for(var Ni=pa;Ni<Ci;)if(f.test(ye[Ni])){pa<Ni&&(Oi.splice(ja,0,new m(1,pa,Ni)),ja+=Ua);var qa=Ni;for(++Ni;Ni<Ci&&f.test(ye[Ni]);++Ni);Oi.splice(ja,0,new m(2,qa,Ni)),ja+=Ua,pa=Ni}else++Ni;pa<Ci&&Oi.splice(ja,0,new m(1,pa,Ci))}return Z=="ltr"&&(Oi[0].level==1&&(sa=y.match(/^\s+/))&&(Oi[0].from=sa[0].length,Oi.unshift(new m(0,0,sa[0].length))),pe(Oi).level==1&&(sa=y.match(/\s+$/))&&(pe(Oi).to-=sa[0].length,Oi.push(new m(0,ke-sa[0].length,ke)))),Z=="rtl"?Oi.reverse():Oi}}();function xt(e,t){var i=e.order;return i==null&&(i=e.order=Pt(e.text,t)),i}var bt=[],Ne=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||bt).concat(i)}};function Ut(e,t){return e._handlers&&e._handlers[t]||bt}function Rt(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers,a=n&&n[t];if(a){var s=Pe(a,i);s>-1&&(n[t]=a.slice(0,s).concat(a.slice(s+1)))}}}function je(e,t){var i=Ut(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),a=0;a<i.length;++a)i[a].apply(null,n)}function We(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),je(e,i||t.type,e,t),j(t)||t.codemirrorIgnore}function $(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)Pe(i,t[n])==-1&&i.push(t[n])}function q(e,t){return Ut(e,t).length>0}function Q(e){e.prototype.on=function(t,i){Ne(this,t,i)},e.prototype.off=function(t,i){Rt(this,t,i)}}function x(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function R(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function j(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function I(e){x(e),R(e)}function de(e){return e.target||e.srcElement}function Ce(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),b&&e.ctrlKey&&t==1&&(t=3),t}var Oe=function(){if(U&&k<9)return!1;var e=C("div");return"draggable"in e||"dragDrop"in e}(),_t;function at(e){if(_t==null){var t=C("span","\u200B");w(e,C("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(_t=t.offsetWidth<=1&&t.offsetHeight>2&&!(U&&k<8))}var i=_t?C("span","\u200B"):C("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var ge;function lt(e){if(ge!=null)return ge;var t=w(e,document.createTextNode("A\u062EA")),i=z(t,0,1).getBoundingClientRect(),n=z(t,1,2).getBoundingClientRect();return Y(e),!i||i.left==i.right?!1:ge=n.right-i.right<3}var Et=`
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var a=e.indexOf(`
`,t);a==-1&&(a=e.length);var s=e.slice(t,e.charAt(a-1)=="\r"?a-1:a),l=s.indexOf("\r");l!=-1?(i.push(s.slice(0,l)),t+=l+1):(i.push(s),t=a+1)}return i}:function(e){return e.split(/\r\n?|\n/)},et=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ft=function(){var e=C("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),tt=null;function zt(e){if(tt!=null)return tt;var t=w(e,C("span","x")),i=t.getBoundingClientRect(),n=z(t,0,1).getBoundingClientRect();return tt=Math.abs(i.left-n.left)>1}var It={},vt={};function $t(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),It[e]=t}function Lt(e,t){vt[e]=t}function Fe(e){if(typeof e=="string"&&vt.hasOwnProperty(e))e=vt[e];else if(e&&typeof e.name=="string"&&vt.hasOwnProperty(e.name)){var t=vt[e.name];typeof t=="string"&&(t={name:t}),e=De(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Fe("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Fe("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function ut(e,t){t=Fe(t);var i=It[t.name];if(!i)return ut(e,"text/plain");var n=i(e,t);if(nt.hasOwnProperty(t.name)){var a=nt[t.name];for(var s in a){if(!a.hasOwnProperty(s))continue;n.hasOwnProperty(s)&&(n["_"+s]=n[s]),n[s]=a[s]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}var nt={};function dt(e,t){var i=nt.hasOwnProperty(e)?nt[e]:nt[e]={};p(t,i)}function Kt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var a=t[n];a instanceof Array&&(a=a.concat([])),i[n]=a}return i}function Vt(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function an(e,t,i){return e.startState?e.startState(t,i):!0}var Gt=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};Gt.prototype.eol=function(){return this.pos>=this.string.length},Gt.prototype.sol=function(){return this.pos==this.lineStart},Gt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Gt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Gt.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},Gt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Gt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Gt.prototype.skipToEnd=function(){this.pos=this.string.length},Gt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Gt.prototype.backUp=function(e){this.pos-=e},Gt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=ue(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?ue(this.string,this.lineStart,this.tabSize):0)},Gt.prototype.indentation=function(){return ue(this.string,null,this.tabSize)-(this.lineStart?ue(this.string,this.lineStart,this.tabSize):0)},Gt.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(l){return i?l.toLowerCase():l},a=this.string.substr(this.pos,e.length);if(n(a)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}},Gt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Gt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Gt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Gt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Ct(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var n=0;;++n){var a=i.children[n],s=a.chunkSize();if(t<s){i=a;break}t-=s}return i.lines[t]}function tn(e,t,i){var n=[],a=t.line;return e.iter(t.line,i.line+1,function(s){var l=s.text;a==i.line&&(l=l.slice(0,i.ch)),a==t.line&&(l=l.slice(t.ch)),n.push(l),++a}),n}function Nt(e,t,i){var n=[];return e.iter(t,i,function(a){n.push(a.text)}),n}function ln(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function Xt(e){if(e.parent==null)return null;for(var t=e.parent,i=Pe(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var a=0;!(n.children[a]==t);++a)i+=n.children[a].chunkSize();return i+t.first}function hn(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var a=e.children[n],s=a.height;if(t<s){e=a;continue e}t-=s,i+=a.chunkSize()}return i}while(!e.lines);for(var l=0;l<e.lines.length;++l){var f=e.lines[l],m=f.height;if(t<m)break;t-=m}return i+l}function Kn(e,t){return t>=e.first&&t<e.first+e.size}function nn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function $e(e,t,i){if(i===void 0&&(i=null),!(this instanceof $e))return new $e(e,t,i);this.line=e,this.ch=t,this.sticky=i}function st(e,t){return e.line-t.line||e.ch-t.ch}function fn(e,t){return e.sticky==t.sticky&&st(e,t)==0}function gn(e){return $e(e.line,e.ch)}function On(e,t){return st(e,t)<0?t:e}function Bn(e,t){return st(e,t)<0?e:t}function d(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function o(e,t){if(t.line<e.first)return $e(e.first,0);var i=e.first+e.size-1;return t.line>i?$e(i,Ct(e,i).text.length):r(t,Ct(e,t.line).text.length)}function r(e,t){var i=e.ch;return i==null||i>t?$e(e.line,t):i<0?$e(e.line,0):e}function u(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=o(e,t[n]);return i}var v=function(e,t){this.state=e,this.lookAhead=t},c=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};c.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},c.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},c.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},c.fromSaved=function(e,t,i){return t instanceof v?new c(e,Kt(e.mode,t.state),i,t.lookAhead):new c(e,Kt(e.mode,t),i)},c.prototype.save=function(e){var t=e!==!1?Kt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new v(t,this.maxLookAhead):t};function oe(e,t,i,n){var a=[e.state.modeGen],s={};Tt(e,t.text,e.doc.mode,i,function(y,Z){return a.push(y,Z)},s,n);for(var l=i.state,f=function(y){i.baseTokens=a;var Z=e.state.overlays[y],ie=1,ke=0;i.state=!0,Tt(e,t.text,Z.mode,i,function(ye,Ge){for(var it=ie;ke<ye;){var ht=a[ie];ht>ye&&a.splice(ie,1,ye,a[ie+1],ht),ie+=2,ke=Math.min(ye,ht)}if(!Ge)return;if(Z.opaque)a.splice(it,ie-it,ye,"overlay "+Ge),ie=it+2;else for(;it<ie;it+=2){var wt=a[it+1];a[it+1]=(wt?wt+" ":"")+"overlay "+Ge}},s),i.state=l,i.baseTokens=null,i.baseTokenPos=1},m=0;m<e.state.overlays.length;++m)f(m);return{styles:a,classes:s.bgClass||s.textClass?s:null}}function Je(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=_e(e,Xt(t)),a=t.text.length>e.options.maxHighlightLength&&Kt(e.doc.mode,n.state),s=oe(e,t,n);a&&(n.state=a),t.stateAfter=n.save(!a),t.styles=s.styles,s.classes?t.styleClasses=s.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function _e(e,t,i){var n=e.doc,a=e.display;if(!n.mode.startState)return new c(n,!0,t);var s=Dt(e,t,i),l=s>n.first&&Ct(n,s-1).stateAfter,f=l?c.fromSaved(n,l,s):new c(n,an(n.mode),s);return n.iter(s,t,function(m){Bt(e,m.text,f);var y=f.line;m.stateAfter=y==t-1||y%5==0||y>=a.viewFrom&&y<a.viewTo?f.save():null,f.nextLine()}),i&&(n.modeFrontier=f.line),f}function Bt(e,t,i,n){var a=e.doc.mode,s=new Gt(t,e.options.tabSize,i);for(s.start=s.pos=n||0,t==""&&Ee(a,i.state);!s.eol();)ce(a,s,i.state),s.start=s.pos}function Ee(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=Vt(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function ce(e,t,i,n){for(var a=0;a<10;a++){n&&(n[0]=Vt(e,i).mode);var s=e.token(t,i);if(t.pos>t.start)return s}throw new Error("Mode "+e.name+" failed to advance stream.")}var Ye=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Ot(e,t,i,n){var a=e.doc,s=a.mode,l;t=o(a,t);var f=Ct(a,t.line),m=_e(e,t.line,i),y=new Gt(f.text,e.options.tabSize,m),Z;for(n&&(Z=[]);(n||y.pos<t.ch)&&!y.eol();)y.start=y.pos,l=ce(s,y,m.state),n&&Z.push(new Ye(y,l,Kt(a.mode,m.state)));return n?Z:new Ye(y,l,m.state)}function Mt(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var n=i[1]?"bgClass":"textClass";t[n]==null?t[n]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+i[2])}return e}function Tt(e,t,i,n,a,s,l){var f=i.flattenSpans;f==null&&(f=e.options.flattenSpans);var m=0,y=null,Z=new Gt(t,e.options.tabSize,n),ie,ke=e.options.addModeClass&&[null];for(t==""&&Mt(Ee(i,n.state),s);!Z.eol();){if(Z.pos>e.options.maxHighlightLength?(f=!1,l&&Bt(e,t,n,Z.pos),Z.pos=t.length,ie=null):ie=Mt(ce(i,Z,n.state,ke),s),ke){var ye=ke[0].name;ye&&(ie="m-"+(ie?ye+" "+ie:ye))}if(!f||y!=ie){for(;m<Z.start;)m=Math.min(Z.start,m+5e3),a(m,y);y=ie}Z.start=Z.pos}for(;m<Z.pos;){var Ge=Math.min(Z.pos,m+5e3);a(Ge,y),m=Ge}}function Dt(e,t,i){for(var n,a,s=e.doc,l=i?-1:t-(e.doc.mode.innerMode?1e3:100),f=t;f>l;--f){if(f<=s.first)return s.first;var m=Ct(s,f-1),y=m.stateAfter;if(y&&(!i||f+(y instanceof v?y.lookAhead:0)<=s.modeFrontier))return f;var Z=ue(m.text,null,e.options.tabSize);(a==null||n>Z)&&(a=f-1,n=Z)}return a}function cn(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,n=t-1;n>i;n--){var a=Ct(e,n).stateAfter;if(a&&(!(a instanceof v)||n+a.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Nn=!1,Cn=!1;function pn(){Nn=!0}function Wn(){Cn=!0}function jn(e,t,i){this.marker=e,this.from=t,this.to=i}function ti(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function xi(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function Fn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Xn(e,t,i){var n;if(e)for(var a=0;a<e.length;++a){var s=e[a],l=s.marker,f=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);if(f||s.from==t&&l.type=="bookmark"&&(!i||!s.marker.insertLeft)){var m=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);(n||(n=[])).push(new jn(l,s.from,m?null:s.to))}}return n}function $i(e,t,i){var n;if(e)for(var a=0;a<e.length;++a){var s=e[a],l=s.marker,f=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);if(f||s.from==t&&l.type=="bookmark"&&(!i||s.marker.insertLeft)){var m=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);(n||(n=[])).push(new jn(l,m?null:s.from-t,s.to==null?null:s.to-t))}}return n}function ri(e,t){if(t.full)return null;var i=Kn(e,t.from.line)&&Ct(e,t.from.line).markedSpans,n=Kn(e,t.to.line)&&Ct(e,t.to.line).markedSpans;if(!i&&!n)return null;var a=t.from.ch,s=t.to.ch,l=st(t.from,t.to)==0,f=Xn(i,a,l),m=$i(n,s,l),y=t.text.length==1,Z=pe(t.text).length+(y?a:0);if(f)for(var ie=0;ie<f.length;++ie){var ke=f[ie];if(ke.to==null){var ye=ti(m,ke.marker);ye?y&&(ke.to=ye.to==null?null:ye.to+Z):ke.to=a}}if(m)for(var Ge=0;Ge<m.length;++Ge){var it=m[Ge];if(it.to!=null&&(it.to+=Z),it.from==null){var ht=ti(f,it.marker);ht||(it.from=Z,y&&(f||(f=[])).push(it))}else it.from+=Z,y&&(f||(f=[])).push(it)}f&&(f=wn(f)),m&&m!=f&&(m=wn(m));var wt=[f];if(!y){var jt=t.text.length-2,St;if(jt>0&&f)for(var Wt=0;Wt<f.length;++Wt)f[Wt].to==null&&(St||(St=[])).push(new jn(f[Wt].marker,null,null));for(var Zt=0;Zt<jt;++Zt)wt.push(St);wt.push(m)}return wt}function wn(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Hi(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(ye){if(ye.markedSpans)for(var Ge=0;Ge<ye.markedSpans.length;++Ge){var it=ye.markedSpans[Ge].marker;it.readOnly&&(!n||Pe(n,it)==-1)&&(n||(n=[])).push(it)}}),!n)return null;for(var a=[{from:t,to:i}],s=0;s<n.length;++s)for(var l=n[s],f=l.find(0),m=0;m<a.length;++m){var y=a[m];if(st(y.to,f.from)<0||st(y.from,f.to)>0)continue;var Z=[m,1],ie=st(y.from,f.from),ke=st(y.to,f.to);(ie<0||!l.inclusiveLeft&&!ie)&&Z.push({from:y.from,to:f.from}),(ke>0||!l.inclusiveRight&&!ke)&&Z.push({from:f.to,to:y.to}),a.splice.apply(a,Z),m+=Z.length-3}return a}function la(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function ia(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function $n(e){return e.inclusiveLeft?-1:0}function yn(e){return e.inclusiveRight?1:0}function di(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),a=t.find(),s=st(n.from,a.from)||$n(e)-$n(t);if(s)return-s;var l=st(n.to,a.to)||yn(e)-yn(t);return l||t.id-e.id}function vn(e,t){var i=Cn&&e.markedSpans,n;if(i)for(var a=void 0,s=0;s<i.length;++s)a=i[s],a.marker.collapsed&&(t?a.from:a.to)==null&&(!n||di(n,a.marker)<0)&&(n=a.marker);return n}function ni(e){return vn(e,!0)}function An(e){return vn(e,!1)}function Si(e,t){var i=Cn&&e.markedSpans,n;if(i)for(var a=0;a<i.length;++a){var s=i[a];s.marker.collapsed&&(s.from==null||s.from<t)&&(s.to==null||s.to>t)&&(!n||di(n,s.marker)<0)&&(n=s.marker)}return n}function ii(e,t,i,n,a){var s=Ct(e,t),l=Cn&&s.markedSpans;if(l)for(var f=0;f<l.length;++f){var m=l[f];if(!m.marker.collapsed)continue;var y=m.marker.find(0),Z=st(y.from,i)||$n(m.marker)-$n(a),ie=st(y.to,n)||yn(m.marker)-yn(a);if(Z>=0&&ie<=0||Z<=0&&ie>=0)continue;if(Z<=0&&(m.marker.inclusiveRight&&a.inclusiveLeft?st(y.to,i)>=0:st(y.to,i)>0)||Z>=0&&(m.marker.inclusiveRight&&a.inclusiveLeft?st(y.from,n)<=0:st(y.from,n)<0))return!0}}function Zn(e){for(var t;t=ni(e);)e=t.find(-1,!0).line;return e}function Yi(e){for(var t;t=An(e);)e=t.find(1,!0).line;return e}function Ji(e){for(var t,i;t=An(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function aa(e,t){var i=Ct(e,t),n=Zn(i);return i==n?t:Xt(n)}function Sa(e,t){if(t>e.lastLine())return t;var i=Ct(e,t),n;if(!Sn(e,i))return t;for(;n=An(i);)i=n.find(1,!0).line;return Xt(i)+1}function Sn(e,t){var i=Cn&&t.markedSpans;if(i)for(var n=void 0,a=0;a<i.length;++a){if(n=i[a],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&Qi(e,t,n))return!0}}function Qi(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return Qi(e,n.line,ti(n.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var a=void 0,s=0;s<t.markedSpans.length;++s)if(a=t.markedSpans[s],a.marker.collapsed&&!a.marker.widgetNode&&a.from==i.to&&(a.to==null||a.to!=i.from)&&(a.marker.inclusiveLeft||i.marker.inclusiveRight)&&Qi(e,t,a))return!0}function Ti(e){e=Zn(e);for(var t=0,i=e.parent,n=0;n<i.lines.length;++n){var a=i.lines[n];if(a==e)break;t+=a.height}for(var s=i.parent;s;i=s,s=i.parent)for(var l=0;l<s.children.length;++l){var f=s.children[l];if(f==i)break;t+=f.height}return t}function ua(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=ni(n);){var a=i.find(0,!0);n=a.from.line,t+=a.from.ch-a.to.ch}for(n=e;i=An(n);){var s=i.find(0,!0);t-=n.text.length-s.from.ch,n=s.to.line,t+=n.text.length-s.to.ch}return t}function Pi(e){var t=e.display,i=e.doc;t.maxLine=Ct(i,i.first),t.maxLineLength=ua(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var a=ua(n);a>t.maxLineLength&&(t.maxLineLength=a,t.maxLine=n)})}var oa=function(e,t,i){this.text=e,ia(this,t),this.height=i?i(this):1};oa.prototype.lineNo=function(){return Xt(this)},Q(oa);function ra(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),la(e),ia(e,i);var a=n?n(e):1;a!=e.height&&ln(e,a)}function eo(e){e.parent=null,la(e)}var to={},To={};function no(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?To:to;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Ia(e,t){var i=J("span",null,null,O?"padding-right: .1px":null),n={pre:J("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var a=0;a<=(t.rest?t.rest.length:0);a++){var s=a?t.rest[a-1]:t.line,l=void 0;n.pos=0,n.addToken=qt,lt(e.display.measure)&&(l=xt(s,e.doc.direction))&&(n.addToken=rn(n.addToken,l)),n.map=[];var f=t!=e.display.externalMeasured&&Xt(s);_n(s,n,Je(e,s,f)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=B(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=B(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(at(e.display.measure))),a==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(O){var m=n.content.lastChild;(/\bcm-tab\b/.test(m.className)||m.querySelector&&m.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return je(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=B(n.pre.className,n.textClass||"")),n}function Ht(e){var t=C("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function qt(e,t,i,n,a,s,l){if(!t)return;var f=e.splitSpaces?Jt(t,e.trailingSpace):t,m=e.cm.state.specialChars,y=!1,Z;if(!m.test(t))e.col+=t.length,Z=document.createTextNode(f),e.map.push(e.pos,e.pos+t.length,Z),U&&k<9&&(y=!0),e.pos+=t.length;else{Z=document.createDocumentFragment();for(var ie=0;;){m.lastIndex=ie;var ke=m.exec(t),ye=ke?ke.index-ie:t.length-ie;if(ye){var Ge=document.createTextNode(f.slice(ie,ie+ye));U&&k<9?Z.appendChild(C("span",[Ge])):Z.appendChild(Ge),e.map.push(e.pos,e.pos+ye,Ge),e.col+=ye,e.pos+=ye}if(!ke)break;ie+=ye+1;var it=void 0;if(ke[0]==" "){var ht=e.cm.options.tabSize,wt=ht-e.col%ht;it=Z.appendChild(C("span",_(wt),"cm-tab")),it.setAttribute("role","presentation"),it.setAttribute("cm-text"," "),e.col+=wt}else ke[0]=="\r"||ke[0]==`
`?(it=Z.appendChild(C("span",ke[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),it.setAttribute("cm-text",ke[0]),e.col+=1):(it=e.cm.options.specialCharPlaceholder(ke[0]),it.setAttribute("cm-text",ke[0]),U&&k<9?Z.appendChild(C("span",[it])):Z.appendChild(it),e.col+=1);e.map.push(e.pos,e.pos+1,it),e.pos++}}if(e.trailingSpace=f.charCodeAt(t.length-1)==32,i||n||a||y||s||l){var jt=i||"";n&&(jt+=n),a&&(jt+=a);var St=C("span",[Z],jt,s);if(l)for(var Wt in l)l.hasOwnProperty(Wt)&&Wt!="style"&&Wt!="class"&&St.setAttribute(Wt,l[Wt]);return e.content.appendChild(St)}e.content.appendChild(Z)}function Jt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",a=0;a<e.length;a++){var s=e.charAt(a);s==" "&&i&&(a==e.length-1||e.charCodeAt(a+1)==32)&&(s="\xA0"),n+=s,i=s==" "}return n}function rn(e,t){return function(i,n,a,s,l,f,m){a=a?a+" cm-force-border":"cm-force-border";for(var y=i.pos,Z=y+n.length;;){for(var ie=void 0,ke=0;ke<t.length&&!(ie=t[ke],ie.to>y&&ie.from<=y);ke++);if(ie.to>=Z)return e(i,n,a,s,l,f,m);e(i,n.slice(0,ie.to-y),a,s,null,f,m),s=null,n=n.slice(ie.to-y),y=ie.to}}}function mn(e,t,i,n){var a=!n&&i.widgetNode;a&&e.map.push(e.pos,e.pos+t,a),!n&&e.cm.display.input.needsContentAttribute&&(a||(a=e.content.appendChild(document.createElement("span"))),a.setAttribute("cm-marker",i.id)),a&&(e.cm.display.input.setUneditable(a),e.content.appendChild(a)),e.pos+=t,e.trailingSpace=!1}function _n(e,t,i){var n=e.markedSpans,a=e.text,s=0;if(!n){for(var l=1;l<i.length;l+=2)t.addToken(t,a.slice(s,s=i[l]),no(i[l+1],t.cm.options));return}for(var f=a.length,m=0,y=1,Z="",ie,ke,ye=0,Ge,it,ht,wt,jt;;){if(ye==m){Ge=it=ht=ke="",jt=null,wt=null,ye=Infinity;for(var St=[],Wt=void 0,Zt=0;Zt<n.length;++Zt){var Yt=n[Zt],sn=Yt.marker;if(sn.type=="bookmark"&&Yt.from==m&&sn.widgetNode)St.push(sn);else if(Yt.from<=m&&(Yt.to==null||Yt.to>m||sn.collapsed&&Yt.to==m&&Yt.from==m)){if(Yt.to!=null&&Yt.to!=m&&ye>Yt.to&&(ye=Yt.to,it=""),sn.className&&(Ge+=" "+sn.className),sn.css&&(ke=(ke?ke+";":"")+sn.css),sn.startStyle&&Yt.from==m&&(ht+=" "+sn.startStyle),sn.endStyle&&Yt.to==ye&&(Wt||(Wt=[])).push(sn.endStyle,Yt.to),sn.title&&((jt||(jt={})).title=sn.title),sn.attributes)for(var In in sn.attributes)(jt||(jt={}))[In]=sn.attributes[In];sn.collapsed&&(!wt||di(wt.marker,sn)<0)&&(wt=Yt)}else Yt.from>m&&ye>Yt.from&&(ye=Yt.from)}if(Wt)for(var Ei=0;Ei<Wt.length;Ei+=2)Wt[Ei+1]==ye&&(it+=" "+Wt[Ei]);if(!wt||wt.from==m)for(var Qn=0;Qn<St.length;++Qn)mn(t,0,St[Qn]);if(wt&&(wt.from||0)==m){if(mn(t,(wt.to==null?f+1:wt.to)-m,wt.marker,wt.from==null),wt.to==null)return;wt.to==m&&(wt=!1)}}if(m>=f)break;for(var Vi=Math.min(f,ye);;){if(Z){var Bi=m+Z.length;if(!wt){var ui=Bi>Vi?Z.slice(0,Vi-m):Z;t.addToken(t,ui,ie?ie+Ge:Ge,ht,m+ui.length==ye?it:"",ke,jt)}if(Bi>=Vi){Z=Z.slice(Vi-m),m=Vi;break}m=Bi,ht=""}Z=a.slice(s,s=i[y++]),ie=no(i[y++],t.cm.options)}}}function dn(e,t,i){this.line=t,this.rest=Ji(t),this.size=this.rest?Xt(pe(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Sn(e,t)}function Mn(e,t,i){for(var n=[],a,s=t;s<i;s=a){var l=new dn(e.doc,Ct(e.doc,s),s);a=s+l.size,n.push(l)}return n}var Yn=null;function un(e){Yn?Yn.ops.push(e):e.ownsGroup=Yn={ops:[e],delayedCallbacks:[]}}function ca(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var n=0;n<e.ops.length;n++){var a=e.ops[n];if(a.cursorActivityHandlers)for(;a.cursorActivityCalled<a.cursorActivityHandlers.length;)a.cursorActivityHandlers[a.cursorActivityCalled++].call(null,a.cm)}}while(i<t.length)}function kn(e,t){var i=e.ownsGroup;if(!i)return;try{ca(i)}finally{Yn=null,t(i)}}var hi=null;function Tn(e,t){var i=Ut(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),a;Yn?a=Yn.delayedCallbacks:hi?a=hi:(a=hi=[],setTimeout(zi,0));for(var s=function(f){a.push(function(){return i[f].apply(null,n)})},l=0;l<i.length;++l)s(l)}function zi(){var e=hi;hi=null;for(var t=0;t<e.length;++t)e[t]()}function da(e,t,i,n){for(var a=0;a<t.changes.length;a++){var s=t.changes[a];s=="text"?er(e,t):s=="gutter"?Ao(e,t,i,n):s=="class"?io(e,t):s=="widget"&&ka(e,t,n)}t.changes=null}function ma(e){return e.node==e.text&&(e.node=C("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),U&&k<8&&(e.node.style.zIndex=2)),e.node}function ha(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var n=ma(t);t.background=n.insertBefore(C("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function Po(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Ia(e,t)}function er(e,t){var i=t.text.className,n=Po(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,io(e,t)):i&&(t.text.className=i)}function io(e,t){ha(e,t),t.line.wrapClass?ma(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function Ao(e,t,i,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var a=ma(t);t.gutterBackground=C("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),a.insertBefore(t.gutterBackground,t.text)}var s=t.line.gutterMarkers;if(e.options.lineNumbers||s){var l=ma(t),f=t.gutter=C("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(f),l.insertBefore(f,t.text),t.line.gutterClass&&(f.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!s||!s["CodeMirror-linenumbers"])&&(t.lineNumber=f.appendChild(C("div",nn(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var m=0;m<e.display.gutterSpecs.length;++m){var y=e.display.gutterSpecs[m].className,Z=s.hasOwnProperty(y)&&s[y];Z&&f.appendChild(C("div",[Z],"CodeMirror-gutter-elt","left: "+n.gutterLeft[y]+"px; width: "+n.gutterWidth[y]+"px"))}}}function ka(e,t,i){t.alignable&&(t.alignable=null);for(var n=ne("CodeMirror-linewidget"),a=t.node.firstChild,s=void 0;a;a=s)s=a.nextSibling,n.test(a.className)&&t.node.removeChild(a);ao(e,t,i)}function Mo(e,t,i,n){var a=Po(e,t);return t.text=t.node=a.pre,a.bgClass&&(t.bgClass=a.bgClass),a.textClass&&(t.textClass=a.textClass),io(e,t),Ao(e,t,i,n),ao(e,t,n),t.node}function ao(e,t,i){if(Ra(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)Ra(e,t.rest[n],t,i,!1)}function Ra(e,t,i,n,a){if(!t.widgets)return;for(var s=ma(i),l=0,f=t.widgets;l<f.length;++l){var m=f[l],y=C("div",[m.node],"CodeMirror-linewidget"+(m.className?" "+m.className:""));m.handleMouseEvents||y.setAttribute("cm-ignore-events","true"),tr(m,y,i,n),e.display.input.setUneditable(y),a&&m.above?s.insertBefore(y,i.gutter||i.text):s.appendChild(y),Tn(m,"redraw")}}function tr(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var a=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(a-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=a+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function ga(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!E(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),w(t.display.measure,C("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function qi(e,t){for(var i=de(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Ba(e){return e.lineSpace.offsetTop}function Oa(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Lo(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=w(e.measure,C("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function Zi(e){return ze-e.display.nativeBarWidth}function ea(e){return e.display.scroller.clientWidth-Zi(e)-e.display.barWidth}function Ta(e){return e.display.scroller.clientHeight-Zi(e)-e.display.barHeight}function pt(e,t,i){var n=e.options.lineWrapping,a=n&&ea(e);if(!t.measure.heights||n&&t.measure.width!=a){var s=t.measure.heights=[];if(n){t.measure.width=a;for(var l=t.text.firstChild.getClientRects(),f=0;f<l.length-1;f++){var m=l[f],y=l[f+1];Math.abs(m.bottom-y.bottom)>2&&s.push((m.bottom+y.top)/2-i.top)}}s.push(i.bottom-i.top)}}function rt(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var a=0;a<e.rest.length;a++)if(Xt(e.rest[a])>i)return{map:e.measure.maps[a],cache:e.measure.caches[a],before:!0}}function He(e,t){t=Zn(t);var i=Xt(t),n=e.display.externalMeasured=new dn(e.doc,t,i);n.lineN=i;var a=n.built=Ia(e,n);return n.text=a.pre,w(e.display.lineMeasure,a.pre),n}function Le(e,t,i,n){return yt(e,ft(e,t),i,n)}function mt(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Aa(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function ft(e,t){var i=Xt(t),n=mt(e,i);n&&!n.text?n=null:n&&n.changes&&(da(e,n,i,oo(e)),e.curOp.forceUpdate=!0),n||(n=He(e,t));var a=rt(n,t,i);return{line:t,view:n,rect:null,map:a.map,cache:a.cache,before:a.before,hasHeights:!1}}function yt(e,t,i,n,a){t.before&&(i=-1);var s=i+(n||""),l;return t.cache.hasOwnProperty(s)?l=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(pt(e,t.view,t.rect),t.hasHeights=!0),l=xn(e,t,i,n),l.bogus||(t.cache[s]=l)),{left:l.left,right:l.right,top:a?l.rtop:l.top,bottom:a?l.rbottom:l.bottom}}var Qt={left:0,right:0,top:0,bottom:0};function on(e,t,i){for(var n,a,s,l,f,m,y=0;y<e.length;y+=3)if(f=e[y],m=e[y+1],t<f?(a=0,s=1,l="left"):t<m?(a=t-f,s=a+1):(y==e.length-3||t==m&&e[y+3]>t)&&(s=m-f,a=s-1,t>=m&&(l="right")),a!=null){if(n=e[y+2],f==m&&i==(n.insertLeft?"left":"right")&&(l=i),i=="left"&&a==0)for(;y&&e[y-2]==e[y-3]&&e[y-1].insertLeft;)n=e[(y-=3)+2],l="left";if(i=="right"&&a==m-f)for(;y<e.length-3&&e[y+3]==e[y+4]&&!e[y+5].insertLeft;)n=e[(y+=3)+2],l="right";break}return{node:n,start:a,end:s,collapse:l,coverStart:f,coverEnd:m}}function Pn(e,t){var i=Qt;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var a=e.length-1;a>=0&&!((i=e[a]).left!=i.right);a--);return i}function xn(e,t,i,n){var a=on(t.map,i,n),s=a.node,l=a.start,f=a.end,m=a.collapse,y;if(s.nodeType==3){for(var Z=0;Z<4;Z++){for(;l&&Ke(t.line.text.charAt(a.coverStart+l));)--l;for(;a.coverStart+f<a.coverEnd&&Ke(t.line.text.charAt(a.coverStart+f));)++f;if(U&&k<9&&l==0&&f==a.coverEnd-a.coverStart?y=s.parentNode.getBoundingClientRect():y=Pn(z(s,l,f).getClientRects(),n),y.left||y.right||l==0)break;f=l,l=l-1,m="right"}U&&k<11&&(y=Ln(e.display.measure,y))}else{l>0&&(m=n="right");var ie;e.options.lineWrapping&&(ie=s.getClientRects()).length>1?y=ie[n=="right"?ie.length-1:0]:y=s.getBoundingClientRect()}if(U&&k<9&&!l&&(!y||!y.left&&!y.right)){var ke=s.parentNode.getClientRects()[0];ke?y={left:ke.left,right:ke.left+ji(e.display),top:ke.top,bottom:ke.bottom}:y=Qt}for(var ye=y.top-t.rect.top,Ge=y.bottom-t.rect.top,it=(ye+Ge)/2,ht=t.view.measure.heights,wt=0;wt<ht.length-1&&!(it<ht[wt]);wt++);var jt=wt?ht[wt-1]:0,St=ht[wt],Wt={left:(m=="right"?y.right:y.left)-t.rect.left,right:(m=="left"?y.left:y.right)-t.rect.left,top:jt,bottom:St};return!y.left&&!y.right&&(Wt.bogus=!0),e.options.singleCursorHeightPerLine||(Wt.rtop=ye,Wt.rbottom=Ge),Wt}function Ln(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!zt(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*n,bottom:t.bottom*n}}function En(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function ai(e){e.display.externalMeasure=null,Y(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)En(e.display.view[t])}function Hn(e){ai(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function zn(){return A&&W?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function pi(){return A&&W?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function si(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=ga(e.widgets[i]));return t}function qn(e,t,i,n,a){if(!a){var s=si(t);i.top+=s,i.bottom+=s}if(n=="line")return i;n||(n="local");var l=Ti(t);if(n=="local"?l+=Ba(e.display):l-=e.display.viewOffset,n=="page"||n=="window"){var f=e.display.lineSpace.getBoundingClientRect();l+=f.top+(n=="window"?0:pi());var m=f.left+(n=="window"?0:zn());i.left+=m,i.right+=m}return i.top+=l,i.bottom+=l,i}function mi(e,t,i){if(i=="div")return t;var n=t.left,a=t.top;if(i=="page")n-=zn(),a-=pi();else if(i=="local"||!i){var s=e.display.sizer.getBoundingClientRect();n+=s.left,a+=s.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:a-l.top}}function Ai(e,t,i,n,a){return n||(n=Ct(e.doc,t.line)),qn(e,n,Le(e,n,t.ch,a),i)}function en(e,t,i,n,a,s){n=n||Ct(e.doc,t.line),a||(a=ft(e,n));function l(Ge,it){var ht=yt(e,a,Ge,it?"right":"left",s);return it?ht.left=ht.right:ht.right=ht.left,qn(e,n,ht,i)}var f=xt(n,e.doc.direction),m=t.ch,y=t.sticky;if(m>=n.text.length?(m=n.text.length,y="before"):m<=0&&(m=0,y="after"),!f)return l(y=="before"?m-1:m,y=="before");function Z(Ge,it,ht){var wt=f[it],jt=wt.level==1;return l(ht?Ge-1:Ge,jt!=ht)}var ie=ct(f,m,y),ke=kt,ye=Z(m,ie,y=="before");return ke!=null&&(ye.other=Z(m,ke,y!="before")),ye}function bn(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=ji(e.display)*t.ch);var n=Ct(e.doc,t.line),a=Ti(n)+Ba(e.display);return{left:i,right:i,top:a,bottom:a+n.height}}function Jn(e,t,i,n,a){var s=$e(e,t,i);return s.xRel=a,n&&(s.outside=n),s}function gi(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return Jn(n.first,0,null,-1,-1);var a=hn(n,i),s=n.first+n.size-1;if(a>s)return Jn(n.first+n.size-1,Ct(n,s).text.length,null,1,1);t<0&&(t=0);for(var l=Ct(n,a);;){var f=Un(e,l,a,t,i),m=Si(l,f.ch+(f.xRel>0||f.outside>0?1:0));if(!m)return f;var y=m.find(1);if(y.line==a)return y;l=Ct(n,a=y.line)}}function li(e,t,i,n){n-=si(t);var a=t.text.length,s=At(function(l){return yt(e,i,l-1).bottom<=n},a,0);return a=At(function(l){return yt(e,i,l).top>n},s,a),{begin:s,end:a}}function Mi(e,t,i,n){i||(i=ft(e,t));var a=qn(e,t,yt(e,i,n),"line").top;return li(e,t,i,a)}function Li(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function Un(e,t,i,n,a){a-=Ti(t);var s=ft(e,t),l=si(t),f=0,m=t.text.length,y=!0,Z=xt(t,e.doc.direction);if(Z){var ie=(e.options.lineWrapping?vi:Vn)(e,t,i,s,Z,n,a);y=ie.level!=1,f=y?ie.from:ie.to-1,m=y?ie.to:ie.from-1}var ke=null,ye=null,Ge=At(function(Zt){var Yt=yt(e,s,Zt);return Yt.top+=l,Yt.bottom+=l,Li(Yt,n,a,!1)?(Yt.top<=a&&Yt.left<=n&&(ke=Zt,ye=Yt),!0):!1},f,m),it,ht,wt=!1;if(ye){var jt=n-ye.left<ye.right-n,St=jt==y;Ge=ke+(St?0:1),ht=St?"after":"before",it=jt?ye.left:ye.right}else{!y&&(Ge==m||Ge==f)&&Ge++,ht=Ge==0?"after":Ge==t.text.length?"before":yt(e,s,Ge-(y?1:0)).bottom+l<=a==y?"after":"before";var Wt=en(e,$e(i,Ge,ht),"line",t,s);it=Wt.left,wt=a<Wt.top?-1:a>=Wt.bottom?1:0}return Ge=Ve(t.text,Ge,1),Jn(i,Ge,ht,wt,n-it)}function Vn(e,t,i,n,a,s,l){var f=At(function(ie){var ke=a[ie],ye=ke.level!=1;return Li(en(e,$e(i,ye?ke.to:ke.from,ye?"before":"after"),"line",t,n),s,l,!0)},0,a.length-1),m=a[f];if(f>0){var y=m.level!=1,Z=en(e,$e(i,y?m.from:m.to,y?"after":"before"),"line",t,n);Li(Z,s,l,!0)&&Z.top>l&&(m=a[f-1])}return m}function vi(e,t,i,n,a,s,l){var f=li(e,t,n,l),m=f.begin,y=f.end;/\s/.test(t.text.charAt(y-1))&&y--;for(var Z=null,ie=null,ke=0;ke<a.length;ke++){var ye=a[ke];if(ye.from>=y||ye.to<=m)continue;var Ge=ye.level!=1,it=yt(e,n,Ge?Math.min(y,ye.to)-1:Math.max(m,ye.from)).right,ht=it<s?s-it+1e9:it-s;(!Z||ie>ht)&&(Z=ye,ie=ht)}return Z||(Z=a[a.length-1]),Z.from<m&&(Z={from:m,to:Z.to,level:Z.level}),Z.to>y&&(Z={from:Z.from,to:y,level:Z.level}),Z}var ki;function yi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ki==null){ki=C("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ki.appendChild(document.createTextNode("x")),ki.appendChild(C("br"));ki.appendChild(document.createTextNode("x"))}w(e.measure,ki);var i=ki.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),Y(e.measure),i||1}function ji(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=C("span","xxxxxxxxxx"),i=C("pre",[t],"CodeMirror-line-like");w(e.measure,i);var n=t.getBoundingClientRect(),a=(n.right-n.left)/10;return a>2&&(e.cachedCharWidth=a),a||10}function oo(e){for(var t=e.display,i={},n={},a=t.gutters.clientLeft,s=t.gutters.firstChild,l=0;s;s=s.nextSibling,++l){var f=e.display.gutterSpecs[l].className;i[f]=s.offsetLeft+s.clientLeft+a,n[f]=s.clientWidth}return{fixedPos:ro(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function ro(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Tr(e){var t=yi(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/ji(e.display)-3);return function(a){if(Sn(e.doc,a))return 0;var s=0;if(a.widgets)for(var l=0;l<a.widgets.length;l++)a.widgets[l].height&&(s+=a.widgets[l].height);return i?s+(Math.ceil(a.text.length/n)||1)*t:s+t}}function nr(e){var t=e.doc,i=Tr(e);t.iter(function(n){var a=i(n);a!=n.height&&ln(n,a)})}function Pa(e,t,i,n){var a=e.display;if(!i&&de(t).getAttribute("cm-not-content")=="true")return null;var s,l,f=a.lineSpace.getBoundingClientRect();try{s=t.clientX-f.left,l=t.clientY-f.top}catch(ie){return null}var m=gi(e,s,l),y;if(n&&m.xRel>0&&(y=Ct(e.doc,m.line).text).length==m.ch){var Z=ue(y,y.length,e.options.tabSize)-y.length;m=$e(m.line,Math.max(0,Math.round((s-Lo(e.display).left)/ji(e.display))-Z))}return m}function Aa(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,n=0;n<i.length;n++)if(t-=i[n].size,t<0)return n}function Ui(e,t,i,n){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),n||(n=0);var a=e.display;if(n&&i<a.viewTo&&(a.updateLineNumbers==null||a.updateLineNumbers>t)&&(a.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=a.viewTo)Cn&&aa(e.doc,t)<a.viewTo&&ya(e);else if(i<=a.viewFrom)Cn&&Sa(e.doc,i+n)>a.viewFrom?ya(e):(a.viewFrom+=n,a.viewTo+=n);else if(t<=a.viewFrom&&i>=a.viewTo)ya(e);else if(t<=a.viewFrom){var s=Do(e,i,i+n,1);s?(a.view=a.view.slice(s.index),a.viewFrom=s.lineN,a.viewTo+=n):ya(e)}else if(i>=a.viewTo){var l=Do(e,t,t,-1);l?(a.view=a.view.slice(0,l.index),a.viewTo=l.lineN):ya(e)}else{var f=Do(e,t,t,-1),m=Do(e,i,i+n,1);f&&m?(a.view=a.view.slice(0,f.index).concat(Mn(e,f.lineN,m.lineN)).concat(a.view.slice(m.index)),a.viewTo+=n):ya(e)}var y=a.externalMeasured;y&&(i<y.lineN?y.lineN+=n:t<y.lineN+y.size&&(a.externalMeasured=null))}function va(e,t,i){e.curOp.viewChanged=!0;var n=e.display,a=e.display.externalMeasured;if(a&&t>=a.lineN&&t<a.lineN+a.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var s=n.view[Aa(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);Pe(l,i)==-1&&l.push(i)}function ya(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Do(e,t,i,n){var a=Aa(e,t),s,l=e.display.view;if(!Cn||i==e.doc.first+e.doc.size)return{index:a,lineN:i};for(var f=e.display.viewFrom,m=0;m<a;m++)f+=l[m].size;if(f!=t){if(n>0){if(a==l.length-1)return null;s=f+l[a].size-t,a++}else s=f-t;t+=s,i+=s}for(;aa(e.doc,i)!=i;){if(a==(n<0?0:l.length-1))return null;i+=n*l[a-(n<0?1:0)].size,a+=n}return{index:a,lineN:i}}function Gs(e,t,i){var n=e.display,a=n.view;a.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=Mn(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=Mn(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Aa(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(Mn(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,Aa(e,i)))),n.viewTo=i}function Pr(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var a=t[n];!a.hidden&&(!a.node||a.changes)&&++i}return i}function so(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Ar(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},a=n.cursors=document.createDocumentFragment(),s=n.selection=document.createDocumentFragment(),l=0;l<i.sel.ranges.length;l++){if(!t&&l==i.sel.primIndex)continue;var f=i.sel.ranges[l];if(f.from().line>=e.display.viewTo||f.to().line<e.display.viewFrom)continue;var m=f.empty();(m||e.options.showCursorWhenSelecting)&&Mr(e,f.head,a),m||Xs(e,f,s)}return n}function Mr(e,t,i){var n=en(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),a=i.appendChild(C("div","\xA0","CodeMirror-cursor"));if(a.style.left=n.left+"px",a.style.top=n.top+"px",a.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var s=i.appendChild(C("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=n.other.left+"px",s.style.top=n.other.top+"px",s.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function No(e,t){return e.top-t.top||e.left-t.left}function Xs(e,t,i){var n=e.display,a=e.doc,s=document.createDocumentFragment(),l=Lo(e.display),f=l.left,m=Math.max(n.sizerWidth,ea(e)-n.sizer.offsetLeft)-l.right,y=a.direction=="ltr";function Z(St,Wt,Zt,Yt){Wt<0&&(Wt=0),Wt=Math.round(Wt),Yt=Math.round(Yt),s.appendChild(C("div",null,"CodeMirror-selected","position: absolute; left: "+St+`px;
top: `+Wt+"px; width: "+(Zt==null?m-St:Zt)+`px;
height: `+(Yt-Wt)+"px"))}function ie(St,Wt,Zt){var Yt=Ct(a,St),sn=Yt.text.length,In,Ei;function Qn(ui,Fi){return Ai(e,$e(St,ui),"div",Yt,Fi)}function Vi(ui,Fi,wi){var fi=Mi(e,Yt,null,ui),ci=Fi=="ltr"==(wi=="after")?"left":"right",ei=wi=="after"?fi.begin:fi.end-(/\s/.test(Yt.text.charAt(fi.end-1))?2:1);return Qn(ei,ci)[ci]}var Bi=xt(Yt,a.direction);return gt(Bi,Wt||0,Zt==null?sn:Zt,function(ui,Fi,wi,fi){var ci=wi=="ltr",ei=Qn(ui,ci?"left":"right"),Wi=Qn(Fi-1,ci?"right":"left"),Za=Wt==null&&ui==0,wa=Zt==null&&Fi==sn,Oi=fi==0,sa=!Bi||fi==Bi.length-1;if(Wi.top-ei.top<=3){var Ci=(y?Za:wa)&&Oi,Rr=(y?wa:Za)&&sa,pa=Ci?f:(ci?ei:Wi).left,ja=Rr?m:(ci?Wi:ei).right;Z(pa,ei.top,ja-pa,ei.bottom)}else{var Ua,Ni,qa,Or;ci?(Ua=y&&Za&&Oi?f:ei.left,Ni=y?m:Vi(ui,wi,"before"),qa=y?f:Vi(Fi,wi,"after"),Or=y&&wa&&sa?m:Wi.right):(Ua=y?Vi(ui,wi,"before"):f,Ni=!y&&Za&&Oi?m:ei.right,qa=!y&&wa&&sa?f:Wi.left,Or=y?Vi(Fi,wi,"after"):m),Z(Ua,ei.top,Ni-Ua,ei.bottom),ei.bottom<Wi.top&&Z(f,ei.bottom,null,Wi.top),Z(qa,Wi.top,Or-qa,Wi.bottom)}(!In||No(ei,In)<0)&&(In=ei),No(Wi,In)<0&&(In=Wi),(!Ei||No(ei,Ei)<0)&&(Ei=ei),No(Wi,Ei)<0&&(Ei=Wi)}),{start:In,end:Ei}}var ke=t.from(),ye=t.to();if(ke.line==ye.line)ie(ke.line,ke.ch,ye.ch);else{var Ge=Ct(a,ke.line),it=Ct(a,ye.line),ht=Zn(Ge)==Zn(it),wt=ie(ke.line,ke.ch,ht?Ge.text.length+1:null).end,jt=ie(ye.line,ht?0:null,ye.ch).start;ht&&(wt.top<jt.top-2?(Z(wt.right,wt.top,null,wt.bottom),Z(f,jt.top,jt.left,jt.bottom)):Z(wt.right,wt.top,jt.left-wt.right,wt.bottom)),wt.bottom<jt.top&&Z(f,wt.bottom,null,jt.top)}i.appendChild(s)}function ir(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Fa(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Lr(e){e.state.focused||(e.display.input.focus(),ar(e))}function Dr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Fa(e))},100)}function ar(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(je(e,"focus",e,t),e.state.focused=!0,ae(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),O&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ir(e)}function Fa(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(je(e,"blur",e,t),e.state.focused=!1,S(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function jo(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var a=t.view[n],s=e.options.lineWrapping,l=void 0,f=0;if(a.hidden)continue;if(U&&k<8){var m=a.node.offsetTop+a.node.offsetHeight;l=m-i,i=m}else{var y=a.node.getBoundingClientRect();l=y.bottom-y.top,!s&&a.text.firstChild&&(f=a.text.firstChild.getBoundingClientRect().right-y.left-1)}var Z=a.line.height-l;if((Z>.005||Z<-.005)&&(ln(a.line,l),Nr(a.line),a.rest))for(var ie=0;ie<a.rest.length;ie++)Nr(a.rest[ie]);if(f>e.display.sizerWidth){var ke=Math.ceil(f/ji(e.display));ke>e.display.maxLineLength&&(e.display.maxLineLength=ke,e.display.maxLine=a.line,e.display.maxLineChanged=!0)}}}function Nr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],n=i.node.parentNode;n&&(i.height=n.offsetHeight)}}function Uo(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Ba(e));var a=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,s=hn(t,n),l=hn(t,a);if(i&&i.ensure){var f=i.ensure.from.line,m=i.ensure.to.line;f<s?(s=f,l=hn(t,Ti(Ct(t,f))+e.wrapper.clientHeight)):Math.min(m,t.lastLine())>=l&&(s=hn(t,Ti(Ct(t,m))-e.wrapper.clientHeight),l=m)}return{from:s,to:Math.max(l,s+1)}}function $s(e,t){if(We(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),a=null;if(t.top+n.top<0?a=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(a=!1),a!=null&&!L){var s=C("div","\u200B",null,`position: absolute;
top: `+(t.top-i.viewOffset-Ba(e.display))+`px;
height: `+(t.bottom-t.top+Zi(e)+i.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(a),e.display.lineSpace.removeChild(s)}}function Ys(e,t,i,n){n==null&&(n=0);var a;!e.options.lineWrapping&&t==i&&(t=t.ch?$e(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?$e(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,f=en(e,t),m=!i||i==t?f:en(e,i);a={left:Math.min(f.left,m.left),top:Math.min(f.top,m.top)-n,right:Math.max(f.left,m.left),bottom:Math.max(f.bottom,m.bottom)+n};var y=or(e,a),Z=e.doc.scrollTop,ie=e.doc.scrollLeft;if(y.scrollTop!=null&&(uo(e,y.scrollTop),Math.abs(e.doc.scrollTop-Z)>1&&(l=!0)),y.scrollLeft!=null&&(Ma(e,y.scrollLeft),Math.abs(e.doc.scrollLeft-ie)>1&&(l=!0)),!l)break}return a}function Js(e,t){var i=or(e,t);i.scrollTop!=null&&uo(e,i.scrollTop),i.scrollLeft!=null&&Ma(e,i.scrollLeft)}function or(e,t){var i=e.display,n=yi(e.display);t.top<0&&(t.top=0);var a=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,s=Ta(e),l={};t.bottom-t.top>s&&(t.bottom=t.top+s);var f=e.doc.height+Oa(i),m=t.top<n,y=t.bottom>f-n;if(t.top<a)l.scrollTop=m?0:t.top;else if(t.bottom>a+s){var Z=Math.min(t.top,(y?f:t.bottom)-s);Z!=a&&(l.scrollTop=Z)}var ie=e.options.fixedGutter?0:i.gutters.offsetWidth,ke=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-ie,ye=ea(e)-i.gutters.offsetWidth,Ge=t.right-t.left>ye;return Ge&&(t.right=t.left+ye),t.left<10?l.scrollLeft=0:t.left<ke?l.scrollLeft=Math.max(0,t.left+ie-(Ge?0:10)):t.right>ye+ke-3&&(l.scrollLeft=t.right+(Ge?0:10)-ye),l}function rr(e,t){if(t==null)return;Io(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Wa(e){Io(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function lo(e,t,i){(t!=null||i!=null)&&Io(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Qs(e,t){Io(e),e.curOp.scrollToPos=t}function Io(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=bn(e,t.from),n=bn(e,t.to);jr(e,i,n,t.margin)}}function jr(e,t,i,n){var a=or(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});lo(e,a.scrollLeft,a.scrollTop)}function uo(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;se||lr(e,{top:t}),Ur(e,t,!0),se&&lr(e),fo(e,100)}function Ur(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Ma(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,Hr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function co(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+Oa(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:n,scrollHeight:n+Zi(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var La=function(e,t,i){this.cm=i;var n=this.vert=C("div",[C("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),a=this.horiz=C("div",[C("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=a.tabIndex=-1,e(n),e(a),Ne(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Ne(a,"scroll",function(){a.clientWidth&&t(a.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,U&&k<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};La.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var a=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+a)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var s=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+s)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?n:0,bottom:t?n:0}},La.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},La.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},La.prototype.zeroWidthHack=function(){var e=b&&!F?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Be,this.disableVert=new Be},La.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function n(){var a=e.getBoundingClientRect(),s=i=="vert"?document.elementFromPoint(a.right-1,(a.top+a.bottom)/2):document.elementFromPoint((a.right+a.left)/2,a.bottom-1);s!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},La.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ho=function(){};ho.prototype.update=function(){return{bottom:0,right:0}},ho.prototype.setScrollLeft=function(){},ho.prototype.setScrollTop=function(){},ho.prototype.clear=function(){};function Ha(e,t){t||(t=co(e));var i=e.display.barWidth,n=e.display.barHeight;Ir(e,t);for(var a=0;a<4&&i!=e.display.barWidth||n!=e.display.barHeight;a++)i!=e.display.barWidth&&e.options.lineWrapping&&jo(e),Ir(e,co(e)),i=e.display.barWidth,n=e.display.barHeight}function Ir(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var Br={native:La,null:ho};function Fr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&S(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Br[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ne(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?Ma(e,t):uo(e,t)},e),e.display.scrollbars.addClass&&ae(e.display.wrapper,e.display.scrollbars.addClass)}var Zs=0;function Da(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Zs},un(e.curOp)}function Na(e){var t=e.curOp;t&&kn(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;qs(i)})}function qs(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var n=0;n<t.length;n++)tl(t[n]);for(var a=0;a<t.length;a++)nl(t[a]);for(var s=0;s<t.length;s++)il(t[s]);for(var l=0;l<t.length;l++)al(t[l])}function el(e){var t=e.cm,i=t.display;rl(t),e.updateMaxLine&&Pi(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Bo(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&sr(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&jo(t),e.barMeasure=co(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Le(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Zi(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-ea(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Ma(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==P();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ha(t,e.barMeasure),e.updatedDisplay&&cr(t,e.barMeasure),e.selectionChanged&&ir(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&Lr(e.cm)}function al(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&Wr(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&Ur(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Ma(t,e.scrollLeft,!0,!0),e.scrollToPos){var a=Ys(t,o(n,e.scrollToPos.from),o(n,e.scrollToPos.to),e.scrollToPos.margin);$s(t,a)}var s=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(s)for(var f=0;f<s.length;++f)s[f].lines.length||je(s[f],"hide");if(l)for(var m=0;m<l.length;++m)l[m].lines.length&&je(l[m],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&je(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Ki(e,t){if(e.curOp)return t();Da(e);try{return t()}finally{Na(e)}}function bi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Da(e);try{return t.apply(e,arguments)}finally{Na(e)}}}function Di(e){return function(){if(this.curOp)return e.apply(this,arguments);Da(this);try{return e.apply(this,arguments)}finally{Na(this)}}}function _i(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Da(t);try{return e.apply(this,arguments)}finally{Na(t)}}}function fo(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,D(ol,e))}function ol(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=_e(e,t.highlightFrontier),a=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(s){if(n.line>=e.display.viewFrom){var l=s.styles,f=s.text.length>e.options.maxHighlightLength?Kt(t.mode,n.state):null,m=oe(e,s,n,!0);f&&(n.state=f),s.styles=m.styles;var y=s.styleClasses,Z=m.classes;Z?s.styleClasses=Z:y&&(s.styleClasses=null);for(var ie=!l||l.length!=s.styles.length||y!=Z&&(!y||!Z||y.bgClass!=Z.bgClass||y.textClass!=Z.textClass),ke=0;!ie&&ke<l.length;++ke)ie=l[ke]!=s.styles[ke];ie&&a.push(n.line),s.stateAfter=n.save(),n.nextLine()}else s.text.length<=e.options.maxHighlightLength&&Bt(e,s.text,n),s.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return fo(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),a.length&&Ki(e,function(){for(var s=0;s<a.length;s++)va(e,a[s],"text")})}var Bo=function(e,t,i){var n=e.display;this.viewport=t,this.visible=Uo(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=ea(e),this.force=i,this.dims=oo(e),this.events=[]};Bo.prototype.signal=function(e,t){q(e,t)&&this.events.push(arguments)},Bo.prototype.finish=function(){for(var e=0;e<this.events.length;e++)je.apply(null,this.events[e])};function rl(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Zi(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Zi(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=P();if(!t||!E(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&E(e.display.lineDiv,n.anchorNode)&&(i.anchorNode=n.anchorNode,i.anchorOffset=n.anchorOffset,i.focusNode=n.focusNode,i.focusOffset=n.focusOffset)}return i}function ll(e){if(!e||!e.activeElt||e.activeElt==P())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&E(document.body,e.anchorNode)&&E(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function sr(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return ya(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&Pr(e)==0)return!1;zr(e)&&(ya(e),t.dims=oo(e));var a=n.first+n.size,s=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(a,t.visible.to+e.options.viewportMargin);i.viewFrom<s&&s-i.viewFrom<20&&(s=Math.max(n.first,i.viewFrom)),i.viewTo>l&&i.viewTo-l<20&&(l=Math.min(a,i.viewTo)),Cn&&(s=aa(e.doc,s),l=Sa(e.doc,l));var f=s!=i.viewFrom||l!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Gs(e,s,l),i.viewOffset=Ti(Ct(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var m=Pr(e);if(!f&&m==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var y=sl(e);return m>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),m>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(y),Y(i.cursorDiv),Y(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,f&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,fo(e,400)),i.updateLineNumbers=null,!0}function Wr(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==ea(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+Oa(e.display)-Ta(e),i.top)}),t.visible=Uo(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Uo(e.display,e.doc,i));if(!sr(e,t))break;jo(e);var a=co(e);so(e),Ha(e,a),cr(e,a),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function lr(e,t){var i=new Bo(e,t);if(sr(e,i)){jo(e),Wr(e,i);var n=co(e);so(e),Ha(e,n),cr(e,n),i.finish()}}function ul(e,t,i){var n=e.display,a=e.options.lineNumbers,s=n.lineDiv,l=s.firstChild;function f(Ge){var it=Ge.nextSibling;return O&&b&&e.display.currentWheelTarget==Ge?Ge.style.display="none":Ge.parentNode.removeChild(Ge),it}for(var m=n.view,y=n.viewFrom,Z=0;Z<m.length;Z++){var ie=m[Z];if(!ie.hidden)if(!ie.node||ie.node.parentNode!=s){var ke=Mo(e,ie,y,i);s.insertBefore(ke,l)}else{for(;l!=ie.node;)l=f(l);var ye=a&&t!=null&&t<=y&&ie.lineNumber;ie.changes&&(Pe(ie.changes,"gutter")>-1&&(ye=!1),da(e,ie,y,i)),ye&&(Y(ie.lineNumber),ie.lineNumber.appendChild(document.createTextNode(nn(e.options,y)))),l=ie.node.nextSibling}y+=ie.size}for(;l;)l=f(l)}function ur(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function cr(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Zi(e)+"px"}function Hr(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=ro(t)-t.scroller.scrollLeft+e.doc.scrollLeft,a=t.gutters.offsetWidth,s=n+"px",l=0;l<i.length;l++)if(!i[l].hidden){e.options.fixedGutter&&(i[l].gutter&&(i[l].gutter.style.left=s),i[l].gutterBackground&&(i[l].gutterBackground.style.left=s));var f=i[l].alignable;if(f)for(var m=0;m<f.length;m++)f[m].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=n+a+"px")}function zr(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=nn(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var a=n.measure.appendChild(C("div",[C("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=a.firstChild.offsetWidth,l=a.offsetWidth-s;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(s,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",ur(e.display),!0}return!1}function dr(e,t){for(var i=[],n=!1,a=0;a<e.length;a++){var s=e[a],l=null;if(typeof s!="string"&&(l=s.style,s=s.className),s=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:s,style:l})}return t&&!n&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function Kr(e){var t=e.gutters,i=e.gutterSpecs;Y(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var a=i[n],s=a.className,l=a.style,f=t.appendChild(C("div",null,"CodeMirror-gutter "+s));l&&(f.style.cssText=l),s=="CodeMirror-linenumbers"&&(e.lineGutter=f,f.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",ur(e)}function po(e){Kr(e.display),Ui(e),Hr(e)}function cl(e,t,i,n){var a=this;this.input=i,a.scrollbarFiller=C("div",null,"CodeMirror-scrollbar-filler"),a.scrollbarFiller.setAttribute("cm-not-content","true"),a.gutterFiller=C("div",null,"CodeMirror-gutter-filler"),a.gutterFiller.setAttribute("cm-not-content","true"),a.lineDiv=J("div",null,"CodeMirror-code"),a.selectionDiv=C("div",null,null,"position: relative; z-index: 1"),a.cursorDiv=C("div",null,"CodeMirror-cursors"),a.measure=C("div",null,"CodeMirror-measure"),a.lineMeasure=C("div",null,"CodeMirror-measure"),a.lineSpace=J("div",[a.measure,a.lineMeasure,a.selectionDiv,a.cursorDiv,a.lineDiv],null,"position: relative; outline: none");var s=J("div",[a.lineSpace],"CodeMirror-lines");a.mover=C("div",[s],null,"position: relative"),a.sizer=C("div",[a.mover],"CodeMirror-sizer"),a.sizerWidth=null,a.heightForcer=C("div",null,null,"position: absolute; height: "+ze+"px; width: 1px;"),a.gutters=C("div",null,"CodeMirror-gutters"),a.lineGutter=null,a.scroller=C("div",[a.sizer,a.heightForcer,a.gutters],"CodeMirror-scroll"),a.scroller.setAttribute("tabIndex","-1"),a.wrapper=C("div",[a.scrollbarFiller,a.gutterFiller,a.scroller],"CodeMirror"),U&&k<8&&(a.gutters.style.zIndex=-1,a.scroller.style.paddingRight=0),!O&&!(se&&ee)&&(a.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(a.wrapper):e(a.wrapper)),a.viewFrom=a.viewTo=t.first,a.reportedViewFrom=a.reportedViewTo=t.first,a.view=[],a.renderedView=null,a.externalMeasured=null,a.viewOffset=0,a.lastWrapHeight=a.lastWrapWidth=0,a.updateLineNumbers=null,a.nativeBarWidth=a.barHeight=a.barWidth=0,a.scrollbarsClipped=!1,a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null,a.alignWidgets=!1,a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null,a.maxLine=null,a.maxLineLength=0,a.maxLineChanged=!1,a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null,a.shift=!1,a.selForContextMenu=null,a.activeTouch=null,a.gutterSpecs=dr(n.gutters,n.lineNumbers),Kr(a),i.init(a)}var Fo=0,Gi=null;U?Gi=-.53:se?Gi=15:A?Gi=-.7:te&&(Gi=-1/3);function Vr(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function dl(e){var t=Vr(e);return t.x*=Gi,t.y*=Gi,t}function Gr(e,t){var i=Vr(t),n=i.x,a=i.y,s=e.display,l=s.scroller,f=l.scrollWidth>l.clientWidth,m=l.scrollHeight>l.clientHeight;if(!(n&&f||a&&m))return;if(a&&b&&O){e:for(var y=t.target,Z=s.view;y!=l;y=y.parentNode)for(var ie=0;ie<Z.length;ie++)if(Z[ie].node==y){e.display.currentWheelTarget=y;break e}}if(n&&!se&&!M&&Gi!=null){a&&m&&uo(e,Math.max(0,l.scrollTop+a*Gi)),Ma(e,Math.max(0,l.scrollLeft+n*Gi)),(!a||a&&m)&&x(t),s.wheelStartX=null;return}if(a&&Gi!=null){var ke=a*Gi,ye=e.doc.scrollTop,Ge=ye+s.wrapper.clientHeight;ke<0?ye=Math.max(0,ye+ke-50):Ge=Math.min(e.doc.height,Ge+ke+50),lr(e,{top:ye,bottom:Ge})}Fo<20&&(s.wheelStartX==null?(s.wheelStartX=l.scrollLeft,s.wheelStartY=l.scrollTop,s.wheelDX=n,s.wheelDY=a,setTimeout(function(){if(s.wheelStartX==null)return;var it=l.scrollLeft-s.wheelStartX,ht=l.scrollTop-s.wheelStartY,wt=ht&&s.wheelDY&&ht/s.wheelDY||it&&s.wheelDX&&it/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!wt)return;Gi=(Gi*Fo+wt)/(Fo+1),++Fo},200)):(s.wheelDX+=n,s.wheelDY+=a))}var Xi=function(e,t){this.ranges=e,this.primIndex=t};Xi.prototype.primary=function(){return this.ranges[this.primIndex]},Xi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],n=e.ranges[t];if(!fn(i.anchor,n.anchor)||!fn(i.head,n.head))return!1}return!0},Xi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Rn(gn(this.ranges[t].anchor),gn(this.ranges[t].head));return new Xi(e,this.primIndex)},Xi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Xi.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(st(t,n.from())>=0&&st(e,n.to())<=0)return i}return-1};var Rn=function(e,t){this.anchor=e,this.head=t};Rn.prototype.from=function(){return Bn(this.anchor,this.head)},Rn.prototype.to=function(){return On(this.anchor,this.head)},Rn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ta(e,t,i){var n=e&&e.options.selectionsMayTouch,a=t[i];t.sort(function(ke,ye){return st(ke.from(),ye.from())}),i=Pe(t,a);for(var s=1;s<t.length;s++){var l=t[s],f=t[s-1],m=st(f.to(),l.from());if(n&&!l.empty()?m>0:m>=0){var y=Bn(f.from(),l.from()),Z=On(f.to(),l.to()),ie=f.empty()?l.from()==l.head:f.from()==f.head;s<=i&&--i,t.splice(--s,2,new Rn(ie?Z:y,ie?y:Z))}}return new Xi(t,i)}function ba(e,t){return new Xi([new Rn(e,t||e)],0)}function _a(e){return e.text?$e(e.from.line+e.text.length-1,pe(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Xr(e,t){if(st(e,t.from)<0)return e;if(st(e,t.to)<=0)return _a(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=_a(t).ch-t.to.ch),$e(i,n)}function hr(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var a=e.sel.ranges[n];i.push(new Rn(Xr(a.anchor,t),Xr(a.head,t)))}return ta(e.cm,i,e.sel.primIndex)}function $r(e,t,i){return e.line==t.line?$e(i.line,e.ch-t.ch+i.ch):$e(i.line+(e.line-t.line),e.ch)}function hl(e,t,i){for(var n=[],a=$e(e.first,0),s=a,l=0;l<t.length;l++){var f=t[l],m=$r(f.from,a,s),y=$r(_a(f),a,s);if(a=f.to,s=y,i=="around"){var Z=e.sel.ranges[l],ie=st(Z.head,Z.anchor)<0;n[l]=new Rn(ie?y:m,ie?m:y)}else n[l]=new Rn(m,m)}return new Xi(n,e.sel.primIndex)}function fr(e){e.doc.mode=ut(e.options,e.doc.modeOption),mo(e)}function mo(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,fo(e,100),e.state.modeGen++,e.curOp&&Ui(e)}function Yr(e,t){return t.from.ch==0&&t.to.ch==0&&pe(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function pr(e,t,i,n){function a(jt){return i?i[jt]:null}function s(jt,St,Wt){ra(jt,St,Wt,n),Tn(jt,"change",jt,t)}function l(jt,St){for(var Wt=[],Zt=jt;Zt<St;++Zt)Wt.push(new oa(y[Zt],a(Zt),n));return Wt}var f=t.from,m=t.to,y=t.text,Z=Ct(e,f.line),ie=Ct(e,m.line),ke=pe(y),ye=a(y.length-1),Ge=m.line-f.line;if(t.full)e.insert(0,l(0,y.length)),e.remove(y.length,e.size-y.length);else if(Yr(e,t)){var it=l(0,y.length-1);s(ie,ie.text,ye),Ge&&e.remove(f.line,Ge),it.length&&e.insert(f.line,it)}else if(Z==ie)if(y.length==1)s(Z,Z.text.slice(0,f.ch)+ke+Z.text.slice(m.ch),ye);else{var ht=l(1,y.length-1);ht.push(new oa(ke+Z.text.slice(m.ch),ye,n)),s(Z,Z.text.slice(0,f.ch)+y[0],a(0)),e.insert(f.line+1,ht)}else if(y.length==1)s(Z,Z.text.slice(0,f.ch)+y[0]+ie.text.slice(m.ch),a(0)),e.remove(f.line+1,Ge);else{s(Z,Z.text.slice(0,f.ch)+y[0],a(0)),s(ie,ke+ie.text.slice(m.ch),ye);var wt=l(1,y.length-1);Ge>1&&e.remove(f.line+1,Ge-1),e.insert(f.line+1,wt)}Tn(e,"change",e,t)}function Ea(e,t,i){function n(a,s,l){if(a.linked)for(var f=0;f<a.linked.length;++f){var m=a.linked[f];if(m.doc==s)continue;var y=l&&m.sharedHist;if(i&&!y)continue;t(m.doc,y),n(m.doc,a,y)}}n(e,null,!0)}function Jr(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,nr(e),fr(e),Qr(e),e.options.lineWrapping||Pi(e),e.options.mode=t.modeOption,Ui(e)}function Qr(e){(e.doc.direction=="rtl"?ae:S)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Ki(e,function(){Qr(e),Ui(e)})}function Wo(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function mr(e,t){var i={from:gn(t.from),to:_a(t),text:tn(e,t.from,t.to)};return es(e,i,t.from.line,t.to.line+1),Ea(e,function(n){return es(n,i,t.from.line,t.to.line+1)},!0),i}function Zr(e){for(;e.length;){var t=pe(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Zr(e.done),pe(e.done);if(e.done.length&&!pe(e.done).ranges)return pe(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),pe(e.done)}function qr(e,t,i,n){var a=e.history;a.undone.length=0;var s=+new Date,l,f;if((a.lastOp==n||a.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&a.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=pl(a,a.lastOp==n)))f=pe(l.changes),st(t.from,t.to)==0&&st(t.from,f.to)==0?f.to=_a(t):l.changes.push(mr(e,t));else{var m=pe(a.done);for((!m||!m.ranges)&&Ho(e.sel,a.done),l={changes:[mr(e,t)],generation:a.generation},a.done.push(l);a.done.length>a.undoDepth;)a.done.shift(),a.done[0].ranges||a.done.shift()}a.done.push(i),a.generation=++a.maxGeneration,a.lastModTime=a.lastSelTime=s,a.lastOp=a.lastSelOp=n,a.lastOrigin=a.lastSelOrigin=t.origin,f||je(e,"historyAdded")}function ml(e,t,i,n){var a=t.charAt(0);return a=="*"||a=="+"&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,n){var a=e.history,s=n&&n.origin;i==a.lastSelOp||s&&a.lastSelOrigin==s&&(a.lastModTime==a.lastSelTime&&a.lastOrigin==s||ml(e,s,pe(a.done),t))?a.done[a.done.length-1]=t:Ho(t,a.done),a.lastSelTime=+new Date,a.lastSelOrigin=s,a.lastSelOp=i,n&&n.clearRedo!==!1&&Zr(a.undone)}function Ho(e,t){var i=pe(t);i&&i.ranges&&i.equals(e)||t.push(e)}function es(e,t,i,n){var a=t["spans_"+e.id],s=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(l){l.markedSpans&&((a||(a=t["spans_"+e.id]={}))[s]=l.markedSpans),++s})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var n=[],a=0;a<t.text.length;++a)n.push(vl(i[a]));return n}function ts(e,t){var i=yl(e,t),n=ri(e,t);if(!i)return n;if(!n)return i;for(var a=0;a<i.length;++a){var s=i[a],l=n[a];if(s&&l){e:for(var f=0;f<l.length;++f){for(var m=l[f],y=0;y<s.length;++y)if(s[y].marker==m.marker)continue e;s.push(m)}}else l&&(i[a]=l)}return i}function za(e,t,i){for(var n=[],a=0;a<e.length;++a){var s=e[a];if(s.ranges){n.push(i?Xi.prototype.deepCopy.call(s):s);continue}var l=s.changes,f=[];n.push({changes:f});for(var m=0;m<l.length;++m){var y=l[m],Z=void 0;if(f.push({from:y.from,to:y.to,text:y.text}),t)for(var ie in y)(Z=ie.match(/^spans_(\d+)$/))&&(Pe(t,Number(Z[1]))>-1&&(pe(f)[ie]=y[ie],delete y[ie]))}}return n}function gr(e,t,i,n){if(n){var a=e.anchor;if(i){var s=st(t,a)<0;s!=st(i,a)<0?(a=t,t=i):s!=st(t,i)<0&&(t=i)}return new Rn(a,t)}else return new Rn(i||t,t)}function zo(e,t,i,n,a){a==null&&(a=e.cm&&(e.cm.display.shift||e.extend)),Ri(e,new Xi([gr(e.sel.primary(),t,i,a)],0),n)}function ns(e,t,i){for(var n=[],a=e.cm&&(e.cm.display.shift||e.extend),s=0;s<e.sel.ranges.length;s++)n[s]=gr(e.sel.ranges[s],t[s],null,a);var l=ta(e.cm,n,e.sel.primIndex);Ri(e,l,i)}function vr(e,t,i,n){var a=e.sel.ranges.slice(0);a[t]=i,Ri(e,ta(e.cm,a,e.sel.primIndex),n)}function is(e,t,i,n){Ri(e,ba(t,i),n)}function bl(e,t,i){var n={ranges:t.ranges,update:function(a){this.ranges=[];for(var s=0;s<a.length;s++)this.ranges[s]=new Rn(o(e,a[s].anchor),o(e,a[s].head))},origin:i&&i.origin};return je(e,"beforeSelectionChange",e,n),e.cm&&je(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?ta(e.cm,n.ranges,n.ranges.length-1):t}function as(e,t,i){var n=e.history.done,a=pe(n);a&&a.ranges?(n[n.length-1]=t,Ko(e,t,i)):Ri(e,t,i)}function Ri(e,t,i){Ko(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function Ko(e,t,i){(q(e,"beforeSelectionChange")||e.cm&&q(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(st(t.primary().head,e.sel.primary().head)<0?-1:1);os(e,ss(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&Wa(e.cm)}function os(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,$(e.cm)),Tn(e,"cursorActivity",e)}function rs(e){os(e,ss(e,e.sel,null,!1))}function ss(e,t,i,n){for(var a,s=0;s<t.ranges.length;s++){var l=t.ranges[s],f=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[s],m=Vo(e,l.anchor,f&&f.anchor,i,n),y=Vo(e,l.head,f&&f.head,i,n);(a||m!=l.anchor||y!=l.head)&&(a||(a=t.ranges.slice(0,s)),a[s]=new Rn(m,y))}return a?ta(e.cm,a,t.primIndex):t}function Ka(e,t,i,n,a){var s=Ct(e,t.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var f=s.markedSpans[l],m=f.marker,y="selectLeft"in m?!m.selectLeft:m.inclusiveLeft,Z="selectRight"in m?!m.selectRight:m.inclusiveRight;if((f.from==null||(y?f.from<=t.ch:f.from<t.ch))&&(f.to==null||(Z?f.to>=t.ch:f.to>t.ch))){if(a&&(je(m,"beforeCursorEnter"),m.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!m.atomic)continue;if(i){var ie=m.find(n<0?1:-1),ke=void 0;if((n<0?Z:y)&&(ie=ls(e,ie,-n,ie&&ie.line==t.line?s:null)),ie&&ie.line==t.line&&(ke=st(ie,i))&&(n<0?ke<0:ke>0))return Ka(e,ie,t,n,a)}var ye=m.find(n<0?-1:1);return(n<0?y:Z)&&(ye=ls(e,ye,n,ye.line==t.line?s:null)),ye?Ka(e,ye,t,n,a):null}}return t}function Vo(e,t,i,n,a){var s=n||1,l=Ka(e,t,i,s,a)||!a&&Ka(e,t,i,s,!0)||Ka(e,t,i,-s,a)||!a&&Ka(e,t,i,-s,!0);return l||(e.cantEdit=!0,$e(e.first,0))}function ls(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,$e(t.line-1)):null:i>0&&t.ch==(n||Ct(e,t.line)).text.length?t.line<e.first+e.size-1?$e(t.line+1,0):null:new $e(t.line,t.ch+i)}function us(e){e.setSelection($e(e.firstLine(),0),$e(e.lastLine()),we)}function cs(e,t,i){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return i&&(n.update=function(a,s,l,f){a&&(n.from=o(e,a)),s&&(n.to=o(e,s)),l&&(n.text=l),f!==void 0&&(n.origin=f)}),je(e,"beforeChange",e,n),e.cm&&je(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function Va(e,t,i){if(e.cm){if(!e.cm.curOp)return bi(e.cm,Va)(e,t,i);if(e.cm.state.suppressEdits)return}if((q(e,"beforeChange")||e.cm&&q(e.cm,"beforeChange"))&&(t=cs(e,t,!0),!t))return;var n=Nn&&!i&&Hi(e,t.from,t.to);if(n)for(var a=n.length-1;a>=0;--a)ds(e,{from:n[a].from,to:n[a].to,text:a?[""]:t.text,origin:t.origin});else ds(e,t)}function ds(e,t){if(t.text.length==1&&t.text[0]==""&&st(t.from,t.to)==0)return;var i=hr(e,t);qr(e,t,i,e.cm?e.cm.curOp.id:NaN),go(e,t,i,ri(e,t));var n=[];Ea(e,function(a,s){!s&&Pe(n,a.history)==-1&&(ms(a.history,t),n.push(a.history)),go(a,t,null,ri(a,t))})}function Go(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var a=e.history,s,l=e.sel,f=t=="undo"?a.done:a.undone,m=t=="undo"?a.undone:a.done,y=0;y<f.length&&!(s=f[y],i?s.ranges&&!s.equals(e.sel):!s.ranges);y++);if(y==f.length)return;for(a.lastOrigin=a.lastSelOrigin=null;;)if(s=f.pop(),s.ranges){if(Ho(s,m),i&&!s.equals(e.sel)){Ri(e,s,{clearRedo:!1});return}l=s}else if(n){f.push(s);return}else break;var Z=[];Ho(l,m),m.push({changes:Z,generation:a.generation}),a.generation=s.generation||++a.maxGeneration;for(var ie=q(e,"beforeChange")||e.cm&&q(e.cm,"beforeChange"),ke=function(it){var ht=s.changes[it];if(ht.origin=t,ie&&!cs(e,ht,!1))return f.length=0,{};Z.push(mr(e,ht));var wt=it?hr(e,ht):pe(f);go(e,ht,wt,ts(e,ht)),!it&&e.cm&&e.cm.scrollIntoView({from:ht.from,to:_a(ht)});var jt=[];Ea(e,function(St,Wt){!Wt&&Pe(jt,St.history)==-1&&(ms(St.history,ht),jt.push(St.history)),go(St,ht,null,ts(St,ht))})},ye=s.changes.length-1;ye>=0;--ye){var Ge=ke(ye);if(Ge)return Ge.v}}function hs(e,t){if(t==0)return;if(e.first+=t,e.sel=new Xi(Ue(e.sel.ranges,function(a){return new Rn($e(a.anchor.line+t,a.anchor.ch),$e(a.head.line+t,a.head.ch))}),e.sel.primIndex),e.cm){Ui(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)va(e.cm,n,"gutter")}}function go(e,t,i,n){if(e.cm&&!e.cm.curOp)return bi(e.cm,go)(e,t,i,n);if(t.to.line<e.first){hs(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var a=t.text.length-1-(e.first-t.from.line);hs(e,a),t={from:$e(e.first,0),to:$e(t.to.line+a,t.to.ch),text:[pe(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:$e(s,Ct(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=tn(e,t.from,t.to),i||(i=hr(e,t)),e.cm?_l(e.cm,t,n):pr(e,t,n),Ko(e,i,we),e.cantEdit&&Vo(e,$e(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,i){var n=e.doc,a=e.display,s=t.from,l=t.to,f=!1,m=s.line;e.options.lineWrapping||(m=Xt(Zn(Ct(n,s.line))),n.iter(m,l.line+1,function(ye){if(ye==a.maxLine)return f=!0,!0})),n.sel.contains(t.from,t.to)>-1&&$(e),pr(n,t,i,Tr(e)),e.options.lineWrapping||(n.iter(m,s.line+t.text.length,function(ye){var Ge=ua(ye);Ge>a.maxLineLength&&(a.maxLine=ye,a.maxLineLength=Ge,a.maxLineChanged=!0,f=!1)}),f&&(e.curOp.updateMaxLine=!0)),cn(n,s.line),fo(e,400);var y=t.text.length-(l.line-s.line)-1;t.full?Ui(e):s.line==l.line&&t.text.length==1&&!Yr(e.doc,t)?va(e,s.line,"text"):Ui(e,s.line,l.line+1,y);var Z=q(e,"changes"),ie=q(e,"change");if(ie||Z){var ke={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};ie&&Tn(e,"change",e,ke),Z&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(ke)}e.display.selForContextMenu=null}function Ga(e,t,i,n,a){var s;n||(n=i),st(n,i)<0&&(s=[n,i],i=s[0],n=s[1]),typeof t=="string"&&(t=e.splitLines(t)),Va(e,{from:i,to:n,text:t,origin:a})}function fs(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function ps(e,t,i,n){for(var a=0;a<e.length;++a){var s=e[a],l=!0;if(s.ranges){s.copied||(s=e[a]=s.deepCopy(),s.copied=!0);for(var f=0;f<s.ranges.length;f++)fs(s.ranges[f].anchor,t,i,n),fs(s.ranges[f].head,t,i,n);continue}for(var m=0;m<s.changes.length;++m){var y=s.changes[m];if(i<y.from.line)y.from=$e(y.from.line+n,y.from.ch),y.to=$e(y.to.line+n,y.to.ch);else if(t<=y.to.line){l=!1;break}}l||(e.splice(0,a+1),a=0)}}function ms(e,t){var i=t.from.line,n=t.to.line,a=t.text.length-(n-i)-1;ps(e.done,i,n,a),ps(e.undone,i,n,a)}function vo(e,t,i,n){var a=t,s=t;return typeof t=="number"?s=Ct(e,d(e,t)):a=Xt(t),a==null?null:(n(s,a)&&e.cm&&va(e.cm,a,i),s)}function yo(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}yo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var a=this.lines[i];this.height-=a.height,eo(a),Tn(a,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,i){for(var n=e+t;e<n;++e)if(i(this.lines[e]))return!0}};function bo(e){this.children=e;for(var t=0,i=0,n=0;n<e.length;++n){var a=e[n];t+=a.chunkSize(),i+=a.height,a.parent=this}this.size=t,this.height=i,this.parent=null}bo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],a=n.chunkSize();if(e<a){var s=Math.min(t,a-e),l=n.height;if(n.removeInner(e,s),this.height-=l-n.height,a==s&&(this.children.splice(i--,1),n.parent=null),(t-=s)==0)break;e=0}else e-=a}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof yo))){var f=[];this.collapse(f),this.children=[new yo(f)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var a=this.children[n],s=a.chunkSize();if(e<=s){if(a.insertInner(e,t,i),a.lines&&a.lines.length>50){for(var l=a.lines.length%25+25,f=l;f<a.lines.length;){var m=new yo(a.lines.slice(f,f+=25));a.height-=m.height,this.children.splice(++n,0,m),m.parent=this}a.lines=a.lines.slice(0,l),this.maybeSpill()}break}e-=s}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new bo(t);if(e.parent){e.size-=i.size,e.height-=i.height;var a=Pe(e.parent.children,e);e.parent.children.splice(a+1,0,i)}else{var n=new bo(e.children);n.parent=e,e.children=[n,i],e=n}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;n<this.children.length;++n){var a=this.children[n],s=a.chunkSize();if(e<s){var l=Math.min(t,s-e);if(a.iterN(e,l,i))return!0;if((t-=l)==0)break;e=0}else e-=s}}};var _o=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};_o.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=Xt(i);if(n==null||!t)return;for(var a=0;a<t.length;++a)t[a]==this&&t.splice(a--,1);t.length||(i.widgets=null);var s=ga(this);ln(i,Math.max(0,i.height-s)),e&&(Ki(e,function(){gs(e,i,-s),va(e,n,"widget")}),Tn(e,"lineWidgetCleared",e,this,n))},_o.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var a=ga(this)-t;if(!a)return;Sn(this.doc,n)||ln(n,n.height+a),i&&Ki(i,function(){i.curOp.forceUpdate=!0,gs(i,n,a),Tn(i,"lineWidgetChanged",i,e,Xt(n))})},Q(_o);function gs(e,t,i){Ti(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&rr(e,i)}function El(e,t,i,n){var a=new _o(e,i,n),s=e.cm;return s&&a.noHScroll&&(s.display.alignWidgets=!0),vo(e,t,"widget",function(l){var f=l.widgets||(l.widgets=[]);if(a.insertAt==null?f.push(a):f.splice(Math.min(f.length-1,Math.max(0,a.insertAt)),0,a),a.line=l,s&&!Sn(e,l)){var m=Ti(l)<e.scrollTop;ln(l,l.height+ga(a)),m&&rr(s,a.height),s.curOp.forceUpdate=!0}return!0}),s&&Tn(s,"lineWidgetAdded",s,a,typeof t=="number"?t:Xt(t)),a}var vs=0,Ca=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++vs};Ca.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Da(e),q(this,"clear")){var i=this.find();i&&Tn(this,"clear",i.from,i.to)}for(var n=null,a=null,s=0;s<this.lines.length;++s){var l=this.lines[s],f=ti(l.markedSpans,this);e&&!this.collapsed?va(e,Xt(l),"text"):e&&(f.to!=null&&(a=Xt(l)),f.from!=null&&(n=Xt(l))),l.markedSpans=xi(l.markedSpans,f),f.from==null&&this.collapsed&&!Sn(this.doc,l)&&e&&ln(l,yi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var m=0;m<this.lines.length;++m){var y=Zn(this.lines[m]),Z=ua(y);Z>e.display.maxLineLength&&(e.display.maxLine=y,e.display.maxLineLength=Z,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Ui(e,n,a+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&rs(e.doc)),e&&Tn(e,"markerCleared",e,this,n,a),t&&Na(e),this.parent&&this.parent.clear()},Ca.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,a=0;a<this.lines.length;++a){var s=this.lines[a],l=ti(s.markedSpans,this);if(l.from!=null&&(i=$e(t?s:Xt(s),l.from),e==-1))return i;if(l.to!=null&&(n=$e(t?s:Xt(s),l.to),e==1))return n}return i&&{from:i,to:n}},Ca.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;Ki(n,function(){var a=t.line,s=Xt(t.line),l=mt(n,s);if(l&&(En(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Sn(i.doc,a)&&i.height!=null){var f=i.height;i.height=null;var m=ga(i)-f;m&&ln(a,a.height+m)}Tn(n,"markerChanged",n,e)})},Ca.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||Pe(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ca.prototype.detachLine=function(e){if(this.lines.splice(Pe(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Q(Ca);function Xa(e,t,i,n,a){if(n&&n.shared)return Cl(e,t,i,n,a);if(e.cm&&!e.cm.curOp)return bi(e.cm,Xa)(e,t,i,n,a);var s=new Ca(e,a),l=st(t,i);if(n&&p(n,s,!1),l>0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=J("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(ii(e,t.line,t,i,s)||t.line!=i.line&&ii(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");Wn()}s.addToHistory&&qr(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var f=t.line,m=e.cm,y;if(e.iter(f,i.line+1,function(ie){m&&s.collapsed&&!m.options.lineWrapping&&Zn(ie)==m.display.maxLine&&(y=!0),s.collapsed&&f!=t.line&&ln(ie,0),Fn(ie,new jn(s,f==t.line?t.ch:null,f==i.line?i.ch:null)),++f}),s.collapsed&&e.iter(t.line,i.line+1,function(ie){Sn(e,ie)&&ln(ie,0)}),s.clearOnEnter&&Ne(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(pn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++vs,s.atomic=!0),m){if(y&&(m.curOp.updateMaxLine=!0),s.collapsed)Ui(m,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var Z=t.line;Z<=i.line;Z++)va(m,Z,"text");s.atomic&&rs(m.doc),Tn(m,"markerAdded",m,s)}return s}var Eo=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Eo.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Tn(this,"clear")},Eo.prototype.find=function(e,t){return this.primary.find(e,t)},Q(Eo);function Cl(e,t,i,n,a){n=p(n),n.shared=!1;var s=[Xa(e,t,i,n,a)],l=s[0],f=n.widgetNode;return Ea(e,function(m){f&&(n.widgetNode=f.cloneNode(!0)),s.push(Xa(m,o(m,t),o(m,i),n,a));for(var y=0;y<m.linked.length;++y)if(m.linked[y].isParent)return;l=pe(s)}),new Eo(s,l)}function ys(e){return e.findMarks($e(e.first,0),e.clipPos($e(e.lastLine())),function(t){return t.parent})}function xl(e,t){for(var i=0;i<t.length;i++){var n=t[i],a=n.find(),s=e.clipPos(a.from),l=e.clipPos(a.to);if(st(s,l)){var f=Xa(e,s,l,n.primary,n.primary.type);n.markers.push(f),f.parent=n}}}function wl(e){for(var t=function(n){var a=e[n],s=[a.primary.doc];Ea(a.primary.doc,function(m){return s.push(m)});for(var l=0;l<a.markers.length;l++){var f=a.markers[l];Pe(s,f.doc)==-1&&(f.parent=null,a.markers.splice(l--,1))}},i=0;i<e.length;i++)t(i)}var Sl=0,Ii=function(e,t,i,n,a){if(!(this instanceof Ii))return new Ii(e,t,i,n,a);i==null&&(i=0),bo.call(this,[new yo([new oa("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var s=$e(i,0);this.sel=ba(s),this.history=new Wo(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=a=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),pr(this,{from:s,to:s,text:e}),Ri(this,ba(s),we)};Ii.prototype=De(bo.prototype,{constructor:Ii,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,n=0;n<t.length;++n)i+=t[n].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Nt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:_i(function(e){var t=$e(this.first,0),i=this.first+this.size-1;Va(this,{from:t,to:$e(i,Ct(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&lo(this.cm,0,0),Ri(this,ba(t),we)}),replaceRange:function(e,t,i,n){t=o(this,t),i=i?o(this,i):t,Ga(this,e,t,i,n)},getRange:function(e,t,i){var n=tn(this,o(this,e),o(this,t));return i===!1?n:n.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Kn(this,e))return Ct(this,e)},getLineNumber:function(e){return Xt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Ct(this,e)),Zn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return o(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:_i(function(e,t,i){is(this,o(this,typeof e=="number"?$e(e,t||0):e),null,i)}),setSelection:_i(function(e,t,i){is(this,o(this,e),o(this,t||e),i)}),extendSelection:_i(function(e,t,i){zo(this,o(this,e),t&&o(this,t),i)}),extendSelections:_i(function(e,t){ns(this,u(this,e),t)}),extendSelectionsBy:_i(function(e,t){var i=Ue(this.sel.ranges,e);ns(this,u(this,i),t)}),setSelections:_i(function(e,t,i){if(!e.length)return;for(var n=[],a=0;a<e.length;a++)n[a]=new Rn(o(this,e[a].anchor),o(this,e[a].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Ri(this,ta(this.cm,n,t),i)}),addSelection:_i(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Rn(o(this,e),o(this,t||e))),Ri(this,ta(this.cm,n,n.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,n=0;n<t.length;n++){var a=tn(this,t[n].from(),t[n].to());i=i?i.concat(a):a}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,n=0;n<i.length;n++){var a=tn(this,i[n].from(),i[n].to());e!==!1&&(a=a.join(e||this.lineSeparator())),t[n]=a}return t},replaceSelection:function(e,t,i){for(var n=[],a=0;a<this.sel.ranges.length;a++)n[a]=e;this.replaceSelections(n,t,i||"+input")},replaceSelections:_i(function(e,t,i){for(var n=[],a=this.sel,s=0;s<a.ranges.length;s++){var l=a.ranges[s];n[s]={from:l.from(),to:l.to(),text:this.splitLines(e[s]),origin:i}}for(var f=t&&t!="end"&&hl(this,n,t),m=n.length-1;m>=0;m--)Va(this,n[m]);f?as(this,f):this.cm&&Wa(this.cm)}),undo:_i(function(){Go(this,"undo")}),redo:_i(function(){Go(this,"redo")}),undoSelection:_i(function(){Go(this,"undo",!0)}),redoSelection:_i(function(){Go(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var a=0;a<e.undone.length;a++)e.undone[a].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Wo(this.history.maxGeneration),Ea(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:za(this.history.done),undone:za(this.history.undone)}},setHistory:function(e){var t=this.history=new Wo(this.history.maxGeneration);t.done=za(e.done.slice(0),null,!0),t.undone=za(e.undone.slice(0),null,!0)},setGutterMarker:_i(function(e,t,i){return vo(this,e,"gutter",function(n){var a=n.gutterMarkers||(n.gutterMarkers={});return a[t]=i,!i&&qe(a)&&(n.gutterMarkers=null),!0})}),clearGutter:_i(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&vo(t,i,"gutter",function(){return i.gutterMarkers[e]=null,qe(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Kn(this,e))return null;if(t=e,e=Ct(this,e),!e)return null}else if(t=Xt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:_i(function(e,t,i){return vo(this,e,t=="gutter"?"gutter":"class",function(n){var a=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[a])n[a]=i;else{if(ne(i).test(n[a]))return!1;n[a]+=" "+i}return!0})}),removeLineClass:_i(function(e,t,i){return vo(this,e,t=="gutter"?"gutter":"class",function(n){var a=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",s=n[a];if(s)if(i==null)n[a]=null;else{var l=s.match(ne(i));if(!l)return!1;var f=l.index+l[0].length;n[a]=s.slice(0,l.index)+(!l.index||f==s.length?"":" ")+s.slice(f)||null}else return!1;return!0})}),addLineWidget:_i(function(e,t,i){return El(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Xa(this,o(this,e),o(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=o(this,e),Xa(this,e,e,i,"bookmark")},findMarksAt:function(e){e=o(this,e);var t=[],i=Ct(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var a=i[n];(a.from==null||a.from<=e.ch)&&(a.to==null||a.to>=e.ch)&&t.push(a.marker.parent||a.marker)}return t},findMarks:function(e,t,i){e=o(this,e),t=o(this,t);var n=[],a=e.line;return this.iter(e.line,t.line+1,function(s){var l=s.markedSpans;if(l)for(var f=0;f<l.length;f++){var m=l[f];!(m.to!=null&&a==e.line&&e.ch>=m.to||m.from==null&&a!=e.line||m.from!=null&&a==t.line&&m.from>=t.ch)&&(!i||i(m.marker))&&n.push(m.marker.parent||m.marker)}++a}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)i[n].from!=null&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first,n=this.lineSeparator().length;return this.iter(function(a){var s=a.text.length+n;if(s>e)return t=e,!0;e-=s,++i}),o(this,$e(i,t))},indexFromPos:function(e){e=o(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+i}),t},copy:function(e){var t=new Ii(Nt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var n=new Ii(Nt(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],xl(n,ys(this)),n},unlinkDoc:function(e){if(e instanceof Gn&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(ys(this));break}if(e.history==this.history){var n=[e.id];Ea(e,function(a){return n.push(a.id)},!0),e.history=new Wo(null),e.history.done=za(this.history.done,n),e.history.undone=za(this.history.undone,n)}},iterLinkedDocs:function(e){Ea(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Et(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:_i(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),Ii.prototype.eachLine=Ii.prototype.iter;var bs=0;function kl(e){var t=this;if(_s(t),We(t,e)||qi(t.display,e))return;x(e),U&&(bs=+new Date);var i=Pa(t,e,!0),n=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var a=n.length,s=Array(a),l=0,f=function(){++l==a&&bi(t,function(){i=o(t.doc,i);var ye={from:i,to:i,text:t.doc.splitLines(s.filter(function(Ge){return Ge!=null}).join(t.doc.lineSeparator())),origin:"paste"};Va(t.doc,ye),as(t.doc,ba(o(t.doc,i),o(t.doc,_a(ye))))})()},m=function(ye,Ge){if(t.options.allowDropFileTypes&&Pe(t.options.allowDropFileTypes,ye.type)==-1){f();return}var it=new FileReader;it.onerror=function(){return f()},it.onload=function(){var ht=it.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(ht)){f();return}s[Ge]=ht,f()},it.readAsText(ye)},y=0;y<n.length;y++)m(n[y],y);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Z=e.dataTransfer.getData("Text");if(Z){var ie;if(t.state.draggingText&&!t.state.draggingText.copy&&(ie=t.listSelections()),Ko(t.doc,ba(i,i)),ie)for(var ke=0;ke<ie.length;++ke)Ga(t.doc,"",ie[ke].anchor,ie[ke].head,"drag");t.replaceSelection(Z,"around","paste"),t.display.input.focus()}}catch(ye){}}}function Rl(e,t){if(U&&(!e.state.draggingText||+new Date-bs<100)){I(t);return}if(We(e,t)||qi(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!te){var i=C("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",M&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),M&&i.parentNode.removeChild(i)}}function Ol(e,t){var i=Pa(e,t);if(!i)return;var n=document.createDocumentFragment();Mr(e,i,n),e.display.dragCursor||(e.display.dragCursor=C("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),w(e.display.dragCursor,n)}function _s(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Es(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],n=0;n<t.length;n++){var a=t[n].CodeMirror;a&&i.push(a)}i.length&&i[0].operation(function(){for(var s=0;s<i.length;s++)e(i[s])})}var Cs=!1;function Tl(){if(Cs)return;Pl(),Cs=!0}function Pl(){var e;Ne(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Es(Al)},100))}),Ne(window,"blur",function(){return Es(Fa)})}function Al(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var xa={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Co=0;Co<10;Co++)xa[Co+48]=xa[Co+96]=String(Co);for(var Xo=65;Xo<=90;Xo++)xa[Xo]=String.fromCharCode(Xo);for(var xo=1;xo<=12;xo++)xa[xo+111]=xa[xo+63235]="F"+xo;var fa={};fa.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},fa.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},fa.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},fa.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},fa.default=b?fa.macDefault:fa.pcDefault;function Ml(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,a,s,l=0;l<t.length-1;l++){var f=t[l];if(/^(cmd|meta|m)$/i.test(f))s=!0;else if(/^a(lt)?$/i.test(f))i=!0;else if(/^(c|ctrl|control)$/i.test(f))n=!0;else if(/^s(hift)?$/i.test(f))a=!0;else throw new Error("Unrecognized modifier name: "+f)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),s&&(e="Cmd-"+e),a&&(e="Shift-"+e),e}function Ll(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(n=="..."){delete e[i];continue}for(var a=Ue(i.split(" "),Ml),s=0;s<a.length;s++){var l=void 0,f=void 0;s==a.length-1?(f=a.join(" "),l=n):(f=a.slice(0,s+1).join(" "),l="...");var m=t[f];if(!m)t[f]=l;else if(m!=l)throw new Error("Inconsistent bindings for "+f)}delete e[i]}for(var y in t)e[y]=t[y];return e}function $a(e,t,i,n){t=$o(t);var a=t.call?t.call(e,n):t[e];if(a===!1)return"nothing";if(a==="...")return"multi";if(a!=null&&i(a))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return $a(e,t.fallthrough,i,n);for(var s=0;s<t.fallthrough.length;s++){var l=$a(e,t.fallthrough[s],i,n);if(l)return l}}}function xs(e){var t=typeof e=="string"?e:xa[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function ws(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(H?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(H?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function Ss(e,t){if(M&&e.keyCode==34&&e.char)return!1;var i=xa[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),ws(i,e,t))}function $o(e){return typeof e=="string"?fa[e]:e}function Ya(e,t){for(var i=e.doc.sel.ranges,n=[],a=0;a<i.length;a++){for(var s=t(i[a]);n.length&&st(s.from,pe(n).to)<=0;){var l=n.pop();if(st(l.from,s.from)<0){s.from=l.from;break}}n.push(s)}Ki(e,function(){for(var f=n.length-1;f>=0;f--)Ga(e.doc,"",n[f].from,n[f].to,"+delete");Wa(e)})}function yr(e,t,i){var n=Ve(e.text,t+i,i);return n<0||n>e.text.length?null:n}function br(e,t,i){var n=yr(e,t.ch,i);return n==null?null:new $e(t.line,n,i<0?"after":"before")}function _r(e,t,i,n,a){if(e){t.doc.direction=="rtl"&&(a=-a);var s=xt(i,t.doc.direction);if(s){var l=a<0?pe(s):s[0],f=a<0==(l.level==1),m=f?"after":"before",y;if(l.level>0||t.doc.direction=="rtl"){var Z=ft(t,i);y=a<0?i.text.length-1:0;var ie=yt(t,Z,y).top;y=At(function(ke){return yt(t,Z,ke).top==ie},a<0==(l.level==1)?l.from:l.to-1,y),m=="before"&&(y=yr(i,y,1))}else y=a<0?l.to:l.from;return new $e(n,y,m)}}return new $e(n,a<0?i.text.length:0,a<0?"before":"after")}function Dl(e,t,i,n){var a=xt(t,e.doc.direction);if(!a)return br(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var s=ct(a,i.ch,i.sticky),l=a[s];if(e.doc.direction=="ltr"&&l.level%2==0&&(n>0?l.to>i.ch:l.from<i.ch))return br(t,i,n);var f=function(wt,jt){return yr(t,wt instanceof $e?wt.ch:wt,jt)},m,y=function(wt){return e.options.lineWrapping?(m=m||ft(e,t),Mi(e,t,m,wt)):{begin:0,end:t.text.length}},Z=y(i.sticky=="before"?f(i,-1):i.ch);if(e.doc.direction=="rtl"||l.level==1){var ie=l.level==1==n<0,ke=f(i,ie?1:-1);if(ke!=null&&(ie?ke<=l.to&&ke<=Z.end:ke>=l.from&&ke>=Z.begin)){var ye=ie?"before":"after";return new $e(i.line,ke,ye)}}var Ge=function(wt,jt,St){for(var Wt=function(In,Ei){return Ei?new $e(i.line,f(In,1),"before"):new $e(i.line,In,"after")};wt>=0&&wt<a.length;wt+=jt){var Zt=a[wt],Yt=jt>0==(Zt.level!=1),sn=Yt?St.begin:f(St.end,-1);if(Zt.from<=sn&&sn<Zt.to)return Wt(sn,Yt);if(sn=Yt?Zt.from:f(Zt.to,-1),St.begin<=sn&&sn<St.end)return Wt(sn,Yt)}},it=Ge(s+n,n,Z);if(it)return it;var ht=n>0?Z.end:f(Z.begin,-1);return ht!=null&&!(n>0&&ht==t.text.length)&&(it=Ge(n>0?0:a.length-1,n,y(ht)),it)?it:null}var wo={selectAll:us,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),we)},killLine:function(e){return Ya(e,function(t){if(t.empty()){var i=Ct(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:$e(t.head.line+1,0)}:{from:t.head,to:$e(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ya(e,function(t){return{from:$e(t.from().line,0),to:o(e.doc,$e(t.to().line+1,0))}})},delLineLeft:function(e){return Ya(e,function(t){return{from:$e(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Ya(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return Ya(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection($e(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection($e(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return ks(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Rs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Nl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},K)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},K)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return n.ch<e.getLine(n.line).search(/\S/)?Rs(e,t.head):n},K)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),n=e.options.tabSize,a=0;a<i.length;a++){var s=i[a].from(),l=ue(e.getLine(s.line),s.ch,n);t.push(_(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ki(e,function(){for(var t=e.listSelections(),i=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var a=t[n].head,s=Ct(e.doc,a.line).text;if(s){if(a.ch==s.length&&(a=new $e(a.line,a.ch-1)),a.ch>0)a=new $e(a.line,a.ch+1),e.replaceRange(s.charAt(a.ch-1)+s.charAt(a.ch-2),$e(a.line,a.ch-2),a,"+transpose");else if(a.line>e.doc.first){var l=Ct(e.doc,a.line-1).text;l&&(a=new $e(a.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),$e(a.line-1,l.length-1),a,"+transpose"))}}i.push(new Rn(a,a))}e.setSelections(i)})},newlineAndIndent:function(e){return Ki(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Wa(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ks(e,t){var i=Ct(e.doc,t),n=Zn(i);return n!=i&&(t=Xt(n)),_r(!0,e,n,t,1)}function Nl(e,t){var i=Ct(e.doc,t),n=Yi(i);return n!=i&&(t=Xt(n)),_r(!0,e,i,t,-1)}function Rs(e,t){var i=ks(e,t.line),n=Ct(e.doc,i.line),a=xt(n,e.doc.direction);if(!a||a[0].level==0){var s=Math.max(i.ch,n.text.search(/\S/)),l=t.line==i.line&&t.ch<=s&&t.ch;return $e(i.line,l?0:s,i.sticky)}return i}function Yo(e,t,i){if(typeof t=="string"&&(t=wo[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,a=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),a=t(e)!=Te}finally{e.display.shift=n,e.state.suppressEdits=!1}return a}function jl(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var a=$a(t,e.state.keyMaps[n],i,e);if(a)return a}return e.options.extraKeys&&$a(t,e.options.extraKeys,i,e)||$a(t,e.options.keyMap,i,e)}var Ul=new Be;function So(e,t,i,n){var a=e.state.keySeq;if(a){if(xs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==a&&(e.state.keySeq=null,e.display.input.reset())}),Os(e,a+" "+t,i,n))return!0}return Os(e,t,i,n)}function Os(e,t,i,n){var a=jl(e,t,n);return a=="multi"&&(e.state.keySeq=t),a=="handled"&&Tn(e,"keyHandled",e,t,i),(a=="handled"||a=="multi")&&(x(i),ir(e)),!!a}function Ts(e,t){var i=Ss(t,!0);return i?t.shiftKey&&!e.state.keySeq?So(e,"Shift-"+i,t,function(n){return Yo(e,n,!0)})||So(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return Yo(e,n)}):So(e,i,t,function(n){return Yo(e,n)}):!1}function Il(e,t,i){return So(e,"'"+i+"'",t,function(n){return Yo(e,n,!0)})}var Er=null;function Ps(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=P(),We(t,e))return;U&&k<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=Ts(t,e);M&&(Er=n?i:null,!n&&i==88&&!Ft&&(b?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),se&&!b&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;ae(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(S(t,"CodeMirror-crosshair"),Rt(document,"keyup",i),Rt(document,"mouseover",i))}Ne(document,"keyup",i),Ne(document,"mouseover",i)}function As(e){e.keyCode==16&&(this.doc.sel.shift=!1),We(this,e)}function Ms(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(qi(t.display,e)||We(t,e)||e.ctrlKey&&!e.altKey||b&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(M&&i==Er){Er=null,x(e);return}if(M&&(!e.which||e.which<10)&&Ts(t,e))return;var a=String.fromCharCode(n==null?i:n);if(a=="\b")return;if(Il(t,e,a))return;t.display.input.onKeyPress(e)}var Fl=400,Cr=function(e,t,i){this.time=e,this.pos=t,this.button=i};Cr.prototype.compare=function(e,t,i){return this.time+Fl>e&&st(t,this.pos)==0&&i==this.button};var ko,Ro;function Wl(e,t){var i=+new Date;return Ro&&Ro.compare(i,e,t)?(ko=Ro=null,"triple"):ko&&ko.compare(i,e,t)?(Ro=new Cr(i,e,t),ko=null,"double"):(ko=new Cr(i,e,t),Ro=null,"single")}function Ls(e){var t=this,i=t.display;if(We(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,qi(i,e)){O||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(xr(t,e))return;var n=Pa(t,e),a=Ce(e),s=n?Wl(n,a):"single";if(window.focus(),a==1&&t.state.selectingText&&t.state.selectingText(e),n&&Hl(t,a,n,s,e))return;a==1?n?Kl(t,n,s,e):de(e)==i.scroller&&x(e):a==2?(n&&zo(t.doc,n),setTimeout(function(){return i.input.focus()},20)):a==3&&(g?t.display.input.onContextMenu(e):Dr(t))}function Hl(e,t,i,n,a){var s="Click";return n=="double"?s="Double"+s:n=="triple"&&(s="Triple"+s),s=(t==1?"Left":t==2?"Middle":"Right")+s,So(e,ws(s,a),a,function(l){if(typeof l=="string"&&(l=wo[l]),!l)return!1;var f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),f=l(e,i)!=Te}finally{e.state.suppressEdits=!1}return f})}function zl(e,t,i){var n=e.getOption("configureMouse"),a=n?n(e,t,i):{};if(a.unit==null){var s=fe?i.shiftKey&&i.metaKey:i.altKey;a.unit=s?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(a.extend==null||e.doc.extend)&&(a.extend=e.doc.extend||i.shiftKey),a.addNew==null&&(a.addNew=b?i.metaKey:i.ctrlKey),a.moveOnDrag==null&&(a.moveOnDrag=!(b?i.altKey:i.ctrlKey)),a}function Kl(e,t,i,n){U?setTimeout(D(Lr,e),0):e.curOp.focus=P();var a=zl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&Oe&&!e.isReadOnly()&&i=="single"&&(l=s.contains(t))>-1&&(st((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(st(l.to(),t)>0||t.xRel<0)?Vl(e,n,t,a):Gl(e,n,t,a)}function Vl(e,t,i,n){var a=e.display,s=!1,l=bi(e,function(y){O&&(a.scroller.draggable=!1),e.state.draggingText=!1,Rt(a.wrapper.ownerDocument,"mouseup",l),Rt(a.wrapper.ownerDocument,"mousemove",f),Rt(a.scroller,"dragstart",m),Rt(a.scroller,"drop",l),s||(x(y),n.addNew||zo(e.doc,i,null,null,n.extend),O&&!te||U&&k==9?setTimeout(function(){a.wrapper.ownerDocument.body.focus({preventScroll:!0}),a.input.focus()},20):a.input.focus())}),f=function(y){s=s||Math.abs(t.clientX-y.clientX)+Math.abs(t.clientY-y.clientY)>=10},m=function(){return s=!0};O&&(a.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,a.scroller.dragDrop&&a.scroller.dragDrop(),Ne(a.wrapper.ownerDocument,"mouseup",l),Ne(a.wrapper.ownerDocument,"mousemove",f),Ne(a.scroller,"dragstart",m),Ne(a.scroller,"drop",l),Dr(e),setTimeout(function(){return a.input.focus()},20)}function Ds(e,t,i){if(i=="char")return new Rn(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Rn($e(t.line,0),o(e.doc,$e(t.line+1,0)));var n=i(e,t);return new Rn(n.from,n.to)}function Gl(e,t,i,n){var a=e.display,s=e.doc;x(t);var l,f,m=s.sel,y=m.ranges;if(n.addNew&&!n.extend?(f=s.sel.contains(i),f>-1?l=y[f]:l=new Rn(i,i)):(l=s.sel.primary(),f=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new Rn(i,i)),i=Pa(e,t,!0,!0),f=-1;else{var Z=Ds(e,i,n.unit);n.extend?l=gr(l,Z.anchor,Z.head,n.extend):l=Z}n.addNew?f==-1?(f=y.length,Ri(s,ta(e,y.concat([l]),f),{scroll:!1,origin:"*mouse"})):y.length>1&&y[f].empty()&&n.unit=="char"&&!n.extend?(Ri(s,ta(e,y.slice(0,f).concat(y.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),m=s.sel):vr(s,f,l,X):(f=0,Ri(s,new Xi([l],0),X),m=s.sel);var ie=i;function ke(St){if(st(ie,St)==0)return;if(ie=St,n.unit=="rectangle"){for(var Wt=[],Zt=e.options.tabSize,Yt=ue(Ct(s,i.line).text,i.ch,Zt),sn=ue(Ct(s,St.line).text,St.ch,Zt),In=Math.min(Yt,sn),Ei=Math.max(Yt,sn),Qn=Math.min(i.line,St.line),Vi=Math.min(e.lastLine(),Math.max(i.line,St.line));Qn<=Vi;Qn++){var Bi=Ct(s,Qn).text,ui=le(Bi,In,Zt);In==Ei?Wt.push(new Rn($e(Qn,ui),$e(Qn,ui))):Bi.length>ui&&Wt.push(new Rn($e(Qn,ui),$e(Qn,le(Bi,Ei,Zt))))}Wt.length||Wt.push(new Rn(i,i)),Ri(s,ta(e,m.ranges.slice(0,f).concat(Wt),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(St)}else{var Fi=l,wi=Ds(e,St,n.unit),fi=Fi.anchor,ci;st(wi.anchor,fi)>0?(ci=wi.head,fi=Bn(Fi.from(),wi.anchor)):(ci=wi.anchor,fi=On(Fi.to(),wi.head));var ei=m.ranges.slice(0);ei[f]=Xl(e,new Rn(o(s,fi),ci)),Ri(s,ta(e,ei,f),X)}}var ye=a.wrapper.getBoundingClientRect(),Ge=0;function it(St){var Wt=++Ge,Zt=Pa(e,St,!0,n.unit=="rectangle");if(!Zt)return;if(st(Zt,ie)!=0){e.curOp.focus=P(),ke(Zt);var Yt=Uo(a,s);(Zt.line>=Yt.to||Zt.line<Yt.from)&&setTimeout(bi(e,function(){Ge==Wt&&it(St)}),150)}else{var sn=St.clientY<ye.top?-20:St.clientY>ye.bottom?20:0;sn&&setTimeout(bi(e,function(){if(Ge!=Wt)return;a.scroller.scrollTop+=sn,it(St)}),50)}}function ht(St){e.state.selectingText=!1,Ge=Infinity,St&&(x(St),a.input.focus()),Rt(a.wrapper.ownerDocument,"mousemove",wt),Rt(a.wrapper.ownerDocument,"mouseup",jt),s.history.lastSelOrigin=null}var wt=bi(e,function(St){St.buttons===0||!Ce(St)?ht(St):it(St)}),jt=bi(e,ht);e.state.selectingText=jt,Ne(a.wrapper.ownerDocument,"mousemove",wt),Ne(a.wrapper.ownerDocument,"mouseup",jt)}function Xl(e,t){var i=t.anchor,n=t.head,a=Ct(e.doc,i.line);if(st(i,n)==0&&i.sticky==n.sticky)return t;var s=xt(a);if(!s)return t;var l=ct(s,i.ch,i.sticky),f=s[l];if(f.from!=i.ch&&f.to!=i.ch)return t;var m=l+(f.from==i.ch==(f.level!=1)?0:1);if(m==0||m==s.length)return t;var y;if(n.line!=i.line)y=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Z=ct(s,n.ch,n.sticky),ie=Z-l||(n.ch-i.ch)*(f.level==1?-1:1);Z==m-1||Z==m?y=ie<0:y=ie>0}var ke=s[m+(y?-1:0)],ye=y==(ke.level==1),Ge=ye?ke.from:ke.to,it=ye?"after":"before";return i.ch==Ge&&i.sticky==it?t:new Rn(new $e(i.line,Ge,it),n)}function Ns(e,t,i,n){var a,s;if(t.touches)a=t.touches[0].clientX,s=t.touches[0].clientY;else try{a=t.clientX,s=t.clientY}catch(ke){return!1}if(a>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&x(t);var l=e.display,f=l.lineDiv.getBoundingClientRect();if(s>f.bottom||!q(e,i))return j(t);s-=f.top-l.viewOffset;for(var m=0;m<e.display.gutterSpecs.length;++m){var y=l.gutters.childNodes[m];if(y&&y.getBoundingClientRect().right>=a){var Z=hn(e.doc,s),ie=e.display.gutterSpecs[m];return je(e,i,e,Z,ie.className,t),j(t)}}}function xr(e,t){return Ns(e,t,"gutterClick",!0)}function js(e,t){if(qi(e.display,t)||$l(e,t))return;if(We(e,t,"contextmenu"))return;g||e.display.input.onContextMenu(t)}function $l(e,t){return q(e,"gutterContextMenu")?Ns(e,t,"gutterContextMenu",!1):!1}function Us(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Hn(e)}var Ja={toString:function(){return"CodeMirror.Init"}},Is={},Jo={};function Yl(e){var t=e.optionHandlers;function i(n,a,s,l){e.defaults[n]=a,s&&(t[n]=l?function(f,m,y){y!=Ja&&s(f,m,y)}:s)}e.defineOption=i,e.Init=Ja,i("value","",function(n,a){return n.setValue(a)},!0),i("mode",null,function(n,a){n.doc.modeOption=a,fr(n)},!0),i("indentUnit",2,fr,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){mo(n),Hn(n),Ui(n)},!0),i("lineSeparator",null,function(n,a){if(n.doc.lineSep=a,!a)return;var s=[],l=n.doc.first;n.doc.iter(function(m){for(var y=0;;){var Z=m.text.indexOf(a,y);if(Z==-1)break;y=Z+a.length,s.push($e(l,Z))}l++});for(var f=s.length-1;f>=0;f--)Ga(n.doc,a,s[f],$e(s[f].line,s[f].ch+a.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,a,s){n.state.specialChars=new RegExp(a.source+(a.test(" ")?"":"| "),"g"),s!=Ja&&n.refresh()}),i("specialCharPlaceholder",Ht,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",ee?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(n,a){return n.getInputField().spellcheck=a},!0),i("autocorrect",!1,function(n,a){return n.getInputField().autocorrect=a},!0),i("autocapitalize",!1,function(n,a){return n.getInputField().autocapitalize=a},!0),i("rtlMoveVisually",!Se),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Us(n),po(n)},!0),i("keyMap","default",function(n,a,s){var l=$o(a),f=s!=Ja&&$o(s);f&&f.detach&&f.detach(n,l),l.attach&&l.attach(n,f||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Ql,!0),i("gutters",[],function(n,a){n.display.gutterSpecs=dr(a,n.options.lineNumbers),po(n)},!0),i("fixedGutter",!0,function(n,a){n.display.gutters.style.left=a?ro(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return Ha(n)},!0),i("scrollbarStyle","native",function(n){Fr(n),Ha(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,a){n.display.gutterSpecs=dr(n.options.gutters,a),po(n)},!0),i("firstLineNumber",1,po,!0),i("lineNumberFormatter",function(n){return n},po,!0),i("showCursorWhenSelecting",!1,so,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,a){a=="nocursor"&&(Fa(n),n.display.input.blur()),n.display.input.readOnlyChanged(a)}),i("screenReaderLabel",null,function(n,a){a=a===""?null:a,n.display.input.screenReaderLabelChanged(a)}),i("disableInput",!1,function(n,a){a||n.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,so,!0),i("singleCursorHeightPerLine",!0,so,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,mo,!0),i("addModeClass",!1,mo,!0),i("pollInterval",100),i("undoDepth",200,function(n,a){return n.doc.history.undoDepth=a}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,mo,!0),i("moveInputWithCursor",!0,function(n,a){a||n.display.input.resetPosition()}),i("tabindex",null,function(n,a){return n.display.input.getField().tabIndex=a||""}),i("autofocus",null),i("direction","ltr",function(n,a){return n.doc.setDirection(a)},!0),i("phrases",null)}function Jl(e,t,i){var n=i&&i!=Ja;if(!t!=!n){var a=e.display.dragFunctions,s=t?Ne:Rt;s(e.display.scroller,"dragstart",a.start),s(e.display.scroller,"dragenter",a.enter),s(e.display.scroller,"dragover",a.over),s(e.display.scroller,"dragleave",a.leave),s(e.display.scroller,"drop",a.drop)}}function Ql(e){e.options.lineWrapping?(ae(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(S(e.display.wrapper,"CodeMirror-wrap"),Pi(e)),nr(e),Ui(e),Hn(e),setTimeout(function(){return Ha(e)},100)}function Gn(e,t){var i=this;if(!(this instanceof Gn))return new Gn(e,t);this.options=t=t?p(t):{},p(Is,t,!1);var n=t.value;typeof n=="string"?n=new Ii(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var a=new Gn.inputStyles[t.inputStyle](this),s=this.display=new cl(e,n,a,t);s.wrapper.CodeMirror=this,Us(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Fr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Be,keySeq:null,specialChars:null},t.autofocus&&!ee&&s.input.focus(),U&&k<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Zl(this),Tl(),Da(this),this.curOp.forceUpdate=!0,Jr(this,n),t.autofocus&&!ee||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&ar(i)},20):Fa(this);for(var l in Jo)Jo.hasOwnProperty(l)&&Jo[l](this,t[l],Ja);zr(this),t.finishInit&&t.finishInit(this);for(var f=0;f<wr.length;++f)wr[f](this);Na(this),O&&t.lineWrapping&&getComputedStyle(s.lineDiv).textRendering=="optimizelegibility"&&(s.lineDiv.style.textRendering="auto")}Gn.defaults=Is,Gn.optionHandlers=Jo;function Zl(e){var t=e.display;Ne(t.scroller,"mousedown",bi(e,Ls)),U&&k<11?Ne(t.scroller,"dblclick",bi(e,function(m){if(We(e,m))return;var y=Pa(e,m);if(!y||xr(e,m)||qi(e.display,m))return;x(m);var Z=e.findWordAt(y);zo(e.doc,Z.anchor,Z.head)})):Ne(t.scroller,"dblclick",function(m){return We(e,m)||x(m)}),Ne(t.scroller,"contextmenu",function(m){return js(e,m)}),Ne(t.input.getField(),"contextmenu",function(m){t.scroller.contains(m.target)||js(e,m)});var i,n={end:0};function a(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function s(m){if(m.touches.length!=1)return!1;var y=m.touches[0];return y.radiusX<=1&&y.radiusY<=1}function l(m,y){if(y.left==null)return!0;var Z=y.left-m.left,ie=y.top-m.top;return Z*Z+ie*ie>20*20}Ne(t.scroller,"touchstart",function(m){if(!We(e,m)&&!s(m)&&!xr(e,m)){t.input.ensurePolled(),clearTimeout(i);var y=+new Date;t.activeTouch={start:y,moved:!1,prev:y-n.end<=300?n:null},m.touches.length==1&&(t.activeTouch.left=m.touches[0].pageX,t.activeTouch.top=m.touches[0].pageY)}}),Ne(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ne(t.scroller,"touchend",function(m){var y=t.activeTouch;if(y&&!qi(t,m)&&y.left!=null&&!y.moved&&new Date-y.start<300){var Z=e.coordsChar(t.activeTouch,"page"),ie;!y.prev||l(y,y.prev)?ie=new Rn(Z,Z):!y.prev.prev||l(y,y.prev.prev)?ie=e.findWordAt(Z):ie=new Rn($e(Z.line,0),o(e.doc,$e(Z.line+1,0))),e.setSelection(ie.anchor,ie.head),e.focus(),x(m)}a()}),Ne(t.scroller,"touchcancel",a),Ne(t.scroller,"scroll",function(){t.scroller.clientHeight&&(uo(e,t.scroller.scrollTop),Ma(e,t.scroller.scrollLeft,!0),je(e,"scroll",e))}),Ne(t.scroller,"mousewheel",function(m){return Gr(e,m)}),Ne(t.scroller,"DOMMouseScroll",function(m){return Gr(e,m)}),Ne(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(m){We(e,m)||I(m)},over:function(m){We(e,m)||(Ol(e,m),I(m))},start:function(m){return Rl(e,m)},drop:bi(e,kl),leave:function(m){We(e,m)||_s(e)}};var f=t.input.getField();Ne(f,"keyup",function(m){return As.call(e,m)}),Ne(f,"keydown",bi(e,Ps)),Ne(f,"keypress",bi(e,Ms)),Ne(f,"focus",function(m){return ar(e,m)}),Ne(f,"blur",function(m){return Fa(e,m)})}var wr=[];Gn.defineInitHook=function(e){return wr.push(e)};function Oo(e,t,i,n){var a=e.doc,s;i==null&&(i="add"),i=="smart"&&(a.mode.indent?s=_e(e,t).state:i="prev");var l=e.options.tabSize,f=Ct(a,t),m=ue(f.text,null,l);f.stateAfter&&(f.stateAfter=null);var y=f.text.match(/^\s*/)[0],Z;if(!n&&!/\S/.test(f.text))Z=0,i="not";else if(i=="smart"&&(Z=a.mode.indent(s,f.text.slice(y.length),f.text),Z==Te||Z>150)){if(!n)return;i="prev"}i=="prev"?t>a.first?Z=ue(Ct(a,t-1).text,null,l):Z=0:i=="add"?Z=m+e.options.indentUnit:i=="subtract"?Z=m-e.options.indentUnit:typeof i=="number"&&(Z=m+i),Z=Math.max(0,Z);var ie="",ke=0;if(e.options.indentWithTabs)for(var ye=Math.floor(Z/l);ye;--ye)ke+=l,ie+=" ";if(ke<Z&&(ie+=_(Z-ke)),ie!=y)return Ga(a,ie,$e(t,0),$e(t,y.length),"+input"),f.stateAfter=null,!0;for(var Ge=0;Ge<a.sel.ranges.length;Ge++){var it=a.sel.ranges[Ge];if(it.head.line==t&&it.head.ch<y.length){var ht=$e(t,y.length);vr(a,Ge,new Rn(ht,ht));break}}}var na=null;function Qo(e){na=e}function Sr(e,t,i,n,a){var s=e.doc;e.display.shift=!1,n||(n=s.sel);var l=+new Date-200,f=a=="paste"||e.state.pasteIncoming>l,m=Et(t),y=null;if(f&&n.ranges.length>1)if(na&&na.text.join(`
`)==t){if(n.ranges.length%na.text.length==0){y=[];for(var Z=0;Z<na.text.length;Z++)y.push(s.splitLines(na.text[Z]))}}else m.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(y=Ue(m,function(wt){return[wt]}));for(var ie=e.curOp.updateInput,ke=n.ranges.length-1;ke>=0;ke--){var ye=n.ranges[ke],Ge=ye.from(),it=ye.to();ye.empty()&&(i&&i>0?Ge=$e(Ge.line,Ge.ch-i):e.state.overwrite&&!f?it=$e(it.line,Math.min(Ct(s,it.line).text.length,it.ch+pe(m).length)):f&&na&&na.lineWise&&na.text.join(`
`)==m.join(`
`)&&(Ge=it=$e(Ge.line,0)));var ht={from:Ge,to:it,text:y?y[ke%y.length]:m,origin:a||(f?"paste":e.state.cutIncoming>l?"cut":"+input")};Va(e.doc,ht),Tn(e,"inputRead",e,ht)}t&&!f&&Fs(e,t),Wa(e),e.curOp.updateInput<2&&(e.curOp.updateInput=ie),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Bs(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Ki(t,function(){return Sr(t,i,0,null,"paste")}),!0}function Fs(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var a=i.ranges[n];if(a.head.ch>100||n&&i.ranges[n-1].head.line==a.head.line)continue;var s=e.getModeAt(a.head),l=!1;if(s.electricChars){for(var f=0;f<s.electricChars.length;f++)if(t.indexOf(s.electricChars.charAt(f))>-1){l=Oo(e,a.head.line,"smart");break}}else s.electricInput&&(s.electricInput.test(Ct(e.doc,a.head.line).text.slice(0,a.head.ch))&&(l=Oo(e,a.head.line,"smart")));l&&Tn(e,"electricInput",e,a.head.line)}}function Ws(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var a=e.doc.sel.ranges[n].head.line,s={anchor:$e(a,0),head:$e(a+1,0)};i.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:i}}function Hs(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function zs(){var e=C("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=C("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return O?e.style.width="1000px":e.setAttribute("wrap","off"),G&&(e.style.border="1px solid black"),Hs(e),t}function ql(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,a){var s=this.options,l=s[n];if(s[n]==a&&n!="mode")return;s[n]=a,t.hasOwnProperty(n)&&bi(this,t[n])(this,a,l),je(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,a){this.state.keyMaps[a?"push":"unshift"]($o(n))},removeKeyMap:function(n){for(var a=this.state.keyMaps,s=0;s<a.length;++s)if(a[s]==n||a[s].name==n)return a.splice(s,1),!0},addOverlay:Di(function(n,a){var s=n.token?n:e.getMode(this.options,n);if(s.startState)throw new Error("Overlays may not be stateful.");Ze(this.state.overlays,{mode:s,modeSpec:n,opaque:a&&a.opaque,priority:a&&a.priority||0},function(l){return l.priority}),this.state.modeGen++,Ui(this)}),removeOverlay:Di(function(n){for(var a=this.state.overlays,s=0;s<a.length;++s){var l=a[s].modeSpec;if(l==n||typeof n=="string"&&l.name==n){a.splice(s,1),this.state.modeGen++,Ui(this);return}}}),indentLine:Di(function(n,a,s){typeof a!="string"&&typeof a!="number"&&(a==null?a=this.options.smartIndent?"smart":"prev":a=a?"add":"subtract"),Kn(this.doc,n)&&Oo(this,n,a,s)}),indentSelection:Di(function(n){for(var a=this.doc.sel.ranges,s=-1,l=0;l<a.length;l++){var f=a[l];if(f.empty())f.head.line>s&&(Oo(this,f.head.line,n,!0),s=f.head.line,l==this.doc.sel.primIndex&&Wa(this));else{var m=f.from(),y=f.to(),Z=Math.max(s,m.line);s=Math.min(this.lastLine(),y.line-(y.ch?0:1))+1;for(var ie=Z;ie<s;++ie)Oo(this,ie,n);var ke=this.doc.sel.ranges;m.ch==0&&a.length==ke.length&&ke[l].from().ch>0&&vr(this.doc,l,new Rn(m,ke[l].to()),we)}}}),getTokenAt:function(n,a){return Ot(this,n,a)},getLineTokens:function(n,a){return Ot(this,$e(n),a,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var a=Je(this,Ct(this.doc,n.line)),s=0,l=(a.length-1)/2,f=n.ch,m;if(f==0)m=a[2];else for(;;){var y=s+l>>1;if((y?a[y*2-1]:0)>=f)l=y;else if(a[y*2+1]<f)s=y+1;else{m=a[y*2+2];break}}var Z=m?m.indexOf("overlay "):-1;return Z<0?m:Z==0?null:m.slice(0,Z-1)},getModeAt:function(n){var a=this.doc.mode;return a.innerMode?e.innerMode(a,this.getTokenAt(n).state).mode:a},getHelper:function(n,a){return this.getHelpers(n,a)[0]},getHelpers:function(n,a){var s=[];if(!i.hasOwnProperty(a))return s;var l=i[a],f=this.getModeAt(n);if(typeof f[a]=="string")l[f[a]]&&s.push(l[f[a]]);else if(f[a])for(var m=0;m<f[a].length;m++){var y=l[f[a][m]];y&&s.push(y)}else f.helperType&&l[f.helperType]?s.push(l[f.helperType]):l[f.name]&&s.push(l[f.name]);for(var Z=0;Z<l._global.length;Z++){var ie=l._global[Z];ie.pred(f,this)&&Pe(s,ie.val)==-1&&s.push(ie.val)}return s},getStateAfter:function(n,a){var s=this.doc;return n=d(s,n==null?s.first+s.size-1:n),_e(this,n+1,a).state},cursorCoords:function(n,a){var s,l=this.doc.sel.primary();return n==null?s=l.head:typeof n=="object"?s=o(this.doc,n):s=n?l.from():l.to(),en(this,s,a||"page")},charCoords:function(n,a){return Ai(this,o(this.doc,n),a||"page")},coordsChar:function(n,a){return n=mi(this,n,a||"page"),gi(this,n.left,n.top)},lineAtHeight:function(n,a){return n=mi(this,{top:n,left:0},a||"page").top,hn(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,a,s){var l=!1,f;if(typeof n=="number"){var m=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>m&&(n=m,l=!0),f=Ct(this.doc,n)}else f=n;return qn(this,f,{top:0,left:0},a||"page",s||l).top+(l?this.doc.height-Ti(f):0)},defaultTextHeight:function(){return yi(this.display)},defaultCharWidth:function(){return ji(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,a,s,l,f){var m=this.display;n=en(this,o(this.doc,n));var y=n.bottom,Z=n.left;if(a.style.position="absolute",a.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(a),m.sizer.appendChild(a),l=="over")y=n.top;else if(l=="above"||l=="near"){var ie=Math.max(m.wrapper.clientHeight,this.doc.height),ke=Math.max(m.sizer.clientWidth,m.lineSpace.clientWidth);(l=="above"||n.bottom+a.offsetHeight>ie)&&n.top>a.offsetHeight?y=n.top-a.offsetHeight:n.bottom+a.offsetHeight<=ie&&(y=n.bottom),Z+a.offsetWidth>ke&&(Z=ke-a.offsetWidth)}a.style.top=y+"px",a.style.left=a.style.right="",f=="right"?(Z=m.sizer.clientWidth-a.offsetWidth,a.style.right="0px"):(f=="left"?Z=0:f=="middle"&&(Z=(m.sizer.clientWidth-a.offsetWidth)/2),a.style.left=Z+"px"),s&&Js(this,{left:Z,top:y,right:Z+a.offsetWidth,bottom:y+a.offsetHeight})},triggerOnKeyDown:Di(Ps),triggerOnKeyPress:Di(Ms),triggerOnKeyUp:As,triggerOnMouseDown:Di(Ls),execCommand:function(n){if(wo.hasOwnProperty(n))return wo[n].call(null,this)},triggerElectric:Di(function(n){Fs(this,n)}),findPosH:function(n,a,s,l){var f=1;a<0&&(f=-1,a=-a);for(var m=o(this.doc,n),y=0;y<a&&!(m=kr(this.doc,m,f,s,l),m.hitSide);++y);return m},moveH:Di(function(n,a){var s=this;this.extendSelectionsBy(function(l){return s.display.shift||s.doc.extend||l.empty()?kr(s.doc,l.head,n,a,s.options.rtlMoveVisually):n<0?l.from():l.to()},K)}),deleteH:Di(function(n,a){var s=this.doc.sel,l=this.doc;s.somethingSelected()?l.replaceSelection("",null,"+delete"):Ya(this,function(f){var m=kr(l,f.head,n,a,!1);return n<0?{from:m,to:f.head}:{from:f.head,to:m}})}),findPosV:function(n,a,s,l){var f=1,m=l;a<0&&(f=-1,a=-a);for(var y=o(this.doc,n),Z=0;Z<a;++Z){var ie=en(this,y,"div");if(m==null?m=ie.left:ie.left=m,y=Ks(this,ie,f,s),y.hitSide)break}return y},moveV:Di(function(n,a){var s=this,l=this.doc,f=[],m=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(Z){if(m)return n<0?Z.from():Z.to();var ie=en(s,Z.head,"div");Z.goalColumn!=null&&(ie.left=Z.goalColumn),f.push(ie.left);var ke=Ks(s,ie,n,a);return a=="page"&&Z==l.sel.primary()&&rr(s,Ai(s,ke,"div").top-ie.top),ke},K),f.length)for(var y=0;y<l.sel.ranges.length;y++)l.sel.ranges[y].goalColumn=f[y]}),findWordAt:function(n){var a=this.doc,s=Ct(a,n.line).text,l=n.ch,f=n.ch;if(s){var m=this.getHelper(n,"wordChars");(n.sticky=="before"||f==s.length)&&l?--l:++f;for(var y=s.charAt(l),Z=Xe(y,m)?function(ie){return Xe(ie,m)}:/\s/.test(y)?function(ie){return/\s/.test(ie)}:function(ie){return!/\s/.test(ie)&&!Xe(ie)};l>0&&Z(s.charAt(l-1));)--l;for(;f<s.length&&Z(s.charAt(f));)++f}return new Rn($e(n.line,l),$e(n.line,f))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?ae(this.display.cursorDiv,"CodeMirror-overwrite"):S(this.display.cursorDiv,"CodeMirror-overwrite"),je(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==P()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Di(function(n,a){lo(this,n,a)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-Zi(this)-this.display.barHeight,width:n.scrollWidth-Zi(this)-this.display.barWidth,clientHeight:Ta(this),clientWidth:ea(this)}},scrollIntoView:Di(function(n,a){n==null?(n={from:this.doc.sel.primary().head,to:null},a==null&&(a=this.options.cursorScrollMargin)):typeof n=="number"?n={from:$e(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=a||0,n.from.line!=null?Qs(this,n):jr(this,n.from,n.to,n.margin)}),setSize:Di(function(n,a){var s=this,l=function(m){return typeof m=="number"||/^\d+$/.test(String(m))?m+"px":m};n!=null&&(this.display.wrapper.style.width=l(n)),a!=null&&(this.display.wrapper.style.height=l(a)),this.options.lineWrapping&&ai(this);var f=this.display.viewFrom;this.doc.iter(f,this.display.viewTo,function(m){if(m.widgets){for(var y=0;y<m.widgets.length;y++)if(m.widgets[y].noHScroll){va(s,f,"widget");break}}++f}),this.curOp.forceUpdate=!0,je(this,"refresh",this)}),operation:function(n){return Ki(this,n)},startOperation:function(){return Da(this)},endOperation:function(){return Na(this)},refresh:Di(function(){var n=this.display.cachedTextHeight;Ui(this),this.curOp.forceUpdate=!0,Hn(this),lo(this,this.doc.scrollLeft,this.doc.scrollTop),ur(this.display),(n==null||Math.abs(n-yi(this.display))>.5||this.options.lineWrapping)&&nr(this),je(this,"refresh",this)}),swapDoc:Di(function(n){var a=this.doc;return a.cm=null,this.state.selectingText&&this.state.selectingText(),Jr(this,n),Hn(this),this.display.input.reset(),lo(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,Tn(this,"swapDoc",this,a),a}),phrase:function(n){var a=this.options.phrases;return a&&Object.prototype.hasOwnProperty.call(a,n)?a[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Q(e),e.registerHelper=function(n,a,s){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][a]=s},e.registerGlobalHelper=function(n,a,s,l){e.registerHelper(n,a,l),i[n]._global.push({pred:s,val:l})}}function kr(e,t,i,n,a){var s=t,l=i,f=Ct(e,t.line),m=a&&e.direction=="rtl"?-i:i;function y(){var jt=t.line+m;return jt<e.first||jt>=e.first+e.size?!1:(t=new $e(jt,t.ch,t.sticky),f=Ct(e,jt))}function Z(jt){var St;if(n=="codepoint"){var Wt=f.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(Wt)?St=null:St=new $e(t.line,Math.max(0,Math.min(f.text.length,t.ch+i*(Wt>=55296&&Wt<56320?2:1))),-i)}else a?St=Dl(e.cm,f,t,i):St=br(f,t,i);if(St==null)if(!jt&&y())t=_r(a,e.cm,f,t.line,m);else return!1;else t=St;return!0}if(n=="char"||n=="codepoint")Z();else if(n=="column")Z(!0);else if(n=="word"||n=="group")for(var ie=null,ke=n=="group",ye=e.cm&&e.cm.getHelper(t,"wordChars"),Ge=!0;!(i<0&&!Z(!Ge));Ge=!1){var it=f.text.charAt(t.ch)||`
`,ht=Xe(it,ye)?"w":ke&&it==`
`?"n":!ke||/\s/.test(it)?null:"p";if(ke&&!Ge&&!ht&&(ht="s"),ie&&ie!=ht){i<0&&(i=1,Z(),t.sticky="after");break}if(ht&&(ie=ht),i>0&&!Z(!Ge))break}var wt=Vo(e,t,s,l,!0);return fn(s,wt)&&(wt.hitSide=!0),wt}function Ks(e,t,i,n){var a=e.doc,s=t.left,l;if(n=="page"){var f=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),m=Math.max(f-.5*yi(e.display),3);l=(i>0?t.bottom:t.top)+i*m}else n=="line"&&(l=i>0?t.bottom+3:t.top-3);for(var y;!(y=gi(e,s,l),!y.outside);){if(i<0?l<=0:l>=a.height){y.hitSide=!0;break}l+=i*5}return y}var Dn=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Be,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Dn.prototype.init=function(e){var t=this,i=this,n=i.cm,a=i.div=e.lineDiv;Hs(a,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function s(f){for(var m=f.target;m;m=m.parentNode){if(m==a)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(m.className))break}return!1}Ne(a,"paste",function(f){if(!s(f)||We(n,f)||Bs(f,n))return;k<=11&&setTimeout(bi(n,function(){return t.updateFromDOM()}),20)}),Ne(a,"compositionstart",function(f){t.composing={data:f.data,done:!1}}),Ne(a,"compositionupdate",function(f){t.composing||(t.composing={data:f.data,done:!1})}),Ne(a,"compositionend",function(f){t.composing&&(f.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ne(a,"touchstart",function(){return i.forceCompositionEnd()}),Ne(a,"input",function(){t.composing||t.readFromDOMSoon()});function l(f){if(!s(f)||We(n,f))return;if(n.somethingSelected())Qo({lineWise:!1,text:n.getSelections()}),f.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var m=Ws(n);Qo({lineWise:!0,text:m.text}),f.type=="cut"&&n.operation(function(){n.setSelections(m.ranges,0,we),n.replaceSelection("",null,"cut")})}else return;if(f.clipboardData){f.clipboardData.clearData();var y=na.text.join(`
`);if(f.clipboardData.setData("Text",y),f.clipboardData.getData("Text")==y){f.preventDefault();return}}var Z=zs(),ie=Z.firstChild;n.display.lineSpace.insertBefore(Z,n.display.lineSpace.firstChild),ie.value=na.text.join(`
`);var ke=document.activeElement;be(ie),setTimeout(function(){n.display.lineSpace.removeChild(Z),ke.focus(),ke==a&&i.showPrimarySelection()},50)}Ne(a,"copy",l),Ne(a,"cut",l)},Dn.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Dn.prototype.prepareSelection=function(){var e=Ar(this.cm,!1);return e.focus=document.activeElement==this.div,e},Dn.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Dn.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Dn.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),a=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||a.line<t.display.viewFrom){e.removeAllRanges();return}var s=Zo(t,e.anchorNode,e.anchorOffset),l=Zo(t,e.focusNode,e.focusOffset);if(s&&!s.bad&&l&&!l.bad&&st(Bn(s,l),n)==0&&st(On(s,l),a)==0)return;var f=t.display.view,m=n.line>=t.display.viewFrom&&Vs(t,n)||{node:f[0].measure.map[2],offset:0},y=a.line<t.display.viewTo&&Vs(t,a);if(!y){var Z=f[f.length-1].measure,ie=Z.maps?Z.maps[Z.maps.length-1]:Z.map;y={node:ie[ie.length-1],offset:ie[ie.length-2]-ie[ie.length-3]}}if(!m||!y){e.removeAllRanges();return}var ke=e.rangeCount&&e.getRangeAt(0),ye;try{ye=z(m.node,m.offset,y.offset,y.node)}catch(Ge){}ye&&(!se&&t.state.focused?(e.collapse(m.node,m.offset),ye.collapsed||(e.removeAllRanges(),e.addRange(ye))):(e.removeAllRanges(),e.addRange(ye)),ke&&e.anchorNode==null?e.addRange(ke):se&&this.startGracePeriod()),this.rememberSelection()},Dn.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Dn.prototype.showMultipleSelections=function(e){w(this.cm.display.cursorDiv,e.cursors),w(this.cm.display.selectionDiv,e.selection)},Dn.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Dn.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return E(this.div,t)},Dn.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Dn.prototype.blur=function(){this.div.blur()},Dn.prototype.getField=function(){return this.div},Dn.prototype.supportsTouch=function(){return!0},Dn.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Ki(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},Dn.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Dn.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(W&&A&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var i=Zo(t,e.anchorNode,e.anchorOffset),n=Zo(t,e.focusNode,e.focusOffset);i&&n&&Ki(t,function(){Ri(t.doc,ba(i,n),we),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},Dn.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),n=i.from(),a=i.to();if(n.ch==0&&n.line>e.firstLine()&&(n=$e(n.line-1,Ct(e.doc,n.line-1).length)),a.ch==Ct(e.doc,a.line).text.length&&a.line<e.lastLine()&&(a=$e(a.line+1,0)),n.line<t.viewFrom||a.line>t.viewTo-1)return!1;var s,l,f;n.line==t.viewFrom||(s=Aa(e,n.line))==0?(l=Xt(t.view[0].line),f=t.view[0].node):(l=Xt(t.view[s].line),f=t.view[s-1].node.nextSibling);var m=Aa(e,a.line),y,Z;if(m==t.view.length-1?(y=t.viewTo-1,Z=t.lineDiv.lastChild):(y=Xt(t.view[m+1].line)-1,Z=t.view[m+1].node.previousSibling),!f)return!1;for(var ie=e.doc.splitLines(tu(e,f,Z,l,y)),ke=tn(e.doc,$e(l,0),$e(y,Ct(e.doc,y).text.length));ie.length>1&&ke.length>1;)if(pe(ie)==pe(ke))ie.pop(),ke.pop(),y--;else if(ie[0]==ke[0])ie.shift(),ke.shift(),l++;else break;for(var ye=0,Ge=0,it=ie[0],ht=ke[0],wt=Math.min(it.length,ht.length);ye<wt&&it.charCodeAt(ye)==ht.charCodeAt(ye);)++ye;for(var jt=pe(ie),St=pe(ke),Wt=Math.min(jt.length-(ie.length==1?ye:0),St.length-(ke.length==1?ye:0));Ge<Wt&&jt.charCodeAt(jt.length-Ge-1)==St.charCodeAt(St.length-Ge-1);)++Ge;if(ie.length==1&&ke.length==1&&l==n.line)for(;ye&&ye>n.ch&&jt.charCodeAt(jt.length-Ge-1)==St.charCodeAt(St.length-Ge-1);)ye--,Ge++;ie[ie.length-1]=jt.slice(0,jt.length-Ge).replace(/^\u200b+/,""),ie[0]=ie[0].slice(ye).replace(/\u200b+$/,"");var Zt=$e(l,ye),Yt=$e(y,ke.length?pe(ke).length-Ge:0);if(ie.length>1||ie[0]||st(Zt,Yt))return Ga(e.doc,ie,Zt,Yt,"+input"),!0},Dn.prototype.ensurePolled=function(){this.forceCompositionEnd()},Dn.prototype.reset=function(){this.forceCompositionEnd()},Dn.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Dn.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},Dn.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ki(this.cm,function(){return Ui(e.cm)})},Dn.prototype.setUneditable=function(e){e.contentEditable="false"},Dn.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||bi(this.cm,Sr)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Dn.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Dn.prototype.onContextMenu=function(){},Dn.prototype.resetPosition=function(){},Dn.prototype.needsContentAttribute=!0;function Vs(e,t){var i=mt(e,t.line);if(!i||i.hidden)return null;var n=Ct(e.doc,t.line),a=rt(i,n,t.line),s=xt(n,e.doc.direction),l="left";if(s){var f=ct(s,t.ch);l=f%2?"right":"left"}var m=on(a.map,t.ch,l);return m.offset=m.collapse=="right"?m.end:m.start,m}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Qa(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,a){var s="",l=!1,f=e.doc.lineSeparator(),m=!1;function y(ye){return function(Ge){return Ge.id==ye}}function Z(){l&&(s+=f,m&&(s+=f),l=m=!1)}function ie(ye){ye&&(Z(),s+=ye)}function ke(ye){if(ye.nodeType==1){var Ge=ye.getAttribute("cm-text");if(Ge){ie(Ge);return}var it=ye.getAttribute("cm-marker"),ht;if(it){var wt=e.findMarks($e(n,0),$e(a+1,0),y(+it));wt.length&&(ht=wt[0].find(0))&&ie(tn(e.doc,ht.from,ht.to).join(f));return}if(ye.getAttribute("contenteditable")=="false")return;var jt=/^(pre|div|p|li|table|br)$/i.test(ye.nodeName);if(!/^br$/i.test(ye.nodeName)&&ye.textContent.length==0)return;jt&&Z();for(var St=0;St<ye.childNodes.length;St++)ke(ye.childNodes[St]);/^(pre|p)$/i.test(ye.nodeName)&&(m=!0),jt&&(l=!0)}else ye.nodeType==3&&ie(ye.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(ke(t),t==i);)t=t.nextSibling,m=!1;return s}function Zo(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return Qa(e.clipPos($e(e.display.viewTo-1)),!0);t=null,i=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var a=0;a<e.display.view.length;a++){var s=e.display.view[a];if(s.node==n)return nu(s,t,i)}}function nu(e,t,i){var n=e.text.firstChild,a=!1;if(!t||!E(n,t))return Qa($e(Xt(e.line),0),!0);if(t==n&&(a=!0,t=n.childNodes[i],i=0,!t)){var s=e.rest?pe(e.rest):e.line;return Qa($e(Xt(s),s.text.length),a)}var l=t.nodeType==3?t:null,f=t;for(!l&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(l=t.firstChild,i&&(i=l.nodeValue.length));f.parentNode!=n;)f=f.parentNode;var m=e.measure,y=m.maps;function Z(ht,wt,jt){for(var St=-1;St<(y?y.length:0);St++)for(var Wt=St<0?m.map:y[St],Zt=0;Zt<Wt.length;Zt+=3){var Yt=Wt[Zt+2];if(Yt==ht||Yt==wt){var sn=Xt(St<0?e.line:e.rest[St]),In=Wt[Zt]+jt;return(jt<0||Yt!=ht)&&(In=Wt[Zt+(jt?1:0)]),$e(sn,In)}}}var ie=Z(l,f,i);if(ie)return Qa(ie,a);for(var ke=f.nextSibling,ye=l?l.nodeValue.length-i:0;ke;ke=ke.nextSibling){if(ie=Z(ke,ke.firstChild,0),ie)return Qa($e(ie.line,ie.ch-ye),a);ye+=ke.textContent.length}for(var Ge=f.previousSibling,it=i;Ge;Ge=Ge.previousSibling){if(ie=Z(Ge,Ge.firstChild,-1),ie)return Qa($e(ie.line,ie.ch+it),a);it+=Ge.textContent.length}}var oi=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Be,this.hasSelection=!1,this.composing=null};oi.prototype.init=function(e){var t=this,i=this,n=this.cm;this.createField(e);var a=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),G&&(a.style.width="0px"),Ne(a,"input",function(){U&&k>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Ne(a,"paste",function(l){if(We(n,l)||Bs(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if(We(n,l))return;if(n.somethingSelected())Qo({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var f=Ws(n);Qo({lineWise:!0,text:f.text}),l.type=="cut"?n.setSelections(f.ranges,null,we):(i.prevInput="",a.value=f.text.join(`
`),be(a))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}Ne(a,"cut",s),Ne(a,"copy",s),Ne(e.scroller,"paste",function(l){if(qi(e,l)||We(n,l))return;if(!a.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var f=new Event("paste");f.clipboardData=l.clipboardData,a.dispatchEvent(f)}),Ne(e.lineSpace,"selectstart",function(l){qi(e,l)||x(l)}),Ne(a,"compositionstart",function(){var l=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:l,range:n.markText(l,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Ne(a,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},oi.prototype.createField=function(e){this.wrapper=zs(),this.textarea=this.wrapper.firstChild},oi.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},oi.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=Ar(e);if(e.options.moveInputWithCursor){var a=en(e,i.sel.primary().head,"div"),s=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,a.top+l.top-s.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,a.left+l.left-s.left))}return n},oi.prototype.showSelection=function(e){var t=this.cm,i=t.display;w(i.cursorDiv,e.cursors),w(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},oi.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&be(this.textarea),U&&k>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",U&&k>=9&&(this.hasSelection=null))},oi.prototype.getField=function(){return this.textarea},oi.prototype.supportsTouch=function(){return!1},oi.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!ee||P()!=this.textarea))try{this.textarea.focus()}catch(e){}},oi.prototype.blur=function(){this.textarea.blur()},oi.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},oi.prototype.receivedFocus=function(){this.slowPoll()},oi.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},oi.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},oi.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||et(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var a=i.value;if(a==n&&!t.somethingSelected())return!1;if(U&&k>=9&&this.hasSelection===a||b&&/[\uf700-\uf7ff]/.test(a))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var s=a.charCodeAt(0);if(s==8203&&!n&&(n="\u200B"),s==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,f=Math.min(n.length,a.length);l<f&&n.charCodeAt(l)==a.charCodeAt(l);)++l;return Ki(t,function(){Sr(t,a.slice(l),n.length-l,null,e.composing?"*compose":null),a.length>1e3||a.indexOf(`
`)>-1?i.value=e.prevInput="":e.prevInput=a,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},oi.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},oi.prototype.onKeyPress=function(){U&&k>=9&&(this.hasSelection=null),this.fastPoll()},oi.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,a=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=Pa(i,e),l=n.scroller.scrollTop;if(!s||M)return;var f=i.options.resetSelectionOnContextMenu;f&&i.doc.sel.contains(s)==-1&&bi(i,Ri)(i.doc,ba(s),we);var m=a.style.cssText,y=t.wrapper.style.cssText,Z=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",a.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-Z.top-5)+"px; left: "+(e.clientX-Z.left-5)+`px;
z-index: 1000; background: `+(U?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ie;O&&(ie=window.scrollY),n.input.focus(),O&&window.scrollTo(null,ie),n.input.reset(),i.somethingSelected()||(a.value=t.prevInput=" "),t.contextMenuPending=ye,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function ke(){if(a.selectionStart!=null){var it=i.somethingSelected(),ht="\u200B"+(it?a.value:"");a.value="\u21DA",a.value=ht,t.prevInput=it?"":"\u200B",a.selectionStart=1,a.selectionEnd=ht.length,n.selForContextMenu=i.doc.sel}}function ye(){if(t.contextMenuPending!=ye)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=y,a.style.cssText=m,U&&k<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),a.selectionStart!=null){(!U||U&&k<9)&&ke();var it=0,ht=function(){n.selForContextMenu==i.doc.sel&&a.selectionStart==0&&a.selectionEnd>0&&t.prevInput=="\u200B"?bi(i,us)(i):it++<10?n.detectingSelectAll=setTimeout(ht,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(ht,200)}}if(U&&k>=9&&ke(),g){I(e);var Ge=function(){Rt(window,"mouseup",Ge),setTimeout(ye,20)};Ne(window,"mouseup",Ge)}else setTimeout(ye,50)},oi.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},oi.prototype.setUneditable=function(){},oi.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?p(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=P();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=f.getValue()}var a;if(e.form&&(Ne(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var s=e.form;a=s.submit;try{var l=s.submit=function(){n(),s.submit=a,s.submit(),s.submit=l}}catch(m){}}t.finishInit=function(m){m.save=n,m.getTextArea=function(){return e},m.toTextArea=function(){m.toTextArea=isNaN,n(),e.parentNode.removeChild(m.getWrapperElement()),e.style.display="",e.form&&(Rt(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=a))}},e.style.display="none";var f=Gn(function(m){return e.parentNode.insertBefore(m,e.nextSibling)},t);return f}function au(e){e.off=Rt,e.on=Ne,e.wheelEventPixels=dl,e.Doc=Ii,e.splitLines=Et,e.countColumn=ue,e.findColumn=le,e.isWordChar=Me,e.Pass=Te,e.signal=je,e.Line=oa,e.changeEnd=_a,e.scrollbarModel=Br,e.Pos=$e,e.cmpPos=st,e.modes=It,e.mimeModes=vt,e.resolveMode=Fe,e.getMode=ut,e.modeExtensions=nt,e.extendMode=dt,e.copyState=Kt,e.startState=an,e.innerMode=Vt,e.commands=wo,e.keyMap=fa,e.keyName=Ss,e.isModifierKey=xs,e.lookupKey=$a,e.normalizeKeyMap=Ll,e.StringStream=Gt,e.SharedTextMarker=Eo,e.TextMarker=Ca,e.LineWidget=_o,e.e_preventDefault=x,e.e_stopPropagation=R,e.e_stop=I,e.addClass=ae,e.contains=E,e.rmClass=S,e.keyNames=xa}Yl(Gn),ql(Gn);var ou="iter insert remove copy getEditor constructor".split(" ");for(var qo in Ii.prototype)Ii.prototype.hasOwnProperty(qo)&&Pe(ou,qo)<0&&(Gn.prototype[qo]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ii.prototype[qo]));return Q(Ii),Gn.inputStyles={textarea:oi,contenteditable:Dn},Gn.defineMode=function(e){!Gn.defaults.mode&&e!="null"&&(Gn.defaults.mode=e),$t.apply(this,arguments)},Gn.defineMIME=Lt,Gn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Gn.defineMIME("text/plain","null"),Gn.defineExtension=function(e,t){Gn.prototype[e]=t},Gn.defineDocExtension=function(e,t){Ii.prototype[e]=t},Gn.fromTextArea=iu,au(Gn),Gn.version="5.58.2",Gn})},WaYH:function(Qe,Ie,h){"use strict";var V=h("rePB"),ve=h("Ff2n"),se=h("VTBJ"),xe=h("1OyB"),me=h("vuIU"),re=h("JX7q"),U=h("Ji7U"),k=h("LK+K"),O=h("q1tI"),T=h("TSYQ"),A=h.n(T),M=h("sboe"),te=h("OZM5"),F=function(g){var ne=g.prefixCls,S=g.level,Y=g.isStart,w=g.isEnd;if(!S)return null;for(var C="".concat(ne,"-indent-unit"),J=[],z=0;z<S;z+=1){var E;J.push(O.createElement("span",{key:z,className:A()(C,(E={},Object(V.a)(E,"".concat(C,"-start"),Y[z+1]),Object(V.a)(E,"".concat(C,"-end"),w[z+1]),Object(V.a)(E,"".concat(C,"-end-first-level"),!z&&w[0]),E))}))}return O.createElement("span",{"aria-hidden":"true",className:"".concat(ne,"-indent")},J)},L=F,G=h("815F"),W="open",ee="close",b="---",fe=function(H){Object(U.a)(ne,H);var g=Object(k.a)(ne);function ne(){var S;return Object(xe.a)(this,ne),S=g.apply(this,arguments),S.state={dragNodeHighlight:!1},S.onSelectorClick=function(Y){var w=S.props.context.onNodeClick;w(Y,Object(G.b)(S.props)),S.isSelectable()?S.onSelect(Y):S.onCheck(Y)},S.onSelectorDoubleClick=function(Y){var w=S.props.context.onNodeDoubleClick;w(Y,Object(G.b)(S.props))},S.onSelect=function(Y){if(S.isDisabled())return;var w=S.props.context.onNodeSelect;Y.preventDefault(),w(Y,Object(G.b)(S.props))},S.onCheck=function(Y){if(S.isDisabled())return;var w=S.props,C=w.disableCheckbox,J=w.checked,z=S.props.context.onNodeCheck;if(!S.isCheckable()||C)return;Y.preventDefault();var E=!J;z(Y,Object(G.b)(S.props),E)},S.onMouseEnter=function(Y){var w=S.props.context.onNodeMouseEnter;w(Y,Object(G.b)(S.props))},S.onMouseLeave=function(Y){var w=S.props.context.onNodeMouseLeave;w(Y,Object(G.b)(S.props))},S.onContextMenu=function(Y){var w=S.props.context.onNodeContextMenu;w(Y,Object(G.b)(S.props))},S.onDragStart=function(Y){var w=S.props.context.onNodeDragStart;Y.stopPropagation(),S.setState({dragNodeHighlight:!0}),w(Y,Object(re.a)(S));try{Y.dataTransfer.setData("text/plain","")}catch(C){}},S.onDragEnter=function(Y){var w=S.props.context.onNodeDragEnter;Y.preventDefault(),Y.stopPropagation(),w(Y,Object(re.a)(S))},S.onDragOver=function(Y){var w=S.props.context.onNodeDragOver;Y.preventDefault(),Y.stopPropagation(),w(Y,Object(re.a)(S))},S.onDragLeave=function(Y){var w=S.props.context.onNodeDragLeave;Y.stopPropagation(),w(Y,Object(re.a)(S))},S.onDragEnd=function(Y){var w=S.props.context.onNodeDragEnd;Y.stopPropagation(),S.setState({dragNodeHighlight:!1}),w(Y,Object(re.a)(S))},S.onDrop=function(Y){var w=S.props.context.onNodeDrop;Y.preventDefault(),Y.stopPropagation(),S.setState({dragNodeHighlight:!1}),w(Y,Object(re.a)(S))},S.onExpand=function(Y){var w=S.props.context.onNodeExpand;w(Y,Object(G.b)(S.props))},S.setSelectHandle=function(Y){S.selectHandle=Y},S.getNodeState=function(){var Y=S.props.expanded;return S.isLeaf()?null:Y?W:ee},S.hasChildren=function(){var Y=S.props.eventKey,w=S.props.context.keyEntities,C=w[Y]||{},J=C.children;return!!(J||[]).length},S.isLeaf=function(){var Y=S.props,w=Y.isLeaf,C=Y.loaded,J=S.props.context.loadData,z=S.hasChildren();return w===!1?!1:w||!J&&!z||J&&C&&!z},S.isDisabled=function(){var Y=S.props.disabled,w=S.props.context.disabled;return!!(w||Y)},S.isCheckable=function(){var Y=S.props.checkable,w=S.props.context.checkable;return!w||Y===!1?!1:w},S.syncLoadData=function(Y){var w=Y.expanded,C=Y.loading,J=Y.loaded,z=S.props.context,E=z.loadData,P=z.onNodeLoad;if(C)return;E&&w&&!S.isLeaf()&&(!S.hasChildren()&&!J&&P(Object(G.b)(S.props)))},S.renderSwitcher=function(){var Y=S.props,w=Y.expanded,C=Y.switcherIcon,J=S.props.context,z=J.prefixCls,E=J.switcherIcon,P=C||E;if(S.isLeaf())return O.createElement("span",{className:A()("".concat(z,"-switcher"),"".concat(z,"-switcher-noop"))},typeof P=="function"?P(Object(se.a)(Object(se.a)({},S.props),{},{isLeaf:!0})):P);var ae=A()("".concat(z,"-switcher"),"".concat(z,"-switcher_").concat(w?W:ee));return O.createElement("span",{onClick:S.onExpand,className:ae},typeof P=="function"?P(Object(se.a)(Object(se.a)({},S.props),{},{isLeaf:!1})):P)},S.renderCheckbox=function(){var Y=S.props,w=Y.checked,C=Y.halfChecked,J=Y.disableCheckbox,z=S.props.context.prefixCls,E=S.isDisabled(),P=S.isCheckable();if(!P)return null;var ae=typeof P!="boolean"?P:null;return O.createElement("span",{className:A()("".concat(z,"-checkbox"),w&&"".concat(z,"-checkbox-checked"),!w&&C&&"".concat(z,"-checkbox-indeterminate"),(E||J)&&"".concat(z,"-checkbox-disabled")),onClick:S.onCheck},ae)},S.renderIcon=function(){var Y=S.props.loading,w=S.props.context.prefixCls;return O.createElement("span",{className:A()("".concat(w,"-iconEle"),"".concat(w,"-icon__").concat(S.getNodeState()||"docu"),Y&&"".concat(w,"-icon_loading"))})},S.renderSelector=function(){var Y=S.state.dragNodeHighlight,w=S.props,C=w.title,J=w.selected,z=w.icon,E=w.loading,P=w.data,ae=S.props.context,B=ae.prefixCls,be=ae.showIcon,D=ae.icon,p=ae.draggable,ue=ae.loadData,Be=ae.titleRender,Pe=S.isDisabled(),ze="".concat(B,"-node-content-wrapper"),Te;if(be){var we=z||D;Te=we?O.createElement("span",{className:A()("".concat(B,"-iconEle"),"".concat(B,"-icon__customize"))},typeof we=="function"?we(S.props):we):S.renderIcon()}else ue&&E&&(Te=S.renderIcon());var X;typeof C=="function"?X=C(P):Be?X=Be(P):X=C;var K=O.createElement("span",{className:"".concat(B,"-title")},X);return O.createElement("span",{ref:S.setSelectHandle,title:typeof C=="string"?C:"",className:A()("".concat(ze),"".concat(ze,"-").concat(S.getNodeState()||"normal"),!Pe&&(J||Y)&&"".concat(B,"-node-selected"),!Pe&&p&&"draggable"),draggable:!Pe&&p||void 0,"aria-grabbed":!Pe&&p||void 0,onMouseEnter:S.onMouseEnter,onMouseLeave:S.onMouseLeave,onContextMenu:S.onContextMenu,onClick:S.onSelectorClick,onDoubleClick:S.onSelectorDoubleClick,onDragStart:p?S.onDragStart:void 0},Te,K)},S}return Object(me.a)(ne,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var Y=this.props.selectable,w=this.props.context.selectable;return typeof Y=="boolean"?Y:w}},{key:"render",value:function(){var Y,w=this.props,C=w.eventKey,J=w.className,z=w.style,E=w.dragOver,P=w.dragOverGapTop,ae=w.dragOverGapBottom,B=w.isLeaf,be=w.isStart,D=w.isEnd,p=w.expanded,ue=w.selected,Be=w.checked,Pe=w.halfChecked,ze=w.loading,Te=w.domRef,we=w.active,X=w.onMouseMove,K=Object(ve.a)(w,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),le=this.props.context,N=le.prefixCls,_=le.filterTreeNode,pe=le.draggable,Ue=le.keyEntities,Ze=this.isDisabled(),Ae=Object(te.f)(K),De=Ue[C]||{},Re=De.level,Me=D[D.length-1];return O.createElement("div",Object.assign({ref:Te,className:A()(J,"".concat(N,"-treenode"),(Y={},Object(V.a)(Y,"".concat(N,"-treenode-disabled"),Ze),Object(V.a)(Y,"".concat(N,"-treenode-switcher-").concat(p?"open":"close"),!B),Object(V.a)(Y,"".concat(N,"-treenode-checkbox-checked"),Be),Object(V.a)(Y,"".concat(N,"-treenode-checkbox-indeterminate"),Pe),Object(V.a)(Y,"".concat(N,"-treenode-selected"),ue),Object(V.a)(Y,"".concat(N,"-treenode-loading"),ze),Object(V.a)(Y,"".concat(N,"-treenode-active"),we),Object(V.a)(Y,"".concat(N,"-treenode-leaf-last"),Me),Object(V.a)(Y,"drag-over",!Ze&&E),Object(V.a)(Y,"drag-over-gap-top",!Ze&&P),Object(V.a)(Y,"drag-over-gap-bottom",!Ze&&ae),Object(V.a)(Y,"filter-node",_&&_(Object(G.b)(this.props))),Y)),style:z,onDragEnter:pe?this.onDragEnter:void 0,onDragOver:pe?this.onDragOver:void 0,onDragLeave:pe?this.onDragLeave:void 0,onDrop:pe?this.onDrop:void 0,onDragEnd:pe?this.onDragEnd:void 0,onMouseMove:X},Ae),O.createElement(L,{prefixCls:N,level:Re,isStart:be,isEnd:D}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),ne}(O.Component),Se=function(g){return O.createElement(M.a.Consumer,null,function(ne){return O.createElement(fe,Object.assign({},g,{context:ne}))})};Se.displayName="TreeNode",Se.defaultProps={title:b},Se.isTreeNode=1;var he=Ie.a=Se},Y1PL:function(Qe,Ie,h){"use strict";h.r(Ie),h.d(Ie,"ResizableTextArea",function(){return Pe});var V=h("wx14"),ve=h("1OyB"),se=h("vuIU"),xe=h("Ji7U"),me=h("LK+K"),re=h("q1tI"),U=h("VTBJ"),k=h("rePB"),O=h("Zm9Q"),T=h("Kwbf"),A=h("c+Xe"),M=h("m+aA"),te=h("bdgK"),F=new Map;function L(we){we.forEach(function(X){var K,le=X.target;(K=F.get(le))===null||K===void 0||K.forEach(function(N){return N(le)})})}var G=new te.default(L),W=null,ee=null;function b(we,X){F.has(we)||(F.set(we,new Set),G.observe(we)),F.get(we).add(X)}function fe(we,X){F.has(we)&&(F.get(we).delete(X),F.get(we).size||(G.unobserve(we),F.delete(we)))}var Se=function(we){Object(xe.a)(K,we);var X=Object(me.a)(K);function K(){return Object(ve.a)(this,K),X.apply(this,arguments)}return Object(se.a)(K,[{key:"render",value:function(){return this.props.children}}]),K}(re.Component),he=re.createContext(null);function H(we){var X=we.children,K=we.onBatchResize,le=re.useRef(0),N=re.useRef([]),_=re.useContext(he),pe=re.useCallback(function(Ue,Ze,Ae){le.current+=1;var De=le.current;N.current.push({size:Ue,element:Ze,data:Ae}),Promise.resolve().then(function(){De===le.current&&(K==null||K(N.current),N.current=[])}),_==null||_(Ue,Ze,Ae)},[K,_]);return re.createElement(he.Provider,{value:pe},X)}function g(we){var X=we.children,K=we.disabled,le=re.useRef(null),N=re.useRef(null),_=re.useContext(he),pe=re.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ue=re.isValidElement(X)&&Object(A.c)(X),Ze=Ue?X.ref:null,Ae=re.useMemo(function(){return Object(A.a)(Ze,le)},[Ze,le]),De=re.useRef(we);De.current=we;var Re=re.useCallback(function(Me){var Xe=De.current,qe=Xe.onResize,ot=Xe.data,Ke=Me.getBoundingClientRect(),Ve=Ke.width,At=Ke.height,gt=Me.offsetWidth,kt=Me.offsetHeight,ct=Math.floor(Ve),Pt=Math.floor(At);if(pe.current.width!==ct||pe.current.height!==Pt||pe.current.offsetWidth!==gt||pe.current.offsetHeight!==kt){var xt={width:ct,height:Pt,offsetWidth:gt,offsetHeight:kt};pe.current=xt;var bt=gt===Math.round(Ve)?Ve:gt,Ne=kt===Math.round(At)?At:kt,Ut=Object(U.a)(Object(U.a)({},xt),{},{offsetWidth:bt,offsetHeight:Ne});_==null||_(Ut,Me,ot),qe&&Promise.resolve().then(function(){qe(Ut,Me)})}},[]);return re.useEffect(function(){var Me=Object(M.a)(le.current)||Object(M.a)(N.current);return Me&&!K&&b(Me,Re),function(){return fe(Me,Re)}},[le.current,K]),re.createElement(Se,{ref:N},Ue?re.cloneElement(X,{ref:Ae}):X)}var ne="rc-observer-key";function S(we){var X=we.children,K=Object(O.a)(X);return K.map(function(le,N){var _=(le==null?void 0:le.key)||"".concat(ne,"-").concat(N);return re.createElement(g,Object(V.a)({},we,{key:_}),le)})}S.Collection=H;var Y=S,w=h("bT9E"),C=h("TSYQ"),J=h.n(C),z=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,E=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],P={},ae;function B(we){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,K=we.getAttribute("id")||we.getAttribute("data-reactid")||we.getAttribute("name");if(X&&P[K])return P[K];var le=window.getComputedStyle(we),N=le.getPropertyValue("box-sizing")||le.getPropertyValue("-moz-box-sizing")||le.getPropertyValue("-webkit-box-sizing"),_=parseFloat(le.getPropertyValue("padding-bottom"))+parseFloat(le.getPropertyValue("padding-top")),pe=parseFloat(le.getPropertyValue("border-bottom-width"))+parseFloat(le.getPropertyValue("border-top-width")),Ue=E.map(function(Ae){return"".concat(Ae,":").concat(le.getPropertyValue(Ae))}).join(";"),Ze={sizingStyle:Ue,paddingSize:_,borderSize:pe,boxSizing:N};return X&&K&&(P[K]=Ze),Ze}function be(we){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,le=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;ae||(ae=document.createElement("textarea"),ae.setAttribute("tab-index","-1"),ae.setAttribute("aria-hidden","true"),document.body.appendChild(ae)),we.getAttribute("wrap")?ae.setAttribute("wrap",we.getAttribute("wrap")):ae.removeAttribute("wrap");var N=B(we,X),_=N.paddingSize,pe=N.borderSize,Ue=N.boxSizing,Ze=N.sizingStyle;ae.setAttribute("style","".concat(Ze,";").concat(z)),ae.value=we.value||we.placeholder||"";var Ae=Number.MIN_SAFE_INTEGER,De=Number.MAX_SAFE_INTEGER,Re=ae.scrollHeight,Me;if(Ue==="border-box"?Re+=pe:Ue==="content-box"&&(Re-=_),K!==null||le!==null){ae.value=" ";var Xe=ae.scrollHeight-_;K!==null&&(Ae=Xe*K,Ue==="border-box"&&(Ae=Ae+_+pe),Re=Math.max(Ae,Re)),le!==null&&(De=Xe*le,Ue==="border-box"&&(De=De+_+pe),Me=Re>De?"":"hidden",Re=Math.min(De,Re))}return{height:Re,minHeight:Ae,maxHeight:De,overflowY:Me,resize:"none"}}var D=h("Gytx"),p=h.n(D),ue;(function(we){we[we.NONE=0]="NONE",we[we.RESIZING=1]="RESIZING",we[we.RESIZED=2]="RESIZED"})(ue||(ue={}));var Be=function(we){Object(xe.a)(K,we);var X=Object(me.a)(K);function K(le){var N;return Object(ve.a)(this,K),N=X.call(this,le),N.nextFrameActionId=void 0,N.resizeFrameId=void 0,N.textArea=void 0,N.saveTextArea=function(_){N.textArea=_},N.handleResize=function(_){var pe=N.state.resizeStatus,Ue=N.props,Ze=Ue.autoSize,Ae=Ue.onResize;if(pe!==ue.NONE)return;typeof Ae=="function"&&Ae(_),Ze&&N.resizeOnNextFrame()},N.resizeOnNextFrame=function(){cancelAnimationFrame(N.nextFrameActionId),N.nextFrameActionId=requestAnimationFrame(N.resizeTextarea)},N.resizeTextarea=function(){var _=N.props.autoSize;if(!_||!N.textArea)return;var pe=_.minRows,Ue=_.maxRows,Ze=be(N.textArea,!1,pe,Ue);N.setState({textareaStyles:Ze,resizeStatus:ue.RESIZING},function(){cancelAnimationFrame(N.resizeFrameId),N.resizeFrameId=requestAnimationFrame(function(){N.setState({resizeStatus:ue.RESIZED},function(){N.resizeFrameId=requestAnimationFrame(function(){N.setState({resizeStatus:ue.NONE}),N.fixFirefoxAutoScroll()})})})})},N.renderTextArea=function(){var _=N.props,pe=_.prefixCls,Ue=pe===void 0?"rc-textarea":pe,Ze=_.autoSize,Ae=_.onResize,De=_.className,Re=_.disabled,Me=N.state,Xe=Me.textareaStyles,qe=Me.resizeStatus,ot=Object(w.a)(N.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ke=J()(Ue,De,Object(k.a)({},"".concat(Ue,"-disabled"),Re));"value"in ot&&(ot.value=ot.value||"");var Ve=Object(U.a)(Object(U.a)(Object(U.a)({},N.props.style),Xe),qe===ue.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return re.createElement(Y,{onResize:N.handleResize,disabled:!(Ze||Ae)},re.createElement("textarea",Object(V.a)({},ot,{className:Ke,style:Ve,ref:N.saveTextArea})))},N.state={textareaStyles:{},resizeStatus:ue.NONE},N}return Object(se.a)(K,[{key:"componentDidUpdate",value:function(N){(N.value!==this.props.value||!p()(N.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var N=this.textArea.selectionStart,_=this.textArea.selectionEnd;this.textArea.setSelectionRange(N,_)}}catch(pe){}}},{key:"render",value:function(){return this.renderTextArea()}}]),K}(re.Component),Pe=Be,ze=function(we){Object(xe.a)(K,we);var X=Object(me.a)(K);function K(le){var N;Object(ve.a)(this,K),N=X.call(this,le),N.resizableTextArea=void 0,N.focus=function(){N.resizableTextArea.textArea.focus()},N.saveTextArea=function(pe){N.resizableTextArea=pe},N.handleChange=function(pe){var Ue=N.props.onChange;N.setValue(pe.target.value,function(){N.resizableTextArea.resizeTextarea()}),Ue&&Ue(pe)},N.handleKeyDown=function(pe){var Ue=N.props,Ze=Ue.onPressEnter,Ae=Ue.onKeyDown;pe.keyCode===13&&Ze&&Ze(pe),Ae&&Ae(pe)};var _=typeof le.value=="undefined"||le.value===null?le.defaultValue:le.value;return N.state={value:_},N}return Object(se.a)(K,[{key:"setValue",value:function(N,_){"value"in this.props||this.setState({value:N},_)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return re.createElement(Pe,Object(V.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(N){return"value"in N?{value:N.value}:null}}]),K}(re.Component),Te=Ie.default=ze},YBdh:function(Qe,Ie,h){Qe.exports=h.p+"static/xiren.a6554bc1.svg"},ZW9T:function(Qe,Ie,h){"use strict";h.d(Ie,"a",function(){return Se});var V=h("k1fw"),ve=h("miYZ"),se=h("tsqr"),xe=h("rAM+"),me=h("tJVT"),re=h("PpiC"),U=h("q1tI"),k=h.n(U),O=h("bdgK");function T(he,H,g,ne,S){var Y=H.getWordUntilPosition(g),w={startLineNumber:g.lineNumber,endLineNumber:g.lineNumber,startColumn:Y.startColumn,endColumn:Y.endColumn},C=ne.map(function(J){return{label:J,kind:he.languages.CompletionItemKind.Keyword,insertText:J,insertTextRules:he.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:w}});return S.map(function(J){C.push(Object(V.a)(Object(V.a)({},J),{},{range:w}))}),C}var A=function(he){var H={label:"ifelse",kind:he.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`),insertTextRules:he.languages.CompletionItemInsertTextRule.InsertAsSnippet},g=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];he.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(w,C){var J=T(he,w,C,g,[H]);return{suggestions:J}}});var ne=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];he.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(w,C){var J=[{label:"print",kind:he.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
`),insertTextRules:he.languages.CompletionItemInsertTextRule.InsertAsSnippet}],z=T(he,w,C,ne,J);return{suggestions:z}}});var S=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];he.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(w,C){var J=[H,{label:"main",kind:he.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
`),insertTextRules:he.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:he.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
`),insertTextRules:he.languages.CompletionItemInsertTextRule.InsertAsSnippet}],z=T(he,w,C,S,J);return{suggestions:z}}})},M="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",te=h("LvDl");function F(he){return/^\d+$/.test(he)?"".concat(he,"px"):he}function L(){}var G=!1,W={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function ee(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],H=he;if(Array.isArray(he)){for(var g=0;g<he.length;g++){var ne=W[he[g]];if(ne)return ne}return H[0]}return W[H]||H}var b=null,fe=Ie.b=function(he){var H=he.width,g=H===void 0?"100%":H,ne=he.height,S=ne===void 0?"100%":ne,Y=he.value,w=he.language,C=w===void 0?"javascript":w,J=he.style,z=J===void 0?{}:J,E=he.options,P=E===void 0?{}:E,ae=he.overrideServices,B=ae===void 0?{}:ae,be=he.theme,D=be===void 0?"vs-dark":be,p=he.onEditBlur,ue=he.onSave,Be=he.autoHeight,Pe=Be===void 0?!1:Be,ze=he.forbidCopy,Te=ze===void 0?!1:ze,we=he.onChange,X=we===void 0?L:we,K=he.editorDidMount,le=K===void 0?L:K,N=he.onFocus,_=N===void 0?L:N,pe=he.filename,Ue=pe===void 0?"educoder.txt":pe,Ze=Object(re.a)(he,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),Ae=Object(U.useRef)(),De=Object(U.useRef)({}),Re=Object(U.useRef)(),Me=Object(U.useRef)(!1),Xe=Object(U.useRef)(),qe=Object(U.useState)(!1),ot=Object(me.a)(qe,2),Ke=ot[0],Ve=ot[1];function At(){var j;return Ae.current&&(j=new O.default(function(I){var de=Object(xe.a)(I),Ce;try{for(de.s();!(Ce=de.n()).done;){var Oe=Ce.value;(Oe.target.offsetHeight>0||Oe.target.offsetWidth>0)&&De.current.instance.layout()}}catch(_t){de.e(_t)}finally{de.f()}}),j.observe(Ae.current)),j}function gt(){se.b.warn(decodeURIComponent(M))}var kt=function(){var I=De.current.instance;if(Y!=null&&I&&Ke){var de=I.getModel();de&&Y!==de.getValue()&&(G=!0,de.setValue(Y),I.layout(),G=!1)}};Object(U.useEffect)(function(){Re.current&&clearTimeout(Re.current),Re.current=setTimeout(function(){kt()},500)},[Y,Ke,De.current]);function ct(){var j=De.current.instance;if(j){var I=j.getSelection(),de=De.current.pastePos||{},Ce=new b.Range(de.startLineNumber||I.endLineNumber,de.startColumn||I.endColumn,de.endLineNumber||I.endLineNumber,de.endColumn||I.endColumn);setTimeout(function(){j.executeEdits("",[{range:Ce,text:""}])},300)}}function Pt(j){(window.navigator.platform.match("Mac")?j.metaKey:j.ctrlKey)&&j.keyCode==83&&(j.preventDefault(),ue())}var xt=function(){if(Pe&&De.current.instance){var I=De.current.instance.getContentHeight();x(I<S?S:I)}else x(S)};function bt(j){var I=document.createEvent("MouseEvents");I.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),j.dispatchEvent(I)}function Ne(j,I){var de=window.URL||window.webkitURL||window,Ce=new Blob([I]),Oe=document.createElementNS("http://www.w3.org/1999/xhtml","a");Oe.href=de.createObjectURL(Ce),Oe.download=j,bt(Oe)}Object(U.useEffect)(function(){xt()},[xt]),Object(U.useEffect)(function(){Ae.current&&!Ke&&h.e(27).then(h.t.bind(null,"M/lh",7)).then(function(j){try{b=j,De.current.instance=b.editor.create(Ae.current,{value:Y,language:ee(C),theme:D,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},B);var I=De.current.instance;if(le(I,b),setTimeout(function(){xt(),De.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Ne(Ue||"educoder.txt",I.getValue())}})},500),De.current.subscription=I.onDidChangeModelContent(function(Ce){Me.current?clearTimeout(Xe.current):(xt(),X(I.getValue(),Ce)),Xe.current=setTimeout(function(){Me.current=!1},500)}),window.Monaco||A(b),Te&&(I.addCommand(b.KeyMod.CtrlCmd|b.KeyMod.Shift|b.KeyCode.KEY_V,function(){return gt(),null}),I.addCommand(b.KeyMod.CtrlCmd|b.KeyCode.KEY_C,function(){return gt(),null})),window.Monaco=b,p&&I.onDidBlurEditorWidget(function(){p(I.getValue())}),_&&I.onDidFocusEditorText(function(){_(I.getValue())}),Te){I.addCommand(b.KeyMod.CtrlCmd|b.KeyCode.KEY_V,function(){return gt(),null}),I.onDidPaste(function(Ce){De.current.pastePos=Ce});try{window.addEventListener("paste",ct)}catch(Ce){}}var de=At();return Ve(!0),function(){var Ce=De.current.instance;Ce.dispose();var Oe=Ce.getModel();Oe&&Oe.dispose(),De.current.subscription&&De.current.subscription.dispose(),Te&&window.removeEventListener("paste",ct),de.unobserve(Ae.current)}}catch(Ce){}})},[]),Object(U.useEffect)(function(){var j=De.current.instance;if(j&&Ke)return document.addEventListener("keydown",Pt,!1),function(){document.removeEventListener("keydown",Pt)}},[ue,Ke]),Object(U.useEffect)(function(){var j=De.current.instance;if(j&&Ke){var I=ee(C);b.editor.setModelLanguage(j.getModel(),I),console.log("language:",C,j.getModel(),I)}},[C,Ke]),Object(U.useEffect)(function(){var j=De.current.instance;j&&Ke&&b.editor.setTheme(D)},[D,Ke]),Object(U.useEffect)(function(){var j=De.current.instance;j&&Ke&&(j.updateOptions(Object(V.a)({},P)),setTimeout(function(){j.getModel().updateOptions(Object(V.a)({},P))},200))},[JSON.stringify(P),Ke]),Object(U.useEffect)(function(){var j=De.current.instance;j&&Ke&&j.layout()},[g,S,Ke]);var Ut=Object(U.useState)(F(g)),Rt=Object(me.a)(Ut,2),je=Rt[0],We=Rt[1],$=Object(U.useState)(F(S)),q=Object(me.a)($,2),Q=q[0],x=q[1],R=Object(V.a)(Object(V.a)({},z),{},{width:je,height:Q});return k.a.createElement("div",{className:"my-monaco-editor",ref:Ae,style:R})};function Se(he){var H=he.width,g=H===void 0?"100%":H,ne=he.height,S=ne===void 0?"100%":ne,Y=he.original,w=he.modified,C=he.language,J=he.options,z=J===void 0?{}:J,E=Object(U.useRef)(),P=Object(U.useState)(null),ae=Object(me.a)(P,2),B=ae[0],be=ae[1];function D(Pe){var ze;return E.current&&(ze=new O.default(function(Te){var we=Object(xe.a)(Te),X;try{for(we.s();!(X=we.n()).done;){var K=X.value;(K.target.offsetHeight>0||K.target.offsetWidth>0)&&Pe.layout()}}catch(le){we.e(le)}finally{we.f()}}),ze.observe(E.current)),ze}Object(U.useEffect)(function(){E.current&&h.e(27).then(h.t.bind(null,"M/lh",7)).then(function(Pe){b=Pe;var ze=b.editor.createDiffEditor(E.current,Object(V.a)(Object(V.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},z),{},{wordWrap:!0}));be(ze);var Te=D(ze);return function(){ze.dispose();var we=ze.getModel();we&&we.dispose(),Te.unobserve(E.current)}})},[]),Object(U.useEffect)(function(){B&&B.setModel({original:b.editor.createModel(Y,C),modified:b.editor.createModel(w,C)})},[Y,w,C,B]);var p=F(g),ue=F(S),Be={width:p,height:ue};return k.a.createElement("div",{className:"my-diff-editor",ref:E,style:Be})}},ZpRC:function(Qe,Ie,h){"use strict";function V(A){return typeof A=="object"&&A!=null&&A.nodeType===1}function ve(A,M){return(!M||A!=="hidden")&&A!=="visible"&&A!=="clip"}function se(A,M){if(A.clientHeight<A.scrollHeight||A.clientWidth<A.scrollWidth){var te=getComputedStyle(A,null);return ve(te.overflowY,M)||ve(te.overflowX,M)||function(F){var L=function(G){if(!G.ownerDocument||!G.ownerDocument.defaultView)return null;try{return G.ownerDocument.defaultView.frameElement}catch(W){return null}}(F);return!!L&&(L.clientHeight<F.scrollHeight||L.clientWidth<F.scrollWidth)}(A)}return!1}function xe(A,M,te,F,L,G,W,ee){return G<A&&W>M||G>A&&W<M?0:G<=A&&ee<=te||W>=M&&ee>=te?G-A-F:W>M&&ee<te||G<A&&ee>te?W-M+L:0}var me=function(A,M){var te=window,F=M.scrollMode,L=M.block,G=M.inline,W=M.boundary,ee=M.skipOverflowHiddenElements,b=typeof W=="function"?W:function(Xe){return Xe!==W};if(!V(A))throw new TypeError("Invalid target");for(var fe=document.scrollingElement||document.documentElement,Se=[],he=A;V(he)&&b(he);){if((he=he.parentElement)===fe){Se.push(he);break}he!=null&&he===document.body&&se(he)&&!se(document.documentElement)||he!=null&&se(he,ee)&&Se.push(he)}for(var H=te.visualViewport?te.visualViewport.width:innerWidth,g=te.visualViewport?te.visualViewport.height:innerHeight,ne=window.scrollX||pageXOffset,S=window.scrollY||pageYOffset,Y=A.getBoundingClientRect(),w=Y.height,C=Y.width,J=Y.top,z=Y.right,E=Y.bottom,P=Y.left,ae=L==="start"||L==="nearest"?J:L==="end"?E:J+w/2,B=G==="center"?P+C/2:G==="end"?z:P,be=[],D=0;D<Se.length;D++){var p=Se[D],ue=p.getBoundingClientRect(),Be=ue.height,Pe=ue.width,ze=ue.top,Te=ue.right,we=ue.bottom,X=ue.left;if(F==="if-needed"&&J>=0&&P>=0&&E<=g&&z<=H&&J>=ze&&E<=we&&P>=X&&z<=Te)return be;var K=getComputedStyle(p),le=parseInt(K.borderLeftWidth,10),N=parseInt(K.borderTopWidth,10),_=parseInt(K.borderRightWidth,10),pe=parseInt(K.borderBottomWidth,10),Ue=0,Ze=0,Ae="offsetWidth"in p?p.offsetWidth-p.clientWidth-le-_:0,De="offsetHeight"in p?p.offsetHeight-p.clientHeight-N-pe:0;if(fe===p)Ue=L==="start"?ae:L==="end"?ae-g:L==="nearest"?xe(S,S+g,g,N,pe,S+ae,S+ae+w,w):ae-g/2,Ze=G==="start"?B:G==="center"?B-H/2:G==="end"?B-H:xe(ne,ne+H,H,le,_,ne+B,ne+B+C,C),Ue=Math.max(0,Ue+S),Ze=Math.max(0,Ze+ne);else{Ue=L==="start"?ae-ze-N:L==="end"?ae-we+pe+De:L==="nearest"?xe(ze,we,Be,N,pe+De,ae,ae+w,w):ae-(ze+Be/2)+De/2,Ze=G==="start"?B-X-le:G==="center"?B-(X+Pe/2)+Ae/2:G==="end"?B-Te+_+Ae:xe(X,Te,Pe,le,_+Ae,B,B+C,C);var Re=p.scrollLeft,Me=p.scrollTop;ae+=Me-(Ue=Math.max(0,Math.min(Me+Ue,p.scrollHeight-Be+De))),B+=Re-(Ze=Math.max(0,Math.min(Re+Ze,p.scrollWidth-Pe+Ae)))}be.push({el:p,top:Ue,left:Ze})}return be};function re(A){return A===Object(A)&&Object.keys(A).length!==0}function U(A,M){M===void 0&&(M="auto");var te="scrollBehavior"in document.body.style;A.forEach(function(F){var L=F.el,G=F.top,W=F.left;L.scroll&&te?L.scroll({top:G,left:W,behavior:M}):(L.scrollTop=G,L.scrollLeft=W)})}function k(A){return A===!1?{block:"end",inline:"nearest"}:re(A)?A:{block:"start",inline:"nearest"}}function O(A,M){var te=!A.ownerDocument.documentElement.contains(A);if(re(M)&&typeof M.behavior=="function")return M.behavior(te?[]:me(A,M));if(te)return;var F=k(M);return U(me(A,F),F.behavior)}var T=Ie.a=O},aRTE:function(Qe,Ie){Qe.exports={L:1,M:0,Q:3,H:2}},bT9E:function(Qe,Ie,h){"use strict";h.d(Ie,"a",function(){return ve});var V=h("VTBJ");function ve(se,xe){var me=Object(V.a)({},se);return Array.isArray(xe)&&xe.forEach(function(re){delete me[re]}),me}},c5Ni:function(Qe,Ie,h){},dQei:function(Qe,Ie){for(var h={glog:function(ve){if(ve<1)throw new Error("glog("+ve+")");return h.LOG_TABLE[ve]},gexp:function(ve){for(;ve<0;)ve+=255;for(;ve>=256;)ve-=255;return h.EXP_TABLE[ve]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},V=0;V<8;V++)h.EXP_TABLE[V]=1<<V;for(var V=8;V<256;V++)h.EXP_TABLE[V]=h.EXP_TABLE[V-4]^h.EXP_TABLE[V-5]^h.EXP_TABLE[V-6]^h.EXP_TABLE[V-8];for(var V=0;V<255;V++)h.LOG_TABLE[h.EXP_TABLE[V]]=V;Qe.exports=h},dWSS:function(Qe,Ie,h){var V=h("dQei");function ve(se,xe){if(se.length==null)throw new Error(se.length+"/"+xe);for(var me=0;me<se.length&&se[me]==0;)me++;this.num=new Array(se.length-me+xe);for(var re=0;re<se.length-me;re++)this.num[re]=se[re+me]}ve.prototype={get:function(se){return this.num[se]},getLength:function(){return this.num.length},multiply:function(se){for(var xe=new Array(this.getLength()+se.getLength()-1),me=0;me<this.getLength();me++)for(var re=0;re<se.getLength();re++)xe[me+re]^=V.gexp(V.glog(this.get(me))+V.glog(se.get(re)));return new ve(xe,0)},mod:function(se){if(this.getLength()-se.getLength()<0)return this;for(var xe=V.glog(this.get(0))-V.glog(se.get(0)),me=new Array(this.getLength()),re=0;re<this.getLength();re++)me[re]=this.get(re);for(var re=0;re<se.getLength();re++)me[re]^=V.gexp(V.glog(se.get(re))+xe);return new ve(me,0).mod(se)}},Qe.exports=ve},dejd:function(Qe,Ie,h){},dmUQ:function(Qe,Ie,h){"use strict";var V=h("Ff2n"),ve=h("rePB"),se=h("1OyB"),xe=h("vuIU"),me=h("Ji7U"),re=h("md7G"),U=h("foSv"),k=h("q1tI"),O=h.n(k),T=h("TSYQ"),A=h.n(T),M=h("4IlW");function te(w,C){var J=Object.keys(w);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(w);C&&(z=z.filter(function(E){return Object.getOwnPropertyDescriptor(w,E).enumerable})),J.push.apply(J,z)}return J}function F(w){for(var C=1;C<arguments.length;C++){var J=arguments[C]!=null?arguments[C]:{};C%2?te(Object(J),!0).forEach(function(z){Object(ve.a)(w,z,J[z])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(J)):te(Object(J)).forEach(function(z){Object.defineProperty(w,z,Object.getOwnPropertyDescriptor(J,z))})}return w}function L(w){var C=G();return function(){var z=Object(U.a)(w),E;if(C){var P=Object(U.a)(this).constructor;E=Reflect.construct(z,arguments,P)}else E=z.apply(this,arguments);return Object(re.a)(this,E)}}function G(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(w){return!1}}function W(){}function ee(w){w.preventDefault()}var b=function(C){return C.replace(/[^\w.-]+/g,"")},fe=200,Se=600,he=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,H=function(C){return C!=null},g=function(C,J){return J===C||typeof J=="number"&&typeof C=="number"&&isNaN(J)&&isNaN(C)},ne=function(w){Object(me.a)(J,w);var C=L(J);function J(z){var E;Object(se.a)(this,J),E=C.call(this,z),E.onKeyDown=function(B){var be=E.props,D=be.onKeyDown,p=be.onPressEnter;if(B.keyCode===M.a.UP){var ue=E.getRatio(B);E.up(B,ue,null),E.stop()}else if(B.keyCode===M.a.DOWN){var Be=E.getRatio(B);E.down(B,Be,null),E.stop()}else B.keyCode===M.a.ENTER&&p&&p(B);if(E.recordCursorPosition(),E.lastKeyCode=B.keyCode,D){for(var Pe=arguments.length,ze=new Array(Pe>1?Pe-1:0),Te=1;Te<Pe;Te++)ze[Te-1]=arguments[Te];D.apply(void 0,[B].concat(ze))}},E.onKeyUp=function(B){var be=E.props.onKeyUp;if(E.stop(),E.recordCursorPosition(),be){for(var D=arguments.length,p=new Array(D>1?D-1:0),ue=1;ue<D;ue++)p[ue-1]=arguments[ue];be.apply(void 0,[B].concat(p))}},E.onChange=function(B){var be=E.props.onChange;E.state.focused&&(E.inputting=!0),E.rawInput=E.props.parser(E.getValueFromEvent(B)),E.setState({inputValue:E.rawInput}),be(E.toNumber(E.rawInput))},E.onMouseUp=function(){var B=E.props.onMouseUp;E.recordCursorPosition(),B&&B.apply(void 0,arguments)},E.onFocus=function(){var B;E.setState({focused:!0}),(B=E.props).onFocus.apply(B,arguments)},E.onBlur=function(){var B=E.props.onBlur;E.inputting=!1,E.setState({focused:!1});var be=E.getCurrentValidValue(E.state.inputValue),D=E.setValue(be,W);if(B){var p=E.input.value,ue=E.getInputDisplayValue({focus:!1,value:D});E.input.value=ue&&Number(ue),B.apply(void 0,arguments),E.input.value=p}},E.getRatio=function(B){var be=1;return B.metaKey||B.ctrlKey?be=.1:B.shiftKey&&(be=10),be},E.getFullNum=function(B){return isNaN(B)?B:/e/i.test(String(B))?Number(B).toFixed(18).replace(/\.?0+$/,""):B},E.getPrecision=function(B){if(H(E.props.precision))return E.props.precision;var be=String(B);if(be.indexOf("e-")>=0)return parseInt(be.slice(be.indexOf("e-")+2),10);var D=0;return be.indexOf(".")>=0&&(D=be.length-be.indexOf(".")-1),D},E.getInputDisplayValue=function(B){var be=B||E.state,D=be.focused,p=be.inputValue,ue=be.value,Be;D?Be=p:Be=E.toPrecisionAsStep(ue),Be==null&&(Be="");var Pe=E.formatWrapper(Be);return H(E.props.decimalSeparator)&&(Pe=Pe.toString().replace(".",E.props.decimalSeparator)),Pe},E.recordCursorPosition=function(){try{E.cursorStart=E.input.selectionStart,E.cursorEnd=E.input.selectionEnd,E.currentValue=E.input.value,E.cursorBefore=E.input.value.substring(0,E.cursorStart),E.cursorAfter=E.input.value.substring(E.cursorEnd)}catch(B){}},E.restoreByAfter=function(B){if(B===void 0)return!1;var be=E.input.value,D=be.lastIndexOf(B);if(D===-1)return!1;var p=E.cursorBefore.length;return E.lastKeyCode===M.a.DELETE&&E.cursorBefore.charAt(p-1)===B[0]?(E.fixCaret(p,p),!0):D+B.length===be.length?(E.fixCaret(D,D),!0):!1},E.partRestoreByAfter=function(B){return B===void 0?!1:Array.prototype.some.call(B,function(be,D){var p=B.substring(D);return E.restoreByAfter(p)})},E.isNotCompleteNumber=function(B){return isNaN(B)||B===""||B===null||B&&B.toString().indexOf(".")===B.toString().length-1},E.stop=function(){E.autoStepTimer&&clearTimeout(E.autoStepTimer)},E.down=function(B,be,D){E.pressingUpOrDown=!0,E.step("down",B,be,D)},E.up=function(B,be,D){E.pressingUpOrDown=!0,E.step("up",B,be,D)},E.saveInput=function(B){E.input=B};var P=z.value;P===void 0&&(P=z.defaultValue),E.state={focused:z.autoFocus};var ae=E.getValidValue(E.toNumber(P));return E.state=F(F({},E.state),{},{inputValue:E.toPrecisionAsStep(ae),value:ae}),E}return Object(xe.a)(J,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(E){var P=this.props,ae=P.value,B=P.onChange,be=P.max,D=P.min,p=this.state.focused;if(E){if(!g(E.value,ae)||!g(E.max,be)||!g(E.min,D)){var ue=p?ae:this.getValidValue(ae),Be;this.pressingUpOrDown?Be=ue:this.inputting?Be=this.rawInput:Be=this.toPrecisionAsStep(ue),this.setState({value:ue,inputValue:Be})}var Pe="value"in this.props?ae:this.state.value;"max"in this.props&&E.max!==be&&typeof Pe=="number"&&Pe>be&&B&&B(be),"min"in this.props&&E.min!==D&&typeof Pe=="number"&&Pe<D&&B&&B(D)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ze=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===M.a.BACKSPACE?ze=this.cursorStart-1:this.lastKeyCode===M.a.DELETE&&(ze=this.cursorStart):ze=this.input.value.length,this.fixCaret(ze,ze)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case M.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case M.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Te){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(E){var P=E;return P===""?P="":this.isNotCompleteNumber(parseFloat(P))?P=this.state.value:P=this.getValidValue(P),this.toNumber(P)}},{key:"getValueFromEvent",value:function(E){var P=E.target.value.trim().replace(/。/g,".");return H(this.props.decimalSeparator)&&(P=P.replace(this.props.decimalSeparator,".")),P}},{key:"getValidValue",value:function(E){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,B=parseFloat(E);return isNaN(B)?E:(B<P&&(B=P),B>ae&&(B=ae),B)}},{key:"setValue",value:function(E,P){var ae=this.props.precision,B=this.isNotCompleteNumber(parseFloat(E))?null:parseFloat(E),be=this.state.value,D=be===void 0?null:be,p=this.state.inputValue,ue=p===void 0?null:p,Be=typeof B=="number"?B.toFixed(ae):"".concat(B),Pe=B!==D||Be!=="".concat(ue);return"value"in this.props?(ue=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:ue},P)):this.setState({value:B,inputValue:this.toPrecisionAsStep(E)},P),Pe&&this.props.onChange(B),B}},{key:"getMaxPrecision",value:function(E){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ae=this.props,B=ae.precision,be=ae.step;if(H(B))return B;var D=this.getPrecision(P),p=this.getPrecision(be),ue=this.getPrecision(E);return E?Math.max(ue,D+p):D+p}},{key:"getPrecisionFactor",value:function(E){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ae=this.getMaxPrecision(E,P);return Math.pow(10,ae)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(E){return this.props.formatter?this.props.formatter(E):E}},{key:"toPrecisionAsStep",value:function(E){if(this.isNotCompleteNumber(E)||E==="")return E;var P=Math.abs(this.getMaxPrecision(E));return isNaN(P)?E.toString():Number(E).toFixed(P)}},{key:"toNumber",value:function(E){var P=this.props.precision,ae=this.state.focused,B=E&&E.length>16&&ae;return this.isNotCompleteNumber(E)||B?E:H(P)?Math.round(E*Math.pow(10,P))/Math.pow(10,P):Number(E)}},{key:"upStep",value:function(E,P){var ae=this.props.step,B=this.getPrecisionFactor(E,P),be=Math.abs(this.getMaxPrecision(E,P)),D=((B*E+B*ae*P)/B).toFixed(be);return this.toNumber(D)}},{key:"downStep",value:function(E,P){var ae=this.props.step,B=this.getPrecisionFactor(E,P),be=Math.abs(this.getMaxPrecision(E,P)),D=((B*E-B*ae*P)/B).toFixed(be);return this.toNumber(D)}},{key:"step",value:function(E,P){var ae=this,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,be=arguments.length>3?arguments[3]:void 0;this.stop(),P&&(P.persist(),P.preventDefault());var D=this.props;if(D.disabled)return;var p=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(p))return;var ue=this["".concat(E,"Step")](p,B),Be=ue>D.max||ue<D.min;if(ue>D.max?ue=D.max:ue<D.min&&(ue=D.min),this.setValue(ue,null),this.setState({focused:!0},function(){ae.pressingUpOrDown=!1}),Be)return;this.autoStepTimer=setTimeout(function(){ae[E](P,B,!0)},be?fe:Se)}},{key:"fixCaret",value:function(E,P){if(E===void 0||P===void 0||!this.input||!this.input.value)return;try{var ae=this.input.selectionStart,B=this.input.selectionEnd;(E!==ae||P!==B)&&this.input.setSelectionRange(E,P)}catch(be){}}},{key:"render",value:function(){var E,P=this.props,ae=P.prefixCls,B=P.disabled,be=P.readOnly,D=P.useTouch,p=P.autoComplete,ue=P.upHandler,Be=P.downHandler,Pe=P.className,ze=P.max,Te=P.min,we=P.style,X=P.title,K=P.onMouseEnter,le=P.onMouseLeave,N=P.onMouseOver,_=P.onMouseOut,pe=P.required,Ue=P.onClick,Ze=P.tabIndex,Ae=P.type,De=P.placeholder,Re=P.id,Me=P.inputMode,Xe=P.pattern,qe=P.step,ot=P.maxLength,Ke=P.autoFocus,Ve=P.name,At=P.onPaste,gt=P.onInput,kt=Object(V.a)(P,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),ct=this.state,Pt=ct.value,xt=ct.focused,bt=A()(ae,(E={},Object(ve.a)(E,Pe,!!Pe),Object(ve.a)(E,"".concat(ae,"-disabled"),B),Object(ve.a)(E,"".concat(ae,"-focused"),xt),E)),Ne={};Object.keys(kt).forEach(function(I){(I.substr(0,5)==="data-"||I.substr(0,5)==="aria-"||I==="role")&&(Ne[I]=kt[I])});var Ut=!be&&!B,Rt=this.getInputDisplayValue(null),je=(Pt||Pt===0)&&(isNaN(Pt)||Number(Pt)>=ze),We=(Pt||Pt===0)&&(isNaN(Pt)||Number(Pt)<=Te),$=je||B||be,q=We||B||be,Q=A()("".concat(ae,"-handler"),"".concat(ae,"-handler-up"),Object(ve.a)({},"".concat(ae,"-handler-up-disabled"),$)),x=A()("".concat(ae,"-handler"),"".concat(ae,"-handler-down"),Object(ve.a)({},"".concat(ae,"-handler-down-disabled"),q)),R=D?{onTouchStart:$?W:this.up,onTouchEnd:this.stop}:{onMouseDown:$?W:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},j=D?{onTouchStart:q?W:this.down,onTouchEnd:this.stop}:{onMouseDown:q?W:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return O.a.createElement("div",{className:bt,style:we,title:X,onMouseEnter:K,onMouseLeave:le,onMouseOver:N,onMouseOut:_,onFocus:function(){return null},onBlur:function(){return null}},O.a.createElement("div",{className:"".concat(ae,"-handler-wrap")},O.a.createElement("span",Object.assign({unselectable:"on"},R,{role:"button","aria-label":"Increase Value","aria-disabled":$,className:Q}),ue||O.a.createElement("span",{unselectable:"on",className:"".concat(ae,"-handler-up-inner"),onClick:ee})),O.a.createElement("span",Object.assign({unselectable:"on"},j,{role:"button","aria-label":"Decrease Value","aria-disabled":q,className:x}),Be||O.a.createElement("span",{unselectable:"on",className:"".concat(ae,"-handler-down-inner"),onClick:ee}))),O.a.createElement("div",{className:"".concat(ae,"-input-wrap")},O.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Te,"aria-valuemax":ze,"aria-valuenow":Pt,required:pe,type:Ae,placeholder:De,onPaste:At,onClick:Ue,onMouseUp:this.onMouseUp,className:"".concat(ae,"-input"),tabIndex:Ze,autoComplete:p,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Ut?this.onKeyDown:W,onKeyUp:Ut?this.onKeyUp:W,autoFocus:Ke,maxLength:ot,readOnly:be,disabled:B,max:ze,min:Te,step:qe,name:Ve,title:X,id:Re,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Rt),pattern:Xe,inputMode:Me,onInput:gt},Ne))))}}]),J}(O.a.Component);ne.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:he,min:-he,step:1,style:{},onChange:W,onKeyDown:W,onPressEnter:W,onFocus:W,onBlur:W,parser:b,required:!1,autoComplete:"off"};var S=ne,Y=Ie.a=S},"e+RI":function(Qe,Ie,h){Qe.exports={btn:"btn___35XHi",s1:"s1___yzdGB",s2:"s2___3kxXm",btnDisabled:"btnDisabled___lI9pA",btn2:"btn2___2KLJQ"}},"eS0+":function(Qe,Ie,h){"use strict";var V=h("giR+"),ve=h("fyUT"),se=h("tJVT"),xe=h("PpiC"),me=h("OaEy"),re=h("2fM7"),U=h("q1tI"),k=h.n(U),O=h("2sxD"),T=h.n(O),A=h("51dB"),M=h.n(A),te=h("5MlY"),F=h.n(te),L=h("lnNo"),G=h.n(L),W=h("YBdh"),ee=h.n(W),b=h("LvDl"),fe=h.n(b),Se=h("TSYQ"),he=h.n(Se),H=re.a.Option,g=function(w){var C=parseInt(w);return Object(b.isNaN)(C)?0:C},ne=function(w){var C,J,z=w.index,E=w.value,P=E===void 0?[]:E,ae=w.onChange,B=w.type,be=w.disabled,D=be===void 0?!1:be,p=w.expansion,ue=p===void 0?!0:p,Be=Object(xe.a)(w,["index","value","onChange","type","disabled","expansion"]),Pe=Object(U.useState)(!0),ze=Object(se.a)(Pe,2),Te=ze[0],we=ze[1],X=function(le,N){var _=Object(b.cloneDeep)(P);_.difficulties[N].num=le,console.log(_,444),ae(_)};return k.a.createElement("div",{className:T.a.ListGroup,style:{borderWidth:z?1:0}},k.a.createElement("div",{className:T.a.a},z+1),k.a.createElement("div",{"data-type":"width",className:T.a.b},P==null?void 0:P.name),k.a.createElement("div",{className:T.a.c},P==null||((C=P.difficulties)===null||C===void 0)?void 0:C.map(function(K,le){return k.a.createElement("div",{key:le,style:{display:Te?"flex":le?"none":"flex"},className:T.a.c1},k.a.createElement("span",{style:{color:"#777777",marginRight:5}},"\u96BE\u5EA6"),K.difficulty===1&&k.a.createElement("span",{className:T.a.radio},"\u7B80\u5355"),K.difficulty===2&&k.a.createElement("span",{className:T.a.radio},"\u9002\u4E2D"),K.difficulty===3&&k.a.createElement("span",{className:T.a.radio},"\u56F0\u96BE"),k.a.createElement("span",{style:{color:"#777777",marginRight:5,marginLeft:50}},"\u62BD\u9898\u6570\u91CF"),z===0&&le===0?k.a.createElement("div",{id:"".concat(B,"_sum")},k.a.createElement(ve.a,{disabled:D,parser:g,onChange:function(_){return X(_,le)},min:0,max:K==null?void 0:K.count,value:(K==null?void 0:K.num)||0,style:{width:66}}),k.a.createElement("span",{style:{display:"none"}},"\u8BF7\u8F93\u5165\u6570\u91CF")):k.a.createElement(ve.a,{disabled:D,parser:g,onChange:function(_){return X(_,le)},min:0,max:K==null?void 0:K.count,value:(K==null?void 0:K.num)||0,style:{width:66}}),k.a.createElement("span",{style:{marginLeft:5}},"/",K==null?void 0:K.count))})),k.a.createElement("div",{style:{display:(P==null||((J=P.difficulties)===null||J===void 0)?void 0:J.length)===1||!ue?"none":"block"},onClick:function(){return we(!Te)},className:T.a.d},Te?"\u6536\u8D77":"\u5C55\u5F00",k.a.createElement("img",{style:{marginTop:-2,transform:Te?"rotate(0deg)":"rotate(180deg)"},src:G.a,className:"ml5"})))},S=function(w){var C,J,z=w.value,E=z===void 0?[]:z,P=w.onChange,ae=w.listClassName,B=w.disabled,be=B===void 0?!1:B,D=w.expansion,p=D===void 0?!0:D,ue=Object(xe.a)(w,["value","onChange","listClassName","disabled","expansion"]),Be=Object(U.useState)(!0),Pe=Object(se.a)(Be,2),ze=Pe[0],Te=Pe[1],we=function(_){var pe,Ue=_.score||0,Ze=[];_==null||((pe=_.item_banks)===null||pe===void 0)||pe.forEach(function(De){var Re;De==null||((Re=De.tag_disciplines)===null||Re===void 0)||Re.forEach(function(Me){var Xe;Me==null||((Xe=Me.difficulties)===null||Xe===void 0)||Xe.forEach(function(qe){qe.num&&Ze.push(qe.num)})})});var Ae=Ze.reduce(function(De,Re){return De+Re},0);return Ae*Ue},X=[{type:"SINGLE",name:"\u5355\u9009\u9898"},{type:"MULTIPLE",name:"\u591A\u9009\u9898"},{type:"COMPLETION",name:"\u586B\u7A7A\u9898"},{type:"JUDGMENT",name:"\u5224\u65AD\u9898"},{type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},{type:"PROGRAM",name:"\u7F16\u7A0B\u9898"},{type:"PRACTICAL",name:"\u5B9E\u8BAD\u9898"},{type:"COMBINATION",name:"\u7EC4\u5408\u9898"}],K=function(_,pe,Ue){var Ze=Object(b.cloneDeep)(E);Ze.item_banks[pe].tag_disciplines[Ue]=_;var Ae=we(Ze);Ze.scoreTotal=Ae,console.log(Ze,"newValue"),P(Ze)},le=function(_){var pe=Object(b.cloneDeep)(E);pe.score=_;var Ue=we(pe);pe.scoreTotal=Ue,P(pe)};return k.a.createElement("div",{className:he()(T.a.list,ae)},k.a.createElement("div",{className:T.a.head},k.a.createElement("div",{className:T.a.name},k.a.createElement("b",null),k.a.createElement("span",null,(C=X.find(function(N){return N.type===(E==null?void 0:E.item_type)}))===null||C===void 0?void 0:C.name)),k.a.createElement("div",{className:T.a.right},p&&k.a.createElement("div",{onClick:function(){return Te(!ze)},className:"current c-light-primary mb10"},ze?"\u6536\u8D77":"\u5C55\u5F00",k.a.createElement("img",{style:{marginTop:-2,transform:ze?"rotate(0deg)":"rotate(180deg)"},src:G.a,className:"ml5"})),k.a.createElement("div",null,k.a.createElement("img",{src:M.a}),k.a.createElement("span",{className:"ml10 mr20"},"\u603B\u5206",E.scoreTotal,"\u5206"),k.a.createElement("img",{className:"mr10",src:F.a}),k.a.createElement("span",null,(E==null?void 0:E.item_type)==="COMBINATION"?"\u6BCF\u5C0F\u9898":"\u6BCF\u9898"),k.a.createElement("div",{id:"".concat(E==null?void 0:E.item_type,"_score")},k.a.createElement(ve.a,{disabled:be,parser:g,min:0,onChange:le,value:E.score,style:{margin:"0 5px"}}),k.a.createElement("span",{style:{display:"none"}},"\u8BF7\u8F93\u5165\u6BCF\u9898\u5206\u6570")),k.a.createElement("span",null,"\u5206")))),k.a.createElement("div",{className:T.a.body,style:{display:ze?"block":"none"}},E==null||((J=E.item_banks)===null||J===void 0)?void 0:J.map(function(N,_){var pe;return k.a.createElement(k.a.Fragment,{key:_},k.a.createElement("div",{className:T.a.top},k.a.createElement("img",{src:ee.a}),k.a.createElement("span",null,"\u65B9\u5411/\u8BFE\u7A0B"),k.a.createElement("b",null),k.a.createElement("aside",null,N==null?void 0:N.disciplines,"/",N==null?void 0:N.sub_discipline)),k.a.createElement("div",{className:T.a.bottom},k.a.createElement("div",{className:T.a.l},"\u77E5\u8BC6\u70B9"),k.a.createElement("div",{className:T.a.r},N==null||((pe=N.tag_disciplines)===null||pe===void 0)?void 0:pe.map(function(Ue,Ze){return k.a.createElement(ne,{expansion:p,disabled:be,type:E==null?void 0:E.item_type,key:"".concat(_,"-").concat(Ze),value:Ue,index:Ze,onChange:function(De){return K(De,_,Ze)}})}))))})))};Ie.a=S},exQ7:function(Qe,Ie,h){Qe.exports=h.p+"static/te.6f9c0684.svg"},f4xo:function(Qe,Ie,h){var V=h("nVVt");function ve(se){this.mode=V.MODE_8BIT_BYTE,this.data=se}ve.prototype={getLength:function(se){return this.data.length},write:function(se){for(var xe=0;xe<this.data.length;xe++)se.put(this.data.charCodeAt(xe),8)}},Qe.exports=ve},fAei:function(Qe,Ie,h){"use strict";h.d(Ie,"a",function(){return fe.a});var V=h("rePB"),ve=h("VTBJ"),se=h("KQm4"),xe=h("1OyB"),me=h("vuIU"),re=h("Ji7U"),U=h("LK+K"),k=h("q1tI"),O=h("4IlW"),T=h("Kwbf"),A=h("TSYQ"),M=h.n(A),te=h("sboe"),F=h("OZM5"),L=h("815F"),G=h("ODXe"),W=h("Ff2n"),ee=h("+nKL"),b=h("8XRh"),fe=h("WaYH"),Se=function(Te,we){var X=Te.className,K=Te.style,le=Te.motion,N=Te.motionNodes,_=Te.motionType,pe=Te.onMotionStart,Ue=Te.onMotionEnd,Ze=Te.active,Ae=Te.treeNodeRequiredProps,De=Object(W.a)(Te,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),Re=k.useState(!0),Me=Object(G.a)(Re,2),Xe=Me[0],qe=Me[1],ot=k.useContext(te.a),Ke=ot.prefixCls,Ve=k.useRef(!1),At=function(){Ve.current||Ue(),Ve.current=!0};return Object(k.useEffect)(function(){N&&_==="hide"&&Xe&&qe(!1)},[N]),Object(k.useEffect)(function(){return N&&pe(),function(){N&&At()}},[]),N?k.createElement(b.default,Object.assign({ref:we,visible:Xe},le,{motionAppear:_==="show",onAppearEnd:At,onLeaveEnd:At}),function(gt,kt){var ct=gt.className,Pt=gt.style;return k.createElement("div",{ref:kt,className:M()("".concat(Ke,"-treenode-motion"),ct),style:Pt},N.map(function(xt){var bt=xt.data,Ne=bt.key,Ut=Object(W.a)(bt,["key"]),Rt=xt.isStart,je=xt.isEnd;delete Ut.children;var We=Object(L.f)(Ne,Ae);return k.createElement(fe.a,Object.assign({},Ut,We,{active:Ze,data:xt.data,key:Ne,isStart:Rt,isEnd:je}))}))}):k.createElement(fe.a,Object.assign({domRef:we,className:X,style:K},De,{active:Ze}))};Se.displayName="MotionTreeNode";var he=k.forwardRef(Se),H=he;function g(){var ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],we=ze.length,X=Te.length;if(Math.abs(we-X)!==1)return{add:!1,key:null};function K(le,N){var _=new Map;le.forEach(function(Ue){_.set(Ue,!0)});var pe=N.filter(function(Ue){return!_.has(Ue)});return pe.length===1?pe[0]:null}return we<X?{add:!0,key:K(ze,Te)}:{add:!1,key:K(Te,ze)}}function ne(ze,Te,we){var X=ze.findIndex(function(_){var pe=_.data;return pe.key===we}),K=ze[X+1],le=Te.findIndex(function(_){var pe=_.data;return pe.key===we});if(K){var N=Te.findIndex(function(_){var pe=_.data;return pe.key===K.data.key});return Te.slice(le+1,N)}return Te.slice(le+1)}var S={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},Y=function(){},w="RC_TREE_MOTION_".concat(Math.random()),C={key:w},J={key:w,level:0,index:0,pos:"0",node:C},z={parent:null,children:[],pos:J.pos,data:C,isStart:[],isEnd:[]};function E(ze,Te,we,X){return Te===!1||!we?ze:ze.slice(0,Math.ceil(we/X)+1)}function P(ze){var Te=ze.data.key,we=ze.pos;return Object(L.e)(Te,we)}function ae(ze){for(var Te=String(ze.data.key),we=ze;we.parent;)we=we.parent,Te="".concat(we.data.key," > ").concat(Te);return Te}var B=function(Te,we){var X=Te.prefixCls,K=Te.data,le=Te.selectable,N=Te.checkable,_=Te.expandedKeys,pe=Te.selectedKeys,Ue=Te.checkedKeys,Ze=Te.loadedKeys,Ae=Te.loadingKeys,De=Te.halfCheckedKeys,Re=Te.keyEntities,Me=Te.disabled,Xe=Te.dragging,qe=Te.dragOverNodeKey,ot=Te.dropPosition,Ke=Te.motion,Ve=Te.height,At=Te.itemHeight,gt=Te.virtual,kt=Te.focusable,ct=Te.activeItem,Pt=Te.focused,xt=Te.tabIndex,bt=Te.onKeyDown,Ne=Te.onFocus,Ut=Te.onBlur,Rt=Te.onActiveChange,je=Te.onListChangeStart,We=Te.onListChangeEnd,$=Object(W.a)(Te,["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"]),q=k.useRef(null);k.useImperativeHandle(we,function(){return{scrollTo:function(dt){q.current.scrollTo(dt)}}});var Q=k.useState(_),x=Object(G.a)(Q,2),R=x[0],j=x[1],I=k.useState(K),de=Object(G.a)(I,2),Ce=de[0],Oe=de[1],_t=k.useState(K),at=Object(G.a)(_t,2),ge=at[0],lt=at[1],Et=k.useState([]),et=Object(G.a)(Et,2),Ft=et[0],tt=et[1],zt=k.useState(null),It=Object(G.a)(zt,2),vt=It[0],$t=It[1];function Lt(){Oe(K),lt(K),tt([]),$t(null),We()}k.useEffect(function(){j(_);var nt=g(R,_);if(nt.key!==null)if(nt.add){var dt=Ce.findIndex(function(tn){var Nt=tn.data.key;return Nt===nt.key}),Kt=E(ne(Ce,K,nt.key),gt,Ve,At),Vt=Ce.slice();Vt.splice(dt+1,0,z),lt(Vt),tt(Kt),$t("show")}else{var an=K.findIndex(function(tn){var Nt=tn.data.key;return Nt===nt.key}),Gt=E(ne(K,Ce,nt.key),gt,Ve,At),Ct=K.slice();Ct.splice(an+1,0,z),lt(Ct),tt(Gt),$t("hide")}else Ce!==K&&(Oe(K),lt(K))},[_,K]),k.useEffect(function(){Xe||Lt()},[Xe]);var Fe=Ke?ge:K,ut={expandedKeys:_,selectedKeys:pe,loadedKeys:Ze,loadingKeys:Ae,checkedKeys:Ue,halfCheckedKeys:De,dragOverNodeKey:qe,dropPosition:ot,keyEntities:Re};return k.createElement(k.Fragment,null,Pt&&ct&&k.createElement("span",{style:S,"aria-live":"assertive"},ae(ct)),k.createElement("div",{role:"tree"},k.createElement("input",{style:S,disabled:kt===!1||Me,tabIndex:kt!==!1?xt:null,onKeyDown:bt,onFocus:Ne,onBlur:Ut,value:"",onChange:Y})),k.createElement(ee.a,Object.assign({},$,{data:Fe,itemKey:P,height:Ve,fullHeight:!1,virtual:gt,itemHeight:At,prefixCls:"".concat(X,"-list"),ref:q}),function(nt){var dt=nt.pos,Kt=nt.data,Vt=Kt.key,an=Object(W.a)(Kt,["key"]),Gt=nt.isStart,Ct=nt.isEnd,tn=Object(L.e)(Vt,dt);delete an.children;var Nt=Object(L.f)(tn,ut);return k.createElement(H,Object.assign({},an,Nt,{active:ct&&Vt===ct.data.key,pos:dt,data:nt.data,isStart:Gt,isEnd:Ct,motion:Ke,motionNodes:Vt===w?Ft:null,motionType:vt,onMotionStart:je,onMotionEnd:Lt,treeNodeRequiredProps:ut,onMouseMove:function(){Rt(null)}}))}))},be=k.forwardRef(B);be.displayName="NodeList";var D=be,p=h("NvD2"),ue=function(ze){Object(re.a)(we,ze);var Te=Object(U.a)(we);function we(){var X;return Object(xe.a)(this,we),X=Te.apply(this,arguments),X.destroyed=!1,X.state={keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragging:!1,dragNodesKeys:[],dragOverNodeKey:null,dropPosition:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null},X.listRef=k.createRef(),X.onNodeDragStart=function(K,le){var N=X.state,_=N.expandedKeys,pe=N.keyEntities,Ue=X.props.onDragStart,Ze=le.props.eventKey;X.dragNode=le;var Ae=Object(F.b)(_,Ze);X.setState({dragging:!0,dragNodesKeys:Object(F.g)(Ze,pe)}),X.setExpandedKeys(Ae),Ue&&Ue({event:K,node:Object(L.b)(le.props)})},X.onNodeDragEnter=function(K,le){var N=X.state,_=N.expandedKeys,pe=N.keyEntities,Ue=N.dragNodesKeys,Ze=X.props.onDragEnter,Ae=le.props,De=Ae.pos,Re=Ae.eventKey;if(!X.dragNode||Ue.indexOf(Re)!==-1)return;var Me=Object(F.c)(K,le);if(X.dragNode.props.eventKey===Re&&Me===0){X.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){X.setState({dragOverNodeKey:Re,dropPosition:Me}),X.delayedDragEnterLogic||(X.delayedDragEnterLogic={}),Object.keys(X.delayedDragEnterLogic).forEach(function(Xe){clearTimeout(X.delayedDragEnterLogic[Xe])}),X.delayedDragEnterLogic[De]=window.setTimeout(function(){if(!X.state.dragging)return;var Xe=Object(se.a)(_),qe=pe[Re];qe&&(qe.children||[]).length&&(Xe=Object(F.a)(_,Re)),"expandedKeys"in X.props||X.setExpandedKeys(Xe),Ze&&Ze({event:K,node:Object(L.b)(le.props),expandedKeys:Xe})},400)},0)},X.onNodeDragOver=function(K,le){var N=X.state.dragNodesKeys,_=X.props.onDragOver,pe=le.props.eventKey;if(N.indexOf(pe)!==-1)return;if(X.dragNode&&pe===X.state.dragOverNodeKey){var Ue=Object(F.c)(K,le);if(Ue===X.state.dropPosition)return;X.setState({dropPosition:Ue})}_&&_({event:K,node:Object(L.b)(le.props)})},X.onNodeDragLeave=function(K,le){var N=X.props.onDragLeave;X.setState({dragOverNodeKey:""}),N&&N({event:K,node:Object(L.b)(le.props)})},X.onNodeDragEnd=function(K,le){var N=X.props.onDragEnd;X.setState({dragOverNodeKey:""}),X.cleanDragState(),N&&N({event:K,node:Object(L.b)(le.props)}),X.dragNode=null},X.onNodeDrop=function(K,le){var N=X.state,_=N.dragNodesKeys,pe=_===void 0?[]:_,Ue=N.dropPosition,Ze=X.props.onDrop,Ae=le.props,De=Ae.eventKey,Re=Ae.pos;if(X.setState({dragOverNodeKey:""}),X.cleanDragState(),pe.indexOf(De)!==-1){Object(T.a)(!1,"Can not drop to dragNode(include it's children node)");return}var Me=Object(F.k)(Re),Xe={event:K,node:Object(L.b)(le.props),dragNode:X.dragNode?Object(L.b)(X.dragNode.props):null,dragNodesKeys:pe.slice(),dropPosition:Ue+Number(Me[Me.length-1]),dropToGap:!1};Ue!==0&&(Xe.dropToGap=!0),Ze&&Ze(Xe),X.dragNode=null},X.cleanDragState=function(){var K=X.state.dragging;K&&X.setState({dragging:!1})},X.onNodeClick=function(K,le){var N=X.props.onClick;N&&N(K,le)},X.onNodeDoubleClick=function(K,le){var N=X.props.onDoubleClick;N&&N(K,le)},X.onNodeSelect=function(K,le){var N=X.state.selectedKeys,_=X.state.keyEntities,pe=X.props,Ue=pe.onSelect,Ze=pe.multiple,Ae=le.selected,De=le.key,Re=!Ae;Re?Ze?N=Object(F.a)(N,De):N=[De]:N=Object(F.b)(N,De);var Me=N.map(function(Xe){var qe=_[Xe];return qe?qe.node:null}).filter(function(Xe){return Xe});X.setUncontrolledState({selectedKeys:N}),Ue&&Ue(N,{event:"select",selected:Re,node:le,selectedNodes:Me,nativeEvent:K.nativeEvent})},X.onNodeCheck=function(K,le,N){var _=X.state,pe=_.keyEntities,Ue=_.checkedKeys,Ze=_.halfCheckedKeys,Ae=X.props,De=Ae.checkStrictly,Re=Ae.onCheck,Me=le.key,Xe,qe={event:"check",node:le,checked:N,nativeEvent:K.nativeEvent};if(De){var ot=N?Object(F.a)(Ue,Me):Object(F.b)(Ue,Me),Ke=Object(F.b)(Ze,Me);Xe={checked:ot,halfChecked:Ke},qe.checkedNodes=ot.map(function(Pt){return pe[Pt]}).filter(function(Pt){return Pt}).map(function(Pt){return Pt.node}),X.setUncontrolledState({checkedKeys:ot})}else{var Ve=Object(p.a)([].concat(Object(se.a)(Ue),[Me]),!0,pe),At=Ve.checkedKeys,gt=Ve.halfCheckedKeys;if(!N){var kt=new Set(At);kt.delete(Me);var ct=Object(p.a)(Array.from(kt),{checked:!1,halfCheckedKeys:gt},pe);At=ct.checkedKeys,gt=ct.halfCheckedKeys}Xe=At,qe.checkedNodes=[],qe.checkedNodesPositions=[],qe.halfCheckedKeys=gt,At.forEach(function(Pt){var xt=pe[Pt];if(!xt)return;var bt=xt.node,Ne=xt.pos;qe.checkedNodes.push(bt),qe.checkedNodesPositions.push({node:bt,pos:Ne})}),X.setUncontrolledState({checkedKeys:At},!1,{halfCheckedKeys:gt})}Re&&Re(Xe,qe)},X.onNodeLoad=function(K){return new Promise(function(le){X.setState(function(N){var _=N.loadedKeys,pe=_===void 0?[]:_,Ue=N.loadingKeys,Ze=Ue===void 0?[]:Ue,Ae=X.props,De=Ae.loadData,Re=Ae.onLoad,Me=K.key;if(!De||pe.indexOf(Me)!==-1||Ze.indexOf(Me)!==-1)return{};var Xe=De(K);return Xe.then(function(){var qe=X.state,ot=qe.loadedKeys,Ke=qe.loadingKeys,Ve=Object(F.a)(ot,Me),At=Object(F.b)(Ke,Me);Re&&Re(Ve,{event:"load",node:K}),X.setUncontrolledState({loadedKeys:Ve}),X.setState({loadingKeys:At}),le()}),{loadingKeys:Object(F.a)(Ze,Me)}})})},X.onNodeMouseEnter=function(K,le){var N=X.props.onMouseEnter;N&&N({event:K,node:le})},X.onNodeMouseLeave=function(K,le){var N=X.props.onMouseLeave;N&&N({event:K,node:le})},X.onNodeContextMenu=function(K,le){var N=X.props.onRightClick;N&&(K.preventDefault(),N({event:K,node:le}))},X.onFocus=function(){var K=X.props.onFocus;X.setState({focused:!0}),K&&K.apply(void 0,arguments)},X.onBlur=function(){var K=X.props.onBlur;X.setState({focused:!1}),X.onActiveChange(null),K&&K.apply(void 0,arguments)},X.getTreeNodeRequiredProps=function(){var K=X.state,le=K.expandedKeys,N=K.selectedKeys,_=K.loadedKeys,pe=K.loadingKeys,Ue=K.checkedKeys,Ze=K.halfCheckedKeys,Ae=K.dragOverNodeKey,De=K.dropPosition,Re=K.keyEntities;return{expandedKeys:le||[],selectedKeys:N||[],loadedKeys:_||[],loadingKeys:pe||[],checkedKeys:Ue||[],halfCheckedKeys:Ze||[],dragOverNodeKey:Ae,dropPosition:De,keyEntities:Re}},X.setExpandedKeys=function(K){var le=X.state.treeData,N=Object(L.d)(le,K);X.setUncontrolledState({expandedKeys:K,flattenNodes:N},!0)},X.onNodeExpand=function(K,le){var N=X.state.expandedKeys,_=X.state.listChanging,pe=X.props,Ue=pe.onExpand,Ze=pe.loadData,Ae=le.key,De=le.expanded;if(_)return;var Re=N.indexOf(Ae),Me=!De;if(Object(T.a)(De&&Re!==-1||!De&&Re===-1,"Expand state not sync with index check"),Me?N=Object(F.a)(N,Ae):N=Object(F.b)(N,Ae),X.setExpandedKeys(N),Ue&&Ue(N,{node:le,expanded:Me,nativeEvent:K.nativeEvent}),Me&&Ze){var Xe=X.onNodeLoad(le);Xe&&Xe.then(function(){var qe=Object(L.d)(X.state.treeData,N);X.setUncontrolledState({flattenNodes:qe})})}},X.onListChangeStart=function(){X.setUncontrolledState({listChanging:!0})},X.onListChangeEnd=function(){setTimeout(function(){X.setUncontrolledState({listChanging:!1})})},X.onActiveChange=function(K){var le=X.state.activeKey,N=X.props.onActiveChange;if(le===K)return;X.setState({activeKey:K}),K!==null&&X.scrollTo({key:K}),N&&N(K)},X.getActiveItem=function(){var K=X.state,le=K.activeKey,N=K.flattenNodes;return le===null?null:N.find(function(_){var pe=_.data.key;return pe===le})||null},X.offsetActiveKey=function(K){var le=X.state,N=le.flattenNodes,_=le.activeKey,pe=N.findIndex(function(Ae){var De=Ae.data.key;return De===_});pe===-1&&K<0&&(pe=N.length),pe=(pe+K+N.length)%N.length;var Ue=N[pe];if(Ue){var Ze=Ue.data.key;X.onActiveChange(Ze)}else X.onActiveChange(null)},X.onKeyDown=function(K){var le=X.state,N=le.activeKey,_=le.expandedKeys,pe=le.checkedKeys,Ue=X.props,Ze=Ue.onKeyDown,Ae=Ue.checkable,De=Ue.selectable;switch(K.which){case O.a.UP:{X.offsetActiveKey(-1),K.preventDefault();break}case O.a.DOWN:{X.offsetActiveKey(1),K.preventDefault();break}}var Re=X.getActiveItem();if(Re&&Re.data){var Me=X.getTreeNodeRequiredProps(),Xe=Re.data.isLeaf===!1||!!(Re.data.children||[]).length,qe=Object(L.b)(Object(ve.a)(Object(ve.a)({},Object(L.f)(N,Me)),{},{data:Re.data,active:!0}));switch(K.which){case O.a.LEFT:{Xe&&_.includes(N)?X.onNodeExpand({},qe):Re.parent&&X.onActiveChange(Re.parent.data.key),K.preventDefault();break}case O.a.RIGHT:{Xe&&!_.includes(N)?X.onNodeExpand({},qe):Re.children&&Re.children.length&&X.onActiveChange(Re.children[0].data.key),K.preventDefault();break}case O.a.ENTER:case O.a.SPACE:{Ae&&!qe.disabled&&qe.checkable!==!1&&!qe.disableCheckbox?X.onNodeCheck({},qe,!pe.includes(N)):!Ae&&De&&!qe.disabled&&qe.selectable!==!1&&X.onNodeSelect({},qe);break}}}Ze&&Ze(K)},X.setUncontrolledState=function(K){var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(X.destroyed)return;var _=!1,pe=!0,Ue={};Object.keys(K).forEach(function(Ze){if(Ze in X.props){pe=!1;return}_=!0,Ue[Ze]=K[Ze]}),_&&(!le||pe)&&X.setState(Object(ve.a)(Object(ve.a)({},Ue),N))},X.scrollTo=function(K){X.listRef.current.scrollTo(K)},X}return Object(me.a)(we,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var K,le=this.state,N=le.focused,_=le.flattenNodes,pe=le.keyEntities,Ue=le.dragging,Ze=le.activeKey,Ae=this.props,De=Ae.prefixCls,Re=Ae.className,Me=Ae.style,Xe=Ae.showLine,qe=Ae.focusable,ot=Ae.tabIndex,Ke=ot===void 0?0:ot,Ve=Ae.selectable,At=Ae.showIcon,gt=Ae.icon,kt=Ae.switcherIcon,ct=Ae.draggable,Pt=Ae.checkable,xt=Ae.checkStrictly,bt=Ae.disabled,Ne=Ae.motion,Ut=Ae.loadData,Rt=Ae.filterTreeNode,je=Ae.height,We=Ae.itemHeight,$=Ae.virtual,q=Ae.titleRender,Q=Ae.onContextMenu,x=Object(F.f)(this.props);return k.createElement(te.a.Provider,{value:{prefixCls:De,selectable:Ve,showIcon:At,icon:gt,switcherIcon:kt,draggable:ct,checkable:Pt,checkStrictly:xt,disabled:bt,keyEntities:pe,loadData:Ut,filterTreeNode:Rt,titleRender:q,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},k.createElement("div",{className:M()(De,Re,(K={},Object(V.a)(K,"".concat(De,"-show-line"),Xe),Object(V.a)(K,"".concat(De,"-focused"),N),Object(V.a)(K,"".concat(De,"-active-focused"),Ze!==null),K))},k.createElement(D,Object.assign({ref:this.listRef,prefixCls:De,style:Me,data:_,disabled:bt,selectable:Ve,checkable:!!Pt,motion:Ne,dragging:Ue,height:je,itemHeight:We,virtual:$,focusable:qe,focused:N,tabIndex:Ke,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:Q},this.getTreeNodeRequiredProps(),x))))}}],[{key:"getDerivedStateFromProps",value:function(K,le){var N=le.prevProps,_={prevProps:K};function pe(gt){return!N&&gt in K||N&&N[gt]!==K[gt]}var Ue;if(pe("treeData")?Ue=K.treeData:pe("children")&&(Object(T.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),Ue=Object(L.c)(K.children)),Ue){_.treeData=Ue;var Ze=Object(L.a)(Ue);_.keyEntities=Object(ve.a)(Object(V.a)({},w,J),Ze.keyEntities)}var Ae=_.keyEntities||le.keyEntities;if(pe("expandedKeys")||N&&pe("autoExpandParent"))_.expandedKeys=K.autoExpandParent||!N&&K.defaultExpandParent?Object(F.e)(K.expandedKeys,Ae):K.expandedKeys;else if(!N&&K.defaultExpandAll){var De=Object(ve.a)({},Ae);delete De[w],_.expandedKeys=Object.keys(De).map(function(gt){return De[gt].key})}else!N&&K.defaultExpandedKeys&&(_.expandedKeys=K.autoExpandParent||K.defaultExpandParent?Object(F.e)(K.defaultExpandedKeys,Ae):K.defaultExpandedKeys);if(_.expandedKeys||delete _.expandedKeys,Ue||_.expandedKeys){var Re=Object(L.d)(Ue||le.treeData,_.expandedKeys||le.expandedKeys);_.flattenNodes=Re}if(K.selectable&&(pe("selectedKeys")?_.selectedKeys=Object(F.d)(K.selectedKeys,K):!N&&K.defaultSelectedKeys&&(_.selectedKeys=Object(F.d)(K.defaultSelectedKeys,K))),K.checkable){var Me;if(pe("checkedKeys")?Me=Object(F.j)(K.checkedKeys)||{}:!N&&K.defaultCheckedKeys?Me=Object(F.j)(K.defaultCheckedKeys)||{}:Ue&&(Me=Object(F.j)(K.checkedKeys)||{checkedKeys:le.checkedKeys,halfCheckedKeys:le.halfCheckedKeys}),Me){var Xe=Me,qe=Xe.checkedKeys,ot=qe===void 0?[]:qe,Ke=Xe.halfCheckedKeys,Ve=Ke===void 0?[]:Ke;if(!K.checkStrictly){var At=Object(p.a)(ot,!0,Ae);ot=At.checkedKeys,Ve=At.halfCheckedKeys}_.checkedKeys=ot,_.halfCheckedKeys=Ve}}return pe("loadedKeys")&&(_.loadedKeys=K.loadedKeys),_}}]),we}(k.Component);ue.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[]},ue.TreeNode=fe.a;var Be=ue,Pe=Ie.b=Be},k4n4:function(Qe,Ie,h){"use strict";var V=h("tJVT"),ve=h("q1tI"),se=h.n(ve),xe=h("e+RI"),me=h.n(xe),re=h("FTkQ"),U=h.n(re),k=h("E/GV"),O=h.n(k),T=function(M){var te=M.type,F=te===void 0?1:te,L=M.value,G=L===void 0?[]:L,W=M.onChange,ee=M.disabled,b=ee===void 0?!1:ee,fe=M.icon,Se=Object(ve.useState)(),he=Object(V.a)(Se,2),H=he[0],g=he[1],ne=function(Y){W(Y)};return F===1?se.a.createElement("div",null,G==null?void 0:G.map(function(S,Y){return se.a.createElement("div",{key:Y,className:b?"".concat(me.a.btn," ").concat(me.a.btnDisabled):me.a.btn},se.a.createElement("span",{className:me.a.s1},S.name),se.a.createElement("img",{src:U.a,className:me.a.s2,onClick:function(){return ne(S.id)}}))})):se.a.createElement("div",null,G==null?void 0:G.map(function(S,Y){return se.a.createElement("div",{key:Y,className:me.a.btn2},se.a.createElement("span",{className:me.a.s1},se.a.createElement("img",{src:fe||O.a}),S.name),se.a.createElement("img",{src:U.a,className:me.a.s2,onClick:function(){return ne(S.id)}}))}))};Ie.a=T},kSUc:function(Qe,Ie,h){},kqOp:function(Qe,Ie,h){"use strict";h.d(Ie,"a",function(){return T});var V=h("0Owb"),ve=h("fWQN"),se=h("mtLc"),xe=h("yKVA"),me=h("879j"),re=h("q1tI"),U=h.n(re),k=h("Ot1p"),O="\u2581",T=function(A){Object(xe.a)(te,A);var M=Object(me.a)(te);function te(){var F;Object(ve.a)(this,te);for(var L=arguments.length,G=new Array(L),W=0;W<L;W++)G[W]=arguments[W];return F=M.call.apply(M,[this].concat(G)),F.getChCountBeforeCursor=function(ee,b){for(var fe=b.line,Se=0,he=0;he<fe;he++)Se+=ee.getLine(he).split(O).length-1;var H=ee.getLine(fe).substring(0,b.ch);return Se+=H.split(O).length-1,Se},F.onCMBeforeChange=function(ee,b){var fe=ee.getRange(b.from,b.to),Se=0;if(b.text.forEach(function(ne){Se+=ne.split(O).length-1}),fe&&fe.indexOf(O)!=-1){var he=fe.split(O).length-1,H=F.getChCountBeforeCursor(ee,b.from);console.log("\u5220\u9664".concat(he,"\u4E2A\uFF0C \u4E4B\u524D\u6709").concat(H,"\u4E2A\uFF0C\u65B0\u589E").concat(Se,"\u4E2A")),F.props.deleteEmptyDisabled?b.cancel():F.props.onPlaceholderChange&&F.props.onPlaceholderChange(H,he,Se)}else if(Se){var g=F.getChCountBeforeCursor(ee,b.from);console.log("\u65B0\u589E".concat(Se,"\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(g,"\u4E2A")),F.props.onPlaceholderChange&&F.props.onPlaceholderChange(g,0,Se)}},F}return Object(se.a)(te,[{key:"render",value:function(){return U.a.createElement(k.a,Object(V.a)({},this.props,{onCMBeforeChange:this.onCMBeforeChange}))}}]),te}(re.Component)},lZu9:function(Qe,Ie,h){(function(V){V(h("VrN/"),h("1eCo"),h("8EBN"))})(function(V){"use strict";V.defineMode("markdown",function(ve,se){var xe=V.getMode(ve,"text/html"),me=xe.name=="null";function re(D){if(V.findModeByName){var p=V.findModeByName(D);p&&(D=p.mime||p.mimes[0])}var ue=V.getMode(ve,D);return ue.name=="null"?null:ue}se.highlightFormatting===void 0&&(se.highlightFormatting=!1),se.maxBlockquoteDepth===void 0&&(se.maxBlockquoteDepth=0),se.taskLists===void 0&&(se.taskLists=!1),se.strikethrough===void 0&&(se.strikethrough=!1),se.emoji===void 0&&(se.emoji=!1),se.fencedCodeBlockHighlighting===void 0&&(se.fencedCodeBlockHighlighting=!0),se.fencedCodeBlockDefaultMode===void 0&&(se.fencedCodeBlockDefaultMode="text/plain"),se.xml===void 0&&(se.xml=!0),se.tokenTypeOverrides===void 0&&(se.tokenTypeOverrides={});var U={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var k in U)U.hasOwnProperty(k)&&se.tokenTypeOverrides[k]&&(U[k]=se.tokenTypeOverrides[k]);var O=/^([*\-_])(?:\s*\1){2,}\s*$/,T=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,A=/^\[(x| )\](?=\s)/i,M=se.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,te=/^ {0,3}(?:\={1,}|-{2,})\s*$/,F=/^[^#!\[\]*_\\<>` "'(~:]+/,L=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,G=/^\s*\[[^\]]+?\]:.*$/,W=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,ee=" ";function b(D,p,ue){return p.f=p.inline=ue,ue(D,p)}function fe(D,p,ue){return p.f=p.block=ue,ue(D,p)}function Se(D){return!D||!/\S/.test(D.string)}function he(D){if(D.linkTitle=!1,D.linkHref=!1,D.linkText=!1,D.em=!1,D.strong=!1,D.strikethrough=!1,D.quote=0,D.indentedCode=!1,D.f==g){var p=me;if(!p){var ue=V.innerMode(xe,D.htmlState);p=ue.mode.name=="xml"&&ue.state.tagStart===null&&!ue.state.context&&ue.state.tokenize.isInText}p&&(D.f=w,D.block=H,D.htmlState=null)}return D.trailingSpace=0,D.trailingSpaceNewLine=!1,D.prevLine=D.thisLine,D.thisLine={stream:null},null}function H(D,p){var ue=D.column()===p.indentation,Be=Se(p.prevLine.stream),Pe=p.indentedCode,ze=p.prevLine.hr,Te=p.list!==!1,we=(p.listStack[p.listStack.length-1]||0)+3;p.indentedCode=!1;var X=p.indentation;if(p.indentationDiff===null&&(p.indentationDiff=p.indentation,Te)){for(p.list=null;X<p.listStack[p.listStack.length-1];)p.listStack.pop(),p.listStack.length?p.indentation=p.listStack[p.listStack.length-1]:p.list=!1;p.list!==!1&&(p.indentationDiff=X-p.listStack[p.listStack.length-1])}var K=!Be&&!ze&&!p.prevLine.header&&(!Te||!Pe)&&!p.prevLine.fencedCodeEnd,le=(p.list===!1||ze||Be)&&p.indentation<=we&&D.match(O),N=null;if(p.indentationDiff>=4&&(Pe||p.prevLine.fencedCodeEnd||p.prevLine.header||Be))return D.skipToEnd(),p.indentedCode=!0,U.code;if(D.eatSpace())return null;if(ue&&p.indentation<=we&&(N=D.match(M))&&N[1].length<=6)return p.quote=0,p.header=N[1].length,p.thisLine.header=!0,se.highlightFormatting&&(p.formatting="header"),p.f=p.inline,S(p);if(p.indentation<=we&&D.eat(">"))return p.quote=ue?1:p.quote+1,se.highlightFormatting&&(p.formatting="quote"),D.eatSpace(),S(p);if(!le&&!p.setext&&ue&&p.indentation<=we&&(N=D.match(T))){var _=N[1]?"ol":"ul";return p.indentation=X+D.current().length,p.list=!0,p.quote=0,p.listStack.push(p.indentation),p.em=!1,p.strong=!1,p.code=!1,p.strikethrough=!1,se.taskLists&&D.match(A,!1)&&(p.taskList=!0),p.f=p.inline,se.highlightFormatting&&(p.formatting=["list","list-"+_]),S(p)}else{if(ue&&p.indentation<=we&&(N=D.match(L,!0)))return p.quote=0,p.fencedEndRE=new RegExp(N[1]+"+ *$"),p.localMode=se.fencedCodeBlockHighlighting&&re(N[2]||se.fencedCodeBlockDefaultMode),p.localMode&&(p.localState=V.startState(p.localMode)),p.f=p.block=ne,se.highlightFormatting&&(p.formatting="code-block"),p.code=-1,S(p);if(p.setext||(!K||!Te)&&!p.quote&&p.list===!1&&!p.code&&!le&&!G.test(D.string)&&(N=D.lookAhead(1))&&(N=N.match(te)))return p.setext?(p.header=p.setext,p.setext=0,D.skipToEnd(),se.highlightFormatting&&(p.formatting="header")):(p.header=N[0].charAt(0)=="="?1:2,p.setext=p.header),p.thisLine.header=!0,p.f=p.inline,S(p);if(le)return D.skipToEnd(),p.hr=!0,p.thisLine.hr=!0,U.hr;if(D.peek()==="[")return b(D,p,P)}return b(D,p,p.inline)}function g(D,p){var ue=xe.token(D,p.htmlState);if(!me){var Be=V.innerMode(xe,p.htmlState);(Be.mode.name=="xml"&&Be.state.tagStart===null&&!Be.state.context&&Be.state.tokenize.isInText||p.md_inside&&D.current().indexOf(">")>-1)&&(p.f=w,p.block=H,p.htmlState=null)}return ue}function ne(D,p){var ue=p.listStack[p.listStack.length-1]||0,Be=p.indentation<ue,Pe=ue+3;if(p.fencedEndRE&&p.indentation<=Pe&&(Be||D.match(p.fencedEndRE))){se.highlightFormatting&&(p.formatting="code-block");var ze;return Be||(ze=S(p)),p.localMode=p.localState=null,p.block=H,p.f=w,p.fencedEndRE=null,p.code=0,p.thisLine.fencedCodeEnd=!0,Be?fe(D,p,p.block):ze}else return p.localMode?p.localMode.token(D,p.localState):(D.skipToEnd(),U.code)}function S(D){var p=[];if(D.formatting){p.push(U.formatting),typeof D.formatting=="string"&&(D.formatting=[D.formatting]);for(var ue=0;ue<D.formatting.length;ue++)p.push(U.formatting+"-"+D.formatting[ue]),D.formatting[ue]==="header"&&p.push(U.formatting+"-"+D.formatting[ue]+"-"+D.header),D.formatting[ue]==="quote"&&(!se.maxBlockquoteDepth||se.maxBlockquoteDepth>=D.quote?p.push(U.formatting+"-"+D.formatting[ue]+"-"+D.quote):p.push("error"))}if(D.taskOpen)return p.push("meta"),p.length?p.join(" "):null;if(D.taskClosed)return p.push("property"),p.length?p.join(" "):null;if(D.linkHref?p.push(U.linkHref,"url"):(D.strong&&p.push(U.strong),D.em&&p.push(U.em),D.strikethrough&&p.push(U.strikethrough),D.emoji&&p.push(U.emoji),D.linkText&&p.push(U.linkText),D.code&&p.push(U.code),D.image&&p.push(U.image),D.imageAltText&&p.push(U.imageAltText,"link"),D.imageMarker&&p.push(U.imageMarker)),D.header&&p.push(U.header,U.header+"-"+D.header),D.quote&&(p.push(U.quote),!se.maxBlockquoteDepth||se.maxBlockquoteDepth>=D.quote?p.push(U.quote+"-"+D.quote):p.push(U.quote+"-"+se.maxBlockquoteDepth)),D.list!==!1){var Be=(D.listStack.length-1)%3;Be?Be===1?p.push(U.list2):p.push(U.list3):p.push(U.list1)}return D.trailingSpaceNewLine?p.push("trailing-space-new-line"):D.trailingSpace&&p.push("trailing-space-"+(D.trailingSpace%2?"a":"b")),p.length?p.join(" "):null}function Y(D,p){return D.match(F,!0)?S(p):void 0}function w(D,p){var ue=p.text(D,p);if(typeof ue!="undefined")return ue;if(p.list)return p.list=null,S(p);if(p.taskList){var Be=D.match(A,!0)[1]===" ";return Be?p.taskOpen=!0:p.taskClosed=!0,se.highlightFormatting&&(p.formatting="task"),p.taskList=!1,S(p)}if(p.taskOpen=!1,p.taskClosed=!1,p.header&&D.match(/^#+$/,!0))return se.highlightFormatting&&(p.formatting="header"),S(p);var Pe=D.next();if(p.linkTitle){p.linkTitle=!1;var ze=Pe;Pe==="("&&(ze=")"),ze=(ze+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Te="^\\s*(?:[^"+ze+"\\\\]+|\\\\\\\\|\\\\.)"+ze;if(D.match(new RegExp(Te),!0))return U.linkHref}if(Pe==="`"){var we=p.formatting;se.highlightFormatting&&(p.formatting="code"),D.eatWhile("`");var X=D.current().length;if(p.code==0&&(!p.quote||X==1))return p.code=X,S(p);if(X==p.code){var K=S(p);return p.code=0,K}else return p.formatting=we,S(p)}else if(p.code)return S(p);if(Pe==="\\"&&(D.next(),se.highlightFormatting)){var le=S(p),N=U.formatting+"-escape";return le?le+" "+N:N}if(Pe==="!"&&D.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return p.imageMarker=!0,p.image=!0,se.highlightFormatting&&(p.formatting="image"),S(p);if(Pe==="["&&p.imageMarker&&D.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return p.imageMarker=!1,p.imageAltText=!0,se.highlightFormatting&&(p.formatting="image"),S(p);if(Pe==="]"&&p.imageAltText){se.highlightFormatting&&(p.formatting="image");var le=S(p);return p.imageAltText=!1,p.image=!1,p.inline=p.f=J,le}if(Pe==="["&&!p.image)return p.linkText&&D.match(/^.*?\]/)||(p.linkText=!0,se.highlightFormatting&&(p.formatting="link")),S(p);if(Pe==="]"&&p.linkText){se.highlightFormatting&&(p.formatting="link");var le=S(p);return p.linkText=!1,p.inline=p.f=D.match(/\(.*?\)| ?\[.*?\]/,!1)?J:w,le}if(Pe==="<"&&D.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){p.f=p.inline=C,se.highlightFormatting&&(p.formatting="link");var le=S(p);return le?le+=" ":le="",le+U.linkInline}if(Pe==="<"&&D.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){p.f=p.inline=C,se.highlightFormatting&&(p.formatting="link");var le=S(p);return le?le+=" ":le="",le+U.linkEmail}if(se.xml&&Pe==="<"&&D.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var _=D.string.indexOf(">",D.pos);if(_!=-1){var pe=D.string.substring(D.start,_);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(pe)&&(p.md_inside=!0)}return D.backUp(1),p.htmlState=V.startState(xe),fe(D,p,g)}if(se.xml&&Pe==="<"&&D.match(/^\/\w*?>/))return p.md_inside=!1,"tag";if(Pe==="*"||Pe==="_"){for(var Ue=1,Ze=D.pos==1?" ":D.string.charAt(D.pos-2);Ue<3&&D.eat(Pe);)Ue++;var Ae=D.peek()||" ",De=!/\s/.test(Ae)&&(!W.test(Ae)||/\s/.test(Ze)||W.test(Ze)),Re=!/\s/.test(Ze)&&(!W.test(Ze)||/\s/.test(Ae)||W.test(Ae)),Me=null,Xe=null;if(Ue%2&&(!p.em&&De&&(Pe==="*"||!Re||W.test(Ze))?Me=!0:p.em==Pe&&Re&&(Pe==="*"||!De||W.test(Ae))&&(Me=!1)),Ue>1&&(!p.strong&&De&&(Pe==="*"||!Re||W.test(Ze))?Xe=!0:p.strong==Pe&&Re&&(Pe==="*"||!De||W.test(Ae))&&(Xe=!1)),Xe!=null||Me!=null){se.highlightFormatting&&(p.formatting=Me==null?"strong":Xe==null?"em":"strong em"),Me===!0&&(p.em=Pe),Xe===!0&&(p.strong=Pe);var K=S(p);return Me===!1&&(p.em=!1),Xe===!1&&(p.strong=!1),K}}else if(Pe===" "&&(D.eat("*")||D.eat("_"))){if(D.peek()===" ")return S(p);D.backUp(1)}if(se.strikethrough){if(Pe==="~"&&D.eatWhile(Pe)){if(p.strikethrough){se.highlightFormatting&&(p.formatting="strikethrough");var K=S(p);return p.strikethrough=!1,K}else if(D.match(/^[^\s]/,!1))return p.strikethrough=!0,se.highlightFormatting&&(p.formatting="strikethrough"),S(p)}else if(Pe===" "&&D.match(/^~~/,!0)){if(D.peek()===" ")return S(p);D.backUp(2)}}if(se.emoji&&Pe===":"&&D.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){p.emoji=!0,se.highlightFormatting&&(p.formatting="emoji");var qe=S(p);return p.emoji=!1,qe}return Pe===" "&&(D.match(/^ +$/,!1)?p.trailingSpace++:p.trailingSpace&&(p.trailingSpaceNewLine=!0)),S(p)}function C(D,p){var ue=D.next();if(ue===">"){p.f=p.inline=w,se.highlightFormatting&&(p.formatting="link");var Be=S(p);return Be?Be+=" ":Be="",Be+U.linkInline}return D.match(/^[^>]+/,!0),U.linkInline}function J(D,p){if(D.eatSpace())return null;var ue=D.next();return ue==="("||ue==="["?(p.f=p.inline=E(ue==="("?")":"]"),se.highlightFormatting&&(p.formatting="link-string"),p.linkHref=!0,S(p)):"error"}var z={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function E(D){return function(p,ue){var Be=p.next();if(Be===D){ue.f=ue.inline=w,se.highlightFormatting&&(ue.formatting="link-string");var Pe=S(ue);return ue.linkHref=!1,Pe}return p.match(z[D]),ue.linkHref=!0,S(ue)}}function P(D,p){return D.match(/^([^\]\\]|\\.)*\]:/,!1)?(p.f=ae,D.next(),se.highlightFormatting&&(p.formatting="link"),p.linkText=!0,S(p)):b(D,p,w)}function ae(D,p){if(D.match(/^\]:/,!0)){p.f=p.inline=B,se.highlightFormatting&&(p.formatting="link");var ue=S(p);return p.linkText=!1,ue}return D.match(/^([^\]\\]|\\.)+/,!0),U.linkText}function B(D,p){return D.eatSpace()?null:(D.match(/^[^\s]+/,!0),D.peek()===void 0?p.linkTitle=!0:D.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),p.f=p.inline=w,U.linkHref+" url")}var be={startState:function(){return{f:H,prevLine:{stream:null},thisLine:{stream:null},block:H,htmlState:null,indentation:0,inline:w,text:Y,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(D){return{f:D.f,prevLine:D.prevLine,thisLine:D.thisLine,block:D.block,htmlState:D.htmlState&&V.copyState(xe,D.htmlState),indentation:D.indentation,localMode:D.localMode,localState:D.localMode?V.copyState(D.localMode,D.localState):null,inline:D.inline,text:D.text,formatting:!1,linkText:D.linkText,linkTitle:D.linkTitle,linkHref:D.linkHref,code:D.code,em:D.em,strong:D.strong,strikethrough:D.strikethrough,emoji:D.emoji,header:D.header,setext:D.setext,hr:D.hr,taskList:D.taskList,list:D.list,listStack:D.listStack.slice(0),quote:D.quote,indentedCode:D.indentedCode,trailingSpace:D.trailingSpace,trailingSpaceNewLine:D.trailingSpaceNewLine,md_inside:D.md_inside,fencedEndRE:D.fencedEndRE}},token:function(D,p){if(p.formatting=!1,D!=p.thisLine.stream){if(p.header=0,p.hr=!1,D.match(/^\s*$/,!0))return he(p),null;if(p.prevLine=p.thisLine,p.thisLine={stream:D},p.taskList=!1,p.trailingSpace=0,p.trailingSpaceNewLine=!1,!p.localState&&(p.f=p.block,p.f!=g)){var ue=D.match(/^\s*/,!0)[0].replace(/\t/g,ee).length;if(p.indentation=ue,p.indentationDiff=null,ue>0)return null}}return p.f(D,p)},innerMode:function(D){return D.block==g?{state:D.htmlState,mode:xe}:D.localState?{state:D.localState,mode:D.localMode}:{state:D,mode:be}},indent:function(D,p,ue){return D.block==g&&xe.indent?xe.indent(D.htmlState,p,ue):D.localState&&D.localMode.indent?D.localMode.indent(D.localState,p,ue):V.Pass},blankLine:he,getType:S,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return be},"xml"),V.defineMIME("text/markdown","markdown"),V.defineMIME("text/x-markdown","markdown")})},lnNo:function(Qe,Ie,h){Qe.exports=h.p+"static/up.69f3b3fd.svg"},m3fD:function(Qe,Ie,h){Qe.exports={flex_box_center:"flex_box_center___1w3aZ",flex_space_between:"flex_space_between___26eB1",flex_box_vertical_center:"flex_box_vertical_center___LffUi",flex_box_center_end:"flex_box_center_end___2AiD3",flex_box_column:"flex_box_column___hZDm1",wrap:"wrap___3Du1e",btns:"btns___35pkF",crumbs:"crumbs___3CPsi",oneWrap:"oneWrap___3F99r",title:"title___2n1na",formWrap:"formWrap___3CHwR",rb:"rb___19sZ1"}},nVVt:function(Qe,Ie){Qe.exports={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3}},osHv:function(Qe,Ie,h){(function(V){V(h("VrN/"))})(function(V){"use strict";var ve=V.Pos;function se(W,ee){return W.line-ee.line||W.ch-ee.ch}var xe="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",me=xe+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",re=new RegExp("<(/?)(["+xe+"]["+me+"]*)","g");function U(W,ee,b,fe){this.line=ee,this.ch=b,this.cm=W,this.text=W.getLine(ee),this.min=fe?Math.max(fe.from,W.firstLine()):W.firstLine(),this.max=fe?Math.min(fe.to-1,W.lastLine()):W.lastLine()}function k(W,ee){var b=W.cm.getTokenTypeAt(ve(W.line,ee));return b&&/\btag\b/.test(b)}function O(W){return W.line>=W.max?void 0:(W.ch=0,W.text=W.cm.getLine(++W.line),!0)}function T(W){return W.line<=W.min?void 0:(W.text=W.cm.getLine(--W.line),W.ch=W.text.length,!0)}function A(W){for(;;){var ee=W.text.indexOf(">",W.ch);if(ee==-1){if(O(W))continue;return}if(!k(W,ee+1)){W.ch=ee+1;continue}var b=W.text.lastIndexOf("/",ee),fe=b>-1&&!/\S/.test(W.text.slice(b+1,ee));return W.ch=ee+1,fe?"selfClose":"regular"}}function M(W){for(;;){var ee=W.ch?W.text.lastIndexOf("<",W.ch-1):-1;if(ee==-1){if(T(W))continue;return}if(!k(W,ee+1)){W.ch=ee;continue}re.lastIndex=ee,W.ch=ee;var b=re.exec(W.text);if(b&&b.index==ee)return b}}function te(W){for(;;){re.lastIndex=W.ch;var ee=re.exec(W.text);if(!ee){if(O(W))continue;return}if(!k(W,ee.index+1)){W.ch=ee.index+1;continue}return W.ch=ee.index+ee[0].length,ee}}function F(W){for(;;){var ee=W.ch?W.text.lastIndexOf(">",W.ch-1):-1;if(ee==-1){if(T(W))continue;return}if(!k(W,ee+1)){W.ch=ee;continue}var b=W.text.lastIndexOf("/",ee),fe=b>-1&&!/\S/.test(W.text.slice(b+1,ee));return W.ch=ee+1,fe?"selfClose":"regular"}}function L(W,ee){for(var b=[];;){var fe=te(W),Se,he=W.line,H=W.ch-(fe?fe[0].length:0);if(!fe||!(Se=A(W)))return;if(Se=="selfClose")continue;if(fe[1]){for(var g=b.length-1;g>=0;--g)if(b[g]==fe[2]){b.length=g;break}if(g<0&&(!ee||ee==fe[2]))return{tag:fe[2],from:ve(he,H),to:ve(W.line,W.ch)}}else b.push(fe[2])}}function G(W,ee){for(var b=[];;){var fe=F(W);if(!fe)return;if(fe=="selfClose"){M(W);continue}var Se=W.line,he=W.ch,H=M(W);if(!H)return;if(H[1])b.push(H[2]);else{for(var g=b.length-1;g>=0;--g)if(b[g]==H[2]){b.length=g;break}if(g<0&&(!ee||ee==H[2]))return{tag:H[2],from:ve(W.line,W.ch),to:ve(Se,he)}}}}V.registerHelper("fold","xml",function(W,ee){for(var b=new U(W,ee.line,0);;){var fe=te(b);if(!fe||b.line!=ee.line)return;var Se=A(b);if(!Se)return;if(!fe[1]&&Se!="selfClose"){var he=ve(b.line,b.ch),H=L(b,fe[2]);return H&&se(H.from,he)>0?{from:he,to:H.from}:null}}}),V.findMatchingTag=function(W,ee,b){var fe=new U(W,ee.line,ee.ch,b);if(fe.text.indexOf(">")==-1&&fe.text.indexOf("<")==-1)return;var Se=A(fe),he=Se&&ve(fe.line,fe.ch),H=Se&&M(fe);if(!Se||!H||se(fe,ee)>0)return;var g={from:ve(fe.line,fe.ch),to:he,tag:H[2]};return Se=="selfClose"?{open:g,close:null,at:"open"}:H[1]?{open:G(fe,H[2]),close:g,at:"close"}:(fe=new U(W,he.line,he.ch,b),{open:g,close:L(fe,H[2]),at:"open"})},V.findEnclosingTag=function(W,ee,b,fe){for(var Se=new U(W,ee.line,ee.ch,b);;){var he=G(Se,fe);if(!he)break;var H=new U(W,ee.line,ee.ch,b),g=L(H,he.tag);if(g)return{open:he,close:g}}},V.scanForClosingTag=function(W,ee,b,fe){var Se=new U(W,ee.line,ee.ch,fe?{from:0,to:fe}:null);return L(Se,b)}})},p5ED:function(Qe,Ie,h){"use strict";var V=h("+L6B"),ve=h("2/Rp"),se=h("5Dmo"),xe=h("3S7+"),me=h("k1fw"),re=h("9og8"),U=h("tJVT"),k=h("WmNS"),O=h.n(k),T=h("q1tI"),A=h.n(T),M=h("vHTk"),te=h.n(M),F=h("yEEn"),L=h("ZW9T"),G=h("1vsH"),W=h("V0Rq"),ee=h("m3rI"),b=function(Se){var he=Se.name,H=Se.data,g=Se.theme,ne=Se.type,S=Se.filename,Y=Se.monacoEditor,w=Se.className,C=Se.style,J=Se.close,z=Se.onClose,E=Se.hasMask,P=Se.otherData,ae=P===void 0?{}:P,B=Object(T.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),be=Object(U.a)(B,2),D=be[0],p=be[1],ue=Object(T.useState)(""),Be=Object(U.a)(ue,2),Pe=Be[0],ze=Be[1],Te=Object(T.useState)(),we=Object(U.a)(Te,2),X=we[0],K=we[1],le,N=1024*1024,_=10*N,pe=Object(T.useRef)();ne==="office"&&(le=Object(G.R)(H).filesize,le>_&&(ne="other")),S&&(Y.filename=S),Object(T.useEffect)(function(){var De,Re,Me=(De=document.cookie)===null||De===void 0||((Re=De.replace(/\s/g,""))===null||Re===void 0)?void 0:Re.split(";");Me==null||Me.map(function(Xe){var qe=Xe.split("=");qe[0]==="_educoder_session"&&ze(qe[1])})},[]),Object(T.useEffect)(function(){ne==="office"&&Ue()},[ne]);var Ue=function(){var De=Object(re.a)(O.a.mark(function Re(){var Me,Xe,qe;return O.a.wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:return console.log("data:",H),Me=H,H.startsWith("http")||(Me=location.origin+Me),Xe=new URL(Me).pathname.split("/").pop(),Ke.next=6,Object(W.U)({attachment_id:Xe});case 6:qe=Ke.sent,K(qe);case 8:case"end":return Ke.stop()}},Re)}));return function(){return De.apply(this,arguments)}}(),Ze=function(){if(H.startsWith("http")||H.startsWith("blob:")){Ae();return}Object(G.x)(S||"educoder",H,S)},Ae=function(){Object(G.v)(S||"educoder",decodeURIComponent(H))};return A.a.createElement("div",{style:Object(me.a)({},C||{}),className:"".concat(E&&te.a.bgBlack," ").concat(ne?te.a.wrp:"hide")},J&&A.a.createElement("div",{className:te.a.close,ref:pe},A.a.createElement(xe.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return pe.current}},A.a.createElement("span",{onClick:Ae},A.a.createElement("i",{className:"icon-quxiaozhiding"}))),A.a.createElement(xe.a,{title:"\u5173\u95ED",getPopupContainer:function(){return pe.current}},A.a.createElement("span",{className:"",onClick:function(){z(),K(null)}},A.a.createElement("i",{className:"icon-guanbi1"})))),A.a.createElement("div",{className:"".concat(te.a[w]," ").concat(w," ").concat(te.a.monaco," ").concat(ne==="txt"?"show":"hide")},ne==="txt"&&A.a.createElement(L.b,Y)),ne==="audio"&&A.a.createElement("audio",{src:"".concat((H==null?void 0:H.indexOf("http://"))>-1||(H==null?void 0:H.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(H),autoPlay:!0}),ne==="video"&&A.a.createElement(A.a.Fragment,null,(H==null?void 0:H.indexOf("http"))>-1?A.a.createElement("video",{controls:!0,src:"".concat(H),autoPlay:!0}):A.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(H),autoPlay:!0})),ne==="office"&&X&&A.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(X.key,"&url=").concat(ee.a.API_SERVER+X.url,"&callbackUrl=").concat(ee.a.API_SERVER+X.callbackUrl,"&fileType=").concat(X.fileType,"&title=").concat(X.title,"&model=view")}),(ne==="xlsx"||ne==="doc"||ne==="pptx"||ne==="docx")&&A.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(ae.key,"&url=").concat(ee.a.API_SERVER+ae.url,"&callbackUrl=").concat(ee.a.API_SERVER+ae.callbackUrl,"&fileType=").concat(ae.fileType,"&title=").concat(ae.title,"&model=").concat(ae.model)}),ne==="html"&&A.a.createElement("iframe",{src:H+"&disposition=inline"}),ne==="pdf"&&A.a.createElement("embed",{className:te.a.embed,src:H,type:"application/pdf"}),ne==="image"&&A.a.createElement("img",{src:"".concat((H==null?void 0:H.indexOf("http://"))>-1||(H==null?void 0:H.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(H)}),ne==="other"&&A.a.createElement("div",null,A.a.createElement(ve.a,{type:"primary",size:"large",onClick:Ze},A.a.createElement(F.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),ne==="download"&&A.a.createElement(ve.a,{type:"primary",size:"large",onClick:Ze},A.a.createElement(F.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))};Ie.a=b},"p77/":function(Qe,Ie,h){},"rAM+":function(Qe,Ie,h){"use strict";h.d(Ie,"a",function(){return ve});var V=h("Qw5x");function ve(se,xe){var me;if(typeof Symbol=="undefined"||se[Symbol.iterator]==null){if(Array.isArray(se)||(me=Object(V.a)(se))||xe&&se&&typeof se.length=="number"){me&&(se=me);var re=0,U=function(){};return{s:U,n:function(){return re>=se.length?{done:!0}:{done:!1,value:se[re++]}},e:function(M){throw M},f:U}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var k=!0,O=!1,T;return{s:function(){me=se[Symbol.iterator]()},n:function(){var M=me.next();return k=M.done,M},e:function(M){O=!0,T=M},f:function(){try{!k&&me.return!=null&&me.return()}finally{if(O)throw T}}}}},rUJ1:function(Qe,Ie){const h=/[&<>"']/,V=/[&<>"']/g,ve=/[<>"']|&(?!#?\w+;)/,se=/[<>"']|&(?!#?\w+;)/g,xe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},me=ne=>xe[ne];function re(ne,S){if(S){if(h.test(ne))return ne.replace(V,me)}else if(ve.test(ne))return ne.replace(se,me);return ne}const U=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function k(ne){return ne.replace(U,(S,Y)=>(Y=Y.toLowerCase(),Y==="colon"?":":Y.charAt(0)==="#"?Y.charAt(1)==="x"?String.fromCharCode(parseInt(Y.substring(2),16)):String.fromCharCode(+Y.substring(1)):""))}const O=/(^|[^\[])\^/g;function T(ne,S){ne=ne.source||ne,S=S||"";const Y={replace:(w,C)=>(C=C.source||C,C=C.replace(O,"$1"),ne=ne.replace(w,C),Y),getRegex:()=>new RegExp(ne,S)};return Y}const A=/[^\w:]/g,M=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function te(ne,S,Y){if(ne){let w;try{w=decodeURIComponent(k(Y)).replace(A,"").toLowerCase()}catch(C){return null}if(w.indexOf("javascript:")===0||w.indexOf("vbscript:")===0||w.indexOf("data:")===0)return null}S&&!M.test(Y)&&(Y=ee(S,Y));try{Y=encodeURI(Y).replace(/%25/g,"%")}catch(w){return null}return Y}const F={},L=/^[^:]+:\/*[^/]*$/,G=/^([^:]+:)[\s\S]*$/,W=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ee(ne,S){F[" "+ne]||(L.test(ne)?F[" "+ne]=ne+"/":F[" "+ne]=he(ne,"/",!0)),ne=F[" "+ne];const Y=ne.indexOf(":")===-1;return S.substring(0,2)==="//"?Y?S:ne.replace(G,"$1")+S:S.charAt(0)==="/"?Y?S:ne.replace(W,"$1")+S:ne+S}const b={exec:function(){}};function fe(ne){let S=1,Y,w;for(;S<arguments.length;S++){Y=arguments[S];for(w in Y)Object.prototype.hasOwnProperty.call(Y,w)&&(ne[w]=Y[w])}return ne}function Se(ne,S){const Y=ne.replace(/\|/g,(J,z,E)=>{let P=!1,ae=z;for(;--ae>=0&&E[ae]==="\\";)P=!P;return P?"|":" |"}),w=Y.split(/ \|/);let C=0;if(w.length>S)w.splice(S);else for(;w.length<S;)w.push("");for(;C<w.length;C++)w[C]=w[C].trim().replace(/\\\|/g,"|");return w}function he(ne,S,Y){const w=ne.length;if(w===0)return"";let C=0;for(;C<w;){const J=ne.charAt(w-C-1);if(J===S&&!Y)C++;else if(J!==S&&Y)C++;else break}return ne.substr(0,w-C)}function H(ne,S){if(ne.indexOf(S[1])===-1)return-1;const Y=ne.length;let w=0,C=0;for(;C<Y;C++)if(ne[C]==="\\")C++;else if(ne[C]===S[0])w++;else if(ne[C]===S[1]&&(w--,w<0))return C;return-1}function g(ne){ne&&ne.sanitize&&!ne.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}Qe.exports={escape:re,unescape:k,edit:T,cleanUrl:te,resolveUrl:ee,noopTest:b,merge:fe,splitCells:Se,rtrim:he,findClosingBracket:H,checkSanitizeDeprecation:g}},rcnY:function(Qe,Ie,h){var V=h("aRTE");function ve(se,xe){this.totalCount=se,this.dataCount=xe}ve.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],ve.getRSBlocks=function(se,xe){var me=ve.getRsBlockTable(se,xe);if(me==null)throw new Error("bad rs block @ typeNumber:"+se+"/errorCorrectLevel:"+xe);for(var re=me.length/3,U=new Array,k=0;k<re;k++)for(var O=me[k*3+0],T=me[k*3+1],A=me[k*3+2],M=0;M<O;M++)U.push(new ve(T,A));return U},ve.getRsBlockTable=function(se,xe){switch(xe){case V.L:return ve.RS_BLOCK_TABLE[(se-1)*4+0];case V.M:return ve.RS_BLOCK_TABLE[(se-1)*4+1];case V.Q:return ve.RS_BLOCK_TABLE[(se-1)*4+2];case V.H:return ve.RS_BLOCK_TABLE[(se-1)*4+3];default:return}},Qe.exports=ve},sbIO:function(Qe,Ie,h){"use strict";var V=h("DjyN"),ve=h("NUBc"),se=h("5Dmo"),xe=h("3S7+"),me=h("/zsF"),re=h("PArb"),U=h("Q9mQ"),k=h("diRs"),O=h("+L6B"),T=h("2/Rp"),A=h("5NDa"),M=h("5rEg"),te=h("miYZ"),F=h("tsqr"),L=h("9og8"),G=h("giR+"),W=h("fyUT"),ee=h("2qtc"),b=h("kLXV"),fe=h("tJVT"),Se=h("WmNS"),he=h.n(Se),H=h("q1tI"),g=h.n(H),ne=h("PsQE"),S=h.n(ne),Y=h("0eGx"),w=h.n(Y),C=h("9Bee"),J=h("Ty5D"),z=h("9kvl"),E=h("ErOA"),P=h("+yhJ"),ae=h.n(P),B=h("RZ/O"),be=h.n(B),D=h("LvDl"),p=h("6K3P"),ue=h.n(p),Be=h("sRBo"),Pe=h("kaz8"),ze=h("oBTY"),Te=h("PpiC"),we=h("Ot1p"),X=h("kqOp"),K=h("7qnI"),le=h("1vsH"),N=h("PGNT"),_=h.n(N),pe=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ue=function($,q){var Q=$.globalSetting,x=$.loading,R=$.dispatch,j=$.isEdit,I=$.editData,de=Object(Te.a)($,["globalSetting","loading","dispatch","isEdit","editData"]),Ce=Object(H.useState)(""),Oe=Object(fe.a)(Ce,2),_t=Oe[0],at=Oe[1],ge=Object(H.useState)(""),lt=Object(fe.a)(ge,2),Et=lt[0],et=lt[1],Ft=Object(H.useState)([]),tt=Object(fe.a)(Ft,2),zt=tt[0],It=tt[1],vt=Object(H.useState)(""),$t=Object(fe.a)(vt,2),Lt=$t[0],Fe=$t[1],ut=Object(H.useState)(),nt=Object(fe.a)(ut,2),dt=nt[0],Kt=nt[1],Vt=Object(H.useState)(!1),an=Object(fe.a)(Vt,2),Gt=an[0],Ct=an[1];Object(H.useEffect)(function(){if(!I||!j)return;at(I==null?void 0:I.name),et(I==null?void 0:I.analysis),Kt(I==null?void 0:I.is_ordered),Ct(!0)},[I]),Object(H.useEffect)(function(){if(!Gt)return;var $e=I==null?void 0:I.standard_answer.map(function(st){return st.answer_text});It($e),Ct(!1)},[Gt]),Object(H.useImperativeHandle)(q,function(){return{onSave:tn,Clear:Nt}});var tn=function(){var st=[],fn=!1;return _t?(zt.forEach(function(gn,On){st.push({position:On+1,answer_text:[]}),gn.forEach(function(Bn,d){st[On].answer_text.push(Bn),(!Bn||!Object(le.bb)(Bn,1e4))&&(Fe("".concat(On,"-").concat(d)),F.b.info(Bn?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),fn=!0)})}),fn?!1:(st==null?void 0:st.length)>20?(F.b.warn("\u586B\u7A7A\u9898\u6807\u51C6\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A/\u4E0D\u80FD\u8D85\u8FC720\u4E2A\uFF01"),!1):{name:_t,analysis:Et,standard_answers:st,is_ordered:dt}):(F.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},Nt=function(){at(""),et(""),It([]),Kt(!1)},ln=function(st,fn,gn){var On=zt.slice();if(fn&&On.splice(st,fn),gn)for(var Bn=0;Bn<gn;Bn++)On.splice(st+Bn,0,[""]);It(On)},Xt=function(st,fn,gn){Fe("");var On=zt.slice();On[st][fn]=gn,It(On)},hn=function(st){var fn=zt.slice();fn[st]=[].concat(Object(ze.a)(fn[st]),[""]),It(fn)},Kn=function(st,fn){var gn=zt.slice();if(!gn[st][fn]){gn[st]=gn[st].filter(function(On,Bn){return Bn!==fn}),It(gn);return}b.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:_.a.modal,onOk:function(){gn[st]=gn[st].filter(function(Bn,d){return d!==fn}),It(gn)}})},nn=function(st){b.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:_.a.modal,onOk:function(){var gn=zt.slice();gn=zt.filter(function(On,Bn){return st!==Bn}),It(gn)}})};return g.a.createElement("section",{className:_.a.wrap},g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.required},"*"),g.a.createElement("span",{className:_.a.title},"\u9898\u5E72\uFF1A")),g.a.createElement("div",null,g.a.createElement(X.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:_t,onChange:function(st){return at(st)},showNullButton:!0,onPlaceholderChange:ln})),g.a.createElement("div",{className:"mt20"},zt.map(function($e,st){return g.a.createElement(K.a,{key:st,answers:$e,index:st,flex:1,is_md:!0,activeOptionErrorIndex:Lt,onAnswerChange:Xt,addChildAnswer:hn,deleteChildAnswer:Kn,deleteChildAnswermain:nn})})),g.a.createElement("div",{className:"mt20"},zt.length>1&&g.a.createElement("span",null,g.a.createElement(Pe.a,{checked:dt,onChange:function(st){return Kt(st.target.checked)},className:"".concat(_.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),g.a.createElement("span",{className:"".concat(_.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),g.a.createElement(we.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Et,onChange:function(st){return et(st)}}))},Ze=Object(z.a)(function(We){var $=We.loading,q=We.globalSetting;return{globalSetting:q,loading:$.effects}},null,null,{forwardRef:!0})(Object(H.forwardRef)(Ue)),Ae=h("7Kak"),De=h("9yH6"),Re=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Me=function($,q){var Q=$.globalSetting,x=$.loading,R=$.editData,j=$.dispatch,I=$.onRef,de=I===void 0?function(){}:I,Ce=$.isEdit,Oe=Object(Te.a)($,["globalSetting","loading","editData","dispatch","onRef","isEdit"]),_t=Object(H.useState)(),at=Object(fe.a)(_t,2),ge=at[0],lt=at[1],Et=Object(H.useState)(""),et=Object(fe.a)(Et,2),Ft=et[0],tt=et[1],zt=Object(H.useState)(""),It=Object(fe.a)(zt,2),vt=It[0],$t=It[1];Object(H.useEffect)(function(){if(!R||!Ce)return;tt(R==null?void 0:R.name),$t(R==null?void 0:R.analysis);var ut=R==null?void 0:R.choices.find(function(nt){return nt.is_answer});lt(ut.choice_text==="\u6B63\u786E"?"0":"1")},[R]),Object(H.useImperativeHandle)(q,function(){return{onSave:Lt,Clear:Fe}});var Lt=function(){if(!Ft)return F.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(!ge)return F.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),!1;var nt=[{choice_text:"\u6B63\u786E",is_answer:ge==="0"?1:0},{choice_text:"\u9519\u8BEF",is_answer:ge==="1"?1:0}];return{name:Ft,choices:nt,analysis:vt}},Fe=function(){tt(""),$t(""),lt("")};return g.a.createElement("section",{className:_.a.wrap},g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.required},"*"),g.a.createElement("span",{className:_.a.title},"\u9898\u5E72\uFF1A")),g.a.createElement(we.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Ft,onChange:function(nt){return tt(nt)}}),g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.required},"*"),g.a.createElement("span",{className:_.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",g.a.createElement("span",{className:_.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),g.a.createElement(De.a.Group,{buttonStyle:"solid",value:ge,onChange:function(nt){return lt(nt.target.value)}},g.a.createElement(De.a.Button,{value:"0",className:"".concat(_.a.radio," mr40")},"\u6B63\u786E"),g.a.createElement(De.a.Button,{value:"1",className:_.a.radio},"\u9519\u8BEF")),g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),g.a.createElement(we.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:vt,onChange:function(nt){return $t(nt)}}))},Xe=Object(z.a)(function(We){var $=We.loading,q=We.globalSetting;return{globalSetting:q,loading:$.effects}},null,null,{forwardRef:!0})(Object(H.forwardRef)(Me)),qe=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ot=function($,q){var Q=$.editData,x=$.globalSetting,R=$.loading,j=$.dispatch,I=$.onRef,de=I===void 0?function(){}:I,Ce=$.isEdit,Oe=Object(Te.a)($,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),_t=Object(H.useState)([]),at=Object(fe.a)(_t,2),ge=at[0],lt=at[1],Et=Object(H.useState)(),et=Object(fe.a)(Et,2),Ft=et[0],tt=et[1],zt=Object(H.useState)([]),It=Object(fe.a)(zt,2),vt=It[0],$t=It[1],Lt=Object(H.useState)(""),Fe=Object(fe.a)(Lt,2),ut=Fe[0],nt=Fe[1],dt=Object(H.useState)(""),Kt=Object(fe.a)(dt,2),Vt=Kt[0],an=Kt[1];Object(H.useEffect)(function(){lt(["","","",""])},[]),Object(H.useEffect)(function(){if(!Q||!Ce)return;nt(Q==null?void 0:Q.name),an(Q==null?void 0:Q.analysis),lt(Q==null?void 0:Q.choices.map(function(Nt){return Nt.choice_text}));var tn=[];Q==null||Q.choices.map(function(Nt,ln){Nt.is_answer&&tn.push(ln)}),$t(tn)},[Q]),Object(H.useImperativeHandle)(q,function(){return{onSave:Gt,Clear:Ct}});var Gt=function(){if(!ut)return F.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;var Nt=ge.findIndex(function(Xt){return!Xt});if(Nt>-1)return F.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(qe[Nt]," \u9009\u9879\u7684\u5185\u5BB9")),!1;if(!vt.length)return F.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;if(vt.length<2)return F.b.info("\u591A\u9009\u9898\u6700\u5C0F\u6B63\u786E\u9009\u9879\u4E3A2\u4E2A"),!1;var ln=ge.map(function(Xt,hn){return{choice_text:Xt,is_answer:vt.includes(hn)?1:0}});return{name:ut,choices:ln,analysis:Vt}},Ct=function(){lt(["","","",""]),nt(""),an(""),$t("")};return g.a.createElement("section",{className:_.a.wrap},g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.required},"*"),g.a.createElement("span",{className:_.a.title},"\u9898\u5E72\uFF1A")),g.a.createElement(we.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:ut,onChange:function(Nt){return nt(Nt)}}),g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.required},"*"),g.a.createElement("span",{className:_.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",g.a.createElement("span",{className:_.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),ge.map(function(tn,Nt){return g.a.createElement("div",{className:_.a.choiceWrap,key:Nt},g.a.createElement(xe.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},g.a.createElement("div",{className:"".concat(_.a.answer," ").concat(vt.includes(Nt)?_.a.activeAnswer:""),onClick:function(){vt.includes(Nt)?$t(vt.filter(function(Xt){return Xt!==Nt})):$t([].concat(Object(ze.a)(vt),[Nt]))}},qe[Nt])),g.a.createElement("div",{className:_.a.editorWrap},Ft===Nt?g.a.createElement(we.a,{id:"single-question-option-".concat(Nt),watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:tn,onChange:function(Xt){ge[Nt]=Xt,lt(ge)}}):g.a.createElement("div",{className:_.a.htmlWrap,onClick:function(){return tt(Nt)}},g.a.createElement(C.a,{value:tn}))),Nt>1&&g.a.createElement(xe.a,{title:"\u5220\u9664"},g.a.createElement("i",{className:"".concat(_.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){lt(ge.filter(function(Xt,hn){return hn!==Nt})),vt.includes(Nt)?$t(vt.filter(function(Xt){return Xt!==Nt})):$t([].concat(Object(ze.a)(vt),[Nt]))}})),Nt<7&&Nt===ge.length-1&&g.a.createElement(xe.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},g.a.createElement("i",{className:"".concat(_.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return lt([].concat(Object(ze.a)(ge),[""]))}})))}),g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),g.a.createElement(we.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Vt,onChange:function(Nt){return an(Nt)}}))},Ke=Object(z.a)(function(We){var $=We.loading,q=We.globalSetting;return{globalSetting:q,loading:$.effects}},null,null,{forwardRef:!0})(Object(H.forwardRef)(ot)),Ve=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],At=function($,q){var Q=$.editData,x=$.globalSetting,R=$.loading,j=$.dispatch,I=$.onRef,de=I===void 0?function(){}:I,Ce=$.isEdit,Oe=Object(Te.a)($,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),_t=Object(H.useState)([]),at=Object(fe.a)(_t,2),ge=at[0],lt=at[1],Et=Object(H.useState)(),et=Object(fe.a)(Et,2),Ft=et[0],tt=et[1],zt=Object(H.useState)(),It=Object(fe.a)(zt,2),vt=It[0],$t=It[1],Lt=Object(H.useState)(""),Fe=Object(fe.a)(Lt,2),ut=Fe[0],nt=Fe[1],dt=Object(H.useState)(""),Kt=Object(fe.a)(dt,2),Vt=Kt[0],an=Kt[1];Object(H.useEffect)(function(){lt(["","","",""])},[]),Object(H.useEffect)(function(){if(!Q||!Ce)return;nt(Q==null?void 0:Q.name),an(Q==null?void 0:Q.analysis),lt(Q==null?void 0:Q.choices.map(function(tn){return tn.choice_text})),$t(Q==null?void 0:Q.choices.findIndex(function(tn){return tn.is_answer}))},[Q]),Object(H.useImperativeHandle)(q,function(){return{onSave:Gt,Clear:Ct}});var Gt=function(){if(!ut)return F.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;var Nt=ge.findIndex(function(Xt){return!Xt});if(Nt>-1)return F.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Ve[Nt]," \u9009\u9879\u7684\u5185\u5BB9")),!1;if(console.log("activeAnswer: ",vt),!(typeof vt=="number"))return F.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;var ln=ge.map(function(Xt,hn){return{choice_text:Xt,is_answer:vt===hn?1:0}});return{name:ut,choices:ln,analysis:Vt}},Ct=function(){lt(["","","",""]),nt(""),an(""),$t("")};return g.a.createElement("section",{className:_.a.wrap},g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.required},"*"),g.a.createElement("span",{className:_.a.title},"\u9898\u5E72\uFF1A")),g.a.createElement(we.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:ut,onChange:function(Nt){return nt(Nt)}}),g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.required},"*"),g.a.createElement("span",{className:_.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",g.a.createElement("span",{className:_.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),ge.map(function(tn,Nt){return g.a.createElement("div",{className:_.a.choiceWrap,key:Nt},g.a.createElement(xe.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},g.a.createElement("div",{className:"".concat(_.a.answer," ").concat(vt===Nt?_.a.activeAnswer:""),onClick:function(){return $t(Nt)}},Ve[Nt])),g.a.createElement("div",{className:_.a.editorWrap},Ft===Nt?g.a.createElement(we.a,{id:"single-question-option-".concat(Nt),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:tn,onChange:function(Xt){ge[Nt]=Xt,lt(ge)}}):g.a.createElement("div",{className:_.a.htmlWrap,onClick:function(){return tt(Nt)}},g.a.createElement(C.a,{value:tn}))),Nt>1&&g.a.createElement(xe.a,{title:"\u5220\u9664"},g.a.createElement("i",{className:"".concat(_.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){lt(ge.filter(function(Xt,hn){return hn!==Nt})),Nt===vt&&$t(null)}})),Nt<7&&Nt===ge.length-1&&g.a.createElement(xe.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},g.a.createElement("i",{className:"".concat(_.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return lt([].concat(Object(ze.a)(ge),[""]))}})))}),g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),g.a.createElement(we.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Vt,onChange:function(Nt){return an(Nt)}}))},gt=Object(z.a)(function(We){var $=We.loading,q=We.globalSetting;return{globalSetting:q,loading:$.effects}},null,null,{forwardRef:!0})(Object(H.forwardRef)(At)),kt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ct=function($,q){var Q=$.editData,x=$.globalSetting,R=$.loading,j=$.dispatch,I=$.onRef,de=I===void 0?function(){}:I,Ce=$.isEdit,Oe=Object(Te.a)($,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),_t=Object(H.useState)(""),at=Object(fe.a)(_t,2),ge=at[0],lt=at[1],Et=Object(H.useState)(""),et=Object(fe.a)(Et,2),Ft=et[0],tt=et[1],zt=Object(H.useState)(""),It=Object(fe.a)(zt,2),vt=It[0],$t=It[1];Object(H.useEffect)(function(){var ut;if(!Q||!Ce)return;lt(Q==null?void 0:Q.name),tt(Q==null?void 0:Q.analysis),$t(Q==null||((ut=Q.answer_texts)===null||ut===void 0)?void 0:ut[0])},[Q]),Object(H.useImperativeHandle)(q,function(){return{onSave:Lt,Clear:Fe}});var Lt=function(){return ge?vt?{name:ge,answer_texts:[vt],analysis:Ft}:(F.b.info("\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848"),!1):(F.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},Fe=function(){lt(""),tt(""),$t("")};return g.a.createElement("section",{className:_.a.wrap},g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.required},"*"),g.a.createElement("span",{className:_.a.title},"\u9898\u5E72\uFF1A")),g.a.createElement(we.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:ge,onChange:function(nt){return lt(nt)}}),g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),g.a.createElement(we.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:vt,onChange:function(nt){return $t(nt)}}),g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),g.a.createElement(we.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Ft,onChange:function(nt){return tt(nt)}}))},Pt=Object(z.a)(function(We){var $=We.loading,q=We.globalSetting;return{globalSetting:q,loading:$.effects}},null,null,{forwardRef:!0})(Object(H.forwardRef)(ct)),xt=h("k1fw"),bt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ne=function($,q){var Q=$.globalSetting,x=$.loading,R=$.dispatch,j=$.editData,I=$.onRef,de=I===void 0?function(){}:I,Ce=$.isEdit,Oe=Object(Te.a)($,["globalSetting","loading","dispatch","editData","onRef","isEdit"]),_t=Object(H.useState)(""),at=Object(fe.a)(_t,2),ge=at[0],lt=at[1],Et=Object(H.useState)([]),et=Object(fe.a)(Et,2),Ft=et[0],tt=et[1];console.log(Ft),Object(H.useEffect)(function(){var Lt;if(!j||!Ce)return;lt(j==null?void 0:j.name);var Fe=j==null||((Lt=j.sub_item_banks)===null||Lt===void 0)?void 0:Lt.map(function(ut){var nt,dt,Kt;return Object(xt.a)(Object(xt.a)({},ut),{},{id:ut.id,open:!1,qusList:ut==null||((nt=ut.choices)===null||nt===void 0)?void 0:nt.map(function(Vt){return Vt.choice_text}),activeQusEditor:null,qusAnswer:(dt=[ut==null||((Kt=ut.choices)===null||Kt===void 0)?void 0:Kt.findIndex(function(Vt){return Vt.is_answer})])===null||dt===void 0?void 0:dt.filter(function(Vt){return Vt!==-1})})});tt(Fe)},[j]),Object(H.useImperativeHandle)(q,function(){return{onSave:zt,Clear:It}});var zt=function(){if(!ge)return F.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(Ft.length===0)return F.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),!1;for(var Fe=0;Fe<Ft.length;Fe++){var ut,nt=Ft[Fe];if(!(nt!=null&&nt.name))return F.b.info("\u8BF7\u60A8\u8F93\u5165\u7B2C".concat(Fe+1,"\u5C0F\u9898\u9898\u5E72")),!1;var dt=nt==null||((ut=nt.qusList)===null||ut===void 0)?void 0:ut.findIndex(function(Vt){return!Vt});if(dt>-1)return F.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(Fe+1,"\u5C0F\u9898").concat(bt[dt],"\u9009\u9879\u7684\u5185\u5BB9")),!1;if(!(nt!=null&&nt.qusAnswer.length))return F.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(Fe+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),!1}var Kt=Ft.map(function(Vt){return{id:Vt.id>1?Vt.id:null,name:Vt.name,item_type:Vt.item_type,analysis:Vt.analysis,choices:Vt.qusList.map(function(an,Gt){return{choice_text:an,is_answer:Vt.qusAnswer[0]===Gt?1:0}})}});return{name:ge,sub_item_banks:Kt}},It=function(){lt(""),tt([])},vt=function(){var Fe={id:Math.random(),item_type:"SINGLE",open:!1,name:"",qusList:["","","",""],activeQusEditor:null,qusAnswer:[],analysis:""};tt(Ft.concat(Fe))},$t=function(Fe,ut,nt){var dt=Object(D.cloneDeep)(Ft);if(Fe==="open"&&(dt[ut].open=!dt[ut].open),Fe==="delete"&&dt.splice(ut,1),Fe==="value"&&(dt[ut].name=nt),Fe==="answer"&&(dt[ut].qusAnswer=[nt]),Fe==="edit"&&(dt[ut].activeQusEditor=nt),Fe==="details"&&(dt[ut].qusList[dt[ut].activeQusEditor]=nt),Fe==="addQus"&&(dt[ut].qusList=dt[ut].qusList.concat("")),Fe==="deleteQus"){var Kt;dt[ut].qusList=dt[ut].qusList.filter(function(Vt,an){return an!==nt}),dt[ut].qusAnswer=(Kt=dt[ut].qusAnswer)===null||Kt===void 0?void 0:Kt.filter(function(Vt){return Vt!==nt})}Fe==="analysis"&&(dt[ut].analysis=nt),tt(dt)};return g.a.createElement("section",{className:_.a.wrap},g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.required},"*"),g.a.createElement("span",{className:_.a.title},"\u9898\u5E72\uFF1A")),g.a.createElement(we.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:ge,onChange:function(Fe){return lt(Fe)}}),Ft==null?void 0:Ft.map(function(Lt,Fe){var ut;return g.a.createElement("div",{className:_.a.fold,key:Lt.id},g.a.createElement("div",{onClick:function(){return $t("open",Fe)},className:_.a.head},g.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:Lt.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),g.a.createElement("span",null,"\u7B2C",Fe+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),g.a.createElement("b",{style:{visibility:"hidden"},onClick:function(dt){dt.stopPropagation(),$t("delete",Fe)},className:"iconfont icon-shanchu8"})),g.a.createElement("div",{className:"mb10",style:{display:Lt.open?"block":"none"}},g.a.createElement(we.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Lt==null?void 0:Lt.name,onChange:function(dt){return $t("value",Fe,dt)}}),g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.required},"*"),g.a.createElement("span",{className:_.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",g.a.createElement("span",{className:_.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Lt==null||((ut=Lt.qusList)===null||ut===void 0)?void 0:ut.map(function(nt,dt){var Kt,Vt;return g.a.createElement("div",{className:_.a.choiceWrap,key:dt},g.a.createElement(xe.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},g.a.createElement("div",{className:"".concat(_.a.answer," ").concat(Lt!=null&&(Kt=Lt.qusAnswer)!==null&&Kt!==void 0&&Kt.includes(dt)?_.a.activeAnswer:""),onClick:function(){return $t("answer",Fe,dt)}},bt[dt])),g.a.createElement("div",{className:_.a.editorWrap},(Lt==null?void 0:Lt.activeQusEditor)===dt?g.a.createElement(we.a,{id:"single-question-option-".concat(dt),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:nt,onChange:function(Gt){return $t("details",Fe,Gt)}}):g.a.createElement("div",{className:_.a.htmlWrap,onClick:function(){return $t("edit",Fe,dt)}},g.a.createElement(C.a,{value:nt}))),dt>1&&g.a.createElement(xe.a,{title:"\u5220\u9664"},g.a.createElement("i",{className:"".concat(_.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return $t("deleteQus",Fe,dt)}})),dt<7&&dt===(Lt==null||((Vt=Lt.qusList)===null||Vt===void 0)?void 0:Vt.length)-1&&g.a.createElement(xe.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},g.a.createElement("i",{className:"".concat(_.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return $t("addQus",Fe)}})))}),g.a.createElement("p",{className:"mb10 mt10"},g.a.createElement("span",{className:_.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),g.a.createElement(we.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Lt.analysis,onChange:function(dt){return $t("analysis",Fe,dt)}})))}))},Ut=Object(z.a)(function(We){var $=We.loading,q=We.globalSetting;return{globalSetting:q,loading:$.effects}},null,null,{forwardRef:!0})(Object(H.forwardRef)(Ne)),Rt=function($){var q,Q,x,R,j,I,de,Ce,Oe=$.data,_t=$.submit,at=$.goBack,ge=$.loading,lt=$.onTypeScore,Et=$.editPreview,et=Et===void 0?!1:Et,Ft=$.onSkipExamination,tt=$.selectValue,zt=$.onExchange,It=Object(H.useRef)(),vt=Object(H.useRef)(Object(D.debounce)(function(){return ln()},100,{leading:!0,trailing:!0})),$t=Object(H.useState)(null),Lt=Object(fe.a)($t,2),Fe=Lt[0],ut=Lt[1],nt=Object(H.useState)(!1),dt=Object(fe.a)(nt,2),Kt=dt[0],Vt=dt[1],an=Object(J.i)();Object(H.useEffect)(function(){return window.addEventListener("scroll",vt==null?void 0:vt.current),function(){window.removeEventListener("scroll",vt==null?void 0:vt.current)}},[]),Object(H.useEffect)(function(){Vt(!0)},[]),Object(H.useEffect)(function(){var Ee,ce,Ye,Ot,Mt=(Ee=document.getElementById("examName"))===null||Ee===void 0||((ce=Ee.getElementsByClassName("ant-pagination-options-quick-jumper"))===null||ce===void 0||((Ye=ce[0])===null||Ye===void 0||((Ot=Ye.childNodes)===null||Ot===void 0)))?void 0:Ot[2];Mt&&(Mt.nodeValue="\u4EFD")},[Oe]);var Gt=function(ce){var Ye=parseInt(ce);return isNaN(Ye)?"":Ye};function Ct(){var Ee=0,ce=0,Ye=0;return document.body&&(ce=document.body.scrollTop),document.documentElement&&(Ye=document.documentElement.scrollTop),Ee=ce-Ye>0?ce:Ye,Ee}function tn(){var Ee=0,ce=0,Ye=0;return document.body&&(ce=document.body.scrollHeight),document.documentElement&&(Ye=document.documentElement.scrollHeight),Ee=ce-Ye>0?ce:Ye,Ee}function Nt(){var Ee=0;return document.compatMode=="CSS1Compat"?Ee=document.documentElement.clientHeight:Ee=document.body.clientHeight,Ee}var ln=function(){var ce=document.getElementById("preview_btns"),Ye=document.getElementById("preview_btns_else");Ct()+Nt()>=tn()-68?(ce.style.visibility="hidden",Ye.style.visibility="visible"):(ce.style.visibility="visible",Ye.style.visibility="hidden")},Xt=["\u5BB9\u6613","\u7B80\u5355","\u9002\u4E2D","\u56F0\u96BE"],hn=function(ce){var Ye,Ot=[];return g.a.createElement(g.a.Fragment,null,g.a.createElement("aside",{className:S.a.single},ce==null||((Ye=ce.choices)===null||Ye===void 0)?void 0:Ye.map(function(Mt,Tt){return Mt.is_answer&&Ot.push(fn[Tt]),g.a.createElement("ul",{key:Tt},g.a.createElement("li",null,fn[Tt],"\u3001"),g.a.createElement("li",null,g.a.createElement(C.a,{value:Mt.choice_text})))})),g.a.createElement("div",{className:S.a.analysis},g.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",Ot.join(""),g.a.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",Xt[ce.difficulty])),g.a.createElement("aside",null,g.a.createElement("span",{className:S.a.text},"\u89E3\u6790:"),g.a.createElement(C.a,{value:ce.analysis?ce.analysis:"\u6682\u65E0\u89E3\u6790"})),g.a.createElement("ul",null,g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(ce==null?void 0:ce.discipline_name,"/").concat(ce==null?void 0:ce.sub_discipline_name)),g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),ce==null?void 0:ce.tag_discipline_name))))},Kn=function(ce){var Ye,Ot=ce==null||((Ye=ce.standard_answer)===null||Ye===void 0)?void 0:Ye.map(function(Mt){var Tt;return"\u7B54\u6848\uFF08\u586B\u7A7A".concat(Mt.position,"\uFF09\uFF1A").concat(Mt==null||((Tt=Mt.answer_text)===null||Tt===void 0)?void 0:Tt.join("\u3001"))});return g.a.createElement(g.a.Fragment,null,g.a.createElement("div",{className:S.a.analysis},g.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",Ot),g.a.createElement("aside",null,g.a.createElement("span",{className:S.a.text},"\u89E3\u6790:"),g.a.createElement(C.a,{value:ce.analysis?ce.analysis:"\u6682\u65E0\u89E3\u6790"})),g.a.createElement("ul",null,g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(ce==null?void 0:ce.discipline_name,"/").concat(ce==null?void 0:ce.sub_discipline_name)),g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),ce==null?void 0:ce.tag_discipline_name))))},nn=function(ce){var Ye;return g.a.createElement("div",{className:S.a.analysis},g.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",ce==null||((Ye=ce.answer_texts)===null||Ye===void 0)?void 0:Ye[0]),g.a.createElement("aside",null,g.a.createElement("span",{className:S.a.text},"\u89E3\u6790:"),g.a.createElement(C.a,{value:ce.analysis?ce.analysis:"\u6682\u65E0\u89E3\u6790"})),g.a.createElement("ul",null,g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(ce==null?void 0:ce.discipline_name,"/").concat(ce==null?void 0:ce.sub_discipline_name)),g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),ce==null?void 0:ce.tag_discipline_name)))},$e=function(ce){var Ye;return g.a.createElement("div",{className:S.a.analysis},g.a.createElement("aside",null,g.a.createElement("span",{className:S.a.text},"\u9884\u671F\u8F93\u51FA:"),g.a.createElement(C.a,{value:ce==null||((Ye=ce.program_attr)===null||Ye===void 0)?void 0:Ye.description})),g.a.createElement("ul",null,g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(ce==null?void 0:ce.discipline_name,"/").concat(ce==null?void 0:ce.sub_discipline_name)),g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),ce==null?void 0:ce.tag_discipline_name)))},st=function(ce,Ye){var Ot;return g.a.createElement("div",null,ce==null||((Ot=ce.sub_item_banks)===null||Ot===void 0)?void 0:Ot.map(function(Mt,Tt){var Dt,cn=[];return g.a.createElement(g.a.Fragment,null,g.a.createElement("div",{style:{marginLeft:25,fontSize:"16px",color:"#333"}},Ye+1+"."+(Tt+1),"\uFF08\u5355\u9009\u9898\uFF09",Mt.name),g.a.createElement("aside",{className:S.a.single},Mt==null||((Dt=Mt.choices)===null||Dt===void 0)?void 0:Dt.map(function(Nn,Cn){return Nn.is_answer&&cn.push(fn[Cn]),g.a.createElement("ul",{key:Cn},g.a.createElement("li",null,fn[Cn],"\u3001"),g.a.createElement("li",null,g.a.createElement(C.a,{value:Nn.choice_text})))})),g.a.createElement("div",{className:S.a.analysis},g.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",cn.join(""),g.a.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",Xt[Mt.difficulty])),g.a.createElement("aside",null,g.a.createElement("span",{className:S.a.text},"\u89E3\u6790:"),g.a.createElement(C.a,{value:Mt.analysis?Mt.analysis:"\u6682\u65E0\u89E3\u6790"})),g.a.createElement("ul",null,g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(ce==null?void 0:ce.discipline_name,"/").concat(ce==null?void 0:ce.sub_discipline_name)),g.a.createElement("li",null,g.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),ce==null?void 0:ce.tag_discipline_name))))}))},fn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],gn=function(ce){console.log("---",ce);var Ye=[];ce.questions.map(function(Mt){return Mt==null?void 0:Mt.sub_item_banks.map(function(Tt){Ye.push(Tt)})});var Ot=0;ce.type==="COMBINATION"?Ot=ce.questions_score/Ye.length:Ot=ce.questions_score/ce.questions_count,b.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u5206\u6570\u8BBE\u7F6E",content:g.a.createElement("div",{className:S.a.modalColumn},g.a.createElement("div",{className:S.a.modalRow,style:{justifyContent:"flex-start"}},g.a.createElement("sup",{className:S.a.sup},"*"),g.a.createElement("span",null,ce==null?void 0:ce.name,(ce==null?void 0:ce.type)==="COMBINATION"&&"\u4E2D\u7684\u6BCF\u5C0F\u9898","\uFF1A"),g.a.createElement(W.a,{min:1,parser:Gt,defaultValue:Ot,onChange:function(Tt){Ot=Tt}}),g.a.createElement("span",{className:"ml5"},"\u5206/\u9898"))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Mt=Object(L.a)(he.a.mark(function Dt(){var cn,Nn;return he.a.wrap(function(pn){for(;;)switch(pn.prev=pn.next){case 0:if(Ot){pn.next=3;break}return F.b.warn("\u5206\u6570\u4E0D\u80FD\u4E3A\u7A7A\u6216\u4E3A0"),pn.abrupt("return",Promise.reject());case 3:ce.type==="COMBINATION"?(cn={type:ce==null?void 0:ce.type,score:Ot,scoreTotal:Ot*(Ye==null?void 0:Ye.length)},lt(cn)):(Nn={type:ce==null?void 0:ce.type,score:Ot,scoreTotal:Ot*ce.questions_count},lt(Nn));case 4:case"end":return pn.stop()}},Dt)}));function Tt(){return Mt.apply(this,arguments)}return Tt}()})},On=function(){var ce="";b.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u4FDD\u5B58\u8BD5\u5377",content:g.a.createElement("div",{className:S.a.modalColumn},g.a.createElement("div",{style:{color:"#676A6C",display:"flex"},className:"font14 mt20"},g.a.createElement("img",{style:{marginRight:5},src:ue.a}),"\u4FDD\u5B58\u540E\u5355\u72EC\u751F\u6210\u4E00\u4EFD\u4EBA\u5DE5\u7EC4\u5377\u7C7B\u578B\u7684\u56FA\u5B9A\u8BD5\u5377\u3002"),g.a.createElement("div",{className:S.a.modalRow,style:{marginTop:20}},g.a.createElement("sup",{className:S.a.sup},"*"),g.a.createElement("span",{style:{flexShrink:0}},"\u8BD5\u5377\u540D\u79F0\uFF1A"),g.a.createElement(M.a,{placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0",min:0,maxLength:60,defaultValue:ce,onChange:function(Ot){ce=Ot.target.value}}))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Ye=Object(L.a)(he.a.mark(function Mt(){var Tt,Dt,cn,Nn,Cn;return he.a.wrap(function(Wn){for(;;)switch(Wn.prev=Wn.next){case 0:if(ce){Wn.next=3;break}return F.b.warn("\u8BD5\u5377\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"),Wn.abrupt("return",Promise.reject());case 3:return Dt=[],cn=[],Nn=[],Oe==null||((Tt=Oe.questionList)===null||Tt===void 0)||Tt.forEach(function(jn){var ti;(ti=jn.questions)===null||ti===void 0||ti.forEach(function(xi){Dt.push(xi.id),cn.push(jn.questions_score/jn.questions_count),jn.type==="COMBINATION"&&Nn.push({id:xi.id,sub_item_bank_ids:xi.sub_item_banks.map(function(Fn){return Fn.id})})})}),console.log("-----",Nn),Cn={item_bank_ids:Dt,item_bank_scores:cn,name:ce,combination_item_banks:Nn},Wn.next=11,_t(Cn);case 11:case"end":return Wn.stop()}},Mt)}));function Ot(){return Ye.apply(this,arguments)}return Ot}()})},Bn=function(ce,Ye,Ot,Mt){var Tt,Dt=(Tt=Mt.questions)===null||Tt===void 0?void 0:Tt.map(function(Nn){return Nn.id}),cn=b.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:"\u786E\u8BA4\u8981\u66F4\u6362\u8BE5\u8BD5\u9898\u5417\uFF1F",cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Nn=Object(L.a)(he.a.mark(function pn(){return he.a.wrap(function(jn){for(;;)switch(jn.prev=jn.next){case 0:return cn.update({cancelButtonProps:{disabled:!0}}),jn.next=3,zt({single_question_id:ce,seleted_item_bank_ids:Dt},{type:Ye,index:Ot});case 3:cn.update({cancelButtonProps:{disabled:!1}}),F.b.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u8BD5\u9898");case 5:case"end":return jn.stop()}},pn)}));function Cn(){return Nn.apply(this,arguments)}return Cn}()})},d=function(ce){var Ye,Ot=(Ye=ce.questions)===null||Ye===void 0?void 0:Ye.map(function(Dt){return Dt.id}),Mt=ce.name,Tt=b.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:"\u786E\u8BA4\u66F4\u6362".concat(Mt,"\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F"),cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Dt=Object(L.a)(he.a.mark(function Nn(){return he.a.wrap(function(pn){for(;;)switch(pn.prev=pn.next){case 0:return Tt.update({cancelButtonProps:{disabled:!0}}),pn.next=3,zt({seleted_item_bank_ids:Ot},{type:ce.type});case 3:Tt.update({cancelButtonProps:{disabled:!1}}),F.b.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210".concat(Mt,"\u8BD5\u9898"));case 5:case"end":return pn.stop()}},Nn)}));function cn(){return Dt.apply(this,arguments)}return cn}()})},o=function(){var ce=b.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:"\u786E\u8BA4\u66F4\u6362\u9884\u89C8\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F",cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Ye=Object(L.a)(he.a.mark(function Mt(){return he.a.wrap(function(Dt){for(;;)switch(Dt.prev=Dt.next){case 0:return ce.update({cancelButtonProps:{disabled:!0}}),Dt.next=3,zt();case 3:ce.update({cancelButtonProps:{disabled:!1}}),F.b.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u6574\u5F20\u8BD5\u9898");case 5:case"end":return Dt.stop()}},Mt)}));function Ot(){return Ye.apply(this,arguments)}return Ot}()})},r=function(ce){console.log(ce,"key"),Ft(ce-1)},u=function(){return g.a.createElement(g.a.Fragment,null,g.a.createElement(k.a,{color:"#55575D",overlayClassName:S.a.popover,visible:Kt,getPopupContainer:function(Ye){return Ye==null?void 0:Ye.parentNode},content:"\u5982\u60A8\u5BF9\u6B64\u4EFD\u8BD5\u9898\u6EE1\u610F\uFF0C\u53EF\u5C06\u6B64\u4EFD\u8BD5\u9898\u4FDD\u5B58\u4E3A\u56FA\u5B9A\u8BD5\u5377"},g.a.createElement(T.a,{onMouseEnter:function(){return Vt(!0)},onMouseLeave:function(){return Vt(!1)},onClick:function(){On()}},"\u4FDD\u5B58")),g.a.createElement(T.a,{onClick:function(){document.body.scrollIntoView(),at()}},"\u8FD4\u56DE"),g.a.createElement(T.a,{loading:ge,onClick:function(){return _t()},type:"primary"},"\u63D0\u4EA4"))},v=function(){var ce;return g.a.createElement(g.a.Fragment,null,g.a.createElement(T.a,{onClick:at},"\u8FD4\u56DE"),tt>0&&g.a.createElement(T.a,{onClick:function(){return r(tt)},type:"primary"},"\u4E0A\u4E00\u4EFD"),tt<(Oe==null||((ce=Oe.exam)===null||ce===void 0)?void 0:ce.total_num)-1&&g.a.createElement(T.a,{onClick:function(){return r(tt+2)}},"\u4E0B\u4E00\u4EFD"))},c=function(ce,Ye){if(console.log(ce,222),Ye==="SINGLE")return g.a.createElement(g.a.Fragment,null,g.a.createElement(gt,{ref:It,editData:ce,isEdit:!0}),g.a.createElement(re.a,null));if(Ye==="MULTIPLE")return g.a.createElement(g.a.Fragment,null,g.a.createElement(Ke,{ref:It,editData:ce,isEdit:!0}),g.a.createElement(re.a,null));if(Ye==="JUDGMENT")return g.a.createElement(g.a.Fragment,null,g.a.createElement(Xe,{ref:It,editData:ce,isEdit:!0}),g.a.createElement(re.a,null));if(Ye==="COMPLETION")return g.a.createElement(g.a.Fragment,null,g.a.createElement(Ze,{ref:It,editData:ce,isEdit:!0}),g.a.createElement(re.a,null));if(Ye==="SUBJECTIVE")return g.a.createElement(g.a.Fragment,null,g.a.createElement(Pt,{ref:It,editData:ce,isEdit:!0}),g.a.createElement(re.a,null));if(Ye==="COMBINATION")return g.a.createElement(g.a.Fragment,null,g.a.createElement(Ut,{ref:It,editData:ce,isEdit:!0}),g.a.createElement(re.a,null));if(Ye==="PROGRAM"){var Ot;z.d.push("/problems/".concat(ce==null||((Ot=ce.program_attr)===null||Ot===void 0)?void 0:Ot.identifier,"/edit?type=exercises&express_id=").concat(an.categoryId,"&question_id=").concat(ce==null?void 0:ce.id,"&score=").concat(ce==null?void 0:ce.score,"&callback_url=").concat(location.pathname,"&select=").concat(tt,"&exercise=true"))}},oe=function(){var Ee=Object(L.a)(he.a.mark(function ce(Ye,Ot){var Mt,Tt,Dt,cn,Nn,Cn,pn,Wn,jn,ti;return he.a.wrap(function(Fn){for(;;)switch(Fn.prev=Fn.next){case 0:return Fn.next=2,(Mt=It.current)===null||Mt===void 0?void 0:Mt.onSave();case 2:if(Tt=Fn.sent,Tt){Fn.next=5;break}return Fn.abrupt("return");case 5:return Dt={question_score:Ot.score,analysis:Tt.analysis},console.log(Tt,"editorData"),(Ye==="SINGLE"||Ye==="MULTIPLE"||Ye==="JUDGMENT")&&(Nn=[],Cn=[],Dt.question_type=Ye==="JUDGMENT"?2:1,Dt.question_title=Tt==null?void 0:Tt.name,Tt==null||((cn=Tt.choices)===null||cn===void 0)||cn.forEach(function(Xn,$i){Nn.push(Xn.choice_text),Xn!=null&&Xn.is_answer&&Cn.push($i+1)}),Dt.question_choices=Nn,Dt.standard_answers=Cn),Ye==="COMPLETION"&&(Dt.is_ordered=Tt.is_ordered,Dt.question_title=Tt==null?void 0:Tt.name,Dt.question_type=3,Wn=[],Tt==null||((pn=Tt.standard_answers)===null||pn===void 0)||pn.forEach(function(Xn,$i){Wn.push({choice_id:Xn.position,answer_text:Xn.answer_text})}),Dt.standard_answers=Wn),Ye==="SUBJECTIVE"&&(Dt.question_title=Tt==null?void 0:Tt.name,Dt.question_type=3,Dt.standard_answers=Tt==null?void 0:Tt.answer_texts),Ye==="COMBINATION"&&(Dt.question_title=Tt==null?void 0:Tt.name,Dt.question_type=7,Dt.sub_questions=Tt==null||((jn=Tt.sub_item_banks)===null||jn===void 0)?void 0:jn.map(function(Xn,$i){return{id:Xn.id,question_title:Xn.name,question_type:1,question_choices:Xn.choices.map(function(ri){return ri.choice_text}),standard_answers:[Xn.choices.findIndex(function(ri){return ri.is_answer})+1],analysis:Xn.analysis}}),delete Dt.analysis),Fn.next=13,Object(E.a)("/api/exercise_questions/".concat(Ot.id,".json"),{method:"put",body:Dt});case 13:ti=Fn.sent,(ti==null?void 0:ti.status)===0&&(F.b.success("\u7F16\u8F91\u6210\u529F"),r(tt+1)),ut(null);case 16:case"end":return Fn.stop()}},ce)}));return function(Ye,Ot){return Ee.apply(this,arguments)}}(),Je=function(){for(var ce=[],Ye=0;Ye<(Oe==null||((Ot=Oe.exam)===null||Ot===void 0)?void 0:Ot.total_num);Ye++){var Ot;ce.push({})}return ce};console.log(Je(),"data");var _e=Oe==null||((q=Oe.questionList)===null||q===void 0)?void 0:q.reduce(function(Ee,ce){return Ee+ce.questions_score},0),Bt=et&&(Oe==null||((Q=Oe.exam)===null||Q===void 0)?void 0:Q.exercise_status)!==1;return g.a.createElement("section",{className:S.a.wrap},g.a.createElement("div",{id:"id_left_preview",className:S.a.left,onMouseEnter:function(ce){var Ye=document.getElementById("id_left_preview");Ye.style.overflowY="auto"},onMouseLeave:function(ce){var Ye=document.getElementById("id_left_preview");Ye.style.overflowY="hidden"}},g.a.createElement("div",{className:S.a.title},g.a.createElement("div",null,g.a.createElement("b",null),g.a.createElement("span",null,"\u7B54\u9898\u5361"))),g.a.createElement("div",{className:S.a.total},g.a.createElement("div",null,g.a.createElement("img",{src:ae.a}),g.a.createElement("span",null,"\u9898\u6570(\u9053)"),g.a.createElement("aside",null,Oe==null?void 0:Oe.all_questions_count)),g.a.createElement("div",{className:"mr30 ml30"},g.a.createElement("img",{src:be.a}),g.a.createElement("span",null,"\u603B\u5206(\u5206)"),g.a.createElement("aside",null,_e)),g.a.createElement("div",null,g.a.createElement("img",{src:w.a}),g.a.createElement("span",null,"\u65F6\u957F(\u5206)"),g.a.createElement("aside",null,Oe==null||((x=Oe.exam)===null||x===void 0)?void 0:x.time))),Oe==null||((R=Oe.questionList)===null||R===void 0)?void 0:R.map(function(Ee,ce){var Ye;return g.a.createElement("div",{className:S.a.list,key:ce},g.a.createElement("div",{className:S.a.name},g.a.createElement("b",null),g.a.createElement("span",null,Ee.name)),g.a.createElement("aside",null,g.a.createElement("div",null,"\u5171",g.a.createElement("span",{className:S.a.b},Ee.questions_count),"\u9898 ",g.a.createElement("span",{className:S.a.l},"|"),"\u5171",g.a.createElement("span",{className:S.a.r},Ee.questions_score),"\u5206"),g.a.createElement("div",{className:S.a.answerSheet},Ee==null||((Ye=Ee.questions)===null||Ye===void 0)?void 0:Ye.map(function(Ot,Mt){return g.a.createElement("div",{onClick:function(){var Dt="Anchor_".concat(Ot.id),cn=document.getElementById(Dt);cn&&setTimeout(function(){return cn.scrollIntoView({block:"center",behavior:"smooth"})})},key:Ot.id,className:S.a.tag},Mt+1)}))))})),g.a.createElement("div",{className:S.a.right},g.a.createElement("div",{className:S.a.examName,id:"examName"},g.a.createElement("div",{className:S.a.name},g.a.createElement(xe.a,{title:Oe==null||((j=Oe.exam)===null||j===void 0)?void 0:j.name,getPopupContainer:function(ce){return ce.parentNode}},g.a.createElement("span",{className:S.a.t},Oe==null||((I=Oe.exam)===null||I===void 0)?void 0:I.name))),et?g.a.createElement(ve.a,{showTotal:function(ce){return g.a.createElement("span",{style:{color:"#656F87",fontSize:14}},"\u5171\u8BA1",g.a.createElement("span",{className:"c-light-primary"},ce),"\u4EFD\u8BD5\u5377")},total:Oe==null||((de=Oe.exam)===null||de===void 0)?void 0:de.total_num,pageSize:1,current:tt+1,showSizeChanger:!1,onChange:r,showQuickJumper:!0,hideOnSinglePage:!1}):g.a.createElement(T.a,{onClick:o,type:"primary"},"\u968F\u673A\u66F4\u6362")),g.a.createElement("div",{className:S.a.topWarp},Oe==null||((Ce=Oe.questionList)===null||Ce===void 0)?void 0:Ce.map(function(Ee,ce){var Ye,Ot;return g.a.createElement(g.a.Fragment,{key:ce},g.a.createElement("div",{className:S.a.head,style:ce===0?{border:0,marginTop:-16}:{}},g.a.createElement("div",{className:S.a.name},g.a.createElement("b",null),g.a.createElement("span",null,Ee.name)),g.a.createElement("div",{className:S.a.so},"\u5171",g.a.createElement("span",{className:S.a.b},Ee.questions_count," "),"\u9898 ",Ee.type==="COMBINATION"&&"\uFF08\u5305\u542B".concat(Ee==null||((Ye=Ee.questions)===null||Ye===void 0)?void 0:Ye.map(function(Mt){var Tt;return Mt==null||((Tt=Mt.sub_item_banks)===null||Tt===void 0)?void 0:Tt.length}).reduce(function(Mt,Tt){return Mt+Tt}),"\u5C0F\u9898\uFF09"),g.a.createElement("span",{className:S.a.l},"|"),"\u5171",g.a.createElement("span",{className:S.a.r},Ee.questions_score),"\u5206"),!et&&g.a.createElement("div",{className:S.a.btn},g.a.createElement(T.a,{onClick:function(){gn(Ee)},type:"primary",ghost:!0,className:"mr20"},"\u8BBE\u7F6E\u5F97\u5206"),g.a.createElement(T.a,{onClick:function(){return d(Ee)},type:"primary",ghost:!0},"\u968F\u673A\u66F4\u6362"))),Ee==null||((Ot=Ee.questions)===null||Ot===void 0)?void 0:Ot.map(function(Mt,Tt){return Fe===Mt.id?g.a.createElement("div",{id:"Anchor_".concat(Mt.id),className:S.a.content,style:{padding:0,marginTop:10},key:Mt.id},g.a.createElement("div",{style:{float:"right",marginTop:-6}},g.a.createElement(T.a,{onClick:function(){return ut(null)},className:"mr20",type:"primary",ghost:!0},"\u53D6\u6D88"),g.a.createElement(T.a,{onClick:function(){return oe(Ee==null?void 0:Ee.type,Mt)},type:"primary"},"\u4FDD\u5B58")),c(Mt,Ee.type)):g.a.createElement("div",{id:"Anchor_".concat(Mt.id),className:S.a.content,key:Mt.id},g.a.createElement("div",{className:S.a.titleWrap},g.a.createElement(C.a,{style:{paddingRight:10},className:S.a.titleHtml,value:Tt+1+"\u3001"+"".concat((Mt==null?void 0:Mt.item_type)==="combination"?"\uFF08\u9898\u5E72\uFF09":"")+Mt.name}),et&&g.a.createElement(T.a,{disabled:Bt,onClick:function(){if(Fe){F.b.warn("\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898");return}ut(Mt.id)},type:"primary",className:"mr20",style:{marginLeft:"auto"},ghost:!0},"\u7F16\u8F91"),g.a.createElement(T.a,{disabled:Bt,onClick:function(){return Bn(Mt.id,Ee.type,Tt,Ee)},type:"primary",ghost:!0},"\u6362\u4E00\u9898")),(Ee.type==="SINGLE"||Ee.type==="JUDGMENT"||Ee.type==="MULTIPLE")&&hn(Mt),Ee.type==="COMPLETION"&&Kn(Mt),Ee.type==="SUBJECTIVE"&&nn(Mt),Ee.type==="PROGRAM"&&$e(Mt),Ee.type==="COMBINATION"&&st(Mt,Tt),g.a.createElement("div",null))}))})),g.a.createElement("div",{className:S.a.btnsElse,id:"preview_btns_else"},et?v():u()),g.a.createElement("div",{className:S.a.btnsWrap,id:"preview_btns"},g.a.createElement("div",{className:S.a.btns},et?v():u()))))},je=Ie.a=Rt},sboe:function(Qe,Ie,h){"use strict";h.d(Ie,"a",function(){return se});var V=h("q1tI"),ve=h.n(V),se=V.createContext(null)},tmPe:function(Qe,Ie,h){Qe.exports={flex_box_center:"flex_box_center___ivyUy",flex_space_between:"flex_space_between___1h8Qq",flex_box_vertical_center:"flex_box_vertical_center___3eC95",flex_box_center_end:"flex_box_center_end___nrhvX",flex_box_column:"flex_box_column___2po4_",customTree:"customTree___1LpRW",name:"name___17ZTs"}},vHTk:function(Qe,Ie,h){Qe.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wU8J:function(Qe,Ie){function h(){this.buffer=new Array,this.length=0}h.prototype={get:function(V){var ve=Math.floor(V/8);return(this.buffer[ve]>>>7-V%8&1)==1},put:function(V,ve){for(var se=0;se<ve;se++)this.putBit((V>>>ve-se-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(V){var ve=Math.floor(this.length/8);this.buffer.length<=ve&&this.buffer.push(0),V&&(this.buffer[ve]|=128>>>this.length%8),this.length++}},Qe.exports=h}}]);