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
724 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[178,7,8,17],{"+NIl":function(Je,je,h){(function(V){V(h("VrN/"))})(function(V){"use strict";V.defineMode("stex",function(ve,se){"use strict";function xe(B,L){B.cmdState.push(L)}function pe(B){return B.cmdState.length>0?B.cmdState[B.cmdState.length-1]:null}function oe(B){var L=B.cmdState.pop();L&&L.closeBracket()}function j(B){for(var L=B.cmdState,F=L.length-1;F>=0;F--){var z=L[F];if(z.name=="DEFAULT")continue;return z}return{styleIdentifier:function(){return null}}}function w(B,L,F){return function(){this.name=B,this.bracketNo=0,this.style=L,this.styles=F,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var T={};T.importmodule=w("importmodule","tag",["string","builtin"]),T.documentclass=w("documentclass","tag",["","atom"]),T.usepackage=w("usepackage","tag",["atom"]),T.begin=w("begin","tag",["atom"]),T.end=w("end","tag",["atom"]),T.label=w("label","tag",["atom"]),T.ref=w("ref","tag",["atom"]),T.eqref=w("eqref","tag",["atom"]),T.cite=w("cite","tag",["atom"]),T.bibitem=w("bibitem","tag",["atom"]),T.Bibitem=w("Bibitem","tag",["atom"]),T.RBibitem=w("RBibitem","tag",["atom"]),T.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function O(B,L){B.f=L}function N(B,L){var F;if(B.match(/^\\[a-zA-Z@]+/)){var z=B.current().slice(1);return F=T.hasOwnProperty(z)?T[z]:T.DEFAULT,F=new F,xe(L,F),O(L,te),F.style}if(B.match(/^\\[$&%#{}_]/))return"tag";if(B.match(/^\\[,;!\/\\]/))return"tag";if(B.match("\\["))return O(L,function(b,fe){return A(b,fe,"\\]")}),"keyword";if(B.match("\\("))return O(L,function(b,fe){return A(b,fe,"\\)")}),"keyword";if(B.match("$$"))return O(L,function(b,fe){return A(b,fe,"$$")}),"keyword";if(B.match("$"))return O(L,function(b,fe){return A(b,fe,"$")}),"keyword";var Y=B.next();if(Y=="%")return B.skipToEnd(),"comment";if(Y=="}"||Y=="]"){if(F=pe(L),F)F.closeBracket(Y),O(L,te);else return"error";return"bracket"}else return Y=="{"||Y=="["?(F=T.DEFAULT,F=new F,xe(L,F),"bracket"):/\d/.test(Y)?(B.eatWhile(/[\w.%]/),"atom"):(B.eatWhile(/[\w\-_]/),F=j(L),F.name=="begin"&&(F.argument=B.current()),F.styleIdentifier())}function A(B,L,F){if(B.eatSpace())return null;if(F&&B.match(F))return O(L,N),"keyword";if(B.match(/^\\[a-zA-Z@]+/))return"tag";if(B.match(/^[a-zA-Z]+/))return"variable-2";if(B.match(/^\\[$&%#{}_]/))return"tag";if(B.match(/^\\[,;!\/]/))return"tag";if(B.match(/^[\^_&]/))return"tag";if(B.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(B.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var z=B.next();return z=="{"||z=="}"||z=="["||z=="]"||z=="("||z==")"?"bracket":z=="%"?(B.skipToEnd(),"comment"):"error"}function te(B,L){var F=B.peek(),z;return F=="{"||F=="["?(z=pe(L),z.openBracket(F),B.eat(F),O(L,N),"bracket"):/[ \t\r]/.test(F)?(B.eat(F),null):(O(L,N),oe(L),N(B,L))}return{startState:function(){var B=se.inMathMode?function(L,F){return A(L,F)}:N;return{cmdState:[],f:B}},copyState:function(B){return{cmdState:B.cmdState.slice(),f:B.f}},token:function(B,L){return L.f(B,L)},blankLine:function(B){B.f=N,B.cmdState.length=0},lineComment:"%"}}),V.defineMIME("text/x-stex","stex"),V.defineMIME("text/x-latex","stex")})},"+RXH":function(Je,je,h){Je.exports=h.p+"static/shu.a39bf729.svg"},"+yhJ":function(Je,je,h){Je.exports=h.p+"static/xixi.d492fb65.svg"},"0eGx":function(Je,je,h){Je.exports=h.p+"static/zhong.c1924b73.svg"},"19Vz":function(Je,je,h){(function(V){V(h("VrN/"))})(function(V){V.defineOption("placeholder","",function(w,T,O){var N=O&&O!=V.Init;if(T&&!N)w.on("blur",pe),w.on("change",oe),w.on("swapDoc",oe),V.on(w.getInputField(),"compositionupdate",w.state.placeholderCompose=function(){xe(w)}),oe(w);else if(!T&&N){w.off("blur",pe),w.off("change",oe),w.off("swapDoc",oe),V.off(w.getInputField(),"compositionupdate",w.state.placeholderCompose),ve(w);var A=w.getWrapperElement();A.className=A.className.replace(" CodeMirror-empty","")}T&&!w.hasFocus()&&pe(w)});function ve(w){w.state.placeholder&&(w.state.placeholder.parentNode.removeChild(w.state.placeholder),w.state.placeholder=null)}function se(w){ve(w);var T=w.state.placeholder=document.createElement("pre");T.style.cssText="height: 0; overflow: visible",T.style.direction=w.getOption("direction"),T.className="CodeMirror-placeholder CodeMirror-line-like";var O=w.getOption("placeholder");typeof O=="string"&&(O=document.createTextNode(O)),T.appendChild(O),w.display.lineSpace.insertBefore(T,w.display.lineSpace.firstChild)}function xe(w){setTimeout(function(){var T=!1,O=w.getInputField();O.nodeName=="TEXTAREA"?T=!O.value:w.lineCount()==1&&(T=!/[^\u200b]/.test(O.querySelector(".CodeMirror-line").textContent)),T?se(w):ve(w)},20)}function pe(w){j(w)&&se(w)}function oe(w){var T=w.getWrapperElement(),O=j(w);T.className=T.className.replace(" CodeMirror-empty","")+(O?" CodeMirror-empty":""),O?se(w):ve(w)}function j(w){return w.lineCount()===1&&w.getLine(0)===""}})},"1eCo":function(Je,je,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,pe){var oe=xe.indentUnit,j={},w=pe.htmlMode?ve:se;for(var T in w)j[T]=w[T];for(var T in pe)j[T]=pe[T];var O,N;function A(C,J){function H(ae){return J.tokenize=ae,ae(C,J)}var E=C.next();if(E=="<")return C.eat("!")?C.eat("[")?C.match("CDATA[")?H(L("atom","]]>")):null:C.match("--")?H(L("comment","-->")):C.match("DOCTYPE",!0,!0)?(C.eatWhile(/[\w\._\-]/),H(F(1))):null:C.eat("?")?(C.eatWhile(/[\w\._\-]/),J.tokenize=L("meta","?>"),"meta"):(O=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}A.isInText=!0;function te(C,J){var H=C.next();if(H==">"||H=="/"&&C.eat(">"))return J.tokenize=A,O=H==">"?"endTag":"selfcloseTag","tag bracket";if(H=="=")return O="equals",null;if(H=="<"){J.tokenize=A,J.state=fe,J.tagName=J.tagStart=null;var E=J.tokenize(C,J);return E?E+" tag error":"tag error"}else return/[\'\"]/.test(H)?(J.tokenize=B(H),J.stringStartCol=C.column(),J.tokenize(C,J)):(C.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function B(C){var J=function(H,E){for(;!H.eol();)if(H.next()==C){E.tokenize=te;break}return"string"};return J.isInAttribute=!0,J}function L(C,J){return function(H,E){for(;!H.eol();){if(H.match(J)){E.tokenize=A;break}H.next()}return C}}function F(C){return function(J,H){for(var E;(E=J.next())!=null;){if(E=="<")return H.tokenize=F(C+1),H.tokenize(J,H);if(E==">")if(C==1){H.tokenize=A;break}else return H.tokenize=F(C-1),H.tokenize(J,H)}return"meta"}}function z(C,J,H){this.prev=C.context,this.tagName=J,this.indent=C.indented,this.startOfLine=H,(j.doNotIndent.hasOwnProperty(J)||C.context&&C.context.noIndent)&&(this.noIndent=!0)}function Y(C){C.context&&(C.context=C.context.prev)}function b(C,J){for(var H;;){if(!C.context)return;if(H=C.context.tagName,!j.contextGrabbers.hasOwnProperty(H)||!j.contextGrabbers[H].hasOwnProperty(J))return;Y(C)}}function fe(C,J,H){return C=="openTag"?(H.tagStart=J.column(),Re):C=="closeTag"?he:fe}function Re(C,J,H){return C=="word"?(H.tagName=J.current(),N="tag",re):j.allowMissingTagName&&C=="endTag"?(N="tag bracket",re(C,J,H)):(N="error",Re)}function he(C,J,H){if(C=="word"){var E=J.current();return H.context&&H.context.tagName!=E&&j.implicitlyClosed.hasOwnProperty(H.context.tagName)&&Y(H),H.context&&H.context.tagName==E||j.matchClosing===!1?(N="tag",q):(N="tag error",g)}else return j.allowMissingTagName&&C=="endTag"?(N="tag bracket",q(C,J,H)):(N="error",g)}function q(C,J,H){return C!="endTag"?(N="error",q):(Y(H),fe)}function g(C,J,H){return N="error",q(C,J,H)}function re(C,J,H){if(C=="word")return N="attribute",k;if(C=="endTag"||C=="selfcloseTag"){var E=H.tagName,P=H.tagStart;return H.tagName=H.tagStart=null,C=="selfcloseTag"||j.autoSelfClosers.hasOwnProperty(E)?b(H,E):(b(H,E),H.context=new z(H,E,P==H.indented)),fe}return N="error",re}function k(C,J,H){return C=="equals"?X:(j.allowMissing||(N="error"),re(C,J,H))}function X(C,J,H){return C=="string"?S:C=="word"&&j.allowUnquoted?(N="string",re):(N="error",re(C,J,H))}function S(C,J,H){return C=="string"?S:re(C,J,H)}return{startState:function(C){var J={tokenize:A,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;O=null;var H=J.tokenize(C,J);return(H||O)&&H!="comment"&&(N=null,J.state=J.state(O||H,C,J),N&&(H=N=="error"?H+" error":N)),H},indent:function(C,J,H){var E=C.context;if(C.tokenize.isInAttribute)return C.tagStart==C.indented?C.stringStartCol+1:C.indented+oe;if(E&&E.noIndent)return V.Pass;if(C.tokenize!=te&&C.tokenize!=A)return H?H.match(/^(\s*)/)[0].length:0;if(C.tagName)return j.multilineTagIndentPastTag!==!1?C.tagStart+C.tagName.length+2:C.tagStart+oe*(j.multilineTagIndentFactor||1);if(j.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(j.implicitlyClosed.hasOwnProperty(E.tagName))E=E.prev;else break;else if(P)for(;E;){var ae=j.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+oe:C.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:j.htmlMode?"html":"xml",helperType:j.htmlMode?"html":"xml",skipAttribute:function(C){C.state==X&&(C.state=re)},xmlCurrentTag:function(C){return C.tagName?{name:C.tagName,close:C.type=="closeTag"}:null},xmlCurrentContext:function(C){for(var J=[],H=C.context;H;H=H.prev)H.tagName&&J.push(H.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(Je,je,h){Je.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(Je,je,h){Je.exports=h.p+"static/sc.c1696770.svg"},"5MlY":function(Je,je,h){Je.exports=h.p+"static/sm.8ccb50bf.svg"},"6+eU":function(Je,je,h){"use strict";h.d(je,"a",function(){return q});var V=h("wx14"),ve=h("rePB"),se=h("VTBJ"),xe=h("1OyB"),pe=h("vuIU"),oe=h("Ji7U"),j=h("LK+K"),w=h("q1tI"),T=h.n(w),O=h("TSYQ"),N=h.n(O),A=function(re){var k,X="".concat(re.rootPrefixCls,"-item"),S=N()(X,"".concat(X,"-").concat(re.page),(k={},Object(ve.a)(k,"".concat(X,"-active"),re.active),Object(ve.a)(k,re.className,!!re.className),Object(ve.a)(k,"".concat(X,"-disabled"),!re.page),k)),C=function(){re.onClick(re.page)},J=function(E){re.onKeyPress(E,re.onClick,re.page)};return T.a.createElement("li",{title:re.showTitle?re.page:null,className:S,onClick:C,onKeyPress:J,tabIndex:"0"},re.itemRender(re.page,"page",T.a.createElement("a",{rel:"nofollow"},re.page)))},te=A,B={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(oe.a)(k,g);var re=Object(j.a)(k);function k(){var X;Object(xe.a)(this,k);for(var S=arguments.length,C=new Array(S),J=0;J<S;J++)C[J]=arguments[J];return X=re.call.apply(re,[this].concat(C)),X.state={goInputText:""},X.buildOptionText=function(H){return"".concat(H," ").concat(X.props.locale.items_per_page)},X.changeSize=function(H){X.props.changeSize(Number(H))},X.handleChange=function(H){X.setState({goInputText:H.target.value})},X.handleBlur=function(H){var E=X.props,P=E.goButton,ae=E.quickGo,W=E.rootPrefixCls,be=X.state.goInputText;if(P||be==="")return;if(H.relatedTarget&&(H.relatedTarget.className.indexOf("".concat(W,"-prev"))>=0||H.relatedTarget.className.indexOf("".concat(W,"-next"))>=0))return;X.setState({goInputText:""}),ae(X.getValidValue())},X.go=function(H){var E=X.state.goInputText;if(E==="")return;(H.keyCode===B.ENTER||H.type==="click")&&(X.setState({goInputText:""}),X.props.quickGo(X.getValidValue()))},X}return Object(pe.a)(k,[{key:"getValidValue",value:function(){var S=this.state,C=S.goInputText,J=S.current;return!C||isNaN(C)?J:Number(C)}},{key:"getPageSizeOptions",value:function(){var S=this.props,C=S.pageSize,J=S.pageSizeOptions;return J.some(function(H){return H.toString()===C.toString()})?J:J.concat([C.toString()]).sort(function(H,E){var P=isNaN(Number(H))?0:Number(H),ae=isNaN(Number(E))?0:Number(E);return P-ae})}},{key:"render",value:function(){var S=this,C=this.props,J=C.pageSize,H=C.locale,E=C.rootPrefixCls,P=C.changeSize,ae=C.quickGo,W=C.goButton,be=C.selectComponentClass,M=C.buildOptionText,p=C.selectPrefixCls,le=C.disabled,Ue=this.state.goInputText,Pe="".concat(E,"-options"),He=be,Oe=null,Se=null,$=null;if(!P&&!ae)return null;var K=this.getPageSizeOptions();if(P&&He){var ue=K.map(function(D,_){return T.a.createElement(He.Option,{key:_,value:D.toString()},(M||S.buildOptionText)(D))});Oe=T.a.createElement(He,{disabled:le,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}},ue)}return ae&&(W&&($=typeof W=="boolean"?T.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:le,className:"".concat(Pe,"-quick-jumper-button")},H.jump_to_confirm):T.a.createElement("span",{onClick:this.go,onKeyUp:this.go},W)),Se=T.a.createElement("div",{className:"".concat(Pe,"-quick-jumper")},H.jump_to,T.a.createElement("input",{disabled:le,type:"text",value:Ue,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),H.page,$)),T.a.createElement("li",{className:"".concat(Pe)},Oe,Se)}}]),k}(T.a.Component);L.defaultProps={pageSizeOptions:["10","20","50","100"]};var F=L,z=h("N2Kk");function Y(){}function b(g){return typeof g=="number"&&isFinite(g)&&Math.floor(g)===g}function fe(g,re,k){return k}function Re(g,re,k){var X=typeof g=="undefined"?re.pageSize:g;return Math.floor((k.total-1)/X)+1}var he=function(g){Object(oe.a)(k,g);var re=Object(j.a)(k);function k(X){var S;Object(xe.a)(this,k),S=re.call(this,X),S.getJumpPrevPage=function(){return Math.max(1,S.state.current-(S.props.showLessItems?3:5))},S.getJumpNextPage=function(){return Math.min(Re(void 0,S.state,S.props),S.state.current+(S.props.showLessItems?3:5))},S.getItemIcon=function(P,ae){var W=S.props.prefixCls,be=P||T.a.createElement("button",{type:"button","aria-label":ae,className:"".concat(W,"-item-link")});return typeof P=="function"&&(be=T.a.createElement(P,Object(se.a)({},S.props))),be},S.savePaginationNode=function(P){S.paginationNode=P},S.isValid=function(P){return b(P)&&P!==S.state.current},S.shouldDisplayQuickJumper=function(){var P=S.props,ae=P.showQuickJumper,W=P.pageSize,be=P.total;return be<=W?!1:ae},S.handleKeyDown=function(P){(P.keyCode===B.ARROW_UP||P.keyCode===B.ARROW_DOWN)&&P.preventDefault()},S.handleKeyUp=function(P){var ae=S.getValidValue(P),W=S.state.currentInputValue;ae!==W&&S.setState({currentInputValue:ae}),P.keyCode===B.ENTER?S.handleChange(ae):P.keyCode===B.ARROW_UP?S.handleChange(ae-1):P.keyCode===B.ARROW_DOWN&&S.handleChange(ae+1)},S.changePageSize=function(P){var ae=S.state.current,W=Re(P,S.state,S.props);ae=ae>W?W:ae,W===0&&(ae=S.state.current),typeof P=="number"&&("pageSize"in S.props||S.setState({pageSize:P}),"current"in S.props||S.setState({current:ae,currentInputValue:ae})),S.props.onShowSizeChange(ae,P),"onChange"in S.props&&S.props.onChange&&S.props.onChange(ae,P)},S.handleChange=function(P){var ae=S.props.disabled,W=P;if(S.isValid(W)&&!ae){var be=Re(void 0,S.state,S.props);W>be?W=be:W<1&&(W=1),"current"in S.props||S.setState({current:W,currentInputValue:W});var M=S.state.pageSize;return S.props.onChange(W,M),W}return S.state.current},S.prev=function(){S.hasPrev()&&S.handleChange(S.state.current-1)},S.next=function(){S.hasNext()&&S.handleChange(S.state.current+1)},S.jumpPrev=function(){S.handleChange(S.getJumpPrevPage())},S.jumpNext=function(){S.handleChange(S.getJumpNextPage())},S.hasPrev=function(){return S.state.current>1},S.hasNext=function(){return S.state.current<Re(void 0,S.state,S.props)},S.runIfEnter=function(P,ae){if(P.key==="Enter"||P.charCode===13){for(var W=arguments.length,be=new Array(W>2?W-2:0),M=2;M<W;M++)be[M-2]=arguments[M];ae.apply(void 0,be)}},S.runIfEnterPrev=function(P){S.runIfEnter(P,S.prev)},S.runIfEnterNext=function(P){S.runIfEnter(P,S.next)},S.runIfEnterJumpPrev=function(P){S.runIfEnter(P,S.jumpPrev)},S.runIfEnterJumpNext=function(P){S.runIfEnter(P,S.jumpNext)},S.handleGoTO=function(P){(P.keyCode===B.ENTER||P.type==="click")&&S.handleChange(S.state.currentInputValue)};var C=X.onChange!==Y,J="current"in X;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 H=X.defaultCurrent;"current"in X&&(H=X.current);var E=X.defaultPageSize;return"pageSize"in X&&(E=X.pageSize),H=Math.min(H,Re(E,void 0,X)),S.state={current:H,currentInputValue:H,pageSize:E},S}return Object(pe.a)(k,[{key:"componentDidUpdate",value:function(S,C){var J=this.props.prefixCls;if(C.current!==this.state.current&&this.paginationNode){var H=this.paginationNode.querySelector(".".concat(J,"-item-").concat(C.current));H&&document.activeElement===H&&H.blur()}}},{key:"getValidValue",value:function(S){var C=S.target.value,J=Re(void 0,this.state,this.props),H=this.state.currentInputValue,E;return C===""?E=C:isNaN(Number(C))?E=H:C>=J?E=J:E=Number(C),E}},{key:"getShowSizeChanger",value:function(){var S=this.props,C=S.showSizeChanger,J=S.total,H=S.totalBoundaryShowSizeChanger;return typeof C!="undefined"?C:J>H}},{key:"renderPrev",value:function(S){var C=this.props,J=C.prevIcon,H=C.itemRender,E=H(S,"prev",this.getItemIcon(J,"prev page")),P=!this.hasPrev();return Object(w.isValidElement)(E)?Object(w.cloneElement)(E,{disabled:P}):E}},{key:"renderNext",value:function(S){var C=this.props,J=C.nextIcon,H=C.itemRender,E=H(S,"next",this.getItemIcon(J,"next page")),P=!this.hasNext();return Object(w.isValidElement)(E)?Object(w.cloneElement)(E,{disabled:P}):E}},{key:"render",value:function(){var S=this,C=this.props,J=C.prefixCls,H=C.className,E=C.style,P=C.disabled,ae=C.hideOnSinglePage,W=C.total,be=C.locale,M=C.showQuickJumper,p=C.showLessItems,le=C.showTitle,Ue=C.showTotal,Pe=C.simple,He=C.itemRender,Oe=C.showPrevNextJumpers,Se=C.jumpPrevIcon,$=C.jumpNextIcon,K=C.selectComponentClass,ue=C.selectPrefixCls,D=C.pageSizeOptions,_=this.state,me=_.current,Ie=_.pageSize,Ze=_.currentInputValue;if(ae===!0&&W<=Ie)return null;var Me=Re(void 0,this.state,this.props),Fe=[],Te=null,De=null,Qe=null,tt=null,ot=null,$e=M&&M.goButton,Ke=p?1:2,At=me-1>0?me-1:0,gt=me+1<Me?me+1:Me,kt=Object.keys(this.props).reduce(function(x,R){return(R.substr(0,5)==="data-"||R.substr(0,5)==="aria-"||R==="role")&&(x[R]=S.props[R]),x},{});if(Pe)return $e&&(typeof $e=="boolean"?ot=T.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},be.jump_to_confirm):ot=T.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},$e),ot=T.a.createElement("li",{title:le?"".concat(be.jump_to).concat(me,"/").concat(Me):null,className:"".concat(J,"-simple-pager")},ot)),T.a.createElement("ul",Object(V.a)({className:N()(J,"".concat(J,"-simple"),Object(ve.a)({},"".concat(J,"-disabled"),P),H),style:E,ref:this.savePaginationNode},kt),T.a.createElement("li",{title:le?be.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:N()("".concat(J,"-prev"),Object(ve.a)({},"".concat(J,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(At)),T.a.createElement("li",{title:le?"".concat(me,"/").concat(Me):null,className:"".concat(J,"-simple-pager")},T.a.createElement("input",{type:"text",value:Ze,disabled:P,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),T.a.createElement("span",{className:"".concat(J,"-slash")},"/"),Me),T.a.createElement("li",{title:le?be.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:N()("".concat(J,"-next"),Object(ve.a)({},"".concat(J,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(gt)),ot);if(Me<=3+Ke*2){var ct={locale:be,rootPrefixCls:J,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:le,itemRender:He};Me||Fe.push(T.a.createElement(te,Object(V.a)({},ct,{key:"noPager",page:Me,className:"".concat(J,"-disabled")})));for(var Pt=1;Pt<=Me;Pt+=1){var xt=me===Pt;Fe.push(T.a.createElement(te,Object(V.a)({},ct,{key:Pt,page:Pt,active:xt})))}}else{var bt=p?be.prev_3:be.prev_5,Le=p?be.next_3:be.next_5;Oe&&(Te=T.a.createElement("li",{title:le?bt:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:N()("".concat(J,"-jump-prev"),Object(ve.a)({},"".concat(J,"-jump-prev-custom-icon"),!!Se))},He(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Se,"prev page"))),De=T.a.createElement("li",{title:le?Le:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:N()("".concat(J,"-jump-next"),Object(ve.a)({},"".concat(J,"-jump-next-custom-icon"),!!$))},He(this.getJumpNextPage(),"jump-next",this.getItemIcon($,"next page")))),tt=T.a.createElement(te,{locale:be,last:!0,rootPrefixCls:J,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Me,page:Me,active:!1,showTitle:le,itemRender:He}),Qe=T.a.createElement(te,{locale:be,rootPrefixCls:J,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:le,itemRender:He});var Ut=Math.max(1,me-Ke),Rt=Math.min(me+Ke,Me);me-1<=Ke&&(Rt=1+Ke*2),Me-me<=Ke&&(Ut=Me-Ke*2);for(var Ne=Ut;Ne<=Rt;Ne+=1){var We=me===Ne;Fe.push(T.a.createElement(te,{locale:be,rootPrefixCls:J,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ne,page:Ne,active:We,showTitle:le,itemRender:He}))}me-1>=Ke*2&&me!==1+2&&(Fe[0]=Object(w.cloneElement)(Fe[0],{className:"".concat(J,"-item-after-jump-prev")}),Fe.unshift(Te)),Me-me>=Ke*2&&me!==Me-2&&(Fe[Fe.length-1]=Object(w.cloneElement)(Fe[Fe.length-1],{className:"".concat(J,"-item-before-jump-next")}),Fe.push(De)),Ut!==1&&Fe.unshift(Qe),Rt!==Me&&Fe.push(tt)}var G=null;Ue&&(G=T.a.createElement("li",{className:"".concat(J,"-total-text")},Ue(W,[W===0?0:(me-1)*Ie+1,me*Ie>W?W:me*Ie])));var ee=!this.hasPrev()||!Me,Q=!this.hasNext()||!Me;return T.a.createElement("ul",Object(V.a)({className:N()(J,H,Object(ve.a)({},"".concat(J,"-disabled"),P)),style:E,unselectable:"unselectable",ref:this.savePaginationNode},kt),G,T.a.createElement("li",{title:le?be.prev_page:null,onClick:this.prev,tabIndex:ee?null:0,onKeyPress:this.runIfEnterPrev,className:N()("".concat(J,"-prev"),Object(ve.a)({},"".concat(J,"-disabled"),ee)),"aria-disabled":ee},this.renderPrev(At)),Fe,T.a.createElement("li",{title:le?be.next_page:null,onClick:this.next,tabIndex:Q?null:0,onKeyPress:this.runIfEnterNext,className:N()("".concat(J,"-next"),Object(ve.a)({},"".concat(J,"-disabled"),Q)),"aria-disabled":Q},this.renderNext(gt)),T.a.createElement(F,{disabled:P,locale:be,rootPrefixCls:J,selectComponentClass:K,selectPrefixCls:ue,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:me,pageSize:Ie,pageSizeOptions:D,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:$e}))}}],[{key:"getDerivedStateFromProps",value:function(S,C){var J={};if("current"in S&&(J.current=S.current,S.current!==C.current&&(J.currentInputValue=J.current)),"pageSize"in S&&S.pageSize!==C.pageSize){var H=C.current,E=Re(S.pageSize,C,S);H=H>E?E:H,"current"in S||(J.current=H,J.currentInputValue=H),J.pageSize=S.pageSize}return J}}]),k}(T.a.Component);he.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:Y,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:Y,locale:z.a,style:{},itemRender:fe,totalBoundaryShowSizeChanger:50};var q=he},"6K3P":function(Je,je,h){Je.exports=h.p+"static/jinshi.9b74f304.svg"},"7Cbv":function(Je,je,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 pe(te){return typeof te=="string"&&xe.test(te)}for(var oe=pe,j=[],w=0;w<256;++w)j.push((w+256).toString(16).substr(1));function T(te){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=(j[te[B+0]]+j[te[B+1]]+j[te[B+2]]+j[te[B+3]]+"-"+j[te[B+4]]+j[te[B+5]]+"-"+j[te[B+6]]+j[te[B+7]]+"-"+j[te[B+8]]+j[te[B+9]]+"-"+j[te[B+10]]+j[te[B+11]]+j[te[B+12]]+j[te[B+13]]+j[te[B+14]]+j[te[B+15]]).toLowerCase();if(!oe(L))throw TypeError("Stringified UUID is invalid");return L}var O=T;function N(te,B,L){te=te||{};var F=te.random||(te.rng||se)();if(F[6]=F[6]&15|64,F[8]=F[8]&63|128,B){L=L||0;for(var z=0;z<16;++z)B[L+z]=F[z];return B}return O(F)}var A=je.a=N},"7ahc":function(Je,je,h){"use strict";h.d(je,"a",function(){return Re});var V=h("k1fw"),ve=h("0Owb"),se=h("+L6B"),xe=h("2/Rp"),pe=h("y8nQ"),oe=h("Vl3Y"),j=h("tJVT"),w=h("OaEy"),T=h("2fM7"),O=h("q1tI"),N=h.n(O),A=h("VrN/"),te=h.n(A),B=h("p77/"),L=h.n(B),F=h("c5Ni"),z=h.n(F),Y=T.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"]};je.b=function(he){var q=he.callback,g=he.onCancel,re=Object(O.useState)("python"),k=Object(j.a)(re,2),X=k[0],S=k[1];function C(H){S(fe[H][1])}function J(H){q(H)}return N.a.createElement(oe.a,Object(ve.a)({},b,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:J}),N.a.createElement(oe.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},N.a.createElement(T.a,{onChange:C},Object.keys(fe).map(function(H){return N.a.createElement(Y,{key:H,value:H},fe[H][0])}))),N.a.createElement(oe.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},N.a.createElement(Re,{mode:X})),N.a.createElement("div",{className:"flex-container flex-end"},N.a.createElement(xe.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),N.a.createElement(xe.a,{type:"ghost",onClick:g},"\u53D6\u6D88")))};function Re(he){var q=he.value,g=he.onChange,re=he.mode,k=he.options,X=k===void 0?{}:k,S=Object(O.useRef)(),C=Object(O.useState)(),J=Object(j.a)(C,2),H=J[0],E=J[1];return Object(O.useEffect)(function(){if(H){function P(ae){var W=ae.getValue();g&&g(W)}return H.on("change",P),function(){H.off("change",P)}}},[H,g]),Object(O.useEffect)(function(){H&&H.setOption("mode",re)},[H,re]),Object(O.useEffect)(function(){H&&((q!==H.getValue()||q==="")&&setTimeout(function(){H.setValue(q||" ")},300))},[H,q]),Object(O.useEffect)(function(){if(S.current&&!H){var P=te.a.fromTextArea(S.current,Object(V.a)({mode:re,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},X));E(P)}},[S.current,H]),N.a.createElement("div",{className:"my-codemirror-container"},N.a.createElement("textarea",{ref:S}))}},"7ixt":function(Je,je,h){"use strict";h.d(je,"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(Je,je,h){"use strict";var V=h("5Dmo"),ve=h("3S7+"),se=h("fWQN"),xe=h("mtLc"),pe=h("yKVA"),oe=h("879j"),j=h("5NDa"),w=h("5rEg"),T=h("q1tI"),O=h.n(T),N=h("O2Wb"),A=h.n(N),te=w.a.TextArea,B=function(L){Object(pe.a)(z,L);var F=Object(oe.a)(z);function z(){return Object(se.a)(this,z),F.apply(this,arguments)}return Object(xe.a)(z,[{key:"render",value:function(){var b=this,fe=this.props,Re=fe.index,he=fe.onAnswerChange,q=fe.addChildAnswer,g=fe.exerciseIsPublish,re=fe.answers,k=fe.activeOptionErrorIndex,X=fe.flex,S=X===void 0?"0 0 1000px":X;return O.a.createElement("div",{className:A.a.flex},O.a.createElement("div",{className:"".concat(A.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",Re+1,"):"),O.a.createElement("div",{className:"".concat(A.a.flex," ").concat(A.a.flex1),style:{flexDirection:"column"}},re.map(function(C,J){var H="".concat(Re,"-").concat(J);return O.a.createElement("div",{className:"".concat(A.a.flex," ").concat(A.a.flex1),key:J},O.a.createElement("div",{className:A.a.flex1,style:{flex:S}},O.a.createElement("div",null,O.a.createElement(te,{className:H===k?A.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(Re,J,P.target.value)},style:{minHeight:95}}))),!g&&O.a.createElement(O.a.Fragment,null,J!=0&&O.a.createElement(ve.a,{title:"\u5220\u9664"},O.a.createElement("i",{className:"".concat(A.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return b.props.deleteChildAnswer(Re,J)},style:{float:"right"}})),J===0&&O.a.createElement(ve.a,{title:"\u5220\u9664"},O.a.createElement("i",{className:"".concat(A.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return b.props.deleteChildAnswermain(Re,J)},style:{float:"right"}})),O.a.createElement(ve.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},O.a.createElement("i",{className:"".concat(A.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return q(Re)},style:{float:"right",visibility:J==re.length-1?"":"hidden"}}))))})))}}]),z}(T.Component);je.a=B},"815F":function(Je,je,h){"use strict";h.d(je,"e",function(){return j}),h.d(je,"c",function(){return T}),h.d(je,"d",function(){return O}),h.d(je,"a",function(){return A}),h.d(je,"f",function(){return te}),h.d(je,"b",function(){return B});var V=h("KQm4"),ve=h("VTBJ"),se=h("Ff2n"),xe=h("Zm9Q"),pe=h("Kwbf"),oe=h("OZM5");function j(L,F){return L!=null?L:F}function w(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],F=new Map;function z(Y){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(Y||[]).forEach(function(fe){var Re=fe.key,he=fe.children;Object(pe.a)(Re!=null,"Tree node must have a certain key: [".concat(b).concat(Re,"]"));var q=String(Re);Object(pe.a)(!F.has(q)||Re===null||Re===void 0,"Same 'key' exist in the Tree: ".concat(q)),F.set(q,!0),z(he,"".concat(b).concat(q," > "))})}z(L)}function T(L){function F(z){var Y=Object(xe.a)(z);return Y.map(function(b){if(!Object(oe.i)(b))return Object(pe.a)(!b,"Tree/TreeNode can only accept TreeNode as children."),null;var fe=b.key,Re=b.props,he=Re.children,q=Object(se.a)(Re,["children"]),g=Object(ve.a)({key:fe},q),re=F(he);return re.length&&(g.children=re),g}).filter(function(b){return b})}return F(L)}function O(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],z=new Set(F===!0?[]:F),Y=[];function b(fe){var Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return fe.map(function(he,q){var g=Object(oe.h)(Re?Re.pos:"0",q),re=j(he.key,g),k=Object(ve.a)(Object(ve.a)({},he),{},{parent:Re,pos:g,children:null,data:he,isStart:[].concat(Object(V.a)(Re?Re.isStart:[]),[q===0]),isEnd:[].concat(Object(V.a)(Re?Re.isEnd:[]),[q===fe.length-1])});return Y.push(k),F===!0||z.has(re)?k.children=b(he.children||[],k):k.children=[],k})}return b(L),Y}function N(L,F,z){var Y;z?typeof z=="string"?Y=function(Re){return Re[z]}:typeof z=="function"&&(Y=function(Re){return z(Re)}):Y=function(Re,he){return j(Re.key,he)};function b(fe,Re,he){var q=fe?fe.children:L,g=fe?Object(oe.h)(he.pos,Re):"0";if(fe){var re=Y(fe,g),k={node:fe,index:Re,pos:g,key:re,parentPos:he.node?he.pos:null,level:he.level+1};F(k)}q&&q.forEach(function(X,S){b(X,S,{node:fe,pos:g,level:he?he.level+1:-1})})}b(null)}function A(L){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},z=F.initWrapper,Y=F.processEntity,b=F.onProcessFinished,fe=arguments.length>2?arguments[2]:void 0,Re={},he={},q={posEntities:Re,keyEntities:he};return z&&(q=z(q)||q),N(L,function(g){var re=g.node,k=g.index,X=g.pos,S=g.key,C=g.parentPos,J=g.level,H={node:re,index:k,key:S,pos:X,level:J},E=j(S,X);Re[X]=H,he[E]=H,H.parent=Re[C],H.parent&&(H.parent.children=H.parent.children||[],H.parent.children.push(H)),Y&&Y(H,q)},fe),b&&b(q),q}function te(L,F){var z=F.expandedKeys,Y=F.selectedKeys,b=F.loadedKeys,fe=F.loadingKeys,Re=F.checkedKeys,he=F.halfCheckedKeys,q=F.dragOverNodeKey,g=F.dropPosition,re=F.keyEntities,k=re[L],X={eventKey:L,expanded:z.indexOf(L)!==-1,selected:Y.indexOf(L)!==-1,loaded:b.indexOf(L)!==-1,loading:fe.indexOf(L)!==-1,checked:Re.indexOf(L)!==-1,halfChecked:he.indexOf(L)!==-1,pos:String(k?k.pos:""),dragOver:q===L&&g===0,dragOverGapTop:q===L&&g===-1,dragOverGapBottom:q===L&&g===1};return X}function B(L){var F=L.data,z=L.expanded,Y=L.selected,b=L.checked,fe=L.loaded,Re=L.loading,he=L.halfChecked,q=L.dragOver,g=L.dragOverGapTop,re=L.dragOverGapBottom,k=L.pos,X=L.active,S=Object(ve.a)(Object(ve.a)({},F),{},{expanded:z,selected:Y,checked:b,loaded:fe,loading:Re,halfChecked:he,dragOver:q,dragOverGapTop:g,dragOverGapBottom:re,pos:k,active:X});return"props"in S||Object.defineProperty(S,"props",{get:function(){return Object(pe.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),L}}),S}},"8EBN":function(Je,je,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 pe=0;pe<V.modeInfo.length;pe++){var oe=V.modeInfo[pe];if(oe.mime==xe)return oe;if(oe.mimes){for(var j=0;j<oe.mimes.length;j++)if(oe.mimes[j]==xe)return oe}}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 pe=0;pe<V.modeInfo.length;pe++){var oe=V.modeInfo[pe];if(oe.ext){for(var j=0;j<oe.ext.length;j++)if(oe.ext[j]==xe)return oe}}},V.findModeByFileName=function(xe){for(var pe=0;pe<V.modeInfo.length;pe++){var oe=V.modeInfo[pe];if(oe.file&&oe.file.test(xe))return oe}var j=xe.lastIndexOf("."),w=j>-1&&xe.substring(j+1,xe.length);if(w)return V.findModeByExtension(w)},V.findModeByName=function(xe){xe=xe.toLowerCase();for(var pe=0;pe<V.modeInfo.length;pe++){var oe=V.modeInfo[pe];if(oe.name.toLowerCase()==xe)return oe;if(oe.alias){for(var j=0;j<oe.alias.length;j++)if(oe.alias[j].toLowerCase()==xe)return oe}}}})},"8hTe":function(Je,je,h){Je.exports={button:"button___1wy9m"}},"9Bee":function(Je,je,h){"use strict";var V=h("DYRE"),ve=h("zeV3"),se=h("+L6B"),xe=h("2/Rp"),pe=h("k1fw"),oe=h("9og8"),j=h("tJVT"),w=h("WmNS"),T=h.n(w),O=h("q1tI"),N=h.n(O),A=h("vg9a"),te=h("DlQD"),B=h.n(te),L=h("rUJ1");function F(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 ie=Object(j.a)(c,1),Ye=ie[0];return Ye.length>=u.length?v.slice(u.length):v}).join(`
`)}var z=[],Y=["<ul>"],b=new B.a.Renderer,fe=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Re(){z.length=0,Y=["<ul>"]}var he={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function q(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=q(d,o,v.level,c),c.length>0&&(u.push("<ul>"),c.forEach(function(ie){u.push(ie)}),u.push("</ul>")),u.push("</li>"),o=q(d,o,r,u),o}function g(){return q(z,0,0,Y),Y.push("</ul>"),Y.join("")}var re={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=F(u,r[3]||""),c=r[2]?r[2].trim():r[2];if(["latex","katex","math"].indexOf(c)>=0){var ie=S(),Ye=v;v=ie,C[ie]={type:"block",expression:Ye}}return{type:"code",raw:u,lang:c,text:v}}}},k=/(?:\${2})([^\n`]+?)(?:\${2})/gi,X=0,S=function(){return"__special_katext_id_".concat(X++,"__")},C={};function J(){return C}function H(){X=0,C={}}function E(d){return d=d.replace(k,function(o,r){var u=S();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 W=b.tablecell;b.tablecell=function(d,o){return W(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 z.push({anchor:u,level:o,text:d}),"<h"+o+' id="'+u+'">'+d+"</h"+o+">"},B.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),B.a.use({tokenizer:re,renderer:b});var be=B.a,M=h("SJMd"),p=h("ulZh"),le=h.n(p),Ue=h("m3rI"),Pe=h("Oy/b"),He=h("p5ED"),Oe=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 Se=function(d,o){return(Se=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 $(d,o){function r(){this.constructor=d}Se(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 ie(Bt){try{_e(u.next(Bt))}catch(Ee){c(Ee)}}function Ye(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(ie,Ye)}_e((u=u.apply(d,o||[])).next())})}function ue(d,o){var r,u,v,c,ie={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return c={next:Ye(0),throw:Ye(1),return:Ye(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function Ye(_e){return function(Bt){return function(Ee){if(r)throw new TypeError("Generator is already executing.");for(;ie;)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 ie.label++,{value:Ee[1],done:!1};case 5:ie.label++,u=Ee[1],Ee=[0];continue;case 7:Ee=ie.ops.pop(),ie.trys.pop();continue;default:if(!(v=ie.trys,(v=v.length>0&&v[v.length-1])||Ee[0]!==6&&Ee[0]!==2)){ie=0;continue}if(Ee[0]===3&&(!v||Ee[1]>v[0]&&Ee[1]<v[3])){ie.label=Ee[1];break}if(Ee[0]===6&&ie.label<v[1]){ie.label=v[1],v=Ee;break}if(v&&ie.label<v[2]){ie.label=v[2],ie.ops.push(Ee);break}v[2]&&ie.ops.pop(),ie.trys.pop();continue}Ee=o.call(d,ie)}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 D(){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],ie=0,Ye=c.length;ie<Ye;ie++,v++)u[v]=c[ie];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],ie=c[0],Ye=c[1];o.setAttribute(ie,Ye)}},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 ie=document.createElementNS("http://www.w3.org/2000/svg","line");return ie.setAttribute("x1",o.toString()),ie.setAttribute("y1",r.toString()),ie.setAttribute("x2",u.toString()),ie.setAttribute("y2",v.toString()),c&&d.setAttributes(ie,c),ie},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,ie,Ye){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",ie.toString()]]),_e.appendChild(Ye),_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}(),me=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}(),Ie=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 ie=u!==void 0?u:document.createElement("canvas");o===null&&(v.markersOnly=!0,v.naturalSize=!1);var Ye=document.createElementNS("http://www.w3.org/2000/svg","svg");Ye.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ye.setAttribute("width",r.width.baseVal.valueAsString),Ye.setAttribute("height",r.height.baseVal.valueAsString),Ye.setAttribute("viewBox","0 0 "+r.viewBox.baseVal.width.toString()+" "+r.viewBox.baseVal.height.toString()),Ye.innerHTML=r.innerHTML,v.naturalSize===!0?(Ye.width.baseVal.value=o.naturalWidth,Ye.height.baseVal.value=o.naturalHeight):v.width!==void 0&&v.height!==void 0&&(Ye.width.baseVal.value=v.width,Ye.height.baseVal.value=v.height),ie.width=Ye.width.baseVal.value,ie.height=Ye.height.baseVal.value;var _e=Ye.outerHTML,Bt=ie.getContext("2d");v.markersOnly!==!0&&Bt.drawImage(o,0,0,ie.width,ie.height);var Ee=window.URL,ce=new Image(ie.width,ie.height);ce.setAttribute("crossOrigin","anonymous");var Xe=new Blob([_e],{type:"image/svg+xml"}),Tt=Ee.createObjectURL(Xe);ce.onload=function(){Bt.drawImage(ce,0,0),Ee.revokeObjectURL(Tt);var Mt=ie.toDataURL(v.imageType,v.imageQuality);c(Mt)},ce.src=Tt})},d}(),Ze=function(){},Me=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 Fe("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Fe("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Fe("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Te("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Te("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}(),Fe=function(d,o){this.selector=d,this.style=o},Te=function(d,o){this.localName=d,this.style=o},De=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 ie=document.createElement("div");ie.className=""+r.toolbarButtonStyleClass.name,ie.setAttribute("data-type-name",c.typeName),ie.innerHTML=c.icon,ie.addEventListener("click",function(){r.markerToolbarButtonClicked(ie,c)}),r.buttons.push(ie),r.markerButtons.push(ie)}),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 Te("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 Te("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Te("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Te("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 Te("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var o=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Te("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 Te("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Te("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Fe("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Fe("."+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}(),Qe=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 Te("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 Te("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var r=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Te("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Te("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Te("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 Te("toolbox-panel-row_colors",`
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Te("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 Te("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Te("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Fe("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Fe("."+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 ie;c.uiStyleSettings=v.uiStyleSettings;var Ye=document.createElement("div");Ye.className=v.toolboxButtonStyleClass.name+" "+((ie=v.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ie!==void 0?ie:v.toolboxButtonStyleColorsClass.name),Ye.innerHTML=c.icon,Ye.title=c.title,Ye.addEventListener("click",function(){v.panelButtonClick(c)}),v.panelButtons.push(Ye),v.buttonRow.appendChild(Ye)}),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,ie){var Ye,_e;c.className=r.toolboxButtonStyleClass.name+" "+(ie===u?""+((Ye=r.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ye!==void 0?Ye:r.toolboxActiveButtonStyleColorsClass.name):""+((_e=r.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&_e!==void 0?_e:r.toolboxButtonStyleColorsClass.name))})},d}(),tt=function(d,o){this.title=d,this.icon=o},ot=function(d){function o(r,u,v,c){var ie=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 ie.colors=[],ie.addTransparent=!1,ie.colorBoxes=[],ie.colors=u,ie.currentColor=v,ie.setCurrentColor=ie.setCurrentColor.bind(ie),ie.getColorBox=ie.getColorBox.bind(ie),ie}return $(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,ie=document.createElement("div");ie.style.display="inline-block",ie.style.boxSizing="content-box",ie.style.width=c-2+"px",ie.style.height=c-2+"px",ie.style.padding="1px",ie.style.marginRight="2px",ie.style.marginBottom="2px",ie.style.borderWidth="2px",ie.style.borderStyle="solid",ie.style.borderRadius=(c+2)/2+"px",ie.style.borderColor=r===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ie.addEventListener("click",function(){u.setCurrentColor(r,ie)});var Ye=document.createElement("div");return Ye.style.display="inline-block",Ye.style.width=c-2+"px",Ye.style.height=c-2+"px",Ye.style.backgroundColor=r,Ye.style.borderRadius=c/2+"px",r==="transparent"&&(Ye.style.fill=this.uiStyleSettings.toolboxAccentColor,Ye.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>`),ie.appendChild(Ye),ie},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}(tt),$e=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}(),Ke=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 $(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 ie=this.container.transform.baseVal.getItem(0);ie.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ie,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,ie=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,ie=this.manipulationStartHeight+this.manipulationStartTop-c;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ie=this.manipulationStartHeight+r.y-this.manipulationStartY}v>=0?(this.left=u,this.width=v):(this.left=u+v,this.width=-v),ie>=0?(this.top=c,this.height=ie):(this.top=c+ie,this.height=-ie),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 Ke,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,ie=(this.height+this.CB_DISTANCE)/2-r/2,Ye=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,ie),this.positionGrip(this.controlGrips.centerRight.visual,_e,ie),this.positionGrip(this.controlGrips.bottomLeft.visual,u,Ye),this.positionGrip(this.controlGrips.bottomCenter.visual,c,Ye),this.positionGrip(this.controlGrips.bottomRight.visual,_e,Ye),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}($e),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 $(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 ie=d.call(this,r,c||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ie.widths=[],ie.widthBoxes=[],ie.widths=u,ie.currentWidth=v,ie.setCurrentWidth=ie.setCurrentWidth.bind(ie),ie}return $(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 ie=document.createElement("div");ie.innerText=v.toString(),ie.style.marginRight="5px",c.appendChild(ie);var Ye=document.createElement("div");Ye.style.minHeight="20px",Ye.style.flexGrow="2",Ye.style.display="flex",Ye.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",Ye.appendChild(_e),c.appendChild(Ye),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}(tt),xt=function(d){function o(r,u,v,c){var ie=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 ie.styles=[],ie.styleBoxes=[],ie.styles=u,ie.currentStyle=v,ie.setCurrentStyle=ie.setCurrentStyle.bind(ie),ie}return $(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 ie=document.createElement("div");ie.style.minHeight="20px",ie.style.flexGrow="2",ie.style.overflow="hidden";var Ye=`<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>`;ie.innerHTML=Ye,c.appendChild(ie),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}(tt),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 $(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),Le=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 $(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}($e),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 $(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),Ne=function(d){function o(r,u,v,c){var ie=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 ie.fonts=[],ie.fontBoxes=[],ie.fonts=u,ie.currentFont=v,ie.setCurrentFont=ie.setCurrentFont.bind(ie),ie}return $(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 ie=document.createElement("div");ie.style.display="flex",ie.style.minHeight="20px",ie.style.flexGrow="2",ie.style.fontFamily=v,ie.style.overflow="hidden";var Ye=document.createElement("div");Ye.style.whiteSpace="nowrap",Ye.style.overflow="hidden",Ye.style.textOverflow="ellipsis",Ye.innerHTML="The quick brown fox jumps over the lazy dog",ie.appendChild(Ye),c.appendChild(ie),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}(tt),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 Ne("Font",v.defaultFontFamilies,v.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c}return $(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),G=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 $(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],ie=u[2],Ye=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>Ye&&(Ye=Bt),Ee>ie&&(ie=Ee));if(_e){this.left=v/this.pixelRatio,this.top=c/this.pixelRatio,this.width=(ie-v)/this.pixelRatio,this.height=(Ye-c)/this.pixelRatio;var ce=document.createElement("canvas");ce.width=ie-v,ce.height=Ye-c,ce.getContext("2d").putImageData(this.canvasContext.getImageData(v,c,ie-v,Ye-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),ee=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 $(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(Ye){var _e="both";switch(Ye){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 Xe=document.createElement("hr");if(Xe.style.minWidth="20px",Xe.style.border="0px",Xe.style.borderTop="3px solid "+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee"),Xe.style.flexGrow="2",ce.appendChild(Xe),Bt.appendChild(ce),_e==="both"||_e==="end"){var Tt=document.createElement("div");Tt.style.display="flex",Tt.style.alignItems="center",Tt.style.minHeight="20px",Tt.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>`,Tt.style.marginRight="5px",Bt.appendChild(Tt)}c.typeBoxes.push(Bt)},c=this,ie=0;ie<4;ie++)v(ie);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}(tt),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 ee("Arrow type","end"),c.arrowTypePanel.onArrowTypeChanged=c.setArrowType,c}return $(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 $(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 ie=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 ie.opacities=[],ie.opacityBoxes=[],ie.opacities=u,ie.currentOpacity=v,ie.setCurrentOpacity=ie.setCurrentOpacity.bind(ie),ie}return $(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 ie=document.createElement("div");ie.innerText=100*v+"%",c.appendChild(ie),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}(tt),U=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 $(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 Ne("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 $(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",D(v.defaultColorSet,["transparent"]),v.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.fillPanel=new ot("Fill color",D(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 $(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),ke=function(d){function o(r,u,v){return d.call(this,r,u,v)||this}return $(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 $(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 $(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 $(o,d),o}(lt),qe=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 $(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}(),et=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 Le,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 Me(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,G,Q,We,_t,Ce,U,de,ke,x,Rt,ge]},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[bt,G,Q,We,Ce,U,de]},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"BASIC_MARKER_TYPES",{get:function(){return[bt,G,Q,We,U]},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(),me.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 ue(this,function(r){switch(r.label){case 0:return this.setCurrentMarker(),(o=new Ie).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 De(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 Qe(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 qe(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 qe(o,u))})}}},d.prototype.clear=function(){var o=this,r=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ie){var Ye=new qe(o,void 0,!0);ie(Ye),Ye.defaultPrevented&&(r=!0)}),!r)){this.setCurrentMarker();for(var u=function(ie){var Ye=v.markers[ie];v.setCurrentMarker(v.markers[ie]),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 qe(o,Ye))})},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 ue(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(ie){return ie.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 qe(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 G&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(G):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(u){return u(new qe(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 qe(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 qe(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 qe(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){me.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 Ht=function(d,o){return(Ht=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}Ht(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 ie(Bt){try{_e(u.next(Bt))}catch(Ee){c(Ee)}}function Ye(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(ie,Ye)}_e((u=u.apply(d,o||[])).next())})}function $t(d,o){var r,u,v,c,ie={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return c={next:Ye(0),throw:Ye(1),return:Ye(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function Ye(_e){return function(Bt){return function(Ee){if(r)throw new TypeError("Generator is already executing.");for(;ie;)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 ie.label++,{value:Ee[1],done:!1};case 5:ie.label++,u=Ee[1],Ee=[0];continue;case 7:Ee=ie.ops.pop(),ie.trys.pop();continue;default:if(!(v=ie.trys,(v=v.length>0&&v[v.length-1])||Ee[0]!==6&&Ee[0]!==2)){ie=0;continue}if(Ee[0]===3&&(!v||Ee[1]>v[0]&&Ee[1]<v[3])){ie.label=Ee[1];break}if(Ee[0]===6&&ie.label<v[1]){ie.label=v[1],v=Ee;break}if(v&&ie.label<v[2]){ie.label=v[2],ie.ops.push(Ee);break}v[2]&&ie.ops.pop(),ie.trys.pop();continue}Ee=o.call(d,ie)}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}(),Be=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],ie=c[0],Ye=c[1];o.setAttribute(ie,Ye)}},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 ie=document.createElementNS("http://www.w3.org/2000/svg","line");return ie.setAttribute("x1",o.toString()),ie.setAttribute("y1",r.toString()),ie.setAttribute("x2",u.toString()),ie.setAttribute("y2",v.toString()),c&&d.setAttributes(ie,c),ie},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,ie,Ye){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",ie.toString()]]),_e.appendChild(Ye),_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,ie,Ye,_e){return"M"+o+","+r+"V"+(r+v)+"H"+(o+u)+"V"+r+"H"+c+"V"+ie+"H"+(c+Ye)+"V"+(ie+_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),ie=document.createElementNS("http://www.w3.org/2000/svg","svg");ie.setAttribute("xmlns","http://www.w3.org/2000/svg"),ie.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ie);var Ye=Be.createDefs();ie.appendChild(Ye);var _e=Be.createElement("clipPath",[["id","text-bg-clip"]]);Ye.appendChild(_e);var Bt=Be.createPath(Be.getHollowRectanglePath((24-v)/2,(24-c)/2,v,c,(24-v)/2+2,(24-c)/2+2,v-4,c-4));ie.appendChild(Bt);var Ee=Be.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ee.appendChild(Be.createTSpan(o+":"+r)),ie.appendChild(Ee);var ce=Ee.getBBox();Be.setAttributes(Ee,[["x",((24-ce.width)/2).toString()],["y",((24-ce.height)/2-ce.y).toString()]]);var Xe=Be.createPath(Be.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(Xe),Be.setAttributes(Bt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ie),ie.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=Be.createGroup(),this.visual.appendChild(Be.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Be.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 Be.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&&Be.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=Be.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Be.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var r=0;r<this.numberOfGridLines;r++)this.horizontalGridLines.push(Be.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Be.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=Be.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),Be.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,ie){var Ye=r.y+u*(ie+1);Be.setAttributes(c,[["x1",""+r.x],["y1",""+Ye],["x2",""+(r.x+r.width)],["y2",""+Ye]])});var v=r.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(c,ie){var Ye=r.x+v*(ie+1);Be.setAttributes(c,[["x1",""+Ye],["y1",""+r.y],["x2",""+Ye],["y2",""+(r.y+r.height)]])}),Be.setAttributes(this.cropShadeElement,[["d",Be.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,ie){var Ye=u/o,_e=v/r;return{x:(c.x-ie)*Ye+ie,y:(c.y-ie)*_e+ie,width:c.width*Ye,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();Be.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=Be.createPath(r);var c=Be.createTransform();this.scaleShape.transform.baseVal.appendItem(c),o.appendChild(this.scaleShape),this.angleLabelElement=Be.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Be.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ie=Be.createTSpan("");return ie.innerHTML="&deg;",this.angleLabelElement.appendChild(ie),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,ie,Ye){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,Xe=1;_e.naturalSize===!0?(ce=r.naturalWidth/(o.width.baseVal.value-2*v)/ie,Xe=r.naturalHeight/(o.height.baseVal.value-2*v)/Ye,Ee.width=r.naturalWidth/ie,Ee.height=r.naturalHeight/Ye):_e.width!==void 0&&_e.height!==void 0&&(ce=_e.width/u.width,Xe=_e.height/u.height,Ee.width*=ce,Ee.height*=Xe);var Tt=Ee.getContext("2d");Tt.translate(Ee.width/2,Ee.height/2),Tt.rotate(c*Math.PI/180),Tt.scale(ie,Ye),Tt.translate(-Ee.width/2,-Ee.height/2),Tt.drawImage(r,0,0,Ee.width,Ee.height);var Mt=document.createElement("canvas");Mt.width=u.width*ce,Mt.height=u.height*Xe,Mt.getContext("2d").putImageData(Tt.getImageData((u.x-v)*ce,(u.y-v)*Xe,u.width*ce,u.height*Xe),0,0),Bt(Mt.toDataURL(_e.imageType,_e.imageQuality))})},d}(),Ge=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",Be.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();Be.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=Be.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Be.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Be.createGroup(),this.editingTargetRotationScaleContainer=Be.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=Be.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var r=Be.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(r),this.editingTargetContainer=Be.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=Be.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(Xe){var Tt=new Gt(Nt.getIcon(Xe.horizontal,Xe.vertical),Xe.horizontal===0&&Xe.vertical===0?"FREE":Xe.horizontal+":"+Xe.vertical);Tt.onClick=function(){return o.ratioButtonClicked(Xe)},u.push(Tt)}),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 ie=new Ct;this.topToolbar.addElementBlock(ie);var Ye=document.createElement("div");Ye.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>',Ye.appendChild(_e),ie.addElement(Ye)}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 ie=new an;ie.minWidth=2*this.toolbarHeight+"px",ie.contentAlign="end",this.bottomToolbar.addButtonBlock(ie);var Ye=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");Ye.onClick=this.flipHorizontallyButtonClicked,ie.addButton(Ye);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,ie.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(),Be.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 Tn(d){var o=document.createElement("div");return o.innerHTML=d,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var Bn=je.a=function(d){var o=d.value,r=o===void 0?"":o,u=d.edit,v=u===void 0?!1:u,c=d.className,ie=d.showTextOnly,Ye=d.showLines,_e=d.replaces,Bt=d.zoomImg,Ee=d.hasMask,ce=d.style,Xe=ce===void 0?{}:ce,Tt=d.stylesPrev,Mt=Tt===void 0?{}:Tt,Ot=String(r),Dt=Object(O.useRef)(),cn=Object(O.useRef)(),Nn=Object(O.useState)(""),Cn=Object(j.a)(Nn,2),pn=Cn[0],Wn=Cn[1],jn=Object(O.useState)("office"),ti=Object(j.a)(jn,2),xi=ti[0],Fn=ti[1],Xn=function(){var yn=new Ge(cn.current);yn.displayMode="popup",yn.addRenderEventListener(function(){var di=Object(oe.a)(T.a.mark(function vn(ni){var An;return T.a.wrap(function(ii){for(;;)switch(ii.prev=ii.next){case 0:return Dt.current.style.display="none",ii.next=3,Object(Oe.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(Ue.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 et(cn.current);yn.settings.displayMode="popup",yn.addEventListener("render",function(){var di=Object(oe.a)(T.a.mark(function vn(ni){var An;return T.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(Oe.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(Ue.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(O.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;Ot=Ot.replace($n,"("+Ue.a.API_SERVER+"/api/attachments/").replace(yn,'"'+Ue.a.API_SERVER+"/api/attachments/").replace(di,'"'+Ue.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,`
`),Ot=Ot.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
`)}catch(Si){}var vn=be(Ot),ni=J();if(Ot.match(/\[TOC\]/)&&(vn=vn.replace("<p>[TOC]</p>",g()),Re()),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)(Tn(Ji)||"",{displayMode:Yi==="block",throwOnError:!1,output:"html"})}),vn=vn.replace(/▁/g,"\u2581\u2581\u2581"),H(),ie){var An=document.createElement("div");return An.innerHTML=vn,An.innerText}return setTimeout(function(){return la()},500),vn},[Ot]),wn=Object(O.useRef)();he.WebkitLineClamp=Ye,Ye&&(Xe=Object(pe.a)(Object(pe.a)({},Xe),he));function zi($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(le.a.isSupported()){var ni=new le.a;ni.loadSource(vn.src),ni.attachMedia(vn)}}})};Object(O.useEffect)(function(){if(wn.current&&ri&&(ri.match(gn)&&window.PR.prettyPrint()),wn.current)return wn.current.addEventListener("click",zi),function(){wn.current.removeEventListener("click",zi),H(),Re()}},[ri,wn.current,zi]);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 N.a.createElement("div",{style:{position:"relative"}},N.a.createElement("div",{ref:wn,style:Object(pe.a)({},Xe),className:"".concat(c||""," markdown-body ").concat(fn.a.mdBody),onMouseOver:ia,dangerouslySetInnerHTML:{__html:ri}}),N.a.createElement("div",{ref:Dt,className:fn.a.button},N.a.createElement(ve.a,null,N.a.createElement(xe.a,{onClick:function(){return Xn()}},"\u88C1\u526A"),N.a.createElement(xe.a,{onClick:function(){return $i()}},"\u7F16\u8F91"))),N.a.createElement("img",{ref:cn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),N.a.createElement(He.a,{close:!0,data:pn,hasMask:Ee,type:pn!=null&&pn.length?xi:"",style:Object(pe.a)({},Mt),onClose:function(){return Wn("")}}))}},"9VGf":function(Je,je,h){"use strict";h.d(je,"a",function(){return se});var V=h("q1tI"),ve=h.n(V);function se(xe,pe){var oe=Object(V.useRef)();Object(V.useEffect)(function(){oe.current=xe}),Object(V.useEffect)(function(){function j(){oe.current()}if(pe!==null){var w=setInterval(j,pe);return function(){return clearInterval(w)}}},[pe])}},"A+k2":function(Je,je,h){Je.exports={tabs:"tabs___2hYAP",active:"active___2Xkwd"}},Bd2K:function(Je,je,h){(function(V){V(h("VrN/"),h("osHv"))})(function(V){V.defineOption("autoCloseTags",!1,function(T,O,N){if(N!=V.Init&&N&&T.removeKeyMap("autoCloseTags"),!O)return;var A={name:"autoCloseTags"};(typeof O!="object"||O.whenClosing!==!1)&&(A["'/'"]=function(te){return oe(te)}),(typeof O!="object"||O.whenOpening!==!1)&&(A["'>'"]=function(te){return xe(te)}),T.addKeyMap(A)});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(T){if(T.getOption("disableInput"))return V.Pass;for(var O=T.listSelections(),N=[],A=T.getOption("autoCloseTags"),te=0;te<O.length;te++){if(!O[te].empty())return V.Pass;var B=O[te].head,L=T.getTokenAt(B),F=V.innerMode(T.getMode(),L.state),z=F.state,Y=F.mode.xmlCurrentTag&&F.mode.xmlCurrentTag(z),b=Y&&Y.name;if(!b)return V.Pass;var fe=F.mode.configuration=="html",Re=typeof A=="object"&&A.dontCloseTags||fe&&ve,he=typeof A=="object"&&A.indentTags||fe&&se;L.end>B.ch&&(b=b.slice(0,b.length-L.end+B.ch));var q=b.toLowerCase();if(!b||L.type=="string"&&(L.end!=B.ch||!/[\"\']/.test(L.string.charAt(L.string.length-1))||L.string.length==1)||L.type=="tag"&&Y.close||L.string.indexOf("/")==B.ch-L.start-1||Re&&j(Re,q)>-1||w(T,F.mode.xmlCurrentContext&&F.mode.xmlCurrentContext(z)||[],b,B,!0))return V.Pass;var g=typeof A=="object"&&A.emptyTags;if(g&&j(g,b)>-1){N[te]={text:"/>",newPos:V.Pos(B.line,B.ch+2)};continue}var re=he&&j(he,q)>-1;N[te]={indent:re,text:">"+(re?`
`:"")+"</"+b+">",newPos:re?V.Pos(B.line+1,0):V.Pos(B.line,B.ch+1)}}for(var k=typeof A=="object"&&A.dontIndentOnAutoClose,te=O.length-1;te>=0;te--){var X=N[te];T.replaceRange(X.text,O[te].head,O[te].anchor,"+insert");var S=T.listSelections().slice(0);S[te]={head:X.newPos,anchor:X.newPos},T.setSelections(S),!k&&X.indent&&(T.indentLine(X.newPos.line,null,!0),T.indentLine(X.newPos.line+1,null,!0))}}function pe(T,O){for(var N=T.listSelections(),A=[],te=O?"/":"</",B=T.getOption("autoCloseTags"),L=typeof B=="object"&&B.dontIndentOnSlash,F=0;F<N.length;F++){if(!N[F].empty())return V.Pass;var z=N[F].head,Y=T.getTokenAt(z),b=V.innerMode(T.getMode(),Y.state),fe=b.state;if(O&&(Y.type=="string"||Y.string.charAt(0)!="<"||Y.start!=z.ch-1))return V.Pass;var Re,he=b.mode.name!="xml"&&T.getMode().name=="htmlmixed";if(he&&b.mode.name=="javascript")Re=te+"script";else if(he&&b.mode.name=="css")Re=te+"style";else{var q=b.mode.xmlCurrentContext&&b.mode.xmlCurrentContext(fe);if(!q||q.length&&w(T,q,q[q.length-1],z))return V.Pass;Re=te+q[q.length-1]}T.getLine(z.line).charAt(Y.end)!=">"&&(Re+=">"),A[F]=Re}if(T.replaceSelections(A),N=T.listSelections(),!L)for(var F=0;F<N.length;F++)(F==N.length-1||N[F].head.line<N[F+1].head.line)&&T.indentLine(N[F].head.line)}function oe(T){return T.getOption("disableInput")?V.Pass:pe(T,!0)}V.commands.closeTag=function(T){return pe(T)};function j(T,O){if(T.indexOf)return T.indexOf(O);for(var N=0,A=T.length;N<A;++N)if(T[N]==O)return N;return-1}function w(T,O,N,A,te){if(!V.scanForClosingTag)return!1;var B=Math.min(T.lastLine()+1,A.line+500),L=V.scanForClosingTag(T,A,null,B);if(!L||L.tag!=N)return!1;for(var F=te?1:0,z=O.length-1;z>=0&&O[z]==N;z--)++F;A=L.to;for(var z=1;z<F;z++){var Y=V.scanForClosingTag(T,A,null,B);if(!Y||Y.tag!=N)return!1;A=Y.to}return!0}})},BjJ7:function(Je,je,h){"use strict";h.d(je,"d",function(){return ve}),h.d(je,"c",function(){return se}),h.d(je,"e",function(){return xe}),h.d(je,"b",function(){return pe}),h.d(je,"a",function(){return j});var V=h("m3rI");function ve(w){var T=!0;if(w.length>0){for(var O=0;O<w.length;O++)if(w[O].compile_success==0||!w[O].compile_success){T=!1;break}}else T=!1;return T}function se(w){for(var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",O=[],N=0;N<w.length;N++){var A=w[N],te=T?"".concat(T,"/").concat(A.name):"".concat(A.name);O.push({title:A.name,isLeaf:!(A.type==="tree"),key:te})}return O}function xe(w,T,O){for(var N=0;N<w.length;N++){var A=w[N];if(A.key===T){A.children=O;break}A.children&&xe(A.children,T,O)}return w}function pe(w,T,O){var N;return function(){var A=this,te=arguments,B=function(){N=null,O||w.apply(A,te)},L=O&&!N;clearTimeout(N),N=setTimeout(B,T),L&&w.apply(A,te)}}var oe=!0,j=V.a.API_SERVER},"C+DQ":function(Je,je,h){},D1Df:function(Je,je,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 W in ae)Object.prototype.hasOwnProperty.call(ae,W)&&(E[W]=ae[W])}return E},ve.apply(this,arguments)}function se(E,P){var ae=Object.keys(E);if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(E);P&&(W=W.filter(function(be){return Object.getOwnPropertyDescriptor(E,be).enumerable})),ae.push.apply(ae,W)}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(W){L(E,W,ae[W])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(ae)):se(ae).forEach(function(W){Object.defineProperty(E,W,Object.getOwnPropertyDescriptor(ae,W))})}return E}function pe(E,P){if(E==null)return{};var ae=oe(E,P),W,be;if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(E);for(be=0;be<M.length;be++){if(W=M[be],P.indexOf(W)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(E,W))continue;ae[W]=E[W]}}return ae}function oe(E,P){if(E==null)return{};var ae={},W=Object.keys(E),be,M;for(M=0;M<W.length;M++){if(be=W[M],P.indexOf(be)>=0)continue;ae[be]=E[be]}return ae}function j(E,P){if(!(E instanceof P))throw new TypeError("Cannot call a class as a function")}function w(E,P){for(var ae=0;ae<P.length;ae++){var W=P[ae];W.enumerable=W.enumerable||!1,W.configurable=!0,"value"in W&&(W.writable=!0),Object.defineProperty(E,W.key,W)}}function T(E,P,ae){return P&&w(E.prototype,P),ae&&w(E,ae),E}function O(E,P){return P&&(V(P)==="object"||typeof P=="function")?P:A(E)}function N(E){return N=Object.setPrototypeOf?Object.getPrototypeOf:function(ae){return ae.__proto__||Object.getPrototypeOf(ae)},N(E)}function A(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&&B(E,P)}function B(E,P){return B=Object.setPrototypeOf||function(W,be){return W.__proto__=be,W},B(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 F=h("q1tI"),z=h("17x9"),Y=h("H38U"),b=h("aRTE");function fe(E){for(var P="",ae=0;ae<E.length;ae++){var W=E.charCodeAt(ae);W<128?P+=String.fromCharCode(W):W<2048?(P+=String.fromCharCode(192|W>>6),P+=String.fromCharCode(128|W&63)):W<55296||W>=57344?(P+=String.fromCharCode(224|W>>12),P+=String.fromCharCode(128|W>>6&63),P+=String.fromCharCode(128|W&63)):(ae++,W=65536+((W&1023)<<10|E.charCodeAt(ae)&1023),P+=String.fromCharCode(240|W>>18),P+=String.fromCharCode(128|W>>12&63),P+=String.fromCharCode(128|W>>6&63),P+=String.fromCharCode(128|W&63))}return P}var Re={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},he={},q=4,g=.1;function re(E){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,ae=[];return E.forEach(function(W,be){var M=null;W.forEach(function(p,le){if(!p&&M!==null){ae.push("M".concat(M+P," ").concat(be+P,"h").concat(le-M,"v1H").concat(M+P,"z")),M=null;return}if(le===W.length-1){if(!p)return;M===null?ae.push("M".concat(le+P,",").concat(be+P," h1v1H").concat(le+P,"z")):ae.push("M".concat(M+P,",").concat(be+P," h").concat(le+1-M,"v1H").concat(M+P,"z"));return}p&&M===null&&(M=le)})}),ae.join("")}function k(E,P){return E.slice().map(function(ae,W){return W<P.y||W>=P.y+P.h?ae:ae.map(function(be,M){return M<P.x||M>=P.x+P.w?be:!1})})}function X(E,P){var ae=E.imageSettings,W=E.size,be=E.includeMargin;if(ae==null)return null;var M=be?q:0,p=P.length+M*2,le=Math.floor(W*g),Ue=p/W,Pe=(ae.width||le)*Ue,He=(ae.height||le)*Ue,Oe=ae.x==null?P.length/2-Pe/2:ae.x*Ue,Se=ae.y==null?P.length/2-He/2:ae.y*Ue,$=null;if(ae.excavate){var K=Math.floor(Oe),ue=Math.floor(Se),D=Math.ceil(Pe+Oe-K),_=Math.ceil(He+Se-ue);$={x:K,y:ue,w:D,h:_}}return{x:Oe,y:Se,h:He,w:Pe,excavation:$}}var S=function(){try{new Path2D().addPath(new Path2D)}catch(E){return!1}return!0}(),C=function(E){te(P,E);function P(){var ae,W;j(this,P);for(var be=arguments.length,M=new Array(be),p=0;p<be;p++)M[p]=arguments[p];return W=O(this,(ae=N(P)).call.apply(ae,[this].concat(M))),L(A(W),"_canvas",void 0),L(A(W),"_image",void 0),L(A(W),"state",{imgLoaded:!1}),L(A(W),"handleImageLoad",function(){W.setState({imgLoaded:!0})}),W}return T(P,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var W=this.props,be=W.value,M=W.size,p=W.level,le=W.bgColor,Ue=W.fgColor,Pe=W.includeMargin,He=W.imageSettings,Oe=new Y(-1,b[p]);if(Oe.addData(fe(be)),Oe.make(),this._canvas!=null){var Se=this._canvas,$=Se.getContext("2d");if(!$)return;var K=Oe.modules;if(K===null)return;var ue=Pe?q:0,D=K.length+ue*2,_=X(this.props,K);He!=null&&_!=null&&(_.excavation!=null&&(K=k(K,_.excavation)));var me=window.devicePixelRatio||1;Se.height=Se.width=M*me;var Ie=M/D*me;$.scale(Ie,Ie),$.fillStyle=le,$.fillRect(0,0,D,D),$.fillStyle=Ue,S?$.fill(new Path2D(re(K,ue))):K.forEach(function(Ze,Me){Ze.forEach(function(Fe,Te){Fe&&$.fillRect(Te+ue,Me+ue,1,1)})}),this.state.imgLoaded&&this._image&&_!=null&&$.drawImage(this._image,_.x+ue,_.y+ue,_.w,_.h)}}},{key:"render",value:function(){var W=this,be=this.props,M=be.value,p=be.size,le=be.level,Ue=be.bgColor,Pe=be.fgColor,He=be.style,Oe=be.includeMargin,Se=be.imageSettings,$=pe(be,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),K=xe({height:p,width:p},He),ue=null,D=Se&&Se.src;return Se!=null&&D!=null&&(ue=F.createElement("img",{src:D,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(me){return W._image=me}})),F.createElement(F.Fragment,null,F.createElement("canvas",ve({style:K,height:p,width:p,ref:function(me){return W._canvas=me}},$)),ue)}}]),P}(F.PureComponent);L(C,"defaultProps",Re);var J=function(E){te(P,E);function P(){return j(this,P),O(this,N(P).apply(this,arguments))}return T(P,[{key:"render",value:function(){var W=this.props,be=W.value,M=W.size,p=W.level,le=W.bgColor,Ue=W.fgColor,Pe=W.includeMargin,He=W.imageSettings,Oe=pe(W,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),Se=new Y(-1,b[p]);Se.addData(fe(be)),Se.make();var $=Se.modules;if($===null)return null;var K=Pe?q:0,ue=$.length+K*2,D=X(this.props,$),_=null;He!=null&&D!=null&&(D.excavation!=null&&($=k($,D.excavation)),_=F.createElement("image",{xlinkHref:He.src,height:D.h,width:D.w,x:D.x+K,y:D.y+K,preserveAspectRatio:"none"}));var me=re($,K);return F.createElement("svg",ve({shapeRendering:"crispEdges",height:M,width:M,viewBox:"0 0 ".concat(ue," ").concat(ue)},Oe),F.createElement("path",{fill:le,d:"M0,0 h".concat(ue,"v").concat(ue,"H0z")}),F.createElement("path",{fill:Ue,d:me}),_)}}]),P}(F.PureComponent);L(J,"defaultProps",Re);var H=function(P){var ae=P.renderAs,W=pe(P,["renderAs"]),be=ae==="svg"?J:C;return F.createElement(be,W)};H.defaultProps=xe({renderAs:"canvas"},Re),Je.exports=H},DlQD:function(Je,je,h){(function(V,ve){Je.exports=ve()})(this,function(){"use strict";function V(G,ee){for(var Q=0;Q<ee.length;Q++){var x=ee[Q];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(G,x.key,x)}}function ve(G,ee,Q){return ee&&V(G.prototype,ee),Q&&V(G,Q),G}function se(G,ee){if(!G)return;if(typeof G=="string")return xe(G,ee);var Q=Object.prototype.toString.call(G).slice(8,-1);if(Q==="Object"&&G.constructor&&(Q=G.constructor.name),Q==="Map"||Q==="Set")return Array.from(G);if(Q==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Q))return xe(G,ee)}function xe(G,ee){(ee==null||ee>G.length)&&(ee=G.length);for(var Q=0,x=new Array(ee);Q<ee;Q++)x[Q]=G[Q];return x}function pe(G,ee){var Q;if(typeof Symbol=="undefined"||G[Symbol.iterator]==null){if(Array.isArray(G)||(Q=se(G))||ee&&G&&typeof G.length=="number"){Q&&(G=Q);var x=0;return function(){return x>=G.length?{done:!0}:{done:!1,value:G[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=G[Symbol.iterator](),Q.next.bind(Q)}function oe(G,ee){return ee={exports:{}},G(ee,ee.exports),ee.exports}var j=oe(function(G){function ee(){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){G.exports.defaults=x}G.exports={defaults:ee(),getDefaults:ee,changeDefaults:Q}}),w=j.defaults,T=j.getDefaults,O=j.changeDefaults,N=/[&<>"']/,A=/[&<>"']/g,te=/[<>"']|&(?!#?\w+;)/,B=/[<>"']|&(?!#?\w+;)/g,L={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},F=function(ee){return L[ee]};function z(G,ee){if(ee){if(N.test(G))return G.replace(A,F)}else if(te.test(G))return G.replace(B,F);return G}var Y=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function b(G){return G.replace(Y,function(ee,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 Re(G,ee){G=G.source||G,ee=ee||"";var Q={replace:function(R,U){return U=U.source||U,U=U.replace(fe,"$1"),G=G.replace(R,U),Q},getRegex:function(){return new RegExp(G,ee)}};return Q}var he=/[^\w:]/g,q=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function g(G,ee,Q){if(G){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}ee&&!q.test(Q)&&(Q=C(ee,Q));try{Q=encodeURI(Q).replace(/%25/g,"%")}catch(R){return null}return Q}var re={},k=/^[^:]+:\/*[^/]*$/,X=/^([^:]+:)[\s\S]*$/,S=/^([^:]+:\/*[^/]*)[\s\S]*$/;function C(G,ee){re[" "+G]||(k.test(G)?re[" "+G]=G+"/":re[" "+G]=P(G,"/",!0)),G=re[" "+G];var Q=G.indexOf(":")===-1;return ee.substring(0,2)==="//"?Q?ee:G.replace(X,"$1")+ee:ee.charAt(0)==="/"?Q?ee:G.replace(S,"$1")+ee:G+ee}var J={exec:function(){}};function H(G){for(var ee=1,Q,x;ee<arguments.length;ee++){Q=arguments[ee];for(x in Q)Object.prototype.hasOwnProperty.call(Q,x)&&(G[x]=Q[x])}return G}function E(G,ee){var Q=G.replace(/\|/g,function(U,I,de){for(var Ce=!1,ke=I;--ke>=0&&de[ke]==="\\";)Ce=!Ce;return Ce?"|":" |"}),x=Q.split(/ \|/),R=0;if(x.length>ee)x.splice(ee);else for(;x.length<ee;)x.push("");for(;R<x.length;R++)x[R]=x[R].trim().replace(/\\\|/g,"|");return x}function P(G,ee,Q){var x=G.length;if(x===0)return"";for(var R=0;R<x;){var U=G.charAt(x-R-1);if(U===ee&&!Q)R++;else if(U!==ee&&Q)R++;else break}return G.substr(0,x-R)}function ae(G,ee){if(G.indexOf(ee[1])===-1)return-1;for(var Q=G.length,x=0,R=0;R<Q;R++)if(G[R]==="\\")R++;else if(G[R]===ee[0])x++;else if(G[R]===ee[1]&&(x--,x<0))return R;return-1}function W(G){G&&G.sanitize&&!G.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:z,unescape:b,edit:Re,cleanUrl:g,resolveUrl:C,noopTest:J,merge:H,splitCells:E,rtrim:P,findClosingBracket:ae,checkSanitizeDeprecation:W},M=j.defaults,p=be.rtrim,le=be.splitCells,Ue=be.escape,Pe=be.findClosingBracket;function He(G,ee,Q){var x=ee.href,R=ee.title?Ue(ee.title):null,U=G[1].replace(/\\([\[\]])/g,"$1");return G[0].charAt(0)!=="!"?{type:"link",raw:Q,href:x,title:R,text:U}:{type:"image",raw:Q,href:x,title:R,text:Ue(U)}}function Oe(G,ee){var Q=G.match(/^(\s+)(?:```)/);if(Q===null)return ee;var x=Q[1];return ee.split(`
`).map(function(R){var U=R.match(/^\s+/);if(U===null)return R;var I=U[0];return I.length>=x.length?R.slice(x.length):R}).join(`
`)}var Se=function(){function G(Q){this.options=Q||M}var ee=G.prototype;return ee.space=function(x){var R=this.rules.block.newline.exec(x);if(R)return R[0].length>1?{type:"space",raw:R[0]}:{raw:`
`}},ee.code=function(x,R){var U=this.rules.block.code.exec(x);if(U){var I=R[R.length-1];if(I&&I.type==="paragraph")return{raw:U[0],text:U[0].trimRight()};var de=U[0].replace(/^ {4}/gm,"");return{type:"code",raw:U[0],codeBlockStyle:"indented",text:this.options.pedantic?de:p(de,`
`)}}},ee.fences=function(x){var R=this.rules.block.fences.exec(x);if(R){var U=R[0],I=Oe(U,R[3]||"");return{type:"code",raw:U,lang:R[2]?R[2].trim():R[2],text:I}}},ee.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]}},ee.nptable=function(x){var R=this.rules.block.nptable.exec(x);if(R){var U={type:"table",header:le(R[1].replace(/^ *| *\| *$/g,"")),align:R[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:R[3]?R[3].replace(/\n$/,"").split(`
`):[],raw:R[0]};if(U.header.length===U.align.length){var I=U.align.length,de;for(de=0;de<I;de++)/^ *-+: *$/.test(U.align[de])?U.align[de]="right":/^ *:-+: *$/.test(U.align[de])?U.align[de]="center":/^ *:-+ *$/.test(U.align[de])?U.align[de]="left":U.align[de]=null;for(I=U.cells.length,de=0;de<I;de++)U.cells[de]=le(U.cells[de],U.header.length);return U}}},ee.hr=function(x){var R=this.rules.block.hr.exec(x);if(R)return{type:"hr",raw:R[0]}},ee.blockquote=function(x){var R=this.rules.block.blockquote.exec(x);if(R){var U=R[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:R[0],text:U}}},ee.list=function(x){var R=this.rules.block.list.exec(x);if(R){for(var U=R[0],I=R[2],de=I.length>1,Ce=I[I.length-1]===")",ke={type:"list",raw:U,ordered:de,start:de?+I.slice(0,-1):"",loose:!1,items:[]},_t=R[0].match(this.rules.block.item),at=!1,ge,lt,Et,qe,Ft,et,Ht,It=_t.length,vt=0;vt<It;vt++)ge=_t[vt],U=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)&&(qe=_t.slice(vt+1).join(`
`),ke.raw=ke.raw.substring(0,ke.raw.length-qe.length),vt=It-1)),Ft=at||/\n\n(?!\s*$)/.test(ge),vt!==It-1&&(at=ge.charAt(ge.length-1)===`
`,Ft||(Ft=at)),Ft&&(ke.loose=!0),et=/^\[[ xX]\] /.test(ge),Ht=void 0,et&&(Ht=ge[1]!==" ",ge=ge.replace(/^\[[ xX]\] +/,"")),ke.items.push({type:"list_item",raw:U,task:et,checked:Ht,loose:Ft,text:ge});return ke}},ee.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]):Ue(R[0]):R[0]}},ee.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 U=R[1].toLowerCase().replace(/\s+/g," ");return{tag:U,raw:R[0],href:R[2],title:R[3]}}},ee.table=function(x){var R=this.rules.block.table.exec(x);if(R){var U={type:"table",header:le(R[1].replace(/^ *| *\| *$/g,"")),align:R[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:R[3]?R[3].replace(/\n$/,"").split(`
`):[]};if(U.header.length===U.align.length){U.raw=R[0];var I=U.align.length,de;for(de=0;de<I;de++)/^ *-+: *$/.test(U.align[de])?U.align[de]="right":/^ *:-+: *$/.test(U.align[de])?U.align[de]="center":/^ *:-+ *$/.test(U.align[de])?U.align[de]="left":U.align[de]=null;for(I=U.cells.length,de=0;de<I;de++)U.cells[de]=le(U.cells[de].replace(/^ *\| *| *\| *$/g,""),U.header.length);return U}}},ee.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]}},ee.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]}},ee.text=function(x,R){var U=this.rules.block.text.exec(x);if(U){var I=R[R.length-1];return I&&I.type==="text"?{raw:U[0],text:U[0]}:{type:"text",raw:U[0],text:U[0]}}},ee.escape=function(x){var R=this.rules.inline.escape.exec(x);if(R)return{type:"escape",raw:R[0],text:Ue(R[1])}},ee.tag=function(x,R,U){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),!U&&/^<(pre|code|kbd|script)(\s|>)/i.test(I[0])?U=!0:U&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(I[0])&&(U=!1),{type:this.options.sanitize?"text":"html",raw:I[0],inLink:R,inRawBlock:U,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(I[0]):Ue(I[0]):I[0]}},ee.link=function(x){var R=this.rules.inline.link.exec(x);if(R){var U=Pe(R[2],"()");if(U>-1){var I=R[0].indexOf("!")===0?5:4,de=I+R[1].length+U;R[2]=R[2].substring(0,U),R[0]=R[0].substring(0,de).trim(),R[3]=""}var Ce=R[2],ke="";if(this.options.pedantic){var _t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ce);_t?(Ce=_t[1],ke=_t[3]):ke=""}else ke=R[3]?R[3].slice(1,-1):"";Ce=Ce.trim().replace(/^<([\s\S]*)>$/,"$1");var at=He(R,{href:Ce&&Ce.replace(this.rules.inline._escapes,"$1"),title:ke&&ke.replace(this.rules.inline._escapes,"$1")},R[0]);return at}},ee.reflink=function(x,R){var U;if((U=this.rules.inline.reflink.exec(x))||(U=this.rules.inline.nolink.exec(x))){var I=(U[2]||U[1]).replace(/\s+/g," ");if(I=R[I.toLowerCase()],!I||!I.href){var de=U[0].charAt(0);return{type:"text",raw:de,text:de}}var Ce=He(U,I,U[0]);return Ce}},ee.strong=function(x,R,U){U===void 0&&(U="");var I=this.rules.inline.strong.start.exec(x);if(I&&(!I[1]||I[1]&&(U===""||this.rules.inline.punctuation.exec(U)))){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)}}},ee.em=function(x,R,U){U===void 0&&(U="");var I=this.rules.inline.em.start.exec(x);if(I&&(!I[1]||I[1]&&(U===""||this.rules.inline.punctuation.exec(U)))){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)}}},ee.codespan=function(x){var R=this.rules.inline.code.exec(x);if(R){var U=R[2].replace(/\n/g," "),I=/[^ ]/.test(U),de=U.startsWith(" ")&&U.endsWith(" ");return I&&de&&(U=U.substring(1,U.length-1)),U=Ue(U,!0),{type:"codespan",raw:R[0],text:U}}},ee.br=function(x){var R=this.rules.inline.br.exec(x);if(R)return{type:"br",raw:R[0]}},ee.del=function(x){var R=this.rules.inline.del.exec(x);if(R)return{type:"del",raw:R[0],text:R[1]}},ee.autolink=function(x,R){var U=this.rules.inline.autolink.exec(x);if(U){var I,de;return U[2]==="@"?(I=Ue(this.options.mangle?R(U[1]):U[1]),de="mailto:"+I):(I=Ue(U[1]),de=I),{type:"link",raw:U[0],text:I,href:de,tokens:[{type:"text",raw:I,text:I}]}}},ee.url=function(x,R){var U;if(U=this.rules.inline.url.exec(x)){var I,de;if(U[2]==="@")I=Ue(this.options.mangle?R(U[0]):U[0]),de="mailto:"+I;else{var Ce;do Ce=U[0],U[0]=this.rules.inline._backpedal.exec(U[0])[0];while(Ce!==U[0]);I=Ue(U[0]),U[1]==="www."?de="http://"+I:de=I}return{type:"link",raw:U[0],text:I,href:de,tokens:[{type:"text",raw:I,text:I}]}}},ee.inlineText=function(x,R,U){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]):Ue(I[0]):I[0]:de=Ue(this.options.smartypants?U(I[0]):I[0]),{type:"text",raw:I[0],text:de}}},G}(),$=be.noopTest,K=be.edit,ue=be.merge,D={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:$,table:$,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};D._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,D._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,D.def=K(D.def).replace("label",D._label).replace("title",D._title).getRegex(),D.bullet=/(?:[*+-]|\d{1,9}[.)])/,D.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,D.item=K(D.item,"gm").replace(/bull/g,D.bullet).getRegex(),D.list=K(D.list).replace(/bull/g,D.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+D.def.source+")").getRegex(),D._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",D._comment=/<!--(?!-?>)[\s\S]*?-->/,D.html=K(D.html,"i").replace("comment",D._comment).replace("tag",D._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),D.paragraph=K(D._paragraph).replace("hr",D.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",D._tag).getRegex(),D.blockquote=K(D.blockquote).replace("paragraph",D.paragraph).getRegex(),D.normal=ue({},D),D.gfm=ue({},D.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*|$)"}),D.gfm.nptable=K(D.gfm.nptable).replace("hr",D.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",D._tag).getRegex(),D.gfm.table=K(D.gfm.table).replace("hr",D.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",D._tag).getRegex(),D.pedantic=ue({},D.normal,{html:K(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",D._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:$,paragraph:K(D.normal._paragraph).replace("hr",D.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",D.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var _={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:$,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:$,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",D._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=ue({},_),_.pedantic=ue({},_.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=ue({},_.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=ue({},_.gfm,{br:K(_.br).replace("{2,}","*").getRegex(),text:K(_.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var me={block:D,inline:_},Ie=j.defaults,Ze=me.block,Me=me.inline;function Fe(G){return G.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 Te(G){var ee="",Q,x,R=G.length;for(Q=0;Q<R;Q++)x=G.charCodeAt(Q),Math.random()>.5&&(x="x"+x.toString(16)),ee+="&#"+x+";";return ee}var De=function(){function G(Q){this.tokens=[],this.tokens.links=Object.create(null),this.options=Q||Ie,this.options.tokenizer=this.options.tokenizer||new Se,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var x={block:Ze.normal,inline:Me.normal};this.options.pedantic?(x.block=Ze.pedantic,x.inline=Me.pedantic):this.options.gfm&&(x.block=Ze.gfm,this.options.breaks?x.inline=Me.breaks:x.inline=Me.gfm),this.tokenizer.rules=x}G.lex=function(x,R){var U=new G(R);return U.lex(x)};var ee=G.prototype;return ee.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},ee.blockTokens=function(x,R,U){R===void 0&&(R=[]),U===void 0&&(U=!0),x=x.replace(/^ +$/gm,"");for(var I,de,Ce,ke;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):(ke=R[R.length-1],ke.raw+=`
`+I.raw,ke.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,[],U),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(U&&(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(U&&(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):(ke=R[R.length-1],ke.raw+=`
`+I.raw,ke.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},ee.inline=function(x){var R,U,I,de,Ce,ke,_t=x.length;for(R=0;R<_t;R++){ke=x[R];switch(ke.type){case"paragraph":case"text":case"heading":{ke.tokens=[],this.inlineTokens(ke.text,ke.tokens);break}case"table":{for(ke.tokens={header:[],cells:[]},de=ke.header.length,U=0;U<de;U++)ke.tokens.header[U]=[],this.inlineTokens(ke.header[U],ke.tokens.header[U]);for(de=ke.cells.length,U=0;U<de;U++)for(Ce=ke.cells[U],ke.tokens.cells[U]=[],I=0;I<Ce.length;I++)ke.tokens.cells[U][I]=[],this.inlineTokens(Ce[I],ke.tokens.cells[U][I]);break}case"blockquote":{this.inline(ke.tokens);break}case"list":{for(de=ke.items.length,U=0;U<de;U++)this.inline(ke.items[U].tokens);break}}}return x},ee.inlineTokens=function(x,R,U,I,de){R===void 0&&(R=[]),U===void 0&&(U=!1),I===void 0&&(I=!1),de===void 0&&(de="");var Ce,ke=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(ke))!=null;)at.includes(_t[0].slice(_t[0].lastIndexOf("[")+1,-1))&&(ke=ke.slice(0,_t.index)+"["+"a".repeat(_t[0].length-2)+"]"+ke.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(_t=this.tokenizer.rules.inline.blockSkip.exec(ke))!=null;)ke=ke.slice(0,_t.index)+"["+"a".repeat(_t[0].length-2)+"]"+ke.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,U,I)){x=x.substring(Ce.raw.length),U=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,ke,de)){x=x.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],U,I),R.push(Ce);continue}if(Ce=this.tokenizer.em(x,ke,de)){x=x.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],U,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,[],U,I),R.push(Ce);continue}if(Ce=this.tokenizer.autolink(x,Te)){x=x.substring(Ce.raw.length),R.push(Ce);continue}if(!U&&(Ce=this.tokenizer.url(x,Te))){x=x.substring(Ce.raw.length),R.push(Ce);continue}if(Ce=this.tokenizer.inlineText(x,I,Fe)){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(G,null,[{key:"rules",get:function(){return{block:Ze,inline:Me}}}]),G}(),Qe=j.defaults,tt=be.cleanUrl,ot=be.escape,$e=function(){function G(Q){this.options=Q||Qe}var ee=G.prototype;return ee.code=function(x,R,U){var I=(R||"").match(/\S*/)[0];if(this.options.highlight){var de=this.options.highlight(x,I);de!=null&&de!==x&&(U=!0,x=de)}return I?'<pre><code class="'+this.options.langPrefix+ot(I,!0)+'">'+(U?x:ot(x,!0))+`</code></pre>
`:"<pre><code>"+(U?x:ot(x,!0))+`</code></pre>
`},ee.blockquote=function(x){return`<blockquote>
`+x+`</blockquote>
`},ee.html=function(x){return x},ee.heading=function(x,R,U,I){return this.options.headerIds?"<h"+R+' id="'+this.options.headerPrefix+I.slug(U)+'">'+x+"</h"+R+`>
`:"<h"+R+">"+x+"</h"+R+`>
`},ee.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ee.list=function(x,R,U){var I=R?"ol":"ul",de=R&&U!==1?' start="'+U+'"':"";return"<"+I+de+`>
`+x+"</"+I+`>
`},ee.listitem=function(x){return"<li>"+x+`</li>
`},ee.checkbox=function(x){return"<input "+(x?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ee.paragraph=function(x){return"<p>"+x+`</p>
`},ee.table=function(x,R){return R&&(R="<tbody>"+R+"</tbody>"),`<table>
<thead>
`+x+`</thead>
`+R+`</table>
`},ee.tablerow=function(x){return`<tr>
`+x+`</tr>
`},ee.tablecell=function(x,R){var U=R.header?"th":"td",I=R.align?"<"+U+' align="'+R.align+'">':"<"+U+">";return I+x+"</"+U+`>
`},ee.strong=function(x){return"<strong>"+x+"</strong>"},ee.em=function(x){return"<em>"+x+"</em>"},ee.codespan=function(x){return"<code>"+x+"</code>"},ee.br=function(){return this.options.xhtml?"<br/>":"<br>"},ee.del=function(x){return"<del>"+x+"</del>"},ee.link=function(x,R,U){if(x=tt(this.options.sanitize,this.options.baseUrl,x),x===null)return U;var I='<a href="'+ot(x)+'"';return R&&(I+=' title="'+R+'"'),I+=">"+U+"</a>",I},ee.image=function(x,R,U){if(x=tt(this.options.sanitize,this.options.baseUrl,x),x===null)return U;var I='<img src="'+x+'" alt="'+U+'"';return R&&(I+=' title="'+R+'"'),I+=this.options.xhtml?"/>":">",I},ee.text=function(x){return x},G}(),Ke=function(){function G(){}var ee=G.prototype;return ee.strong=function(x){return x},ee.em=function(x){return x},ee.codespan=function(x){return x},ee.del=function(x){return x},ee.html=function(x){return x},ee.text=function(x){return x},ee.link=function(x,R,U){return""+U},ee.image=function(x,R,U){return""+U},ee.br=function(){return""},G}(),At=function(){function G(){this.seen={}}var ee=G.prototype;return ee.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 U=R;do this.seen[U]++,R=U+"-"+this.seen[U];while(this.seen.hasOwnProperty(R))}return this.seen[R]=0,R},G}(),gt=j.defaults,kt=be.unescape,ct=function(){function G(Q){this.options=Q||gt,this.options.renderer=this.options.renderer||new $e,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ke,this.slugger=new At}G.parse=function(x,R){var U=new G(R);return U.parse(x)};var ee=G.prototype;return ee.parse=function(x,R){R===void 0&&(R=!0);var U="",I,de,Ce,ke,_t,at,ge,lt,Et,qe,Ft,et,Ht,It,vt,$t,Lt,Be,ut=x.length;for(I=0;I<ut;I++){qe=x[I];switch(qe.type){case"space":continue;case"hr":{U+=this.renderer.hr();continue}case"heading":{U+=this.renderer.heading(this.parseInline(qe.tokens),qe.depth,kt(this.parseInline(qe.tokens,this.textRenderer)),this.slugger);continue}case"code":{U+=this.renderer.code(qe.text,qe.lang,qe.escaped);continue}case"table":{for(lt="",ge="",ke=qe.header.length,de=0;de<ke;de++)ge+=this.renderer.tablecell(this.parseInline(qe.tokens.header[de]),{header:!0,align:qe.align[de]});for(lt+=this.renderer.tablerow(ge),Et="",ke=qe.cells.length,de=0;de<ke;de++){for(at=qe.tokens.cells[de],ge="",_t=at.length,Ce=0;Ce<_t;Ce++)ge+=this.renderer.tablecell(this.parseInline(at[Ce]),{header:!1,align:qe.align[Ce]});Et+=this.renderer.tablerow(ge)}U+=this.renderer.table(lt,Et);continue}case"blockquote":{Et=this.parse(qe.tokens),U+=this.renderer.blockquote(Et);continue}case"list":{for(Ft=qe.ordered,et=qe.start,Ht=qe.loose,ke=qe.items.length,Et="",de=0;de<ke;de++)vt=qe.items[de],$t=vt.checked,Lt=vt.task,It="",vt.task&&(Be=this.renderer.checkbox($t),Ht?vt.tokens.length>0&&vt.tokens[0].type==="text"?(vt.tokens[0].text=Be+" "+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=Be+" "+vt.tokens[0].tokens[0].text)):vt.tokens.unshift({type:"text",text:Be}):It+=Be),It+=this.parse(vt.tokens,Ht),Et+=this.renderer.listitem(It,Lt,$t);U+=this.renderer.list(Et,Ft,et);continue}case"html":{U+=this.renderer.html(qe.text);continue}case"paragraph":{U+=this.renderer.paragraph(this.parseInline(qe.tokens));continue}case"text":{for(Et=qe.tokens?this.parseInline(qe.tokens):qe.text;I+1<ut&&x[I+1].type==="text";)qe=x[++I],Et+=`
`+(qe.tokens?this.parseInline(qe.tokens):qe.text);U+=R?this.renderer.paragraph(Et):Et;continue}default:{var nt='Token with "'+qe.type+'" type was not found.';if(this.options.silent){console.error(nt);return}else throw new Error(nt)}}}return U},ee.parseInline=function(x,R){R=R||this.renderer;var U="",I,de,Ce=x.length;for(I=0;I<Ce;I++){de=x[I];switch(de.type){case"escape":{U+=R.text(de.text);break}case"html":{U+=R.html(de.text);break}case"link":{U+=R.link(de.href,de.title,this.parseInline(de.tokens,R));break}case"image":{U+=R.image(de.href,de.title,de.text);break}case"strong":{U+=R.strong(this.parseInline(de.tokens,R));break}case"em":{U+=R.em(this.parseInline(de.tokens,R));break}case"codespan":{U+=R.codespan(de.text);break}case"br":{U+=R.br();break}case"del":{U+=R.del(this.parseInline(de.tokens,R));break}case"text":{U+=R.text(de.text);break}default:{var ke='Token with "'+de.type+'" type was not found.';if(this.options.silent){console.error(ke);return}else throw new Error(ke)}}}return U},G}(),Pt=be.merge,xt=be.checkSanitizeDeprecation,bt=be.escape,Le=j.getDefaults,Ut=j.changeDefaults,Rt=j.defaults;function Ne(G,ee,Q){if(typeof G=="undefined"||G===null)throw new Error("marked(): input parameter is undefined or null");if(typeof G!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(G)+", string expected");if(typeof ee=="function"&&(Q=ee,ee=null),ee=Pt({},Ne.defaults,ee||{}),xt(ee),Q){var x=ee.highlight,R;try{R=De.lex(G,ee)}catch(Ce){return Q(Ce)}var U=function(ke){var _t;if(!ke)try{_t=ct.parse(R,ee)}catch(at){ke=at}return ee.highlight=x,ke?Q(ke):Q(null,_t)};if(!x||x.length<3)return U();if(delete ee.highlight,!R.length)return U();var I=0;Ne.walkTokens(R,function(Ce){Ce.type==="code"&&(I++,setTimeout(function(){x(Ce.text,Ce.lang,function(ke,_t){if(ke)return U(ke);_t!=null&&_t!==Ce.text&&(Ce.text=_t,Ce.escaped=!0),I--,I===0&&U()})},0))}),I===0&&U();return}try{var de=De.lex(G,ee);return ee.walkTokens&&Ne.walkTokens(de,ee.walkTokens),ct.parse(de,ee)}catch(Ce){if(Ce.message+=`
Please report this to https://github.com/markedjs/marked.`,ee.silent)return"<p>An error occurred:</p><pre>"+bt(Ce.message+"",!0)+"</pre>";throw Ce}}Ne.options=Ne.setOptions=function(G){return Pt(Ne.defaults,G),Ut(Ne.defaults),Ne},Ne.getDefaults=Le,Ne.defaults=Rt,Ne.use=function(G){var ee=Pt({},G);if(G.renderer&&function(){var x=Ne.defaults.renderer||new $e,R=function(de){var Ce=x[de];x[de]=function(){for(var ke=arguments.length,_t=new Array(ke),at=0;at<ke;at++)_t[at]=arguments[at];var ge=G.renderer[de].apply(x,_t);return ge===!1&&(ge=Ce.apply(x,_t)),ge}};for(var U in G.renderer)R(U);ee.renderer=x}(),G.tokenizer&&function(){var x=Ne.defaults.tokenizer||new Se,R=function(de){var Ce=x[de];x[de]=function(){for(var ke=arguments.length,_t=new Array(ke),at=0;at<ke;at++)_t[at]=arguments[at];var ge=G.tokenizer[de].apply(x,_t);return ge===!1&&(ge=Ce.apply(x,_t)),ge}};for(var U in G.tokenizer)R(U);ee.tokenizer=x}(),G.walkTokens){var Q=Ne.defaults.walkTokens;ee.walkTokens=function(x){G.walkTokens(x),Q&&Q(x)}}Ne.setOptions(ee)},Ne.walkTokens=function(G,ee){for(var Q=pe(G),x;!(x=Q()).done;){var R=x.value;ee(R);switch(R.type){case"table":{for(var U=pe(R.tokens.header),I;!(I=U()).done;){var de=I.value;Ne.walkTokens(de,ee)}for(var Ce=pe(R.tokens.cells),ke;!(ke=Ce()).done;)for(var _t=ke.value,at=pe(_t),ge;!(ge=at()).done;){var lt=ge.value;Ne.walkTokens(lt,ee)}break}case"list":{Ne.walkTokens(R.items,ee);break}default:R.tokens&&Ne.walkTokens(R.tokens,ee)}}},Ne.Parser=ct,Ne.parser=ct.parse,Ne.Renderer=$e,Ne.TextRenderer=Ke,Ne.Lexer=De,Ne.lexer=De.lex,Ne.Tokenizer=Se,Ne.Slugger=At,Ne.parse=Ne;var We=Ne;return We})},"Dvv+":function(Je,je,h){"use strict";h.r(je);var V=h("cWXX"),ve=h("/ezw"),se=h("+L6B"),xe=h("2/Rp"),pe=h("7Kak"),oe=h("9yH6"),j=h("giR+"),w=h("fyUT"),T=h("9og8"),O=h("k1fw"),N=h("y8nQ"),A=h("Vl3Y"),te=h("tJVT"),B=h("5NDa"),L=h("5rEg"),F=h("WmNS"),z=h.n(F),Y=h("q1tI"),b=h.n(Y),fe=h("Ty5D"),Re=h("9kvl"),he=h("m3fD"),q=h.n(he),g=h("A+k2"),re=h.n(g),k=function(de){var Ce=de.value,ke=Ce===void 0?[]:Ce,_t=de.onChange,at=de.className,ge=at===void 0?"":at;return b.a.createElement("div",{className:"".concat(re.a.tabs," ").concat(ge," ")},b.a.createElement("div",{onClick:function(){return _t(0)},className:ke===0?re.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:ke===1?re.a.active:""},b.a.createElement("div",null,"2"),b.a.createElement("div",null,"\u914D\u7F6E\u7EC4\u5377")))},X=k,S=h("2qtc"),C=h("kLXV"),J=h("sRBo"),H=h("kaz8"),E=h("5Dmo"),P=h("3S7+"),ae=h("miYZ"),W=h("tsqr"),be=h("oBTY"),M=h("IlMy"),p=h.n(M),le=h("WCUW"),Ue=h("QSKd"),Pe=h.n(Ue),He=h("Hfvn"),Oe=h.n(He),Se=h("HPRh"),$=h.n(Se),K=h("+RXH"),ue=h.n(K),D=h("+yhJ"),_=h.n(D),me=h("RZ/O"),Ie=h.n(me),Ze=h("exQ7"),Me=h.n(Ze),Fe=h("HG2Q"),Te=h.n(Fe),De=h("k4n4"),Qe=h("eS0+"),tt=h("PpiC"),ot=h("K5AI"),$e=h.n(ot),Ke=h("LvDl"),At=H.a.Group,gt=function(de){var Ce=de.value,ke=Ce===void 0?[]:Ce,_t=de.onChange,at=de.options,ge=de.search,lt=Object(tt.a)(de,["value","onChange","options","search"]),Et=b.a.useState(!1),qe=Object(te.a)(Et,2),Ft=qe[0],et=qe[1];Object(Y.useEffect)(function(){var Lt,Be=at==null||((Lt=at.tag_disciplines)===null||Lt===void 0)?void 0:Lt.map(function(nt){return nt.id}),ut=ke==null?void 0:ke.filter(function(nt){return Be.includes(nt)});et(ut.length===(Be==null?void 0:Be.length))},[ke]);var Ht=function(Be){var ut,nt,dt=at==null||((ut=at.tag_disciplines)===null||ut===void 0)?void 0:ut.map(function(Gt){return Gt.id}),Kt=ke==null?void 0:ke.filter(function(Gt){return dt.includes(Gt)}),Vt=Object(Ke.uniq)([].concat(Object(be.a)(ke),Object(be.a)(Be)));if(Kt.length>Be.length){var an=Object(Ke.xor)(Kt,Be);console.log(an,"newLevel"),Vt=Vt.filter(function(Gt){return!an.includes(Gt)})}_t(Vt),et(Be.length===(at==null||((nt=at.tag_disciplines)===null||nt===void 0)?void 0:nt.length))},It=function(Be){var ut,nt=at==null||((ut=at.tag_disciplines)===null||ut===void 0)?void 0:ut.map(function(dt){return dt.id});_t(Be.target.checked?Object(Ke.uniq)([].concat(Object(be.a)(ke),Object(be.a)(nt))):ke==null?void 0:ke.filter(function(dt){return!nt.includes(dt)})),et(Be.target.checked)};console.log(at,"options");var vt=function(){var Be,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=(Be=nt)===null||Be===void 0?void 0:Be.map(function(Kt){return Object(O.a)(Object(O.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 Be=!1;if(!ge)Be=!0;else{var ut;(ut=at.tag_disciplines)===null||ut===void 0||ut.forEach(function(nt){if(!Be){var dt;Be=((dt=nt.name)===null||dt===void 0?void 0:dt.includes(ge))&&nt.item_count!==0}})}return Be};return(at==null?void 0:at.item_count)===0||!$t()?b.a.createElement(b.a.Fragment,null):b.a.createElement("div",{className:$e.a.cInput},b.a.createElement("div",{className:$e.a.cl},b.a.createElement(H.a,{checked:Ft,onChange:It},b.a.createElement("span",{className:$e.a.box},b.a.createElement("span",{className:"font14 c-light-primary"},b.a.createElement("span",{title:at==null?void 0:at.name,className:$e.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:$e.a.cr},b.a.createElement(At,{options:vt(),value:ke,onChange:Ht})))},kt=gt,ct=h("ErOA"),Pt=h("ozfa"),xt=h("MJZm"),bt=h("0Owb"),Le=h("tmPe"),Ut=h.n(Le),Rt=function(de){var Ce=de.value,ke=de.onChange,_t=de.defaultValue,at=de.treeData,ge=at===void 0?[]:at,lt=Object(tt.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:ke},lt)))},Ne=Rt,We=h("sbIO"),G=L.a.Search,ee=function(de){var Ce,ke=de.formValue,_t=de.setFatherTabs,at=de.tabs,ge=de.editData,lt=de.dispatch,Et=Object(fe.i)().id,qe=Object(Y.useState)(["mine"]),Ft=Object(te.a)(qe,2),et=Ft[0],Ht=Ft[1],It=Object(Y.useState)(!0),vt=Object(te.a)(It,2),$t=vt[0],Lt=vt[1],Be=Object(Y.useState)(!1),ut=Object(te.a)(Be,2),nt=ut[0],dt=ut[1],Kt=Object(Y.useState)(!1),Vt=Object(te.a)(Kt,2),an=Vt[0],Gt=Vt[1],Ct=Object(Y.useState)(""),tn=Object(te.a)(Ct,2),Nt=tn[0],ln=tn[1],Xt=Object(Y.useState)(!1),hn=Object(te.a)(Xt,2),Kn=hn[0],nn=hn[1],Ge=Object(Y.useState)(!1),st=Object(te.a)(Ge,2),fn=st[0],gn=st[1],Tn=Object(Y.useState)({}),Bn=Object(te.a)(Tn,2),d=Bn[0],o=Bn[1],r=Object(Y.useState)([]),u=Object(te.a)(r,2),v=u[0],c=u[1],ie=Object(Y.useState)([]),Ye=Object(te.a)(ie,2),_e=Ye[0],Bt=Ye[1],Ee=Object(Y.useState)([]),ce=Object(te.a)(Ee,2),Xe=ce[0],Tt=ce[1],Mt=Object(Y.useState)([]),Ot=Object(te.a)(Mt,2),Dt=Ot[0],cn=Ot[1],Nn=Object(Y.useState)(null),Cn=Object(te.a)(Nn,2),pn=Cn[0],Wn=Cn[1],jn=Object(Y.useRef)([]),ti=Object(Y.useState)(!1),xi=Object(te.a)(ti,2),Fn=xi[0],Xn=xi[1],$i=Object(Y.useState)([]),ri=Object(te.a)($i,2),wn=ri[0],zi=ri[1],la=Object(Y.useState)([0]),ia=Object(te.a)(la,2),$n=ia[0],yn=ia[1],di=Object(Y.useState)([]),vn=Object(te.a)(di,2),ni=vn[0],An=vn[1],Si=Object(Y.useRef)([]),ii=Object(Y.useState)(!1),Zn=Object(te.a)(ii,2),Yi=Zn[0],Ji=Zn[1],aa=Object(Y.useState)([]),Sa=Object(te.a)(aa,2),Sn=Sa[0],Qi=Sa[1],Oi=Object(Y.useState)([]),ua=Object(te.a)(Oi,2),Pi=ua[0],oa=ua[1],ra=Object(Y.useRef)([]),eo=Object(Y.useState)([]),to=Object(te.a)(eo,2),Oo=to[0],no=to[1],Ia=Object(Y.useState)(!1),zt=Object(te.a)(Ia,2),qt=zt[0],Jt=zt[1],rn=Object(Y.useRef)([]),mn=Object(Y.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(Y.useEffect)(function(){hi()},[]),Object(Y.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(Y.useEffect)(function(){Et?ge&&On():(da(et),ma(),Lt(!1))},[ge]),Object(Y.useEffect)(function(){Nt&&ca()},[Nt]);var ca=function(){var rt=null;_e==null||_e.forEach(function(ze){var Ae;(Ae=ze.sub_disciplines)===null||Ae===void 0||Ae.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=ze.id)})})}),rt&&Wn(rt)},kn=function(rt){function ze(Ae){var mt=Ae.children,ft=Array.isArray(mt)&&mt.length>0,yt=Ae==null?void 0:Ae.group_id;return rn.current.push({name:Ae==null?void 0:Ae.name,id:yt,count:Ae==null?void 0:Ae.count}),{title:b.a.createElement("div",{title:Ae==null?void 0:Ae.name,className:p.a.name},Ae==null?void 0:Ae.name,"\uFF08".concat(Ae==null?void 0:Ae.count,"\uFF09")),value:yt,name:Ae==null?void 0:Ae.name,key:yt,count:Ae==null?void 0:Ae.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 ze(Qt)}):[]}}return rt==null?void 0:rt.map(function(Ae){return ze(Ae)})},hi=function(){var pt=Object(T.a)(z.a.mark(function rt(){var ze,Ae;return z.a.wrap(function(ft){for(;;)switch(ft.prev=ft.next){case 0:return ft.next=2,Object(le.x)({});case 2:ze=ft.sent,rn.current=[{id:0,name:"\u6839\u76EE\u5F55",count:ze==null?void 0:ze.root_count}],ze!=null&&ze.data&&(Ae=[{title:b.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:p.a.name},"\u6839\u76EE\u5F55","\uFF08".concat((ze==null?void 0:ze.root_count)||0,"\uFF09")),value:0,id:0,key:0,count:ze==null?void 0:ze.root_count,name:"\u6839\u76EE\u5F55",icon:b.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:kn(ze.data||[])}],An(rn.current),no(Ae));case 5:case"end":return ft.stop()}},rt)}));return function(){return pt.apply(this,arguments)}}(),On=function(){var pt=Object(T.a)(z.a.mark(function rt(){var ze,Ae,mt,ft,yt,Qt,on,Pn,xn,Ln,En,ai,zn,Hn,pi,si,qn,mi;return z.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return Ln=ge==null||((ze=ge.tag_disciplines)===null||ze===void 0)?void 0:ze.map(function(bn){return bn.tag_discipline_id}),En=ge==null||((Ae=ge.groups)===null||Ae===void 0)?void 0:Ae.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(zn=en.sent,!((zn==null?void 0:zn.status)===-1)){en.next=8;break}return en.abrupt("return");case 8:Hn=zn==null?void 0:zn.filter(function(bn){var Jn;return!!(bn!=null&&(Jn=bn.item_banks)!==null&&Jn!==void 0&&Jn.length)}),Hn=Hn.map(function(bn){return Object(O.a)(Object(O.a)({},bn),{},{scoreTotal:0,score:0,questionTotal:0})}),Hn=(ft=Hn)===null||ft===void 0?void 0:ft.map(function(bn,Jn){var gi,li,Mi;return Object(O.a)(Object(O.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(O.a)(Object(O.a)({},Li),{},{tag_disciplines:Li==null||((Un=Li.tag_disciplines)===null||Un===void 0)?void 0:Un.map(function(Vn){var vi;return Object(O.a)(Object(O.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(O.a)(Object(O.a)({},ki),{},{num:yi==null?void 0:yi.quanlity}):Object(O.a)({},ki)})})})})})})}),pi=ka(Hn),si=pi.panel,qn=pi.score_num_item,Hn=(yt=Hn)===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(O.a)(Object(O.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=Hn.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(Ke.compact)(mi),da(ge==null||((on=ge.examination_bank)===null||on===void 0)?void 0:on.source),ma(),Ht(ge==null||((Pn=ge.examination_bank)===null||Pn===void 0)?void 0:Pn.source),cn(Ln),jn.current=Ln,zi(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(Ke.cloneDeep)(mi)),Lt(!1);case 29:case"end":return en.stop()}},rt)}));return function(){return pt.apply(this,arguments)}}(),Hi=function(){var pt=Object(T.a)(z.a.mark(function rt(){var ze;return z.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:ze={source:et,group_ids:wn,tag_discipline_ids:Dt,teach_group_ids:Sn},ha(ze),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(T.a)(z.a.mark(function rt(ze){var Ae,mt,ft,yt,Qt,on;return z.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:ze}});case 2:ft=xn.sent,yt=[],ft==null||((Ae=ft.disciplines)===null||Ae===void 0)||Ae.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(zn,Hn){return zn+Hn.item_count},0);return!Qt&&ai!==0&&(Qt=Ln.id),Object(O.a)(Object(O.a)({},Ln),{},{item_count:ai})}),console.log(on,48767874),Bt(on),Tt(yt),Wn(Qt);case 11:case"end":return xn.stop()}},rt)}));return function(ze){return pt.apply(this,arguments)}}(),ma=function(){var pt=Object(T.a)(z.a.mark(function rt(){var ze;return z.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:ze=mt.sent,oa((ze==null?void 0:ze.groups)||[]);case 4:case"end":return mt.stop()}},rt)}));return function(){return pt.apply(this,arguments)}}(),ha=function(){var pt=Object(T.a)(z.a.mark(function rt(ze){var Ae,mt;return z.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:ze});case 3:Ae=yt.sent,mt=Ae==null?void 0:Ae.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(O.a)(Object(O.a)({},Qt),{},{scoreTotal:0,score:0,questionTotal:0})}),c(mt),Lt(!1);case 8:case"end":return yt.stop()}},rt)}));return function(ze){return pt.apply(this,arguments)}}(),Po=function(){cn(jn.current),nn(!1),ln("")},er=function(rt){cn(rt)},io=function(){for(var rt=Xe==null?void 0:Xe.filter(function(Pn){return Dt==null?void 0:Dt.includes(Pn.id)}),ze=Object(be.a)(rt),Ae=0,mt=[],ft=0;ft<ze.length;ft++){for(var yt="",Qt=0;Qt<mt.length;Qt++)if(mt[Qt][0].parent_name==ze[ft].parent_name){Ae=1,yt=Qt;break}if(Ae==1)mt[yt].push(ze[ft]),Ae=0;else if(Ae==0){var on=new Array;on.push(ze[ft]),mt.push(on)}}return mt},Ao=function(rt,ze){var Ae,mt,ft=Object(Ke.cloneDeep)(v);ft[ze]=rt;var yt=ka([ft[ze]]),Qt=yt==null||((Ae=yt.panel)===null||Ae===void 0||((mt=Ae[0])===null||mt===void 0))?void 0:mt.reduce(function(Pn,xn){return Pn+xn},0);ft[ze].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 ze={contents:[],panel:[],score_num_item:[],score_total:[],error_tips:[]};return rt==null||rt.forEach(function(Ae,mt){var ft,yt,Qt;ze.panel.push([]),ze.score_num_item.push(Ae==null?void 0:Ae.score),ze.score_total.push(Ae==null?void 0:Ae.scoreTotal),(ft=ze.error_tips)===null||ft===void 0||ft.push({name:(yt=Ra.find(function(on){return on.type===(Ae==null?void 0:Ae.item_type)}))===null||yt===void 0?void 0:yt.name,score:(Ae==null?void 0:Ae.score)||0,scoreTotal:Ae==null?void 0:Ae.scoreTotal,item_type:Ae==null?void 0:Ae.item_type}),Ae==null||((Qt=Ae.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&&(ze.panel[mt].push(En.num),ze.contents.push({difficulty:En.difficulty,item_type:Ae.item_type,items_count:En.num,sub_discipline_id:on.sub_discipline_id,tag_discipline_id:xn.tag_discipline_id}))})})})}),ze},Mo=function(){var pt=Object(T.a)(z.a.mark(function rt(ze){var Ae,mt,ft,yt,Qt,on,Pn,xn,Ln,En,ai,zn,Hn,pi,si,qn,mi;return z.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:if(!(!wn.length&&!Dt.length&&!Sn.length)){en.next=3;break}return W.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:Ae=[],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&&(Ae==null||Ae.push({item_type:(zn=ft.error_tips[yt])===null||zn===void 0?void 0:zn.item_type,score:((Hn=ft.error_tips[yt])===null||Hn===void 0?void 0:Hn.score)||0}),mt.push(ft.error_tips[yt].name));case 20:yt++,en.next=7;break;case 23:if(!(Ae.length===0)){en.next=26;break}return W.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(O.a)({contents:ft.contents,group_ids:wn,teach_group_ids:Sn,score_settings:Ae,source:et,sub_discipline_id:0,sort_by_item_type:mt,tag_discipline_ids:Dt},ke),!ze){en.next=36;break}return si=Object(O.a)(Object(O.a)({},pi),ze),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&&W.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&&(W.b.success("\u64CD\u4F5C\u6210\u529F"),Re.d.push("/paperlibrary?defaultActiveKey=0")),dt(!1);case 48:case"end":return en.stop()}},rt)}));return function(ze){return pt.apply(this,arguments)}}(),ao=function(){var pt=Object(T.a)(z.a.mark(function rt(ze,Ae){var mt,ft,yt,Qt,on,Pn,xn,Ln,En,ai,zn,Hn,pi,si,qn,mi,Ai,en,bn,Jn,gi,li,Mi;return z.a.wrap(function(Un){for(;;)switch(Un.prev=Un.next){case 0:if(!(!wn.length&&!Dt.length&&!Sn.length)){Un.next=3;break}return W.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 zn=document.getElementById("".concat((ai=yt.error_tips[Qt])===null||ai===void 0?void 0:ai.item_type,"_sum")),zn.classList.add("customError"),zn.scrollIntoView({block:"start",behavior:"smooth"}),Un.abrupt("return");case 19:yt.error_tips[Qt].score!==0&&xn!==0&&(mt==null||mt.push({item_type:(Hn=yt.error_tips[Qt])===null||Hn===void 0?void 0:Hn.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 W.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(O.a)({contents:yt.contents,group_ids:wn,teach_group_ids:Sn,score_settings:mt,sort_by_item_type:ft,tag_discipline_ids:Dt,source:et,sub_discipline_id:0},ke),!(ze!==void 0&&!(ze!=null&&ze.single_question_id))){Un.next=36;break}return si.seleted_item_bank_ids=ze==null?void 0:ze.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(Ke.cloneDeep)(d),Ai.questionList=Ai==null||((mi=Ai.questionList)===null||mi===void 0)?void 0:mi.map(function(Vn){if(Vn.type===Ae.type){var vi;return Object(O.a)(Object(O.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(!(ze!=null&&ze!==void 0&&ze.single_question_id)){Un.next=45;break}return si.seleted_item_bank_ids=ze==null?void 0:ze.seleted_item_bank_ids,si.single_question_id=ze==null?void 0:ze.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(Ke.cloneDeep)(d),Jn.questionList=Jn==null||((bn=Jn.questionList)===null||bn===void 0)?void 0:bn.map(function(Vn){if(Vn.type===Ae.type){var vi,ki,yi=Object(Ke.cloneDeep)(Vn==null?void 0:Vn.questions);return yi.splice(Ae.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,Ae.index,"new_questions"),Object(O.a)(Object(O.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(Ke.compact)(Mi),li.questionList=Mi,o(Object(O.a)({},li)),console.log(JSON.stringify(li)),gn(!0),document.body.scrollIntoView()),Gt(!1);case 50:case"end":return Un.stop()}},rt)}));return function(ze,Ae){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),ze=rt.panel,Ae=rt.score_total;return Ae=Ae.reduce(function(mt,ft){return mt+ft},0),ze=Object(Ke.flatten)(ze).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,ze)),b.a.createElement("aside",null),b.a.createElement("div",null,b.a.createElement("img",{src:Ie.a}),b.a.createElement("span",null,"\u603B\u5206(\u5206)"),b.a.createElement("aside",null,Ae)))},ga=function(rt,ze,Ae){return rt[ze]=rt.splice(Ae,1,rt[ze])[0],rt},qi=function(rt){var ze=[],Ae=Object(Ke.cloneDeep)(v);Ae.length>1&&rt!==0&&(ze=ga(Ae,rt,rt-1)),c(ze)},Ba=function(rt){var ze=[],Ae=Object(Ke.cloneDeep)(v);Ae.length>1&&rt!==Ae.length-1&&(ze=ga(Ae,rt,rt+1)),c(ze)},Ta=function(){var pt=Object(T.a)(z.a.mark(function rt(ze){var Ae,mt,ft,yt;return z.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:if(ft=Object(be.a)(et),et.includes(ze)?ft=ft.filter(function(Pn){return Pn!==ze}):ft.push(ze),!(ft.length===0)){on.next=5;break}return W.b.warn("\u8BD5\u9898\u6765\u6E90\u4E3A\u5FC5\u9009\u9879"),on.abrupt("return");case 5:(Ae=ft)!==null&&Ae!==void 0&&Ae.includes("mine")||(zi([]),Si.current=[]),(mt=ft)!==null&&mt!==void 0&&mt.includes("teach_groups")||(Qi([]),ra.current=[]),Ht(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(ze){return pt.apply(this,arguments)}}(),Lo=function(rt){var ze={1:"\u4E00",2:"\u4E8C",3:"\u4E09",4:"\u56DB",5:"\u4E94",6:"\u516D",7:"\u4E03"};if(!rt)return;var Ae=rt||{},mt=Ae.exam,ft=Ae.single_questions,yt=Ae.multiple_questions,Qt=Ae.judgement_questions,on=Ae.program_questions,Pn=Ae.completion_questions,xn=Ae.subjective_questions,Ln=Ae.practical_questions,En=Ae.combination_questions,ai=[Object(O.a)({type:"SINGLE",name:"\u5355\u9009\u9898"},ft),Object(O.a)({type:"MULTIPLE",name:"\u591A\u9009\u9898"},yt),Object(O.a)({type:"COMPLETION",name:"\u586B\u7A7A\u9898"},Pn),Object(O.a)({type:"JUDGMENT",name:"\u5224\u65AD\u9898"},Qt),Object(O.a)({type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},xn),Object(O.a)({type:"PROGRAM",name:"\u7F16\u7A0B\u9898"},on),Object(O.a)({type:"PRACTICAL",name:"\u5B9E\u8BAD\u9898"},Ln),Object(O.a)({type:"COMBINATION",name:"\u7EC4\u5408\u9898"},En)],zn=[],Hn=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){zn.push(en.id),Hn=Hn+en.score,pi=pi+1}),Object(O.a)(Object(O.a)({},qn),{number:ze[mi+1]})});return{all_questions_count:pi,all_score:Hn,questionList:si,ids:zn,exam:mt}},Zi=function(rt){var ze,Ae,mt=Object(Ke.cloneDeep)(d),ft=Object(Ke.cloneDeep)(v);mt.questionList=mt==null||((ze=mt.questionList)===null||ze===void 0)?void 0:ze.map(function(yt){return yt.type===rt.type?Object(O.a)(Object(O.a)({},yt),{},{questions_score:rt.scoreTotal}):yt}),ft=(Ae=ft)===null||Ae===void 0?void 0:Ae.map(function(yt){return yt.item_type===rt.type?Object(O.a)(Object(O.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,Oa=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 ze=document.getElementById("id_left");ze.style.overflowY="auto"},onMouseLeave:function(rt){var ze=document.getElementById("id_left");ze.style.overflowY="hidden"}},b.a.createElement(ve.a,{loading:$t,active:!0,paragraph:{rows:5}},v.map(function(pt,rt){var ze;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,(ze=Ra.find(function(Ae){return Ae.type===(pt==null?void 0:pt.item_type)}))===null||ze===void 0?void 0:ze.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(X,{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 Ta("mine")}}," ",b.a.createElement(H.a,{checked:et==null?void 0:et.includes("mine")}),b.a.createElement("span",{style:{color:et!=null&&et.includes("mine")?"#007DFE":"#666666"}},"\u4EC5\u6211\u521B\u5EFA\u7684")),b.a.createElement("div",{className:"mb20",onClick:function(){return Ta("teach_groups")}}," ",b.a.createElement(H.a,{checked:et==null?void 0:et.includes("teach_groups")}),b.a.createElement("span",{style:{color:et!=null&&et.includes("teach_groups")?"#007DFE":"#666666"}},"\u6559\u7814\u5171\u4EAB")),b.a.createElement("div",{onClick:function(){return Ta("public")}},b.a.createElement(H.a,{checked:et==null?void 0:et.includes("public")}),b.a.createElement("span",{style:{color:et!=null&&et.includes("public")?"#007DFE":"#666666"}},"\u516C\u5171\u9898\u5E93"))),b.a.createElement("aside",null,(et==null?void 0:et.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,ze){return rt+ze},0))||0)}},b.a.createElement("img",{src:Oe.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}))),(et==null?void 0:et.includes("teach_groups"))&&b.a.createElement("div",{className:p.a.folder,onClick:function(){Ji(!0),ra.current=Sn}},b.a.createElement("img",{src:Me.a}),b.a.createElement("span",null,"\u9009\u62E9\u6559\u7814\u56E2\u961F")))),(et==null?void 0:et.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(De.a,{type:2,value:Yn,onChange:function(rt){var ze=wn.filter(function(mt){return mt!==rt}),Ae={source:et,group_ids:ze,tag_discipline_ids:Dt,teach_group_ids:Sn};ha(Ae),zi(ze),Si.current=ze}})),(et==null?void 0:et.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(De.a,{icon:Te.a,type:2,value:un,onChange:function(rt){var ze=Sn.filter(function(mt){return mt!==rt}),Ae={source:et,group_ids:wn,tag_discipline_ids:Dt,teach_group_ids:ze};ha(Ae),Qi(ze),ra.current=ze}})),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){W.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:$.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},Oa==null?void 0:Oa.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(De.a,{type:1,value:pt==null?void 0:pt.filter(function(ze){return!!ze.item_count}),onChange:function(Ae){var mt=Dt.filter(function(yt){return yt!==Ae}),ft={source:et,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(Qe.a,{key:rt,value:pt,onChange:function(Ae){return Ao(Ae,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:Hi,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:ue.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,ze=!1;if(!Nt)ze=!0;else{var Ae;(Ae=pt.sub_disciplines)===null||Ae===void 0||Ae.forEach(function(mt){var ft;(ft=mt.tag_disciplines)===null||ft===void 0||ft.forEach(function(yt){if(!ze){var Qt;ze=((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&&ze&&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(G,{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 ze,Ae=Object(O.a)(Object(O.a)({},pt),{},{tag_disciplines:pt==null||((ze=pt.tag_disciplines)===null||ze===void 0)?void 0:ze.filter(function(mt){return mt.item_count!==0})});return b.a.createElement(kt,{search:Nt,onChange:er,key:pt.id,value:Dt,options:Ae})}))))),b.a.createElement(C.a,{centered:!0,title:"\u9009\u62E9\u6587\u4EF6\u5939",visible:Fn,width:718,destroyOnClose:!0,onCancel:function(){zi(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(){zi(Si.current),Mn(0),Xn(!1)}},"\u53D6\u6D88"),b.a.createElement(xe.a,{type:"primary",onClick:function(){var rt={source:et,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(Ne,{treeData:Oo,defaultValue:$n,value:wn,onChange:function(rt,ze){var Ae;Mn((Ae=ze.selectedNodes)===null||Ae===void 0?void 0:Ae.map(function(mt){return mt.count}).reduce(function(mt,ft){return mt+ft},0)),zi(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:et,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(H.a,{onChange:function(){var ze=pt.id,Ae=Object(be.a)(Sn);Sn.includes(ze)?Ae=Ae.filter(function(mt){return mt!==ze}):Ae.push(ze),Qi(Ae)},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=ee,x=L.a.TextArea,R=function(de){var Ce=de.paperlibrary,ke=de.user,_t=de.globalSetting,at=de.dispatch,ge=Object(Y.useState)(0),lt=Object(te.a)(ge,2),Et=lt[0],qe=lt[1],Ft=A.a.useForm(),et=Object(te.a)(Ft,1),Ht=et[0],It=Object(Y.useState)({}),vt=Object(te.a)(It,2),$t=vt[0],Lt=vt[1],Be=Object(Y.useState)(!0),ut=Object(te.a)(Be,2),nt=ut[0],dt=ut[1],Kt=Object(Y.useState)(null),Vt=Object(te.a)(Kt,2),an=Vt[0],Gt=Vt[1],Ct=Object(fe.i)().id;console.log(Ct,"editId"),Object(Y.useEffect)(function(){return at({type:"globalSetting/footerToggle",payload:!1}),function(){at({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(Y.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]);var tn=function(Kn){Lt(Object(O.a)({},Ht.getFieldsValue()))};Object(Y.useEffect)(function(){if(Ct){Nt();return}dt(!1)},[Ct]);var Nt=function(){var hn=Object(T.a)(z.a.mark(function Kn(){var nn,Ge,st,fn,gn,Tn;return z.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&&(Tn={difficulty:nn==null||((Ge=nn.examination_bank)===null||Ge===void 0)?void 0:Ge.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(O.a)({},Tn)),Ht.setFieldsValue(Object(O.a)({},Tn)),Gt(Object(O.a)(Object(O.a)({},nn),{},{id:Ct})));case 4:case"end":return d.stop()}},Kn)}));return function(){return hn.apply(this,arguments)}}(),ln=function(){var hn=Object(T.a)(z.a.mark(function Kn(nn){return z.a.wrap(function(st){for(;;)switch(st.prev=st.next){case 0:if(!(nn===0)){st.next=3;break}return qe(nn),st.abrupt("return");case 3:return st.next=5,Ht.validateFields();case 5:qe(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(Ke.isNaN)(nn)?"":nn};return b.a.createElement("section",{className:q.a.wrap},b.a.createElement(ve.a,{loading:nt,active:!0,paragraph:{rows:5}},b.a.createElement("div",{className:q.a.crumbs},b.a.createElement("b",null),b.a.createElement("span",{className:"current",onClick:function(){return Re.d.push("/")}},"\u9996\u9875>"),b.a.createElement("span",{className:"current",onClick:function(){return Re.d.push("/paperlibrary")}},"\u8BD5\u5377\u5E93>"),b.a.createElement("span",{style:{color:"#bebebe"}},"\u968F\u673A\u7EC4\u5377")),Et===0&&b.a.createElement(X,{value:Et,onChange:ln}),Et===0&&b.a.createElement("section",{className:q.a.oneWrap},b.a.createElement("div",{className:q.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(A.a,{className:q.a.formWrap,form:Ht,layout:"horizontal",onValuesChange:tn},b.a.createElement(A.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:q.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(A.a.Item,{label:"\u7B54\u9898\u65F6\u957F:",name:"time",rules:[{required:!0,message:"\u7B54\u9898\u65F6\u957F\u4E0D\u80FD\u4E3A\u7A7A"}]},b.a.createElement(w.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(A.a.Item,{label:"\u8BD5\u9898\u96BE\u5EA6",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},b.a.createElement(oe.a.Group,{style:{display:"flex",width:286,justifyContent:"space-between"},size:"large"},b.a.createElement(oe.a.Button,{className:q.a.rb,value:1},"\u7B80\u5355"),b.a.createElement(oe.a.Button,{className:q.a.rb,value:2},"\u9002\u4E2D"),b.a.createElement(oe.a.Button,{className:q.a.rb,value:3},"\u56F0\u96BE"))),b.a.createElement(A.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:q.a.btns},b.a.createElement(xe.a,{className:"mr40",onClick:function(){return Re.d.push("/paperlibrary")}},"\u8FD4\u56DE"),b.a.createElement(xe.a,{type:"primary",onClick:Object(T.a)(z.a.mark(function hn(){return z.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:return nn.next=2,Ht.validateFields();case 2:qe(1);case 3:case"end":return nn.stop()}},hn)}))},"\u4E0B\u4E00\u6B65"))),b.a.createElement(Q,{tabs:Et,dispatch:at,editData:an,setFatherTabs:qe,formValue:$t})))},U=je.default=Object(Re.a)(function(I){var de=I.paperlibrary,Ce=I.user,ke=I.globalSetting;return{paperlibrary:de,user:Ce,globalSetting:ke}})(R)},"E/GV":function(Je,je,h){Je.exports=h.p+"static/swenjianjia.1640bf70.svg"},ELLl:function(Je,je,h){(function(V){V(h("VrN/"))})(function(V){var ve={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},se=V.Pos;V.defineOption("autoCloseBrackets",!1,function(L,F,z){z&&z!=V.Init&&(L.removeKeyMap(pe),L.state.closeBrackets=null),F&&(oe(xe(F,"pairs")),L.state.closeBrackets=F,L.addKeyMap(pe))});function xe(L,F){return F=="pairs"&&typeof L=="string"?L:typeof L=="object"&&L[F]!=null?L[F]:ve[F]}var pe={Backspace:T,Enter:O};function oe(L){for(var F=0;F<L.length;F++){var z=L.charAt(F),Y="'"+z+"'";pe[Y]||(pe[Y]=j(z))}}oe(ve.pairs+"`");function j(L){return function(F){return A(F,L)}}function w(L){var F=L.state.closeBrackets;if(!F||F.override)return F;var z=L.getModeAt(L.getCursor());return z.closeBrackets||F}function T(L){var F=w(L);if(!F||L.getOption("disableInput"))return V.Pass;for(var z=xe(F,"pairs"),Y=L.listSelections(),b=0;b<Y.length;b++){if(!Y[b].empty())return V.Pass;var fe=te(L,Y[b].head);if(!fe||z.indexOf(fe)%2!=0)return V.Pass}for(var b=Y.length-1;b>=0;b--){var Re=Y[b].head;L.replaceRange("",se(Re.line,Re.ch-1),se(Re.line,Re.ch+1),"+delete")}}function O(L){var F=w(L),z=F&&xe(F,"explode");if(!z||L.getOption("disableInput"))return V.Pass;for(var Y=L.listSelections(),b=0;b<Y.length;b++){if(!Y[b].empty())return V.Pass;var fe=te(L,Y[b].head);if(!fe||z.indexOf(fe)%2!=0)return V.Pass}L.operation(function(){var Re=L.lineSeparator()||`
`;L.replaceSelection(Re+Re,null),L.execCommand("goCharLeft"),Y=L.listSelections();for(var he=0;he<Y.length;he++){var q=Y[he].head.line;L.indentLine(q,null,!0),L.indentLine(q+1,null,!0)}})}function N(L){var F=V.cmpPos(L.anchor,L.head)>0;return{anchor:new se(L.anchor.line,L.anchor.ch+(F?-1:1)),head:new se(L.head.line,L.head.ch+(F?1:-1))}}function A(L,F){var z=w(L);if(!z||L.getOption("disableInput"))return V.Pass;var Y=xe(z,"pairs"),b=Y.indexOf(F);if(b==-1)return V.Pass;for(var fe=xe(z,"closeBefore"),Re=xe(z,"triples"),he=Y.charAt(b+1)==F,q=L.listSelections(),g=b%2==0,re,k=0;k<q.length;k++){var X=q[k],S=X.head,C,J=L.getRange(S,se(S.line,S.ch+1));if(g&&!X.empty())C="surround";else if((he||!g)&&J==F)he&&B(L,S)?C="both":Re.indexOf(F)>=0&&L.getRange(S,se(S.line,S.ch+3))==F+F+F?C="skipThree":C="skip";else if(he&&S.ch>1&&Re.indexOf(F)>=0&&L.getRange(se(S.line,S.ch-2),S)==F+F){if(S.ch>2&&/\bstring/.test(L.getTokenTypeAt(se(S.line,S.ch-2))))return V.Pass;C="addFour"}else if(he){var H=S.ch==0?" ":L.getRange(se(S.line,S.ch-1),S);if(!V.isWordChar(J)&&H!=F&&!V.isWordChar(H))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(!re)re=C;else if(re!=C)return V.Pass}var E=b%2?Y.charAt(b-1):F,P=b%2?F:Y.charAt(b+1);L.operation(function(){if(re=="skip")L.execCommand("goCharRight");else if(re=="skipThree")for(var ae=0;ae<3;ae++)L.execCommand("goCharRight");else if(re=="surround"){for(var W=L.getSelections(),ae=0;ae<W.length;ae++)W[ae]=E+W[ae]+P;L.replaceSelections(W,"around"),W=L.listSelections().slice();for(var ae=0;ae<W.length;ae++)W[ae]=N(W[ae]);L.setSelections(W)}else re=="both"?(L.replaceSelection(E+P,null),L.triggerElectric(E+P),L.execCommand("goCharLeft")):re=="addFour"&&(L.replaceSelection(E+E+E+E,"before"),L.execCommand("goCharRight"))})}function te(L,F){var z=L.getRange(se(F.line,F.ch-1),se(F.line,F.ch+1));return z.length==2?z:null}function B(L,F){var z=L.getTokenAt(se(F.line,F.ch+1));return/\bstring/.test(z.type)&&z.start==F.ch&&(F.ch==0||!/\bstring/.test(L.getTokenTypeAt(F)))}})},FTkQ:function(Je,je){Je.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABjUlEQVQ4T61VsUoDQRB9s+eVYifkUlqIWCW3sbBMqYUR0cbfUPETxPgZ2giigpZaCnKXpBK1sMydpIx25+7ISu5ILhsjclvuzLx5M292lmA57PtuF2gIYIMBSYBn3BiICAg1cF0GrqjVSvLhlL+IqtVNEDUZWLAlS+8IeAPzvtduXw77ZYAMiEjKI2LeY2AskQ2cAGaiEy8MDwnQxicL7Ep5bDL+xmqijahZDsODDHBQ5sVfmVn6xmDeMuWTESAGnqf1bBpz09MSsESx729r4DwfIIA6hPjUSt2AaP7Hztwj5nXHdd0vpR7yMQzsUOT7pwzsjgEKsVIKgiCu1Za1UvfGLhynXgqCp6hSkSxEYCn9jLq+/wJgcawk5l4KYECN3YBlCVLWo4GvhmGfgVlrj4ZAjX0KmBmZD8Owj4IAMQAsvGSrKKR1zet0QpsosZQrmvnRKsqksZlxnFWVJAkT3Y6MDbAmgDlFdGcdm8IH22Qp9OmltAtdDoPlWez6SpkWtmCHFTNCvQMN/scX8A1e4fnIOEHt8AAAAABJRU5ErkJggg=="},Gytx:function(Je,je){Je.exports=function(V,ve,se,xe){var pe=se?se.call(xe,V,ve):void 0;if(pe!==void 0)return!!pe;if(V===ve)return!0;if(typeof V!="object"||!V||typeof ve!="object"||!ve)return!1;var oe=Object.keys(V),j=Object.keys(ve);if(oe.length!==j.length)return!1;for(var w=Object.prototype.hasOwnProperty.bind(ve),T=0;T<oe.length;T++){var O=oe[T];if(!w(O))return!1;var N=V[O],A=ve[O];if(pe=se?se.call(xe,N,A,O):void 0,pe===!1||pe===void 0&&N!==A)return!1}return!0}},H38U:function(Je,je,h){var V=h("f4xo"),ve=h("rcnY"),se=h("wU8J"),xe=h("Iq15"),pe=h("dWSS");function oe(w,T){this.typeNumber=w,this.errorCorrectLevel=T,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var j=oe.prototype;j.addData=function(w){var T=new V(w);this.dataList.push(T),this.dataCache=null},j.isDark=function(w,T){if(w<0||this.moduleCount<=w||T<0||this.moduleCount<=T)throw new Error(w+","+T);return this.modules[w][T]},j.getModuleCount=function(){return this.moduleCount},j.make=function(){if(this.typeNumber<1){var w=1;for(w=1;w<40;w++){for(var T=ve.getRSBlocks(w,this.errorCorrectLevel),O=new se,N=0,A=0;A<T.length;A++)N+=T[A].dataCount;for(var A=0;A<this.dataList.length;A++){var te=this.dataList[A];O.put(te.mode,4),O.put(te.getLength(),xe.getLengthInBits(te.mode,w)),te.write(O)}if(O.getLengthInBits()<=N*8)break}this.typeNumber=w}this.makeImpl(!1,this.getBestMaskPattern())},j.makeImpl=function(w,T){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var O=0;O<this.moduleCount;O++){this.modules[O]=new Array(this.moduleCount);for(var N=0;N<this.moduleCount;N++)this.modules[O][N]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(w,T),this.typeNumber>=7&&this.setupTypeNumber(w),this.dataCache==null&&(this.dataCache=oe.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,T)},j.setupPositionProbePattern=function(w,T){for(var O=-1;O<=7;O++){if(w+O<=-1||this.moduleCount<=w+O)continue;for(var N=-1;N<=7;N++){if(T+N<=-1||this.moduleCount<=T+N)continue;0<=O&&O<=6&&(N==0||N==6)||0<=N&&N<=6&&(O==0||O==6)||2<=O&&O<=4&&2<=N&&N<=4?this.modules[w+O][T+N]=!0:this.modules[w+O][T+N]=!1}}},j.getBestMaskPattern=function(){for(var w=0,T=0,O=0;O<8;O++){this.makeImpl(!0,O);var N=xe.getLostPoint(this);(O==0||w>N)&&(w=N,T=O)}return T},j.createMovieClip=function(w,T,O){var N=w.createEmptyMovieClip(T,O),A=1;this.make();for(var te=0;te<this.modules.length;te++)for(var B=te*A,L=0;L<this.modules[te].length;L++){var F=L*A,z=this.modules[te][L];z&&(N.beginFill(0,100),N.moveTo(F,B),N.lineTo(F+A,B),N.lineTo(F+A,B+A),N.lineTo(F,B+A),N.endFill())}return N},j.setupTimingPattern=function(){for(var w=8;w<this.moduleCount-8;w++){if(this.modules[w][6]!=null)continue;this.modules[w][6]=w%2==0}for(var T=8;T<this.moduleCount-8;T++){if(this.modules[6][T]!=null)continue;this.modules[6][T]=T%2==0}},j.setupPositionAdjustPattern=function(){for(var w=xe.getPatternPosition(this.typeNumber),T=0;T<w.length;T++)for(var O=0;O<w.length;O++){var N=w[T],A=w[O];if(this.modules[N][A]!=null)continue;for(var te=-2;te<=2;te++)for(var B=-2;B<=2;B++)te==-2||te==2||B==-2||B==2||te==0&&B==0?this.modules[N+te][A+B]=!0:this.modules[N+te][A+B]=!1}},j.setupTypeNumber=function(w){for(var T=xe.getBCHTypeNumber(this.typeNumber),O=0;O<18;O++){var N=!w&&(T>>O&1)==1;this.modules[Math.floor(O/3)][O%3+this.moduleCount-8-3]=N}for(var O=0;O<18;O++){var N=!w&&(T>>O&1)==1;this.modules[O%3+this.moduleCount-8-3][Math.floor(O/3)]=N}},j.setupTypeInfo=function(w,T){for(var O=this.errorCorrectLevel<<3|T,N=xe.getBCHTypeInfo(O),A=0;A<15;A++){var te=!w&&(N>>A&1)==1;A<6?this.modules[A][8]=te:A<8?this.modules[A+1][8]=te:this.modules[this.moduleCount-15+A][8]=te}for(var A=0;A<15;A++){var te=!w&&(N>>A&1)==1;A<8?this.modules[8][this.moduleCount-A-1]=te:A<9?this.modules[8][15-A-1+1]=te:this.modules[8][15-A-1]=te}this.modules[this.moduleCount-8][8]=!w},j.mapData=function(w,T){for(var O=-1,N=this.moduleCount-1,A=7,te=0,B=this.moduleCount-1;B>0;B-=2)for(B==6&&B--;;){for(var L=0;L<2;L++)if(this.modules[N][B-L]==null){var F=!1;te<w.length&&(F=(w[te]>>>A&1)==1);var z=xe.getMask(T,N,B-L);z&&(F=!F),this.modules[N][B-L]=F,A--,A==-1&&(te++,A=7)}if(N+=O,N<0||this.moduleCount<=N){N-=O,O=-O;break}}},oe.PAD0=236,oe.PAD1=17,oe.createData=function(w,T,O){for(var N=ve.getRSBlocks(w,T),A=new se,te=0;te<O.length;te++){var B=O[te];A.put(B.mode,4),A.put(B.getLength(),xe.getLengthInBits(B.mode,w)),B.write(A)}for(var L=0,te=0;te<N.length;te++)L+=N[te].dataCount;if(A.getLengthInBits()>L*8)throw new Error("code length overflow. ("+A.getLengthInBits()+">"+L*8+")");for(A.getLengthInBits()+4<=L*8&&A.put(0,4);A.getLengthInBits()%8!=0;)A.putBit(!1);for(;!(A.getLengthInBits()>=L*8);){if(A.put(oe.PAD0,8),A.getLengthInBits()>=L*8)break;A.put(oe.PAD1,8)}return oe.createBytes(A,N)},oe.createBytes=function(w,T){for(var O=0,N=0,A=0,te=new Array(T.length),B=new Array(T.length),L=0;L<T.length;L++){var F=T[L].dataCount,z=T[L].totalCount-F;N=Math.max(N,F),A=Math.max(A,z),te[L]=new Array(F);for(var Y=0;Y<te[L].length;Y++)te[L][Y]=255&w.buffer[Y+O];O+=F;var b=xe.getErrorCorrectPolynomial(z),fe=new pe(te[L],b.getLength()-1),Re=fe.mod(b);B[L]=new Array(b.getLength()-1);for(var Y=0;Y<B[L].length;Y++){var he=Y+Re.getLength()-B[L].length;B[L][Y]=he>=0?Re.get(he):0}}for(var q=0,Y=0;Y<T.length;Y++)q+=T[Y].totalCount;for(var g=new Array(q),re=0,Y=0;Y<N;Y++)for(var L=0;L<T.length;L++)Y<te[L].length&&(g[re++]=te[L][Y]);for(var Y=0;Y<A;Y++)for(var L=0;L<T.length;L++)Y<B[L].length&&(g[re++]=B[L][Y]);return g},Je.exports=oe},HG2Q:function(Je,je,h){Je.exports=h.p+"static/sren.1cbce50b.svg"},HPRh:function(Je,je,h){Je.exports=h.p+"static/median.766cb706.svg"},Hfvn:function(Je,je,h){Je.exports=h.p+"static/wenjian.ea3b4170.svg"},HmJG:function(Je,je,h){},IlMy:function(Je,je,h){Je.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(Je,je,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},pe={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(oe){for(var j=oe<<10;pe.getBCHDigit(j)-pe.getBCHDigit(pe.G15)>=0;)j^=pe.G15<<pe.getBCHDigit(j)-pe.getBCHDigit(pe.G15);return(oe<<10|j)^pe.G15_MASK},getBCHTypeNumber:function(oe){for(var j=oe<<12;pe.getBCHDigit(j)-pe.getBCHDigit(pe.G18)>=0;)j^=pe.G18<<pe.getBCHDigit(j)-pe.getBCHDigit(pe.G18);return oe<<12|j},getBCHDigit:function(oe){for(var j=0;oe!=0;)j++,oe>>>=1;return j},getPatternPosition:function(oe){return pe.PATTERN_POSITION_TABLE[oe-1]},getMask:function(oe,j,w){switch(oe){case xe.PATTERN000:return(j+w)%2==0;case xe.PATTERN001:return j%2==0;case xe.PATTERN010:return w%3==0;case xe.PATTERN011:return(j+w)%3==0;case xe.PATTERN100:return(Math.floor(j/2)+Math.floor(w/3))%2==0;case xe.PATTERN101:return j*w%2+j*w%3==0;case xe.PATTERN110:return(j*w%2+j*w%3)%2==0;case xe.PATTERN111:return(j*w%3+(j+w)%2)%2==0;default:throw new Error("bad maskPattern:"+oe)}},getErrorCorrectPolynomial:function(oe){for(var j=new ve([1],0),w=0;w<oe;w++)j=j.multiply(new ve([1,se.gexp(w)],0));return j},getLengthInBits:function(oe,j){if(1<=j&&j<10)switch(oe){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:"+oe)}else if(j<27)switch(oe){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:"+oe)}else if(j<41)switch(oe){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:"+oe)}else throw new Error("type:"+j)},getLostPoint:function(oe){for(var j=oe.getModuleCount(),w=0,T=0;T<j;T++)for(var O=0;O<j;O++){for(var N=0,A=oe.isDark(T,O),te=-1;te<=1;te++){if(T+te<0||j<=T+te)continue;for(var B=-1;B<=1;B++){if(O+B<0||j<=O+B)continue;if(te==0&&B==0)continue;A==oe.isDark(T+te,O+B)&&N++}}N>5&&(w+=3+N-5)}for(var T=0;T<j-1;T++)for(var O=0;O<j-1;O++){var L=0;oe.isDark(T,O)&&L++,oe.isDark(T+1,O)&&L++,oe.isDark(T,O+1)&&L++,oe.isDark(T+1,O+1)&&L++,(L==0||L==4)&&(w+=3)}for(var T=0;T<j;T++)for(var O=0;O<j-6;O++)oe.isDark(T,O)&&!oe.isDark(T,O+1)&&oe.isDark(T,O+2)&&oe.isDark(T,O+3)&&oe.isDark(T,O+4)&&!oe.isDark(T,O+5)&&oe.isDark(T,O+6)&&(w+=40);for(var O=0;O<j;O++)for(var T=0;T<j-6;T++)oe.isDark(T,O)&&!oe.isDark(T+1,O)&&oe.isDark(T+2,O)&&oe.isDark(T+3,O)&&oe.isDark(T+4,O)&&!oe.isDark(T+5,O)&&oe.isDark(T+6,O)&&(w+=40);for(var F=0,O=0;O<j;O++)for(var T=0;T<j;T++)oe.isDark(T,O)&&F++;var z=Math.abs(100*F/j/j-50)/5;return w+=z*10,w}};Je.exports=pe},K5AI:function(Je,je,h){Je.exports={cInput:"cInput___2BJRi",cl:"cl___AbKoK",box:"box___3gRA9",box1:"box1___S3u_s",cr:"cr___16yEi"}},LdHM:function(Je,je,h){"use strict";h.d(je,"b",function(){return fe}),h.d(je,"a",function(){return he});var V=h("1OyB"),ve=h("vuIU"),se=h("Ji7U"),xe=h("LK+K"),pe=h("q1tI"),oe=h("rePB"),j=h("Ff2n"),w=h("ODXe"),T=h("4IlW"),O=h("bX4T"),N=h("YrtM"),A=h("TSYQ"),te=h.n(A),B=h("+nKL"),L=h("8OUc"),F=function(le,Ue){var Pe=le.prefixCls,He=le.id,Oe=le.flattenOptions,Se=le.childrenAsData,$=le.values,K=le.searchValue,ue=le.multiple,D=le.defaultActiveFirstOption,_=le.height,me=le.itemHeight,Ie=le.notFoundContent,Ze=le.open,Me=le.menuItemSelectedIcon,Fe=le.virtual,Te=le.onSelect,De=le.onToggleOpen,Qe=le.onActiveValue,tt=le.onScroll,ot=le.onMouseEnter,$e="".concat(Pe,"-item"),Ke=Object(N.a)(function(){return Oe},[Ze,Oe],function(We,G){return G[0]&&We[1]!==G[1]}),At=pe.useRef(null),gt=function(G){G.preventDefault()},kt=function(G){At.current&&At.current.scrollTo({index:G})},ct=function(G){for(var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Q=Ke.length,x=0;x<Q;x+=1){var R=(G+x*ee+Q)%Q,U=Ke[R],I=U.group,de=U.data;if(!I&&!de.disabled)return R}return-1},Pt=pe.useState(function(){return ct(0)}),xt=Object(w.a)(Pt,2),bt=xt[0],Le=xt[1],Ut=function(G){Le(G);var ee=Ke[G];if(!ee){Qe(null,-1);return}Qe(ee.data.value,G)};pe.useEffect(function(){Ut(D!==!1?ct(0):-1)},[Ke.length,K]),pe.useEffect(function(){var We=setTimeout(function(){if(!ue&&Ze&&$.size===1){var G=Array.from($)[0],ee=Ke.findIndex(function(Q){var x=Q.data;return x.value===G});Ut(ee),kt(ee)}});return function(){return clearTimeout(We)}},[Ze]);var Rt=function(G){G!==void 0&&Te(G,{selected:!$.has(G)}),ue||De(!1)};if(pe.useImperativeHandle(Ue,function(){return{onKeyDown:function(G){var ee=G.which;switch(ee){case T.a.UP:case T.a.DOWN:{var Q=0;if(ee===T.a.UP?Q=-1:ee===T.a.DOWN&&(Q=1),Q!==0){var x=ct(bt+Q,Q);kt(x),Ut(x)}break}case T.a.ENTER:{var R=Ke[bt];R&&!R.data.disabled?Rt(R.data.value):Rt(void 0),Ze&&G.preventDefault();break}case T.a.ESC:De(!1)}},onKeyUp:function(){},scrollTo:function(G){kt(G)}}}),Ke.length===0)return pe.createElement("div",{role:"listbox",id:"".concat(He,"_list"),className:"".concat($e,"-empty"),onMouseDown:gt},Ie);function Ne(We){var G=Ke[We];if(!G)return null;var ee=G.data||{},Q=ee.value,x=ee.label,R=ee.children,U=Object(O.a)(ee,!0),I=Se?R:x;return G?pe.createElement("div",Object.assign({"aria-label":typeof I=="string"?I:null},U,{key:We,role:"option",id:"".concat(He,"_list_").concat(We),"aria-selected":$.has(Q)}),Q):null}return pe.createElement(pe.Fragment,null,pe.createElement("div",{role:"listbox",id:"".concat(He,"_list"),style:{height:0,width:0,overflow:"hidden"}},Ne(bt-1),Ne(bt),Ne(bt+1)),pe.createElement(B.a,{itemKey:"key",ref:At,data:Ke,height:_,itemHeight:me,fullHeight:!1,onMouseDown:gt,onScroll:tt,virtual:Fe,onMouseEnter:ot},function(We,G){var ee,Q=We.group,x=We.groupOption,R=We.data,U=R.label,I=R.key;if(Q)return pe.createElement("div",{className:te()($e,"".concat($e,"-group"))},U!==void 0?U:I);var de=R.disabled,Ce=R.value,ke=R.title,_t=R.children,at=R.style,ge=R.className,lt=Object(j.a)(R,["disabled","value","title","children","style","className"]),Et=$.has(Ce),qe="".concat($e,"-option"),Ft=te()($e,qe,ge,(ee={},Object(oe.a)(ee,"".concat(qe,"-grouped"),x),Object(oe.a)(ee,"".concat(qe,"-active"),bt===G&&!de),Object(oe.a)(ee,"".concat(qe,"-disabled"),de),Object(oe.a)(ee,"".concat(qe,"-selected"),Et),ee)),et=Se?_t:U,Ht=!Me||typeof Me=="function"||Et;return pe.createElement("div",Object.assign({},lt,{"aria-selected":Et,className:Ft,title:ke,onMouseMove:function(){if(bt===G||de)return;Ut(G)},onClick:function(){de||Rt(Ce)},style:at}),pe.createElement("div",{className:"".concat(qe,"-content")},et||Ce),pe.isValidElement(Me)||Et,Ht&&pe.createElement(L.a,{className:"".concat($e,"-option-state"),customizeIcon:Me,customizeIconProps:{isSelected:Et}},Et?"\u2713":null))}))},z=pe.forwardRef(F);z.displayName="OptionList";var Y=z,b=function(){return null};b.isSelectOption=!0;var fe=b,Re=function(){return null};Re.isSelectOptGroup=!0;var he=Re,q=h("VTBJ"),g=h("Zm9Q");function re(p){var le=p.key,Ue=p.props,Pe=Ue.children,He=Ue.value,Oe=Object(j.a)(Ue,["children","value"]);return Object(q.a)({key:le,value:He!==void 0?He:le,children:Pe},Oe)}function k(p){var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(g.a)(p).map(function(Ue,Pe){if(!pe.isValidElement(Ue)||!Ue.type)return null;var He=Ue.type.isSelectOptGroup,Oe=Ue.key,Se=Ue.props,$=Se.children,K=Object(j.a)(Se,["children"]);return le||!He?re(Ue):Object(q.a)(Object(q.a)({key:"__RC_SELECT_GRP__".concat(Oe===null?Pe:Oe,"__"),label:Oe},K),{},{options:k($)})}).filter(function(Ue){return Ue})}var X=h("2Qr1"),S=h("qNPg"),C=h("U8pU"),J=h("Kwbf"),H=h("WKfj");function E(p){var le=p.mode,Ue=p.options,Pe=p.children,He=p.backfill,Oe=p.allowClear,Se=p.placeholder,$=p.getInputElement,K=p.showSearch,ue=p.onSearch,D=p.defaultOpen,_=p.autoFocus,me=p.labelInValue,Ie=p.value,Ze=p.inputValue,Me=p.optionLabelProp,Fe=le==="multiple"||le==="tags",Te=K!==void 0?K:Fe||le==="combobox",De=Ue||k(Pe);if(Object(J.a)(le!=="tags"||De.every(function($e){return!$e.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),le==="tags"||le==="combobox"){var Qe=De.some(function($e){return $e.options?$e.options.some(function(Ke){return typeof("value"in Ke?Ke.value:Ke.key)=="number"}):typeof("value"in $e?$e.value:$e.key)=="number"});Object(J.a)(!Qe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(J.a)(le!=="combobox"||!Me,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(J.a)(le==="combobox"||!He,"`backfill` only works with `combobox` mode."),Object(J.a)(le==="combobox"||!$,"`getInputElement` only work with `combobox` mode."),Object(J.b)(le!=="combobox"||!$||!Oe||!Se,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ue&&!Te&&le!=="combobox"&&le!=="tags"&&Object(J.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(J.b)(!D||_,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ie!=null){var tt=Object(H.d)(Ie);Object(J.a)(!me||tt.every(function($e){return Object(C.a)($e)==="object"&&("key"in $e||"value"in $e)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(J.a)(!Fe||Array.isArray(Ie),"`value` should be array when `mode` is `multiple` or `tags`")}if(Pe){var ot=null;Object(g.a)(Pe).some(function($e){if(!pe.isValidElement($e)||!$e.type)return!1;var Ke=$e.type;if(Ke.isSelectOption)return!1;if(Ke.isSelectOptGroup){var At=Object(g.a)($e.props.children).every(function(gt){return!pe.isValidElement(gt)||!$e.type||gt.type.isSelectOption?!0:(ot=gt.type,!1)});return!At}return ot=Ke,!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(S.a)({prefixCls:"rc-select",components:{optionList:Y},convertChildrenToData:k,flattenOptions:X.d,getLabeledValue:X.e,filterOptions:X.b,isValueDisabled:X.g,findValueOption:X.c,warningProps:P,fillOptionsWithMissingValue:X.a}),W=function(p){Object(se.a)(Ue,p);var le=Object(xe.a)(Ue);function Ue(){var Pe;return Object(V.a)(this,Ue),Pe=le.apply(this,arguments),Pe.selectRef=pe.createRef(),Pe.focus=function(){Pe.selectRef.current.focus()},Pe.blur=function(){Pe.selectRef.current.blur()},Pe}return Object(ve.a)(Ue,[{key:"render",value:function(){return pe.createElement(ae,Object.assign({ref:this.selectRef},this.props))}}]),Ue}(pe.Component);W.Option=fe,W.OptGroup=he;var be=W,M=je.c=be},M8RZ:function(Je,je,h){"use strict";h.d(je,"a",function(){return T});var V=h("fWQN"),ve=h("mtLc"),se=h("yKVA"),xe=h("879j"),pe=h("q1tI"),oe=h.n(pe),j=h("i8i4"),w=h.n(j),T=function(O){Object(se.a)(A,O);var N=Object(xe.a)(A);function A(te){var B;Object(V.a)(this,A),B=N.call(this,te);var L=window.document;return B.node=L.createElement("div"),L.body.appendChild(B.node),B}return Object(ve.a)(A,[{key:"render",value:function(){var B=this.props.children;return Object(j.createPortal)(B,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),A}(oe.a.Component)},NvD2:function(Je,je,h){"use strict";h.d(je,"a",function(){return oe});var V=h("Kwbf");function ve(j,w){var T=new Set;return j.forEach(function(O){w.has(O)||T.add(O)}),T}function se(j){var w=j||{},T=w.disabled,O=w.disableCheckbox,N=w.checkable;return!!(T||O)||N===!1}function xe(j,w,T,O){for(var N=new Set(j),A=new Set,te=0;te<=T;te+=1){var B=w.get(te)||new Set;B.forEach(function(Y){var b=Y.key,fe=Y.node,Re=Y.children,he=Re===void 0?[]:Re;N.has(b)&&!O(fe)&&he.filter(function(q){return!O(q.node)}).forEach(function(q){N.add(q.key)})})}for(var L=new Set,F=T;F>=0;F-=1){var z=w.get(F)||new Set;z.forEach(function(Y){var b=Y.parent,fe=Y.node;if(O(fe)||!Y.parent||L.has(Y.parent.key))return;if(O(Y.parent.node)){L.add(b.key);return}var Re=!0,he=!1;(b.children||[]).filter(function(q){return!O(q.node)}).forEach(function(q){var g=q.key,re=N.has(g);Re&&!re&&(Re=!1),!he&&(re||A.has(g))&&(he=!0)}),Re&&N.add(b.key),he&&A.add(b.key),L.add(b.key)})}return{checkedKeys:Array.from(N),halfCheckedKeys:Array.from(ve(A,N))}}function pe(j,w,T,O,N){for(var A=new Set(j),te=new Set(w),B=0;B<=O;B+=1){var L=T.get(B)||new Set;L.forEach(function(b){var fe=b.key,Re=b.node,he=b.children,q=he===void 0?[]:he;!A.has(fe)&&!te.has(fe)&&!N(Re)&&q.filter(function(g){return!N(g.node)}).forEach(function(g){A.delete(g.key)})})}te=new Set;for(var F=new Set,z=O;z>=0;z-=1){var Y=T.get(z)||new Set;Y.forEach(function(b){var fe=b.parent,Re=b.node;if(N(Re)||!b.parent||F.has(b.parent.key))return;if(N(b.parent.node)){F.add(fe.key);return}var he=!0,q=!1;(fe.children||[]).filter(function(g){return!N(g.node)}).forEach(function(g){var re=g.key,k=A.has(re);he&&!k&&(he=!1),!q&&(k||te.has(re))&&(q=!0)}),he||A.delete(fe.key),q&&te.add(fe.key),F.add(fe.key)})}return{checkedKeys:Array.from(A),halfCheckedKeys:Array.from(ve(te,A))}}function oe(j,w,T,O){var N=[],A;O?A=O:A=se;var te=new Set(j.filter(function(z){var Y=!!T[z];return Y||N.push(z),Y})),B=new Map,L=0;Object.keys(T).forEach(function(z){var Y=T[z],b=Y.level,fe=B.get(b);fe||(fe=new Set,B.set(b,fe)),fe.add(Y),L=Math.max(L,b)}),Object(V.a)(!N.length,"Tree missing follow keys: ".concat(N.slice(0,100).map(function(z){return"'".concat(z,"'")}).join(", ")));var F;return w===!0?F=xe(te,B,L,A):F=pe(te,w.halfCheckedKeys,B,L,A),F}},O2Wb:function(Je,je,h){Je.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OLES:function(Je,je,h){"use strict";var V=h("U8pU"),ve=h("VTBJ"),se=h("Ff2n"),xe=h("q1tI"),pe=h("uciX"),oe=h("7ixt"),j=function(te){var B=te.overlay,L=te.prefixCls,F=te.id,z=te.overlayInnerStyle;return xe.createElement("div",{className:"".concat(L,"-inner"),id:F,role:"tooltip",style:z},typeof B=="function"?B():B)},w=j,T=function(te,B){var L=te.overlayClassName,F=te.trigger,z=F===void 0?["hover"]:F,Y=te.mouseEnterDelay,b=Y===void 0?0:Y,fe=te.mouseLeaveDelay,Re=fe===void 0?.1:fe,he=te.overlayStyle,q=te.prefixCls,g=q===void 0?"rc-tooltip":q,re=te.children,k=te.onVisibleChange,X=te.afterVisibleChange,S=te.transitionName,C=te.animation,J=te.placement,H=J===void 0?"right":J,E=te.align,P=E===void 0?{}:E,ae=te.destroyTooltipOnHide,W=ae===void 0?!1:ae,be=te.defaultVisible,M=te.getTooltipContainer,p=te.overlayInnerStyle,le=Object(se.a)(te,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Ue=Object(xe.useRef)(null);Object(xe.useImperativeHandle)(B,function(){return Ue.current});var Pe=Object(ve.a)({},le);"visible"in te&&(Pe.popupVisible=te.visible);var He=function(){var ue=te.arrowContent,D=ue===void 0?null:ue,_=te.overlay,me=te.id;return[xe.createElement("div",{className:"".concat(g,"-arrow"),key:"arrow"},D),xe.createElement(w,{key:"content",prefixCls:g,id:me,overlay:_,overlayInnerStyle:p})]},Oe=!1,Se=!1;if(typeof W=="boolean")Oe=W;else if(W&&Object(V.a)(W)==="object"){var $=W.keepParent;Oe=$===!0,Se=$===!1}return xe.createElement(pe.a,Object.assign({popupClassName:L,prefixCls:g,popup:He,action:z,builtinPlacements:oe.a,popupPlacement:H,ref:Ue,popupAlign:P,getPopupContainer:M,onPopupVisibleChange:k,afterPopupVisibleChange:X,popupTransitionName:S,popupAnimation:C,defaultPopupVisible:be,destroyPopupOnHide:Oe,autoDestroy:Se,mouseLeaveDelay:Re,popupStyle:he,mouseEnterDelay:b},Pe),re)},O=Object(xe.forwardRef)(T),N=je.a=O},OZM5:function(Je,je,h){"use strict";h.d(je,"b",function(){return O}),h.d(je,"a",function(){return N}),h.d(je,"k",function(){return A}),h.d(je,"h",function(){return te}),h.d(je,"i",function(){return B}),h.d(je,"g",function(){return L}),h.d(je,"c",function(){return F}),h.d(je,"d",function(){return z}),h.d(je,"j",function(){return fe}),h.d(je,"e",function(){return Re}),h.d(je,"f",function(){return he});var V=h("KQm4"),ve=h("U8pU"),se=h("Ff2n"),xe=h("q1tI"),pe=h.n(xe),oe=h("Kwbf"),j=h("WaYH"),w=.25,T=2;function O(q,g){var re=q.slice(),k=re.indexOf(g);return k>=0&&re.splice(k,1),re}function N(q,g){var re=q.slice();return re.indexOf(g)===-1&&re.push(g),re}function A(q){return q.split("-")}function te(q,g){return"".concat(q,"-").concat(g)}function B(q){return q&&q.type&&q.type.isTreeNode}function L(q,g){var re=[q],k=g[q];function X(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];S.forEach(function(C){var J=C.key,H=C.children;re.push(J),X(H)})}return X(k.children),re}function F(q,g){var re=q.clientY,k=g.selectHandle.getBoundingClientRect(),X=k.top,S=k.bottom,C=k.height,J=Math.max(C*w,T);return re<=X+J?-1:re>=S-J?1:0}function z(q,g){if(!q)return;var re=g.multiple;return re?q.slice():q.length?[q[0]]:q}var Y=function(g){return g};function b(q,g){if(!q)return[];var re=g||{},k=re.processProps,X=k===void 0?Y:k,S=Array.isArray(q)?q:[q];return S.map(function(C){var J=C.children,H=Object(se.a)(C,["children"]),E=b(J,g);return pe.a.createElement(j.a,Object.assign({},X(H)),E)})}function fe(q){if(!q)return null;var g;if(Array.isArray(q))g={checkedKeys:q,halfCheckedKeys:void 0};else if(Object(ve.a)(q)==="object")g={checkedKeys:q.checked||void 0,halfCheckedKeys:q.halfChecked||void 0};else return Object(oe.a)(!1,"`checkedKeys` is not an array or an object"),null;return g}function Re(q,g){var re=new Set;function k(X){if(re.has(X))return;var S=g[X];if(!S)return;re.add(X);var C=S.parent,J=S.node;if(J.disabled)return;C&&k(C.key)}return(q||[]).forEach(function(X){k(X)}),Object(V.a)(re)}function he(q){var g={};return Object.keys(q).forEach(function(re){(re.startsWith("data-")||re.startsWith("aria-"))&&(g[re]=q[re])}),g}},Ot1p:function(Je,je,h){"use strict";var V=h("2qtc"),ve=h("kLXV"),se=h("rAM+"),xe=h("miYZ"),pe=h("tsqr"),oe=h("9og8"),j=h("tJVT"),w=h("jrin"),T=h("WmNS"),O=h.n(T),N=h("q1tI"),A=h.n(N),te=h("VrN/"),B=h.n(te),L=h("bdgK"),F=h("p77/"),z=h("Bd2K"),Y=h("ELLl"),b=h("19Vz"),fe=h("lZu9"),Re=h("+NIl"),he=h("kSUc"),q=h("9Bee"),g=function(ge){var lt=ge.value,Et=lt===void 0?"":lt,qe=ge.className,Ft=ge.showTextOnly,et=ge.showLines,Ht=ge.style,It=Ht===void 0?{}:Ht,vt=Object(N.useMemo)(function(){return""},[Et]);return A.a.createElement(A.a.Fragment,null,A.a.createElement("div",{dangerouslySetInnerHTML:{__html:vt}}))},re=h("Q9mQ"),k=h("diRs"),X=h("0Owb"),S=h("dejd"),C=h("C+DQ"),J=h("D1Df"),H=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 W(ge){var lt=ge.onActionCallback,Et=ge.title,qe=ge.icon,Ft=ge.actionName,et=ge.className,Ht=et===void 0?"":et,It=ge.children;function vt(){lt(Ft)}return A.a.createElement("a",{title:Et,className:Ht,onClick:vt},A.a.createElement("i",{className:"md-iconfont ".concat(qe)}),It)}var be=function(ge){var lt=ge.watch,Et=ge.showNullButton,qe=ge.onActionCallback,Ft=ge.fullScreen,et=ge.insertTemp,Ht=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 A.a.createElement("ul",{className:"markdown-toolbar-container"},!Ht&&$t.map(function(Lt,Be){return A.a.createElement("li",{key:Be},Lt.actionName?A.a.createElement(W,Object(X.a)({},Lt,{onActionCallback:qe})):A.a.createElement("span",{className:"v-line"}))}),Et?A.a.createElement("li",null,A.a.createElement(W,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:qe},A.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,et&&A.a.createElement("li",null,A.a.createElement(W,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(et),onActionCallback:qe},A.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),A.a.createElement("li",null,A.a.createElement(k.a,{title:"\u6253\u5F00\u624B\u673A\u626B\u4E00\u626B",content:A.a.createElement("div",null,A.a.createElement(H.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))}))},A.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return vt(!0)}},"\u624B\u673A\u4E0A\u4F20\u6587\u4EF6"))),A.a.createElement("li",{className:"btn-full-screen"},A.a.createElement(W,{icon:"".concat(Ft?"icon-shrink":"icon-enlarge"),title:Ft?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:qe})))},M=h("M8RZ"),p=h("+L6B"),le=h("2/Rp"),Ue=h("y8nQ"),Pe=h("Vl3Y"),He=h("5NDa"),Oe=h("5rEg"),Se={labelCol:{span:4},wrapperCol:{span:20}},$=function(ge){var lt=ge.callback,Et=ge.onCancel;function qe(Ft){lt(Ft)}return A.a.createElement(Pe.a,Object(X.a)({},Se,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:qe}),A.a.createElement(Pe.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},A.a.createElement(Oe.a,null)),A.a.createElement(Pe.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},A.a.createElement(Oe.a,null)),A.a.createElement("div",{className:"flex-container flex-end"},A.a.createElement(le.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(le.a,{type:"ghost",onClick:Et},"\u53D6\u6D88")))},K=h("7ahc"),ue=h("k1fw"),D=h("HmJG"),_=h("BjJ7"),me=Pe.a.useForm,Ie={width:280,marginRight:10},Ze={labelCol:{span:5},wrapperCol:{span:19}},Me=function(ge){var lt=ge.callback,Et=ge.onCancel,qe=me(),Ft=Object(j.a)(qe,1),et=Ft[0],Ht=Object(N.useRef)();function It(Lt){lt(Object(ue.a)(Object(ue.a)({},Lt),{},{name:Ht.current}))}function vt(Lt,Be){et.setFieldsValue({src:"/api/attachments/".concat(Lt.id,"?type=").concat(Lt.content_type),type:Be.type})}function $t(Lt){var Be=Lt.target.files[0];Ht.current=Be.name,Te(Be,vt)}return A.a.createElement(Pe.a,Object(X.a)({form:et},Ze,{className:"upload-image-panel",onFinish:It}),A.a.createElement(Pe.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},A.a.createElement("div",{className:"flex-container"},A.a.createElement(Pe.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},A.a.createElement(Oe.a,{style:Ie})),A.a.createElement(Fe,{onFileChange:$t}))),A.a.createElement(Pe.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},A.a.createElement(Oe.a,{style:{width:264}})),A.a.createElement(Pe.a.Item,{style:{textAlign:"right"}},A.a.createElement(le.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(le.a,{type:"ghost",onClick:Et},"\u53D6\u6D88")))};function Fe(ge){var lt=ge.onFileChange;return A.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",A.a.createElement("input",{type:"file",onChange:lt}))}function Te(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 qe=new window.XMLHttpRequest;qe.withCredentials=!0,qe.addEventListener("load",function(Ft){lt(JSON.parse(Ft.target.responseText),ge)},!1),qe.addEventListener("error",function(Ft){console.error(Ft)},!1),qe.open("POST","".concat(_.a,"/api/attachments.json")),qe.send(Et)}var De=h("giR+"),Qe=h("fyUT"),tt=h("7Kak"),ot=h("9yH6"),$e=ot.a.Group,Ke={margin:"0 8px"},At=function(ge){var lt=ge.callback,Et=ge.onCancel;function qe(Ft){lt(Ft)}return A.a.createElement(Pe.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:qe},A.a.createElement("div",{className:"flex-container"},A.a.createElement("span",{style:Ke},"\u5355\u5143\u683C\u6570\uFF1A"),A.a.createElement("span",{style:Ke},"\u884C\u6570"),A.a.createElement(Pe.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},A.a.createElement(Qe.a,null)),A.a.createElement("span",{style:Ke},"\u5217\u6570"),A.a.createElement(Pe.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},A.a.createElement(Qe.a,null))),A.a.createElement("div",{className:"flex-container",style:{marginTop:12}},A.a.createElement("span",{style:Ke},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),A.a.createElement(Pe.a.Item,{name:"align"},A.a.createElement($e,null,A.a.createElement(ot.a,{value:"default"},A.a.createElement("i",{className:"fa fa-align-justify"})),A.a.createElement(ot.a,{value:"left"},A.a.createElement("i",{className:"fa fa-align-left"})),A.a.createElement(ot.a,{value:"center"},A.a.createElement("i",{className:"fa fa-align-center"})),A.a.createElement(ot.a,{value:"right"},A.a.createElement("i",{className:"fa fa-align-right"}))))),A.a.createElement("div",{className:"flex-container flex-end"},A.a.createElement(le.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(le.a,{type:"ghost",onClick:Et},"\u53D6\u6D88")))},gt=h("ErOA"),kt=h("7Cbv"),ct="link",Pt="upload-image",xt="code-block",bt="add-table",Le="------------",Ut={default:Le,left:":".concat(Le),center:":".concat(Le,":"),right:"".concat(Le,":")},Rt=h("9VGf"),Ne,We;function G(){}var ee=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 U(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"],ke=(Ne={},Object(w.a)(Ne,de+"-B","bold"),Object(w.a)(Ne,de+"-I","italic"),Ne),_t=(We={},Object(w.a)(We,ct,"\u6DFB\u52A0\u94FE\u63A5"),Object(w.a)(We,xt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(w.a)(We,Pt,"\u6DFB\u52A0\u6587\u4EF6"),Object(w.a)(We,bt,"\u6DFB\u52A0\u8868\u683C"),We),at=je.a=function(ge){var lt=ge.defaultValue,Et=lt===void 0?"":lt,qe=ge.onChange,Ft=ge.width,et=Ft===void 0?"100%":Ft,Ht=ge.height,It=Ht===void 0?400:Ht,vt=ge.miniToolbar,$t=vt===void 0?!1:vt,Lt=ge.isFocus,Be=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,Ge=nn===void 0?!1:nn,st=ge.onBlur,fn=ge.onCMBeforeChange,gn=ge.onFullScreen,Tn=ge.className,Bn=Tn===void 0?"":Tn,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,ie=Object(N.useState)(null),Ye=Object(j.a)(ie,2),_e=Ye[0],Bt=Ye[1],Ee=Object(N.useState)(Et),ce=Object(j.a)(Ee,2),Xe=ce[0],Tt=ce[1],Mt=Object(N.useState)(ut),Ot=Object(j.a)(Mt,2),Dt=Ot[0],cn=Ot[1],Nn=Object(N.useState)(Ge),Cn=Object(j.a)(Nn,2),pn=Cn[0],Wn=Cn[1],jn=Object(N.useState)(""),ti=Object(j.a)(jn,2),xi=ti[0],Fn=ti[1],Xn=Object(N.useState)(0),$i=Object(j.a)(Xn,2),ri=$i[0],wn=$i[1],zi=Object(N.useState)(It),la=Object(j.a)(zi,2),ia=la[0],$n=la[1],yn=Object(N.useState)(!1),di=Object(j.a)(yn,2),vn=di[0],ni=di[1],An=Object(N.useRef)(Object(kt.a)()),Si=Object(N.useRef)(!1),ii=Object(N.useRef)(),Zn=Object(N.useRef)(),Yi=Object(N.useRef)(),Ji=Object(N.useRef)(),aa=Object(N.useRef)(),Sa=function(){var zt=Object(oe.a)(O.a.mark(function qt(){var Jt,rn;return O.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 zt.apply(this,arguments)}}();Object(N.useEffect)(function(){Tt(c),_e==null||_e.setValue(c)},[c]),Object(N.useEffect)(function(){gn==null||gn(pn)},[pn]),Object(N.useEffect)(function(){if(Zn.current){var zt=B.a.fromTextArea(Zn.current,{mode:Kt,lineNumbers:!$t,lineWrapping:!0,value:Et,autoCloseTags:!0,autoCloseBrackets:!0});Be&&zt.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();Te(un,function(kn){if(kn.id){var hi,On,Hi;(un==null||((hi=un.type)===null||hi===void 0)?void 0:hi.indexOf("image"))>-1?zt.replaceSelection("![,](/api/attachments/".concat(kn.id,"?type=").concat(kn.content_type,")")):(un==null||((On=un.type)===null||On===void 0)?void 0:On.indexOf("video"))>-1?zt.replaceSelection('<video width="100%" controls src="'.concat(P.a.API_SERVER,"/api/attachments/").concat(kn.id,'"></video>')):(un==null||((Hi=un.type)===null||Hi===void 0)?void 0:Hi.indexOf("pdf"))>-1?zt.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)?zt.replaceSelection('<a href="'.concat(P.a.API_SERVER,"/api/attachments/").concat(kn.id,'?type=office&disposition=inline" target="_blank">').concat(un.name,"</a>")):zt.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){pe.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return zt.on("paste",qt),zt.on("dragleave",function(Jt,rn){Yi.current.classList.remove("mouse-hover-md")}),zt.on("dragover",function(Jt,rn){Yi.current.classList.add("mouse-hover-md")}),zt.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();Te(un,function(kn){if(kn.id){var hi,On,Hi;(un==null||((hi=un.type)===null||hi===void 0)?void 0:hi.indexOf("image"))>-1?zt.replaceSelection("![,](/api/attachments/".concat(kn.id,"?type=").concat(kn.content_type,")")):(un==null||((On=un.type)===null||On===void 0)?void 0:On.indexOf("video"))>-1?zt.replaceSelection('<video width="100%" controls src="'.concat(P.a.API_SERVER,"/api/attachments/").concat(kn.id,'"></video>')):(un==null||((Hi=un.type)===null||Hi===void 0)?void 0:Hi.indexOf("pdf"))>-1?zt.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)?zt.replaceSelection('<a href="'.concat(P.a.API_SERVER,"/api/attachments/").concat(kn.id,'?type=office&disposition=inline" target="_blank">').concat(un.name,"</a>")):zt.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(zt),function(){zt.off("paste",qt)}}},[]);var Sn=Object(N.useCallback)(function(){if(Yi.current)try{}catch(zt){console.log(zt,"---- to set md editor body height")}},[ia,Yi,pn]);Object(N.useEffect)(function(){function zt(){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=zt();return function(){qt.unobserve(Zn.current.parentElement)}}},[_e,Sn]),Object(N.useEffect)(function(){if(_e){for(var zt=[],qt=function(){var dn=rn[Jt];mn=Object(j.a)(dn,2);var Mn=mn[0],Yn=mn[1],un=Object(w.a)({},Mn,function(){Qi(Yn)});zt.push(un),_e.addKeyMap(un)},Jt=0,rn=Object.entries(ke);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)(zt),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(N.useEffect)(function(){Ge!==pn&&Wn(Ge)},[Ge]),Object(Rt.a)(function(){if(!Nt&&ri>0){var zt=new Date().getTime(),qt=window.sessionStorage.getItem(an);zt>=ri+Q&&(!qt||qt!==Xe)&&(window.sessionStorage.setItem(an,Xe),ni(!0))}},Q),Object(N.useEffect)(function(){cn(ut)},[_e,ut]),Object(N.useEffect)(function(){_e&&(Be&&_e.focus())},[_e,Be]),Object(N.useEffect)(function(){if(Dt&&_e){var zt=_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 zt.addEventListener("scroll",qt),function(){zt.removeEventListener("scroll",qt)}}},[_e,Dt]),Object(N.useEffect)(function(){if(_e&&fn){function zt(qt,Jt){fn(qt,Jt)}return _e.on("beforeChange",zt),function(){_e.off("beforeChange",zt)}}},[_e,fn]),Object(N.useEffect)(function(){if(_e&&st){function zt(){st(_e.getValue())}return _e.on("blur",zt),function(){_e.off("blur",zt)}}},[_e,st]),Object(N.useEffect)(function(){if(_e){function zt(qt){var Jt=qt.getValue();Tt(Jt),wn(new Date().getTime()),qt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),qe&&qe(Jt)}return _e.on("change",zt),function(){_e.off("change",zt)}}},[_e,qe]),Object(N.useEffect)(function(){_e&&(Et==null?(_e.setValue(""),Tt("")):Et!==_e.getValue()&&(_e.setValue(Et),Tt(Et),_e.setCursor(_e.lineCount(),0)))},[_e,Et]);var Qi=Object(N.useCallback)(function(zt){var qt=_e.getCursor(),Jt=_e.getSelection(),rn=Jt.split(`
`);switch(zt){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]),Oi=Object(N.useCallback)(function(zt){Fn("");switch(xi){case ct:var qt=zt.title,Jt=zt.link;return _e.replaceSelection("[".concat(qt,"](").concat(Jt,")")),_e.focus();case xt:var rn=zt.language,mn=zt.content;return _e.replaceSelection(["```"+rn,mn,"```"].join(`
`)),_e.focus();case Pt:var _n=zt.src,dn=zt.alt,Mn=zt.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=zt.row,un=zt.col,ca=zt.align,kn=`
`,hi=0;hi<Yn;hi++){for(var On=[],Hi=[],da=0;da<un;da++)hi===1&&Hi.push(Ut[ca]),On.push(" ");hi===1&&(kn+="| ".concat(Hi.join(" | "),` |
`)),kn+="| ".concat(On.join(un===1?"":" | "),` |
`)}return _e.replaceSelection(kn+`
`),_e.focus();default:throw new Error}},[_e,xi]),ua=Object(N.useMemo)(function(){switch(xi){case ct:return A.a.createElement($,{callback:Oi,onCancel:Pi});case xt:return A.a.createElement(K.b,{callback:Oi,onCancel:Pi});case Pt:return A.a.createElement(Me,{callback:Oi,onCancel:Pi});case bt:return A.a.createElement(At,{callback:Oi,onCancel:Pi});default:return null}},[xi]);function Pi(){Fn("")}Object(N.useEffect)(function(){if(Ji.current){var zt=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 zt.addEventListener("mousedown",rn),document.addEventListener("mousemove",_n),document.addEventListener("mouseup",mn),function(){zt.removeEventListener("mousedown",rn),document.removeEventListener("mousemove",_n),document.removeEventListener("mouseup",mn)}}},[_e,Ji]),Object(N.useEffect)(function(){$n(It)},[It]);var oa=U(et),ra=U(ia),eo={width:oa,height:ra},to=Object(N.useMemo)(function(){if(ri){var zt=new Date(ri),qt=zt.getHours(),Jt=zt.getMinutes(),rn=zt.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 Oo(){window.sessionStorage.removeItem(an),ni(!1),wn(0)}function no(){ni(!1),wn(0),_e.setValue(window.sessionStorage.getItem(an))}function Ia(zt,qt){var Jt=_e.getValue();Jt=Jt.replace(zt,qt),Tt(Jt),_e==null||_e.setValue(Jt)}return A.a.createElement(N.Fragment,null,A.a.createElement("div",{className:"markdown-editor-wrapper",ref:Yi},A.a.createElement("div",{className:"markdown-editor-container ".concat(Bn," ").concat(Dt?"on-preview":""," ").concat($t?"mini":""," ").concat(pn?"full-screen":""),style:eo},A.a.createElement(be,{insertTemp:nt,watch:Dt,fullScreen:pn,showNullButton:Xt,onActionCallback:Qi,hidetoolBar:Kn,uuid:An.current,setOpenPhones:function(){Si.current=!0}}),A.a.createElement("div",{className:"markdown-editor-body"},A.a.createElement("div",{className:"codemirror-container"},A.a.createElement("textarea",{ref:Zn,placeholder:u})),Dt?A.a.createElement("div",{ref:aa,className:"preview-container"},Kt==="stex"&&A.a.createElement(g,{value:Xe}),Kt!=="stex"&&A.a.createElement(q.a,{edit:!0,value:Xe,replaces:Ia})):null))),Ct?A.a.createElement("a",{ref:Ji,className:"editor-resize"}):null,A.a.createElement(M.a,null,_t[xi]?A.a.createElement(ve.a,{centered:!0,title:_t[xi],visible:!0,onCancel:Pi,footer:null},ua):null))}},PGNT:function(Je,je,h){Je.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(Je,je,h){Je.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(Je,je,h){Je.exports=h.p+"static/wenhao.50b63ac4.svg"},"RZ/O":function(Je,je,h){Je.exports=h.p+"static/bi.9c9b0364.svg"},SJMd:function(Je,je){/**
* @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,pe;window.PR_SHOULD_USE_CONTINUATION=!0;var oe,j;(function(){var w=window,T=["break,continue,do,else,for,if,return,while"],O=[T,"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"],N=[O,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],A=[N,"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=[N,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],B=[N,"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",F=[N,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],z="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",Y=[T,"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=[T,"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=[T,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Re=[A,B,te,F,z,Y,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/,q="str",g="kwd",re="com",k="typ",X="lit",S="pun",C="pln",J="tag",H="dec",E="src",P="atn",ae="atv",W="nocode",be="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function M(Te){for(var De=0,Qe=!1,tt=!1,ot=0,$e=Te.length;ot<$e;++ot){var Ke=Te[ot];if(Ke.ignoreCase)tt=!0;else if(/[a-z]/i.test(Ke.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Qe=!0,tt=!1;break}}var At={b:8,t:9,n:10,v:11,f:12,r:13};function gt(bt){var Le=bt.charCodeAt(0);if(Le!==92)return Le;var Ut=bt.charAt(1);return Le=At[Ut],Le||("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 Le=String.fromCharCode(bt);return Le==="\\"||Le==="-"||Le==="]"||Le==="^"?"\\"+Le:Le}function ct(bt){var Le=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=Le[0]==="^",Ne=["["];Rt&&Ne.push("^");for(var We=Rt?1:0,G=Le.length;We<G;++We){var ee=Le[We];if(/\\[bdsw]/i.test(ee))Ne.push(ee);else{var Q=gt(ee),x;We+2<G&&Le[We+1]==="-"?(x=gt(Le[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=[],U=[],We=0;We<Ut.length;++We){var I=Ut[We];I[0]<=U[1]+1?U[1]=Math.max(U[1],I[1]):R.push(U=I)}for(var We=0;We<R.length;++We){var I=R[We];Ne.push(kt(I[0])),I[1]>I[0]&&(I[1]+1>I[0]&&Ne.push("-"),Ne.push(kt(I[1])))}return Ne.push("]"),Ne.join("")}function Pt(bt){for(var Le=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=Le.length,Rt=[],Ne=0,We=0;Ne<Ut;++Ne){var G=Le[Ne];if(G==="(")++We;else if(G.charAt(0)==="\\"){var ee=+G.substring(1);ee&&(ee<=We?Rt[ee]=-1:Le[Ne]=kt(ee))}}for(var Ne=1;Ne<Rt.length;++Ne)Rt[Ne]===-1&&(Rt[Ne]=++De);for(var Ne=0,We=0;Ne<Ut;++Ne){var G=Le[Ne];if(G==="(")++We,Rt[We]||(Le[Ne]="(?:");else if(G.charAt(0)==="\\"){var ee=+G.substring(1);ee&&ee<=We&&(Le[Ne]="\\"+Rt[ee])}}for(var Ne=0;Ne<Ut;++Ne)Le[Ne]==="^"&&Le[Ne+1]!=="^"&&(Le[Ne]="");if(bt.ignoreCase&&Qe)for(var Ne=0;Ne<Ut;++Ne){var G=Le[Ne],Q=G.charAt(0);G.length>=2&&Q==="["?Le[Ne]=ct(G):Q!=="\\"&&(Le[Ne]=G.replace(/[a-zA-Z]/g,function(U){var I=U.charCodeAt(0);return"["+String.fromCharCode(I&~32,I|32)+"]"}))}return Le.join("")}for(var xt=[],ot=0,$e=Te.length;ot<$e;++ot){var Ke=Te[ot];if(Ke.global||Ke.multiline)throw new Error(""+Ke);xt.push("(?:"+Pt(Ke)+")")}return new RegExp(xt.join("|"),tt?"gi":"g")}function p(Te,De){var Qe=/(?:^|\s)nocode(?:\s|$)/,tt=[],ot=0,$e=[],Ke=0;function At(gt){var kt=gt.nodeType;if(kt==1){if(Qe.test(gt.className))return;for(var ct=gt.firstChild;ct;ct=ct.nextSibling)At(ct);var Pt=gt.nodeName.toLowerCase();(Pt==="br"||Pt==="li")&&(tt[Ke]=`
`,$e[Ke<<1]=ot++,$e[Ke++<<1|1]=gt)}else if(kt==3||kt==4){var xt=gt.nodeValue;xt.length&&(De?xt=xt.replace(/\r\n?/g,`
`):xt=xt.replace(/[ \t\r\n]+/g," "),tt[Ke]=xt,$e[Ke<<1]=ot,ot+=xt.length,$e[Ke++<<1|1]=gt)}}return At(Te),{sourceCode:tt.join("").replace(/\n$/,""),spans:$e}}function le(Te,De,Qe,tt,ot){if(!Qe)return;var $e={sourceNode:Te,pre:1,langExtension:null,numberLines:null,sourceCode:Qe,spans:null,basePos:De,decorations:null};tt($e),ot.push.apply(ot,$e.decorations)}var Ue=/\S/;function Pe(Te){for(var De=void 0,Qe=Te.firstChild;Qe;Qe=Qe.nextSibling){var tt=Qe.nodeType;De=tt===1?De?Te:Qe:tt===3&&Ue.test(Qe.nodeValue)?Te:De}return De===Te?void 0:De}function He(Te,De){var Qe={},tt;(function(){for(var Ke=Te.concat(De),At=[],gt={},kt=0,ct=Ke.length;kt<ct;++kt){var Pt=Ke[kt],xt=Pt[3];if(xt)for(var bt=xt.length;--bt>=0;)Qe[xt.charAt(bt)]=Pt;var Le=Pt[1],Ut=""+Le;gt.hasOwnProperty(Ut)||(At.push(Le),gt[Ut]=null)}At.push(/[\0-\uffff]/),tt=M(At)})();var ot=De.length,$e=function(Ke){for(var At=Ke.sourceCode,gt=Ke.basePos,kt=Ke.sourceNode,ct=[gt,C],Pt=0,xt=At.match(tt)||[],bt={},Le=0,Ut=xt.length;Le<Ut;++Le){var Rt=xt[Le],Ne=bt[Rt],We=void 0,G;if(typeof Ne=="string")G=!1;else{var ee=Qe[Rt.charAt(0)];if(ee)We=Rt.match(ee[1]),Ne=ee[0];else{for(var Q=0;Q<ot;++Q)if(ee=De[Q],We=Rt.match(ee[1]),We){Ne=ee[0];break}We||(Ne=C)}G=Ne.length>=5&&Ne.substring(0,5)==="lang-",G&&!(We&&typeof We[1]=="string")&&(G=!1,Ne=E),G||(bt[Rt]=Ne)}var x=Pt;if(Pt+=Rt.length,!G)ct.push(gt+x,Ne);else{var R=We[1],U=Rt.indexOf(R),I=U+R.length;We[2]&&(I=Rt.length-We[2].length,U=I-R.length);var de=Ne.substring(5);le(kt,gt+x,Rt.substring(0,U),$e,ct),le(kt,gt+x+U,R,_(de,R),ct),le(kt,gt+x+I,Rt.substring(I),$e,ct)}}Ke.decorations=ct};return $e}function Oe(Te){var De=[],Qe=[];Te.tripleQuotedStrings?De.push([q,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Te.multiLineStrings?De.push([q,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):De.push([q,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Te.verbatimStrings&&Qe.push([q,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var tt=Te.hashComments;tt&&(Te.cStyleComments?(tt>1?De.push([re,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):De.push([re,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Qe.push([q,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):De.push([re,/^#[^\r\n]*/,null,"#"])),Te.cStyleComments&&(Qe.push([re,/^\/\/[^\r\n]*/,null]),Qe.push([re,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ot=Te.regexLiterals;if(ot){var $e=ot>1?"":`
\r`,Ke=$e?".":"[\\S\\s]",At="/(?=[^/*"+$e+"])(?:[^/\\x5B\\x5C"+$e+"]|\\x5C"+Ke+"|\\x5B(?:[^\\x5C\\x5D"+$e+"]|\\x5C"+Ke+")*(?:\\x5D|$))+/";Qe.push(["lang-regex",RegExp("^"+be+"("+At+")")])}var gt=Te.types;gt&&Qe.push([k,gt]);var kt=(""+Te.keywords).replace(/^ | $/g,"");kt.length&&Qe.push([g,new RegExp("^(?:"+kt.replace(/[\s,]+/g,"|")+")\\b"),null]),De.push([C,/^\s+/,null,` \r
\xA0`]);var ct="^.[^\\s\\w.$@'\"`/\\\\]*";return Te.regexLiterals&&(ct+="(?!s*/)"),Qe.push([X,/^@[a-z_$][a-z_$@0-9]*/i,null],[k,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[C,/^[a-z_$][a-z_$@0-9]*/i,null],[X,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[C,/^\\[\s\S]?/,null],[S,new RegExp(ct),null]),He(De,Qe)}var Se=Oe({keywords:Re,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function $(Te,De,Qe){for(var tt=/(?:^|\s)nocode(?:\s|$)/,ot=/\r\n?|\n/,$e=Te.ownerDocument,Ke=$e.createElement("li");Te.firstChild;)Ke.appendChild(Te.firstChild);var At=[Ke];function gt(Le){var Ut=Le.nodeType;if(Ut==1&&!tt.test(Le.className))if(Le.nodeName==="br")kt(Le),Le.parentNode&&Le.parentNode.removeChild(Le);else for(var Rt=Le.firstChild;Rt;Rt=Rt.nextSibling)gt(Rt);else if((Ut==3||Ut==4)&&Qe){var Ne=Le.nodeValue,We=Ne.match(ot);if(We){var G=Ne.substring(0,We.index);Le.nodeValue=G;var ee=Ne.substring(We.index+We[0].length);if(ee){var Q=Le.parentNode;Q.insertBefore($e.createTextNode(ee),Le.nextSibling)}kt(Le),G||Le.parentNode.removeChild(Le)}}}function kt(Le){for(;!Le.nextSibling;)if(Le=Le.parentNode,!Le)return;function Ut(We,G){var ee=G?We.cloneNode(!1):We,Q=We.parentNode;if(Q){var x=Ut(Q,1),R=We.nextSibling;x.appendChild(ee);for(var U=R;U;U=R)R=U.nextSibling,x.appendChild(U)}return ee}for(var Rt=Ut(Le.nextSibling,0),Ne;(Ne=Rt.parentNode)&&Ne.nodeType===1;)Rt=Ne;At.push(Rt)}for(var ct=0;ct<At.length;++ct)gt(At[ct]);De===(De|0)&&At[0].setAttribute("value",De);var Pt=$e.createElement("ol");Pt.className="linenums";for(var xt=Math.max(0,De-1|0)||0,ct=0,bt=At.length;ct<bt;++ct)Ke=At[ct],Ke.className="L"+(ct+xt)%10,Ke.firstChild||Ke.appendChild($e.createTextNode("\xA0")),Pt.appendChild(Ke);Te.appendChild(Pt)}function K(Te){var De=/\bMSIE\s(\d+)/.exec(navigator.userAgent);De=De&&+De[1]<=8;var Qe=/\n/g,tt=Te.sourceCode,ot=tt.length,$e=0,Ke=Te.spans,At=Ke.length,gt=0,kt=Te.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 Le=kt[bt],Ut=kt[bt+1],Rt=bt+2;Rt+2<=ct&&kt[Rt+1]===Ut;)Rt+=2;kt[xt++]=Le,kt[xt++]=Ut,bt=Rt}ct=kt.length=xt;var Ne=Te.sourceNode,We="";Ne&&(We=Ne.style.display,Ne.style.display="none");try{for(var G=null;gt<At;){var ee=Ke[gt],Q=Ke[gt+2]||ot,x=kt[Pt+2]||ot,Rt=Math.min(Q,x),R=Ke[gt+1],U;if(R.nodeType!==1&&(U=tt.substring($e,Rt))){De&&(U=U.replace(Qe,"\r")),R.nodeValue=U;var I=R.ownerDocument,de=I.createElement("span");de.className=kt[Pt+1];var Ce=R.parentNode;Ce.replaceChild(de,R),de.appendChild(R),$e<Q&&(Ke[gt+1]=R=I.createTextNode(tt.substring(Rt,Q)),Ce.insertBefore(R,de.nextSibling))}$e=Rt,$e>=Q&&(gt+=2),$e>=x&&(Pt+=2)}}finally{Ne&&(Ne.style.display=We)}}var ue={};function D(Te,De){for(var Qe=De.length;--Qe>=0;){var tt=De[Qe];ue.hasOwnProperty(tt)?w.console&&console.warn("cannot override language handler %s",tt):ue[tt]=Te}}function _(Te,De){return Te&&ue.hasOwnProperty(Te)||(Te=/^\s*</.test(De)?"default-markup":"default-code"),ue[Te]}D(Se,["default-code"]),D(He([],[[C,/^[^<?]+/],[H,/^<!\w[^>]*(?:>|$)/],[re,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[S,/^(?:<[%?]|[%?]>)/],["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"]),D(He([[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)))/],[S,/^[=<>\/]+/],["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"]),D(He([],[[ae,/^[\s\S]+/]]),["uq.val"]),D(Oe({keywords:A,hashComments:!0,cStyleComments:!0,types:he}),["c","cc","cpp","cxx","cyc","m"]),D(Oe({keywords:"null,true,false"}),["json"]),D(Oe({keywords:B,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:he}),["cs"]),D(Oe({keywords:te,cStyleComments:!0}),["java"]),D(Oe({keywords:fe,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),D(Oe({keywords:Y,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),D(Oe({keywords:z,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),D(Oe({keywords:b,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),D(Oe({keywords:F,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),D(Oe({keywords:L,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),D(He([],[[q,/^[\s\S]+/]]),["regex"]);function me(Te){var De=Te.langExtension;try{var Qe=p(Te.sourceNode,Te.pre),tt=Qe.sourceCode;Te.sourceCode=tt,Te.spans=Qe.spans,Te.basePos=0,_(De,tt)(Te),K(Te)}catch(ot){w.console&&console.log(ot&&ot.stack||ot)}}function Ie(Te,De,Qe){var tt=Qe||!1,ot=De||null,$e=document.createElement("div");$e.innerHTML="<pre>"+Te+"</pre>",$e=$e.firstChild,tt&&$($e,tt,!0);var Ke={langExtension:ot,numberLines:tt,sourceNode:$e,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return me(Ke),$e.innerHTML}function Ze(Te,De){var Qe=De||document.body,tt=Qe.ownerDocument||document;function ot(ee){return Qe.getElementsByTagName(ee)}for(var $e=[ot("pre"),ot("code"),ot("xmp")],Ke=[],At=0;At<$e.length;++At)for(var gt=0,kt=$e[At].length;gt<kt;++gt)Ke.push($e[At][gt]);$e=null;var ct=Date;ct.now||(ct={now:function(){return+new Date}});var Pt=0,xt=/\blang(?:uage)?-([\w.]+)(?!\S)/,bt=/\bprettyprint\b/,Le=/\bprettyprinted\b/,Ut=/pre|xmp/i,Rt=/^code$/i,Ne=/^(?:pre|code|xmp)$/i,We={};function G(){for(var ee=w.PR_SHOULD_USE_CONTINUATION?ct.now()+250:Infinity;Pt<Ke.length&&ct.now()<ee;Pt++){for(var Q=Ke[Pt],x=We,R=Q;R=R.previousSibling;){var U=R.nodeType,I=(U===7||U===8)&&R.nodeValue;if(I?!/^\??prettify\b/.test(I):U!==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))&&!Le.test(de)){for(var Ce=!1,ke=Q.parentNode;ke;ke=ke.parentNode){var _t=ke.tagName;if(Ne.test(_t)&&ke.className&&bt.test(ke.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,qe=tt.defaultView,Ft=Et?Et.whiteSpace:qe&&qe.getComputedStyle?qe.getComputedStyle(Q,null).getPropertyValue("white-space"):0;lt=Ft&&Ft.substring(0,3)==="pre"}var et=x.linenums;(et=et==="true"||+et)||(et=de.match(/\blinenums\b(?::(\d+))?/),et=et?et[1]&&et[1].length?+et[1]:!0:!1),et&&$(Q,et,lt);var Ht={langExtension:at,sourceNode:Q,numberLines:et,pre:lt,sourceCode:null,basePos:null,spans:null,decorations:null};me(Ht)}}}Pt<Ke.length?w.setTimeout(G,250):typeof Te=="function"&&Te()}G()}var Me=w.PR={createSimpleLexer:He,registerLangHandler:D,sourceDecorator:Oe,PR_ATTRIB_NAME:P,PR_ATTRIB_VALUE:ae,PR_COMMENT:re,PR_DECLARATION:H,PR_KEYWORD:g,PR_LITERAL:X,PR_NOCODE:W,PR_PLAIN:C,PR_PUNCTUATION:S,PR_SOURCE:E,PR_STRING:q,PR_TAG:J,PR_TYPE:k,prettyPrintOne:se?w.prettyPrintOne=Ie:oe=Ie,prettyPrint:j=se?w.prettyPrint=Ze:j=Ze},Fe=w.define;typeof Fe=="function"&&Fe.amd&&Fe("google-code-prettify",[],function(){return Me})})()},"VrN/":function(Je,je,h){(function(V,ve){Je.exports=ve()})(this,function(){"use strict";var V=navigator.userAgent,ve=navigator.platform,se=/gecko\/\d/i.test(V),xe=/MSIE \d/.test(V),pe=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(V),oe=/Edge\/(\d+)/.exec(V),j=xe||pe||oe,w=j&&(xe?document.documentMode||6:+(oe||pe)[1]),T=!oe&&/WebKit\//.test(V),O=T&&/Qt\/\d+\.\d+/.test(V),N=!oe&&/Chrome\//.test(V),A=/Opera\//.test(V),te=/Apple Computer/.test(navigator.vendor),B=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(V),L=/PhantomJS/.test(V),F=!oe&&/AppleWebKit/.test(V)&&/Mobile\/\w+/.test(V),z=/Android/.test(V),Y=F||z||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(V),b=F||/Mac/.test(ve),fe=/\bCrOS\b/.test(V),Re=/win/i.test(ve),he=A&&V.match(/Version\/(\d*\.\d*)/);he&&(he=Number(he[1])),he&&he>=15&&(A=!1,T=!0);var q=b&&(O||A&&(he==null||he<12.11)),g=se||j&&w>=9;function re(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var k=function(e,t){var i=e.className,n=re(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 X(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function S(e,t){return X(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 H;document.createRange?H=function(e,t,i,n){var a=document.createRange();return a.setEnd(n||e,i),a.setStart(e,t),a}:H=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;re(t).test(i)||(e.className+=(i?" ":"")+t)}function W(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!re(i[n]).test(t)&&(t+=" "+i[n]);return t}var be=function(e){e.select()};F?be=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:j&&(be=function(e){try{e.select()}catch(t){}});function M(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 le(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 Ue=function(){this.id=null,this.f=null,this.time=0,this.handler=M(this.onTimeout,this)};Ue.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Ue.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 He=50,Oe={toString:function(){return"CodeMirror.Pass"}},Se={scroll:!1},$={origin:"*mouse"},K={origin:"+move"};function ue(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 D=[""];function _(e){for(;D.length<=e;)D.push(me(D)+" ");return D[e]}function me(e){return e[e.length-1]}function Ie(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 Me(){}function Fe(e,t){var i;return Object.create?i=Object.create(e):(Me.prototype=e,i=new Me),t&&p(t,i),i}var Te=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function De(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Te.test(e))}function Qe(e,t){return t?t.source.indexOf("\\w")>-1&&De(e)?!0:t.test(e):De(e)}function tt(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 $e(e){return e.charCodeAt(0)>=768&&ot.test(e)}function Ke(e,t,i){for(;(i<0?t>0:t<e.length)&&$e(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,ne){this.level=y,this.from=Z,this.to=ne}return function(y,Z){var ne=Z=="ltr"?"L":"R";if(y.length==0||Z=="ltr"&&!n.test(y))return!1;for(var we=y.length,ye=[],Ve=0;Ve<we;++Ve)ye.push(i(y.charCodeAt(Ve)));for(var it=0,ht=ne;it<we;++it){var wt=ye[it];wt=="m"?ye[it]=ht:ht=wt}for(var jt=0,St=ne;jt<we;++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<we-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<we;++In){var Ei=ye[In];if(Ei==",")ye[In]="N";else if(Ei=="%"){var Qn=void 0;for(Qn=In+1;Qn<we&&ye[Qn]=="%";++Qn);for(var Vi=In&&ye[In-1]=="!"||Qn<we&&ye[Qn]=="1"?"1":"N",Bi=In;Bi<Qn;++Bi)ye[Bi]=Vi;In=Qn-1}}for(var ui=0,Fi=ne;ui<we;++ui){var wi=ye[ui];Fi=="L"&&wi=="1"?ye[ui]="L":s.test(wi)&&(Fi=wi)}for(var fi=0;fi<we;++fi)if(a.test(ye[fi])){var ci=void 0;for(ci=fi+1;ci<we&&a.test(ye[ci]);++ci);for(var ei=(fi?ye[fi-1]:ne)=="L",Wi=(ci<we?ye[ci]:ne)=="L",Za=ei==Wi?ei?"L":"R":ne,wa=fi;wa<ci;++wa)ye[wa]=Za;fi=ci-1}for(var Ti=[],sa,Ci=0;Ci<we;)if(l.test(ye[Ci])){var Rr=Ci;for(++Ci;Ci<we&&l.test(ye[Ci]);++Ci);Ti.push(new m(0,Rr,Ci))}else{var pa=Ci,ja=Ti.length,Ua=Z=="rtl"?1:0;for(++Ci;Ci<we&&ye[Ci]!="L";++Ci);for(var Ni=pa;Ni<Ci;)if(f.test(ye[Ni])){pa<Ni&&(Ti.splice(ja,0,new m(1,pa,Ni)),ja+=Ua);var qa=Ni;for(++Ni;Ni<Ci&&f.test(ye[Ni]);++Ni);Ti.splice(ja,0,new m(2,qa,Ni)),ja+=Ua,pa=Ni}else++Ni;pa<Ci&&Ti.splice(ja,0,new m(1,pa,Ci))}return Z=="ltr"&&(Ti[0].level==1&&(sa=y.match(/^\s+/))&&(Ti[0].from=sa[0].length,Ti.unshift(new m(0,0,sa[0].length))),me(Ti).level==1&&(sa=y.match(/\s+$/))&&(me(Ti).to-=sa[0].length,Ti.push(new m(0,we-sa[0].length,we)))),Z=="rtl"?Ti.reverse():Ti}}();function xt(e,t){var i=e.order;return i==null&&(i=e.order=Pt(e.text,t)),i}var bt=[],Le=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 Ne(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}}),Ne(e,i||t.type,e,t),U(t)||t.codemirrorIgnore}function G(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 ee(e,t){return Ut(e,t).length>0}function Q(e){e.prototype.on=function(t,i){Le(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 U(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 ke=function(){if(j&&w<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");S(e,C("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(_t=t.offsetWidth<=1&&t.offsetHeight>2&&!(j&&w<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=S(e,document.createTextNode("A\u062EA")),i=H(t,0,1).getBoundingClientRect(),n=H(t,1,2).getBoundingClientRect();return X(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/)},qe=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")}(),et=null;function Ht(e){if(et!=null)return et;var t=S(e,C("span","x")),i=t.getBoundingClientRect(),n=H(t,0,1).getBoundingClientRect();return et=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 Be(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=Fe(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Be("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Be("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function ut(e,t){t=Be(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=le(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?le(this.string,this.lineStart,this.tabSize):0)},Gt.prototype.indentation=function(){return le(this.string,null,this.tabSize)-(this.lineStart?le(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 Ge(e,t,i){if(i===void 0&&(i=null),!(this instanceof Ge))return new Ge(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 Ge(e.line,e.ch)}function Tn(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 Ge(e.first,0);var i=e.first+e.size-1;return t.line>i?Ge(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?Ge(e.line,t):i<0?Ge(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 ie(e,t,i,n){var a=[e.state.modeGen],s={};Ot(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],ne=1,we=0;i.state=!0,Ot(e,t.text,Z.mode,i,function(ye,Ve){for(var it=ne;we<ye;){var ht=a[ne];ht>ye&&a.splice(ne,1,ye,a[ne+1],ht),ne+=2,we=Math.min(ye,ht)}if(!Ve)return;if(Z.opaque)a.splice(it,ne-it,ye,"overlay "+Ve),ne=it+2;else for(;it<ne;it+=2){var wt=a[it+1];a[it+1]=(wt?wt+" ":"")+"overlay "+Ve}},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 Ye(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=ie(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 Xe=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Tt(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 Xe(y,l,Kt(a.mode,m.state)));return n?Z:new Xe(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 Ot(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),ne,we=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,ne=null):ne=Mt(ce(i,Z,n.state,we),s),we){var ye=we[0].name;ye&&(ne="m-"+(ne?ye+" "+ne:ye))}if(!f||y!=ne){for(;m<Z.start;)m=Math.min(Z.start,m+5e3),a(m,y);y=ne}Z.start=Z.pos}for(;m<Z.pos;){var Ve=Math.min(Z.pos,m+5e3);a(Ve,y),m=Ve}}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=le(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=me(t.text).length+(y?a:0);if(f)for(var ne=0;ne<f.length;++ne){var we=f[ne];if(we.to==null){var ye=ti(m,we.marker);ye?y&&(we.to=ye.to==null?null:ye.to+Z):we.to=a}}if(m)for(var Ve=0;Ve<m.length;++Ve){var it=m[Ve];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 zi(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(ye){if(ye.markedSpans)for(var Ve=0;Ve<ye.markedSpans.length;++Ve){var it=ye.markedSpans[Ve].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],ne=st(y.from,f.from),we=st(y.to,f.to);(ne<0||!l.inclusiveLeft&&!ne)&&Z.push({from:y.from,to:f.from}),(we>0||!l.inclusiveRight&&!we)&&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),ne=st(y.to,n)||yn(m.marker)-yn(a);if(Z>=0&&ne<=0||Z<=0&&ne>=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 Oi(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={},Oo={};function no(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Oo:to;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Ia(e,t){var i=J("span",null,null,T?"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,Ye(e,s,f)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=W(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=W(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(T){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 Ne(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=W(n.pre.className,n.textClass||"")),n}function zt(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),j&&w<9&&(y=!0),e.pos+=t.length;else{Z=document.createDocumentFragment();for(var ne=0;;){m.lastIndex=ne;var we=m.exec(t),ye=we?we.index-ne:t.length-ne;if(ye){var Ve=document.createTextNode(f.slice(ne,ne+ye));j&&w<9?Z.appendChild(C("span",[Ve])):Z.appendChild(Ve),e.map.push(e.pos,e.pos+ye,Ve),e.col+=ye,e.pos+=ye}if(!we)break;ne+=ye+1;var it=void 0;if(we[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 we[0]=="\r"||we[0]==`
`?(it=Z.appendChild(C("span",we[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),it.setAttribute("cm-text",we[0]),e.col+=1):(it=e.cm.options.specialCharPlaceholder(we[0]),it.setAttribute("cm-text",we[0]),j&&w<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 ne=void 0,we=0;we<t.length&&!(ne=t[we],ne.to>y&&ne.from<=y);we++);if(ne.to>=Z)return e(i,n,a,s,l,f,m);e(i,n.slice(0,ne.to-y),a,s,null,f,m),s=null,n=n.slice(ne.to-y),y=ne.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="",ne,we,ye=0,Ve,it,ht,wt,jt;;){if(ye==m){Ve=it=ht=we="",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&&(Ve+=" "+sn.className),sn.css&&(we=(we?we+";":"")+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,ne?ne+Ve:Ve,ht,m+ui.length==ye?it:"",we,jt)}if(Bi>=Vi){Z=Z.slice(Vi-m),m=Vi;break}m=Bi,ht=""}Z=a.slice(s,s=i[y++]),ne=no(i[y++],t.cm.options)}}}function dn(e,t,i){this.line=t,this.rest=Ji(t),this.size=this.rest?Xt(me(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 On(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(Hi,0));for(var s=function(f){a.push(function(){return i[f].apply(null,n)})},l=0;l<i.length;++l)s(l)}function Hi(){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),j&&w<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=re("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),On(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;"),S(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 Ta(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Lo(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=S(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 He-e.display.nativeBarWidth}function ea(e){return e.display.scroller.clientWidth-Zi(e)-e.display.barWidth}function Oa(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 ze(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,S(e.display.lineMeasure,a.pre),n}function Ae(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=ze(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&&$e(t.line.text.charAt(a.coverStart+l));)--l;for(;a.coverStart+f<a.coverEnd&&$e(t.line.text.charAt(a.coverStart+f));)++f;if(j&&w<9&&l==0&&f==a.coverEnd-a.coverStart?y=s.parentNode.getBoundingClientRect():y=Pn(H(s,l,f).getClientRects(),n),y.left||y.right||l==0)break;f=l,l=l-1,m="right"}j&&w<11&&(y=Ln(e.display.measure,y))}else{l>0&&(m=n="right");var ne;e.options.lineWrapping&&(ne=s.getClientRects()).length>1?y=ne[n=="right"?ne.length-1:0]:y=s.getBoundingClientRect()}if(j&&w<9&&!l&&(!y||!y.left&&!y.right)){var we=s.parentNode.getClientRects()[0];we?y={left:we.left,right:we.left+ji(e.display),top:we.top,bottom:we.bottom}:y=Qt}for(var ye=y.top-t.rect.top,Ve=y.bottom-t.rect.top,it=(ye+Ve)/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=Ve),Wt}function Ln(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ht(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,X(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)En(e.display.view[t])}function zn(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 Hn(){return N&&z?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function pi(){return N&&z?-(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=Oi(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:Hn());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-=Hn(),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,Ae(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(Ve,it){var ht=yt(e,a,Ve,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(Ve,it,ht){var wt=f[it],jt=wt.level==1;return l(ht?Ve-1:Ve,jt!=ht)}var ne=ct(f,m,y),we=kt,ye=Z(m,ne,y=="before");return we!=null&&(ye.other=Z(m,we,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=Oi(n)+Ba(e.display);return{left:i,right:i,top:a,bottom:a+n.height}}function Jn(e,t,i,n,a){var s=Ge(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-=Oi(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 ne=(e.options.lineWrapping?vi:Vn)(e,t,i,s,Z,n,a);y=ne.level!=1,f=y?ne.from:ne.to-1,m=y?ne.to:ne.from-1}var we=null,ye=null,Ve=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&&(we=Zt,ye=Yt),!0):!1},f,m),it,ht,wt=!1;if(ye){var jt=n-ye.left<ye.right-n,St=jt==y;Ve=we+(St?0:1),ht=St?"after":"before",it=jt?ye.left:ye.right}else{!y&&(Ve==m||Ve==f)&&Ve++,ht=Ve==0?"after":Ve==t.text.length?"before":yt(e,s,Ve-(y?1:0)).bottom+l<=a==y?"after":"before";var Wt=en(e,Ge(i,Ve,ht),"line",t,s);it=Wt.left,wt=a<Wt.top?-1:a>=Wt.bottom?1:0}return Ve=Ke(t.text,Ve,1),Jn(i,Ve,ht,wt,n-it)}function Vn(e,t,i,n,a,s,l){var f=At(function(ne){var we=a[ne],ye=we.level!=1;return Li(en(e,Ge(i,ye?we.to:we.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,Ge(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,ne=null,we=0;we<a.length;we++){var ye=a[we];if(ye.from>=y||ye.to<=m)continue;var Ve=ye.level!=1,it=yt(e,n,Ve?Math.min(y,ye.to)-1:Math.max(m,ye.from)).right,ht=it<s?s-it+1e9:it-s;(!Z||ne>ht)&&(Z=ye,ne=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"))}S(e.measure,ki);var i=ki.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),X(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");S(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 Or(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=Or(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(ne){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=le(y,y.length,e.options.tabSize)-y.length;m=Ge(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 ne(St,Wt,Zt){var Yt=Ct(a,St),sn=Yt.text.length,In,Ei;function Qn(ui,Fi){return Ai(e,Ge(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,Ti=fi==0,sa=!Bi||fi==Bi.length-1;if(Wi.top-ei.top<=3){var Ci=(y?Za:wa)&&Ti,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,Tr;ci?(Ua=y&&Za&&Ti?f:ei.left,Ni=y?m:Vi(ui,wi,"before"),qa=y?f:Vi(Fi,wi,"after"),Tr=y&&wa&&sa?m:Wi.right):(Ua=y?Vi(ui,wi,"before"):f,Ni=!y&&Za&&Ti?m:ei.right,qa=!y&&wa&&sa?f:Wi.left,Tr=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,Tr-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 we=t.from(),ye=t.to();if(we.line==ye.line)ne(we.line,we.ch,ye.ch);else{var Ve=Ct(a,we.line),it=Ct(a,ye.line),ht=Zn(Ve)==Zn(it),wt=ne(we.line,we.ch,ht?Ve.text.length+1:null).end,jt=ne(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||(Ne(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(),T&&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&&(Ne(e,"blur",e,t),e.state.focused=!1,k(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(j&&w<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 ne=0;ne<a.rest.length;ne++)Nr(a.rest[ne]);if(f>e.display.sizerWidth){var we=Math.ceil(f/ji(e.display));we>e.display.maxLineLength&&(e.display.maxLineLength=we,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,Oi(Ct(t,f))+e.wrapper.clientHeight)):Math.min(m,t.lastLine())>=l&&(s=hn(t,Oi(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?Ge(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?Ge(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,ne=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-ne)>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=Oa(e),l={};t.bottom-t.top>s&&(t.bottom=t.top+s);var f=e.doc.height+Ta(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 ne=e.options.fixedGutter?0:i.gutters.offsetWidth,we=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-ne,ye=ea(e)-i.gutters.offsetWidth,Ve=t.right-t.left>ye;return Ve&&(t.right=t.left+ye),t.left<10?l.scrollLeft=0:t.left<we?l.scrollLeft=Math.max(0,t.left+ne-(Ve?0:10)):t.right>ye+we-3&&(l.scrollLeft=t.right+(Ve?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,zr(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+Ta(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),Le(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Le(a,"scroll",function(){a.clientWidth&&t(a.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,j&&w<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&&!B?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ue,this.disableVert=new Ue},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 za(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&&k(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),Le(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=Ae(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)&&za(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||Ne(s[f],"hide");if(l)for(var m=0;m<l.length;++m)l[m].lines.length&&Ne(l[m],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ne(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,M(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=ie(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 ne=!l||l.length!=s.styles.length||y!=Z&&(!y||!Z||y.bgClass!=Z.bgClass||y.textClass!=Z.textClass),we=0;!ne&&we<l.length;++we)ne=l[we]!=s.styles[we];ne&&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){ee(e,t)&&this.events.push(arguments)},Bo.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ne.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;Hr(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=Oi(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),X(i.cursorDiv),X(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+Ta(e.display)-Oa(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),za(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),za(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(Ve){var it=Ve.nextSibling;return T&&b&&e.display.currentWheelTarget==Ve?Ve.style.display="none":Ve.parentNode.removeChild(Ve),it}for(var m=n.view,y=n.viewFrom,Z=0;Z<m.length;Z++){var ne=m[Z];if(!ne.hidden)if(!ne.node||ne.node.parentNode!=s){var we=Mo(e,ne,y,i);s.insertBefore(we,l)}else{for(;l!=ne.node;)l=f(l);var ye=a&&t!=null&&t<=y&&ne.lineNumber;ne.changes&&(Pe(ne.changes,"gutter")>-1&&(ye=!1),da(e,ne,y,i)),ye&&(X(ne.lineNumber),ne.lineNumber.appendChild(document.createTextNode(nn(e.options,y)))),l=ne.node.nextSibling}y+=ne.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 zr(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 Hr(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;X(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),zr(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: "+He+"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"),j&&w<8&&(a.gutters.style.zIndex=-1,a.scroller.style.paddingRight=0),!T&&!(se&&Y)&&(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;j?Gi=-.53:se?Gi=15:N?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&&T){e:for(var y=t.target,Z=s.view;y!=l;y=y.parentNode)for(var ne=0;ne<Z.length;ne++)if(Z[ne].node==y){e.display.currentWheelTarget=y;break e}}if(n&&!se&&!A&&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 we=a*Gi,ye=e.doc.scrollTop,Ve=ye+s.wrapper.clientHeight;we<0?ye=Math.max(0,ye+we-50):Ve=Math.min(e.doc.height,Ve+we+50),lr(e,{top:ye,bottom:Ve})}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 Tn(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(we,ye){return st(we.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=Tn(f.to(),l.to()),ne=f.empty()?l.from()==l.head:f.from()==f.head;s<=i&&--i,t.splice(--s,2,new Rn(ne?Z:y,ne?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?Ge(e.from.line+e.text.length-1,me(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),Ge(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?Ge(i.line,e.ch-t.ch+i.ch):Ge(i.line+(e.line-t.line),e.ch)}function hl(e,t,i){for(var n=[],a=Ge(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],ne=st(Z.head,Z.anchor)<0;n[l]=new Rn(ne?y:m,ne?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&&me(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),On(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),ne=Ct(e,m.line),we=me(y),ye=a(y.length-1),Ve=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(ne,ne.text,ye),Ve&&e.remove(f.line,Ve),it.length&&e.insert(f.line,it)}else if(Z==ne)if(y.length==1)s(Z,Z.text.slice(0,f.ch)+we+Z.text.slice(m.ch),ye);else{var ht=l(1,y.length-1);ht.push(new oa(we+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]+ne.text.slice(m.ch),a(0)),e.remove(f.line+1,Ve);else{s(Z,Z.text.slice(0,f.ch)+y[0],a(0)),s(ne,we+ne.text.slice(m.ch),ye);var wt=l(1,y.length-1);Ve>1&&e.remove(f.line+1,Ve-1),e.insert(f.line+1,wt)}On(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:k)(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=me(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Zr(e.done),me(e.done);if(e.done.length&&!me(e.done).ranges)return me(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),me(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=me(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=me(a.done);for((!m||!m.ranges)&&zo(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||Ne(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,me(a.done),t))?a.done[a.done.length-1]=t:zo(t,a.done),a.lastSelTime=+new Date,a.lastSelOrigin=s,a.lastSelOp=i,n&&n.clearRedo!==!1&&Zr(a.undone)}function zo(e,t){var i=me(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 Ha(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 ne in y)(Z=ne.match(/^spans_(\d+)$/))&&(Pe(t,Number(Z[1]))>-1&&(me(f)[ne]=y[ne],delete y[ne]))}}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 Ho(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 Ne(e,"beforeSelectionChange",e,n),e.cm&&Ne(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=me(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){(ee(e,"beforeSelectionChange")||e.cm&&ee(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,G(e.cm)),On(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&&(Ne(m,"beforeCursorEnter"),m.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!m.atomic)continue;if(i){var ne=m.find(n<0?1:-1),we=void 0;if((n<0?Z:y)&&(ne=ls(e,ne,-n,ne&&ne.line==t.line?s:null)),ne&&ne.line==t.line&&(we=st(ne,i))&&(n<0?we<0:we>0))return Ka(e,ne,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,Ge(e.first,0))}function ls(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,Ge(t.line-1)):null:i>0&&t.ch==(n||Ct(e,t.line)).text.length?t.line<e.first+e.size-1?Ge(t.line+1,0):null:new Ge(t.line,t.ch+i)}function us(e){e.setSelection(Ge(e.firstLine(),0),Ge(e.lastLine()),Se)}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)}),Ne(e,"beforeChange",e,n),e.cm&&Ne(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((ee(e,"beforeChange")||e.cm&&ee(e.cm,"beforeChange"))&&(t=cs(e,t,!0),!t))return;var n=Nn&&!i&&zi(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(zo(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=[];zo(l,m),m.push({changes:Z,generation:a.generation}),a.generation=s.generation||++a.maxGeneration;for(var ne=ee(e,"beforeChange")||e.cm&&ee(e.cm,"beforeChange"),we=function(it){var ht=s.changes[it];if(ht.origin=t,ne&&!cs(e,ht,!1))return f.length=0,{};Z.push(mr(e,ht));var wt=it?hr(e,ht):me(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 Ve=we(ye);if(Ve)return Ve.v}}function hs(e,t){if(t==0)return;if(e.first+=t,e.sel=new Xi(Ie(e.sel.ranges,function(a){return new Rn(Ge(a.anchor.line+t,a.anchor.ch),Ge(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:Ge(e.first,0),to:Ge(t.to.line+a,t.to.ch),text:[me(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:Ge(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,Se),e.cantEdit&&Vo(e,Ge(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&&G(e),pr(n,t,i,Or(e)),e.options.lineWrapping||(n.iter(m,s.line+t.text.length,function(ye){var Ve=ua(ye);Ve>a.maxLineLength&&(a.maxLine=ye,a.maxLineLength=Ve,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=ee(e,"changes"),ne=ee(e,"change");if(ne||Z){var we={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};ne&&On(e,"change",e,we),Z&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(we)}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=Ge(y.from.line+n,y.from.ch),y.to=Ge(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),On(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")}),On(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),On(i,"lineWidgetChanged",i,e,Xt(n))})},Q(_o);function gs(e,t,i){Oi(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=Oi(l)<e.scrollTop;ln(l,l.height+ga(a)),m&&rr(s,a.height),s.curOp.forceUpdate=!0}return!0}),s&&On(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),ee(this,"clear")){var i=this.find();i&&On(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&&On(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=Ge(t?s:Xt(s),l.from),e==-1))return i;if(l.to!=null&&(n=Ge(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)}On(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(ne){m&&s.collapsed&&!m.options.lineWrapping&&Zn(ne)==m.display.maxLine&&(y=!0),s.collapsed&&f!=t.line&&ln(ne,0),Fn(ne,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(ne){Sn(e,ne)&&ln(ne,0)}),s.clearOnEnter&&Le(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),On(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();On(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=me(s)}),new Eo(s,l)}function ys(e){return e.findMarks(Ge(e.first,0),e.clipPos(Ge(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=Ge(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),Se)};Ii.prototype=Fe(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=Ge(this.first,0),i=this.first+this.size-1;Va(this,{from:t,to:Ge(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),Se)}),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"?Ge(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){Ho(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=Ie(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:Ha(this.history.done),undone:Ha(this.history.undone)}},setHistory:function(e){var t=this.history=new Wo(this.history.maxGeneration);t.done=Ha(e.done.slice(0),null,!0),t.undone=Ha(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&&tt(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,tt(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(re(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(re(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,Ge(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=Ha(this.history.done,n),e.history.undone=Ha(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),j&&(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(Ve){return Ve!=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,Ve){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[Ve]=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 ne;if(t.state.draggingText&&!t.state.draggingText.copy&&(ne=t.listSelections()),Ko(t.doc,ba(i,i)),ne)for(var we=0;we<ne.length;++we)Ga(t.doc,"",ne[we].anchor,ne[we].head,"drag");t.replaceSelection(Z,"around","paste"),t.display.input.focus()}}catch(ye){}}}function Rl(e,t){if(j&&(!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==",A&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),A&&i.parentNode.removeChild(i)}}function Tl(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)),S(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 Ol(){if(Cs)return;Pl(),Cs=!0}function Pl(){var e;Le(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Es(Al)},100))}),Le(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=Ie(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),(q?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(q?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function Ss(e,t){if(A&&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,me(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=Ke(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 Ge(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?me(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 ne=yt(t,Z,y).top;y=At(function(we){return yt(t,Z,we).top==ne},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 Ge(n,y,m)}}return new Ge(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 Ge?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 ne=l.level==1==n<0,we=f(i,ne?1:-1);if(we!=null&&(ne?we<=l.to&&we<=Z.end:we>=l.from&&we>=Z.begin)){var ye=ne?"before":"after";return new Ge(i.line,we,ye)}}var Ve=function(wt,jt,St){for(var Wt=function(In,Ei){return Ei?new Ge(i.line,f(In,1),"before"):new Ge(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=Ve(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=Ve(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"),Se)},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:Ge(t.head.line+1,0)}:{from:t.head,to:Ge(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ya(e,function(t){return{from:Ge(t.from().line,0),to:o(e.doc,Ge(t.to().line+1,0))}})},delLineLeft:function(e){return Ya(e,function(t){return{from:Ge(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(Ge(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Ge(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=le(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 Ge(a.line,a.ch-1)),a.ch>0)a=new Ge(a.line,a.ch+1),e.replaceRange(s.charAt(a.ch-1)+s.charAt(a.ch-2),Ge(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 Ge(a.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),Ge(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 Ge(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)!=Oe}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 Ue;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())}),Ts(e,a+" "+t,i,n))return!0}return Ts(e,t,i,n)}function Ts(e,t,i,n){var a=jl(e,t,n);return a=="multi"&&(e.state.keySeq=t),a=="handled"&&On(e,"keyHandled",e,t,i),(a=="handled"||a=="multi")&&(x(i),ir(e)),!!a}function Os(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;j&&w<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=Os(t,e);A&&(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)&&(k(t,"CodeMirror-crosshair"),Rt(document,"keyup",i),Rt(document,"mouseover",i))}Le(document,"keyup",i),Le(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(A&&i==Er){Er=null,x(e);return}if(A&&(!e.which||e.which<10)&&Os(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)){T||(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&&zl(t,a,n,s,e))return;a==1?n?Kl(t,n,s,e):de(e)==i.scroller&&x(e):a==2?(n&&Ho(t.doc,n),setTimeout(function(){return i.input.focus()},20)):a==3&&(g?t.display.input.onContextMenu(e):Dr(t))}function zl(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)!=Oe}finally{e.state.suppressEdits=!1}return f})}function Hl(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){j?setTimeout(M(Lr,e),0):e.curOp.focus=P();var a=Hl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&ke&&!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){T&&(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||Ho(e.doc,i,null,null,n.extend),T&&!te||j&&w==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};T&&(a.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,a.scroller.dragDrop&&a.scroller.dragDrop(),Le(a.wrapper.ownerDocument,"mouseup",l),Le(a.wrapper.ownerDocument,"mousemove",f),Le(a.scroller,"dragstart",m),Le(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(Ge(t.line,0),o(e.doc,Ge(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,$):(f=0,Ri(s,new Xi([l],0),$),m=s.sel);var ne=i;function we(St){if(st(ne,St)==0)return;if(ne=St,n.unit=="rectangle"){for(var Wt=[],Zt=e.options.tabSize,Yt=le(Ct(s,i.line).text,i.ch,Zt),sn=le(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=ue(Bi,In,Zt);In==Ei?Wt.push(new Rn(Ge(Qn,ui),Ge(Qn,ui))):Bi.length>ui&&Wt.push(new Rn(Ge(Qn,ui),Ge(Qn,ue(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=Tn(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),$)}}var ye=a.wrapper.getBoundingClientRect(),Ve=0;function it(St){var Wt=++Ve,Zt=Pa(e,St,!0,n.unit=="rectangle");if(!Zt)return;if(st(Zt,ne)!=0){e.curOp.focus=P(),we(Zt);var Yt=Uo(a,s);(Zt.line>=Yt.to||Zt.line<Yt.from)&&setTimeout(bi(e,function(){Ve==Wt&&it(St)}),150)}else{var sn=St.clientY<ye.top?-20:St.clientY>ye.bottom?20:0;sn&&setTimeout(bi(e,function(){if(Ve!=Wt)return;a.scroller.scrollTop+=sn,it(St)}),50)}}function ht(St){e.state.selectingText=!1,Ve=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,Le(a.wrapper.ownerDocument,"mousemove",wt),Le(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),ne=Z-l||(n.ch-i.ch)*(f.level==1?-1:1);Z==m-1||Z==m?y=ne<0:y=ne>0}var we=s[m+(y?-1:0)],ye=y==(we.level==1),Ve=ye?we.from:we.to,it=ye?"after":"before";return i.ch==Ve&&i.sticky==it?t:new Rn(new Ge(i.line,Ve,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(we){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||!ee(e,i))return U(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),ne=e.display.gutterSpecs[m];return Ne(e,i,e,Z,ne.className,t),U(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 ee(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-"),zn(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),zn(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(Ge(l,Z))}l++});for(var f=s.length-1;f>=0;f--)Ga(n.doc,a,s[f],Ge(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",zt,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",Y?"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",!Re),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 za(n)},!0),i("scrollbarStyle","native",function(n){Fr(n),za(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?Le: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):(k(e.display.wrapper,"CodeMirror-wrap"),Pi(e)),nr(e),Ui(e),zn(e),setTimeout(function(){return za(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 Ue,keySeq:null,specialChars:null},t.autofocus&&!Y&&s.input.focus(),j&&w<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Zl(this),Ol(),Da(this),this.curOp.forceUpdate=!0,Jr(this,n),t.autofocus&&!Y||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);Hr(this),t.finishInit&&t.finishInit(this);for(var f=0;f<wr.length;++f)wr[f](this);Na(this),T&&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;Le(t.scroller,"mousedown",bi(e,Ls)),j&&w<11?Le(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);Ho(e.doc,Z.anchor,Z.head)})):Le(t.scroller,"dblclick",function(m){return We(e,m)||x(m)}),Le(t.scroller,"contextmenu",function(m){return js(e,m)}),Le(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,ne=y.top-m.top;return Z*Z+ne*ne>20*20}Le(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)}}),Le(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Le(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"),ne;!y.prev||l(y,y.prev)?ne=new Rn(Z,Z):!y.prev.prev||l(y,y.prev.prev)?ne=e.findWordAt(Z):ne=new Rn(Ge(Z.line,0),o(e.doc,Ge(Z.line+1,0))),e.setSelection(ne.anchor,ne.head),e.focus(),x(m)}a()}),Le(t.scroller,"touchcancel",a),Le(t.scroller,"scroll",function(){t.scroller.clientHeight&&(uo(e,t.scroller.scrollTop),Ma(e,t.scroller.scrollLeft,!0),Ne(e,"scroll",e))}),Le(t.scroller,"mousewheel",function(m){return Gr(e,m)}),Le(t.scroller,"DOMMouseScroll",function(m){return Gr(e,m)}),Le(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)||(Tl(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();Le(f,"keyup",function(m){return As.call(e,m)}),Le(f,"keydown",bi(e,Ps)),Le(f,"keypress",bi(e,Ms)),Le(f,"focus",function(m){return ar(e,m)}),Le(f,"blur",function(m){return Fa(e,m)})}var wr=[];Gn.defineInitHook=function(e){return wr.push(e)};function To(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=le(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==Oe||Z>150)){if(!n)return;i="prev"}i=="prev"?t>a.first?Z=le(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 ne="",we=0;if(e.options.indentWithTabs)for(var ye=Math.floor(Z/l);ye;--ye)we+=l,ne+=" ";if(we<Z&&(ne+=_(Z-we)),ne!=y)return Ga(a,ne,Ge(t,0),Ge(t,y.length),"+input"),f.stateAfter=null,!0;for(var Ve=0;Ve<a.sel.ranges.length;Ve++){var it=a.sel.ranges[Ve];if(it.head.line==t&&it.head.ch<y.length){var ht=Ge(t,y.length);vr(a,Ve,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=Ie(m,function(wt){return[wt]}));for(var ne=e.curOp.updateInput,we=n.ranges.length-1;we>=0;we--){var ye=n.ranges[we],Ve=ye.from(),it=ye.to();ye.empty()&&(i&&i>0?Ve=Ge(Ve.line,Ve.ch-i):e.state.overwrite&&!f?it=Ge(it.line,Math.min(Ct(s,it.line).text.length,it.ch+me(m).length)):f&&na&&na.lineWise&&na.text.join(`
`)==m.join(`
`)&&(Ve=it=Ge(Ve.line,0)));var ht={from:Ve,to:it,text:y?y[we%y.length]:m,origin:a||(f?"paste":e.state.cutIncoming>l?"cut":"+input")};Va(e.doc,ht),On(e,"inputRead",e,ht)}t&&!f&&Fs(e,t),Wa(e),e.curOp.updateInput<2&&(e.curOp.updateInput=ne),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=To(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=To(e,a.head.line,"smart")));l&&On(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:Ge(a,0),head:Ge(a+1,0)};i.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:i}}function zs(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Hs(){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 T?e.style.width="1000px":e.setAttribute("wrap","off"),F&&(e.style.border="1px solid black"),zs(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),Ne(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)&&To(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&&(To(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 ne=Z;ne<s;++ne)To(this,ne,n);var we=this.doc.sel.ranges;m.ch==0&&a.length==we.length&&we[l].from().ch>0&&vr(this.doc,l,new Rn(m,we[l].to()),Se)}}}),getTokenAt:function(n,a){return Tt(this,n,a)},getLineTokens:function(n,a){return Tt(this,Ge(n),a,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var a=Ye(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 ne=l._global[Z];ne.pred(f,this)&&Pe(s,ne.val)==-1&&s.push(ne.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-Oi(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 ne=Math.max(m.wrapper.clientHeight,this.doc.height),we=Math.max(m.sizer.clientWidth,m.lineSpace.clientWidth);(l=="above"||n.bottom+a.offsetHeight>ne)&&n.top>a.offsetHeight?y=n.top-a.offsetHeight:n.bottom+a.offsetHeight<=ne&&(y=n.bottom),Z+a.offsetWidth>we&&(Z=we-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 ne=en(this,y,"div");if(m==null?m=ne.left:ne.left=m,y=Ks(this,ne,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 ne=en(s,Z.head,"div");Z.goalColumn!=null&&(ne.left=Z.goalColumn),f.push(ne.left);var we=Ks(s,ne,n,a);return a=="page"&&Z==l.sel.primary()&&rr(s,Ai(s,we,"div").top-ne.top),we},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=Qe(y,m)?function(ne){return Qe(ne,m)}:/\s/.test(y)?function(ne){return/\s/.test(ne)}:function(ne){return!/\s/.test(ne)&&!Qe(ne)};l>0&&Z(s.charAt(l-1));)--l;for(;f<s.length&&Z(s.charAt(f));)++f}return new Rn(Ge(n.line,l),Ge(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"):k(this.display.cursorDiv,"CodeMirror-overwrite"),Ne(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:Oa(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:Ge(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,Ne(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,zn(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),Ne(this,"refresh",this)}),swapDoc:Di(function(n){var a=this.doc;return a.cm=null,this.state.selectingText&&this.state.selectingText(),Jr(this,n),zn(this),this.display.input.reset(),lo(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,On(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 Ge(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 Ge(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 ne=null,we=n=="group",ye=e.cm&&e.cm.getHelper(t,"wordChars"),Ve=!0;!(i<0&&!Z(!Ve));Ve=!1){var it=f.text.charAt(t.ch)||`
`,ht=Qe(it,ye)?"w":we&&it==`
`?"n":!we||/\s/.test(it)?null:"p";if(we&&!Ve&&!ht&&(ht="s"),ne&&ne!=ht){i<0&&(i=1,Z(),t.sticky="after");break}if(ht&&(ne=ht),i>0&&!Z(!Ve))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 Ue,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;zs(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}Le(a,"paste",function(f){if(!s(f)||We(n,f)||Bs(f,n))return;w<=11&&setTimeout(bi(n,function(){return t.updateFromDOM()}),20)}),Le(a,"compositionstart",function(f){t.composing={data:f.data,done:!1}}),Le(a,"compositionupdate",function(f){t.composing||(t.composing={data:f.data,done:!1})}),Le(a,"compositionend",function(f){t.composing&&(f.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Le(a,"touchstart",function(){return i.forceCompositionEnd()}),Le(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,Se),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=Hs(),ne=Z.firstChild;n.display.lineSpace.insertBefore(Z,n.display.lineSpace.firstChild),ne.value=na.text.join(`
`);var we=document.activeElement;be(ne),setTimeout(function(){n.display.lineSpace.removeChild(Z),we.focus(),we==a&&i.showPrimarySelection()},50)}Le(a,"copy",l),Le(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(Tn(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,ne=Z.maps?Z.maps[Z.maps.length-1]:Z.map;y={node:ne[ne.length-1],offset:ne[ne.length-2]-ne[ne.length-3]}}if(!m||!y){e.removeAllRanges();return}var we=e.rangeCount&&e.getRangeAt(0),ye;try{ye=H(m.node,m.offset,y.offset,y.node)}catch(Ve){}ye&&(!se&&t.state.focused?(e.collapse(m.node,m.offset),ye.collapsed||(e.removeAllRanges(),e.addRange(ye))):(e.removeAllRanges(),e.addRange(ye)),we&&e.anchorNode==null?e.addRange(we):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){S(this.cm.display.cursorDiv,e.cursors),S(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(z&&N&&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),Se),(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=Ge(n.line-1,Ct(e.doc,n.line-1).length)),a.ch==Ct(e.doc,a.line).text.length&&a.line<e.lastLine()&&(a=Ge(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 ne=e.doc.splitLines(tu(e,f,Z,l,y)),we=tn(e.doc,Ge(l,0),Ge(y,Ct(e.doc,y).text.length));ne.length>1&&we.length>1;)if(me(ne)==me(we))ne.pop(),we.pop(),y--;else if(ne[0]==we[0])ne.shift(),we.shift(),l++;else break;for(var ye=0,Ve=0,it=ne[0],ht=we[0],wt=Math.min(it.length,ht.length);ye<wt&&it.charCodeAt(ye)==ht.charCodeAt(ye);)++ye;for(var jt=me(ne),St=me(we),Wt=Math.min(jt.length-(ne.length==1?ye:0),St.length-(we.length==1?ye:0));Ve<Wt&&jt.charCodeAt(jt.length-Ve-1)==St.charCodeAt(St.length-Ve-1);)++Ve;if(ne.length==1&&we.length==1&&l==n.line)for(;ye&&ye>n.ch&&jt.charCodeAt(jt.length-Ve-1)==St.charCodeAt(St.length-Ve-1);)ye--,Ve++;ne[ne.length-1]=jt.slice(0,jt.length-Ve).replace(/^\u200b+/,""),ne[0]=ne[0].slice(ye).replace(/\u200b+$/,"");var Zt=Ge(l,ye),Yt=Ge(y,we.length?me(we).length-Ve:0);if(ne.length>1||ne[0]||st(Zt,Yt))return Ga(e.doc,ne,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(Ve){return Ve.id==ye}}function Z(){l&&(s+=f,m&&(s+=f),l=m=!1)}function ne(ye){ye&&(Z(),s+=ye)}function we(ye){if(ye.nodeType==1){var Ve=ye.getAttribute("cm-text");if(Ve){ne(Ve);return}var it=ye.getAttribute("cm-marker"),ht;if(it){var wt=e.findMarks(Ge(n,0),Ge(a+1,0),y(+it));wt.length&&(ht=wt[0].find(0))&&ne(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++)we(ye.childNodes[St]);/^(pre|p)$/i.test(ye.nodeName)&&(m=!0),jt&&(l=!0)}else ye.nodeType==3&&ne(ye.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(we(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(Ge(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(Ge(Xt(e.line),0),!0);if(t==n&&(a=!0,t=n.childNodes[i],i=0,!t)){var s=e.rest?me(e.rest):e.line;return Qa(Ge(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)]),Ge(sn,In)}}}var ne=Z(l,f,i);if(ne)return Qa(ne,a);for(var we=f.nextSibling,ye=l?l.nodeValue.length-i:0;we;we=we.nextSibling){if(ne=Z(we,we.firstChild,0),ne)return Qa(Ge(ne.line,ne.ch-ye),a);ye+=we.textContent.length}for(var Ve=f.previousSibling,it=i;Ve;Ve=Ve.previousSibling){if(ne=Z(Ve,Ve.firstChild,-1),ne)return Qa(Ge(ne.line,ne.ch+it),a);it+=Ve.textContent.length}}var oi=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Ue,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),F&&(a.style.width="0px"),Le(a,"input",function(){j&&w>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Le(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,Se):(i.prevInput="",a.value=f.text.join(`
`),be(a))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}Le(a,"cut",s),Le(a,"copy",s),Le(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)}),Le(e.lineSpace,"selectstart",function(l){qi(e,l)||x(l)}),Le(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"})}}),Le(a,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},oi.prototype.createField=function(e){this.wrapper=Hs(),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;S(i.cursorDiv,e.cursors),S(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),j&&w>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",j&&w>=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"&&(!Y||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||qe(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(j&&w>=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(){j&&w>=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||A)return;var f=i.options.resetSelectionOnContextMenu;f&&i.doc.sel.contains(s)==-1&&bi(i,Ri)(i.doc,ba(s),Se);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: `+(j?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ne;T&&(ne=window.scrollY),n.input.focus(),T&&window.scrollTo(null,ne),n.input.reset(),i.somethingSelected()||(a.value=t.prevInput=" "),t.contextMenuPending=ye,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function we(){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,j&&w<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),a.selectionStart!=null){(!j||j&&w<9)&&we();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(j&&w>=9&&we(),g){I(e);var Ve=function(){Rt(window,"mouseup",Ve),setTimeout(ye,20)};Le(window,"mouseup",Ve)}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&&(Le(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=Le,e.wheelEventPixels=dl,e.Doc=Ii,e.splitLines=Et,e.countColumn=le,e.findColumn=ue,e.isWordChar=De,e.Pass=Oe,e.signal=Ne,e.Line=oa,e.changeEnd=_a,e.scrollbarModel=Br,e.Pos=Ge,e.cmpPos=st,e.modes=It,e.mimeModes=vt,e.resolveMode=Be,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=k,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(Je,je,h){"use strict";var V=h("rePB"),ve=h("Ff2n"),se=h("VTBJ"),xe=h("1OyB"),pe=h("vuIU"),oe=h("JX7q"),j=h("Ji7U"),w=h("LK+K"),T=h("q1tI"),O=h("TSYQ"),N=h.n(O),A=h("sboe"),te=h("OZM5"),B=function(g){var re=g.prefixCls,k=g.level,X=g.isStart,S=g.isEnd;if(!k)return null;for(var C="".concat(re,"-indent-unit"),J=[],H=0;H<k;H+=1){var E;J.push(T.createElement("span",{key:H,className:N()(C,(E={},Object(V.a)(E,"".concat(C,"-start"),X[H+1]),Object(V.a)(E,"".concat(C,"-end"),S[H+1]),Object(V.a)(E,"".concat(C,"-end-first-level"),!H&&S[0]),E))}))}return T.createElement("span",{"aria-hidden":"true",className:"".concat(re,"-indent")},J)},L=B,F=h("815F"),z="open",Y="close",b="---",fe=function(q){Object(j.a)(re,q);var g=Object(w.a)(re);function re(){var k;return Object(xe.a)(this,re),k=g.apply(this,arguments),k.state={dragNodeHighlight:!1},k.onSelectorClick=function(X){var S=k.props.context.onNodeClick;S(X,Object(F.b)(k.props)),k.isSelectable()?k.onSelect(X):k.onCheck(X)},k.onSelectorDoubleClick=function(X){var S=k.props.context.onNodeDoubleClick;S(X,Object(F.b)(k.props))},k.onSelect=function(X){if(k.isDisabled())return;var S=k.props.context.onNodeSelect;X.preventDefault(),S(X,Object(F.b)(k.props))},k.onCheck=function(X){if(k.isDisabled())return;var S=k.props,C=S.disableCheckbox,J=S.checked,H=k.props.context.onNodeCheck;if(!k.isCheckable()||C)return;X.preventDefault();var E=!J;H(X,Object(F.b)(k.props),E)},k.onMouseEnter=function(X){var S=k.props.context.onNodeMouseEnter;S(X,Object(F.b)(k.props))},k.onMouseLeave=function(X){var S=k.props.context.onNodeMouseLeave;S(X,Object(F.b)(k.props))},k.onContextMenu=function(X){var S=k.props.context.onNodeContextMenu;S(X,Object(F.b)(k.props))},k.onDragStart=function(X){var S=k.props.context.onNodeDragStart;X.stopPropagation(),k.setState({dragNodeHighlight:!0}),S(X,Object(oe.a)(k));try{X.dataTransfer.setData("text/plain","")}catch(C){}},k.onDragEnter=function(X){var S=k.props.context.onNodeDragEnter;X.preventDefault(),X.stopPropagation(),S(X,Object(oe.a)(k))},k.onDragOver=function(X){var S=k.props.context.onNodeDragOver;X.preventDefault(),X.stopPropagation(),S(X,Object(oe.a)(k))},k.onDragLeave=function(X){var S=k.props.context.onNodeDragLeave;X.stopPropagation(),S(X,Object(oe.a)(k))},k.onDragEnd=function(X){var S=k.props.context.onNodeDragEnd;X.stopPropagation(),k.setState({dragNodeHighlight:!1}),S(X,Object(oe.a)(k))},k.onDrop=function(X){var S=k.props.context.onNodeDrop;X.preventDefault(),X.stopPropagation(),k.setState({dragNodeHighlight:!1}),S(X,Object(oe.a)(k))},k.onExpand=function(X){var S=k.props.context.onNodeExpand;S(X,Object(F.b)(k.props))},k.setSelectHandle=function(X){k.selectHandle=X},k.getNodeState=function(){var X=k.props.expanded;return k.isLeaf()?null:X?z:Y},k.hasChildren=function(){var X=k.props.eventKey,S=k.props.context.keyEntities,C=S[X]||{},J=C.children;return!!(J||[]).length},k.isLeaf=function(){var X=k.props,S=X.isLeaf,C=X.loaded,J=k.props.context.loadData,H=k.hasChildren();return S===!1?!1:S||!J&&!H||J&&C&&!H},k.isDisabled=function(){var X=k.props.disabled,S=k.props.context.disabled;return!!(S||X)},k.isCheckable=function(){var X=k.props.checkable,S=k.props.context.checkable;return!S||X===!1?!1:S},k.syncLoadData=function(X){var S=X.expanded,C=X.loading,J=X.loaded,H=k.props.context,E=H.loadData,P=H.onNodeLoad;if(C)return;E&&S&&!k.isLeaf()&&(!k.hasChildren()&&!J&&P(Object(F.b)(k.props)))},k.renderSwitcher=function(){var X=k.props,S=X.expanded,C=X.switcherIcon,J=k.props.context,H=J.prefixCls,E=J.switcherIcon,P=C||E;if(k.isLeaf())return T.createElement("span",{className:N()("".concat(H,"-switcher"),"".concat(H,"-switcher-noop"))},typeof P=="function"?P(Object(se.a)(Object(se.a)({},k.props),{},{isLeaf:!0})):P);var ae=N()("".concat(H,"-switcher"),"".concat(H,"-switcher_").concat(S?z:Y));return T.createElement("span",{onClick:k.onExpand,className:ae},typeof P=="function"?P(Object(se.a)(Object(se.a)({},k.props),{},{isLeaf:!1})):P)},k.renderCheckbox=function(){var X=k.props,S=X.checked,C=X.halfChecked,J=X.disableCheckbox,H=k.props.context.prefixCls,E=k.isDisabled(),P=k.isCheckable();if(!P)return null;var ae=typeof P!="boolean"?P:null;return T.createElement("span",{className:N()("".concat(H,"-checkbox"),S&&"".concat(H,"-checkbox-checked"),!S&&C&&"".concat(H,"-checkbox-indeterminate"),(E||J)&&"".concat(H,"-checkbox-disabled")),onClick:k.onCheck},ae)},k.renderIcon=function(){var X=k.props.loading,S=k.props.context.prefixCls;return T.createElement("span",{className:N()("".concat(S,"-iconEle"),"".concat(S,"-icon__").concat(k.getNodeState()||"docu"),X&&"".concat(S,"-icon_loading"))})},k.renderSelector=function(){var X=k.state.dragNodeHighlight,S=k.props,C=S.title,J=S.selected,H=S.icon,E=S.loading,P=S.data,ae=k.props.context,W=ae.prefixCls,be=ae.showIcon,M=ae.icon,p=ae.draggable,le=ae.loadData,Ue=ae.titleRender,Pe=k.isDisabled(),He="".concat(W,"-node-content-wrapper"),Oe;if(be){var Se=H||M;Oe=Se?T.createElement("span",{className:N()("".concat(W,"-iconEle"),"".concat(W,"-icon__customize"))},typeof Se=="function"?Se(k.props):Se):k.renderIcon()}else le&&E&&(Oe=k.renderIcon());var $;typeof C=="function"?$=C(P):Ue?$=Ue(P):$=C;var K=T.createElement("span",{className:"".concat(W,"-title")},$);return T.createElement("span",{ref:k.setSelectHandle,title:typeof C=="string"?C:"",className:N()("".concat(He),"".concat(He,"-").concat(k.getNodeState()||"normal"),!Pe&&(J||X)&&"".concat(W,"-node-selected"),!Pe&&p&&"draggable"),draggable:!Pe&&p||void 0,"aria-grabbed":!Pe&&p||void 0,onMouseEnter:k.onMouseEnter,onMouseLeave:k.onMouseLeave,onContextMenu:k.onContextMenu,onClick:k.onSelectorClick,onDoubleClick:k.onSelectorDoubleClick,onDragStart:p?k.onDragStart:void 0},Oe,K)},k}return Object(pe.a)(re,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var X=this.props.selectable,S=this.props.context.selectable;return typeof X=="boolean"?X:S}},{key:"render",value:function(){var X,S=this.props,C=S.eventKey,J=S.className,H=S.style,E=S.dragOver,P=S.dragOverGapTop,ae=S.dragOverGapBottom,W=S.isLeaf,be=S.isStart,M=S.isEnd,p=S.expanded,le=S.selected,Ue=S.checked,Pe=S.halfChecked,He=S.loading,Oe=S.domRef,Se=S.active,$=S.onMouseMove,K=Object(ve.a)(S,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),ue=this.props.context,D=ue.prefixCls,_=ue.filterTreeNode,me=ue.draggable,Ie=ue.keyEntities,Ze=this.isDisabled(),Me=Object(te.f)(K),Fe=Ie[C]||{},Te=Fe.level,De=M[M.length-1];return T.createElement("div",Object.assign({ref:Oe,className:N()(J,"".concat(D,"-treenode"),(X={},Object(V.a)(X,"".concat(D,"-treenode-disabled"),Ze),Object(V.a)(X,"".concat(D,"-treenode-switcher-").concat(p?"open":"close"),!W),Object(V.a)(X,"".concat(D,"-treenode-checkbox-checked"),Ue),Object(V.a)(X,"".concat(D,"-treenode-checkbox-indeterminate"),Pe),Object(V.a)(X,"".concat(D,"-treenode-selected"),le),Object(V.a)(X,"".concat(D,"-treenode-loading"),He),Object(V.a)(X,"".concat(D,"-treenode-active"),Se),Object(V.a)(X,"".concat(D,"-treenode-leaf-last"),De),Object(V.a)(X,"drag-over",!Ze&&E),Object(V.a)(X,"drag-over-gap-top",!Ze&&P),Object(V.a)(X,"drag-over-gap-bottom",!Ze&&ae),Object(V.a)(X,"filter-node",_&&_(Object(F.b)(this.props))),X)),style:H,onDragEnter:me?this.onDragEnter:void 0,onDragOver:me?this.onDragOver:void 0,onDragLeave:me?this.onDragLeave:void 0,onDrop:me?this.onDrop:void 0,onDragEnd:me?this.onDragEnd:void 0,onMouseMove:$},Me),T.createElement(L,{prefixCls:D,level:Te,isStart:be,isEnd:M}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),re}(T.Component),Re=function(g){return T.createElement(A.a.Consumer,null,function(re){return T.createElement(fe,Object.assign({},g,{context:re}))})};Re.displayName="TreeNode",Re.defaultProps={title:b},Re.isTreeNode=1;var he=je.a=Re},Y1PL:function(Je,je,h){"use strict";h.r(je),h.d(je,"ResizableTextArea",function(){return Pe});var V=h("wx14"),ve=h("1OyB"),se=h("vuIU"),xe=h("Ji7U"),pe=h("LK+K"),oe=h("q1tI"),j=h("VTBJ"),w=h("rePB"),T=h("Zm9Q"),O=h("Kwbf"),N=h("c+Xe"),A=h("m+aA"),te=h("bdgK"),B=new Map;function L(Se){Se.forEach(function($){var K,ue=$.target;(K=B.get(ue))===null||K===void 0||K.forEach(function(D){return D(ue)})})}var F=new te.default(L),z=null,Y=null;function b(Se,$){B.has(Se)||(B.set(Se,new Set),F.observe(Se)),B.get(Se).add($)}function fe(Se,$){B.has(Se)&&(B.get(Se).delete($),B.get(Se).size||(F.unobserve(Se),B.delete(Se)))}var Re=function(Se){Object(xe.a)(K,Se);var $=Object(pe.a)(K);function K(){return Object(ve.a)(this,K),$.apply(this,arguments)}return Object(se.a)(K,[{key:"render",value:function(){return this.props.children}}]),K}(oe.Component),he=oe.createContext(null);function q(Se){var $=Se.children,K=Se.onBatchResize,ue=oe.useRef(0),D=oe.useRef([]),_=oe.useContext(he),me=oe.useCallback(function(Ie,Ze,Me){ue.current+=1;var Fe=ue.current;D.current.push({size:Ie,element:Ze,data:Me}),Promise.resolve().then(function(){Fe===ue.current&&(K==null||K(D.current),D.current=[])}),_==null||_(Ie,Ze,Me)},[K,_]);return oe.createElement(he.Provider,{value:me},$)}function g(Se){var $=Se.children,K=Se.disabled,ue=oe.useRef(null),D=oe.useRef(null),_=oe.useContext(he),me=oe.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ie=oe.isValidElement($)&&Object(N.c)($),Ze=Ie?$.ref:null,Me=oe.useMemo(function(){return Object(N.a)(Ze,ue)},[Ze,ue]),Fe=oe.useRef(Se);Fe.current=Se;var Te=oe.useCallback(function(De){var Qe=Fe.current,tt=Qe.onResize,ot=Qe.data,$e=De.getBoundingClientRect(),Ke=$e.width,At=$e.height,gt=De.offsetWidth,kt=De.offsetHeight,ct=Math.floor(Ke),Pt=Math.floor(At);if(me.current.width!==ct||me.current.height!==Pt||me.current.offsetWidth!==gt||me.current.offsetHeight!==kt){var xt={width:ct,height:Pt,offsetWidth:gt,offsetHeight:kt};me.current=xt;var bt=gt===Math.round(Ke)?Ke:gt,Le=kt===Math.round(At)?At:kt,Ut=Object(j.a)(Object(j.a)({},xt),{},{offsetWidth:bt,offsetHeight:Le});_==null||_(Ut,De,ot),tt&&Promise.resolve().then(function(){tt(Ut,De)})}},[]);return oe.useEffect(function(){var De=Object(A.a)(ue.current)||Object(A.a)(D.current);return De&&!K&&b(De,Te),function(){return fe(De,Te)}},[ue.current,K]),oe.createElement(Re,{ref:D},Ie?oe.cloneElement($,{ref:Me}):$)}var re="rc-observer-key";function k(Se){var $=Se.children,K=Object(T.a)($);return K.map(function(ue,D){var _=(ue==null?void 0:ue.key)||"".concat(re,"-").concat(D);return oe.createElement(g,Object(V.a)({},Se,{key:_}),ue)})}k.Collection=q;var X=k,S=h("bT9E"),C=h("TSYQ"),J=h.n(C),H=`
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 W(Se){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,K=Se.getAttribute("id")||Se.getAttribute("data-reactid")||Se.getAttribute("name");if($&&P[K])return P[K];var ue=window.getComputedStyle(Se),D=ue.getPropertyValue("box-sizing")||ue.getPropertyValue("-moz-box-sizing")||ue.getPropertyValue("-webkit-box-sizing"),_=parseFloat(ue.getPropertyValue("padding-bottom"))+parseFloat(ue.getPropertyValue("padding-top")),me=parseFloat(ue.getPropertyValue("border-bottom-width"))+parseFloat(ue.getPropertyValue("border-top-width")),Ie=E.map(function(Me){return"".concat(Me,":").concat(ue.getPropertyValue(Me))}).join(";"),Ze={sizingStyle:Ie,paddingSize:_,borderSize:me,boxSizing:D};return $&&K&&(P[K]=Ze),Ze}function be(Se){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ue=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)),Se.getAttribute("wrap")?ae.setAttribute("wrap",Se.getAttribute("wrap")):ae.removeAttribute("wrap");var D=W(Se,$),_=D.paddingSize,me=D.borderSize,Ie=D.boxSizing,Ze=D.sizingStyle;ae.setAttribute("style","".concat(Ze,";").concat(H)),ae.value=Se.value||Se.placeholder||"";var Me=Number.MIN_SAFE_INTEGER,Fe=Number.MAX_SAFE_INTEGER,Te=ae.scrollHeight,De;if(Ie==="border-box"?Te+=me:Ie==="content-box"&&(Te-=_),K!==null||ue!==null){ae.value=" ";var Qe=ae.scrollHeight-_;K!==null&&(Me=Qe*K,Ie==="border-box"&&(Me=Me+_+me),Te=Math.max(Me,Te)),ue!==null&&(Fe=Qe*ue,Ie==="border-box"&&(Fe=Fe+_+me),De=Te>Fe?"":"hidden",Te=Math.min(Fe,Te))}return{height:Te,minHeight:Me,maxHeight:Fe,overflowY:De,resize:"none"}}var M=h("Gytx"),p=h.n(M),le;(function(Se){Se[Se.NONE=0]="NONE",Se[Se.RESIZING=1]="RESIZING",Se[Se.RESIZED=2]="RESIZED"})(le||(le={}));var Ue=function(Se){Object(xe.a)(K,Se);var $=Object(pe.a)(K);function K(ue){var D;return Object(ve.a)(this,K),D=$.call(this,ue),D.nextFrameActionId=void 0,D.resizeFrameId=void 0,D.textArea=void 0,D.saveTextArea=function(_){D.textArea=_},D.handleResize=function(_){var me=D.state.resizeStatus,Ie=D.props,Ze=Ie.autoSize,Me=Ie.onResize;if(me!==le.NONE)return;typeof Me=="function"&&Me(_),Ze&&D.resizeOnNextFrame()},D.resizeOnNextFrame=function(){cancelAnimationFrame(D.nextFrameActionId),D.nextFrameActionId=requestAnimationFrame(D.resizeTextarea)},D.resizeTextarea=function(){var _=D.props.autoSize;if(!_||!D.textArea)return;var me=_.minRows,Ie=_.maxRows,Ze=be(D.textArea,!1,me,Ie);D.setState({textareaStyles:Ze,resizeStatus:le.RESIZING},function(){cancelAnimationFrame(D.resizeFrameId),D.resizeFrameId=requestAnimationFrame(function(){D.setState({resizeStatus:le.RESIZED},function(){D.resizeFrameId=requestAnimationFrame(function(){D.setState({resizeStatus:le.NONE}),D.fixFirefoxAutoScroll()})})})})},D.renderTextArea=function(){var _=D.props,me=_.prefixCls,Ie=me===void 0?"rc-textarea":me,Ze=_.autoSize,Me=_.onResize,Fe=_.className,Te=_.disabled,De=D.state,Qe=De.textareaStyles,tt=De.resizeStatus,ot=Object(S.a)(D.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),$e=J()(Ie,Fe,Object(w.a)({},"".concat(Ie,"-disabled"),Te));"value"in ot&&(ot.value=ot.value||"");var Ke=Object(j.a)(Object(j.a)(Object(j.a)({},D.props.style),Qe),tt===le.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return oe.createElement(X,{onResize:D.handleResize,disabled:!(Ze||Me)},oe.createElement("textarea",Object(V.a)({},ot,{className:$e,style:Ke,ref:D.saveTextArea})))},D.state={textareaStyles:{},resizeStatus:le.NONE},D}return Object(se.a)(K,[{key:"componentDidUpdate",value:function(D){(D.value!==this.props.value||!p()(D.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 D=this.textArea.selectionStart,_=this.textArea.selectionEnd;this.textArea.setSelectionRange(D,_)}}catch(me){}}},{key:"render",value:function(){return this.renderTextArea()}}]),K}(oe.Component),Pe=Ue,He=function(Se){Object(xe.a)(K,Se);var $=Object(pe.a)(K);function K(ue){var D;Object(ve.a)(this,K),D=$.call(this,ue),D.resizableTextArea=void 0,D.focus=function(){D.resizableTextArea.textArea.focus()},D.saveTextArea=function(me){D.resizableTextArea=me},D.handleChange=function(me){var Ie=D.props.onChange;D.setValue(me.target.value,function(){D.resizableTextArea.resizeTextarea()}),Ie&&Ie(me)},D.handleKeyDown=function(me){var Ie=D.props,Ze=Ie.onPressEnter,Me=Ie.onKeyDown;me.keyCode===13&&Ze&&Ze(me),Me&&Me(me)};var _=typeof ue.value=="undefined"||ue.value===null?ue.defaultValue:ue.value;return D.state={value:_},D}return Object(se.a)(K,[{key:"setValue",value:function(D,_){"value"in this.props||this.setState({value:D},_)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return oe.createElement(Pe,Object(V.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(D){return"value"in D?{value:D.value}:null}}]),K}(oe.Component),Oe=je.default=He},YBdh:function(Je,je,h){Je.exports=h.p+"static/xiren.a6554bc1.svg"},ZW9T:function(Je,je,h){"use strict";h.d(je,"a",function(){return Re});var V=h("k1fw"),ve=h("miYZ"),se=h("tsqr"),xe=h("rAM+"),pe=h("tJVT"),oe=h("PpiC"),j=h("q1tI"),w=h.n(j),T=h("bdgK");function O(he,q,g,re,k){var X=q.getWordUntilPosition(g),S={startLineNumber:g.lineNumber,endLineNumber:g.lineNumber,startColumn:X.startColumn,endColumn:X.endColumn},C=re.map(function(J){return{label:J,kind:he.languages.CompletionItemKind.Keyword,insertText:J,insertTextRules:he.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:S}});return k.map(function(J){C.push(Object(V.a)(Object(V.a)({},J),{},{range:S}))}),C}var N=function(he){var q={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(S,C){var J=O(he,S,C,g,[q]);return{suggestions:J}}});var re=["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(S,C){var J=[{label:"print",kind:he.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
`),insertTextRules:he.languages.CompletionItemInsertTextRule.InsertAsSnippet}],H=O(he,S,C,re,J);return{suggestions:H}}});var k=["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(S,C){var J=[q,{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}],H=O(he,S,C,k,J);return{suggestions:H}}})},A="\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 B(he){return/^\d+$/.test(he)?"".concat(he,"px"):he}function L(){}var F=!1,z={"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 Y(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],q=he;if(Array.isArray(he)){for(var g=0;g<he.length;g++){var re=z[he[g]];if(re)return re}return q[0]}return z[q]||q}var b=null,fe=je.b=function(he){var q=he.width,g=q===void 0?"100%":q,re=he.height,k=re===void 0?"100%":re,X=he.value,S=he.language,C=S===void 0?"javascript":S,J=he.style,H=J===void 0?{}:J,E=he.options,P=E===void 0?{}:E,ae=he.overrideServices,W=ae===void 0?{}:ae,be=he.theme,M=be===void 0?"vs-dark":be,p=he.onEditBlur,le=he.onSave,Ue=he.autoHeight,Pe=Ue===void 0?!1:Ue,He=he.forbidCopy,Oe=He===void 0?!1:He,Se=he.onChange,$=Se===void 0?L:Se,K=he.editorDidMount,ue=K===void 0?L:K,D=he.onFocus,_=D===void 0?L:D,me=he.filename,Ie=me===void 0?"educoder.txt":me,Ze=Object(oe.a)(he,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),Me=Object(j.useRef)(),Fe=Object(j.useRef)({}),Te=Object(j.useRef)(),De=Object(j.useRef)(!1),Qe=Object(j.useRef)(),tt=Object(j.useState)(!1),ot=Object(pe.a)(tt,2),$e=ot[0],Ke=ot[1];function At(){var U;return Me.current&&(U=new T.default(function(I){var de=Object(xe.a)(I),Ce;try{for(de.s();!(Ce=de.n()).done;){var ke=Ce.value;(ke.target.offsetHeight>0||ke.target.offsetWidth>0)&&Fe.current.instance.layout()}}catch(_t){de.e(_t)}finally{de.f()}}),U.observe(Me.current)),U}function gt(){se.b.warn(decodeURIComponent(A))}var kt=function(){var I=Fe.current.instance;if(X!=null&&I&&$e){var de=I.getModel();de&&X!==de.getValue()&&(F=!0,de.setValue(X),I.layout(),F=!1)}};Object(j.useEffect)(function(){Te.current&&clearTimeout(Te.current),Te.current=setTimeout(function(){kt()},500)},[X,$e,Fe.current]);function ct(){var U=Fe.current.instance;if(U){var I=U.getSelection(),de=Fe.current.pastePos||{},Ce=new b.Range(de.startLineNumber||I.endLineNumber,de.startColumn||I.endColumn,de.endLineNumber||I.endLineNumber,de.endColumn||I.endColumn);setTimeout(function(){U.executeEdits("",[{range:Ce,text:""}])},300)}}function Pt(U){(window.navigator.platform.match("Mac")?U.metaKey:U.ctrlKey)&&U.keyCode==83&&(U.preventDefault(),le())}var xt=function(){if(Pe&&Fe.current.instance){var I=Fe.current.instance.getContentHeight();x(I<k?k:I)}else x(k)};function bt(U){var I=document.createEvent("MouseEvents");I.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),U.dispatchEvent(I)}function Le(U,I){var de=window.URL||window.webkitURL||window,Ce=new Blob([I]),ke=document.createElementNS("http://www.w3.org/1999/xhtml","a");ke.href=de.createObjectURL(Ce),ke.download=U,bt(ke)}Object(j.useEffect)(function(){xt()},[xt]),Object(j.useEffect)(function(){Me.current&&!$e&&h.e(27).then(h.t.bind(null,"M/lh",7)).then(function(U){try{b=U,Fe.current.instance=b.editor.create(Me.current,{value:X,language:Y(C),theme:M,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},W);var I=Fe.current.instance;if(ue(I,b),setTimeout(function(){xt(),Fe.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Le(Ie||"educoder.txt",I.getValue())}})},500),Fe.current.subscription=I.onDidChangeModelContent(function(Ce){De.current?clearTimeout(Qe.current):(xt(),$(I.getValue(),Ce)),Qe.current=setTimeout(function(){De.current=!1},500)}),window.Monaco||N(b),Oe&&(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())}),Oe){I.addCommand(b.KeyMod.CtrlCmd|b.KeyCode.KEY_V,function(){return gt(),null}),I.onDidPaste(function(Ce){Fe.current.pastePos=Ce});try{window.addEventListener("paste",ct)}catch(Ce){}}var de=At();return Ke(!0),function(){var Ce=Fe.current.instance;Ce.dispose();var ke=Ce.getModel();ke&&ke.dispose(),Fe.current.subscription&&Fe.current.subscription.dispose(),Oe&&window.removeEventListener("paste",ct),de.unobserve(Me.current)}}catch(Ce){}})},[]),Object(j.useEffect)(function(){var U=Fe.current.instance;if(U&&$e)return document.addEventListener("keydown",Pt,!1),function(){document.removeEventListener("keydown",Pt)}},[le,$e]),Object(j.useEffect)(function(){var U=Fe.current.instance;if(U&&$e){var I=Y(C);b.editor.setModelLanguage(U.getModel(),I),console.log("language:",C,U.getModel(),I)}},[C,$e]),Object(j.useEffect)(function(){var U=Fe.current.instance;U&&$e&&b.editor.setTheme(M)},[M,$e]),Object(j.useEffect)(function(){var U=Fe.current.instance;U&&$e&&(U.updateOptions(Object(V.a)({},P)),setTimeout(function(){U.getModel().updateOptions(Object(V.a)({},P))},200))},[JSON.stringify(P),$e]),Object(j.useEffect)(function(){var U=Fe.current.instance;U&&$e&&U.layout()},[g,k,$e]);var Ut=Object(j.useState)(B(g)),Rt=Object(pe.a)(Ut,2),Ne=Rt[0],We=Rt[1],G=Object(j.useState)(B(k)),ee=Object(pe.a)(G,2),Q=ee[0],x=ee[1],R=Object(V.a)(Object(V.a)({},H),{},{width:Ne,height:Q});return w.a.createElement("div",{className:"my-monaco-editor",ref:Me,style:R})};function Re(he){var q=he.width,g=q===void 0?"100%":q,re=he.height,k=re===void 0?"100%":re,X=he.original,S=he.modified,C=he.language,J=he.options,H=J===void 0?{}:J,E=Object(j.useRef)(),P=Object(j.useState)(null),ae=Object(pe.a)(P,2),W=ae[0],be=ae[1];function M(Pe){var He;return E.current&&(He=new T.default(function(Oe){var Se=Object(xe.a)(Oe),$;try{for(Se.s();!($=Se.n()).done;){var K=$.value;(K.target.offsetHeight>0||K.target.offsetWidth>0)&&Pe.layout()}}catch(ue){Se.e(ue)}finally{Se.f()}}),He.observe(E.current)),He}Object(j.useEffect)(function(){E.current&&h.e(27).then(h.t.bind(null,"M/lh",7)).then(function(Pe){b=Pe;var He=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},H),{},{wordWrap:!0}));be(He);var Oe=M(He);return function(){He.dispose();var Se=He.getModel();Se&&Se.dispose(),Oe.unobserve(E.current)}})},[]),Object(j.useEffect)(function(){W&&W.setModel({original:b.editor.createModel(X,C),modified:b.editor.createModel(S,C)})},[X,S,C,W]);var p=B(g),le=B(k),Ue={width:p,height:le};return w.a.createElement("div",{className:"my-diff-editor",ref:E,style:Ue})}},ZpRC:function(Je,je,h){"use strict";function V(N){return typeof N=="object"&&N!=null&&N.nodeType===1}function ve(N,A){return(!A||N!=="hidden")&&N!=="visible"&&N!=="clip"}function se(N,A){if(N.clientHeight<N.scrollHeight||N.clientWidth<N.scrollWidth){var te=getComputedStyle(N,null);return ve(te.overflowY,A)||ve(te.overflowX,A)||function(B){var L=function(F){if(!F.ownerDocument||!F.ownerDocument.defaultView)return null;try{return F.ownerDocument.defaultView.frameElement}catch(z){return null}}(B);return!!L&&(L.clientHeight<B.scrollHeight||L.clientWidth<B.scrollWidth)}(N)}return!1}function xe(N,A,te,B,L,F,z,Y){return F<N&&z>A||F>N&&z<A?0:F<=N&&Y<=te||z>=A&&Y>=te?F-N-B:z>A&&Y<te||F<N&&Y>te?z-A+L:0}var pe=function(N,A){var te=window,B=A.scrollMode,L=A.block,F=A.inline,z=A.boundary,Y=A.skipOverflowHiddenElements,b=typeof z=="function"?z:function(Qe){return Qe!==z};if(!V(N))throw new TypeError("Invalid target");for(var fe=document.scrollingElement||document.documentElement,Re=[],he=N;V(he)&&b(he);){if((he=he.parentElement)===fe){Re.push(he);break}he!=null&&he===document.body&&se(he)&&!se(document.documentElement)||he!=null&&se(he,Y)&&Re.push(he)}for(var q=te.visualViewport?te.visualViewport.width:innerWidth,g=te.visualViewport?te.visualViewport.height:innerHeight,re=window.scrollX||pageXOffset,k=window.scrollY||pageYOffset,X=N.getBoundingClientRect(),S=X.height,C=X.width,J=X.top,H=X.right,E=X.bottom,P=X.left,ae=L==="start"||L==="nearest"?J:L==="end"?E:J+S/2,W=F==="center"?P+C/2:F==="end"?H:P,be=[],M=0;M<Re.length;M++){var p=Re[M],le=p.getBoundingClientRect(),Ue=le.height,Pe=le.width,He=le.top,Oe=le.right,Se=le.bottom,$=le.left;if(B==="if-needed"&&J>=0&&P>=0&&E<=g&&H<=q&&J>=He&&E<=Se&&P>=$&&H<=Oe)return be;var K=getComputedStyle(p),ue=parseInt(K.borderLeftWidth,10),D=parseInt(K.borderTopWidth,10),_=parseInt(K.borderRightWidth,10),me=parseInt(K.borderBottomWidth,10),Ie=0,Ze=0,Me="offsetWidth"in p?p.offsetWidth-p.clientWidth-ue-_:0,Fe="offsetHeight"in p?p.offsetHeight-p.clientHeight-D-me:0;if(fe===p)Ie=L==="start"?ae:L==="end"?ae-g:L==="nearest"?xe(k,k+g,g,D,me,k+ae,k+ae+S,S):ae-g/2,Ze=F==="start"?W:F==="center"?W-q/2:F==="end"?W-q:xe(re,re+q,q,ue,_,re+W,re+W+C,C),Ie=Math.max(0,Ie+k),Ze=Math.max(0,Ze+re);else{Ie=L==="start"?ae-He-D:L==="end"?ae-Se+me+Fe:L==="nearest"?xe(He,Se,Ue,D,me+Fe,ae,ae+S,S):ae-(He+Ue/2)+Fe/2,Ze=F==="start"?W-$-ue:F==="center"?W-($+Pe/2)+Me/2:F==="end"?W-Oe+_+Me:xe($,Oe,Pe,ue,_+Me,W,W+C,C);var Te=p.scrollLeft,De=p.scrollTop;ae+=De-(Ie=Math.max(0,Math.min(De+Ie,p.scrollHeight-Ue+Fe))),W+=Te-(Ze=Math.max(0,Math.min(Te+Ze,p.scrollWidth-Pe+Me)))}be.push({el:p,top:Ie,left:Ze})}return be};function oe(N){return N===Object(N)&&Object.keys(N).length!==0}function j(N,A){A===void 0&&(A="auto");var te="scrollBehavior"in document.body.style;N.forEach(function(B){var L=B.el,F=B.top,z=B.left;L.scroll&&te?L.scroll({top:F,left:z,behavior:A}):(L.scrollTop=F,L.scrollLeft=z)})}function w(N){return N===!1?{block:"end",inline:"nearest"}:oe(N)?N:{block:"start",inline:"nearest"}}function T(N,A){var te=!N.ownerDocument.documentElement.contains(N);if(oe(A)&&typeof A.behavior=="function")return A.behavior(te?[]:pe(N,A));if(te)return;var B=w(A);return j(pe(N,B),B.behavior)}var O=je.a=T},aRTE:function(Je,je){Je.exports={L:1,M:0,Q:3,H:2}},bT9E:function(Je,je,h){"use strict";h.d(je,"a",function(){return ve});var V=h("VTBJ");function ve(se,xe){var pe=Object(V.a)({},se);return Array.isArray(xe)&&xe.forEach(function(oe){delete pe[oe]}),pe}},c5Ni:function(Je,je,h){},dQei:function(Je,je){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;Je.exports=h},dWSS:function(Je,je,h){var V=h("dQei");function ve(se,xe){if(se.length==null)throw new Error(se.length+"/"+xe);for(var pe=0;pe<se.length&&se[pe]==0;)pe++;this.num=new Array(se.length-pe+xe);for(var oe=0;oe<se.length-pe;oe++)this.num[oe]=se[oe+pe]}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),pe=0;pe<this.getLength();pe++)for(var oe=0;oe<se.getLength();oe++)xe[pe+oe]^=V.gexp(V.glog(this.get(pe))+V.glog(se.get(oe)));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)),pe=new Array(this.getLength()),oe=0;oe<this.getLength();oe++)pe[oe]=this.get(oe);for(var oe=0;oe<se.getLength();oe++)pe[oe]^=V.gexp(V.glog(se.get(oe))+xe);return new ve(pe,0).mod(se)}},Je.exports=ve},dejd:function(Je,je,h){},dmUQ:function(Je,je,h){"use strict";var V=h("Ff2n"),ve=h("rePB"),se=h("1OyB"),xe=h("vuIU"),pe=h("Ji7U"),oe=h("md7G"),j=h("foSv"),w=h("q1tI"),T=h.n(w),O=h("TSYQ"),N=h.n(O),A=h("4IlW");function te(S,C){var J=Object.keys(S);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(S);C&&(H=H.filter(function(E){return Object.getOwnPropertyDescriptor(S,E).enumerable})),J.push.apply(J,H)}return J}function B(S){for(var C=1;C<arguments.length;C++){var J=arguments[C]!=null?arguments[C]:{};C%2?te(Object(J),!0).forEach(function(H){Object(ve.a)(S,H,J[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(J)):te(Object(J)).forEach(function(H){Object.defineProperty(S,H,Object.getOwnPropertyDescriptor(J,H))})}return S}function L(S){var C=F();return function(){var H=Object(j.a)(S),E;if(C){var P=Object(j.a)(this).constructor;E=Reflect.construct(H,arguments,P)}else E=H.apply(this,arguments);return Object(oe.a)(this,E)}}function F(){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(S){return!1}}function z(){}function Y(S){S.preventDefault()}var b=function(C){return C.replace(/[^\w.-]+/g,"")},fe=200,Re=600,he=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,q=function(C){return C!=null},g=function(C,J){return J===C||typeof J=="number"&&typeof C=="number"&&isNaN(J)&&isNaN(C)},re=function(S){Object(pe.a)(J,S);var C=L(J);function J(H){var E;Object(se.a)(this,J),E=C.call(this,H),E.onKeyDown=function(W){var be=E.props,M=be.onKeyDown,p=be.onPressEnter;if(W.keyCode===A.a.UP){var le=E.getRatio(W);E.up(W,le,null),E.stop()}else if(W.keyCode===A.a.DOWN){var Ue=E.getRatio(W);E.down(W,Ue,null),E.stop()}else W.keyCode===A.a.ENTER&&p&&p(W);if(E.recordCursorPosition(),E.lastKeyCode=W.keyCode,M){for(var Pe=arguments.length,He=new Array(Pe>1?Pe-1:0),Oe=1;Oe<Pe;Oe++)He[Oe-1]=arguments[Oe];M.apply(void 0,[W].concat(He))}},E.onKeyUp=function(W){var be=E.props.onKeyUp;if(E.stop(),E.recordCursorPosition(),be){for(var M=arguments.length,p=new Array(M>1?M-1:0),le=1;le<M;le++)p[le-1]=arguments[le];be.apply(void 0,[W].concat(p))}},E.onChange=function(W){var be=E.props.onChange;E.state.focused&&(E.inputting=!0),E.rawInput=E.props.parser(E.getValueFromEvent(W)),E.setState({inputValue:E.rawInput}),be(E.toNumber(E.rawInput))},E.onMouseUp=function(){var W=E.props.onMouseUp;E.recordCursorPosition(),W&&W.apply(void 0,arguments)},E.onFocus=function(){var W;E.setState({focused:!0}),(W=E.props).onFocus.apply(W,arguments)},E.onBlur=function(){var W=E.props.onBlur;E.inputting=!1,E.setState({focused:!1});var be=E.getCurrentValidValue(E.state.inputValue),M=E.setValue(be,z);if(W){var p=E.input.value,le=E.getInputDisplayValue({focus:!1,value:M});E.input.value=le&&Number(le),W.apply(void 0,arguments),E.input.value=p}},E.getRatio=function(W){var be=1;return W.metaKey||W.ctrlKey?be=.1:W.shiftKey&&(be=10),be},E.getFullNum=function(W){return isNaN(W)?W:/e/i.test(String(W))?Number(W).toFixed(18).replace(/\.?0+$/,""):W},E.getPrecision=function(W){if(q(E.props.precision))return E.props.precision;var be=String(W);if(be.indexOf("e-")>=0)return parseInt(be.slice(be.indexOf("e-")+2),10);var M=0;return be.indexOf(".")>=0&&(M=be.length-be.indexOf(".")-1),M},E.getInputDisplayValue=function(W){var be=W||E.state,M=be.focused,p=be.inputValue,le=be.value,Ue;M?Ue=p:Ue=E.toPrecisionAsStep(le),Ue==null&&(Ue="");var Pe=E.formatWrapper(Ue);return q(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(W){}},E.restoreByAfter=function(W){if(W===void 0)return!1;var be=E.input.value,M=be.lastIndexOf(W);if(M===-1)return!1;var p=E.cursorBefore.length;return E.lastKeyCode===A.a.DELETE&&E.cursorBefore.charAt(p-1)===W[0]?(E.fixCaret(p,p),!0):M+W.length===be.length?(E.fixCaret(M,M),!0):!1},E.partRestoreByAfter=function(W){return W===void 0?!1:Array.prototype.some.call(W,function(be,M){var p=W.substring(M);return E.restoreByAfter(p)})},E.isNotCompleteNumber=function(W){return isNaN(W)||W===""||W===null||W&&W.toString().indexOf(".")===W.toString().length-1},E.stop=function(){E.autoStepTimer&&clearTimeout(E.autoStepTimer)},E.down=function(W,be,M){E.pressingUpOrDown=!0,E.step("down",W,be,M)},E.up=function(W,be,M){E.pressingUpOrDown=!0,E.step("up",W,be,M)},E.saveInput=function(W){E.input=W};var P=H.value;P===void 0&&(P=H.defaultValue),E.state={focused:H.autoFocus};var ae=E.getValidValue(E.toNumber(P));return E.state=B(B({},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,W=P.onChange,be=P.max,M=P.min,p=this.state.focused;if(E){if(!g(E.value,ae)||!g(E.max,be)||!g(E.min,M)){var le=p?ae:this.getValidValue(ae),Ue;this.pressingUpOrDown?Ue=le:this.inputting?Ue=this.rawInput:Ue=this.toPrecisionAsStep(le),this.setState({value:le,inputValue:Ue})}var Pe="value"in this.props?ae:this.state.value;"max"in this.props&&E.max!==be&&typeof Pe=="number"&&Pe>be&&W&&W(be),"min"in this.props&&E.min!==M&&typeof Pe=="number"&&Pe<M&&W&&W(M)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var He=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===A.a.BACKSPACE?He=this.cursorStart-1:this.lastKeyCode===A.a.DELETE&&(He=this.cursorStart):He=this.input.value.length,this.fixCaret(He,He)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case A.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case A.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Oe){}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 q(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,W=parseFloat(E);return isNaN(W)?E:(W<P&&(W=P),W>ae&&(W=ae),W)}},{key:"setValue",value:function(E,P){var ae=this.props.precision,W=this.isNotCompleteNumber(parseFloat(E))?null:parseFloat(E),be=this.state.value,M=be===void 0?null:be,p=this.state.inputValue,le=p===void 0?null:p,Ue=typeof W=="number"?W.toFixed(ae):"".concat(W),Pe=W!==M||Ue!=="".concat(le);return"value"in this.props?(le=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:le},P)):this.setState({value:W,inputValue:this.toPrecisionAsStep(E)},P),Pe&&this.props.onChange(W),W}},{key:"getMaxPrecision",value:function(E){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ae=this.props,W=ae.precision,be=ae.step;if(q(W))return W;var M=this.getPrecision(P),p=this.getPrecision(be),le=this.getPrecision(E);return E?Math.max(le,M+p):M+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,W=E&&E.length>16&&ae;return this.isNotCompleteNumber(E)||W?E:q(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,W=this.getPrecisionFactor(E,P),be=Math.abs(this.getMaxPrecision(E,P)),M=((W*E+W*ae*P)/W).toFixed(be);return this.toNumber(M)}},{key:"downStep",value:function(E,P){var ae=this.props.step,W=this.getPrecisionFactor(E,P),be=Math.abs(this.getMaxPrecision(E,P)),M=((W*E-W*ae*P)/W).toFixed(be);return this.toNumber(M)}},{key:"step",value:function(E,P){var ae=this,W=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 M=this.props;if(M.disabled)return;var p=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(p))return;var le=this["".concat(E,"Step")](p,W),Ue=le>M.max||le<M.min;if(le>M.max?le=M.max:le<M.min&&(le=M.min),this.setValue(le,null),this.setState({focused:!0},function(){ae.pressingUpOrDown=!1}),Ue)return;this.autoStepTimer=setTimeout(function(){ae[E](P,W,!0)},be?fe:Re)}},{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,W=this.input.selectionEnd;(E!==ae||P!==W)&&this.input.setSelectionRange(E,P)}catch(be){}}},{key:"render",value:function(){var E,P=this.props,ae=P.prefixCls,W=P.disabled,be=P.readOnly,M=P.useTouch,p=P.autoComplete,le=P.upHandler,Ue=P.downHandler,Pe=P.className,He=P.max,Oe=P.min,Se=P.style,$=P.title,K=P.onMouseEnter,ue=P.onMouseLeave,D=P.onMouseOver,_=P.onMouseOut,me=P.required,Ie=P.onClick,Ze=P.tabIndex,Me=P.type,Fe=P.placeholder,Te=P.id,De=P.inputMode,Qe=P.pattern,tt=P.step,ot=P.maxLength,$e=P.autoFocus,Ke=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=N()(ae,(E={},Object(ve.a)(E,Pe,!!Pe),Object(ve.a)(E,"".concat(ae,"-disabled"),W),Object(ve.a)(E,"".concat(ae,"-focused"),xt),E)),Le={};Object.keys(kt).forEach(function(I){(I.substr(0,5)==="data-"||I.substr(0,5)==="aria-"||I==="role")&&(Le[I]=kt[I])});var Ut=!be&&!W,Rt=this.getInputDisplayValue(null),Ne=(Pt||Pt===0)&&(isNaN(Pt)||Number(Pt)>=He),We=(Pt||Pt===0)&&(isNaN(Pt)||Number(Pt)<=Oe),G=Ne||W||be,ee=We||W||be,Q=N()("".concat(ae,"-handler"),"".concat(ae,"-handler-up"),Object(ve.a)({},"".concat(ae,"-handler-up-disabled"),G)),x=N()("".concat(ae,"-handler"),"".concat(ae,"-handler-down"),Object(ve.a)({},"".concat(ae,"-handler-down-disabled"),ee)),R=M?{onTouchStart:G?z:this.up,onTouchEnd:this.stop}:{onMouseDown:G?z:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},U=M?{onTouchStart:ee?z:this.down,onTouchEnd:this.stop}:{onMouseDown:ee?z:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return T.a.createElement("div",{className:bt,style:Se,title:$,onMouseEnter:K,onMouseLeave:ue,onMouseOver:D,onMouseOut:_,onFocus:function(){return null},onBlur:function(){return null}},T.a.createElement("div",{className:"".concat(ae,"-handler-wrap")},T.a.createElement("span",Object.assign({unselectable:"on"},R,{role:"button","aria-label":"Increase Value","aria-disabled":G,className:Q}),le||T.a.createElement("span",{unselectable:"on",className:"".concat(ae,"-handler-up-inner"),onClick:Y})),T.a.createElement("span",Object.assign({unselectable:"on"},U,{role:"button","aria-label":"Decrease Value","aria-disabled":ee,className:x}),Ue||T.a.createElement("span",{unselectable:"on",className:"".concat(ae,"-handler-down-inner"),onClick:Y}))),T.a.createElement("div",{className:"".concat(ae,"-input-wrap")},T.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Oe,"aria-valuemax":He,"aria-valuenow":Pt,required:me,type:Me,placeholder:Fe,onPaste:At,onClick:Ie,onMouseUp:this.onMouseUp,className:"".concat(ae,"-input"),tabIndex:Ze,autoComplete:p,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Ut?this.onKeyDown:z,onKeyUp:Ut?this.onKeyUp:z,autoFocus:$e,maxLength:ot,readOnly:be,disabled:W,max:He,min:Oe,step:tt,name:Ke,title:$,id:Te,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Rt),pattern:Qe,inputMode:De,onInput:gt},Le))))}}]),J}(T.a.Component);re.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:he,min:-he,step:1,style:{},onChange:z,onKeyDown:z,onPressEnter:z,onFocus:z,onBlur:z,parser:b,required:!1,autoComplete:"off"};var k=re,X=je.a=k},"e+RI":function(Je,je,h){Je.exports={btn:"btn___35XHi",s1:"s1___yzdGB",s2:"s2___3kxXm",btnDisabled:"btnDisabled___lI9pA",btn2:"btn2___2KLJQ"}},"eS0+":function(Je,je,h){"use strict";var V=h("giR+"),ve=h("fyUT"),se=h("tJVT"),xe=h("PpiC"),pe=h("OaEy"),oe=h("2fM7"),j=h("q1tI"),w=h.n(j),T=h("2sxD"),O=h.n(T),N=h("51dB"),A=h.n(N),te=h("5MlY"),B=h.n(te),L=h("lnNo"),F=h.n(L),z=h("YBdh"),Y=h.n(z),b=h("LvDl"),fe=h.n(b),Re=h("TSYQ"),he=h.n(Re),q=oe.a.Option,g=function(S){var C=parseInt(S);return Object(b.isNaN)(C)?0:C},re=function(S){var C,J,H=S.index,E=S.value,P=E===void 0?[]:E,ae=S.onChange,W=S.type,be=S.disabled,M=be===void 0?!1:be,p=S.expansion,le=p===void 0?!0:p,Ue=Object(xe.a)(S,["index","value","onChange","type","disabled","expansion"]),Pe=Object(j.useState)(!0),He=Object(se.a)(Pe,2),Oe=He[0],Se=He[1],$=function(ue,D){var _=Object(b.cloneDeep)(P);_.difficulties[D].num=ue,console.log(_,444),ae(_)};return w.a.createElement("div",{className:O.a.ListGroup,style:{borderWidth:H?1:0}},w.a.createElement("div",{className:O.a.a},H+1),w.a.createElement("div",{"data-type":"width",className:O.a.b},P==null?void 0:P.name),w.a.createElement("div",{className:O.a.c},P==null||((C=P.difficulties)===null||C===void 0)?void 0:C.map(function(K,ue){return w.a.createElement("div",{key:ue,style:{display:Oe?"flex":ue?"none":"flex"},className:O.a.c1},w.a.createElement("span",{style:{color:"#777777",marginRight:5}},"\u96BE\u5EA6"),K.difficulty===1&&w.a.createElement("span",{className:O.a.radio},"\u7B80\u5355"),K.difficulty===2&&w.a.createElement("span",{className:O.a.radio},"\u9002\u4E2D"),K.difficulty===3&&w.a.createElement("span",{className:O.a.radio},"\u56F0\u96BE"),w.a.createElement("span",{style:{color:"#777777",marginRight:5,marginLeft:50}},"\u62BD\u9898\u6570\u91CF"),H===0&&ue===0?w.a.createElement("div",{id:"".concat(W,"_sum")},w.a.createElement(ve.a,{disabled:M,parser:g,onChange:function(_){return $(_,ue)},min:0,max:K==null?void 0:K.count,value:(K==null?void 0:K.num)||0,style:{width:66}}),w.a.createElement("span",{style:{display:"none"}},"\u8BF7\u8F93\u5165\u6570\u91CF")):w.a.createElement(ve.a,{disabled:M,parser:g,onChange:function(_){return $(_,ue)},min:0,max:K==null?void 0:K.count,value:(K==null?void 0:K.num)||0,style:{width:66}}),w.a.createElement("span",{style:{marginLeft:5}},"/",K==null?void 0:K.count))})),w.a.createElement("div",{style:{display:(P==null||((J=P.difficulties)===null||J===void 0)?void 0:J.length)===1||!le?"none":"block"},onClick:function(){return Se(!Oe)},className:O.a.d},Oe?"\u6536\u8D77":"\u5C55\u5F00",w.a.createElement("img",{style:{marginTop:-2,transform:Oe?"rotate(0deg)":"rotate(180deg)"},src:F.a,className:"ml5"})))},k=function(S){var C,J,H=S.value,E=H===void 0?[]:H,P=S.onChange,ae=S.listClassName,W=S.disabled,be=W===void 0?!1:W,M=S.expansion,p=M===void 0?!0:M,le=Object(xe.a)(S,["value","onChange","listClassName","disabled","expansion"]),Ue=Object(j.useState)(!0),Pe=Object(se.a)(Ue,2),He=Pe[0],Oe=Pe[1],Se=function(_){var me,Ie=_.score||0,Ze=[];_==null||((me=_.item_banks)===null||me===void 0)||me.forEach(function(Fe){var Te;Fe==null||((Te=Fe.tag_disciplines)===null||Te===void 0)||Te.forEach(function(De){var Qe;De==null||((Qe=De.difficulties)===null||Qe===void 0)||Qe.forEach(function(tt){tt.num&&Ze.push(tt.num)})})});var Me=Ze.reduce(function(Fe,Te){return Fe+Te},0);return Me*Ie},$=[{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(_,me,Ie){var Ze=Object(b.cloneDeep)(E);Ze.item_banks[me].tag_disciplines[Ie]=_;var Me=Se(Ze);Ze.scoreTotal=Me,console.log(Ze,"newValue"),P(Ze)},ue=function(_){var me=Object(b.cloneDeep)(E);me.score=_;var Ie=Se(me);me.scoreTotal=Ie,P(me)};return w.a.createElement("div",{className:he()(O.a.list,ae)},w.a.createElement("div",{className:O.a.head},w.a.createElement("div",{className:O.a.name},w.a.createElement("b",null),w.a.createElement("span",null,(C=$.find(function(D){return D.type===(E==null?void 0:E.item_type)}))===null||C===void 0?void 0:C.name)),w.a.createElement("div",{className:O.a.right},p&&w.a.createElement("div",{onClick:function(){return Oe(!He)},className:"current c-light-primary mb10"},He?"\u6536\u8D77":"\u5C55\u5F00",w.a.createElement("img",{style:{marginTop:-2,transform:He?"rotate(0deg)":"rotate(180deg)"},src:F.a,className:"ml5"})),w.a.createElement("div",null,w.a.createElement("img",{src:A.a}),w.a.createElement("span",{className:"ml10 mr20"},"\u603B\u5206",E.scoreTotal,"\u5206"),w.a.createElement("img",{className:"mr10",src:B.a}),w.a.createElement("span",null,(E==null?void 0:E.item_type)==="COMBINATION"?"\u6BCF\u5C0F\u9898":"\u6BCF\u9898"),w.a.createElement("div",{id:"".concat(E==null?void 0:E.item_type,"_score")},w.a.createElement(ve.a,{disabled:be,parser:g,min:0,onChange:ue,value:E.score,style:{margin:"0 5px"}}),w.a.createElement("span",{style:{display:"none"}},"\u8BF7\u8F93\u5165\u6BCF\u9898\u5206\u6570")),w.a.createElement("span",null,"\u5206")))),w.a.createElement("div",{className:O.a.body,style:{display:He?"block":"none"}},E==null||((J=E.item_banks)===null||J===void 0)?void 0:J.map(function(D,_){var me;return w.a.createElement(w.a.Fragment,{key:_},w.a.createElement("div",{className:O.a.top},w.a.createElement("img",{src:Y.a}),w.a.createElement("span",null,"\u65B9\u5411/\u8BFE\u7A0B"),w.a.createElement("b",null),w.a.createElement("aside",null,D==null?void 0:D.disciplines,"/",D==null?void 0:D.sub_discipline)),w.a.createElement("div",{className:O.a.bottom},w.a.createElement("div",{className:O.a.l},"\u77E5\u8BC6\u70B9"),w.a.createElement("div",{className:O.a.r},D==null||((me=D.tag_disciplines)===null||me===void 0)?void 0:me.map(function(Ie,Ze){return w.a.createElement(re,{expansion:p,disabled:be,type:E==null?void 0:E.item_type,key:"".concat(_,"-").concat(Ze),value:Ie,index:Ze,onChange:function(Fe){return K(Fe,_,Ze)}})}))))})))};je.a=k},exQ7:function(Je,je,h){Je.exports=h.p+"static/te.6f9c0684.svg"},f4xo:function(Je,je,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)}},Je.exports=ve},fAei:function(Je,je,h){"use strict";h.d(je,"a",function(){return fe.a});var V=h("rePB"),ve=h("VTBJ"),se=h("KQm4"),xe=h("1OyB"),pe=h("vuIU"),oe=h("Ji7U"),j=h("LK+K"),w=h("q1tI"),T=h("4IlW"),O=h("Kwbf"),N=h("TSYQ"),A=h.n(N),te=h("sboe"),B=h("OZM5"),L=h("815F"),F=h("ODXe"),z=h("Ff2n"),Y=h("+nKL"),b=h("8XRh"),fe=h("WaYH"),Re=function(Oe,Se){var $=Oe.className,K=Oe.style,ue=Oe.motion,D=Oe.motionNodes,_=Oe.motionType,me=Oe.onMotionStart,Ie=Oe.onMotionEnd,Ze=Oe.active,Me=Oe.treeNodeRequiredProps,Fe=Object(z.a)(Oe,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),Te=w.useState(!0),De=Object(F.a)(Te,2),Qe=De[0],tt=De[1],ot=w.useContext(te.a),$e=ot.prefixCls,Ke=w.useRef(!1),At=function(){Ke.current||Ie(),Ke.current=!0};return Object(w.useEffect)(function(){D&&_==="hide"&&Qe&&tt(!1)},[D]),Object(w.useEffect)(function(){return D&&me(),function(){D&&At()}},[]),D?w.createElement(b.default,Object.assign({ref:Se,visible:Qe},ue,{motionAppear:_==="show",onAppearEnd:At,onLeaveEnd:At}),function(gt,kt){var ct=gt.className,Pt=gt.style;return w.createElement("div",{ref:kt,className:A()("".concat($e,"-treenode-motion"),ct),style:Pt},D.map(function(xt){var bt=xt.data,Le=bt.key,Ut=Object(z.a)(bt,["key"]),Rt=xt.isStart,Ne=xt.isEnd;delete Ut.children;var We=Object(L.f)(Le,Me);return w.createElement(fe.a,Object.assign({},Ut,We,{active:Ze,data:xt.data,key:Le,isStart:Rt,isEnd:Ne}))}))}):w.createElement(fe.a,Object.assign({domRef:Se,className:$,style:K},Fe,{active:Ze}))};Re.displayName="MotionTreeNode";var he=w.forwardRef(Re),q=he;function g(){var He=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Se=He.length,$=Oe.length;if(Math.abs(Se-$)!==1)return{add:!1,key:null};function K(ue,D){var _=new Map;ue.forEach(function(Ie){_.set(Ie,!0)});var me=D.filter(function(Ie){return!_.has(Ie)});return me.length===1?me[0]:null}return Se<$?{add:!0,key:K(He,Oe)}:{add:!1,key:K(Oe,He)}}function re(He,Oe,Se){var $=He.findIndex(function(_){var me=_.data;return me.key===Se}),K=He[$+1],ue=Oe.findIndex(function(_){var me=_.data;return me.key===Se});if(K){var D=Oe.findIndex(function(_){var me=_.data;return me.key===K.data.key});return Oe.slice(ue+1,D)}return Oe.slice(ue+1)}var k={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},X=function(){},S="RC_TREE_MOTION_".concat(Math.random()),C={key:S},J={key:S,level:0,index:0,pos:"0",node:C},H={parent:null,children:[],pos:J.pos,data:C,isStart:[],isEnd:[]};function E(He,Oe,Se,$){return Oe===!1||!Se?He:He.slice(0,Math.ceil(Se/$)+1)}function P(He){var Oe=He.data.key,Se=He.pos;return Object(L.e)(Oe,Se)}function ae(He){for(var Oe=String(He.data.key),Se=He;Se.parent;)Se=Se.parent,Oe="".concat(Se.data.key," > ").concat(Oe);return Oe}var W=function(Oe,Se){var $=Oe.prefixCls,K=Oe.data,ue=Oe.selectable,D=Oe.checkable,_=Oe.expandedKeys,me=Oe.selectedKeys,Ie=Oe.checkedKeys,Ze=Oe.loadedKeys,Me=Oe.loadingKeys,Fe=Oe.halfCheckedKeys,Te=Oe.keyEntities,De=Oe.disabled,Qe=Oe.dragging,tt=Oe.dragOverNodeKey,ot=Oe.dropPosition,$e=Oe.motion,Ke=Oe.height,At=Oe.itemHeight,gt=Oe.virtual,kt=Oe.focusable,ct=Oe.activeItem,Pt=Oe.focused,xt=Oe.tabIndex,bt=Oe.onKeyDown,Le=Oe.onFocus,Ut=Oe.onBlur,Rt=Oe.onActiveChange,Ne=Oe.onListChangeStart,We=Oe.onListChangeEnd,G=Object(z.a)(Oe,["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"]),ee=w.useRef(null);w.useImperativeHandle(Se,function(){return{scrollTo:function(dt){ee.current.scrollTo(dt)}}});var Q=w.useState(_),x=Object(F.a)(Q,2),R=x[0],U=x[1],I=w.useState(K),de=Object(F.a)(I,2),Ce=de[0],ke=de[1],_t=w.useState(K),at=Object(F.a)(_t,2),ge=at[0],lt=at[1],Et=w.useState([]),qe=Object(F.a)(Et,2),Ft=qe[0],et=qe[1],Ht=w.useState(null),It=Object(F.a)(Ht,2),vt=It[0],$t=It[1];function Lt(){ke(K),lt(K),et([]),$t(null),We()}w.useEffect(function(){U(_);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(re(Ce,K,nt.key),gt,Ke,At),Vt=Ce.slice();Vt.splice(dt+1,0,H),lt(Vt),et(Kt),$t("show")}else{var an=K.findIndex(function(tn){var Nt=tn.data.key;return Nt===nt.key}),Gt=E(re(K,Ce,nt.key),gt,Ke,At),Ct=K.slice();Ct.splice(an+1,0,H),lt(Ct),et(Gt),$t("hide")}else Ce!==K&&(ke(K),lt(K))},[_,K]),w.useEffect(function(){Qe||Lt()},[Qe]);var Be=$e?ge:K,ut={expandedKeys:_,selectedKeys:me,loadedKeys:Ze,loadingKeys:Me,checkedKeys:Ie,halfCheckedKeys:Fe,dragOverNodeKey:tt,dropPosition:ot,keyEntities:Te};return w.createElement(w.Fragment,null,Pt&&ct&&w.createElement("span",{style:k,"aria-live":"assertive"},ae(ct)),w.createElement("div",{role:"tree"},w.createElement("input",{style:k,disabled:kt===!1||De,tabIndex:kt!==!1?xt:null,onKeyDown:bt,onFocus:Le,onBlur:Ut,value:"",onChange:X})),w.createElement(Y.a,Object.assign({},G,{data:Be,itemKey:P,height:Ke,fullHeight:!1,virtual:gt,itemHeight:At,prefixCls:"".concat($,"-list"),ref:ee}),function(nt){var dt=nt.pos,Kt=nt.data,Vt=Kt.key,an=Object(z.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 w.createElement(q,Object.assign({},an,Nt,{active:ct&&Vt===ct.data.key,pos:dt,data:nt.data,isStart:Gt,isEnd:Ct,motion:$e,motionNodes:Vt===S?Ft:null,motionType:vt,onMotionStart:Ne,onMotionEnd:Lt,treeNodeRequiredProps:ut,onMouseMove:function(){Rt(null)}}))}))},be=w.forwardRef(W);be.displayName="NodeList";var M=be,p=h("NvD2"),le=function(He){Object(oe.a)(Se,He);var Oe=Object(j.a)(Se);function Se(){var $;return Object(xe.a)(this,Se),$=Oe.apply(this,arguments),$.destroyed=!1,$.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},$.listRef=w.createRef(),$.onNodeDragStart=function(K,ue){var D=$.state,_=D.expandedKeys,me=D.keyEntities,Ie=$.props.onDragStart,Ze=ue.props.eventKey;$.dragNode=ue;var Me=Object(B.b)(_,Ze);$.setState({dragging:!0,dragNodesKeys:Object(B.g)(Ze,me)}),$.setExpandedKeys(Me),Ie&&Ie({event:K,node:Object(L.b)(ue.props)})},$.onNodeDragEnter=function(K,ue){var D=$.state,_=D.expandedKeys,me=D.keyEntities,Ie=D.dragNodesKeys,Ze=$.props.onDragEnter,Me=ue.props,Fe=Me.pos,Te=Me.eventKey;if(!$.dragNode||Ie.indexOf(Te)!==-1)return;var De=Object(B.c)(K,ue);if($.dragNode.props.eventKey===Te&&De===0){$.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){$.setState({dragOverNodeKey:Te,dropPosition:De}),$.delayedDragEnterLogic||($.delayedDragEnterLogic={}),Object.keys($.delayedDragEnterLogic).forEach(function(Qe){clearTimeout($.delayedDragEnterLogic[Qe])}),$.delayedDragEnterLogic[Fe]=window.setTimeout(function(){if(!$.state.dragging)return;var Qe=Object(se.a)(_),tt=me[Te];tt&&(tt.children||[]).length&&(Qe=Object(B.a)(_,Te)),"expandedKeys"in $.props||$.setExpandedKeys(Qe),Ze&&Ze({event:K,node:Object(L.b)(ue.props),expandedKeys:Qe})},400)},0)},$.onNodeDragOver=function(K,ue){var D=$.state.dragNodesKeys,_=$.props.onDragOver,me=ue.props.eventKey;if(D.indexOf(me)!==-1)return;if($.dragNode&&me===$.state.dragOverNodeKey){var Ie=Object(B.c)(K,ue);if(Ie===$.state.dropPosition)return;$.setState({dropPosition:Ie})}_&&_({event:K,node:Object(L.b)(ue.props)})},$.onNodeDragLeave=function(K,ue){var D=$.props.onDragLeave;$.setState({dragOverNodeKey:""}),D&&D({event:K,node:Object(L.b)(ue.props)})},$.onNodeDragEnd=function(K,ue){var D=$.props.onDragEnd;$.setState({dragOverNodeKey:""}),$.cleanDragState(),D&&D({event:K,node:Object(L.b)(ue.props)}),$.dragNode=null},$.onNodeDrop=function(K,ue){var D=$.state,_=D.dragNodesKeys,me=_===void 0?[]:_,Ie=D.dropPosition,Ze=$.props.onDrop,Me=ue.props,Fe=Me.eventKey,Te=Me.pos;if($.setState({dragOverNodeKey:""}),$.cleanDragState(),me.indexOf(Fe)!==-1){Object(O.a)(!1,"Can not drop to dragNode(include it's children node)");return}var De=Object(B.k)(Te),Qe={event:K,node:Object(L.b)(ue.props),dragNode:$.dragNode?Object(L.b)($.dragNode.props):null,dragNodesKeys:me.slice(),dropPosition:Ie+Number(De[De.length-1]),dropToGap:!1};Ie!==0&&(Qe.dropToGap=!0),Ze&&Ze(Qe),$.dragNode=null},$.cleanDragState=function(){var K=$.state.dragging;K&&$.setState({dragging:!1})},$.onNodeClick=function(K,ue){var D=$.props.onClick;D&&D(K,ue)},$.onNodeDoubleClick=function(K,ue){var D=$.props.onDoubleClick;D&&D(K,ue)},$.onNodeSelect=function(K,ue){var D=$.state.selectedKeys,_=$.state.keyEntities,me=$.props,Ie=me.onSelect,Ze=me.multiple,Me=ue.selected,Fe=ue.key,Te=!Me;Te?Ze?D=Object(B.a)(D,Fe):D=[Fe]:D=Object(B.b)(D,Fe);var De=D.map(function(Qe){var tt=_[Qe];return tt?tt.node:null}).filter(function(Qe){return Qe});$.setUncontrolledState({selectedKeys:D}),Ie&&Ie(D,{event:"select",selected:Te,node:ue,selectedNodes:De,nativeEvent:K.nativeEvent})},$.onNodeCheck=function(K,ue,D){var _=$.state,me=_.keyEntities,Ie=_.checkedKeys,Ze=_.halfCheckedKeys,Me=$.props,Fe=Me.checkStrictly,Te=Me.onCheck,De=ue.key,Qe,tt={event:"check",node:ue,checked:D,nativeEvent:K.nativeEvent};if(Fe){var ot=D?Object(B.a)(Ie,De):Object(B.b)(Ie,De),$e=Object(B.b)(Ze,De);Qe={checked:ot,halfChecked:$e},tt.checkedNodes=ot.map(function(Pt){return me[Pt]}).filter(function(Pt){return Pt}).map(function(Pt){return Pt.node}),$.setUncontrolledState({checkedKeys:ot})}else{var Ke=Object(p.a)([].concat(Object(se.a)(Ie),[De]),!0,me),At=Ke.checkedKeys,gt=Ke.halfCheckedKeys;if(!D){var kt=new Set(At);kt.delete(De);var ct=Object(p.a)(Array.from(kt),{checked:!1,halfCheckedKeys:gt},me);At=ct.checkedKeys,gt=ct.halfCheckedKeys}Qe=At,tt.checkedNodes=[],tt.checkedNodesPositions=[],tt.halfCheckedKeys=gt,At.forEach(function(Pt){var xt=me[Pt];if(!xt)return;var bt=xt.node,Le=xt.pos;tt.checkedNodes.push(bt),tt.checkedNodesPositions.push({node:bt,pos:Le})}),$.setUncontrolledState({checkedKeys:At},!1,{halfCheckedKeys:gt})}Te&&Te(Qe,tt)},$.onNodeLoad=function(K){return new Promise(function(ue){$.setState(function(D){var _=D.loadedKeys,me=_===void 0?[]:_,Ie=D.loadingKeys,Ze=Ie===void 0?[]:Ie,Me=$.props,Fe=Me.loadData,Te=Me.onLoad,De=K.key;if(!Fe||me.indexOf(De)!==-1||Ze.indexOf(De)!==-1)return{};var Qe=Fe(K);return Qe.then(function(){var tt=$.state,ot=tt.loadedKeys,$e=tt.loadingKeys,Ke=Object(B.a)(ot,De),At=Object(B.b)($e,De);Te&&Te(Ke,{event:"load",node:K}),$.setUncontrolledState({loadedKeys:Ke}),$.setState({loadingKeys:At}),ue()}),{loadingKeys:Object(B.a)(Ze,De)}})})},$.onNodeMouseEnter=function(K,ue){var D=$.props.onMouseEnter;D&&D({event:K,node:ue})},$.onNodeMouseLeave=function(K,ue){var D=$.props.onMouseLeave;D&&D({event:K,node:ue})},$.onNodeContextMenu=function(K,ue){var D=$.props.onRightClick;D&&(K.preventDefault(),D({event:K,node:ue}))},$.onFocus=function(){var K=$.props.onFocus;$.setState({focused:!0}),K&&K.apply(void 0,arguments)},$.onBlur=function(){var K=$.props.onBlur;$.setState({focused:!1}),$.onActiveChange(null),K&&K.apply(void 0,arguments)},$.getTreeNodeRequiredProps=function(){var K=$.state,ue=K.expandedKeys,D=K.selectedKeys,_=K.loadedKeys,me=K.loadingKeys,Ie=K.checkedKeys,Ze=K.halfCheckedKeys,Me=K.dragOverNodeKey,Fe=K.dropPosition,Te=K.keyEntities;return{expandedKeys:ue||[],selectedKeys:D||[],loadedKeys:_||[],loadingKeys:me||[],checkedKeys:Ie||[],halfCheckedKeys:Ze||[],dragOverNodeKey:Me,dropPosition:Fe,keyEntities:Te}},$.setExpandedKeys=function(K){var ue=$.state.treeData,D=Object(L.d)(ue,K);$.setUncontrolledState({expandedKeys:K,flattenNodes:D},!0)},$.onNodeExpand=function(K,ue){var D=$.state.expandedKeys,_=$.state.listChanging,me=$.props,Ie=me.onExpand,Ze=me.loadData,Me=ue.key,Fe=ue.expanded;if(_)return;var Te=D.indexOf(Me),De=!Fe;if(Object(O.a)(Fe&&Te!==-1||!Fe&&Te===-1,"Expand state not sync with index check"),De?D=Object(B.a)(D,Me):D=Object(B.b)(D,Me),$.setExpandedKeys(D),Ie&&Ie(D,{node:ue,expanded:De,nativeEvent:K.nativeEvent}),De&&Ze){var Qe=$.onNodeLoad(ue);Qe&&Qe.then(function(){var tt=Object(L.d)($.state.treeData,D);$.setUncontrolledState({flattenNodes:tt})})}},$.onListChangeStart=function(){$.setUncontrolledState({listChanging:!0})},$.onListChangeEnd=function(){setTimeout(function(){$.setUncontrolledState({listChanging:!1})})},$.onActiveChange=function(K){var ue=$.state.activeKey,D=$.props.onActiveChange;if(ue===K)return;$.setState({activeKey:K}),K!==null&&$.scrollTo({key:K}),D&&D(K)},$.getActiveItem=function(){var K=$.state,ue=K.activeKey,D=K.flattenNodes;return ue===null?null:D.find(function(_){var me=_.data.key;return me===ue})||null},$.offsetActiveKey=function(K){var ue=$.state,D=ue.flattenNodes,_=ue.activeKey,me=D.findIndex(function(Me){var Fe=Me.data.key;return Fe===_});me===-1&&K<0&&(me=D.length),me=(me+K+D.length)%D.length;var Ie=D[me];if(Ie){var Ze=Ie.data.key;$.onActiveChange(Ze)}else $.onActiveChange(null)},$.onKeyDown=function(K){var ue=$.state,D=ue.activeKey,_=ue.expandedKeys,me=ue.checkedKeys,Ie=$.props,Ze=Ie.onKeyDown,Me=Ie.checkable,Fe=Ie.selectable;switch(K.which){case T.a.UP:{$.offsetActiveKey(-1),K.preventDefault();break}case T.a.DOWN:{$.offsetActiveKey(1),K.preventDefault();break}}var Te=$.getActiveItem();if(Te&&Te.data){var De=$.getTreeNodeRequiredProps(),Qe=Te.data.isLeaf===!1||!!(Te.data.children||[]).length,tt=Object(L.b)(Object(ve.a)(Object(ve.a)({},Object(L.f)(D,De)),{},{data:Te.data,active:!0}));switch(K.which){case T.a.LEFT:{Qe&&_.includes(D)?$.onNodeExpand({},tt):Te.parent&&$.onActiveChange(Te.parent.data.key),K.preventDefault();break}case T.a.RIGHT:{Qe&&!_.includes(D)?$.onNodeExpand({},tt):Te.children&&Te.children.length&&$.onActiveChange(Te.children[0].data.key),K.preventDefault();break}case T.a.ENTER:case T.a.SPACE:{Me&&!tt.disabled&&tt.checkable!==!1&&!tt.disableCheckbox?$.onNodeCheck({},tt,!me.includes(D)):!Me&&Fe&&!tt.disabled&&tt.selectable!==!1&&$.onNodeSelect({},tt);break}}}Ze&&Ze(K)},$.setUncontrolledState=function(K){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if($.destroyed)return;var _=!1,me=!0,Ie={};Object.keys(K).forEach(function(Ze){if(Ze in $.props){me=!1;return}_=!0,Ie[Ze]=K[Ze]}),_&&(!ue||me)&&$.setState(Object(ve.a)(Object(ve.a)({},Ie),D))},$.scrollTo=function(K){$.listRef.current.scrollTo(K)},$}return Object(pe.a)(Se,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var K,ue=this.state,D=ue.focused,_=ue.flattenNodes,me=ue.keyEntities,Ie=ue.dragging,Ze=ue.activeKey,Me=this.props,Fe=Me.prefixCls,Te=Me.className,De=Me.style,Qe=Me.showLine,tt=Me.focusable,ot=Me.tabIndex,$e=ot===void 0?0:ot,Ke=Me.selectable,At=Me.showIcon,gt=Me.icon,kt=Me.switcherIcon,ct=Me.draggable,Pt=Me.checkable,xt=Me.checkStrictly,bt=Me.disabled,Le=Me.motion,Ut=Me.loadData,Rt=Me.filterTreeNode,Ne=Me.height,We=Me.itemHeight,G=Me.virtual,ee=Me.titleRender,Q=Me.onContextMenu,x=Object(B.f)(this.props);return w.createElement(te.a.Provider,{value:{prefixCls:Fe,selectable:Ke,showIcon:At,icon:gt,switcherIcon:kt,draggable:ct,checkable:Pt,checkStrictly:xt,disabled:bt,keyEntities:me,loadData:Ut,filterTreeNode:Rt,titleRender:ee,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}},w.createElement("div",{className:A()(Fe,Te,(K={},Object(V.a)(K,"".concat(Fe,"-show-line"),Qe),Object(V.a)(K,"".concat(Fe,"-focused"),D),Object(V.a)(K,"".concat(Fe,"-active-focused"),Ze!==null),K))},w.createElement(M,Object.assign({ref:this.listRef,prefixCls:Fe,style:De,data:_,disabled:bt,selectable:Ke,checkable:!!Pt,motion:Le,dragging:Ie,height:Ne,itemHeight:We,virtual:G,focusable:tt,focused:D,tabIndex:$e,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,ue){var D=ue.prevProps,_={prevProps:K};function me(gt){return!D&&gt in K||D&&D[gt]!==K[gt]}var Ie;if(me("treeData")?Ie=K.treeData:me("children")&&(Object(O.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),Ie=Object(L.c)(K.children)),Ie){_.treeData=Ie;var Ze=Object(L.a)(Ie);_.keyEntities=Object(ve.a)(Object(V.a)({},S,J),Ze.keyEntities)}var Me=_.keyEntities||ue.keyEntities;if(me("expandedKeys")||D&&me("autoExpandParent"))_.expandedKeys=K.autoExpandParent||!D&&K.defaultExpandParent?Object(B.e)(K.expandedKeys,Me):K.expandedKeys;else if(!D&&K.defaultExpandAll){var Fe=Object(ve.a)({},Me);delete Fe[S],_.expandedKeys=Object.keys(Fe).map(function(gt){return Fe[gt].key})}else!D&&K.defaultExpandedKeys&&(_.expandedKeys=K.autoExpandParent||K.defaultExpandParent?Object(B.e)(K.defaultExpandedKeys,Me):K.defaultExpandedKeys);if(_.expandedKeys||delete _.expandedKeys,Ie||_.expandedKeys){var Te=Object(L.d)(Ie||ue.treeData,_.expandedKeys||ue.expandedKeys);_.flattenNodes=Te}if(K.selectable&&(me("selectedKeys")?_.selectedKeys=Object(B.d)(K.selectedKeys,K):!D&&K.defaultSelectedKeys&&(_.selectedKeys=Object(B.d)(K.defaultSelectedKeys,K))),K.checkable){var De;if(me("checkedKeys")?De=Object(B.j)(K.checkedKeys)||{}:!D&&K.defaultCheckedKeys?De=Object(B.j)(K.defaultCheckedKeys)||{}:Ie&&(De=Object(B.j)(K.checkedKeys)||{checkedKeys:ue.checkedKeys,halfCheckedKeys:ue.halfCheckedKeys}),De){var Qe=De,tt=Qe.checkedKeys,ot=tt===void 0?[]:tt,$e=Qe.halfCheckedKeys,Ke=$e===void 0?[]:$e;if(!K.checkStrictly){var At=Object(p.a)(ot,!0,Me);ot=At.checkedKeys,Ke=At.halfCheckedKeys}_.checkedKeys=ot,_.halfCheckedKeys=Ke}}return me("loadedKeys")&&(_.loadedKeys=K.loadedKeys),_}}]),Se}(w.Component);le.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:[]},le.TreeNode=fe.a;var Ue=le,Pe=je.b=Ue},k4n4:function(Je,je,h){"use strict";var V=h("tJVT"),ve=h("q1tI"),se=h.n(ve),xe=h("e+RI"),pe=h.n(xe),oe=h("FTkQ"),j=h.n(oe),w=h("E/GV"),T=h.n(w),O=function(A){var te=A.type,B=te===void 0?1:te,L=A.value,F=L===void 0?[]:L,z=A.onChange,Y=A.disabled,b=Y===void 0?!1:Y,fe=A.icon,Re=Object(ve.useState)(),he=Object(V.a)(Re,2),q=he[0],g=he[1],re=function(X){z(X)};return B===1?se.a.createElement("div",null,F==null?void 0:F.map(function(k,X){return se.a.createElement("div",{key:X,className:b?"".concat(pe.a.btn," ").concat(pe.a.btnDisabled):pe.a.btn},se.a.createElement("span",{className:pe.a.s1},k.name),se.a.createElement("img",{src:j.a,className:pe.a.s2,onClick:function(){return re(k.id)}}))})):se.a.createElement("div",null,F==null?void 0:F.map(function(k,X){return se.a.createElement("div",{key:X,className:pe.a.btn2},se.a.createElement("span",{className:pe.a.s1},se.a.createElement("img",{src:fe||T.a}),k.name),se.a.createElement("img",{src:j.a,className:pe.a.s2,onClick:function(){return re(k.id)}}))}))};je.a=O},kSUc:function(Je,je,h){},kqOp:function(Je,je,h){"use strict";h.d(je,"a",function(){return O});var V=h("0Owb"),ve=h("fWQN"),se=h("mtLc"),xe=h("yKVA"),pe=h("879j"),oe=h("q1tI"),j=h.n(oe),w=h("Ot1p"),T="\u2581",O=function(N){Object(xe.a)(te,N);var A=Object(pe.a)(te);function te(){var B;Object(ve.a)(this,te);for(var L=arguments.length,F=new Array(L),z=0;z<L;z++)F[z]=arguments[z];return B=A.call.apply(A,[this].concat(F)),B.getChCountBeforeCursor=function(Y,b){for(var fe=b.line,Re=0,he=0;he<fe;he++)Re+=Y.getLine(he).split(T).length-1;var q=Y.getLine(fe).substring(0,b.ch);return Re+=q.split(T).length-1,Re},B.onCMBeforeChange=function(Y,b){var fe=Y.getRange(b.from,b.to),Re=0;if(b.text.forEach(function(re){Re+=re.split(T).length-1}),fe&&fe.indexOf(T)!=-1){var he=fe.split(T).length-1,q=B.getChCountBeforeCursor(Y,b.from);console.log("\u5220\u9664".concat(he,"\u4E2A\uFF0C \u4E4B\u524D\u6709").concat(q,"\u4E2A\uFF0C\u65B0\u589E").concat(Re,"\u4E2A")),B.props.deleteEmptyDisabled?b.cancel():B.props.onPlaceholderChange&&B.props.onPlaceholderChange(q,he,Re)}else if(Re){var g=B.getChCountBeforeCursor(Y,b.from);console.log("\u65B0\u589E".concat(Re,"\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(g,"\u4E2A")),B.props.onPlaceholderChange&&B.props.onPlaceholderChange(g,0,Re)}},B}return Object(se.a)(te,[{key:"render",value:function(){return j.a.createElement(w.a,Object(V.a)({},this.props,{onCMBeforeChange:this.onCMBeforeChange}))}}]),te}(oe.Component)},lZu9:function(Je,je,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"),pe=xe.name=="null";function oe(M){if(V.findModeByName){var p=V.findModeByName(M);p&&(M=p.mime||p.mimes[0])}var le=V.getMode(ve,M);return le.name=="null"?null:le}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 j={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 w in j)j.hasOwnProperty(w)&&se.tokenTypeOverrides[w]&&(j[w]=se.tokenTypeOverrides[w]);var T=/^([*\-_])(?:\s*\1){2,}\s*$/,O=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,N=/^\[(x| )\](?=\s)/i,A=se.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,te=/^ {0,3}(?:\={1,}|-{2,})\s*$/,B=/^[^#!\[\]*_\\<>` "'(~:]+/,L=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,F=/^\s*\[[^\]]+?\]:.*$/,z=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,Y=" ";function b(M,p,le){return p.f=p.inline=le,le(M,p)}function fe(M,p,le){return p.f=p.block=le,le(M,p)}function Re(M){return!M||!/\S/.test(M.string)}function he(M){if(M.linkTitle=!1,M.linkHref=!1,M.linkText=!1,M.em=!1,M.strong=!1,M.strikethrough=!1,M.quote=0,M.indentedCode=!1,M.f==g){var p=pe;if(!p){var le=V.innerMode(xe,M.htmlState);p=le.mode.name=="xml"&&le.state.tagStart===null&&!le.state.context&&le.state.tokenize.isInText}p&&(M.f=S,M.block=q,M.htmlState=null)}return M.trailingSpace=0,M.trailingSpaceNewLine=!1,M.prevLine=M.thisLine,M.thisLine={stream:null},null}function q(M,p){var le=M.column()===p.indentation,Ue=Re(p.prevLine.stream),Pe=p.indentedCode,He=p.prevLine.hr,Oe=p.list!==!1,Se=(p.listStack[p.listStack.length-1]||0)+3;p.indentedCode=!1;var $=p.indentation;if(p.indentationDiff===null&&(p.indentationDiff=p.indentation,Oe)){for(p.list=null;$<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=$-p.listStack[p.listStack.length-1])}var K=!Ue&&!He&&!p.prevLine.header&&(!Oe||!Pe)&&!p.prevLine.fencedCodeEnd,ue=(p.list===!1||He||Ue)&&p.indentation<=Se&&M.match(T),D=null;if(p.indentationDiff>=4&&(Pe||p.prevLine.fencedCodeEnd||p.prevLine.header||Ue))return M.skipToEnd(),p.indentedCode=!0,j.code;if(M.eatSpace())return null;if(le&&p.indentation<=Se&&(D=M.match(A))&&D[1].length<=6)return p.quote=0,p.header=D[1].length,p.thisLine.header=!0,se.highlightFormatting&&(p.formatting="header"),p.f=p.inline,k(p);if(p.indentation<=Se&&M.eat(">"))return p.quote=le?1:p.quote+1,se.highlightFormatting&&(p.formatting="quote"),M.eatSpace(),k(p);if(!ue&&!p.setext&&le&&p.indentation<=Se&&(D=M.match(O))){var _=D[1]?"ol":"ul";return p.indentation=$+M.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&&M.match(N,!1)&&(p.taskList=!0),p.f=p.inline,se.highlightFormatting&&(p.formatting=["list","list-"+_]),k(p)}else{if(le&&p.indentation<=Se&&(D=M.match(L,!0)))return p.quote=0,p.fencedEndRE=new RegExp(D[1]+"+ *$"),p.localMode=se.fencedCodeBlockHighlighting&&oe(D[2]||se.fencedCodeBlockDefaultMode),p.localMode&&(p.localState=V.startState(p.localMode)),p.f=p.block=re,se.highlightFormatting&&(p.formatting="code-block"),p.code=-1,k(p);if(p.setext||(!K||!Oe)&&!p.quote&&p.list===!1&&!p.code&&!ue&&!F.test(M.string)&&(D=M.lookAhead(1))&&(D=D.match(te)))return p.setext?(p.header=p.setext,p.setext=0,M.skipToEnd(),se.highlightFormatting&&(p.formatting="header")):(p.header=D[0].charAt(0)=="="?1:2,p.setext=p.header),p.thisLine.header=!0,p.f=p.inline,k(p);if(ue)return M.skipToEnd(),p.hr=!0,p.thisLine.hr=!0,j.hr;if(M.peek()==="[")return b(M,p,P)}return b(M,p,p.inline)}function g(M,p){var le=xe.token(M,p.htmlState);if(!pe){var Ue=V.innerMode(xe,p.htmlState);(Ue.mode.name=="xml"&&Ue.state.tagStart===null&&!Ue.state.context&&Ue.state.tokenize.isInText||p.md_inside&&M.current().indexOf(">")>-1)&&(p.f=S,p.block=q,p.htmlState=null)}return le}function re(M,p){var le=p.listStack[p.listStack.length-1]||0,Ue=p.indentation<le,Pe=le+3;if(p.fencedEndRE&&p.indentation<=Pe&&(Ue||M.match(p.fencedEndRE))){se.highlightFormatting&&(p.formatting="code-block");var He;return Ue||(He=k(p)),p.localMode=p.localState=null,p.block=q,p.f=S,p.fencedEndRE=null,p.code=0,p.thisLine.fencedCodeEnd=!0,Ue?fe(M,p,p.block):He}else return p.localMode?p.localMode.token(M,p.localState):(M.skipToEnd(),j.code)}function k(M){var p=[];if(M.formatting){p.push(j.formatting),typeof M.formatting=="string"&&(M.formatting=[M.formatting]);for(var le=0;le<M.formatting.length;le++)p.push(j.formatting+"-"+M.formatting[le]),M.formatting[le]==="header"&&p.push(j.formatting+"-"+M.formatting[le]+"-"+M.header),M.formatting[le]==="quote"&&(!se.maxBlockquoteDepth||se.maxBlockquoteDepth>=M.quote?p.push(j.formatting+"-"+M.formatting[le]+"-"+M.quote):p.push("error"))}if(M.taskOpen)return p.push("meta"),p.length?p.join(" "):null;if(M.taskClosed)return p.push("property"),p.length?p.join(" "):null;if(M.linkHref?p.push(j.linkHref,"url"):(M.strong&&p.push(j.strong),M.em&&p.push(j.em),M.strikethrough&&p.push(j.strikethrough),M.emoji&&p.push(j.emoji),M.linkText&&p.push(j.linkText),M.code&&p.push(j.code),M.image&&p.push(j.image),M.imageAltText&&p.push(j.imageAltText,"link"),M.imageMarker&&p.push(j.imageMarker)),M.header&&p.push(j.header,j.header+"-"+M.header),M.quote&&(p.push(j.quote),!se.maxBlockquoteDepth||se.maxBlockquoteDepth>=M.quote?p.push(j.quote+"-"+M.quote):p.push(j.quote+"-"+se.maxBlockquoteDepth)),M.list!==!1){var Ue=(M.listStack.length-1)%3;Ue?Ue===1?p.push(j.list2):p.push(j.list3):p.push(j.list1)}return M.trailingSpaceNewLine?p.push("trailing-space-new-line"):M.trailingSpace&&p.push("trailing-space-"+(M.trailingSpace%2?"a":"b")),p.length?p.join(" "):null}function X(M,p){return M.match(B,!0)?k(p):void 0}function S(M,p){var le=p.text(M,p);if(typeof le!="undefined")return le;if(p.list)return p.list=null,k(p);if(p.taskList){var Ue=M.match(N,!0)[1]===" ";return Ue?p.taskOpen=!0:p.taskClosed=!0,se.highlightFormatting&&(p.formatting="task"),p.taskList=!1,k(p)}if(p.taskOpen=!1,p.taskClosed=!1,p.header&&M.match(/^#+$/,!0))return se.highlightFormatting&&(p.formatting="header"),k(p);var Pe=M.next();if(p.linkTitle){p.linkTitle=!1;var He=Pe;Pe==="("&&(He=")"),He=(He+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Oe="^\\s*(?:[^"+He+"\\\\]+|\\\\\\\\|\\\\.)"+He;if(M.match(new RegExp(Oe),!0))return j.linkHref}if(Pe==="`"){var Se=p.formatting;se.highlightFormatting&&(p.formatting="code"),M.eatWhile("`");var $=M.current().length;if(p.code==0&&(!p.quote||$==1))return p.code=$,k(p);if($==p.code){var K=k(p);return p.code=0,K}else return p.formatting=Se,k(p)}else if(p.code)return k(p);if(Pe==="\\"&&(M.next(),se.highlightFormatting)){var ue=k(p),D=j.formatting+"-escape";return ue?ue+" "+D:D}if(Pe==="!"&&M.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return p.imageMarker=!0,p.image=!0,se.highlightFormatting&&(p.formatting="image"),k(p);if(Pe==="["&&p.imageMarker&&M.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return p.imageMarker=!1,p.imageAltText=!0,se.highlightFormatting&&(p.formatting="image"),k(p);if(Pe==="]"&&p.imageAltText){se.highlightFormatting&&(p.formatting="image");var ue=k(p);return p.imageAltText=!1,p.image=!1,p.inline=p.f=J,ue}if(Pe==="["&&!p.image)return p.linkText&&M.match(/^.*?\]/)||(p.linkText=!0,se.highlightFormatting&&(p.formatting="link")),k(p);if(Pe==="]"&&p.linkText){se.highlightFormatting&&(p.formatting="link");var ue=k(p);return p.linkText=!1,p.inline=p.f=M.match(/\(.*?\)| ?\[.*?\]/,!1)?J:S,ue}if(Pe==="<"&&M.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){p.f=p.inline=C,se.highlightFormatting&&(p.formatting="link");var ue=k(p);return ue?ue+=" ":ue="",ue+j.linkInline}if(Pe==="<"&&M.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){p.f=p.inline=C,se.highlightFormatting&&(p.formatting="link");var ue=k(p);return ue?ue+=" ":ue="",ue+j.linkEmail}if(se.xml&&Pe==="<"&&M.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var _=M.string.indexOf(">",M.pos);if(_!=-1){var me=M.string.substring(M.start,_);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(me)&&(p.md_inside=!0)}return M.backUp(1),p.htmlState=V.startState(xe),fe(M,p,g)}if(se.xml&&Pe==="<"&&M.match(/^\/\w*?>/))return p.md_inside=!1,"tag";if(Pe==="*"||Pe==="_"){for(var Ie=1,Ze=M.pos==1?" ":M.string.charAt(M.pos-2);Ie<3&&M.eat(Pe);)Ie++;var Me=M.peek()||" ",Fe=!/\s/.test(Me)&&(!z.test(Me)||/\s/.test(Ze)||z.test(Ze)),Te=!/\s/.test(Ze)&&(!z.test(Ze)||/\s/.test(Me)||z.test(Me)),De=null,Qe=null;if(Ie%2&&(!p.em&&Fe&&(Pe==="*"||!Te||z.test(Ze))?De=!0:p.em==Pe&&Te&&(Pe==="*"||!Fe||z.test(Me))&&(De=!1)),Ie>1&&(!p.strong&&Fe&&(Pe==="*"||!Te||z.test(Ze))?Qe=!0:p.strong==Pe&&Te&&(Pe==="*"||!Fe||z.test(Me))&&(Qe=!1)),Qe!=null||De!=null){se.highlightFormatting&&(p.formatting=De==null?"strong":Qe==null?"em":"strong em"),De===!0&&(p.em=Pe),Qe===!0&&(p.strong=Pe);var K=k(p);return De===!1&&(p.em=!1),Qe===!1&&(p.strong=!1),K}}else if(Pe===" "&&(M.eat("*")||M.eat("_"))){if(M.peek()===" ")return k(p);M.backUp(1)}if(se.strikethrough){if(Pe==="~"&&M.eatWhile(Pe)){if(p.strikethrough){se.highlightFormatting&&(p.formatting="strikethrough");var K=k(p);return p.strikethrough=!1,K}else if(M.match(/^[^\s]/,!1))return p.strikethrough=!0,se.highlightFormatting&&(p.formatting="strikethrough"),k(p)}else if(Pe===" "&&M.match(/^~~/,!0)){if(M.peek()===" ")return k(p);M.backUp(2)}}if(se.emoji&&Pe===":"&&M.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){p.emoji=!0,se.highlightFormatting&&(p.formatting="emoji");var tt=k(p);return p.emoji=!1,tt}return Pe===" "&&(M.match(/^ +$/,!1)?p.trailingSpace++:p.trailingSpace&&(p.trailingSpaceNewLine=!0)),k(p)}function C(M,p){var le=M.next();if(le===">"){p.f=p.inline=S,se.highlightFormatting&&(p.formatting="link");var Ue=k(p);return Ue?Ue+=" ":Ue="",Ue+j.linkInline}return M.match(/^[^>]+/,!0),j.linkInline}function J(M,p){if(M.eatSpace())return null;var le=M.next();return le==="("||le==="["?(p.f=p.inline=E(le==="("?")":"]"),se.highlightFormatting&&(p.formatting="link-string"),p.linkHref=!0,k(p)):"error"}var H={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function E(M){return function(p,le){var Ue=p.next();if(Ue===M){le.f=le.inline=S,se.highlightFormatting&&(le.formatting="link-string");var Pe=k(le);return le.linkHref=!1,Pe}return p.match(H[M]),le.linkHref=!0,k(le)}}function P(M,p){return M.match(/^([^\]\\]|\\.)*\]:/,!1)?(p.f=ae,M.next(),se.highlightFormatting&&(p.formatting="link"),p.linkText=!0,k(p)):b(M,p,S)}function ae(M,p){if(M.match(/^\]:/,!0)){p.f=p.inline=W,se.highlightFormatting&&(p.formatting="link");var le=k(p);return p.linkText=!1,le}return M.match(/^([^\]\\]|\\.)+/,!0),j.linkText}function W(M,p){return M.eatSpace()?null:(M.match(/^[^\s]+/,!0),M.peek()===void 0?p.linkTitle=!0:M.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),p.f=p.inline=S,j.linkHref+" url")}var be={startState:function(){return{f:q,prevLine:{stream:null},thisLine:{stream:null},block:q,htmlState:null,indentation:0,inline:S,text:X,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(M){return{f:M.f,prevLine:M.prevLine,thisLine:M.thisLine,block:M.block,htmlState:M.htmlState&&V.copyState(xe,M.htmlState),indentation:M.indentation,localMode:M.localMode,localState:M.localMode?V.copyState(M.localMode,M.localState):null,inline:M.inline,text:M.text,formatting:!1,linkText:M.linkText,linkTitle:M.linkTitle,linkHref:M.linkHref,code:M.code,em:M.em,strong:M.strong,strikethrough:M.strikethrough,emoji:M.emoji,header:M.header,setext:M.setext,hr:M.hr,taskList:M.taskList,list:M.list,listStack:M.listStack.slice(0),quote:M.quote,indentedCode:M.indentedCode,trailingSpace:M.trailingSpace,trailingSpaceNewLine:M.trailingSpaceNewLine,md_inside:M.md_inside,fencedEndRE:M.fencedEndRE}},token:function(M,p){if(p.formatting=!1,M!=p.thisLine.stream){if(p.header=0,p.hr=!1,M.match(/^\s*$/,!0))return he(p),null;if(p.prevLine=p.thisLine,p.thisLine={stream:M},p.taskList=!1,p.trailingSpace=0,p.trailingSpaceNewLine=!1,!p.localState&&(p.f=p.block,p.f!=g)){var le=M.match(/^\s*/,!0)[0].replace(/\t/g,Y).length;if(p.indentation=le,p.indentationDiff=null,le>0)return null}}return p.f(M,p)},innerMode:function(M){return M.block==g?{state:M.htmlState,mode:xe}:M.localState?{state:M.localState,mode:M.localMode}:{state:M,mode:be}},indent:function(M,p,le){return M.block==g&&xe.indent?xe.indent(M.htmlState,p,le):M.localState&&M.localMode.indent?M.localMode.indent(M.localState,p,le):V.Pass},blankLine:he,getType:k,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return be},"xml"),V.defineMIME("text/markdown","markdown"),V.defineMIME("text/x-markdown","markdown")})},lnNo:function(Je,je,h){Je.exports=h.p+"static/up.69f3b3fd.svg"},m3fD:function(Je,je,h){Je.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(Je,je){Je.exports={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3}},osHv:function(Je,je,h){(function(V){V(h("VrN/"))})(function(V){"use strict";var ve=V.Pos;function se(z,Y){return z.line-Y.line||z.ch-Y.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",pe=xe+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",oe=new RegExp("<(/?)(["+xe+"]["+pe+"]*)","g");function j(z,Y,b,fe){this.line=Y,this.ch=b,this.cm=z,this.text=z.getLine(Y),this.min=fe?Math.max(fe.from,z.firstLine()):z.firstLine(),this.max=fe?Math.min(fe.to-1,z.lastLine()):z.lastLine()}function w(z,Y){var b=z.cm.getTokenTypeAt(ve(z.line,Y));return b&&/\btag\b/.test(b)}function T(z){return z.line>=z.max?void 0:(z.ch=0,z.text=z.cm.getLine(++z.line),!0)}function O(z){return z.line<=z.min?void 0:(z.text=z.cm.getLine(--z.line),z.ch=z.text.length,!0)}function N(z){for(;;){var Y=z.text.indexOf(">",z.ch);if(Y==-1){if(T(z))continue;return}if(!w(z,Y+1)){z.ch=Y+1;continue}var b=z.text.lastIndexOf("/",Y),fe=b>-1&&!/\S/.test(z.text.slice(b+1,Y));return z.ch=Y+1,fe?"selfClose":"regular"}}function A(z){for(;;){var Y=z.ch?z.text.lastIndexOf("<",z.ch-1):-1;if(Y==-1){if(O(z))continue;return}if(!w(z,Y+1)){z.ch=Y;continue}oe.lastIndex=Y,z.ch=Y;var b=oe.exec(z.text);if(b&&b.index==Y)return b}}function te(z){for(;;){oe.lastIndex=z.ch;var Y=oe.exec(z.text);if(!Y){if(T(z))continue;return}if(!w(z,Y.index+1)){z.ch=Y.index+1;continue}return z.ch=Y.index+Y[0].length,Y}}function B(z){for(;;){var Y=z.ch?z.text.lastIndexOf(">",z.ch-1):-1;if(Y==-1){if(O(z))continue;return}if(!w(z,Y+1)){z.ch=Y;continue}var b=z.text.lastIndexOf("/",Y),fe=b>-1&&!/\S/.test(z.text.slice(b+1,Y));return z.ch=Y+1,fe?"selfClose":"regular"}}function L(z,Y){for(var b=[];;){var fe=te(z),Re,he=z.line,q=z.ch-(fe?fe[0].length:0);if(!fe||!(Re=N(z)))return;if(Re=="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&&(!Y||Y==fe[2]))return{tag:fe[2],from:ve(he,q),to:ve(z.line,z.ch)}}else b.push(fe[2])}}function F(z,Y){for(var b=[];;){var fe=B(z);if(!fe)return;if(fe=="selfClose"){A(z);continue}var Re=z.line,he=z.ch,q=A(z);if(!q)return;if(q[1])b.push(q[2]);else{for(var g=b.length-1;g>=0;--g)if(b[g]==q[2]){b.length=g;break}if(g<0&&(!Y||Y==q[2]))return{tag:q[2],from:ve(z.line,z.ch),to:ve(Re,he)}}}}V.registerHelper("fold","xml",function(z,Y){for(var b=new j(z,Y.line,0);;){var fe=te(b);if(!fe||b.line!=Y.line)return;var Re=N(b);if(!Re)return;if(!fe[1]&&Re!="selfClose"){var he=ve(b.line,b.ch),q=L(b,fe[2]);return q&&se(q.from,he)>0?{from:he,to:q.from}:null}}}),V.findMatchingTag=function(z,Y,b){var fe=new j(z,Y.line,Y.ch,b);if(fe.text.indexOf(">")==-1&&fe.text.indexOf("<")==-1)return;var Re=N(fe),he=Re&&ve(fe.line,fe.ch),q=Re&&A(fe);if(!Re||!q||se(fe,Y)>0)return;var g={from:ve(fe.line,fe.ch),to:he,tag:q[2]};return Re=="selfClose"?{open:g,close:null,at:"open"}:q[1]?{open:F(fe,q[2]),close:g,at:"close"}:(fe=new j(z,he.line,he.ch,b),{open:g,close:L(fe,q[2]),at:"open"})},V.findEnclosingTag=function(z,Y,b,fe){for(var Re=new j(z,Y.line,Y.ch,b);;){var he=F(Re,fe);if(!he)break;var q=new j(z,Y.line,Y.ch,b),g=L(q,he.tag);if(g)return{open:he,close:g}}},V.scanForClosingTag=function(z,Y,b,fe){var Re=new j(z,Y.line,Y.ch,fe?{from:0,to:fe}:null);return L(Re,b)}})},p5ED:function(Je,je,h){"use strict";var V=h("+L6B"),ve=h("2/Rp"),se=h("5Dmo"),xe=h("3S7+"),pe=h("k1fw"),oe=h("tJVT"),j=h("q1tI"),w=h.n(j),T=h("vHTk"),O=h.n(T),N=h("yEEn"),A=h("ZW9T"),te=h("1vsH");je.a=function(B){var L=B.name,F=B.data,z=B.theme,Y=B.type,b=B.filename,fe=B.monacoEditor,Re=B.className,he=B.style,q=B.close,g=B.onClose,re=B.hasMask,k=Object(j.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),X=Object(oe.a)(k,2),S=X[0],C=X[1],J=Object(j.useState)(""),H=Object(oe.a)(J,2),E=H[0],P=H[1],ae=Object(j.useRef)();b&&(fe.filename=b),Object(j.useEffect)(function(){var M,p,le=(M=document.cookie)===null||M===void 0||((p=M.replace(/\s/g,""))===null||p===void 0)?void 0:p.split(";");le==null||le.map(function(Ue){var Pe=Ue.split("=");Pe[0]==="_educoder_session"&&P(Pe[1])})},[]);var W=function(){if(F.startsWith("http")||F.startsWith("/")){be();return}Object(te.x)(b||"educoder",F,b)},be=function(){Object(te.v)(b||L,F)};return console.log("data:",F,"fileanme:",b," name:",L),w.a.createElement("div",{style:Object(pe.a)({},he||{}),className:"".concat(re&&O.a.bgBlack," ").concat(Y?O.a.wrp:"hide")},q&&w.a.createElement("div",{className:O.a.close,ref:ae},w.a.createElement(xe.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return ae.current}},w.a.createElement("span",{onClick:be},w.a.createElement("i",{className:"icon-quxiaozhiding"}))),w.a.createElement(xe.a,{title:"\u5173\u95ED",getPopupContainer:function(){return ae.current}},w.a.createElement("span",{className:"",onClick:g},w.a.createElement("i",{className:"icon-guanbi1"})))),w.a.createElement("div",{className:"".concat(O.a[Re]," ").concat(Re," ").concat(O.a.monaco," ").concat(Y==="txt"?"show":"hide")},Y==="txt"&&w.a.createElement(A.b,fe)),Y==="audio"&&w.a.createElement("audio",{src:"".concat(F!=null&&F.startsWith("/")||(F==null?void 0:F.indexOf("https://"))>-1?F:"data:audio/mp3;base64,").concat(F),autoPlay:!0}),Y==="video"&&w.a.createElement(w.a.Fragment,null,F!=null&&F.startsWith("/")?w.a.createElement("video",{controls:!0,src:"".concat(F),autoPlay:!0}):w.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(F),autoPlay:!0})),Y==="html"&&w.a.createElement("iframe",{src:F+"&disposition=inline"}),Y==="pdf"&&w.a.createElement("embed",{className:O.a.embed,src:F}),Y==="image"&&w.a.createElement(w.a.Fragment,null,w.a.createElement("img",{src:"".concat(F!=null&&F.startsWith("/")||(F==null?void 0:F.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(F)})),Y==="other"&&w.a.createElement("div",null,w.a.createElement(ve.a,{type:"primary",size:"large",onClick:W},w.a.createElement(N.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(Y==="download"||Y==="office")&&w.a.createElement(ve.a,{type:"primary",size:"large",onClick:W},w.a.createElement(N.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Je,je,h){},"rAM+":function(Je,je,h){"use strict";h.d(je,"a",function(){return ve});var V=h("Qw5x");function ve(se,xe){var pe;if(typeof Symbol=="undefined"||se[Symbol.iterator]==null){if(Array.isArray(se)||(pe=Object(V.a)(se))||xe&&se&&typeof se.length=="number"){pe&&(se=pe);var oe=0,j=function(){};return{s:j,n:function(){return oe>=se.length?{done:!0}:{done:!1,value:se[oe++]}},e:function(A){throw A},f:j}}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 w=!0,T=!1,O;return{s:function(){pe=se[Symbol.iterator]()},n:function(){var A=pe.next();return w=A.done,A},e:function(A){T=!0,O=A},f:function(){try{!w&&pe.return!=null&&pe.return()}finally{if(T)throw O}}}}},rUJ1:function(Je,je){const h=/[&<>"']/,V=/[&<>"']/g,ve=/[<>"']|&(?!#?\w+;)/,se=/[<>"']|&(?!#?\w+;)/g,xe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},pe=re=>xe[re];function oe(re,k){if(k){if(h.test(re))return re.replace(V,pe)}else if(ve.test(re))return re.replace(se,pe);return re}const j=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function w(re){return re.replace(j,(k,X)=>(X=X.toLowerCase(),X==="colon"?":":X.charAt(0)==="#"?X.charAt(1)==="x"?String.fromCharCode(parseInt(X.substring(2),16)):String.fromCharCode(+X.substring(1)):""))}const T=/(^|[^\[])\^/g;function O(re,k){re=re.source||re,k=k||"";const X={replace:(S,C)=>(C=C.source||C,C=C.replace(T,"$1"),re=re.replace(S,C),X),getRegex:()=>new RegExp(re,k)};return X}const N=/[^\w:]/g,A=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function te(re,k,X){if(re){let S;try{S=decodeURIComponent(w(X)).replace(N,"").toLowerCase()}catch(C){return null}if(S.indexOf("javascript:")===0||S.indexOf("vbscript:")===0||S.indexOf("data:")===0)return null}k&&!A.test(X)&&(X=Y(k,X));try{X=encodeURI(X).replace(/%25/g,"%")}catch(S){return null}return X}const B={},L=/^[^:]+:\/*[^/]*$/,F=/^([^:]+:)[\s\S]*$/,z=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Y(re,k){B[" "+re]||(L.test(re)?B[" "+re]=re+"/":B[" "+re]=he(re,"/",!0)),re=B[" "+re];const X=re.indexOf(":")===-1;return k.substring(0,2)==="//"?X?k:re.replace(F,"$1")+k:k.charAt(0)==="/"?X?k:re.replace(z,"$1")+k:re+k}const b={exec:function(){}};function fe(re){let k=1,X,S;for(;k<arguments.length;k++){X=arguments[k];for(S in X)Object.prototype.hasOwnProperty.call(X,S)&&(re[S]=X[S])}return re}function Re(re,k){const X=re.replace(/\|/g,(J,H,E)=>{let P=!1,ae=H;for(;--ae>=0&&E[ae]==="\\";)P=!P;return P?"|":" |"}),S=X.split(/ \|/);let C=0;if(S.length>k)S.splice(k);else for(;S.length<k;)S.push("");for(;C<S.length;C++)S[C]=S[C].trim().replace(/\\\|/g,"|");return S}function he(re,k,X){const S=re.length;if(S===0)return"";let C=0;for(;C<S;){const J=re.charAt(S-C-1);if(J===k&&!X)C++;else if(J!==k&&X)C++;else break}return re.substr(0,S-C)}function q(re,k){if(re.indexOf(k[1])===-1)return-1;const X=re.length;let S=0,C=0;for(;C<X;C++)if(re[C]==="\\")C++;else if(re[C]===k[0])S++;else if(re[C]===k[1]&&(S--,S<0))return C;return-1}function g(re){re&&re.sanitize&&!re.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")}Je.exports={escape:oe,unescape:w,edit:O,cleanUrl:te,resolveUrl:Y,noopTest:b,merge:fe,splitCells:Re,rtrim:he,findClosingBracket:q,checkSanitizeDeprecation:g}},rcnY:function(Je,je,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 pe=ve.getRsBlockTable(se,xe);if(pe==null)throw new Error("bad rs block @ typeNumber:"+se+"/errorCorrectLevel:"+xe);for(var oe=pe.length/3,j=new Array,w=0;w<oe;w++)for(var T=pe[w*3+0],O=pe[w*3+1],N=pe[w*3+2],A=0;A<T;A++)j.push(new ve(O,N));return j},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}},Je.exports=ve},sbIO:function(Je,je,h){"use strict";var V=h("DjyN"),ve=h("NUBc"),se=h("5Dmo"),xe=h("3S7+"),pe=h("/zsF"),oe=h("PArb"),j=h("Q9mQ"),w=h("diRs"),T=h("+L6B"),O=h("2/Rp"),N=h("5NDa"),A=h("5rEg"),te=h("miYZ"),B=h("tsqr"),L=h("9og8"),F=h("giR+"),z=h("fyUT"),Y=h("2qtc"),b=h("kLXV"),fe=h("tJVT"),Re=h("WmNS"),he=h.n(Re),q=h("q1tI"),g=h.n(q),re=h("PsQE"),k=h.n(re),X=h("0eGx"),S=h.n(X),C=h("9Bee"),J=h("Ty5D"),H=h("9kvl"),E=h("ErOA"),P=h("+yhJ"),ae=h.n(P),W=h("RZ/O"),be=h.n(W),M=h("LvDl"),p=h("6K3P"),le=h.n(p),Ue=h("sRBo"),Pe=h("kaz8"),He=h("oBTY"),Oe=h("PpiC"),Se=h("Ot1p"),$=h("kqOp"),K=h("7qnI"),ue=h("1vsH"),D=h("PGNT"),_=h.n(D),me=["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"],Ie=function(G,ee){var Q=G.globalSetting,x=G.loading,R=G.dispatch,U=G.isEdit,I=G.editData,de=Object(Oe.a)(G,["globalSetting","loading","dispatch","isEdit","editData"]),Ce=Object(q.useState)(""),ke=Object(fe.a)(Ce,2),_t=ke[0],at=ke[1],ge=Object(q.useState)(""),lt=Object(fe.a)(ge,2),Et=lt[0],qe=lt[1],Ft=Object(q.useState)([]),et=Object(fe.a)(Ft,2),Ht=et[0],It=et[1],vt=Object(q.useState)(""),$t=Object(fe.a)(vt,2),Lt=$t[0],Be=$t[1],ut=Object(q.useState)(),nt=Object(fe.a)(ut,2),dt=nt[0],Kt=nt[1],Vt=Object(q.useState)(!1),an=Object(fe.a)(Vt,2),Gt=an[0],Ct=an[1];Object(q.useEffect)(function(){if(!I||!U)return;at(I==null?void 0:I.name),qe(I==null?void 0:I.analysis),Kt(I==null?void 0:I.is_ordered),Ct(!0)},[I]),Object(q.useEffect)(function(){if(!Gt)return;var Ge=I==null?void 0:I.standard_answer.map(function(st){return st.answer_text});It(Ge),Ct(!1)},[Gt]),Object(q.useImperativeHandle)(ee,function(){return{onSave:tn,Clear:Nt}});var tn=function(){var st=[],fn=!1;return _t?(Ht.forEach(function(gn,Tn){st.push({position:Tn+1,answer_text:[]}),gn.forEach(function(Bn,d){st[Tn].answer_text.push(Bn),(!Bn||!Object(ue.bb)(Bn,1e4))&&(Be("".concat(Tn,"-").concat(d)),B.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?(B.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}):(B.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},Nt=function(){at(""),qe(""),It([]),Kt(!1)},ln=function(st,fn,gn){var Tn=Ht.slice();if(fn&&Tn.splice(st,fn),gn)for(var Bn=0;Bn<gn;Bn++)Tn.splice(st+Bn,0,[""]);It(Tn)},Xt=function(st,fn,gn){Be("");var Tn=Ht.slice();Tn[st][fn]=gn,It(Tn)},hn=function(st){var fn=Ht.slice();fn[st]=[].concat(Object(He.a)(fn[st]),[""]),It(fn)},Kn=function(st,fn){var gn=Ht.slice();if(!gn[st][fn]){gn[st]=gn[st].filter(function(Tn,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=Ht.slice();gn=Ht.filter(function(Tn,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($.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"},Ht.map(function(Ge,st){return g.a.createElement(K.a,{key:st,answers:Ge,index:st,flex:1,is_md:!0,activeOptionErrorIndex:Lt,onAnswerChange:Xt,addChildAnswer:hn,deleteChildAnswer:Kn,deleteChildAnswermain:nn})})),g.a.createElement("div",{className:"mt20"},Ht.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(Se.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Et,onChange:function(st){return qe(st)}}))},Ze=Object(H.a)(function(We){var G=We.loading,ee=We.globalSetting;return{globalSetting:ee,loading:G.effects}},null,null,{forwardRef:!0})(Object(q.forwardRef)(Ie)),Me=h("7Kak"),Fe=h("9yH6"),Te=["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"],De=function(G,ee){var Q=G.globalSetting,x=G.loading,R=G.editData,U=G.dispatch,I=G.onRef,de=I===void 0?function(){}:I,Ce=G.isEdit,ke=Object(Oe.a)(G,["globalSetting","loading","editData","dispatch","onRef","isEdit"]),_t=Object(q.useState)(),at=Object(fe.a)(_t,2),ge=at[0],lt=at[1],Et=Object(q.useState)(""),qe=Object(fe.a)(Et,2),Ft=qe[0],et=qe[1],Ht=Object(q.useState)(""),It=Object(fe.a)(Ht,2),vt=It[0],$t=It[1];Object(q.useEffect)(function(){if(!R||!Ce)return;et(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(q.useImperativeHandle)(ee,function(){return{onSave:Lt,Clear:Be}});var Lt=function(){if(!Ft)return B.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(!ge)return B.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}},Be=function(){et(""),$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(Se.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Ft,onChange:function(nt){return et(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(Fe.a.Group,{buttonStyle:"solid",value:ge,onChange:function(nt){return lt(nt.target.value)}},g.a.createElement(Fe.a.Button,{value:"0",className:"".concat(_.a.radio," mr40")},"\u6B63\u786E"),g.a.createElement(Fe.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(Se.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)}}))},Qe=Object(H.a)(function(We){var G=We.loading,ee=We.globalSetting;return{globalSetting:ee,loading:G.effects}},null,null,{forwardRef:!0})(Object(q.forwardRef)(De)),tt=["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(G,ee){var Q=G.editData,x=G.globalSetting,R=G.loading,U=G.dispatch,I=G.onRef,de=I===void 0?function(){}:I,Ce=G.isEdit,ke=Object(Oe.a)(G,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),_t=Object(q.useState)([]),at=Object(fe.a)(_t,2),ge=at[0],lt=at[1],Et=Object(q.useState)(),qe=Object(fe.a)(Et,2),Ft=qe[0],et=qe[1],Ht=Object(q.useState)([]),It=Object(fe.a)(Ht,2),vt=It[0],$t=It[1],Lt=Object(q.useState)(""),Be=Object(fe.a)(Lt,2),ut=Be[0],nt=Be[1],dt=Object(q.useState)(""),Kt=Object(fe.a)(dt,2),Vt=Kt[0],an=Kt[1];Object(q.useEffect)(function(){lt(["","","",""])},[]),Object(q.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(q.useImperativeHandle)(ee,function(){return{onSave:Gt,Clear:Ct}});var Gt=function(){if(!ut)return B.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;var Nt=ge.findIndex(function(Xt){return!Xt});if(Nt>-1)return B.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(tt[Nt]," \u9009\u9879\u7684\u5185\u5BB9")),!1;if(!vt.length)return B.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 B.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(Se.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(He.a)(vt),[Nt]))}},tt[Nt])),g.a.createElement("div",{className:_.a.editorWrap},Ft===Nt?g.a.createElement(Se.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 et(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(He.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(He.a)(ge),[""]))}})))}),g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),g.a.createElement(Se.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)}}))},$e=Object(H.a)(function(We){var G=We.loading,ee=We.globalSetting;return{globalSetting:ee,loading:G.effects}},null,null,{forwardRef:!0})(Object(q.forwardRef)(ot)),Ke=["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(G,ee){var Q=G.editData,x=G.globalSetting,R=G.loading,U=G.dispatch,I=G.onRef,de=I===void 0?function(){}:I,Ce=G.isEdit,ke=Object(Oe.a)(G,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),_t=Object(q.useState)([]),at=Object(fe.a)(_t,2),ge=at[0],lt=at[1],Et=Object(q.useState)(),qe=Object(fe.a)(Et,2),Ft=qe[0],et=qe[1],Ht=Object(q.useState)(),It=Object(fe.a)(Ht,2),vt=It[0],$t=It[1],Lt=Object(q.useState)(""),Be=Object(fe.a)(Lt,2),ut=Be[0],nt=Be[1],dt=Object(q.useState)(""),Kt=Object(fe.a)(dt,2),Vt=Kt[0],an=Kt[1];Object(q.useEffect)(function(){lt(["","","",""])},[]),Object(q.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(q.useImperativeHandle)(ee,function(){return{onSave:Gt,Clear:Ct}});var Gt=function(){if(!ut)return B.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;var Nt=ge.findIndex(function(Xt){return!Xt});if(Nt>-1)return B.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Ke[Nt]," \u9009\u9879\u7684\u5185\u5BB9")),!1;if(console.log("activeAnswer: ",vt),!(typeof vt=="number"))return B.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(Se.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)}},Ke[Nt])),g.a.createElement("div",{className:_.a.editorWrap},Ft===Nt?g.a.createElement(Se.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 et(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(He.a)(ge),[""]))}})))}),g.a.createElement("p",{className:_.a.titleWrap},g.a.createElement("span",{className:_.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),g.a.createElement(Se.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(H.a)(function(We){var G=We.loading,ee=We.globalSetting;return{globalSetting:ee,loading:G.effects}},null,null,{forwardRef:!0})(Object(q.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(G,ee){var Q=G.editData,x=G.globalSetting,R=G.loading,U=G.dispatch,I=G.onRef,de=I===void 0?function(){}:I,Ce=G.isEdit,ke=Object(Oe.a)(G,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),_t=Object(q.useState)(""),at=Object(fe.a)(_t,2),ge=at[0],lt=at[1],Et=Object(q.useState)(""),qe=Object(fe.a)(Et,2),Ft=qe[0],et=qe[1],Ht=Object(q.useState)(""),It=Object(fe.a)(Ht,2),vt=It[0],$t=It[1];Object(q.useEffect)(function(){var ut;if(!Q||!Ce)return;lt(Q==null?void 0:Q.name),et(Q==null?void 0:Q.analysis),$t(Q==null||((ut=Q.answer_texts)===null||ut===void 0)?void 0:ut[0])},[Q]),Object(q.useImperativeHandle)(ee,function(){return{onSave:Lt,Clear:Be}});var Lt=function(){return ge?vt?{name:ge,answer_texts:[vt],analysis:Ft}:(B.b.info("\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848"),!1):(B.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},Be=function(){lt(""),et(""),$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(Se.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(Se.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(Se.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Ft,onChange:function(nt){return et(nt)}}))},Pt=Object(H.a)(function(We){var G=We.loading,ee=We.globalSetting;return{globalSetting:ee,loading:G.effects}},null,null,{forwardRef:!0})(Object(q.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"],Le=function(G,ee){var Q=G.globalSetting,x=G.loading,R=G.dispatch,U=G.editData,I=G.onRef,de=I===void 0?function(){}:I,Ce=G.isEdit,ke=Object(Oe.a)(G,["globalSetting","loading","dispatch","editData","onRef","isEdit"]),_t=Object(q.useState)(""),at=Object(fe.a)(_t,2),ge=at[0],lt=at[1],Et=Object(q.useState)([]),qe=Object(fe.a)(Et,2),Ft=qe[0],et=qe[1];console.log(Ft),Object(q.useEffect)(function(){var Lt;if(!U||!Ce)return;lt(U==null?void 0:U.name);var Be=U==null||((Lt=U.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})})});et(Be)},[U]),Object(q.useImperativeHandle)(ee,function(){return{onSave:Ht,Clear:It}});var Ht=function(){if(!ge)return B.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(Ft.length===0)return B.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),!1;for(var Be=0;Be<Ft.length;Be++){var ut,nt=Ft[Be];if(!(nt!=null&&nt.name))return B.b.info("\u8BF7\u60A8\u8F93\u5165\u7B2C".concat(Be+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 B.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(Be+1,"\u5C0F\u9898").concat(bt[dt],"\u9009\u9879\u7684\u5185\u5BB9")),!1;if(!(nt!=null&&nt.qusAnswer.length))return B.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(Be+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(""),et([])},vt=function(){var Be={id:Math.random(),item_type:"SINGLE",open:!1,name:"",qusList:["","","",""],activeQusEditor:null,qusAnswer:[],analysis:""};et(Ft.concat(Be))},$t=function(Be,ut,nt){var dt=Object(M.cloneDeep)(Ft);if(Be==="open"&&(dt[ut].open=!dt[ut].open),Be==="delete"&&dt.splice(ut,1),Be==="value"&&(dt[ut].name=nt),Be==="answer"&&(dt[ut].qusAnswer=[nt]),Be==="edit"&&(dt[ut].activeQusEditor=nt),Be==="details"&&(dt[ut].qusList[dt[ut].activeQusEditor]=nt),Be==="addQus"&&(dt[ut].qusList=dt[ut].qusList.concat("")),Be==="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})}Be==="analysis"&&(dt[ut].analysis=nt),et(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(Se.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:ge,onChange:function(Be){return lt(Be)}}),Ft==null?void 0:Ft.map(function(Lt,Be){var ut;return g.a.createElement("div",{className:_.a.fold,key:Lt.id},g.a.createElement("div",{onClick:function(){return $t("open",Be)},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",Be+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),g.a.createElement("b",{style:{visibility:"hidden"},onClick:function(dt){dt.stopPropagation(),$t("delete",Be)},className:"iconfont icon-shanchu8"})),g.a.createElement("div",{className:"mb10",style:{display:Lt.open?"block":"none"}},g.a.createElement(Se.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",Be,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",Be,dt)}},bt[dt])),g.a.createElement("div",{className:_.a.editorWrap},(Lt==null?void 0:Lt.activeQusEditor)===dt?g.a.createElement(Se.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",Be,Gt)}}):g.a.createElement("div",{className:_.a.htmlWrap,onClick:function(){return $t("edit",Be,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",Be,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",Be)}})))}),g.a.createElement("p",{className:"mb10 mt10"},g.a.createElement("span",{className:_.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),g.a.createElement(Se.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",Be,dt)}})))}))},Ut=Object(H.a)(function(We){var G=We.loading,ee=We.globalSetting;return{globalSetting:ee,loading:G.effects}},null,null,{forwardRef:!0})(Object(q.forwardRef)(Le)),Rt=function(G){var ee,Q,x,R,U,I,de,Ce,ke=G.data,_t=G.submit,at=G.goBack,ge=G.loading,lt=G.onTypeScore,Et=G.editPreview,qe=Et===void 0?!1:Et,Ft=G.onSkipExamination,et=G.selectValue,Ht=G.onExchange,It=Object(q.useRef)(),vt=Object(q.useRef)(Object(M.debounce)(function(){return ln()},100,{leading:!0,trailing:!0})),$t=Object(q.useState)(null),Lt=Object(fe.a)($t,2),Be=Lt[0],ut=Lt[1],nt=Object(q.useState)(!1),dt=Object(fe.a)(nt,2),Kt=dt[0],Vt=dt[1],an=Object(J.i)();Object(q.useEffect)(function(){return window.addEventListener("scroll",vt==null?void 0:vt.current),function(){window.removeEventListener("scroll",vt==null?void 0:vt.current)}},[]),Object(q.useEffect)(function(){Vt(!0)},[]),Object(q.useEffect)(function(){var Ee,ce,Xe,Tt,Mt=(Ee=document.getElementById("examName"))===null||Ee===void 0||((ce=Ee.getElementsByClassName("ant-pagination-options-quick-jumper"))===null||ce===void 0||((Xe=ce[0])===null||Xe===void 0||((Tt=Xe.childNodes)===null||Tt===void 0)))?void 0:Tt[2];Mt&&(Mt.nodeValue="\u4EFD")},[ke]);var Gt=function(ce){var Xe=parseInt(ce);return isNaN(Xe)?"":Xe};function Ct(){var Ee=0,ce=0,Xe=0;return document.body&&(ce=document.body.scrollTop),document.documentElement&&(Xe=document.documentElement.scrollTop),Ee=ce-Xe>0?ce:Xe,Ee}function tn(){var Ee=0,ce=0,Xe=0;return document.body&&(ce=document.body.scrollHeight),document.documentElement&&(Xe=document.documentElement.scrollHeight),Ee=ce-Xe>0?ce:Xe,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"),Xe=document.getElementById("preview_btns_else");Ct()+Nt()>=tn()-68?(ce.style.visibility="hidden",Xe.style.visibility="visible"):(ce.style.visibility="visible",Xe.style.visibility="hidden")},Xt=["\u5BB9\u6613","\u7B80\u5355","\u9002\u4E2D","\u56F0\u96BE"],hn=function(ce){var Xe,Tt=[];return g.a.createElement(g.a.Fragment,null,g.a.createElement("aside",{className:k.a.single},ce==null||((Xe=ce.choices)===null||Xe===void 0)?void 0:Xe.map(function(Mt,Ot){return Mt.is_answer&&Tt.push(fn[Ot]),g.a.createElement("ul",{key:Ot},g.a.createElement("li",null,fn[Ot],"\u3001"),g.a.createElement("li",null,g.a.createElement(C.a,{value:Mt.choice_text})))})),g.a.createElement("div",{className:k.a.analysis},g.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",Tt.join(""),g.a.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",Xt[ce.difficulty])),g.a.createElement("aside",null,g.a.createElement("span",{className:k.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 Xe,Tt=ce==null||((Xe=ce.standard_answer)===null||Xe===void 0)?void 0:Xe.map(function(Mt){var Ot;return"\u7B54\u6848\uFF08\u586B\u7A7A".concat(Mt.position,"\uFF09\uFF1A").concat(Mt==null||((Ot=Mt.answer_text)===null||Ot===void 0)?void 0:Ot.join("\u3001"))});return g.a.createElement(g.a.Fragment,null,g.a.createElement("div",{className:k.a.analysis},g.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",Tt),g.a.createElement("aside",null,g.a.createElement("span",{className:k.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 Xe;return g.a.createElement("div",{className:k.a.analysis},g.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",ce==null||((Xe=ce.answer_texts)===null||Xe===void 0)?void 0:Xe[0]),g.a.createElement("aside",null,g.a.createElement("span",{className:k.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)))},Ge=function(ce){var Xe;return g.a.createElement("div",{className:k.a.analysis},g.a.createElement("aside",null,g.a.createElement("span",{className:k.a.text},"\u9884\u671F\u8F93\u51FA:"),g.a.createElement(C.a,{value:ce==null||((Xe=ce.program_attr)===null||Xe===void 0)?void 0:Xe.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,Xe){var Tt;return g.a.createElement("div",null,ce==null||((Tt=ce.sub_item_banks)===null||Tt===void 0)?void 0:Tt.map(function(Mt,Ot){var Dt,cn=[];return g.a.createElement(g.a.Fragment,null,g.a.createElement("div",{style:{marginLeft:25,fontSize:"16px",color:"#333"}},Xe+1+"."+(Ot+1),"\uFF08\u5355\u9009\u9898\uFF09",Mt.name),g.a.createElement("aside",{className:k.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:k.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:k.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 Xe=[];ce.questions.map(function(Mt){return Mt==null?void 0:Mt.sub_item_banks.map(function(Ot){Xe.push(Ot)})});var Tt=0;ce.type==="COMBINATION"?Tt=ce.questions_score/Xe.length:Tt=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:k.a.modalColumn},g.a.createElement("div",{className:k.a.modalRow,style:{justifyContent:"flex-start"}},g.a.createElement("sup",{className:k.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(z.a,{min:1,parser:Gt,defaultValue:Tt,onChange:function(Ot){Tt=Ot}}),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(Tt){pn.next=3;break}return B.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:Tt,scoreTotal:Tt*(Xe==null?void 0:Xe.length)},lt(cn)):(Nn={type:ce==null?void 0:ce.type,score:Tt,scoreTotal:Tt*ce.questions_count},lt(Nn));case 4:case"end":return pn.stop()}},Dt)}));function Ot(){return Mt.apply(this,arguments)}return Ot}()})},Tn=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:k.a.modalColumn},g.a.createElement("div",{style:{color:"#676A6C",display:"flex"},className:"font14 mt20"},g.a.createElement("img",{style:{marginRight:5},src:le.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:k.a.modalRow,style:{marginTop:20}},g.a.createElement("sup",{className:k.a.sup},"*"),g.a.createElement("span",{style:{flexShrink:0}},"\u8BD5\u5377\u540D\u79F0\uFF1A"),g.a.createElement(A.a,{placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0",min:0,maxLength:60,defaultValue:ce,onChange:function(Tt){ce=Tt.target.value}}))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Xe=Object(L.a)(he.a.mark(function Mt(){var Ot,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 B.b.warn("\u8BD5\u5377\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"),Wn.abrupt("return",Promise.reject());case 3:return Dt=[],cn=[],Nn=[],ke==null||((Ot=ke.questionList)===null||Ot===void 0)||Ot.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 Tt(){return Xe.apply(this,arguments)}return Tt}()})},Bn=function(ce,Xe,Tt,Mt){var Ot,Dt=(Ot=Mt.questions)===null||Ot===void 0?void 0:Ot.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,Ht({single_question_id:ce,seleted_item_bank_ids:Dt},{type:Xe,index:Tt});case 3:cn.update({cancelButtonProps:{disabled:!1}}),B.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 Xe,Tt=(Xe=ce.questions)===null||Xe===void 0?void 0:Xe.map(function(Dt){return Dt.id}),Mt=ce.name,Ot=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 Ot.update({cancelButtonProps:{disabled:!0}}),pn.next=3,Ht({seleted_item_bank_ids:Tt},{type:ce.type});case 3:Ot.update({cancelButtonProps:{disabled:!1}}),B.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 Xe=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,Ht();case 3:ce.update({cancelButtonProps:{disabled:!1}}),B.b.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u6574\u5F20\u8BD5\u9898");case 5:case"end":return Dt.stop()}},Mt)}));function Tt(){return Xe.apply(this,arguments)}return Tt}()})},r=function(ce){console.log(ce,"key"),Ft(ce-1)},u=function(){return g.a.createElement(g.a.Fragment,null,g.a.createElement(w.a,{color:"#55575D",overlayClassName:k.a.popover,visible:Kt,getPopupContainer:function(Xe){return Xe==null?void 0:Xe.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(O.a,{onMouseEnter:function(){return Vt(!0)},onMouseLeave:function(){return Vt(!1)},onClick:function(){Tn()}},"\u4FDD\u5B58")),g.a.createElement(O.a,{onClick:function(){document.body.scrollIntoView(),at()}},"\u8FD4\u56DE"),g.a.createElement(O.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(O.a,{onClick:at},"\u8FD4\u56DE"),et>0&&g.a.createElement(O.a,{onClick:function(){return r(et)},type:"primary"},"\u4E0A\u4E00\u4EFD"),et<(ke==null||((ce=ke.exam)===null||ce===void 0)?void 0:ce.total_num)-1&&g.a.createElement(O.a,{onClick:function(){return r(et+2)}},"\u4E0B\u4E00\u4EFD"))},c=function(ce,Xe){if(console.log(ce,222),Xe==="SINGLE")return g.a.createElement(g.a.Fragment,null,g.a.createElement(gt,{ref:It,editData:ce,isEdit:!0}),g.a.createElement(oe.a,null));if(Xe==="MULTIPLE")return g.a.createElement(g.a.Fragment,null,g.a.createElement($e,{ref:It,editData:ce,isEdit:!0}),g.a.createElement(oe.a,null));if(Xe==="JUDGMENT")return g.a.createElement(g.a.Fragment,null,g.a.createElement(Qe,{ref:It,editData:ce,isEdit:!0}),g.a.createElement(oe.a,null));if(Xe==="COMPLETION")return g.a.createElement(g.a.Fragment,null,g.a.createElement(Ze,{ref:It,editData:ce,isEdit:!0}),g.a.createElement(oe.a,null));if(Xe==="SUBJECTIVE")return g.a.createElement(g.a.Fragment,null,g.a.createElement(Pt,{ref:It,editData:ce,isEdit:!0}),g.a.createElement(oe.a,null));if(Xe==="COMBINATION")return g.a.createElement(g.a.Fragment,null,g.a.createElement(Ut,{ref:It,editData:ce,isEdit:!0}),g.a.createElement(oe.a,null));if(Xe==="PROGRAM"){var Tt;H.d.push("/problems/".concat(ce==null||((Tt=ce.program_attr)===null||Tt===void 0)?void 0:Tt.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(et,"&exercise=true"))}},ie=function(){var Ee=Object(L.a)(he.a.mark(function ce(Xe,Tt){var Mt,Ot,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(Ot=Fn.sent,Ot){Fn.next=5;break}return Fn.abrupt("return");case 5:return Dt={question_score:Tt.score,analysis:Ot.analysis},console.log(Ot,"editorData"),(Xe==="SINGLE"||Xe==="MULTIPLE"||Xe==="JUDGMENT")&&(Nn=[],Cn=[],Dt.question_type=Xe==="JUDGMENT"?2:1,Dt.question_title=Ot==null?void 0:Ot.name,Ot==null||((cn=Ot.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),Xe==="COMPLETION"&&(Dt.is_ordered=Ot.is_ordered,Dt.question_title=Ot==null?void 0:Ot.name,Dt.question_type=3,Wn=[],Ot==null||((pn=Ot.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),Xe==="SUBJECTIVE"&&(Dt.question_title=Ot==null?void 0:Ot.name,Dt.question_type=3,Dt.standard_answers=Ot==null?void 0:Ot.answer_texts),Xe==="COMBINATION"&&(Dt.question_title=Ot==null?void 0:Ot.name,Dt.question_type=7,Dt.sub_questions=Ot==null||((jn=Ot.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(Tt.id,".json"),{method:"put",body:Dt});case 13:ti=Fn.sent,(ti==null?void 0:ti.status)===0&&(B.b.success("\u7F16\u8F91\u6210\u529F"),r(et+1)),ut(null);case 16:case"end":return Fn.stop()}},ce)}));return function(Xe,Tt){return Ee.apply(this,arguments)}}(),Ye=function(){for(var ce=[],Xe=0;Xe<(ke==null||((Tt=ke.exam)===null||Tt===void 0)?void 0:Tt.total_num);Xe++){var Tt;ce.push({})}return ce};console.log(Ye(),"data");var _e=ke==null||((ee=ke.questionList)===null||ee===void 0)?void 0:ee.reduce(function(Ee,ce){return Ee+ce.questions_score},0),Bt=qe&&(ke==null||((Q=ke.exam)===null||Q===void 0)?void 0:Q.exercise_status)!==1;return g.a.createElement("section",{className:k.a.wrap},g.a.createElement("div",{id:"id_left_preview",className:k.a.left,onMouseEnter:function(ce){var Xe=document.getElementById("id_left_preview");Xe.style.overflowY="auto"},onMouseLeave:function(ce){var Xe=document.getElementById("id_left_preview");Xe.style.overflowY="hidden"}},g.a.createElement("div",{className:k.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:k.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,ke==null?void 0:ke.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:S.a}),g.a.createElement("span",null,"\u65F6\u957F(\u5206)"),g.a.createElement("aside",null,ke==null||((x=ke.exam)===null||x===void 0)?void 0:x.time))),ke==null||((R=ke.questionList)===null||R===void 0)?void 0:R.map(function(Ee,ce){var Xe;return g.a.createElement("div",{className:k.a.list,key:ce},g.a.createElement("div",{className:k.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:k.a.b},Ee.questions_count),"\u9898 ",g.a.createElement("span",{className:k.a.l},"|"),"\u5171",g.a.createElement("span",{className:k.a.r},Ee.questions_score),"\u5206"),g.a.createElement("div",{className:k.a.answerSheet},Ee==null||((Xe=Ee.questions)===null||Xe===void 0)?void 0:Xe.map(function(Tt,Mt){return g.a.createElement("div",{onClick:function(){var Dt="Anchor_".concat(Tt.id),cn=document.getElementById(Dt);cn&&setTimeout(function(){return cn.scrollIntoView({block:"center",behavior:"smooth"})})},key:Tt.id,className:k.a.tag},Mt+1)}))))})),g.a.createElement("div",{className:k.a.right},g.a.createElement("div",{className:k.a.examName,id:"examName"},g.a.createElement("div",{className:k.a.name},g.a.createElement(xe.a,{title:ke==null||((U=ke.exam)===null||U===void 0)?void 0:U.name,getPopupContainer:function(ce){return ce.parentNode}},g.a.createElement("span",{className:k.a.t},ke==null||((I=ke.exam)===null||I===void 0)?void 0:I.name))),qe?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:ke==null||((de=ke.exam)===null||de===void 0)?void 0:de.total_num,pageSize:1,current:et+1,showSizeChanger:!1,onChange:r,showQuickJumper:!0,hideOnSinglePage:!1}):g.a.createElement(O.a,{onClick:o,type:"primary"},"\u968F\u673A\u66F4\u6362")),g.a.createElement("div",{className:k.a.topWarp},ke==null||((Ce=ke.questionList)===null||Ce===void 0)?void 0:Ce.map(function(Ee,ce){var Xe,Tt;return g.a.createElement(g.a.Fragment,{key:ce},g.a.createElement("div",{className:k.a.head,style:ce===0?{border:0,marginTop:-16}:{}},g.a.createElement("div",{className:k.a.name},g.a.createElement("b",null),g.a.createElement("span",null,Ee.name)),g.a.createElement("div",{className:k.a.so},"\u5171",g.a.createElement("span",{className:k.a.b},Ee.questions_count," "),"\u9898 ",Ee.type==="COMBINATION"&&"\uFF08\u5305\u542B".concat(Ee==null||((Xe=Ee.questions)===null||Xe===void 0)?void 0:Xe.map(function(Mt){var Ot;return Mt==null||((Ot=Mt.sub_item_banks)===null||Ot===void 0)?void 0:Ot.length}).reduce(function(Mt,Ot){return Mt+Ot}),"\u5C0F\u9898\uFF09"),g.a.createElement("span",{className:k.a.l},"|"),"\u5171",g.a.createElement("span",{className:k.a.r},Ee.questions_score),"\u5206"),!qe&&g.a.createElement("div",{className:k.a.btn},g.a.createElement(O.a,{onClick:function(){gn(Ee)},type:"primary",ghost:!0,className:"mr20"},"\u8BBE\u7F6E\u5F97\u5206"),g.a.createElement(O.a,{onClick:function(){return d(Ee)},type:"primary",ghost:!0},"\u968F\u673A\u66F4\u6362"))),Ee==null||((Tt=Ee.questions)===null||Tt===void 0)?void 0:Tt.map(function(Mt,Ot){return Be===Mt.id?g.a.createElement("div",{id:"Anchor_".concat(Mt.id),className:k.a.content,style:{padding:0,marginTop:10},key:Mt.id},g.a.createElement("div",{style:{float:"right",marginTop:-6}},g.a.createElement(O.a,{onClick:function(){return ut(null)},className:"mr20",type:"primary",ghost:!0},"\u53D6\u6D88"),g.a.createElement(O.a,{onClick:function(){return ie(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:k.a.content,key:Mt.id},g.a.createElement("div",{className:k.a.titleWrap},g.a.createElement(C.a,{style:{paddingRight:10},className:k.a.titleHtml,value:Ot+1+"\u3001"+"".concat((Mt==null?void 0:Mt.item_type)==="combination"?"\uFF08\u9898\u5E72\uFF09":"")+Mt.name}),qe&&g.a.createElement(O.a,{disabled:Bt,onClick:function(){if(Be){B.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(O.a,{disabled:Bt,onClick:function(){return Bn(Mt.id,Ee.type,Ot,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"&&Ge(Mt),Ee.type==="COMBINATION"&&st(Mt,Ot),g.a.createElement("div",null))}))})),g.a.createElement("div",{className:k.a.btnsElse,id:"preview_btns_else"},qe?v():u()),g.a.createElement("div",{className:k.a.btnsWrap,id:"preview_btns"},g.a.createElement("div",{className:k.a.btns},qe?v():u()))))},Ne=je.a=Rt},sboe:function(Je,je,h){"use strict";h.d(je,"a",function(){return se});var V=h("q1tI"),ve=h.n(V),se=V.createContext(null)},tmPe:function(Je,je,h){Je.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(Je,je,h){Je.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wU8J:function(Je,je){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++}},Je.exports=h}}]);