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__Pr...

345 lines
645 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[184,7,8,17],{"+NIl":function(it,qe,y){(function(B){B(y("VrN/"))})(function(B){"use strict";B.defineMode("stex",function(me,Z){"use strict";function fe($,F){$.cmdState.push(F)}function ue($){return $.cmdState.length>0?$.cmdState[$.cmdState.length-1]:null}function ee($){var F=$.cmdState.pop();F&&F.closeBracket()}function O($){for(var F=$.cmdState,H=F.length-1;H>=0;H--){var X=F[H];if(X.name=="DEFAULT")continue;return X}return{styleIdentifier:function(){return null}}}function N($,F,H){return function(){this.name=$,this.bracketNo=0,this.style=F,this.styles=H,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var A={};A.importmodule=N("importmodule","tag",["string","builtin"]),A.documentclass=N("documentclass","tag",["","atom"]),A.usepackage=N("usepackage","tag",["atom"]),A.begin=N("begin","tag",["atom"]),A.end=N("end","tag",["atom"]),A.label=N("label","tag",["atom"]),A.ref=N("ref","tag",["atom"]),A.eqref=N("eqref","tag",["atom"]),A.cite=N("cite","tag",["atom"]),A.bibitem=N("bibitem","tag",["atom"]),A.Bibitem=N("Bibitem","tag",["atom"]),A.RBibitem=N("RBibitem","tag",["atom"]),A.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function U($,F){$.f=F}function k($,F){var H;if($.match(/^\\[a-zA-Z@]+/)){var X=$.current().slice(1);return H=A.hasOwnProperty(X)?A[X]:A.DEFAULT,H=new H,fe(F,H),U(F,q),H.style}if($.match(/^\\[$&%#{}_]/))return"tag";if($.match(/^\\[,;!\/\\]/))return"tag";if($.match("\\["))return U(F,function(se,Le){return R(se,Le,"\\]")}),"keyword";if($.match("\\("))return U(F,function(se,Le){return R(se,Le,"\\)")}),"keyword";if($.match("$$"))return U(F,function(se,Le){return R(se,Le,"$$")}),"keyword";if($.match("$"))return U(F,function(se,Le){return R(se,Le,"$")}),"keyword";var oe=$.next();if(oe=="%")return $.skipToEnd(),"comment";if(oe=="}"||oe=="]"){if(H=ue(F),H)H.closeBracket(oe),U(F,q);else return"error";return"bracket"}else return oe=="{"||oe=="["?(H=A.DEFAULT,H=new H,fe(F,H),"bracket"):/\d/.test(oe)?($.eatWhile(/[\w.%]/),"atom"):($.eatWhile(/[\w\-_]/),H=O(F),H.name=="begin"&&(H.argument=$.current()),H.styleIdentifier())}function R($,F,H){if($.eatSpace())return null;if(H&&$.match(H))return U(F,k),"keyword";if($.match(/^\\[a-zA-Z@]+/))return"tag";if($.match(/^[a-zA-Z]+/))return"variable-2";if($.match(/^\\[$&%#{}_]/))return"tag";if($.match(/^\\[,;!\/]/))return"tag";if($.match(/^[\^_&]/))return"tag";if($.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if($.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var X=$.next();return X=="{"||X=="}"||X=="["||X=="]"||X=="("||X==")"?"bracket":X=="%"?($.skipToEnd(),"comment"):"error"}function q($,F){var H=$.peek(),X;return H=="{"||H=="["?(X=ue(F),X.openBracket(H),$.eat(H),U(F,k),"bracket"):/[ \t\r]/.test(H)?($.eat(H),null):(U(F,k),ee(F),k($,F))}return{startState:function(){var $=Z.inMathMode?function(F,H){return R(F,H)}:k;return{cmdState:[],f:$}},copyState:function($){return{cmdState:$.cmdState.slice(),f:$.f}},token:function($,F){return F.f($,F)},blankLine:function($){$.f=k,$.cmdState.length=0},lineComment:"%"}}),B.defineMIME("text/x-stex","stex"),B.defineMIME("text/x-latex","stex")})},"+yhJ":function(it,qe,y){it.exports=y.p+"static/xixi.d492fb65.svg"},"0eGx":function(it,qe,y){it.exports=y.p+"static/zhong.c1924b73.svg"},"19Vz":function(it,qe,y){(function(B){B(y("VrN/"))})(function(B){B.defineOption("placeholder","",function(N,A,U){var k=U&&U!=B.Init;if(A&&!k)N.on("blur",ue),N.on("change",ee),N.on("swapDoc",ee),B.on(N.getInputField(),"compositionupdate",N.state.placeholderCompose=function(){fe(N)}),ee(N);else if(!A&&k){N.off("blur",ue),N.off("change",ee),N.off("swapDoc",ee),B.off(N.getInputField(),"compositionupdate",N.state.placeholderCompose),me(N);var R=N.getWrapperElement();R.className=R.className.replace(" CodeMirror-empty","")}A&&!N.hasFocus()&&ue(N)});function me(N){N.state.placeholder&&(N.state.placeholder.parentNode.removeChild(N.state.placeholder),N.state.placeholder=null)}function Z(N){me(N);var A=N.state.placeholder=document.createElement("pre");A.style.cssText="height: 0; overflow: visible",A.style.direction=N.getOption("direction"),A.className="CodeMirror-placeholder CodeMirror-line-like";var U=N.getOption("placeholder");typeof U=="string"&&(U=document.createTextNode(U)),A.appendChild(U),N.display.lineSpace.insertBefore(A,N.display.lineSpace.firstChild)}function fe(N){setTimeout(function(){var A=!1,U=N.getInputField();U.nodeName=="TEXTAREA"?A=!U.value:N.lineCount()==1&&(A=!/[^\u200b]/.test(U.querySelector(".CodeMirror-line").textContent)),A?Z(N):me(N)},20)}function ue(N){O(N)&&Z(N)}function ee(N){var A=N.getWrapperElement(),U=O(N);A.className=A.className.replace(" CodeMirror-empty","")+(U?" CodeMirror-empty":""),U?Z(N):me(N)}function O(N){return N.lineCount()===1&&N.getLine(0)===""}})},"1eCo":function(it,qe,y){(function(B){B(y("VrN/"))})(function(B){"use strict";var me={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},Z={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};B.defineMode("xml",function(fe,ue){var ee=fe.indentUnit,O={},N=ue.htmlMode?me:Z;for(var A in N)O[A]=N[A];for(var A in ue)O[A]=ue[A];var U,k;function R(x,K){function G(J){return K.tokenize=J,J(x,K)}var C=x.next();if(C=="<")return x.eat("!")?x.eat("[")?x.match("CDATA[")?G(F("atom","]]>")):null:x.match("--")?G(F("comment","-->")):x.match("DOCTYPE",!0,!0)?(x.eatWhile(/[\w\._\-]/),G(H(1))):null:x.eat("?")?(x.eatWhile(/[\w\._\-]/),K.tokenize=F("meta","?>"),"meta"):(U=x.eat("/")?"closeTag":"openTag",K.tokenize=q,"tag bracket");if(C=="&"){var E;return x.eat("#")?x.eat("x")?E=x.eatWhile(/[a-fA-F\d]/)&&x.eat(";"):E=x.eatWhile(/[\d]/)&&x.eat(";"):E=x.eatWhile(/[\w\.\-:]/)&&x.eat(";"),E?"atom":"error"}else return x.eatWhile(/[^&<]/),null}R.isInText=!0;function q(x,K){var G=x.next();if(G==">"||G=="/"&&x.eat(">"))return K.tokenize=R,U=G==">"?"endTag":"selfcloseTag","tag bracket";if(G=="=")return U="equals",null;if(G=="<"){K.tokenize=R,K.state=Le,K.tagName=K.tagStart=null;var C=K.tokenize(x,K);return C?C+" tag error":"tag error"}else return/[\'\"]/.test(G)?(K.tokenize=$(G),K.stringStartCol=x.column(),K.tokenize(x,K)):(x.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function $(x){var K=function(G,C){for(;!G.eol();)if(G.next()==x){C.tokenize=q;break}return"string"};return K.isInAttribute=!0,K}function F(x,K){return function(G,C){for(;!G.eol();){if(G.match(K)){C.tokenize=R;break}G.next()}return x}}function H(x){return function(K,G){for(var C;(C=K.next())!=null;){if(C=="<")return G.tokenize=H(x+1),G.tokenize(K,G);if(C==">")if(x==1){G.tokenize=R;break}else return G.tokenize=H(x-1),G.tokenize(K,G)}return"meta"}}function X(x,K,G){this.prev=x.context,this.tagName=K,this.indent=x.indented,this.startOfLine=G,(O.doNotIndent.hasOwnProperty(K)||x.context&&x.context.noIndent)&&(this.noIndent=!0)}function oe(x){x.context&&(x.context=x.context.prev)}function se(x,K){for(var G;;){if(!x.context)return;if(G=x.context.tagName,!O.contextGrabbers.hasOwnProperty(G)||!O.contextGrabbers[G].hasOwnProperty(K))return;oe(x)}}function Le(x,K,G){return x=="openTag"?(G.tagStart=K.column(),Me):x=="closeTag"?le:Le}function Me(x,K,G){return x=="word"?(G.tagName=K.current(),k="tag",Y):O.allowMissingTagName&&x=="endTag"?(k="tag bracket",Y(x,K,G)):(k="error",Me)}function le(x,K,G){if(x=="word"){var C=K.current();return G.context&&G.context.tagName!=C&&O.implicitlyClosed.hasOwnProperty(G.context.tagName)&&oe(G),G.context&&G.context.tagName==C||O.matchClosing===!1?(k="tag",ve):(k="tag error",De)}else return O.allowMissingTagName&&x=="endTag"?(k="tag bracket",ve(x,K,G)):(k="error",De)}function ve(x,K,G){return x!="endTag"?(k="error",ve):(oe(G),Le)}function De(x,K,G){return k="error",ve(x,K,G)}function Y(x,K,G){if(x=="word")return k="attribute",m;if(x=="endTag"||x=="selfcloseTag"){var C=G.tagName,E=G.tagStart;return G.tagName=G.tagStart=null,x=="selfcloseTag"||O.autoSelfClosers.hasOwnProperty(C)?se(G,C):(se(G,C),G.context=new X(G,C,E==G.indented)),Le}return k="error",Y}function m(x,K,G){return x=="equals"?ge:(O.allowMissing||(k="error"),Y(x,K,G))}function ge(x,K,G){return x=="string"?T:x=="word"&&O.allowUnquoted?(k="string",Y):(k="error",Y(x,K,G))}function T(x,K,G){return x=="string"?T:Y(x,K,G)}return{startState:function(x){var K={tokenize:R,state:Le,indented:x||0,tagName:null,tagStart:null,context:null};return x!=null&&(K.baseIndent=x),K},token:function(x,K){if(!K.tagName&&x.sol()&&(K.indented=x.indentation()),x.eatSpace())return null;U=null;var G=K.tokenize(x,K);return(G||U)&&G!="comment"&&(k=null,K.state=K.state(U||G,x,K),k&&(G=k=="error"?G+" error":k)),G},indent:function(x,K,G){var C=x.context;if(x.tokenize.isInAttribute)return x.tagStart==x.indented?x.stringStartCol+1:x.indented+ee;if(C&&C.noIndent)return B.Pass;if(x.tokenize!=q&&x.tokenize!=R)return G?G.match(/^(\s*)/)[0].length:0;if(x.tagName)return O.multilineTagIndentPastTag!==!1?x.tagStart+x.tagName.length+2:x.tagStart+ee*(O.multilineTagIndentFactor||1);if(O.alignCDATA&&/<!\[CDATA\[/.test(K))return 0;var E=K&&/^<(\/)?([\w_:\.-]*)/.exec(K);if(E&&E[1])for(;C;)if(C.tagName==E[2]){C=C.prev;break}else if(O.implicitlyClosed.hasOwnProperty(C.tagName))C=C.prev;else break;else if(E)for(;C;){var J=O.contextGrabbers[C.tagName];if(J&&J.hasOwnProperty(E[2]))C=C.prev;else break}for(;C&&C.prev&&!C.startOfLine;)C=C.prev;return C?C.indent+ee:x.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:O.htmlMode?"html":"xml",helperType:O.htmlMode?"html":"xml",skipAttribute:function(x){x.state==ge&&(x.state=Y)},xmlCurrentTag:function(x){return x.tagName?{name:x.tagName,close:x.type=="closeTag"}:null},xmlCurrentContext:function(x){for(var K=[],G=x.context;G;G=G.prev)G.tagName&&K.push(G.tagName);return K.reverse()}}}),B.defineMIME("text/xml","xml"),B.defineMIME("application/xml","xml"),B.mimeModes.hasOwnProperty("text/html")||B.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"6+eU":function(it,qe,y){"use strict";y.d(qe,"a",function(){return ve});var B=y("wx14"),me=y("rePB"),Z=y("VTBJ"),fe=y("1OyB"),ue=y("vuIU"),ee=y("Ji7U"),O=y("LK+K"),N=y("q1tI"),A=y.n(N),U=y("TSYQ"),k=y.n(U),R=function(Y){var m,ge="".concat(Y.rootPrefixCls,"-item"),T=k()(ge,"".concat(ge,"-").concat(Y.page),(m={},Object(me.a)(m,"".concat(ge,"-active"),Y.active),Object(me.a)(m,Y.className,!!Y.className),Object(me.a)(m,"".concat(ge,"-disabled"),!Y.page),m)),x=function(){Y.onClick(Y.page)},K=function(C){Y.onKeyPress(C,Y.onClick,Y.page)};return A.a.createElement("li",{title:Y.showTitle?Y.page:null,className:T,onClick:x,onKeyPress:K,tabIndex:"0"},Y.itemRender(Y.page,"page",A.a.createElement("a",{rel:"nofollow"},Y.page)))},q=R,$={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},F=function(De){Object(ee.a)(m,De);var Y=Object(O.a)(m);function m(){var ge;Object(fe.a)(this,m);for(var T=arguments.length,x=new Array(T),K=0;K<T;K++)x[K]=arguments[K];return ge=Y.call.apply(Y,[this].concat(x)),ge.state={goInputText:""},ge.buildOptionText=function(G){return"".concat(G," ").concat(ge.props.locale.items_per_page)},ge.changeSize=function(G){ge.props.changeSize(Number(G))},ge.handleChange=function(G){ge.setState({goInputText:G.target.value})},ge.handleBlur=function(G){var C=ge.props,E=C.goButton,J=C.quickGo,L=C.rootPrefixCls,de=ge.state.goInputText;if(E||de==="")return;if(G.relatedTarget&&(G.relatedTarget.className.indexOf("".concat(L,"-prev"))>=0||G.relatedTarget.className.indexOf("".concat(L,"-next"))>=0))return;ge.setState({goInputText:""}),J(ge.getValidValue())},ge.go=function(G){var C=ge.state.goInputText;if(C==="")return;(G.keyCode===$.ENTER||G.type==="click")&&(ge.setState({goInputText:""}),ge.props.quickGo(ge.getValidValue()))},ge}return Object(ue.a)(m,[{key:"getValidValue",value:function(){var T=this.state,x=T.goInputText,K=T.current;return!x||isNaN(x)?K:Number(x)}},{key:"getPageSizeOptions",value:function(){var T=this.props,x=T.pageSize,K=T.pageSizeOptions;return K.some(function(G){return G.toString()===x.toString()})?K:K.concat([x.toString()]).sort(function(G,C){var E=isNaN(Number(G))?0:Number(G),J=isNaN(Number(C))?0:Number(C);return E-J})}},{key:"render",value:function(){var T=this,x=this.props,K=x.pageSize,G=x.locale,C=x.rootPrefixCls,E=x.changeSize,J=x.quickGo,L=x.goButton,de=x.selectComponentClass,w=x.buildOptionText,g=x.selectPrefixCls,te=x.disabled,Oe=this.state.goInputText,_e="".concat(C,"-options"),$e=de,Qe=null,Te=null,Ee=null;if(!E&&!J)return null;var ye=this.getPageSizeOptions();if(E&&$e){var we=ye.map(function(ne,z){return A.a.createElement($e.Option,{key:z,value:ne.toString()},(w||T.buildOptionText)(ne))});Qe=A.a.createElement($e,{disabled:te,prefixCls:g,showSearch:!1,className:"".concat(_e,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(K||ye[0]).toString(),onChange:this.changeSize,getPopupContainer:function(z){return z.parentNode}},we)}return J&&(L&&(Ee=typeof L=="boolean"?A.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:te,className:"".concat(_e,"-quick-jumper-button")},G.jump_to_confirm):A.a.createElement("span",{onClick:this.go,onKeyUp:this.go},L)),Te=A.a.createElement("div",{className:"".concat(_e,"-quick-jumper")},G.jump_to,A.a.createElement("input",{disabled:te,type:"text",value:Oe,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),G.page,Ee)),A.a.createElement("li",{className:"".concat(_e)},Qe,Te)}}]),m}(A.a.Component);F.defaultProps={pageSizeOptions:["10","20","50","100"]};var H=F,X=y("N2Kk");function oe(){}function se(De){return typeof De=="number"&&isFinite(De)&&Math.floor(De)===De}function Le(De,Y,m){return m}function Me(De,Y,m){var ge=typeof De=="undefined"?Y.pageSize:De;return Math.floor((m.total-1)/ge)+1}var le=function(De){Object(ee.a)(m,De);var Y=Object(O.a)(m);function m(ge){var T;Object(fe.a)(this,m),T=Y.call(this,ge),T.getJumpPrevPage=function(){return Math.max(1,T.state.current-(T.props.showLessItems?3:5))},T.getJumpNextPage=function(){return Math.min(Me(void 0,T.state,T.props),T.state.current+(T.props.showLessItems?3:5))},T.getItemIcon=function(E,J){var L=T.props.prefixCls,de=E||A.a.createElement("button",{type:"button","aria-label":J,className:"".concat(L,"-item-link")});return typeof E=="function"&&(de=A.a.createElement(E,Object(Z.a)({},T.props))),de},T.savePaginationNode=function(E){T.paginationNode=E},T.isValid=function(E){return se(E)&&E!==T.state.current},T.shouldDisplayQuickJumper=function(){var E=T.props,J=E.showQuickJumper,L=E.pageSize,de=E.total;return de<=L?!1:J},T.handleKeyDown=function(E){(E.keyCode===$.ARROW_UP||E.keyCode===$.ARROW_DOWN)&&E.preventDefault()},T.handleKeyUp=function(E){var J=T.getValidValue(E),L=T.state.currentInputValue;J!==L&&T.setState({currentInputValue:J}),E.keyCode===$.ENTER?T.handleChange(J):E.keyCode===$.ARROW_UP?T.handleChange(J-1):E.keyCode===$.ARROW_DOWN&&T.handleChange(J+1)},T.changePageSize=function(E){var J=T.state.current,L=Me(E,T.state,T.props);J=J>L?L:J,L===0&&(J=T.state.current),typeof E=="number"&&("pageSize"in T.props||T.setState({pageSize:E}),"current"in T.props||T.setState({current:J,currentInputValue:J})),T.props.onShowSizeChange(J,E),"onChange"in T.props&&T.props.onChange&&T.props.onChange(J,E)},T.handleChange=function(E){var J=T.props.disabled,L=E;if(T.isValid(L)&&!J){var de=Me(void 0,T.state,T.props);L>de?L=de:L<1&&(L=1),"current"in T.props||T.setState({current:L,currentInputValue:L});var w=T.state.pageSize;return T.props.onChange(L,w),L}return T.state.current},T.prev=function(){T.hasPrev()&&T.handleChange(T.state.current-1)},T.next=function(){T.hasNext()&&T.handleChange(T.state.current+1)},T.jumpPrev=function(){T.handleChange(T.getJumpPrevPage())},T.jumpNext=function(){T.handleChange(T.getJumpNextPage())},T.hasPrev=function(){return T.state.current>1},T.hasNext=function(){return T.state.current<Me(void 0,T.state,T.props)},T.runIfEnter=function(E,J){if(E.key==="Enter"||E.charCode===13){for(var L=arguments.length,de=new Array(L>2?L-2:0),w=2;w<L;w++)de[w-2]=arguments[w];J.apply(void 0,de)}},T.runIfEnterPrev=function(E){T.runIfEnter(E,T.prev)},T.runIfEnterNext=function(E){T.runIfEnter(E,T.next)},T.runIfEnterJumpPrev=function(E){T.runIfEnter(E,T.jumpPrev)},T.runIfEnterJumpNext=function(E){T.runIfEnter(E,T.jumpNext)},T.handleGoTO=function(E){(E.keyCode===$.ENTER||E.type==="click")&&T.handleChange(T.state.currentInputValue)};var x=ge.onChange!==oe,K="current"in ge;K&&!x&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var G=ge.defaultCurrent;"current"in ge&&(G=ge.current);var C=ge.defaultPageSize;return"pageSize"in ge&&(C=ge.pageSize),G=Math.min(G,Me(C,void 0,ge)),T.state={current:G,currentInputValue:G,pageSize:C},T}return Object(ue.a)(m,[{key:"componentDidUpdate",value:function(T,x){var K=this.props.prefixCls;if(x.current!==this.state.current&&this.paginationNode){var G=this.paginationNode.querySelector(".".concat(K,"-item-").concat(x.current));G&&document.activeElement===G&&G.blur()}}},{key:"getValidValue",value:function(T){var x=T.target.value,K=Me(void 0,this.state,this.props),G=this.state.currentInputValue,C;return x===""?C=x:isNaN(Number(x))?C=G:x>=K?C=K:C=Number(x),C}},{key:"getShowSizeChanger",value:function(){var T=this.props,x=T.showSizeChanger,K=T.total,G=T.totalBoundaryShowSizeChanger;return typeof x!="undefined"?x:K>G}},{key:"renderPrev",value:function(T){var x=this.props,K=x.prevIcon,G=x.itemRender,C=G(T,"prev",this.getItemIcon(K,"prev page")),E=!this.hasPrev();return Object(N.isValidElement)(C)?Object(N.cloneElement)(C,{disabled:E}):C}},{key:"renderNext",value:function(T){var x=this.props,K=x.nextIcon,G=x.itemRender,C=G(T,"next",this.getItemIcon(K,"next page")),E=!this.hasNext();return Object(N.isValidElement)(C)?Object(N.cloneElement)(C,{disabled:E}):C}},{key:"render",value:function(){var T=this,x=this.props,K=x.prefixCls,G=x.className,C=x.style,E=x.disabled,J=x.hideOnSinglePage,L=x.total,de=x.locale,w=x.showQuickJumper,g=x.showLessItems,te=x.showTitle,Oe=x.showTotal,_e=x.simple,$e=x.itemRender,Qe=x.showPrevNextJumpers,Te=x.jumpPrevIcon,Ee=x.jumpNextIcon,ye=x.selectComponentClass,we=x.selectPrefixCls,ne=x.pageSizeOptions,z=this.state,Ne=z.current,be=z.pageSize,St=z.currentInputValue;if(J===!0&&L<=be)return null;var Ze=Me(void 0,this.state,this.props),Ke=[],Re=null,Fe=null,Ge=null,Ye=null,Ve=null,Be=w&&w.goButton,ze=g?1:2,Lt=Ne-1>0?Ne-1:0,ft=Ne+1<Ze?Ne+1:Ze,st=Object.keys(this.props).reduce(function(b,_){return(_.substr(0,5)==="data-"||_.substr(0,5)==="aria-"||_==="role")&&(b[_]=T.props[_]),b},{});if(_e)return Be&&(typeof Be=="boolean"?Ve=A.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},de.jump_to_confirm):Ve=A.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Be),Ve=A.a.createElement("li",{title:te?"".concat(de.jump_to).concat(Ne,"/").concat(Ze):null,className:"".concat(K,"-simple-pager")},Ve)),A.a.createElement("ul",Object(B.a)({className:k()(K,"".concat(K,"-simple"),Object(me.a)({},"".concat(K,"-disabled"),E),G),style:C,ref:this.savePaginationNode},st),A.a.createElement("li",{title:te?de.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:k()("".concat(K,"-prev"),Object(me.a)({},"".concat(K,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Lt)),A.a.createElement("li",{title:te?"".concat(Ne,"/").concat(Ze):null,className:"".concat(K,"-simple-pager")},A.a.createElement("input",{type:"text",value:St,disabled:E,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),A.a.createElement("span",{className:"".concat(K,"-slash")},"/"),Ze),A.a.createElement("li",{title:te?de.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:k()("".concat(K,"-next"),Object(me.a)({},"".concat(K,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(ft)),Ve);if(Ze<=3+ze*2){var ut={locale:de,rootPrefixCls:K,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:te,itemRender:$e};Ze||Ke.push(A.a.createElement(q,Object(B.a)({},ut,{key:"noPager",page:Ze,className:"".concat(K,"-disabled")})));for(var xt=1;xt<=Ze;xt+=1){var bt=Ne===xt;Ke.push(A.a.createElement(q,Object(B.a)({},ut,{key:xt,page:xt,active:bt})))}}else{var pt=g?de.prev_3:de.prev_5,Se=g?de.next_3:de.next_5;Qe&&(Re=A.a.createElement("li",{title:te?pt:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:k()("".concat(K,"-jump-prev"),Object(me.a)({},"".concat(K,"-jump-prev-custom-icon"),!!Te))},$e(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Te,"prev page"))),Fe=A.a.createElement("li",{title:te?Se:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:k()("".concat(K,"-jump-next"),Object(me.a)({},"".concat(K,"-jump-next-custom-icon"),!!Ee))},$e(this.getJumpNextPage(),"jump-next",this.getItemIcon(Ee,"next page")))),Ye=A.a.createElement(q,{locale:de,last:!0,rootPrefixCls:K,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ze,page:Ze,active:!1,showTitle:te,itemRender:$e}),Ge=A.a.createElement(q,{locale:de,rootPrefixCls:K,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:te,itemRender:$e});var Rt=Math.max(1,Ne-ze),ht=Math.min(Ne+ze,Ze);Ne-1<=ze&&(ht=1+ze*2),Ze-Ne<=ze&&(Rt=Ze-ze*2);for(var ke=Rt;ke<=ht;ke+=1){var Ae=Ne===ke;Ke.push(A.a.createElement(q,{locale:de,rootPrefixCls:K,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ke,page:ke,active:Ae,showTitle:te,itemRender:$e}))}Ne-1>=ze*2&&Ne!==1+2&&(Ke[0]=Object(N.cloneElement)(Ke[0],{className:"".concat(K,"-item-after-jump-prev")}),Ke.unshift(Re)),Ze-Ne>=ze*2&&Ne!==Ze-2&&(Ke[Ke.length-1]=Object(N.cloneElement)(Ke[Ke.length-1],{className:"".concat(K,"-item-before-jump-next")}),Ke.push(Fe)),Rt!==1&&Ke.unshift(Ge),ht!==Ze&&Ke.push(Ye)}var M=null;Oe&&(M=A.a.createElement("li",{className:"".concat(K,"-total-text")},Oe(L,[L===0?0:(Ne-1)*be+1,Ne*be>L?L:Ne*be])));var j=!this.hasPrev()||!Ze,I=!this.hasNext()||!Ze;return A.a.createElement("ul",Object(B.a)({className:k()(K,G,Object(me.a)({},"".concat(K,"-disabled"),E)),style:C,unselectable:"unselectable",ref:this.savePaginationNode},st),M,A.a.createElement("li",{title:te?de.prev_page:null,onClick:this.prev,tabIndex:j?null:0,onKeyPress:this.runIfEnterPrev,className:k()("".concat(K,"-prev"),Object(me.a)({},"".concat(K,"-disabled"),j)),"aria-disabled":j},this.renderPrev(Lt)),Ke,A.a.createElement("li",{title:te?de.next_page:null,onClick:this.next,tabIndex:I?null:0,onKeyPress:this.runIfEnterNext,className:k()("".concat(K,"-next"),Object(me.a)({},"".concat(K,"-disabled"),I)),"aria-disabled":I},this.renderNext(ft)),A.a.createElement(H,{disabled:E,locale:de,rootPrefixCls:K,selectComponentClass:ye,selectPrefixCls:we,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ne,pageSize:be,pageSizeOptions:ne,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Be}))}}],[{key:"getDerivedStateFromProps",value:function(T,x){var K={};if("current"in T&&(K.current=T.current,T.current!==x.current&&(K.currentInputValue=K.current)),"pageSize"in T&&T.pageSize!==x.pageSize){var G=x.current,C=Me(T.pageSize,x,T);G=G>C?C:G,"current"in T||(K.current=G,K.currentInputValue=G),K.pageSize=T.pageSize}return K}}]),m}(A.a.Component);le.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:oe,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:oe,locale:X.a,style:{},itemRender:Le,totalBoundaryShowSizeChanger:50};var ve=le},"6K3P":function(it,qe,y){it.exports=y.p+"static/jinshi.9b74f304.svg"},"7Cbv":function(it,qe,y){"use strict";var B=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),me=new Uint8Array(16);function Z(){if(!B)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return B(me)}var fe=/^(?:[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 ue(q){return typeof q=="string"&&fe.test(q)}for(var ee=ue,O=[],N=0;N<256;++N)O.push((N+256).toString(16).substr(1));function A(q){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,F=(O[q[$+0]]+O[q[$+1]]+O[q[$+2]]+O[q[$+3]]+"-"+O[q[$+4]]+O[q[$+5]]+"-"+O[q[$+6]]+O[q[$+7]]+"-"+O[q[$+8]]+O[q[$+9]]+"-"+O[q[$+10]]+O[q[$+11]]+O[q[$+12]]+O[q[$+13]]+O[q[$+14]]+O[q[$+15]]).toLowerCase();if(!ee(F))throw TypeError("Stringified UUID is invalid");return F}var U=A;function k(q,$,F){q=q||{};var H=q.random||(q.rng||Z)();if(H[6]=H[6]&15|64,H[8]=H[8]&63|128,$){F=F||0;for(var X=0;X<16;++X)$[F+X]=H[X];return $}return U(H)}var R=qe.a=k},"7ahc":function(it,qe,y){"use strict";y.d(qe,"a",function(){return Me});var B=y("k1fw"),me=y("0Owb"),Z=y("+L6B"),fe=y("2/Rp"),ue=y("y8nQ"),ee=y("Vl3Y"),O=y("tJVT"),N=y("OaEy"),A=y("2fM7"),U=y("q1tI"),k=y.n(U),R=y("VrN/"),q=y.n(R),$=y("p77/"),F=y.n($),H=y("c5Ni"),X=y.n(H),oe=A.a.Option,se={labelCol:{span:4},wrapperCol:{span:20}},Le={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"]};qe.b=function(le){var ve=le.callback,De=le.onCancel,Y=Object(U.useState)("python"),m=Object(O.a)(Y,2),ge=m[0],T=m[1];function x(G){T(Le[G][1])}function K(G){ve(G)}return k.a.createElement(ee.a,Object(me.a)({},se,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:K}),k.a.createElement(ee.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},k.a.createElement(A.a,{onChange:x},Object.keys(Le).map(function(G){return k.a.createElement(oe,{key:G,value:G},Le[G][0])}))),k.a.createElement(ee.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},k.a.createElement(Me,{mode:ge})),k.a.createElement("div",{className:"flex-container flex-end"},k.a.createElement(fe.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),k.a.createElement(fe.a,{type:"ghost",onClick:De},"\u53D6\u6D88")))};function Me(le){var ve=le.value,De=le.onChange,Y=le.mode,m=le.options,ge=m===void 0?{}:m,T=Object(U.useRef)(),x=Object(U.useState)(),K=Object(O.a)(x,2),G=K[0],C=K[1];return Object(U.useEffect)(function(){if(G){function E(J){var L=J.getValue();De&&De(L)}return G.on("change",E),function(){G.off("change",E)}}},[G,De]),Object(U.useEffect)(function(){G&&G.setOption("mode",Y)},[G,Y]),Object(U.useEffect)(function(){G&&((ve!==G.getValue()||ve==="")&&setTimeout(function(){G.setValue(ve||" ")},300))},[G,ve]),Object(U.useEffect)(function(){if(T.current&&!G){var E=q.a.fromTextArea(T.current,Object(B.a)({mode:Y,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},ge));C(E)}},[T.current,G]),k.a.createElement("div",{className:"my-codemirror-container"},k.a.createElement("textarea",{ref:T}))}},"7ixt":function(it,qe,y){"use strict";y.d(qe,"a",function(){return Z});var B={adjustX:1,adjustY:1},me=[0,0],Z={left:{points:["cr","cl"],overflow:B,offset:[-4,0],targetOffset:me},right:{points:["cl","cr"],overflow:B,offset:[4,0],targetOffset:me},top:{points:["bc","tc"],overflow:B,offset:[0,-4],targetOffset:me},bottom:{points:["tc","bc"],overflow:B,offset:[0,4],targetOffset:me},topLeft:{points:["bl","tl"],overflow:B,offset:[0,-4],targetOffset:me},leftTop:{points:["tr","tl"],overflow:B,offset:[-4,0],targetOffset:me},topRight:{points:["br","tr"],overflow:B,offset:[0,-4],targetOffset:me},rightTop:{points:["tl","tr"],overflow:B,offset:[4,0],targetOffset:me},bottomRight:{points:["tr","br"],overflow:B,offset:[0,4],targetOffset:me},rightBottom:{points:["bl","br"],overflow:B,offset:[4,0],targetOffset:me},bottomLeft:{points:["tl","bl"],overflow:B,offset:[0,4],targetOffset:me},leftBottom:{points:["br","bl"],overflow:B,offset:[-4,0],targetOffset:me}},fe=Z},"7qnI":function(it,qe,y){"use strict";var B=y("5Dmo"),me=y("3S7+"),Z=y("fWQN"),fe=y("mtLc"),ue=y("yKVA"),ee=y("879j"),O=y("5NDa"),N=y("5rEg"),A=y("q1tI"),U=y.n(A),k=y("O2Wb"),R=y.n(k),q=N.a.TextArea,$=function(F){Object(ue.a)(X,F);var H=Object(ee.a)(X);function X(){return Object(Z.a)(this,X),H.apply(this,arguments)}return Object(fe.a)(X,[{key:"render",value:function(){var se=this,Le=this.props,Me=Le.index,le=Le.onAnswerChange,ve=Le.addChildAnswer,De=Le.exerciseIsPublish,Y=Le.answers,m=Le.activeOptionErrorIndex,ge=Le.flex,T=ge===void 0?"0 0 1000px":ge;return U.a.createElement("div",{className:R.a.flex},U.a.createElement("div",{className:"".concat(R.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",Me+1,"):"),U.a.createElement("div",{className:"".concat(R.a.flex," ").concat(R.a.flex1),style:{flexDirection:"column"}},Y.map(function(x,K){var G="".concat(Me,"-").concat(K);return U.a.createElement("div",{className:"".concat(R.a.flex," ").concat(R.a.flex1),key:K},U.a.createElement("div",{className:R.a.flex1,style:{flex:T}},U.a.createElement("div",null,U.a.createElement(q,{className:G===m?R.a.error:"",spellCheck:!1,rows:4,value:x||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(K==0?"":"(\u53EF\u9009)"),onChange:function(E){return le(Me,K,E.target.value)},style:{minHeight:95}}))),!De&&U.a.createElement(U.a.Fragment,null,K!=0&&U.a.createElement(me.a,{title:"\u5220\u9664"},U.a.createElement("i",{className:"".concat(R.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return se.props.deleteChildAnswer(Me,K)},style:{float:"right"}})),K===0&&U.a.createElement(me.a,{title:"\u5220\u9664"},U.a.createElement("i",{className:"".concat(R.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return se.props.deleteChildAnswermain(Me,K)},style:{float:"right"}})),U.a.createElement(me.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},U.a.createElement("i",{className:"".concat(R.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return ve(Me)},style:{float:"right",visibility:K==Y.length-1?"":"hidden"}}))))})))}}]),X}(A.Component);qe.a=$},"8EBN":function(it,qe,y){(function(B){B(y("VrN/"))})(function(B){"use strict";B.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 me=0;me<B.modeInfo.length;me++){var Z=B.modeInfo[me];Z.mimes&&(Z.mime=Z.mimes[0])}B.findModeByMIME=function(fe){fe=fe.toLowerCase();for(var ue=0;ue<B.modeInfo.length;ue++){var ee=B.modeInfo[ue];if(ee.mime==fe)return ee;if(ee.mimes){for(var O=0;O<ee.mimes.length;O++)if(ee.mimes[O]==fe)return ee}}if(/\+xml$/.test(fe))return B.findModeByMIME("application/xml");if(/\+json$/.test(fe))return B.findModeByMIME("application/json")},B.findModeByExtension=function(fe){fe=fe.toLowerCase();for(var ue=0;ue<B.modeInfo.length;ue++){var ee=B.modeInfo[ue];if(ee.ext){for(var O=0;O<ee.ext.length;O++)if(ee.ext[O]==fe)return ee}}},B.findModeByFileName=function(fe){for(var ue=0;ue<B.modeInfo.length;ue++){var ee=B.modeInfo[ue];if(ee.file&&ee.file.test(fe))return ee}var O=fe.lastIndexOf("."),N=O>-1&&fe.substring(O+1,fe.length);if(N)return B.findModeByExtension(N)},B.findModeByName=function(fe){fe=fe.toLowerCase();for(var ue=0;ue<B.modeInfo.length;ue++){var ee=B.modeInfo[ue];if(ee.name.toLowerCase()==fe)return ee;if(ee.alias){for(var O=0;O<ee.alias.length;O++)if(ee.alias[O].toLowerCase()==fe)return ee}}}})},"8hTe":function(it,qe,y){it.exports={button:"button___1wy9m"}},"9Bee":function(it,qe,y){"use strict";var B=y("DYRE"),me=y("zeV3"),Z=y("+L6B"),fe=y("2/Rp"),ue=y("k1fw"),ee=y("9og8"),O=y("tJVT"),N=y("WmNS"),A=y.n(N),U=y("q1tI"),k=y.n(U),R=y("vg9a"),q=y("DlQD"),$=y.n(q),F=y("rUJ1");function H(h,o){var a=h.match(/^(\s+)(?:```)/);if(a===null)return o;var u=a[1];return o.split(`
`).map(function(p){var c=p.match(/^\s+/);if(c===null)return p;var V=Object(O.a)(c,1),Ue=V[0];return Ue.length>=u.length?p.slice(u.length):p}).join(`
`)}var X=[],oe=["<ul>"],se=new $.a.Renderer,Le=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Me(){X.length=0,oe=["<ul>"]}var le={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function ve(h,o,a,u){if(o>=h.length||h[o].level<=a)return o;var p=h[o];u.push("<li><a href='#"+p.anchor+"'>"+p.text+"</a>"),o++;var c=[];return o=ve(h,o,p.level,c),c.length>0&&(u.push("<ul>"),c.forEach(function(V){u.push(V)}),u.push("</ul>")),u.push("</li>"),o=ve(h,o,a,u),o}function De(){return ve(X,0,0,oe),oe.push("</ul>"),oe.join("")}var Y={heading:function(o){var a=Le.exec(o);if(a)return{type:"heading",raw:a[0],depth:a[1].length,text:a[2]}},fences:function(o){var a=this.rules.block.fences.exec(o);if(a){var u=a[0],p=H(u,a[3]||""),c=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(c)>=0){var V=T(),Ue=p;p=V,x[V]={type:"block",expression:Ue}}return{type:"code",raw:u,lang:c,text:p}}}},m=/(?:\${2})([^\n`]+?)(?:\${2})/gi,ge=0,T=function(){return"__special_katext_id_".concat(ge++,"__")},x={};function K(){return x}function G(){ge=0,x={}}function C(h){return h=h.replace(m,function(o,a){var u=T();return x[u]={type:"inline",expression:a},u}),h}var E=se.listitem;se.listitem=function(h){return E(C(h))};var J=se.paragraph;se.paragraph=function(h){return J(C(h))};var L=se.tablecell;se.tablecell=function(h,o){return L(C(h),o)},se.code=function(h,o,a){var u=(o||"").match(/\S*/)[0];return u?["latex","katex","math"].indexOf(u)>=0?"<p class='editormd-tex'>".concat(h,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(o,'">').concat(a?h:Object(F.escape)(h,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(a?h:Object(F.escape)(h,!0))+"</code></pre>"},se.heading=function(h,o,a){var u=this.options.headerPrefix+a.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return X.push({anchor:u,level:o,text:h}),"<h"+o+' id="'+u+'">'+h+"</h"+o+">"},$.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),$.a.use({tokenizer:Y,renderer:se});var de=$.a,w=y("SJMd"),g=y("ulZh"),te=y.n(g),Oe=y("m3rI"),_e=y("Oy/b"),$e=y("p5ED"),Qe=y("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 Te=function(h,o){return(Te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var p in u)Object.prototype.hasOwnProperty.call(u,p)&&(a[p]=u[p])})(h,o)};function Ee(h,o){function a(){this.constructor=h}Te(h,o),h.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function ye(h,o,a,u){return new(a||(a=Promise))(function(p,c){function V(wt){try{he(u.next(wt))}catch(ae){c(ae)}}function Ue(wt){try{he(u.throw(wt))}catch(ae){c(ae)}}function he(wt){var ae;wt.done?p(wt.value):(ae=wt.value,ae instanceof a?ae:new a(function(Q){Q(ae)})).then(V,Ue)}he((u=u.apply(h,o||[])).next())})}function we(h,o){var a,u,p,c,V={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return c={next:Ue(0),throw:Ue(1),return:Ue(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function Ue(he){return function(wt){return function(ae){if(a)throw new TypeError("Generator is already executing.");for(;V;)try{if(a=1,u&&(p=2&ae[0]?u.return:ae[0]?u.throw||((p=u.return)&&p.call(u),0):u.next)&&!(p=p.call(u,ae[1])).done)return p;switch(u=0,p&&(ae=[2&ae[0],p.value]),ae[0]){case 0:case 1:p=ae;break;case 4:return V.label++,{value:ae[1],done:!1};case 5:V.label++,u=ae[1],ae=[0];continue;case 7:ae=V.ops.pop(),V.trys.pop();continue;default:if(!(p=V.trys,(p=p.length>0&&p[p.length-1])||ae[0]!==6&&ae[0]!==2)){V=0;continue}if(ae[0]===3&&(!p||ae[1]>p[0]&&ae[1]<p[3])){V.label=ae[1];break}if(ae[0]===6&&V.label<p[1]){V.label=p[1],p=ae;break}if(p&&V.label<p[2]){V.label=p[2],V.ops.push(ae);break}p[2]&&V.ops.pop(),V.trys.pop();continue}ae=o.call(h,V)}catch(Q){ae=[6,Q],u=0}finally{a=p=0}if(5&ae[0])throw ae[1];return{value:ae[0]?ae[1]:void 0,done:!0}}([he,wt])}}}function ne(){for(var h=0,o=0,a=arguments.length;o<a;o++)h+=arguments[o].length;var u=Array(h),p=0;for(o=0;o<a;o++)for(var c=arguments[o],V=0,Ue=c.length;V<Ue;V++,p++)u[p]=c[V];return u}var z=function(){function h(){}return h.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},h.setAttributes=function(o,a){for(var u=0,p=a;u<p.length;u++){var c=p[u],V=c[0],Ue=c[1];o.setAttribute(V,Ue)}},h.createRect=function(o,a,u){var p=document.createElementNS("http://www.w3.org/2000/svg","rect");return p.setAttribute("width",o.toString()),p.setAttribute("height",a.toString()),u&&h.setAttributes(p,u),p},h.createLine=function(o,a,u,p,c){var V=document.createElementNS("http://www.w3.org/2000/svg","line");return V.setAttribute("x1",o.toString()),V.setAttribute("y1",a.toString()),V.setAttribute("x2",u.toString()),V.setAttribute("y2",p.toString()),c&&h.setAttributes(V,c),V},h.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&h.setAttributes(u,a),u},h.createCircle=function(o,a){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()),a&&h.setAttributes(u,a),u},h.createEllipse=function(o,a,u){var p=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return p.setAttribute("cx",(o/2).toString()),p.setAttribute("cy",(a/2).toString()),p.setAttribute("rx",(o/2).toString()),p.setAttribute("ry",(a/2).toString()),u&&h.setAttributes(p,u),p},h.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&h.setAttributes(a,o),a},h.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},h.createMarker=function(o,a,u,p,c,V,Ue){var he=document.createElementNS("http://www.w3.org/2000/svg","marker");return h.setAttributes(he,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",p.toString()],["refX",c.toString()],["refY",V.toString()]]),he.appendChild(Ue),he},h.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&h.setAttributes(a,o),a},h.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&h.setAttributes(u,a),u},h.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&h.setAttributes(a,o),a},h.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},h.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&h.setAttributes(u,a),u},h}(),Ne=function(){function h(){}return h.addKey=function(o){h.key=o},Object.defineProperty(h,"isLicensed",{get:function(){return!!h.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(h.key)},enumerable:!1,configurable:!0}),h}(),be=function(){function h(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return h.prototype.rasterize=function(o,a,u){var p=this;return new Promise(function(c){var V=u!==void 0?u:document.createElement("canvas");o===null&&(p.markersOnly=!0,p.naturalSize=!1);var Ue=document.createElementNS("http://www.w3.org/2000/svg","svg");Ue.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ue.setAttribute("width",a.width.baseVal.valueAsString),Ue.setAttribute("height",a.height.baseVal.valueAsString),Ue.setAttribute("viewBox","0 0 "+a.viewBox.baseVal.width.toString()+" "+a.viewBox.baseVal.height.toString()),Ue.innerHTML=a.innerHTML,p.naturalSize===!0?(Ue.width.baseVal.value=o.naturalWidth,Ue.height.baseVal.value=o.naturalHeight):p.width!==void 0&&p.height!==void 0&&(Ue.width.baseVal.value=p.width,Ue.height.baseVal.value=p.height),V.width=Ue.width.baseVal.value,V.height=Ue.height.baseVal.value;var he=Ue.outerHTML,wt=V.getContext("2d");p.markersOnly!==!0&&wt.drawImage(o,0,0,V.width,V.height);var ae=window.URL,Q=new Image(V.width,V.height);Q.setAttribute("crossOrigin","anonymous");var Ie=new Blob([he],{type:"image/svg+xml"}),ot=ae.createObjectURL(Ie);Q.onload=function(){wt.drawImage(Q,0,0),ae.revokeObjectURL(ot);var at=V.toDataURL(p.imageType,p.imageQuality);c(at)},Q.src=ot})},h}(),St=function(){},Ze=function(){function h(o){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(h.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(h.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(h.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),h.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},h.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)},h.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 Ke("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ke("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Ke("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Re("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Re("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},h.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},h}(),Ke=function(h,o){this.selector=h,this.style=o},Re=function(h,o){this.localName=h,this.style=o},Fe=function(){function h(o,a,u,p,c){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=o,this.displayMode=a,this.markerItems=u,this.uiStyleSettings=p,this.styles=c,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return h.prototype.show=function(o){var a=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 V=document.createElement("div");V.className=""+a.toolbarButtonStyleClass.name,V.setAttribute("data-type-name",c.typeName),V.innerHTML=c.icon,V.addEventListener("click",function(){a.markerToolbarButtonClicked(V,c)}),a.buttons.push(V),a.markerButtons.push(V)}),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 p=document.createElement("div");p.className=this.toolbarBlockStyleClass.name,p.style.whiteSpace="nowrap",p.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(p),this.addActionButton(p,'<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(p,'<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()},h.prototype.addButtonClickListener=function(o){this.buttonClickListeners.push(o)},h.prototype.removeButtonClickListener=function(o){this.buttonClickListeners.indexOf(o)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(o),1)},h.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},h.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 a=0;a<this.markerButtons.length;a++)a<o||a===o&&this.markerButtons.length-1===o?this.markerButtonBlock.appendChild(this.markerButtons[a]):(a===o&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[a]))}},h.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")},h.prototype.resetButtonStyles=function(){var o=this;this.buttons.forEach(function(a){a.className=a.className.replace(o.uiStyleSettings.toolbarButtonStyleColorsClassName?o.uiStyleSettings.toolbarButtonStyleColorsClassName:o.toolbarButtonStyleColorsClass.name,"").trim(),a.className=a.className.replace(o.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?o.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:o.toolbarActiveButtonStyleColorsClass.name,"").trim(),a.className+=" "+(o.uiStyleSettings.toolbarButtonStyleColorsClassName?o.uiStyleSettings.toolbarButtonStyleColorsClassName:o.toolbarButtonStyleColorsClass.name)})},h.prototype.addActionButton=function(o,a,u){var p=this,c=document.createElement("div");switch(c.className=""+this.toolbarButtonStyleClass.name,c.innerHTML=a,c.setAttribute("data-action",u),c.addEventListener("click",function(){p.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)},h.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Re("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Re("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Re("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Re("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new Re("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var o=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Re("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*o)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*o)+`px;
padding: `+o+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Re("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Re("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ke("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Ke("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},h.prototype.markerToolbarButtonClicked=function(o,a){this.setActiveButton(o),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("marker",a)}),this.markerButtonOverflowBlock.style.display="none"},h.prototype.actionToolbarButtonClicked=function(o,a){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("action",a)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},h.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)},h.prototype.setActiveMarkerButton=function(o){var a=this.markerButtons.find(function(u){return u.getAttribute("data-type-name")===o});a&&this.setActiveButton(a)},h.prototype.setCurrentMarker=function(o){var a=this;this.currentMarker=o,this.buttons.filter(function(u){return/delete|notes/.test(u.getAttribute("data-action"))}).forEach(function(u){a.currentMarker===void 0?(u.style.fillOpacity="0.4",u.style.pointerEvents="none"):(u.style.fillOpacity="1",u.style.pointerEvents="all")})},h}(),Ge=function(){function h(o,a,u,p){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=a,this.uiStyleSettings=u,this.styles=p,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return h.prototype.addStyles=function(){var o;this.toolboxStyleClass=this.styles.addClass(new Re("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new Re("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var a=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Re("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Re("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Re("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new Re("toolbox-panel-row_colors",`
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Re("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*a)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*a)+`px;
padding: `+a+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Re("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Re("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ke("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ke("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},h.prototype.show=function(o){var a;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolboxStyleClass.name+" "+((a=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&a!==void 0?a:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},h.prototype.setPanelButtons=function(o){var a,u,p=this;this.panels=o,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((a=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&a!==void 0?a: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 V;c.uiStyleSettings=p.uiStyleSettings;var Ue=document.createElement("div");Ue.className=p.toolboxButtonStyleClass.name+" "+((V=p.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&V!==void 0?V:p.toolboxButtonStyleColorsClass.name),Ue.innerHTML=c.icon,Ue.title=c.title,Ue.addEventListener("click",function(){p.panelButtonClick(c)}),p.panelButtons.push(Ue),p.buttonRow.appendChild(Ue)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},h.prototype.panelButtonClick=function(o){var a=this,u=-1;if(o!==this.activePanel){u=this.panels.indexOf(o),this.panelRow.innerHTML="";var p=o.getUi();p.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(p),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(){a.displayMode==="inline"?a.panelRow.style.display="none":a.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(c,V){var Ue,he;c.className=a.toolboxButtonStyleClass.name+" "+(V===u?""+((Ue=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ue!==void 0?Ue:a.toolboxActiveButtonStyleColorsClass.name):""+((he=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&he!==void 0?he:a.toolboxButtonStyleColorsClass.name))})},h}(),Ye=function(h,o){this.title=h,this.icon=o},Ve=function(h){function o(a,u,p,c){var V=h.call(this,a,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 V.colors=[],V.addTransparent=!1,V.colorBoxes=[],V.colors=u,V.currentColor=p,V.setCurrentColor=V.setCurrentColor.bind(V),V.getColorBox=V.getColorBox.bind(V),V}return Ee(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.whiteSpace="nowrap",this.colors.forEach(function(p){var c=a.getColorBox(p);u.appendChild(c),a.colorBoxes.push(c)}),u},o.prototype.getColorBox=function(a){var u=this,p=this.uiStyleSettings.toolbarHeight/4,c=this.uiStyleSettings.toolbarHeight-p,V=document.createElement("div");V.style.display="inline-block",V.style.boxSizing="content-box",V.style.width=c-2+"px",V.style.height=c-2+"px",V.style.padding="1px",V.style.marginRight="2px",V.style.marginBottom="2px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderRadius=(c+2)/2+"px",V.style.borderColor=a===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){u.setCurrentColor(a,V)});var Ue=document.createElement("div");return Ue.style.display="inline-block",Ue.style.width=c-2+"px",Ue.style.height=c-2+"px",Ue.style.backgroundColor=a,Ue.style.borderRadius=c/2+"px",a==="transparent"&&(Ue.style.fill=this.uiStyleSettings.toolboxAccentColor,Ue.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>`),V.appendChild(Ue),V},o.prototype.setCurrentColor=function(a,u){var p=this;this.currentColor=a,this.colorBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(a)},o}(Ye),Be=function(){function h(o,a,u){this._state="new",this._isSelected=!1,this._container=o,this._overlayContainer=a,this.globalSettings=u,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(h.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),h.prototype.ownsTarget=function(o){return!1},Object.defineProperty(h.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),h.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},h.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},h.prototype.pointerDown=function(o,a){},h.prototype.dblClick=function(o,a){},h.prototype.manipulate=function(o){},h.prototype.pointerUp=function(o){this.stateChanged()},h.prototype.dispose=function(){},h.prototype.addMarkerVisualToContainer=function(o){this.container.childNodes.length>0?this.container.insertBefore(o,this.container.childNodes[0]):this.container.appendChild(o)},h.prototype.getState=function(){return{typeName:h.typeName,state:this.state,notes:this.notes}},h.prototype.restoreState=function(o){this._state=o.state,this.notes=o.notes},h.prototype.scale=function(o,a){},h.prototype.colorChanged=function(o){this.onColorChanged&&this.onColorChanged(o),this.stateChanged()},h.prototype.fillColorChanged=function(o){this.onFillColorChanged&&this.onFillColorChanged(o),this.stateChanged()},h.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)}},h.typeName="MarkerBase",h}(),ze=function(){function h(){this.findGripByVisual=this.findGripByVisual.bind(this)}return h.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},h}(),Lt=function(){function h(){this.GRIP_SIZE=10,this.visual=z.createGroup(),this.visual.appendChild(z.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(z.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return h.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},h}(),ft=function(){function h(){}return h.toITransformMatrix=function(o){return{a:o.a,b:o.b,c:o.c,d:o.d,e:o.e,f:o.f}},h.toSVGMatrix=function(o,a){return o.a=a.a,o.b=a.b,o.c=a.c,o.d=a.d,o.e=a.e,o.f=a.f,o},h}(),st=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||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(z.createTransform()),c.setupControlBox(),c}return Ee(o,h),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(a){this._visual=a;var u=z.createTransform();this._visual.transform.baseVal.appendItem(u)},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!!h.prototype.ownsTarget.call(this,a)||!!(this.controlGrips.findGripByVisual(a)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(a))},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.left=a.x,this.top=a.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var p=this.unrotatePoint(a);if(this.manipulationStartX=p.x,this.manipulationStartY=p.y,this.offsetX=p.x-this.left,this.offsetY=p.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 V=this.container.transform.baseVal.getItem(0);V.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(V,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},o.prototype.pointerUp=function(a){var u=this.state;h.prototype.pointerUp.call(this,a),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},o.prototype.moveVisual=function(a){this.visual.style.transform="translate("+a.x+"px, "+a.y+"px)"},o.prototype.manipulate=function(a){var u=this.unrotatePoint(a);this.state==="creating"?this.resize(a):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(a)},o.prototype.resize=function(a){var u=this.manipulationStartLeft,p=this.manipulationStartWidth,c=this.manipulationStartTop,V=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:u=this.manipulationStartLeft+a.x-this.manipulationStartX,p=this.manipulationStartWidth+this.manipulationStartLeft-u;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:p=this.manipulationStartWidth+a.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:c=this.manipulationStartTop+a.y-this.manipulationStartY,V=this.manipulationStartHeight+this.manipulationStartTop-c;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:V=this.manipulationStartHeight+a.y-this.manipulationStartY}p>=0?(this.left=u,this.width=p):(this.left=u+p,this.width=-p),V>=0?(this.top=c,this.height=V):(this.top=c+V,this.height=-V),this.setSize()},o.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},o.prototype.rotate=function(a){if(Math.abs(a.x-this.centerX)>.1){var u=Math.sign(a.x-this.centerX);this.rotationAngle=180*Math.atan((a.y-this.centerY)/(a.x-this.centerX))/Math.PI+90*u,this.applyRotation()}},o.prototype.applyRotation=function(){var a=this.container.transform.baseVal.getItem(0);a.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(a,0)},o.prototype.rotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM(),p=z.createPoint(a.x,a.y);return{x:(p=p.matrixTransform(u)).x,y:p.y}},o.prototype.unrotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM();u=u.inverse();var p=z.createPoint(a.x,a.y);return{x:(p=p.matrixTransform(u)).x,y:p.y}},o.prototype.select=function(){h.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){h.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=z.createGroup();var a=z.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=z.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=z.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 ze,this.addControlGrips(),this.controlBox.style.display="none"},o.prototype.adjustControlBox=function(){var a=this.controlBox.transform.baseVal.getItem(0);a.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(a,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 a=new Lt;return a.visual.transform.baseVal.appendItem(z.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.controlGrips.topLeft.GRIP_SIZE,u=-a/2,p=u,c=(this.width+this.CB_DISTANCE)/2-a/2,V=(this.height+this.CB_DISTANCE)/2-a/2,Ue=this.height+this.CB_DISTANCE-a/2,he=this.width+this.CB_DISTANCE-a/2;this.positionGrip(this.controlGrips.topLeft.visual,u,p),this.positionGrip(this.controlGrips.topCenter.visual,c,p),this.positionGrip(this.controlGrips.topRight.visual,he,p),this.positionGrip(this.controlGrips.centerLeft.visual,u,V),this.positionGrip(this.controlGrips.centerRight.visual,he,V),this.positionGrip(this.controlGrips.bottomLeft.visual,u,Ue),this.positionGrip(this.controlGrips.bottomCenter.visual,c,Ue),this.positionGrip(this.controlGrips.bottomRight.visual,he,Ue),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,c,p-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(a,u,p){var c=a.transform.baseVal.getItem(0);c.setTranslate(u,p),a.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:ft.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:ft.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},h.prototype.getState.call(this))},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;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(ft.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(ft.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u);var p=this.rotatePoint({x:this.left,y:this.top}),c=this.unrotatePoint({x:p.x*a,y:p.y*u});this.left=c.x,this.top=c.y,this.width=this.width*a,this.height=this.height*u,this.adjustControlBox()},o}(Be),ut=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||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 Ee(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=z.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(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){h.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){h.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){h.prototype.setSize.call(this),z.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){h.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&z.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&z.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&z.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&z.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},h.prototype.getState.call(this))},o.prototype.restoreState=function(a){var u=a;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),h.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.setSize()},o.title="Rectangle marker",o}(st),xt=function(h){function o(a,u,p,c){var V=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return V.widths=[],V.widthBoxes=[],V.widths=u,V.currentWidth=p,V.setCurrentWidth=V.setCurrentWidth.bind(V),V}return Ee(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.widths.forEach(function(p){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=p===a.currentWidth?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentWidth(p,c)}),u.appendChild(c);var V=document.createElement("div");V.innerText=p.toString(),V.style.marginRight="5px",c.appendChild(V);var Ue=document.createElement("div");Ue.style.minHeight="20px",Ue.style.flexGrow="2",Ue.style.display="flex",Ue.style.alignItems="center";var he=document.createElement("hr");he.style.minWidth="20px",he.style.border="0px",he.style.borderTop=p+"px solid "+a.uiStyleSettings.toolboxColor,he.style.flexGrow="2",Ue.appendChild(he),c.appendChild(Ue),a.widthBoxes.push(c)}),u},o.prototype.setCurrentWidth=function(a,u){var p=this;this.currentWidth=a,this.widthBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(Ye),bt=function(h){function o(a,u,p,c){var V=h.call(this,a,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 V.styles=[],V.styleBoxes=[],V.styles=u,V.currentStyle=p,V.setCurrentStyle=V.setCurrentStyle.bind(V),V}return Ee(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.styles.forEach(function(p){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/a.styles.length-5+"%",c.style.borderColor=p===a.currentStyle?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentStyle(p,c)}),u.appendChild(c);var V=document.createElement("div");V.style.minHeight="20px",V.style.flexGrow="2",V.style.overflow="hidden";var Ue=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+a.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(p!==""?'stroke-dasharray="'+p+'"':"")+` />
</svg>`;V.innerHTML=Ue,c.appendChild(V),a.styleBoxes.push(c)}),u},o.prototype.setCurrentStyle=function(a,u){var p=this;this.currentStyle=a,this.styleBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(Ye),pt=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.strokeColor=p.defaultColor,c.strokeWidth=p.defaultStrokeWidth,c.strokeDasharray=p.defaultStrokeDasharray,c.strokePanel=new Ve("Line color",p.defaultColorSet,p.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new xt("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new bt("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return Ee(o,h),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="FrameMarker",o.title="Frame marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',o}(ut),Se=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},Rt=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||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 Ee(o,h),o.prototype.ownsTarget=function(a){return!!h.prototype.ownsTarget.call(this,a)||!(!this.grip1.ownsTarget(a)&&!this.grip2.ownsTarget(a))},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.manipulationStartX=a.x,this.manipulationStartY=a.y,this.state==="new"&&(this.x1=a.x,this.y1=a.y,this.x2=a.x,this.y2=a.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(a){var u=this.state;h.prototype.pointerUp.call(this,a),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(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},o.prototype.adjustVisual=function(){},o.prototype.manipulate=function(a){this.state==="creating"?this.resize(a):this.state==="move"?(this.x1=this.manipulationStartX1+a.x-this.manipulationStartX,this.y1=this.manipulationStartY1+a.y-this.manipulationStartY,this.x2=this.manipulationStartX2+a.x-this.manipulationStartX,this.y2=this.manipulationStartY2+a.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(a)},o.prototype.resize=function(a){switch(this.activeGrip){case this.grip1:this.x1=a.x,this.y1=a.y;break;case this.grip2:case void 0:this.x2=a.x,this.y2=a.y}this.adjustVisual(),this.adjustControlBox()},o.prototype.select=function(){h.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){h.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=z.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 a=new Lt;return a.visual.transform.baseVal.appendItem(z.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-a/2,this.y1-a/2),this.positionGrip(this.grip2.visual,this.x2-a/2,this.y2-a/2)},o.prototype.positionGrip=function(a,u,p){var c=a.transform.baseVal.getItem(0);c.setTranslate(u,p),a.transform.baseVal.replaceItem(c,0)},o.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},h.prototype.getState.call(this))},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;this.x1=u.x1,this.y1=u.y1,this.x2=u.x2,this.y2=u.y2},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.x1=this.x1*a,this.y1=this.y1*u,this.x2=this.x2*a,this.y2=this.y2*u,this.adjustVisual(),this.adjustControlBox()},o}(Be),ht=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||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=p.defaultColor,c.strokeWidth=p.defaultStrokeWidth,c.strokeDasharray=p.defaultStrokeDasharray,c.strokePanel=new Ve("Line color",p.defaultColorSet,p.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new xt("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new bt("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return Ee(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorLine&&a!==this.visibleLine)},o.prototype.createVisual=function(){this.visual=z.createGroup(),this.selectorLine=z.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=z.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(a,u){h.prototype.pointerDown.call(this,a,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()),z.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),z.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),z.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,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 a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;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}(Rt),ke=function(h){function o(a,u,p,c){var V=h.call(this,a,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 V.fonts=[],V.fontBoxes=[],V.fonts=u,V.currentFont=p,V.setCurrentFont=V.setCurrentFont.bind(V),V}return Ee(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.flexGrow="2",this.fonts.forEach(function(p){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/a.fonts.length-5+"%",c.style.borderColor=p===a.currentFont?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentFont(p,c)}),u.appendChild(c);var V=document.createElement("div");V.style.display="flex",V.style.minHeight="20px",V.style.flexGrow="2",V.style.fontFamily=p,V.style.overflow="hidden";var Ue=document.createElement("div");Ue.style.whiteSpace="nowrap",Ue.style.overflow="hidden",Ue.style.textOverflow="ellipsis",Ue.innerHTML="The quick brown fox jumps over the lazy dog",V.appendChild(Ue),c.appendChild(V),a.fontBoxes.push(c)}),u},o.prototype.setCurrentFont=function(a,u){var p=this;this.currentFont=a,this.fontBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(Ye),Ae=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.color="transparent",c.padding=5,c.DEFAULT_TEXT="your text here",c.text=c.DEFAULT_TEXT,c.isMoved=!1,c.color=p.defaultColor,c.fontFamily=p.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 Ve("Color",p.defaultColorSet,p.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.fontFamilyPanel=new ke("Font",p.defaultFontFamilies,p.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c}return Ee(o,h),o.prototype.ownsTarget=function(a){if(h.prototype.ownsTarget.call(this,a)||a===this.visual||a===this.textElement||a===this.bgRectangle)return!0;var u=!1;return this.textElement.childNodes.forEach(function(p){p===a&&(u=!0)}),u},o.prototype.createVisual=function(){this.visual=z.createGroup(),this.bgRectangle=z.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=z.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(z.createTransform()),this.textElement.transform.baseVal.appendItem(z.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.isMoved=!1,this.pointerDownPoint=a,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.renderText=function(){var a=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){a.textElement.appendChild(z.createTSpan(u.trim()===""?" ":u.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},o.prototype.getTextScale=function(){var a=this.textElement.getBBox(),u=1;if(a.width>0&&a.height>0){var p=(1*this.width-this.width*this.padding*2/100)/a.width,c=(1*this.height-this.height*this.padding*2/100)/a.height;u=Math.min(p,c)}return u},o.prototype.getTextPosition=function(a){var u=this.textElement.getBBox(),p=0,c=0;return u.width>0&&u.height>0&&(p=(this.width-u.width*a)/2,c=this.height/2-u.height*a/2),{x:p,y:c}},o.prototype.sizeText=function(){var a=this.textElement.getBBox(),u=this.getTextScale(),p=this.getTextPosition(u);p.y-=a.y*u,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+p.x+"px, "+p.y+"px) scale("+u+", "+u+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(p.x,p.y),this.textElement.transform.baseVal.getItem(1).setScale(u,u))},o.prototype.manipulate=function(a){h.prototype.manipulate.call(this,a),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(a.x-this.pointerDownPoint.x)>5||Math.abs(a.y-this.pointerDownPoint.y)>5)},o.prototype.resize=function(a){h.prototype.resize.call(this,a),this.isMoved=!0,this.setSize(),this.sizeText()},o.prototype.setSize=function(){h.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(z.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),z.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},o.prototype.pointerUp=function(a){var u=this.state;u==="creating"&&(this._suppressMarkerCreateEvent=!0),h.prototype.pointerUp.call(this,a),this.setSize(),(u==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},o.prototype.showTextEditor=function(){var a=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(a.textEditor.style.fontSize);a.textEditor.clientWidth>=Number.parseInt(a.textEditor.style.maxWidth)&&u>.9;)u-=.1,a.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 p=u.clipboardData.getData("text"),c=window.getSelection();if(!c.rangeCount)return!1;c.deleteFromDocument(),c.getRangeAt(0).insertNode(document.createTextNode(p)),u.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){a.textEditDivClicked(a.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 a=this.getTextScale(),u=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),p=this.textElement.getBBox(),c={x:p.width*a,y:p.height*a};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*a,12)+"px",this.textElement.style.display="none"}},o.prototype.textEditDivClicked=function(a){this.text=a.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},o.prototype.select=function(){h.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},o.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),h.prototype.deselect.call(this)},o.prototype.dblClick=function(a,u){h.prototype.dblClick.call(this,a,u),this.showTextEditor()},o.prototype.setColor=function(a){this.textElement&&z.setAttributes(this.textElement,[["fill",a]]),this.color=a,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(a)},o.prototype.setFont=function(a){this.textElement&&z.setAttributes(this.textElement,[["font-family",a]]),this.fontFamily=a,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 a=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.color=u.color,this.fontFamily=u.fontFamily,this.padding=u.padding,this.text=u.text,this.createVisual(),h.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,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}(st),M=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.color="transparent",c.lineWidth=3,c.drawing=!1,c.pixelRatio=1,c.color=p.defaultColor,c.lineWidth=p.defaultStrokeWidth,c.pixelRatio=p.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 Ve("Color",p.defaultColorSet,p.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.lineWidthPanel=new xt("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),c.lineWidthPanel.onWidthChanged=c.setLineWidth,c}return Ee(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.drawingImage)},o.prototype.createVisual=function(){this.visual=z.createGroup(),this.drawingImage=z.createImage(),this.visual.appendChild(this.drawingImage);var a=z.createTransform();this.visual.transform.baseVal.appendItem(a),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,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(a.x,a.y),this.drawing=!0):h.prototype.pointerDown.call(this,a,u)},o.prototype.manipulate=function(a){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(a.x,a.y),this.canvasContext.stroke()):h.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){h.prototype.resize.call(this,a),z.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),z.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):h.prototype.pointerUp.call(this,a)},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(),h.prototype.select.call(this)},o.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),h.prototype.deselect.call(this)},o.prototype.finishCreation=function(){for(var a=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),u=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],p=u[0],c=u[1],V=u[2],Ue=u[3],he=!1,wt=0;wt<this.canvasElement.height;wt++)for(var ae=0;ae<this.canvasElement.width;ae++)a.data[wt*this.canvasElement.width*4+4*ae+3]>0&&(he=!0,wt<c&&(c=wt),ae<p&&(p=ae),wt>Ue&&(Ue=wt),ae>V&&(V=ae));if(he){this.left=p/this.pixelRatio,this.top=c/this.pixelRatio,this.width=(V-p)/this.pixelRatio,this.height=(Ue-c)/this.pixelRatio;var Q=document.createElement("canvas");Q.width=V-p,Q.height=Ue-c,Q.getContext("2d").putImageData(this.canvasContext.getImageData(p,c,V-p,Ue-c),0,0),this.drawingImgUrl=Q.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){z.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),z.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},o.prototype.setColor=function(a){this.color=a,this.colorChanged(a)},o.prototype.setLineWidth=function(a){this.lineWidth=a},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 a=Object.assign({drawingImgUrl:this.drawingImgUrl},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){this.createVisual(),h.prototype.restoreState.call(this,a),this.drawingImgUrl=a.drawingImgUrl,this.setDrawingImage()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,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}(st),j=function(h){function o(a,u,p){var c=h.call(this,a,p||'<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 Ee(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2";for(var p=function(Ue){var he="both";switch(Ue){case 0:he="both";break;case 1:he="start";break;case 2:he="end";break;case 3:he="none"}var wt=document.createElement("div");if(wt.style.display="flex",wt.style.flexGrow="2",wt.style.alignItems="center",wt.style.justifyContent="space-between",wt.style.padding="5px",wt.style.borderWidth="2px",wt.style.borderStyle="solid",wt.style.borderColor=he===c.currentType?c.uiStyleSettings.toolboxAccentColor:"transparent",wt.addEventListener("click",function(){a.setCurrentType(he,wt)}),u.appendChild(wt),he==="both"||he==="start"){var ae=document.createElement("div");ae.style.display="flex",ae.style.alignItems="center",ae.style.minHeight="20px",ae.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>`,ae.style.marginLeft="5px",wt.appendChild(ae)}var Q=document.createElement("div");Q.style.display="flex",Q.style.alignItems="center",Q.style.minHeight="20px",Q.style.flexGrow="2";var Ie=document.createElement("hr");if(Ie.style.minWidth="20px",Ie.style.border="0px",Ie.style.borderTop="3px solid "+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee"),Ie.style.flexGrow="2",Q.appendChild(Ie),wt.appendChild(Q),he==="both"||he==="end"){var ot=document.createElement("div");ot.style.display="flex",ot.style.alignItems="center",ot.style.minHeight="20px",ot.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,ot.style.marginRight="5px",wt.appendChild(ot)}c.typeBoxes.push(wt)},c=this,V=0;V<4;V++)p(V);return u},o.prototype.setCurrentType=function(a,u){var p=this;this.currentType=a,this.typeBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings!==void 0?p.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(Ye),I=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||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 j("Arrow type","end"),c.arrowTypePanel.onArrowTypeChanged=c.setArrowType,c}return Ee(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.arrow1&&a!==this.arrow2)},o.prototype.getArrowPoints=function(a,u){var p=this.arrowBaseWidth+2*this.strokeWidth,c=this.arrowBaseHeight+2*this.strokeWidth;return a-p/2+","+(u+c/2)+" "+a+","+(u-c/2)+" "+(a+p/2)+","+(u+c/2)},o.prototype.createTips=function(){this.arrow1=z.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(z.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=z.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(z.createTransform()),this.visual.appendChild(this.arrow2)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(h.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",z.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),z.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var a=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(a,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(u,0);var p=this.arrow2.transform.baseVal.getItem(0);p.setRotate(a+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(p,0)}},o.prototype.setArrowType=function(a){this.arrowType=a,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 a=Object.assign({arrowType:this.arrowType},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;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}(ht),b=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.fillColor=p.defaultFillColor,c.strokeWidth=0,c.fillPanel=new Ve("Color",p.defaultColorSet,p.defaultFillColor),c.fillPanel.onColorChanged=c.setFillColor,c}return Ee(o,h),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="CoverMarker",o.title="Cover marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',o}(ut),_=function(h){function o(a,u,p,c){var V=h.call(this,a,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 V.opacities=[],V.opacityBoxes=[],V.opacities=u,V.currentOpacity=p,V.setCurrentOpacity=V.setCurrentOpacity.bind(V),V}return Ee(o,h),o.prototype.getUi=function(){var a=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(p){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=p===a.currentOpacity?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentOpacity(p,c)}),u.appendChild(c);var V=document.createElement("div");V.innerText=100*p+"%",c.appendChild(V),a.opacityBoxes.push(c)}),u},o.prototype.setCurrentOpacity=function(a,u){var p=this;this.currentOpacity=a,this.opacityBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(Ye),S=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.setOpacity=c.setOpacity.bind(c),c.fillColor=p.defaultHighlightColor,c.strokeWidth=0,c.opacity=p.defaultHighlightOpacity,c.fillPanel=new Ve("Color",p.defaultColorSet,c.fillColor),c.fillPanel.onColorChanged=c.setFillColor,c.opacityPanel=new _("Opacity",p.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return Ee(o,h),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&z.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 a=h.prototype.getState.call(this);return a.typeName=o.typeName,a},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}(b),P='<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>',re=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||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=p.defaultStrokeColor,c.bgColor=p.defaultFillColor,c.fontFamily=p.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 Ve("Text color",p.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 Ve("Fill color",p.defaultColorSet,c.bgColor,P),c.bgColorPanel.onColorChanged=c.setBgColor,c.fontFamilyPanel=new ke("Font",p.defaultFontFamilies,p.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c.tipGrip=new Lt,c.tipGrip.visual.transform.baseVal.appendItem(z.createTransform()),c.controlBox.appendChild(c.tipGrip.visual),c}return Ee(o,h),o.prototype.ownsTarget=function(a){return h.prototype.ownsTarget.call(this,a)||this.tipGrip.ownsTarget(a)||this.tip===a},o.prototype.createTip=function(){z.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=z.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},o.prototype.pointerDown=function(a,u){this.state==="new"&&h.prototype.pointerDown.call(this,a,u),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(u)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):h.prototype.pointerDown.call(this,a,u)},o.prototype.pointerUp=function(a){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,h.prototype.pointerUp.call(this,a);else{var u=this.state==="creating";h.prototype.pointerUp.call(this,a),this.setTipPoints(u),this.positionTip()}},o.prototype.manipulate=function(a){if(this.tipMoving){var u=this.unrotatePoint(a);this.tipPosition={x:u.x-this.manipulationStartLeft,y:u.y-this.manipulationStartTop},this.positionTip()}else h.prototype.manipulate.call(this,a)},o.prototype.setBgColor=function(a){this.bgRectangle&&this.tip&&(z.setAttributes(this.bgRectangle,[["fill",a]]),z.setAttributes(this.tip,[["fill",a]])),this.bgColor=a,this.fillColorChanged(a)},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(a){a===void 0&&(a=!1);var u=Math.min(this.height/2,15),p=this.height/5;a&&(this.tipPosition={x:u+p/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))?(p=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:0},this.tipBase2Position={x:u+p,y:0}):(this.tipBase1Position={x:0,y:u},this.tipBase2Position={x:0,y:u+p}):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))?(p=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-p,y:0},this.tipBase2Position={x:this.width-u,y:0}):(this.tipBase1Position={x:this.width,y:u},this.tipBase2Position={x:this.width,y:u+p}):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))?(p=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-p,y:this.height},this.tipBase2Position={x:this.width-u,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-u-p},this.tipBase2Position={x:this.width,y:this.height-u}):c<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(p=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:this.height},this.tipBase2Position={x:u+p,y:this.height}):(this.tipBase1Position={x:0,y:this.height-u},this.tipBase2Position={x:0,y:this.height-u-p})},o.prototype.resize=function(a){h.prototype.resize.call(this,a),this.positionTip()},o.prototype.positionTip=function(){z.setAttributes(this.tip,[["points",this.getTipPoints()]]);var a=this.tipGrip.visual.transform.baseVal.getItem(0);a.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(a,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(),h.prototype.select.call(this)},o.prototype.getState=function(){var a=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.bgColor=u.bgColor,this.tipPosition=u.tipPosition,h.prototype.restoreState.call(this,a),this.createTip(),this.setTipPoints()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.tipPosition={x:this.tipPosition.x*a,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}(Ae),pe=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.fillColor="transparent",c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.opacity=1,c.strokeColor=p.defaultColor,c.strokeWidth=p.defaultStrokeWidth,c.strokeDasharray=p.defaultStrokeDasharray,c.fillColor=p.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 Ve("Line color",ne(p.defaultColorSet,["transparent"]),p.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.fillPanel=new Ve("Fill color",ne(p.defaultColorSet,["transparent"]),c.fillColor,P),c.fillPanel.onColorChanged=c.setFillColor,c.strokeWidthPanel=new xt("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new bt("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c.opacityPanel=new _("Opacity",p.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return Ee(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=z.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(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){h.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){h.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){h.prototype.setSize.call(this),z.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(a){h.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&z.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&z.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(a),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&z.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&z.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&z.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 a=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),h.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,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}(st),Ce=function(h){function o(a,u,p){return h.call(this,a,u,p)||this}return Ee(o,h),Object.defineProperty(o.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.tip1&&a!==this.tip2)},o.prototype.createTips=function(){this.tip1=z.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(z.createTransform()),this.visual.appendChild(this.tip1),this.tip2=z.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(z.createTransform()),this.visual.appendChild(this.tip2)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(h.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(z.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()]]),z.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 a=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(a,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(u,0);var p=this.tip2.transform.baseVal.getItem(0);p.setRotate(a+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(p,0)}},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.prototype.getState.call(this);return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a),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}(ht),Ct=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.strokePanel.colors=p.defaultColorSet,c.fillColor="transparent",c}return Ee(o,h),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.prototype.getState.call(this);return a.typeName=o.typeName,a},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}(pe),At=function(){function h(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(h.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),h.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))},h.prototype.replaceLastUndoStep=function(o){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=o)},h.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},h.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}},h.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},h}(),xe=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||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=p.defaultColor,c.strokeWidth=p.defaultStrokeWidth,c.strokeDasharray=p.defaultStrokeDasharray,c.strokePanel=new Ve("Line color",p.defaultColorSet,p.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new xt("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new bt("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return Ee(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorCurve&&a!==this.visibleCurve&&!this.curveGrip.ownsTarget(a))},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=z.createGroup(),this.selectorCurve=z.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=z.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(a,u){h.prototype.pointerDown.call(this,a,u),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=a.x,this.curveY=a.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()),z.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),z.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),z.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){h.prototype.setupControlBox.call(this),this.curveControlLine1=z.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=z.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,h.prototype.addControlGrips.call(this)},o.prototype.positionGrips=function(){h.prototype.positionGrips.call(this);var a=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-a/2,this.curveY-a/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(a){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+a.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+a.y-this.manipulationStartY),h.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){this.activeGrip===this.curveGrip&&(this.curveX=a.x,this.curveY=a.y),h.prototype.resize.call(this,a),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(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.adjustVisual()},o.prototype.scale=function(a,u){this.curveX=this.curveX*a,this.curveY=this.curveY*u,h.prototype.scale.call(this,a,u)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;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}(Rt),rt=function(){function h(o,a){a===void 0&&(a=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=o,this.cancelable=a}return Object.defineProperty(h.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),h.prototype.preventDefault=function(){this._defaultPrevented=!0},h}(),mt=function(h){function o(a,u,p){var c=h.call(this,a,!1)||this;return c.dataUrl=u,c.state=p,c}return Ee(o,h),o}(rt),Xe=function(h){function o(a,u,p){p===void 0&&(p=!1);var c=h.call(this,a,p)||this;return c.marker=u,c}return Ee(o,h),o}(rt),Dt=function(){function h(){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 h.prototype.addEventListener=function(o,a){this[o].push(a)},h.prototype.removeEventListener=function(o,a){var u=this[o].indexOf(a);u>-1&&this[o].splice(u,1)},h}(),kt=function(){function h(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 Se,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 Dt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=h.instanceCounter++,this.styles=new Ze(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(h.prototype,"ALL_MARKER_TYPES",{get:function(){return[pt,M,I,Ae,Ct,pe,S,re,Ce,b,ht,xe]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[pt,M,I,Ae,pe,S,re]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"BASIC_MARKER_TYPES",{get:function(){return[pt,M,I,Ae,S]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(o){var a=this;this._availableMarkerTypes.splice(0),o.forEach(function(u){if(typeof u=="string"){var p=a.ALL_MARKER_TYPES.find(function(c){return c.typeName===u});p!==void 0&&a._availableMarkerTypes.push(p)}else a._availableMarkerTypes.push(u)})},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(h.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(h.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),h.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ne.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},h.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&St.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=St.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new rt(o))})},h.prototype.render=function(){return ye(this,void 0,void 0,function(){var o;return we(this,function(a){switch(a.label){case 0:return this.setCurrentMarker(),(o=new be).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 a.sent(),[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,a.sent()]}})})},h.prototype.close=function(o){var a=this;if(o===void 0&&(o=!1),this.isOpen){var u=!1;o||this.eventListeners.beforeclose.forEach(function(p){var c=new rt(a,!0);p(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(p){return p(new rt(a))}),this.detachEvents(),this._isOpen=!1)}},h.prototype.addMarkersToToolbar=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];(o=this._availableMarkerTypes).push.apply(o,a)},h.prototype.addRenderEventListener=function(o){this.addEventListener("render",function(a){o(a.dataUrl,a.state)})},h.prototype.removeRenderEventListener=function(o){},h.prototype.addCloseEventListener=function(o){this.addEventListener("close",function(){o()})},h.prototype.removeCloseEventListener=function(o){},h.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))},h.prototype.onPopupTargetResize=function(){var o=1*this.target.clientWidth/this.target.clientHeight,a=this.editorCanvas.clientWidth/o>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*o:this.editorCanvas.clientWidth,u=a<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/o;this.resize(a,u)},h.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},h.prototype.resize=function(o,a){this._isResizing=!0;var u=o/this.imageWidth,p=a/this.imageHeight;this.imageWidth=Math.round(o),this.imageHeight=Math.round(a),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,p),this._isResizing=!1},h.prototype.scaleMarkers=function(o,a){var u,p=this;this._currentMarker&&this._currentMarker instanceof Ae?this._currentMarker.scale(o,a):(u=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(c){c!==p._currentMarker&&c.scale(o,a)}),u!==void 0&&this.setCurrentMarker(u)},h.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"},h.prototype.setTopLeft=function(){var o=this.editingTarget.getBoundingClientRect(),a=this.editorCanvas.getBoundingClientRect();this.left=o.left-a.left,this.top=o.top-a.top},h.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)},h.prototype.addDefs=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];this.defs=z.createDefs(),this.addDefsToImage(),(o=this.defs).append.apply(o,a)},h.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},h.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)},h.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},h.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},h.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)},h.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},h.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)},h.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()},h.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")},h.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"},h.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},h.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 Fe(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 Ge(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},h.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},h.prototype.removeMarker=function(o){this.markerImage.removeChild(o.container),this.markers.indexOf(o)>-1&&this.markers.splice(this.markers.indexOf(o),1),o.dispose()},h.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())},h.prototype.toolbarButtonClicked=function(o,a){if(o==="marker"&&a!==void 0)this.createNewMarker(a);else if(o==="action")switch(a){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()}},h.prototype.deleteSelectedMarker=function(){var o=this;if(this._currentMarker!==void 0){var a=!1;if(this.eventListeners.markerbeforedelete.forEach(function(p){var c=new Xe(o,o._currentMarker,!0);p(c),c.defaultPrevented&&(a=!0)}),!a){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(p){return p(new Xe(o,u))})}}},h.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(V){var Ue=new Xe(o,void 0,!0);V(Ue),Ue.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function(V){var Ue=p.markers[V];p.setCurrentMarker(p.markers[V]),p._currentMarker.dispose(),p.markerImage.removeChild(p._currentMarker.container),p.markers.splice(p.markers.indexOf(p._currentMarker),1),p.eventListeners.markerdelete.forEach(function(he){return he(new Xe(o,Ue))})},p=this,c=this.markers.length-1;c>=0;c--)u(c);this.addUndoStep()}},Object.defineProperty(h.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),h.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))},h.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)},h.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},h.prototype.addUndoStep=function(){var o=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var a=this.getState(),u=this.undoRedoManager.getLastUndoStep();if(!u||u.width===a.width&&u.height===a.height){var p=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(a),p<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(c){return c(new rt(o))})}else this.undoRedoManager.replaceLastUndoStep(a),this.eventListeners.statechange.forEach(function(c){return c(new rt(o))})}},h.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},h.prototype.undoStep=function(){var o=this,a=this.undoRedoManager.undo();a!==void 0&&(this.restoreState(a),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(u){return u(new rt(o))}))},h.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},h.prototype.redoStep=function(){var o=this,a=this.undoRedoManager.redo();a!==void 0&&(this.restoreState(a),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(u){return u(new rt(o))}))},h.prototype.stepZoom=function(){var o=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=o<this.zoomSteps.length-1?this.zoomSteps[o+1]:this.zoomSteps[0]},h.prototype.panTo=function(o){this.contentDiv.scrollBy({left:this.prevPanPoint.x-o.x,top:this.prevPanPoint.y-o.y}),this.prevPanPoint=o},h.prototype.startRenderAndClose=function(){return ye(this,void 0,void 0,function(){var o,a,u=this;return we(this,function(p){switch(p.label){case 0:return[4,this.render()];case 1:return o=p.sent(),a=this.getState(),this.eventListeners.render.forEach(function(c){return c(new mt(u,o,a))}),this.close(!0),[2]}})})},h.prototype.getState=function(o){o===!0&&this.setCurrentMarker();var a={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(u){return a.markers.push(u.getState())}),a},h.prototype.restoreState=function(o){var a=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);o.markers.forEach(function(u){var p=a._availableMarkerTypes.find(function(V){return V.typeName===u.typeName});if(p!==void 0){var c=a.addNewMarker(p);c.restoreState(u),a.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 rt(a))})},h.prototype.addNewMarker=function(o){var a=z.createGroup();return this.markerImage.appendChild(a),new o(a,this.overlayContainer,this.settings)},h.prototype.createNewMarker=function(o){var a,u=this;(a=typeof o=="string"?this._availableMarkerTypes.find(function(p){return p.typeName===o}):o)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(a),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(a.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(p){return p(new Xe(u,u._currentMarker))}))},h.prototype.markerCreated=function(o){var a=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(o),this.setCurrentMarker(o),o instanceof M&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(M):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(u){return u(new Xe(a,a._currentMarker))})},h.prototype.colorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=o,this.settings.defaultStrokeColor=o)},h.prototype.fillColorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=o)},h.prototype.markerStateChanged=function(o){var a=this;this.eventListeners.markerchange.forEach(function(u){return u(new Xe(a,o))})},h.prototype.setCurrentMarker=function(o){var a=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 Xe(a,a._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 Xe(a,a._currentMarker))}))},h.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 a=this.markers.find(function(u){return u.ownsTarget(o.target)});a!==void 0?(this.setCurrentMarker(a),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))},h.prototype.onDblClick=function(o){if(this._isFocused||this.focus(),this.mode==="select"){var a=this.markers.find(function(u){return u.ownsTarget(o.target)});a!==void 0&&a!==this._currentMarker&&this.setCurrentMarker(a),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(o.clientX,o.clientY),o.target):this.setCurrentMarker()}},h.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}))},h.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()},h.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},h.prototype.onKeyUp=function(o){this._currentMarker===void 0||this.notesArea!==void 0||o.key!=="Delete"&&o.key!=="Backspace"||this.deleteSelectedMarker()},h.prototype.clientToLocalCoordinates=function(o,a){var u=this.markerImage.getBoundingClientRect();return{x:(o-u.left)/this.zoomLevel,y:(a-u.top)/this.zoomLevel}},h.prototype.onWindowResize=function(){this.positionUI()},h.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()},h.prototype.addLicenseKey=function(o){Ne.addKey(o)},h.prototype.addEventListener=function(o,a){this.eventListeners.addEventListener(o,a)},h.prototype.removeEventListener=function(o,a){this.eventListeners.removeEventListener(o,a)},h.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(h.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),h.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(a){return a(new rt(o))}))},h.prototype.blur=function(){var o=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(a){return a(new rt(o))}))},h.instanceCounter=0,h}();/* **********************************
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 Ft=function(h,o){return(Ft=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var p in u)Object.prototype.hasOwnProperty.call(u,p)&&(a[p]=u[p])})(h,o)};function Pt(h,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function a(){this.constructor=h}Ft(h,o),h.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function ct(h,o,a,u){return new(a||(a=Promise))(function(p,c){function V(wt){try{he(u.next(wt))}catch(ae){c(ae)}}function Ue(wt){try{he(u.throw(wt))}catch(ae){c(ae)}}function he(wt){var ae;wt.done?p(wt.value):(ae=wt.value,ae instanceof a?ae:new a(function(Q){Q(ae)})).then(V,Ue)}he((u=u.apply(h,o||[])).next())})}function Wt(h,o){var a,u,p,c,V={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return c={next:Ue(0),throw:Ue(1),return:Ue(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function Ue(he){return function(wt){return function(ae){if(a)throw new TypeError("Generator is already executing.");for(;V;)try{if(a=1,u&&(p=2&ae[0]?u.return:ae[0]?u.throw||((p=u.return)&&p.call(u),0):u.next)&&!(p=p.call(u,ae[1])).done)return p;switch(u=0,p&&(ae=[2&ae[0],p.value]),ae[0]){case 0:case 1:p=ae;break;case 4:return V.label++,{value:ae[1],done:!1};case 5:V.label++,u=ae[1],ae=[0];continue;case 7:ae=V.ops.pop(),V.trys.pop();continue;default:if(!(p=V.trys,(p=p.length>0&&p[p.length-1])||ae[0]!==6&&ae[0]!==2)){V=0;continue}if(ae[0]===3&&(!p||ae[1]>p[0]&&ae[1]<p[3])){V.label=ae[1];break}if(ae[0]===6&&V.label<p[1]){V.label=p[1],p=ae;break}if(p&&V.label<p[2]){V.label=p[2],V.ops.push(ae);break}p[2]&&V.ops.pop(),V.trys.pop();continue}ae=o.call(h,V)}catch(Q){ae=[6,Q],u=0}finally{a=p=0}if(5&ae[0])throw ae[1];return{value:ae[0]?ae[1]:void 0,done:!0}}([he,wt])}}}var Nt=function(){function h(){}return h.addKey=function(o){h.key=o},Object.defineProperty(h,"isLicensed",{get:function(){return!!h.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(h.key)},enumerable:!1,configurable:!0}),h}(),He=function(){function h(){}return h.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},h.setAttributes=function(o,a){for(var u=0,p=a;u<p.length;u++){var c=p[u],V=c[0],Ue=c[1];o.setAttribute(V,Ue)}},h.createRect=function(o,a,u){var p=document.createElementNS("http://www.w3.org/2000/svg","rect");return p.setAttribute("width",o.toString()),p.setAttribute("height",a.toString()),u&&h.setAttributes(p,u),p},h.createLine=function(o,a,u,p,c){var V=document.createElementNS("http://www.w3.org/2000/svg","line");return V.setAttribute("x1",o.toString()),V.setAttribute("y1",a.toString()),V.setAttribute("x2",u.toString()),V.setAttribute("y2",p.toString()),c&&h.setAttributes(V,c),V},h.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&h.setAttributes(u,a),u},h.createCircle=function(o,a){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()),a&&h.setAttributes(u,a),u},h.createEllipse=function(o,a,u){var p=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return p.setAttribute("cx",(o/2).toString()),p.setAttribute("cy",(a/2).toString()),p.setAttribute("rx",(o/2).toString()),p.setAttribute("ry",(a/2).toString()),u&&h.setAttributes(p,u),p},h.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&h.setAttributes(a,o),a},h.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},h.createMarker=function(o,a,u,p,c,V,Ue){var he=document.createElementNS("http://www.w3.org/2000/svg","marker");return h.setAttributes(he,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",p.toString()],["refX",c.toString()],["refY",V.toString()]]),he.appendChild(Ue),he},h.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&h.setAttributes(a,o),a},h.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&h.setAttributes(u,a),u},h.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&h.setAttributes(a,o),a},h.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},h.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&h.setAttributes(u,a),u},h.createElement=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg",o);return a&&h.setAttributes(u,a),u},h.getHollowRectanglePath=function(o,a,u,p,c,V,Ue,he){return"M"+o+","+a+"V"+(a+p)+"H"+(o+u)+"V"+a+"H"+c+"V"+V+"H"+(c+Ue)+"V"+(V+he)+"H"+c+"V"+a+"Z"},h}(),dt=function(){function h(o){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(h.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(h.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(h.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),h.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},h.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)},h.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 gt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new gt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new gt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Et("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Et("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},h.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},h}(),gt=function(h,o){this.selector=h,this.style=o},Et=function(h,o){this.localName=h,this.style=o},Xt=function(){function h(){this.blocks=[],this.display=""}return h.prototype.addButtonBlock=function(o){o.className=this.blockClassName,o.buttonClassName=this.buttonClassName,o.buttonColorsClassName=this.buttonColorsClassName,o.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(o)},h.prototype.addElementBlock=function(o){o.className===void 0&&(o.className=this.blockClassName),this.blocks.push(o)},h.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(a){return o.appendChild(a.getUI())}),o},h}(),Gt=function(){function h(){}return h.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},h}(),tn=function(h){function o(){var a=h!==null&&h.apply(this,arguments)||this;return a.buttons=[],a}return Pt(o,h),o.prototype.addButton=function(a){a.className=this.buttonClassName,a.colorsClassName=this.buttonColorsClassName,a.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(a)},o.prototype.getUI=function(){var a=h.prototype.getUI.call(this);return this.buttons.forEach(function(u){return a.appendChild(u.getUI())}),a},o}(Gt),Ht=function(){function h(o,a){this._isActive=!1,this._isHidden=!1,this._icon=o,this.title=a,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(h.prototype,"icon",{get:function(){return this._icon},set:function(o){this._icon=o,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isActive",{get:function(){return this._isActive},set:function(o){this._isActive=o,this.adjustClassName()},enumerable:!1,configurable:!0}),h.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},h.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,"")))},h.prototype.hide=function(){this._isHidden=!0},h}(),yt=function(h){function o(){var a=h!==null&&h.apply(this,arguments)||this;return a.elements=[],a}return Pt(o,h),o.prototype.addElement=function(a){this.elements.push(a)},o.prototype.getUI=function(){var a=h.prototype.getUI.call(this);return this.elements.forEach(function(u){return a.appendChild(u)}),a},o}(Gt),Yt=function(){function h(o,a){this.horizontal=o,this.vertical=a}return Object.defineProperty(h.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),h.prototype.getVerticalLength=function(o){return o/this.ratio},h.prototype.getHorizontalLength=function(o){return o*this.ratio},h}(),Mt=function(){function h(){}return h.getIcon=function(o,a){if(o>0&&a>0){var u=new Yt(o,a),p=u.ratio>=1?20:u.getHorizontalLength(20),c=u.ratio<1?20:u.getVerticalLength(20),V=document.createElementNS("http://www.w3.org/2000/svg","svg");V.setAttribute("xmlns","http://www.w3.org/2000/svg"),V.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(V);var Ue=He.createDefs();V.appendChild(Ue);var he=He.createElement("clipPath",[["id","text-bg-clip"]]);Ue.appendChild(he);var wt=He.createPath(He.getHollowRectanglePath((24-p)/2,(24-c)/2,p,c,(24-p)/2+2,(24-c)/2+2,p-4,c-4));V.appendChild(wt);var ae=He.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ae.appendChild(He.createTSpan(o+":"+a)),V.appendChild(ae);var Q=ae.getBBox();He.setAttributes(ae,[["x",((24-Q.width)/2).toString()],["y",((24-Q.height)/2-Q.y).toString()]]);var Ie=He.createPath(He.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Q.width))/2,(24-Math.ceil(Q.height))/2,Math.ceil(Q.width),Math.ceil(Q.height)));return he.appendChild(Ie),He.setAttributes(wt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(V),V.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>'},h}(),qt=function(h){function o(a,u,p){var c=h.call(this,a,u)||this;return c.isDropdownOpen=!1,c.onClick=c.dropdownButtonClicked,c.dropdownButtons=p,c}return Pt(o,h),o.prototype.setupDropdown=function(){var a=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=a.className,u.colorsClassName=a.colorsClassName,a.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}(Ht),It=function(){function h(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=He.createGroup(),this.visual.appendChild(He.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(He.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return h.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},h.prototype.setCenter=function(o,a){this.visual.childNodes.forEach(function(u){return He.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},h}(),Cn=function(){function h(o,a,u,p){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=o,this.canvasHeight=a,this.margin=u,this.container=p,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(h.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(h.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.gridContainer&&He.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(o){this._zoomFactor=o,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),h.prototype.open=function(){var o=this;this.cropShadeElement=He.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=He.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;a<this.numberOfGridLines;a++)this.horizontalGridLines.push(He.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(He.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=He.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},h.prototype.setCropRectangle=function(o){this.cropRect=o;var a=Object.assign({},this.cropRect);this.zoomFactor!==1&&(a.width=this.cropRect.width*this.zoomFactor,a.height=this.cropRect.height*this.zoomFactor,a.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-a.width/2,a.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-a.height/2),He.setAttributes(this.cropRectElement,[["x",a.x.toString()],["y",a.y.toString()],["width",a.width.toString()],["height",a.height.toString()]]);var u=a.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(c,V){var Ue=a.y+u*(V+1);He.setAttributes(c,[["x1",""+a.x],["y1",""+Ue],["x2",""+(a.x+a.width)],["y2",""+Ue]])});var p=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(c,V){var Ue=a.x+p*(V+1);He.setAttributes(c,[["x1",""+Ue],["y1",""+a.y],["x2",""+Ue],["y2",""+(a.y+a.height)]])}),He.setAttributes(this.cropShadeElement,[["d",He.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,a.x,a.y,a.width,a.height)]]),this.topLeftGrip.setCenter(a.x,a.y),this.topRightGrip.setCenter(a.x+a.width,a.y),this.bottomLeftGrip.setCenter(a.x,a.y+a.height),this.bottomRightGrip.setCenter(a.x+a.width,a.y+a.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},h.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)},h.prototype.clientToLocalCoordinates=function(o,a){var u=this.container.getBoundingClientRect();return{x:o-u.left+this.margin,y:a-u.top+this.margin}},h.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)},h.prototype.onPointerMove=function(o){if(this.isMoving)this.move(this.clientToLocalCoordinates(o.clientX,o.clientY));else if(this.activeGrip){var a=this.clientToLocalCoordinates(o.clientX,o.clientY);this.resize(a)}o.preventDefault()},h.prototype.onPointerUp=function(o){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(o.pointerId)},h.prototype.move=function(o){var a=o.x-this.previousPoint.x,u=o.y-this.previousPoint.y;this.zoomFactor!==1&&(a=-a/this.zoomFactor,u=-u/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+a),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},h.prototype.resize=function(o){var a=Object.assign({},this.cropRect),u=o.x-this.previousPoint.x,p=o.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:a.x+u<this.margin&&(u=this.margin-a.x),a.x+=u,a.width=this.cropRect.x+this.cropRect.width-a.x;break;case this.bottomRightGrip:case this.topRightGrip:a.width+u>this.canvasWidth*this.zoomFactor&&(u=this.canvasWidth*this.zoomFactor-a.width),a.width+=u}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(a.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(u),a.height=this.aspectRatio.getVerticalLength(a.width)):(a.y+=p,a.height=this.cropRect.y+this.cropRect.height-a.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?a.height=this.aspectRatio.getVerticalLength(a.width):a.height+=p}a.width<10&&(a.x=this.cropRect.x,a.width=10),a.height<10&&(a.y=this.cropRect.y,a.height=10),this.previousPoint=o,a.x>=this.margin&&a.y>=this.margin&&a.x-this.margin+a.width<=this.canvasWidth&&a.y-this.margin+a.height<=this.canvasHeight&&(this.cropRect=a,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},h.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,a=this.cropRect.y+this.cropRect.height/2,u=this.aspectRatio.getHorizontalLength(this.cropRect.height),p=this.aspectRatio.getVerticalLength(this.cropRect.width);u/this.canvasWidth<p/this.canvasHeight?this.cropRect.width=u:this.cropRect.height=p,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=a-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)}},h.prototype.getRescaledRect=function(o,a,u,p,c,V){var Ue=u/o,he=p/a;return{x:(c.x-V)*Ue+V,y:(c.y-V)*he+V,width:c.width*Ue,height:c.height*he}},h.prototype.scaleCanvas=function(o,a){var u=this.getRescaledRect(this.canvasWidth,this.canvasHeight,o,a,this.cropRect,this.margin);this.canvasWidth=o,this.canvasHeight=a,this.onCropChange&&this.onCropChange(u),this.setCropRectangle(u)},h}(),ai=function(){function h(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(h.prototype,"angle",{get:function(){return this._angle},set:function(o){this._angle=o,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),h.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},h.prototype.onPointerDown=function(o){this.controlContainer.setPointerCapture(o.pointerId),this.isDragging=!0,this.previousPoint={x:o.clientX,y:o.clientY}},h.prototype.onPointerMove=function(o){this.isDragging&&(this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.previousPoint.x=o.clientX)},h.prototype.onPointerUp=function(o){this.isDragging&&this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(o.pointerId)},h.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var o=this.angleLabelText.getBBox();He.setAttributes(this.angleLabelElement,[["x",((this.width-o.width)/2).toString()],["y",(this.height/2).toString()]])}},h.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)}},h.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 a="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,u=1;u<=this.width/5+10;u++){var p=u%5==0?this.height/3:this.height/6;a+="h4v"+-p+"h1v"+p}a+="v1H0Z",this.scaleShape=He.createPath(a);var c=He.createTransform();this.scaleShape.transform.baseVal.appendItem(c),o.appendChild(this.scaleShape),this.angleLabelElement=He.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=He.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var V=He.createTSpan("");return V.innerHTML="&deg;",this.angleLabelElement.appendChild(V),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},h}(),ti=function(){function h(){this.naturalSize=!1,this.imageType="image/png"}return h.prototype.rasterize=function(o,a,u,p,c,V,Ue){var he=this;return new Promise(function(wt){var ae=document.createElement("canvas");ae.width=o.width.baseVal.value-2*p,ae.height=o.height.baseVal.value-2*p;var Q=1,Ie=1;he.naturalSize===!0?(Q=a.naturalWidth/(o.width.baseVal.value-2*p)/V,Ie=a.naturalHeight/(o.height.baseVal.value-2*p)/Ue,ae.width=a.naturalWidth/V,ae.height=a.naturalHeight/Ue):he.width!==void 0&&he.height!==void 0&&(Q=he.width/u.width,Ie=he.height/u.height,ae.width*=Q,ae.height*=Ie);var ot=ae.getContext("2d");ot.translate(ae.width/2,ae.height/2),ot.rotate(c*Math.PI/180),ot.scale(V,Ue),ot.translate(-ae.width/2,-ae.height/2),ot.drawImage(a,0,0,ae.width,ae.height);var at=document.createElement("canvas");at.width=u.width*Q,at.height=u.height*Ie,at.getContext("2d").putImageData(ot.getImageData((u.x-p)*Q,(u.y-p)*Ie,u.width*Q,u.height*Ie),0,0),wt(at.toDataURL(he.imageType,he.imageQuality))})},h}(),je=function(){function h(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=h.instanceCounter++,this.styles=new dt(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(h.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(o){this._zoomToCropEnabled=o,o?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(h.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(h.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(h.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(h.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(h.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}),h.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},h.prototype.show=function(){this.showUI(),this.open()},h.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(a){return a()}),this._isOpen=!1)},h.prototype.addRenderEventListener=function(o){this.renderEventListeners.push(o)},h.prototype.removeRenderEventListener=function(o){this.renderEventListeners.indexOf(o)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(o),1)},h.prototype.addCloseEventListener=function(o){this.closeEventListeners.push(o)},h.prototype.removeCloseEventListener=function(o){this.closeEventListeners.indexOf(o)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(o),1)},h.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))},h.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var o=1*this.target.clientWidth/this.target.clientHeight,a=this.contentDiv.clientWidth/o>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*o:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,u=a+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/o;this.resize(a,u)}},h.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},h.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",He.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},h.prototype.resize=function(o,a){this.imageWidth=Math.round(o),this.imageHeight=Math.round(a),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()},h.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 a=o.toDataURL();He.setAttributes(this.editingTarget,[["href",a]]),this.setEditingTargetSize()},h.prototype.setTopLeft=function(){var o=this.target.getBoundingClientRect(),a=this.editorCanvas.getBoundingClientRect();this.left=o.left-a.left-this.CANVAS_MARGIN,this.top=o.top-a.top-this.CANVAS_MARGIN},h.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=He.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=He.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=He.createGroup(),this.editingTargetRotationScaleContainer=He.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=He.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var a=He.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(a),this.editingTargetContainer=He.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)},h.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},h.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=He.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Cn(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()},h.prototype.zoomToCrop=function(){if(this.cropRect){var o=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,a=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 "+a+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-o+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-a+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},h.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)},h.prototype.cropRectChanged=function(o){this.cropRect=o,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},h.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},h.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"},h.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},h.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,a=this.target.offsetTop>o+this.CANVAS_MARGIN?this.target.offsetTop-(o+this.CANVAS_MARGIN):0;this.coverDiv.style.top=a+"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},h.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},h.prototype.addTopToolbar=function(){var o=this;this.topToolbar=new Xt,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 a=new tn;a.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(a);var u=[];this.aspectRatios.forEach(function(Ie){var ot=new Ht(Mt.getIcon(Ie.horizontal,Ie.vertical),Ie.horizontal===0&&Ie.vertical===0?"FREE":Ie.horizontal+":"+Ie.vertical);ot.onClick=function(){return o.ratioButtonClicked(Ie)},u.push(ot)}),this.aspectRatioButton=new qt(Mt.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,a.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var p=new Ht('<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");p.isActive=this.isGridVisible,p.onClick=function(){o.isGridVisible=!o.isGridVisible,p.isActive=o.isGridVisible},a.addButton(p);var c=new Ht('<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},a.addButton(c),!Nt.isLicensed){var V=new yt;this.topToolbar.addElementBlock(V);var Ue=document.createElement("div");Ue.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var he=document.createElement("a");he.style.color="currentColor",he.href="https://markerjs.com/products/cropro",he.target="_blank",he.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>',Ue.appendChild(he),V.addElement(Ue)}var wt=new tn;wt.minWidth=3*this.toolbarHeight+"px",wt.contentAlign="end",this.topToolbar.addButtonBlock(wt);var ae=new Ht('<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");ae.onClick=this.startRenderAndClose,wt.addButton(ae),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ae.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Q=new Ht('<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");Q.onClick=this.close,wt.addButton(Q),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Q.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},h.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new Xt,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 a=new tn;a.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(a);var u=new Ht('<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,a.addButton(u);var p=new Ht('<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");p.onClick=this.rotateRightButtonClicked,a.addButton(p);var c=new yt;c.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(c),this.straightener=new ai("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(wt){o.rotateBy(wt),o.straightener.angle=o.rotationAngle},c.addElement(this.straightener.getUI());var V=new tn;V.minWidth=2*this.toolbarHeight+"px",V.contentAlign="end",this.bottomToolbar.addButtonBlock(V);var Ue=new Ht('<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");Ue.onClick=this.flipHorizontallyButtonClicked,V.addButton(Ue);var he=new Ht('<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");he.onClick=this.flipVerticallyButtonClicked,V.addButton(he)},h.prototype.ratioButtonClicked=function(o){this.aspectRatio=o,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},h.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Mt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},h.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Yt(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},h.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},h.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},h.prototype.restoreState=function(o){if(o){var a=this.cropLayer.getRescaledRect(o.width,o.height,this.imageWidth,this.imageHeight,o.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(a),this.cropRectChanged(a),this.flippedHorizontally=o.flippedHorizontally,this.flippedVertically=o.flippedVertically,this.applyFlip(),this.rotationAngle=o.rotationAngle,this.applyRotation()}},h.prototype.clientToLocalCoordinates=function(o,a){var u=this.cropImage.getBoundingClientRect();return{x:o-u.left,y:a-u.top}},h.prototype.onWindowResize=function(){this.positionUI()},h.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()},h.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)},h.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)},h.prototype.rotateTo=function(o){o=(o=o>180?o-360:o)<=-180?o+360:o,this.rotationAngle=o,this.applyRotation()},h.prototype.rotateBy=function(o){this.rotateTo((this.rotationAngle+o)%360)},h.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 a=this.editingTargetRotationContainer.transform.baseVal.getItem(0);a.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(a,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},h.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},h.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},h.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},h.prototype.startRenderAndClose=function(){return ct(this,void 0,void 0,function(){var o,a;return Wt(this,function(u){switch(u.label){case 0:return[4,this.render()];case 1:return o=u.sent(),a=this.getState(),this.renderEventListeners.forEach(function(p){return p(o,a)}),this.close(!0),[2]}})})},h.prototype.render=function(){return ct(this,void 0,void 0,function(){var o;return Wt(this,function(a){switch(a.label){case 0:return(o=new ti).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.width=this.renderWidth,o.height=this.renderHeight,this.unzoomFromCrop(),He.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 a.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,a.sent()]}})})},h.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Et("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 Et("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Et("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Et("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 Et("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Et("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new gt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new gt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Et("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 Et("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Et("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 Et("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 Et("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},h.instanceCounter=0,h}(),et=y("8hTe"),an=y.n(et),hn=/<pre[^>]*>/g;function gn(h){var o=document.createElement("div");return o.innerHTML=h,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var En=qe.a=function(h){var o=h.value,a=o===void 0?"":o,u=h.edit,p=u===void 0?!1:u,c=h.className,V=h.showTextOnly,Ue=h.showLines,he=h.replaces,wt=h.zoomImg,ae=h.hasMask,Q=h.style,Ie=Q===void 0?{}:Q,ot=h.stylesPrev,at=ot===void 0?{}:ot,lt=String(a),Ot=Object(U.useRef)(),Qt=Object(U.useRef)(),mn=Object(U.useState)(""),nn=Object(O.a)(mn,2),Zt=nn[0],wn=nn[1],Bn=Object(U.useState)("office"),vn=Object(O.a)(Bn,2),Yn=vn[0],yn=vn[1],Mn=function(){var rn=new je(Qt.current);rn.displayMode="popup",rn.addRenderEventListener(function(){var Wn=Object(ee.a)(A.a.mark(function on(zn){var fn;return A.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:return Ot.current.style.display="none",Pn.next=3,Object(Qe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:zn}});case 3:fn=Pn.sent,fn!=null&&fn.id&&he(Qt.current.getAttribute("src").replace(Oe.a.API_SERVER,""),"/api/attachments/".concat(fn==null?void 0:fn.id,"?type=").concat(fn.content_type));case 5:case"end":return Pn.stop()}},on)}));return function(on){return Wn.apply(this,arguments)}}()),rn.show()},pi=function(){var rn=new kt(Qt.current);rn.settings.displayMode="popup",rn.addEventListener("render",function(){var Wn=Object(ee.a)(A.a.mark(function on(zn){var fn;return A.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:if(Ot.current.style.display="none",!Qt.current){Pn.next=6;break}return Pn.next=4,Object(Qe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:zn.dataUrl}});case 4:fn=Pn.sent,fn!=null&&fn.id&&he(Qt.current.getAttribute("src").replace(Oe.a.API_SERVER,""),"/api/attachments/".concat(fn==null?void 0:fn.id,"?type=").concat(fn.content_type));case 6:case"end":return Pn.stop()}},on)}));return function(on){return Wn.apply(this,arguments)}}()),rn.show(),window.markerArea=rn},Fn=Object(U.useMemo)(function(){try{var kn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,rn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Wn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;lt=lt.replace(kn,"("+Oe.a.API_SERVER+"/api/attachments/").replace(rn,'"'+Oe.a.API_SERVER+"/api/attachments/").replace(Wn,'"'+Oe.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,`
`),lt=lt.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
`)}catch(Ei){}var on=de(lt),zn=K();if(lt.match(/\[TOC\]/)&&(on=on.replace("<p>[TOC]</p>",De()),Me()),on=on.replace(/(__special_katext_id_\d+__)/g,function(Ei,Pn){var On=zn[Pn],mi=On.type,wi=On.expression;return Object(_e.renderToString)(gn(wi)||"",{displayMode:mi==="block",throwOnError:!1,output:"html"})}),on=on.replace(/▁/g,"\u2581\u2581\u2581"),G(),V){var fn=document.createElement("div");return fn.innerHTML=on,fn.innerText}return setTimeout(function(){return Ii()},500),on},[lt]),ni=Object(U.useRef)();le.WebkitLineClamp=Ue,Ue&&(Ie=Object(ue.a)(Object(ue.a)({},Ie),le));function Ni(kn){var rn=kn.target;if(rn.tagName.toUpperCase()==="IMG"){if(wt){var Wn=rn.getAttribute("src");wn(Wn),yn("image")}}else if(rn.tagName.toUpperCase()==="A"){var on=rn.getAttribute("href");if(on.indexOf("office")>-1)kn.preventDefault(),wn(on),yn("office");else if(on.indexOf("application/pdf")>-1)kn.preventDefault(),wn(on),yn("pdf");else if(on.indexOf("type=text")>-1)kn.preventDefault(),wn(on),yn("html");else if(on.startsWith("#")){kn.preventDefault();var zn=document.getElementById(on.replace("#",""));zn&&zn.scrollIntoView(!0)}}}var Ii=function(){var rn,Wn=(rn=ni.current)===null||rn===void 0?void 0:rn.querySelectorAll("video");Wn==null||Wn.forEach(function(on){if(on.oncontextmenu=function(){return!1},on.src.indexOf(".m3u8")>-1&&!on.canPlayType("application/vnd.apple.mpegurl")){if(te.a.isSupported()){var zn=new te.a;zn.loadSource(on.src),zn.attachMedia(on)}}})};Object(U.useEffect)(function(){if(ni.current&&Fn&&(Fn.match(hn)&&window.PR.prettyPrint()),ni.current)return ni.current.addEventListener("click",Ni),function(){ni.current.removeEventListener("click",Ni),G(),Me()}},[Fn,ni.current,Ni]);var ji=function(rn){if(!p)return;rn.target.nodeName==="IMG"?(Ot.current.style.display="flex",Ot.current.style.width=rn.target.clientWidth+"px",Ot.current.style.height=rn.target.clientHeight+"px",Ot.current.style.top=rn.target.offsetTop+"px",Ot.current.style.left=rn.target.offsetLeft+"px",Qt.current.src=rn.target.getAttribute("src")):Ot.current.style.display="none"};return k.a.createElement("div",{style:{position:"relative"}},k.a.createElement("div",{ref:ni,style:Object(ue.a)({},Ie),className:"".concat(c||""," markdown-body ").concat(an.a.mdBody),onMouseOver:ji,dangerouslySetInnerHTML:{__html:Fn}}),k.a.createElement("div",{ref:Ot,className:an.a.button},k.a.createElement(me.a,null,k.a.createElement(fe.a,{onClick:function(){return Mn()}},"\u88C1\u526A"),k.a.createElement(fe.a,{onClick:function(){return pi()}},"\u7F16\u8F91"))),k.a.createElement("img",{ref:Qt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),k.a.createElement($e.a,{close:!0,data:Zt,hasMask:ae,type:Zt!=null&&Zt.length?Yn:"",style:Object(ue.a)({},at),onClose:function(){return wn("")}}))}},"9VGf":function(it,qe,y){"use strict";y.d(qe,"a",function(){return Z});var B=y("q1tI"),me=y.n(B);function Z(fe,ue){var ee=Object(B.useRef)();Object(B.useEffect)(function(){ee.current=fe}),Object(B.useEffect)(function(){function O(){ee.current()}if(ue!==null){var N=setInterval(O,ue);return function(){return clearInterval(N)}}},[ue])}},Bd2K:function(it,qe,y){(function(B){B(y("VrN/"),y("osHv"))})(function(B){B.defineOption("autoCloseTags",!1,function(A,U,k){if(k!=B.Init&&k&&A.removeKeyMap("autoCloseTags"),!U)return;var R={name:"autoCloseTags"};(typeof U!="object"||U.whenClosing!==!1)&&(R["'/'"]=function(q){return ee(q)}),(typeof U!="object"||U.whenOpening!==!1)&&(R["'>'"]=function(q){return fe(q)}),A.addKeyMap(R)});var me=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],Z=["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 fe(A){if(A.getOption("disableInput"))return B.Pass;for(var U=A.listSelections(),k=[],R=A.getOption("autoCloseTags"),q=0;q<U.length;q++){if(!U[q].empty())return B.Pass;var $=U[q].head,F=A.getTokenAt($),H=B.innerMode(A.getMode(),F.state),X=H.state,oe=H.mode.xmlCurrentTag&&H.mode.xmlCurrentTag(X),se=oe&&oe.name;if(!se)return B.Pass;var Le=H.mode.configuration=="html",Me=typeof R=="object"&&R.dontCloseTags||Le&&me,le=typeof R=="object"&&R.indentTags||Le&&Z;F.end>$.ch&&(se=se.slice(0,se.length-F.end+$.ch));var ve=se.toLowerCase();if(!se||F.type=="string"&&(F.end!=$.ch||!/[\"\']/.test(F.string.charAt(F.string.length-1))||F.string.length==1)||F.type=="tag"&&oe.close||F.string.indexOf("/")==$.ch-F.start-1||Me&&O(Me,ve)>-1||N(A,H.mode.xmlCurrentContext&&H.mode.xmlCurrentContext(X)||[],se,$,!0))return B.Pass;var De=typeof R=="object"&&R.emptyTags;if(De&&O(De,se)>-1){k[q]={text:"/>",newPos:B.Pos($.line,$.ch+2)};continue}var Y=le&&O(le,ve)>-1;k[q]={indent:Y,text:">"+(Y?`
`:"")+"</"+se+">",newPos:Y?B.Pos($.line+1,0):B.Pos($.line,$.ch+1)}}for(var m=typeof R=="object"&&R.dontIndentOnAutoClose,q=U.length-1;q>=0;q--){var ge=k[q];A.replaceRange(ge.text,U[q].head,U[q].anchor,"+insert");var T=A.listSelections().slice(0);T[q]={head:ge.newPos,anchor:ge.newPos},A.setSelections(T),!m&&ge.indent&&(A.indentLine(ge.newPos.line,null,!0),A.indentLine(ge.newPos.line+1,null,!0))}}function ue(A,U){for(var k=A.listSelections(),R=[],q=U?"/":"</",$=A.getOption("autoCloseTags"),F=typeof $=="object"&&$.dontIndentOnSlash,H=0;H<k.length;H++){if(!k[H].empty())return B.Pass;var X=k[H].head,oe=A.getTokenAt(X),se=B.innerMode(A.getMode(),oe.state),Le=se.state;if(U&&(oe.type=="string"||oe.string.charAt(0)!="<"||oe.start!=X.ch-1))return B.Pass;var Me,le=se.mode.name!="xml"&&A.getMode().name=="htmlmixed";if(le&&se.mode.name=="javascript")Me=q+"script";else if(le&&se.mode.name=="css")Me=q+"style";else{var ve=se.mode.xmlCurrentContext&&se.mode.xmlCurrentContext(Le);if(!ve||ve.length&&N(A,ve,ve[ve.length-1],X))return B.Pass;Me=q+ve[ve.length-1]}A.getLine(X.line).charAt(oe.end)!=">"&&(Me+=">"),R[H]=Me}if(A.replaceSelections(R),k=A.listSelections(),!F)for(var H=0;H<k.length;H++)(H==k.length-1||k[H].head.line<k[H+1].head.line)&&A.indentLine(k[H].head.line)}function ee(A){return A.getOption("disableInput")?B.Pass:ue(A,!0)}B.commands.closeTag=function(A){return ue(A)};function O(A,U){if(A.indexOf)return A.indexOf(U);for(var k=0,R=A.length;k<R;++k)if(A[k]==U)return k;return-1}function N(A,U,k,R,q){if(!B.scanForClosingTag)return!1;var $=Math.min(A.lastLine()+1,R.line+500),F=B.scanForClosingTag(A,R,null,$);if(!F||F.tag!=k)return!1;for(var H=q?1:0,X=U.length-1;X>=0&&U[X]==k;X--)++H;R=F.to;for(var X=1;X<H;X++){var oe=B.scanForClosingTag(A,R,null,$);if(!oe||oe.tag!=k)return!1;R=oe.to}return!0}})},BjJ7:function(it,qe,y){"use strict";y.d(qe,"d",function(){return me}),y.d(qe,"c",function(){return Z}),y.d(qe,"e",function(){return fe}),y.d(qe,"b",function(){return ue}),y.d(qe,"a",function(){return O});var B=y("m3rI");function me(N){var A=!0;if(N.length>0){for(var U=0;U<N.length;U++)if(N[U].compile_success==0||!N[U].compile_success){A=!1;break}}else A=!1;return A}function Z(N){for(var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",U=[],k=0;k<N.length;k++){var R=N[k],q=A?"".concat(A,"/").concat(R.name):"".concat(R.name);U.push({title:R.name,isLeaf:!(R.type==="tree"),key:q})}return U}function fe(N,A,U){for(var k=0;k<N.length;k++){var R=N[k];if(R.key===A){R.children=U;break}R.children&&fe(R.children,A,U)}return N}function ue(N,A,U){var k;return function(){var R=this,q=arguments,$=function(){k=null,U||N.apply(R,q)},F=U&&!k;clearTimeout(k),k=setTimeout($,A),F&&N.apply(R,q)}}var ee=!0,O=B.a.API_SERVER},"C+DQ":function(it,qe,y){},D1Df:function(it,qe,y){"use strict";function B(C){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?B=function(J){return typeof J}:B=function(J){return J&&typeof Symbol=="function"&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},B(C)}function me(){return me=Object.assign||function(C){for(var E=1;E<arguments.length;E++){var J=arguments[E];for(var L in J)Object.prototype.hasOwnProperty.call(J,L)&&(C[L]=J[L])}return C},me.apply(this,arguments)}function Z(C,E){var J=Object.keys(C);if(Object.getOwnPropertySymbols){var L=Object.getOwnPropertySymbols(C);E&&(L=L.filter(function(de){return Object.getOwnPropertyDescriptor(C,de).enumerable})),J.push.apply(J,L)}return J}function fe(C){for(var E=1;E<arguments.length;E++){var J=arguments[E]!=null?arguments[E]:{};E%2?Z(J,!0).forEach(function(L){F(C,L,J[L])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(J)):Z(J).forEach(function(L){Object.defineProperty(C,L,Object.getOwnPropertyDescriptor(J,L))})}return C}function ue(C,E){if(C==null)return{};var J=ee(C,E),L,de;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(C);for(de=0;de<w.length;de++){if(L=w[de],E.indexOf(L)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(C,L))continue;J[L]=C[L]}}return J}function ee(C,E){if(C==null)return{};var J={},L=Object.keys(C),de,w;for(w=0;w<L.length;w++){if(de=L[w],E.indexOf(de)>=0)continue;J[de]=C[de]}return J}function O(C,E){if(!(C instanceof E))throw new TypeError("Cannot call a class as a function")}function N(C,E){for(var J=0;J<E.length;J++){var L=E[J];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(C,L.key,L)}}function A(C,E,J){return E&&N(C.prototype,E),J&&N(C,J),C}function U(C,E){return E&&(B(E)==="object"||typeof E=="function")?E:R(C)}function k(C){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(J){return J.__proto__||Object.getPrototypeOf(J)},k(C)}function R(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}function q(C,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function");C.prototype=Object.create(E&&E.prototype,{constructor:{value:C,writable:!0,configurable:!0}}),E&&$(C,E)}function $(C,E){return $=Object.setPrototypeOf||function(L,de){return L.__proto__=de,L},$(C,E)}function F(C,E,J){return E in C?Object.defineProperty(C,E,{value:J,enumerable:!0,configurable:!0,writable:!0}):C[E]=J,C}var H=y("q1tI"),X=y("17x9"),oe=y("H38U"),se=y("aRTE");function Le(C){for(var E="",J=0;J<C.length;J++){var L=C.charCodeAt(J);L<128?E+=String.fromCharCode(L):L<2048?(E+=String.fromCharCode(192|L>>6),E+=String.fromCharCode(128|L&63)):L<55296||L>=57344?(E+=String.fromCharCode(224|L>>12),E+=String.fromCharCode(128|L>>6&63),E+=String.fromCharCode(128|L&63)):(J++,L=65536+((L&1023)<<10|C.charCodeAt(J)&1023),E+=String.fromCharCode(240|L>>18),E+=String.fromCharCode(128|L>>12&63),E+=String.fromCharCode(128|L>>6&63),E+=String.fromCharCode(128|L&63))}return E}var Me={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},le={},ve=4,De=.1;function Y(C){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,J=[];return C.forEach(function(L,de){var w=null;L.forEach(function(g,te){if(!g&&w!==null){J.push("M".concat(w+E," ").concat(de+E,"h").concat(te-w,"v1H").concat(w+E,"z")),w=null;return}if(te===L.length-1){if(!g)return;w===null?J.push("M".concat(te+E,",").concat(de+E," h1v1H").concat(te+E,"z")):J.push("M".concat(w+E,",").concat(de+E," h").concat(te+1-w,"v1H").concat(w+E,"z"));return}g&&w===null&&(w=te)})}),J.join("")}function m(C,E){return C.slice().map(function(J,L){return L<E.y||L>=E.y+E.h?J:J.map(function(de,w){return w<E.x||w>=E.x+E.w?de:!1})})}function ge(C,E){var J=C.imageSettings,L=C.size,de=C.includeMargin;if(J==null)return null;var w=de?ve:0,g=E.length+w*2,te=Math.floor(L*De),Oe=g/L,_e=(J.width||te)*Oe,$e=(J.height||te)*Oe,Qe=J.x==null?E.length/2-_e/2:J.x*Oe,Te=J.y==null?E.length/2-$e/2:J.y*Oe,Ee=null;if(J.excavate){var ye=Math.floor(Qe),we=Math.floor(Te),ne=Math.ceil(_e+Qe-ye),z=Math.ceil($e+Te-we);Ee={x:ye,y:we,w:ne,h:z}}return{x:Qe,y:Te,h:$e,w:_e,excavation:Ee}}var T=function(){try{new Path2D().addPath(new Path2D)}catch(C){return!1}return!0}(),x=function(C){q(E,C);function E(){var J,L;O(this,E);for(var de=arguments.length,w=new Array(de),g=0;g<de;g++)w[g]=arguments[g];return L=U(this,(J=k(E)).call.apply(J,[this].concat(w))),F(R(L),"_canvas",void 0),F(R(L),"_image",void 0),F(R(L),"state",{imgLoaded:!1}),F(R(L),"handleImageLoad",function(){L.setState({imgLoaded:!0})}),L}return A(E,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var L=this.props,de=L.value,w=L.size,g=L.level,te=L.bgColor,Oe=L.fgColor,_e=L.includeMargin,$e=L.imageSettings,Qe=new oe(-1,se[g]);if(Qe.addData(Le(de)),Qe.make(),this._canvas!=null){var Te=this._canvas,Ee=Te.getContext("2d");if(!Ee)return;var ye=Qe.modules;if(ye===null)return;var we=_e?ve:0,ne=ye.length+we*2,z=ge(this.props,ye);$e!=null&&z!=null&&(z.excavation!=null&&(ye=m(ye,z.excavation)));var Ne=window.devicePixelRatio||1;Te.height=Te.width=w*Ne;var be=w/ne*Ne;Ee.scale(be,be),Ee.fillStyle=te,Ee.fillRect(0,0,ne,ne),Ee.fillStyle=Oe,T?Ee.fill(new Path2D(Y(ye,we))):ye.forEach(function(St,Ze){St.forEach(function(Ke,Re){Ke&&Ee.fillRect(Re+we,Ze+we,1,1)})}),this.state.imgLoaded&&this._image&&z!=null&&Ee.drawImage(this._image,z.x+we,z.y+we,z.w,z.h)}}},{key:"render",value:function(){var L=this,de=this.props,w=de.value,g=de.size,te=de.level,Oe=de.bgColor,_e=de.fgColor,$e=de.style,Qe=de.includeMargin,Te=de.imageSettings,Ee=ue(de,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),ye=fe({height:g,width:g},$e),we=null,ne=Te&&Te.src;return Te!=null&&ne!=null&&(we=H.createElement("img",{src:ne,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(Ne){return L._image=Ne}})),H.createElement(H.Fragment,null,H.createElement("canvas",me({style:ye,height:g,width:g,ref:function(Ne){return L._canvas=Ne}},Ee)),we)}}]),E}(H.PureComponent);F(x,"defaultProps",Me);var K=function(C){q(E,C);function E(){return O(this,E),U(this,k(E).apply(this,arguments))}return A(E,[{key:"render",value:function(){var L=this.props,de=L.value,w=L.size,g=L.level,te=L.bgColor,Oe=L.fgColor,_e=L.includeMargin,$e=L.imageSettings,Qe=ue(L,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),Te=new oe(-1,se[g]);Te.addData(Le(de)),Te.make();var Ee=Te.modules;if(Ee===null)return null;var ye=_e?ve:0,we=Ee.length+ye*2,ne=ge(this.props,Ee),z=null;$e!=null&&ne!=null&&(ne.excavation!=null&&(Ee=m(Ee,ne.excavation)),z=H.createElement("image",{xlinkHref:$e.src,height:ne.h,width:ne.w,x:ne.x+ye,y:ne.y+ye,preserveAspectRatio:"none"}));var Ne=Y(Ee,ye);return H.createElement("svg",me({shapeRendering:"crispEdges",height:w,width:w,viewBox:"0 0 ".concat(we," ").concat(we)},Qe),H.createElement("path",{fill:te,d:"M0,0 h".concat(we,"v").concat(we,"H0z")}),H.createElement("path",{fill:Oe,d:Ne}),z)}}]),E}(H.PureComponent);F(K,"defaultProps",Me);var G=function(E){var J=E.renderAs,L=ue(E,["renderAs"]),de=J==="svg"?K:x;return H.createElement(de,L)};G.defaultProps=fe({renderAs:"canvas"},Me),it.exports=G},DlQD:function(it,qe,y){(function(B,me){it.exports=me()})(this,function(){"use strict";function B(M,j){for(var I=0;I<j.length;I++){var b=j[I];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(M,b.key,b)}}function me(M,j,I){return j&&B(M.prototype,j),I&&B(M,I),M}function Z(M,j){if(!M)return;if(typeof M=="string")return fe(M,j);var I=Object.prototype.toString.call(M).slice(8,-1);if(I==="Object"&&M.constructor&&(I=M.constructor.name),I==="Map"||I==="Set")return Array.from(M);if(I==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(I))return fe(M,j)}function fe(M,j){(j==null||j>M.length)&&(j=M.length);for(var I=0,b=new Array(j);I<j;I++)b[I]=M[I];return b}function ue(M,j){var I;if(typeof Symbol=="undefined"||M[Symbol.iterator]==null){if(Array.isArray(M)||(I=Z(M))||j&&M&&typeof M.length=="number"){I&&(M=I);var b=0;return function(){return b>=M.length?{done:!0}:{done:!1,value:M[b++]}}}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 I=M[Symbol.iterator](),I.next.bind(I)}function ee(M,j){return j={exports:{}},M(j,j.exports),j.exports}var O=ee(function(M){function j(){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 I(b){M.exports.defaults=b}M.exports={defaults:j(),getDefaults:j,changeDefaults:I}}),N=O.defaults,A=O.getDefaults,U=O.changeDefaults,k=/[&<>"']/,R=/[&<>"']/g,q=/[<>"']|&(?!#?\w+;)/,$=/[<>"']|&(?!#?\w+;)/g,F={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},H=function(j){return F[j]};function X(M,j){if(j){if(k.test(M))return M.replace(R,H)}else if(q.test(M))return M.replace($,H);return M}var oe=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function se(M){return M.replace(oe,function(j,I){return I=I.toLowerCase(),I==="colon"?":":I.charAt(0)==="#"?I.charAt(1)==="x"?String.fromCharCode(parseInt(I.substring(2),16)):String.fromCharCode(+I.substring(1)):""})}var Le=/(^|[^\[])\^/g;function Me(M,j){M=M.source||M,j=j||"";var I={replace:function(_,S){return S=S.source||S,S=S.replace(Le,"$1"),M=M.replace(_,S),I},getRegex:function(){return new RegExp(M,j)}};return I}var le=/[^\w:]/g,ve=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function De(M,j,I){if(M){var b;try{b=decodeURIComponent(se(I)).replace(le,"").toLowerCase()}catch(_){return null}if(b.indexOf("javascript:")===0||b.indexOf("vbscript:")===0||b.indexOf("data:")===0)return null}j&&!ve.test(I)&&(I=x(j,I));try{I=encodeURI(I).replace(/%25/g,"%")}catch(_){return null}return I}var Y={},m=/^[^:]+:\/*[^/]*$/,ge=/^([^:]+:)[\s\S]*$/,T=/^([^:]+:\/*[^/]*)[\s\S]*$/;function x(M,j){Y[" "+M]||(m.test(M)?Y[" "+M]=M+"/":Y[" "+M]=E(M,"/",!0)),M=Y[" "+M];var I=M.indexOf(":")===-1;return j.substring(0,2)==="//"?I?j:M.replace(ge,"$1")+j:j.charAt(0)==="/"?I?j:M.replace(T,"$1")+j:M+j}var K={exec:function(){}};function G(M){for(var j=1,I,b;j<arguments.length;j++){I=arguments[j];for(b in I)Object.prototype.hasOwnProperty.call(I,b)&&(M[b]=I[b])}return M}function C(M,j){var I=M.replace(/\|/g,function(S,P,re){for(var pe=!1,Ce=P;--Ce>=0&&re[Ce]==="\\";)pe=!pe;return pe?"|":" |"}),b=I.split(/ \|/),_=0;if(b.length>j)b.splice(j);else for(;b.length<j;)b.push("");for(;_<b.length;_++)b[_]=b[_].trim().replace(/\\\|/g,"|");return b}function E(M,j,I){var b=M.length;if(b===0)return"";for(var _=0;_<b;){var S=M.charAt(b-_-1);if(S===j&&!I)_++;else if(S!==j&&I)_++;else break}return M.substr(0,b-_)}function J(M,j){if(M.indexOf(j[1])===-1)return-1;for(var I=M.length,b=0,_=0;_<I;_++)if(M[_]==="\\")_++;else if(M[_]===j[0])b++;else if(M[_]===j[1]&&(b--,b<0))return _;return-1}function L(M){M&&M.sanitize&&!M.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 de={escape:X,unescape:se,edit:Me,cleanUrl:De,resolveUrl:x,noopTest:K,merge:G,splitCells:C,rtrim:E,findClosingBracket:J,checkSanitizeDeprecation:L},w=O.defaults,g=de.rtrim,te=de.splitCells,Oe=de.escape,_e=de.findClosingBracket;function $e(M,j,I){var b=j.href,_=j.title?Oe(j.title):null,S=M[1].replace(/\\([\[\]])/g,"$1");return M[0].charAt(0)!=="!"?{type:"link",raw:I,href:b,title:_,text:S}:{type:"image",raw:I,href:b,title:_,text:Oe(S)}}function Qe(M,j){var I=M.match(/^(\s+)(?:```)/);if(I===null)return j;var b=I[1];return j.split(`
`).map(function(_){var S=_.match(/^\s+/);if(S===null)return _;var P=S[0];return P.length>=b.length?_.slice(b.length):_}).join(`
`)}var Te=function(){function M(I){this.options=I||w}var j=M.prototype;return j.space=function(b){var _=this.rules.block.newline.exec(b);if(_)return _[0].length>1?{type:"space",raw:_[0]}:{raw:`
`}},j.code=function(b,_){var S=this.rules.block.code.exec(b);if(S){var P=_[_.length-1];if(P&&P.type==="paragraph")return{raw:S[0],text:S[0].trimRight()};var re=S[0].replace(/^ {4}/gm,"");return{type:"code",raw:S[0],codeBlockStyle:"indented",text:this.options.pedantic?re:g(re,`
`)}}},j.fences=function(b){var _=this.rules.block.fences.exec(b);if(_){var S=_[0],P=Qe(S,_[3]||"");return{type:"code",raw:S,lang:_[2]?_[2].trim():_[2],text:P}}},j.heading=function(b){var _=this.rules.block.heading.exec(b);if(_)return{type:"heading",raw:_[0],depth:_[1].length,text:_[2]}},j.nptable=function(b){var _=this.rules.block.nptable.exec(b);if(_){var S={type:"table",header:te(_[1].replace(/^ *| *\| *$/g,"")),align:_[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:_[3]?_[3].replace(/\n$/,"").split(`
`):[],raw:_[0]};if(S.header.length===S.align.length){var P=S.align.length,re;for(re=0;re<P;re++)/^ *-+: *$/.test(S.align[re])?S.align[re]="right":/^ *:-+: *$/.test(S.align[re])?S.align[re]="center":/^ *:-+ *$/.test(S.align[re])?S.align[re]="left":S.align[re]=null;for(P=S.cells.length,re=0;re<P;re++)S.cells[re]=te(S.cells[re],S.header.length);return S}}},j.hr=function(b){var _=this.rules.block.hr.exec(b);if(_)return{type:"hr",raw:_[0]}},j.blockquote=function(b){var _=this.rules.block.blockquote.exec(b);if(_){var S=_[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:_[0],text:S}}},j.list=function(b){var _=this.rules.block.list.exec(b);if(_){for(var S=_[0],P=_[2],re=P.length>1,pe=P[P.length-1]===")",Ce={type:"list",raw:S,ordered:re,start:re?+P.slice(0,-1):"",loose:!1,items:[]},Ct=_[0].match(this.rules.block.item),At=!1,xe,rt,mt,Xe,Dt,kt,Ft,Pt=Ct.length,ct=0;ct<Pt;ct++)xe=Ct[ct],S=xe,rt=xe.length,xe=xe.replace(/^ *([*+-]|\d+[.)]) */,""),~xe.indexOf(`
`)&&(rt-=xe.length,xe=this.options.pedantic?xe.replace(/^ {1,4}/gm,""):xe.replace(new RegExp("^ {1,"+rt+"}","gm"),"")),ct!==Pt-1&&(mt=this.rules.block.bullet.exec(Ct[ct+1])[0],(re?mt.length===1||!pe&&mt[mt.length-1]===")":mt.length>1||this.options.smartLists&&mt!==P)&&(Xe=Ct.slice(ct+1).join(`
`),Ce.raw=Ce.raw.substring(0,Ce.raw.length-Xe.length),ct=Pt-1)),Dt=At||/\n\n(?!\s*$)/.test(xe),ct!==Pt-1&&(At=xe.charAt(xe.length-1)===`
`,Dt||(Dt=At)),Dt&&(Ce.loose=!0),kt=/^\[[ xX]\] /.test(xe),Ft=void 0,kt&&(Ft=xe[1]!==" ",xe=xe.replace(/^\[[ xX]\] +/,"")),Ce.items.push({type:"list_item",raw:S,task:kt,checked:Ft,loose:Dt,text:xe});return Ce}},j.html=function(b){var _=this.rules.block.html.exec(b);if(_)return{type:this.options.sanitize?"paragraph":"html",raw:_[0],pre:!this.options.sanitizer&&(_[1]==="pre"||_[1]==="script"||_[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(_[0]):Oe(_[0]):_[0]}},j.def=function(b){var _=this.rules.block.def.exec(b);if(_){_[3]&&(_[3]=_[3].substring(1,_[3].length-1));var S=_[1].toLowerCase().replace(/\s+/g," ");return{tag:S,raw:_[0],href:_[2],title:_[3]}}},j.table=function(b){var _=this.rules.block.table.exec(b);if(_){var S={type:"table",header:te(_[1].replace(/^ *| *\| *$/g,"")),align:_[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:_[3]?_[3].replace(/\n$/,"").split(`
`):[]};if(S.header.length===S.align.length){S.raw=_[0];var P=S.align.length,re;for(re=0;re<P;re++)/^ *-+: *$/.test(S.align[re])?S.align[re]="right":/^ *:-+: *$/.test(S.align[re])?S.align[re]="center":/^ *:-+ *$/.test(S.align[re])?S.align[re]="left":S.align[re]=null;for(P=S.cells.length,re=0;re<P;re++)S.cells[re]=te(S.cells[re].replace(/^ *\| *| *\| *$/g,""),S.header.length);return S}}},j.lheading=function(b){var _=this.rules.block.lheading.exec(b);if(_)return{type:"heading",raw:_[0],depth:_[2].charAt(0)==="="?1:2,text:_[1]}},j.paragraph=function(b){var _=this.rules.block.paragraph.exec(b);if(_)return{type:"paragraph",raw:_[0],text:_[1].charAt(_[1].length-1)===`
`?_[1].slice(0,-1):_[1]}},j.text=function(b,_){var S=this.rules.block.text.exec(b);if(S){var P=_[_.length-1];return P&&P.type==="text"?{raw:S[0],text:S[0]}:{type:"text",raw:S[0],text:S[0]}}},j.escape=function(b){var _=this.rules.inline.escape.exec(b);if(_)return{type:"escape",raw:_[0],text:Oe(_[1])}},j.tag=function(b,_,S){var P=this.rules.inline.tag.exec(b);if(P)return!_&&/^<a /i.test(P[0])?_=!0:_&&/^<\/a>/i.test(P[0])&&(_=!1),!S&&/^<(pre|code|kbd|script)(\s|>)/i.test(P[0])?S=!0:S&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(P[0])&&(S=!1),{type:this.options.sanitize?"text":"html",raw:P[0],inLink:_,inRawBlock:S,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(P[0]):Oe(P[0]):P[0]}},j.link=function(b){var _=this.rules.inline.link.exec(b);if(_){var S=_e(_[2],"()");if(S>-1){var P=_[0].indexOf("!")===0?5:4,re=P+_[1].length+S;_[2]=_[2].substring(0,S),_[0]=_[0].substring(0,re).trim(),_[3]=""}var pe=_[2],Ce="";if(this.options.pedantic){var Ct=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(pe);Ct?(pe=Ct[1],Ce=Ct[3]):Ce=""}else Ce=_[3]?_[3].slice(1,-1):"";pe=pe.trim().replace(/^<([\s\S]*)>$/,"$1");var At=$e(_,{href:pe&&pe.replace(this.rules.inline._escapes,"$1"),title:Ce&&Ce.replace(this.rules.inline._escapes,"$1")},_[0]);return At}},j.reflink=function(b,_){var S;if((S=this.rules.inline.reflink.exec(b))||(S=this.rules.inline.nolink.exec(b))){var P=(S[2]||S[1]).replace(/\s+/g," ");if(P=_[P.toLowerCase()],!P||!P.href){var re=S[0].charAt(0);return{type:"text",raw:re,text:re}}var pe=$e(S,P,S[0]);return pe}},j.strong=function(b,_,S){S===void 0&&(S="");var P=this.rules.inline.strong.start.exec(b);if(P&&(!P[1]||P[1]&&(S===""||this.rules.inline.punctuation.exec(S)))){_=_.slice(-1*b.length);var re=P[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;re.lastIndex=0;for(var pe;(P=re.exec(_))!=null;)if(pe=this.rules.inline.strong.middle.exec(_.slice(0,P.index+3)),pe)return{type:"strong",raw:b.slice(0,pe[0].length),text:b.slice(2,pe[0].length-2)}}},j.em=function(b,_,S){S===void 0&&(S="");var P=this.rules.inline.em.start.exec(b);if(P&&(!P[1]||P[1]&&(S===""||this.rules.inline.punctuation.exec(S)))){_=_.slice(-1*b.length);var re=P[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;re.lastIndex=0;for(var pe;(P=re.exec(_))!=null;)if(pe=this.rules.inline.em.middle.exec(_.slice(0,P.index+2)),pe)return{type:"em",raw:b.slice(0,pe[0].length),text:b.slice(1,pe[0].length-1)}}},j.codespan=function(b){var _=this.rules.inline.code.exec(b);if(_){var S=_[2].replace(/\n/g," "),P=/[^ ]/.test(S),re=S.startsWith(" ")&&S.endsWith(" ");return P&&re&&(S=S.substring(1,S.length-1)),S=Oe(S,!0),{type:"codespan",raw:_[0],text:S}}},j.br=function(b){var _=this.rules.inline.br.exec(b);if(_)return{type:"br",raw:_[0]}},j.del=function(b){var _=this.rules.inline.del.exec(b);if(_)return{type:"del",raw:_[0],text:_[1]}},j.autolink=function(b,_){var S=this.rules.inline.autolink.exec(b);if(S){var P,re;return S[2]==="@"?(P=Oe(this.options.mangle?_(S[1]):S[1]),re="mailto:"+P):(P=Oe(S[1]),re=P),{type:"link",raw:S[0],text:P,href:re,tokens:[{type:"text",raw:P,text:P}]}}},j.url=function(b,_){var S;if(S=this.rules.inline.url.exec(b)){var P,re;if(S[2]==="@")P=Oe(this.options.mangle?_(S[0]):S[0]),re="mailto:"+P;else{var pe;do pe=S[0],S[0]=this.rules.inline._backpedal.exec(S[0])[0];while(pe!==S[0]);P=Oe(S[0]),S[1]==="www."?re="http://"+P:re=P}return{type:"link",raw:S[0],text:P,href:re,tokens:[{type:"text",raw:P,text:P}]}}},j.inlineText=function(b,_,S){var P=this.rules.inline.text.exec(b);if(P){var re;return _?re=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(P[0]):Oe(P[0]):P[0]:re=Oe(this.options.smartypants?S(P[0]):P[0]),{type:"text",raw:P[0],text:re}}},M}(),Ee=de.noopTest,ye=de.edit,we=de.merge,ne={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:Ee,table:Ee,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ne._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ne._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ne.def=ye(ne.def).replace("label",ne._label).replace("title",ne._title).getRegex(),ne.bullet=/(?:[*+-]|\d{1,9}[.)])/,ne.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ne.item=ye(ne.item,"gm").replace(/bull/g,ne.bullet).getRegex(),ne.list=ye(ne.list).replace(/bull/g,ne.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ne.def.source+")").getRegex(),ne._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",ne._comment=/<!--(?!-?>)[\s\S]*?-->/,ne.html=ye(ne.html,"i").replace("comment",ne._comment).replace("tag",ne._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ne.paragraph=ye(ne._paragraph).replace("hr",ne.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",ne._tag).getRegex(),ne.blockquote=ye(ne.blockquote).replace("paragraph",ne.paragraph).getRegex(),ne.normal=we({},ne),ne.gfm=we({},ne.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*|$)"}),ne.gfm.nptable=ye(ne.gfm.nptable).replace("hr",ne.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",ne._tag).getRegex(),ne.gfm.table=ye(ne.gfm.table).replace("hr",ne.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",ne._tag).getRegex(),ne.pedantic=we({},ne.normal,{html:ye(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ne._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:Ee,paragraph:ye(ne.normal._paragraph).replace("hr",ne.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ne.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ee,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:Ee,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};z._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",z.punctuation=ye(z.punctuation).replace(/punctuation/g,z._punctuation).getRegex(),z._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",z._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",z.em.start=ye(z.em.start).replace(/punctuation/g,z._punctuation).getRegex(),z.em.middle=ye(z.em.middle).replace(/punctuation/g,z._punctuation).replace(/overlapSkip/g,z._overlapSkip).getRegex(),z.em.endAst=ye(z.em.endAst,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.em.endUnd=ye(z.em.endUnd,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.strong.start=ye(z.strong.start).replace(/punctuation/g,z._punctuation).getRegex(),z.strong.middle=ye(z.strong.middle).replace(/punctuation/g,z._punctuation).replace(/blockSkip/g,z._blockSkip).getRegex(),z.strong.endAst=ye(z.strong.endAst,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.strong.endUnd=ye(z.strong.endUnd,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.blockSkip=ye(z._blockSkip,"g").getRegex(),z.overlapSkip=ye(z._overlapSkip,"g").getRegex(),z._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,z._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,z._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])?)+(?![-_])/,z.autolink=ye(z.autolink).replace("scheme",z._scheme).replace("email",z._email).getRegex(),z._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,z.tag=ye(z.tag).replace("comment",ne._comment).replace("attribute",z._attribute).getRegex(),z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,z._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,z.link=ye(z.link).replace("label",z._label).replace("href",z._href).replace("title",z._title).getRegex(),z.reflink=ye(z.reflink).replace("label",z._label).getRegex(),z.reflinkSearch=ye(z.reflinkSearch,"g").replace("reflink",z.reflink).replace("nolink",z.nolink).getRegex(),z.normal=we({},z),z.pedantic=we({},z.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:ye(/^!?\[(label)\]\((.*?)\)/).replace("label",z._label).getRegex(),reflink:ye(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",z._label).getRegex()}),z.gfm=we({},z.normal,{escape:ye(z.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),z.gfm.url=ye(z.gfm.url,"i").replace("email",z.gfm._extended_email).getRegex(),z.breaks=we({},z.gfm,{br:ye(z.br).replace("{2,}","*").getRegex(),text:ye(z.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Ne={block:ne,inline:z},be=O.defaults,St=Ne.block,Ze=Ne.inline;function Ke(M){return M.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function Re(M){var j="",I,b,_=M.length;for(I=0;I<_;I++)b=M.charCodeAt(I),Math.random()>.5&&(b="x"+b.toString(16)),j+="&#"+b+";";return j}var Fe=function(){function M(I){this.tokens=[],this.tokens.links=Object.create(null),this.options=I||be,this.options.tokenizer=this.options.tokenizer||new Te,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var b={block:St.normal,inline:Ze.normal};this.options.pedantic?(b.block=St.pedantic,b.inline=Ze.pedantic):this.options.gfm&&(b.block=St.gfm,this.options.breaks?b.inline=Ze.breaks:b.inline=Ze.gfm),this.tokenizer.rules=b}M.lex=function(b,_){var S=new M(_);return S.lex(b)};var j=M.prototype;return j.lex=function(b){return b=b.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(b,this.tokens,!0),this.inline(this.tokens),this.tokens},j.blockTokens=function(b,_,S){_===void 0&&(_=[]),S===void 0&&(S=!0),b=b.replace(/^ +$/gm,"");for(var P,re,pe,Ce;b;){if(P=this.tokenizer.space(b)){b=b.substring(P.raw.length),P.type&&_.push(P);continue}if(P=this.tokenizer.code(b,_)){b=b.substring(P.raw.length),P.type?_.push(P):(Ce=_[_.length-1],Ce.raw+=`
`+P.raw,Ce.text+=`
`+P.text);continue}if(P=this.tokenizer.fences(b)){b=b.substring(P.raw.length),_.push(P);continue}if(P=this.tokenizer.heading(b)){b=b.substring(P.raw.length),_.push(P);continue}if(P=this.tokenizer.nptable(b)){b=b.substring(P.raw.length),_.push(P);continue}if(P=this.tokenizer.hr(b)){b=b.substring(P.raw.length),_.push(P);continue}if(P=this.tokenizer.blockquote(b)){b=b.substring(P.raw.length),P.tokens=this.blockTokens(P.text,[],S),_.push(P);continue}if(P=this.tokenizer.list(b)){for(b=b.substring(P.raw.length),pe=P.items.length,re=0;re<pe;re++)P.items[re].tokens=this.blockTokens(P.items[re].text,[],!1);_.push(P);continue}if(P=this.tokenizer.html(b)){b=b.substring(P.raw.length),_.push(P);continue}if(S&&(P=this.tokenizer.def(b))){b=b.substring(P.raw.length),this.tokens.links[P.tag]||(this.tokens.links[P.tag]={href:P.href,title:P.title});continue}if(P=this.tokenizer.table(b)){b=b.substring(P.raw.length),_.push(P);continue}if(P=this.tokenizer.lheading(b)){b=b.substring(P.raw.length),_.push(P);continue}if(S&&(P=this.tokenizer.paragraph(b))){b=b.substring(P.raw.length),_.push(P);continue}if(P=this.tokenizer.text(b,_)){b=b.substring(P.raw.length),P.type?_.push(P):(Ce=_[_.length-1],Ce.raw+=`
`+P.raw,Ce.text+=`
`+P.text);continue}if(b){var Ct="Infinite loop on byte: "+b.charCodeAt(0);if(this.options.silent){console.error(Ct);break}else throw new Error(Ct)}}return _},j.inline=function(b){var _,S,P,re,pe,Ce,Ct=b.length;for(_=0;_<Ct;_++){Ce=b[_];switch(Ce.type){case"paragraph":case"text":case"heading":{Ce.tokens=[],this.inlineTokens(Ce.text,Ce.tokens);break}case"table":{for(Ce.tokens={header:[],cells:[]},re=Ce.header.length,S=0;S<re;S++)Ce.tokens.header[S]=[],this.inlineTokens(Ce.header[S],Ce.tokens.header[S]);for(re=Ce.cells.length,S=0;S<re;S++)for(pe=Ce.cells[S],Ce.tokens.cells[S]=[],P=0;P<pe.length;P++)Ce.tokens.cells[S][P]=[],this.inlineTokens(pe[P],Ce.tokens.cells[S][P]);break}case"blockquote":{this.inline(Ce.tokens);break}case"list":{for(re=Ce.items.length,S=0;S<re;S++)this.inline(Ce.items[S].tokens);break}}}return b},j.inlineTokens=function(b,_,S,P,re){_===void 0&&(_=[]),S===void 0&&(S=!1),P===void 0&&(P=!1),re===void 0&&(re="");var pe,Ce=b,Ct;if(this.tokens.links){var At=Object.keys(this.tokens.links);if(At.length>0)for(;(Ct=this.tokenizer.rules.inline.reflinkSearch.exec(Ce))!=null;)At.includes(Ct[0].slice(Ct[0].lastIndexOf("[")+1,-1))&&(Ce=Ce.slice(0,Ct.index)+"["+"a".repeat(Ct[0].length-2)+"]"+Ce.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ct=this.tokenizer.rules.inline.blockSkip.exec(Ce))!=null;)Ce=Ce.slice(0,Ct.index)+"["+"a".repeat(Ct[0].length-2)+"]"+Ce.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;b;){if(pe=this.tokenizer.escape(b)){b=b.substring(pe.raw.length),_.push(pe);continue}if(pe=this.tokenizer.tag(b,S,P)){b=b.substring(pe.raw.length),S=pe.inLink,P=pe.inRawBlock,_.push(pe);continue}if(pe=this.tokenizer.link(b)){b=b.substring(pe.raw.length),pe.type==="link"&&(pe.tokens=this.inlineTokens(pe.text,[],!0,P)),_.push(pe);continue}if(pe=this.tokenizer.reflink(b,this.tokens.links)){b=b.substring(pe.raw.length),pe.type==="link"&&(pe.tokens=this.inlineTokens(pe.text,[],!0,P)),_.push(pe);continue}if(pe=this.tokenizer.strong(b,Ce,re)){b=b.substring(pe.raw.length),pe.tokens=this.inlineTokens(pe.text,[],S,P),_.push(pe);continue}if(pe=this.tokenizer.em(b,Ce,re)){b=b.substring(pe.raw.length),pe.tokens=this.inlineTokens(pe.text,[],S,P),_.push(pe);continue}if(pe=this.tokenizer.codespan(b)){b=b.substring(pe.raw.length),_.push(pe);continue}if(pe=this.tokenizer.br(b)){b=b.substring(pe.raw.length),_.push(pe);continue}if(pe=this.tokenizer.del(b)){b=b.substring(pe.raw.length),pe.tokens=this.inlineTokens(pe.text,[],S,P),_.push(pe);continue}if(pe=this.tokenizer.autolink(b,Re)){b=b.substring(pe.raw.length),_.push(pe);continue}if(!S&&(pe=this.tokenizer.url(b,Re))){b=b.substring(pe.raw.length),_.push(pe);continue}if(pe=this.tokenizer.inlineText(b,P,Ke)){b=b.substring(pe.raw.length),re=pe.raw.slice(-1),_.push(pe);continue}if(b){var xe="Infinite loop on byte: "+b.charCodeAt(0);if(this.options.silent){console.error(xe);break}else throw new Error(xe)}}return _},me(M,null,[{key:"rules",get:function(){return{block:St,inline:Ze}}}]),M}(),Ge=O.defaults,Ye=de.cleanUrl,Ve=de.escape,Be=function(){function M(I){this.options=I||Ge}var j=M.prototype;return j.code=function(b,_,S){var P=(_||"").match(/\S*/)[0];if(this.options.highlight){var re=this.options.highlight(b,P);re!=null&&re!==b&&(S=!0,b=re)}return P?'<pre><code class="'+this.options.langPrefix+Ve(P,!0)+'">'+(S?b:Ve(b,!0))+`</code></pre>
`:"<pre><code>"+(S?b:Ve(b,!0))+`</code></pre>
`},j.blockquote=function(b){return`<blockquote>
`+b+`</blockquote>
`},j.html=function(b){return b},j.heading=function(b,_,S,P){return this.options.headerIds?"<h"+_+' id="'+this.options.headerPrefix+P.slug(S)+'">'+b+"</h"+_+`>
`:"<h"+_+">"+b+"</h"+_+`>
`},j.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},j.list=function(b,_,S){var P=_?"ol":"ul",re=_&&S!==1?' start="'+S+'"':"";return"<"+P+re+`>
`+b+"</"+P+`>
`},j.listitem=function(b){return"<li>"+b+`</li>
`},j.checkbox=function(b){return"<input "+(b?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},j.paragraph=function(b){return"<p>"+b+`</p>
`},j.table=function(b,_){return _&&(_="<tbody>"+_+"</tbody>"),`<table>
<thead>
`+b+`</thead>
`+_+`</table>
`},j.tablerow=function(b){return`<tr>
`+b+`</tr>
`},j.tablecell=function(b,_){var S=_.header?"th":"td",P=_.align?"<"+S+' align="'+_.align+'">':"<"+S+">";return P+b+"</"+S+`>
`},j.strong=function(b){return"<strong>"+b+"</strong>"},j.em=function(b){return"<em>"+b+"</em>"},j.codespan=function(b){return"<code>"+b+"</code>"},j.br=function(){return this.options.xhtml?"<br/>":"<br>"},j.del=function(b){return"<del>"+b+"</del>"},j.link=function(b,_,S){if(b=Ye(this.options.sanitize,this.options.baseUrl,b),b===null)return S;var P='<a href="'+Ve(b)+'"';return _&&(P+=' title="'+_+'"'),P+=">"+S+"</a>",P},j.image=function(b,_,S){if(b=Ye(this.options.sanitize,this.options.baseUrl,b),b===null)return S;var P='<img src="'+b+'" alt="'+S+'"';return _&&(P+=' title="'+_+'"'),P+=this.options.xhtml?"/>":">",P},j.text=function(b){return b},M}(),ze=function(){function M(){}var j=M.prototype;return j.strong=function(b){return b},j.em=function(b){return b},j.codespan=function(b){return b},j.del=function(b){return b},j.html=function(b){return b},j.text=function(b){return b},j.link=function(b,_,S){return""+S},j.image=function(b,_,S){return""+S},j.br=function(){return""},M}(),Lt=function(){function M(){this.seen={}}var j=M.prototype;return j.slug=function(b){var _=b.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(_)){var S=_;do this.seen[S]++,_=S+"-"+this.seen[S];while(this.seen.hasOwnProperty(_))}return this.seen[_]=0,_},M}(),ft=O.defaults,st=de.unescape,ut=function(){function M(I){this.options=I||ft,this.options.renderer=this.options.renderer||new Be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ze,this.slugger=new Lt}M.parse=function(b,_){var S=new M(_);return S.parse(b)};var j=M.prototype;return j.parse=function(b,_){_===void 0&&(_=!0);var S="",P,re,pe,Ce,Ct,At,xe,rt,mt,Xe,Dt,kt,Ft,Pt,ct,Wt,Nt,He,dt=b.length;for(P=0;P<dt;P++){Xe=b[P];switch(Xe.type){case"space":continue;case"hr":{S+=this.renderer.hr();continue}case"heading":{S+=this.renderer.heading(this.parseInline(Xe.tokens),Xe.depth,st(this.parseInline(Xe.tokens,this.textRenderer)),this.slugger);continue}case"code":{S+=this.renderer.code(Xe.text,Xe.lang,Xe.escaped);continue}case"table":{for(rt="",xe="",Ce=Xe.header.length,re=0;re<Ce;re++)xe+=this.renderer.tablecell(this.parseInline(Xe.tokens.header[re]),{header:!0,align:Xe.align[re]});for(rt+=this.renderer.tablerow(xe),mt="",Ce=Xe.cells.length,re=0;re<Ce;re++){for(At=Xe.tokens.cells[re],xe="",Ct=At.length,pe=0;pe<Ct;pe++)xe+=this.renderer.tablecell(this.parseInline(At[pe]),{header:!1,align:Xe.align[pe]});mt+=this.renderer.tablerow(xe)}S+=this.renderer.table(rt,mt);continue}case"blockquote":{mt=this.parse(Xe.tokens),S+=this.renderer.blockquote(mt);continue}case"list":{for(Dt=Xe.ordered,kt=Xe.start,Ft=Xe.loose,Ce=Xe.items.length,mt="",re=0;re<Ce;re++)ct=Xe.items[re],Wt=ct.checked,Nt=ct.task,Pt="",ct.task&&(He=this.renderer.checkbox(Wt),Ft?ct.tokens.length>0&&ct.tokens[0].type==="text"?(ct.tokens[0].text=He+" "+ct.tokens[0].text,ct.tokens[0].tokens&&ct.tokens[0].tokens.length>0&&ct.tokens[0].tokens[0].type==="text"&&(ct.tokens[0].tokens[0].text=He+" "+ct.tokens[0].tokens[0].text)):ct.tokens.unshift({type:"text",text:He}):Pt+=He),Pt+=this.parse(ct.tokens,Ft),mt+=this.renderer.listitem(Pt,Nt,Wt);S+=this.renderer.list(mt,Dt,kt);continue}case"html":{S+=this.renderer.html(Xe.text);continue}case"paragraph":{S+=this.renderer.paragraph(this.parseInline(Xe.tokens));continue}case"text":{for(mt=Xe.tokens?this.parseInline(Xe.tokens):Xe.text;P+1<dt&&b[P+1].type==="text";)Xe=b[++P],mt+=`
`+(Xe.tokens?this.parseInline(Xe.tokens):Xe.text);S+=_?this.renderer.paragraph(mt):mt;continue}default:{var gt='Token with "'+Xe.type+'" type was not found.';if(this.options.silent){console.error(gt);return}else throw new Error(gt)}}}return S},j.parseInline=function(b,_){_=_||this.renderer;var S="",P,re,pe=b.length;for(P=0;P<pe;P++){re=b[P];switch(re.type){case"escape":{S+=_.text(re.text);break}case"html":{S+=_.html(re.text);break}case"link":{S+=_.link(re.href,re.title,this.parseInline(re.tokens,_));break}case"image":{S+=_.image(re.href,re.title,re.text);break}case"strong":{S+=_.strong(this.parseInline(re.tokens,_));break}case"em":{S+=_.em(this.parseInline(re.tokens,_));break}case"codespan":{S+=_.codespan(re.text);break}case"br":{S+=_.br();break}case"del":{S+=_.del(this.parseInline(re.tokens,_));break}case"text":{S+=_.text(re.text);break}default:{var Ce='Token with "'+re.type+'" type was not found.';if(this.options.silent){console.error(Ce);return}else throw new Error(Ce)}}}return S},M}(),xt=de.merge,bt=de.checkSanitizeDeprecation,pt=de.escape,Se=O.getDefaults,Rt=O.changeDefaults,ht=O.defaults;function ke(M,j,I){if(typeof M=="undefined"||M===null)throw new Error("marked(): input parameter is undefined or null");if(typeof M!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(M)+", string expected");if(typeof j=="function"&&(I=j,j=null),j=xt({},ke.defaults,j||{}),bt(j),I){var b=j.highlight,_;try{_=Fe.lex(M,j)}catch(pe){return I(pe)}var S=function(Ce){var Ct;if(!Ce)try{Ct=ut.parse(_,j)}catch(At){Ce=At}return j.highlight=b,Ce?I(Ce):I(null,Ct)};if(!b||b.length<3)return S();if(delete j.highlight,!_.length)return S();var P=0;ke.walkTokens(_,function(pe){pe.type==="code"&&(P++,setTimeout(function(){b(pe.text,pe.lang,function(Ce,Ct){if(Ce)return S(Ce);Ct!=null&&Ct!==pe.text&&(pe.text=Ct,pe.escaped=!0),P--,P===0&&S()})},0))}),P===0&&S();return}try{var re=Fe.lex(M,j);return j.walkTokens&&ke.walkTokens(re,j.walkTokens),ut.parse(re,j)}catch(pe){if(pe.message+=`
Please report this to https://github.com/markedjs/marked.`,j.silent)return"<p>An error occurred:</p><pre>"+pt(pe.message+"",!0)+"</pre>";throw pe}}ke.options=ke.setOptions=function(M){return xt(ke.defaults,M),Rt(ke.defaults),ke},ke.getDefaults=Se,ke.defaults=ht,ke.use=function(M){var j=xt({},M);if(M.renderer&&function(){var b=ke.defaults.renderer||new Be,_=function(re){var pe=b[re];b[re]=function(){for(var Ce=arguments.length,Ct=new Array(Ce),At=0;At<Ce;At++)Ct[At]=arguments[At];var xe=M.renderer[re].apply(b,Ct);return xe===!1&&(xe=pe.apply(b,Ct)),xe}};for(var S in M.renderer)_(S);j.renderer=b}(),M.tokenizer&&function(){var b=ke.defaults.tokenizer||new Te,_=function(re){var pe=b[re];b[re]=function(){for(var Ce=arguments.length,Ct=new Array(Ce),At=0;At<Ce;At++)Ct[At]=arguments[At];var xe=M.tokenizer[re].apply(b,Ct);return xe===!1&&(xe=pe.apply(b,Ct)),xe}};for(var S in M.tokenizer)_(S);j.tokenizer=b}(),M.walkTokens){var I=ke.defaults.walkTokens;j.walkTokens=function(b){M.walkTokens(b),I&&I(b)}}ke.setOptions(j)},ke.walkTokens=function(M,j){for(var I=ue(M),b;!(b=I()).done;){var _=b.value;j(_);switch(_.type){case"table":{for(var S=ue(_.tokens.header),P;!(P=S()).done;){var re=P.value;ke.walkTokens(re,j)}for(var pe=ue(_.tokens.cells),Ce;!(Ce=pe()).done;)for(var Ct=Ce.value,At=ue(Ct),xe;!(xe=At()).done;){var rt=xe.value;ke.walkTokens(rt,j)}break}case"list":{ke.walkTokens(_.items,j);break}default:_.tokens&&ke.walkTokens(_.tokens,j)}}},ke.Parser=ut,ke.parser=ut.parse,ke.Renderer=Be,ke.TextRenderer=ze,ke.Lexer=Fe,ke.lexer=Fe.lex,ke.Tokenizer=Te,ke.Slugger=Lt,ke.parse=ke;var Ae=ke;return Ae})},ELLl:function(it,qe,y){(function(B){B(y("VrN/"))})(function(B){var me={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},Z=B.Pos;B.defineOption("autoCloseBrackets",!1,function(F,H,X){X&&X!=B.Init&&(F.removeKeyMap(ue),F.state.closeBrackets=null),H&&(ee(fe(H,"pairs")),F.state.closeBrackets=H,F.addKeyMap(ue))});function fe(F,H){return H=="pairs"&&typeof F=="string"?F:typeof F=="object"&&F[H]!=null?F[H]:me[H]}var ue={Backspace:A,Enter:U};function ee(F){for(var H=0;H<F.length;H++){var X=F.charAt(H),oe="'"+X+"'";ue[oe]||(ue[oe]=O(X))}}ee(me.pairs+"`");function O(F){return function(H){return R(H,F)}}function N(F){var H=F.state.closeBrackets;if(!H||H.override)return H;var X=F.getModeAt(F.getCursor());return X.closeBrackets||H}function A(F){var H=N(F);if(!H||F.getOption("disableInput"))return B.Pass;for(var X=fe(H,"pairs"),oe=F.listSelections(),se=0;se<oe.length;se++){if(!oe[se].empty())return B.Pass;var Le=q(F,oe[se].head);if(!Le||X.indexOf(Le)%2!=0)return B.Pass}for(var se=oe.length-1;se>=0;se--){var Me=oe[se].head;F.replaceRange("",Z(Me.line,Me.ch-1),Z(Me.line,Me.ch+1),"+delete")}}function U(F){var H=N(F),X=H&&fe(H,"explode");if(!X||F.getOption("disableInput"))return B.Pass;for(var oe=F.listSelections(),se=0;se<oe.length;se++){if(!oe[se].empty())return B.Pass;var Le=q(F,oe[se].head);if(!Le||X.indexOf(Le)%2!=0)return B.Pass}F.operation(function(){var Me=F.lineSeparator()||`
`;F.replaceSelection(Me+Me,null),F.execCommand("goCharLeft"),oe=F.listSelections();for(var le=0;le<oe.length;le++){var ve=oe[le].head.line;F.indentLine(ve,null,!0),F.indentLine(ve+1,null,!0)}})}function k(F){var H=B.cmpPos(F.anchor,F.head)>0;return{anchor:new Z(F.anchor.line,F.anchor.ch+(H?-1:1)),head:new Z(F.head.line,F.head.ch+(H?1:-1))}}function R(F,H){var X=N(F);if(!X||F.getOption("disableInput"))return B.Pass;var oe=fe(X,"pairs"),se=oe.indexOf(H);if(se==-1)return B.Pass;for(var Le=fe(X,"closeBefore"),Me=fe(X,"triples"),le=oe.charAt(se+1)==H,ve=F.listSelections(),De=se%2==0,Y,m=0;m<ve.length;m++){var ge=ve[m],T=ge.head,x,K=F.getRange(T,Z(T.line,T.ch+1));if(De&&!ge.empty())x="surround";else if((le||!De)&&K==H)le&&$(F,T)?x="both":Me.indexOf(H)>=0&&F.getRange(T,Z(T.line,T.ch+3))==H+H+H?x="skipThree":x="skip";else if(le&&T.ch>1&&Me.indexOf(H)>=0&&F.getRange(Z(T.line,T.ch-2),T)==H+H){if(T.ch>2&&/\bstring/.test(F.getTokenTypeAt(Z(T.line,T.ch-2))))return B.Pass;x="addFour"}else if(le){var G=T.ch==0?" ":F.getRange(Z(T.line,T.ch-1),T);if(!B.isWordChar(K)&&G!=H&&!B.isWordChar(G))x="both";else return B.Pass}else if(De&&(K.length===0||/\s/.test(K)||Le.indexOf(K)>-1))x="both";else return B.Pass;if(!Y)Y=x;else if(Y!=x)return B.Pass}var C=se%2?oe.charAt(se-1):H,E=se%2?H:oe.charAt(se+1);F.operation(function(){if(Y=="skip")F.execCommand("goCharRight");else if(Y=="skipThree")for(var J=0;J<3;J++)F.execCommand("goCharRight");else if(Y=="surround"){for(var L=F.getSelections(),J=0;J<L.length;J++)L[J]=C+L[J]+E;F.replaceSelections(L,"around"),L=F.listSelections().slice();for(var J=0;J<L.length;J++)L[J]=k(L[J]);F.setSelections(L)}else Y=="both"?(F.replaceSelection(C+E,null),F.triggerElectric(C+E),F.execCommand("goCharLeft")):Y=="addFour"&&(F.replaceSelection(C+C+C+C,"before"),F.execCommand("goCharRight"))})}function q(F,H){var X=F.getRange(Z(H.line,H.ch-1),Z(H.line,H.ch+1));return X.length==2?X:null}function $(F,H){var X=F.getTokenAt(Z(H.line,H.ch+1));return/\bstring/.test(X.type)&&X.start==H.ch&&(H.ch==0||!/\bstring/.test(F.getTokenTypeAt(H)))}})},FIWC:function(it,qe,y){it.exports={flex_box_center:"flex_box_center___gdHkq",flex_space_between:"flex_space_between___lk_Gv",flex_box_vertical_center:"flex_box_vertical_center___2WNVo",flex_box_center_end:"flex_box_center_end___13O11",flex_box_column:"flex_box_column___kMb8L",wrap:"wrap___1y6rg",crumbs:"crumbs___1vKDo"}},Gytx:function(it,qe){it.exports=function(B,me,Z,fe){var ue=Z?Z.call(fe,B,me):void 0;if(ue!==void 0)return!!ue;if(B===me)return!0;if(typeof B!="object"||!B||typeof me!="object"||!me)return!1;var ee=Object.keys(B),O=Object.keys(me);if(ee.length!==O.length)return!1;for(var N=Object.prototype.hasOwnProperty.bind(me),A=0;A<ee.length;A++){var U=ee[A];if(!N(U))return!1;var k=B[U],R=me[U];if(ue=Z?Z.call(fe,k,R,U):void 0,ue===!1||ue===void 0&&k!==R)return!1}return!0}},H38U:function(it,qe,y){var B=y("f4xo"),me=y("rcnY"),Z=y("wU8J"),fe=y("Iq15"),ue=y("dWSS");function ee(N,A){this.typeNumber=N,this.errorCorrectLevel=A,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var O=ee.prototype;O.addData=function(N){var A=new B(N);this.dataList.push(A),this.dataCache=null},O.isDark=function(N,A){if(N<0||this.moduleCount<=N||A<0||this.moduleCount<=A)throw new Error(N+","+A);return this.modules[N][A]},O.getModuleCount=function(){return this.moduleCount},O.make=function(){if(this.typeNumber<1){var N=1;for(N=1;N<40;N++){for(var A=me.getRSBlocks(N,this.errorCorrectLevel),U=new Z,k=0,R=0;R<A.length;R++)k+=A[R].dataCount;for(var R=0;R<this.dataList.length;R++){var q=this.dataList[R];U.put(q.mode,4),U.put(q.getLength(),fe.getLengthInBits(q.mode,N)),q.write(U)}if(U.getLengthInBits()<=k*8)break}this.typeNumber=N}this.makeImpl(!1,this.getBestMaskPattern())},O.makeImpl=function(N,A){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var U=0;U<this.moduleCount;U++){this.modules[U]=new Array(this.moduleCount);for(var k=0;k<this.moduleCount;k++)this.modules[U][k]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(N,A),this.typeNumber>=7&&this.setupTypeNumber(N),this.dataCache==null&&(this.dataCache=ee.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,A)},O.setupPositionProbePattern=function(N,A){for(var U=-1;U<=7;U++){if(N+U<=-1||this.moduleCount<=N+U)continue;for(var k=-1;k<=7;k++){if(A+k<=-1||this.moduleCount<=A+k)continue;0<=U&&U<=6&&(k==0||k==6)||0<=k&&k<=6&&(U==0||U==6)||2<=U&&U<=4&&2<=k&&k<=4?this.modules[N+U][A+k]=!0:this.modules[N+U][A+k]=!1}}},O.getBestMaskPattern=function(){for(var N=0,A=0,U=0;U<8;U++){this.makeImpl(!0,U);var k=fe.getLostPoint(this);(U==0||N>k)&&(N=k,A=U)}return A},O.createMovieClip=function(N,A,U){var k=N.createEmptyMovieClip(A,U),R=1;this.make();for(var q=0;q<this.modules.length;q++)for(var $=q*R,F=0;F<this.modules[q].length;F++){var H=F*R,X=this.modules[q][F];X&&(k.beginFill(0,100),k.moveTo(H,$),k.lineTo(H+R,$),k.lineTo(H+R,$+R),k.lineTo(H,$+R),k.endFill())}return k},O.setupTimingPattern=function(){for(var N=8;N<this.moduleCount-8;N++){if(this.modules[N][6]!=null)continue;this.modules[N][6]=N%2==0}for(var A=8;A<this.moduleCount-8;A++){if(this.modules[6][A]!=null)continue;this.modules[6][A]=A%2==0}},O.setupPositionAdjustPattern=function(){for(var N=fe.getPatternPosition(this.typeNumber),A=0;A<N.length;A++)for(var U=0;U<N.length;U++){var k=N[A],R=N[U];if(this.modules[k][R]!=null)continue;for(var q=-2;q<=2;q++)for(var $=-2;$<=2;$++)q==-2||q==2||$==-2||$==2||q==0&&$==0?this.modules[k+q][R+$]=!0:this.modules[k+q][R+$]=!1}},O.setupTypeNumber=function(N){for(var A=fe.getBCHTypeNumber(this.typeNumber),U=0;U<18;U++){var k=!N&&(A>>U&1)==1;this.modules[Math.floor(U/3)][U%3+this.moduleCount-8-3]=k}for(var U=0;U<18;U++){var k=!N&&(A>>U&1)==1;this.modules[U%3+this.moduleCount-8-3][Math.floor(U/3)]=k}},O.setupTypeInfo=function(N,A){for(var U=this.errorCorrectLevel<<3|A,k=fe.getBCHTypeInfo(U),R=0;R<15;R++){var q=!N&&(k>>R&1)==1;R<6?this.modules[R][8]=q:R<8?this.modules[R+1][8]=q:this.modules[this.moduleCount-15+R][8]=q}for(var R=0;R<15;R++){var q=!N&&(k>>R&1)==1;R<8?this.modules[8][this.moduleCount-R-1]=q:R<9?this.modules[8][15-R-1+1]=q:this.modules[8][15-R-1]=q}this.modules[this.moduleCount-8][8]=!N},O.mapData=function(N,A){for(var U=-1,k=this.moduleCount-1,R=7,q=0,$=this.moduleCount-1;$>0;$-=2)for($==6&&$--;;){for(var F=0;F<2;F++)if(this.modules[k][$-F]==null){var H=!1;q<N.length&&(H=(N[q]>>>R&1)==1);var X=fe.getMask(A,k,$-F);X&&(H=!H),this.modules[k][$-F]=H,R--,R==-1&&(q++,R=7)}if(k+=U,k<0||this.moduleCount<=k){k-=U,U=-U;break}}},ee.PAD0=236,ee.PAD1=17,ee.createData=function(N,A,U){for(var k=me.getRSBlocks(N,A),R=new Z,q=0;q<U.length;q++){var $=U[q];R.put($.mode,4),R.put($.getLength(),fe.getLengthInBits($.mode,N)),$.write(R)}for(var F=0,q=0;q<k.length;q++)F+=k[q].dataCount;if(R.getLengthInBits()>F*8)throw new Error("code length overflow. ("+R.getLengthInBits()+">"+F*8+")");for(R.getLengthInBits()+4<=F*8&&R.put(0,4);R.getLengthInBits()%8!=0;)R.putBit(!1);for(;!(R.getLengthInBits()>=F*8);){if(R.put(ee.PAD0,8),R.getLengthInBits()>=F*8)break;R.put(ee.PAD1,8)}return ee.createBytes(R,k)},ee.createBytes=function(N,A){for(var U=0,k=0,R=0,q=new Array(A.length),$=new Array(A.length),F=0;F<A.length;F++){var H=A[F].dataCount,X=A[F].totalCount-H;k=Math.max(k,H),R=Math.max(R,X),q[F]=new Array(H);for(var oe=0;oe<q[F].length;oe++)q[F][oe]=255&N.buffer[oe+U];U+=H;var se=fe.getErrorCorrectPolynomial(X),Le=new ue(q[F],se.getLength()-1),Me=Le.mod(se);$[F]=new Array(se.getLength()-1);for(var oe=0;oe<$[F].length;oe++){var le=oe+Me.getLength()-$[F].length;$[F][oe]=le>=0?Me.get(le):0}}for(var ve=0,oe=0;oe<A.length;oe++)ve+=A[oe].totalCount;for(var De=new Array(ve),Y=0,oe=0;oe<k;oe++)for(var F=0;F<A.length;F++)oe<q[F].length&&(De[Y++]=q[F][oe]);for(var oe=0;oe<R;oe++)for(var F=0;F<A.length;F++)oe<$[F].length&&(De[Y++]=$[F][oe]);return De},it.exports=ee},HmJG:function(it,qe,y){},Iq15:function(it,qe,y){var B=y("nVVt"),me=y("dWSS"),Z=y("dQei"),fe={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},ue={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(ee){for(var O=ee<<10;ue.getBCHDigit(O)-ue.getBCHDigit(ue.G15)>=0;)O^=ue.G15<<ue.getBCHDigit(O)-ue.getBCHDigit(ue.G15);return(ee<<10|O)^ue.G15_MASK},getBCHTypeNumber:function(ee){for(var O=ee<<12;ue.getBCHDigit(O)-ue.getBCHDigit(ue.G18)>=0;)O^=ue.G18<<ue.getBCHDigit(O)-ue.getBCHDigit(ue.G18);return ee<<12|O},getBCHDigit:function(ee){for(var O=0;ee!=0;)O++,ee>>>=1;return O},getPatternPosition:function(ee){return ue.PATTERN_POSITION_TABLE[ee-1]},getMask:function(ee,O,N){switch(ee){case fe.PATTERN000:return(O+N)%2==0;case fe.PATTERN001:return O%2==0;case fe.PATTERN010:return N%3==0;case fe.PATTERN011:return(O+N)%3==0;case fe.PATTERN100:return(Math.floor(O/2)+Math.floor(N/3))%2==0;case fe.PATTERN101:return O*N%2+O*N%3==0;case fe.PATTERN110:return(O*N%2+O*N%3)%2==0;case fe.PATTERN111:return(O*N%3+(O+N)%2)%2==0;default:throw new Error("bad maskPattern:"+ee)}},getErrorCorrectPolynomial:function(ee){for(var O=new me([1],0),N=0;N<ee;N++)O=O.multiply(new me([1,Z.gexp(N)],0));return O},getLengthInBits:function(ee,O){if(1<=O&&O<10)switch(ee){case B.MODE_NUMBER:return 10;case B.MODE_ALPHA_NUM:return 9;case B.MODE_8BIT_BYTE:return 8;case B.MODE_KANJI:return 8;default:throw new Error("mode:"+ee)}else if(O<27)switch(ee){case B.MODE_NUMBER:return 12;case B.MODE_ALPHA_NUM:return 11;case B.MODE_8BIT_BYTE:return 16;case B.MODE_KANJI:return 10;default:throw new Error("mode:"+ee)}else if(O<41)switch(ee){case B.MODE_NUMBER:return 14;case B.MODE_ALPHA_NUM:return 13;case B.MODE_8BIT_BYTE:return 16;case B.MODE_KANJI:return 12;default:throw new Error("mode:"+ee)}else throw new Error("type:"+O)},getLostPoint:function(ee){for(var O=ee.getModuleCount(),N=0,A=0;A<O;A++)for(var U=0;U<O;U++){for(var k=0,R=ee.isDark(A,U),q=-1;q<=1;q++){if(A+q<0||O<=A+q)continue;for(var $=-1;$<=1;$++){if(U+$<0||O<=U+$)continue;if(q==0&&$==0)continue;R==ee.isDark(A+q,U+$)&&k++}}k>5&&(N+=3+k-5)}for(var A=0;A<O-1;A++)for(var U=0;U<O-1;U++){var F=0;ee.isDark(A,U)&&F++,ee.isDark(A+1,U)&&F++,ee.isDark(A,U+1)&&F++,ee.isDark(A+1,U+1)&&F++,(F==0||F==4)&&(N+=3)}for(var A=0;A<O;A++)for(var U=0;U<O-6;U++)ee.isDark(A,U)&&!ee.isDark(A,U+1)&&ee.isDark(A,U+2)&&ee.isDark(A,U+3)&&ee.isDark(A,U+4)&&!ee.isDark(A,U+5)&&ee.isDark(A,U+6)&&(N+=40);for(var U=0;U<O;U++)for(var A=0;A<O-6;A++)ee.isDark(A,U)&&!ee.isDark(A+1,U)&&ee.isDark(A+2,U)&&ee.isDark(A+3,U)&&ee.isDark(A+4,U)&&!ee.isDark(A+5,U)&&ee.isDark(A+6,U)&&(N+=40);for(var H=0,U=0;U<O;U++)for(var A=0;A<O;A++)ee.isDark(A,U)&&H++;var X=Math.abs(100*H/O/O-50)/5;return N+=X*10,N}};it.exports=ue},LdHM:function(it,qe,y){"use strict";y.d(qe,"b",function(){return Le}),y.d(qe,"a",function(){return le});var B=y("1OyB"),me=y("vuIU"),Z=y("Ji7U"),fe=y("LK+K"),ue=y("q1tI"),ee=y("rePB"),O=y("Ff2n"),N=y("ODXe"),A=y("4IlW"),U=y("bX4T"),k=y("YrtM"),R=y("TSYQ"),q=y.n(R),$=y("+nKL"),F=y("8OUc"),H=function(te,Oe){var _e=te.prefixCls,$e=te.id,Qe=te.flattenOptions,Te=te.childrenAsData,Ee=te.values,ye=te.searchValue,we=te.multiple,ne=te.defaultActiveFirstOption,z=te.height,Ne=te.itemHeight,be=te.notFoundContent,St=te.open,Ze=te.menuItemSelectedIcon,Ke=te.virtual,Re=te.onSelect,Fe=te.onToggleOpen,Ge=te.onActiveValue,Ye=te.onScroll,Ve=te.onMouseEnter,Be="".concat(_e,"-item"),ze=Object(k.a)(function(){return Qe},[St,Qe],function(Ae,M){return M[0]&&Ae[1]!==M[1]}),Lt=ue.useRef(null),ft=function(M){M.preventDefault()},st=function(M){Lt.current&&Lt.current.scrollTo({index:M})},ut=function(M){for(var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,I=ze.length,b=0;b<I;b+=1){var _=(M+b*j+I)%I,S=ze[_],P=S.group,re=S.data;if(!P&&!re.disabled)return _}return-1},xt=ue.useState(function(){return ut(0)}),bt=Object(N.a)(xt,2),pt=bt[0],Se=bt[1],Rt=function(M){Se(M);var j=ze[M];if(!j){Ge(null,-1);return}Ge(j.data.value,M)};ue.useEffect(function(){Rt(ne!==!1?ut(0):-1)},[ze.length,ye]),ue.useEffect(function(){var Ae=setTimeout(function(){if(!we&&St&&Ee.size===1){var M=Array.from(Ee)[0],j=ze.findIndex(function(I){var b=I.data;return b.value===M});Rt(j),st(j)}});return function(){return clearTimeout(Ae)}},[St]);var ht=function(M){M!==void 0&&Re(M,{selected:!Ee.has(M)}),we||Fe(!1)};if(ue.useImperativeHandle(Oe,function(){return{onKeyDown:function(M){var j=M.which;switch(j){case A.a.UP:case A.a.DOWN:{var I=0;if(j===A.a.UP?I=-1:j===A.a.DOWN&&(I=1),I!==0){var b=ut(pt+I,I);st(b),Rt(b)}break}case A.a.ENTER:{var _=ze[pt];_&&!_.data.disabled?ht(_.data.value):ht(void 0),St&&M.preventDefault();break}case A.a.ESC:Fe(!1)}},onKeyUp:function(){},scrollTo:function(M){st(M)}}}),ze.length===0)return ue.createElement("div",{role:"listbox",id:"".concat($e,"_list"),className:"".concat(Be,"-empty"),onMouseDown:ft},be);function ke(Ae){var M=ze[Ae];if(!M)return null;var j=M.data||{},I=j.value,b=j.label,_=j.children,S=Object(U.a)(j,!0),P=Te?_:b;return M?ue.createElement("div",Object.assign({"aria-label":typeof P=="string"?P:null},S,{key:Ae,role:"option",id:"".concat($e,"_list_").concat(Ae),"aria-selected":Ee.has(I)}),I):null}return ue.createElement(ue.Fragment,null,ue.createElement("div",{role:"listbox",id:"".concat($e,"_list"),style:{height:0,width:0,overflow:"hidden"}},ke(pt-1),ke(pt),ke(pt+1)),ue.createElement($.a,{itemKey:"key",ref:Lt,data:ze,height:z,itemHeight:Ne,fullHeight:!1,onMouseDown:ft,onScroll:Ye,virtual:Ke,onMouseEnter:Ve},function(Ae,M){var j,I=Ae.group,b=Ae.groupOption,_=Ae.data,S=_.label,P=_.key;if(I)return ue.createElement("div",{className:q()(Be,"".concat(Be,"-group"))},S!==void 0?S:P);var re=_.disabled,pe=_.value,Ce=_.title,Ct=_.children,At=_.style,xe=_.className,rt=Object(O.a)(_,["disabled","value","title","children","style","className"]),mt=Ee.has(pe),Xe="".concat(Be,"-option"),Dt=q()(Be,Xe,xe,(j={},Object(ee.a)(j,"".concat(Xe,"-grouped"),b),Object(ee.a)(j,"".concat(Xe,"-active"),pt===M&&!re),Object(ee.a)(j,"".concat(Xe,"-disabled"),re),Object(ee.a)(j,"".concat(Xe,"-selected"),mt),j)),kt=Te?Ct:S,Ft=!Ze||typeof Ze=="function"||mt;return ue.createElement("div",Object.assign({},rt,{"aria-selected":mt,className:Dt,title:Ce,onMouseMove:function(){if(pt===M||re)return;Rt(M)},onClick:function(){re||ht(pe)},style:At}),ue.createElement("div",{className:"".concat(Xe,"-content")},kt||pe),ue.isValidElement(Ze)||mt,Ft&&ue.createElement(F.a,{className:"".concat(Be,"-option-state"),customizeIcon:Ze,customizeIconProps:{isSelected:mt}},mt?"\u2713":null))}))},X=ue.forwardRef(H);X.displayName="OptionList";var oe=X,se=function(){return null};se.isSelectOption=!0;var Le=se,Me=function(){return null};Me.isSelectOptGroup=!0;var le=Me,ve=y("VTBJ"),De=y("Zm9Q");function Y(g){var te=g.key,Oe=g.props,_e=Oe.children,$e=Oe.value,Qe=Object(O.a)(Oe,["children","value"]);return Object(ve.a)({key:te,value:$e!==void 0?$e:te,children:_e},Qe)}function m(g){var te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(De.a)(g).map(function(Oe,_e){if(!ue.isValidElement(Oe)||!Oe.type)return null;var $e=Oe.type.isSelectOptGroup,Qe=Oe.key,Te=Oe.props,Ee=Te.children,ye=Object(O.a)(Te,["children"]);return te||!$e?Y(Oe):Object(ve.a)(Object(ve.a)({key:"__RC_SELECT_GRP__".concat(Qe===null?_e:Qe,"__"),label:Qe},ye),{},{options:m(Ee)})}).filter(function(Oe){return Oe})}var ge=y("2Qr1"),T=y("qNPg"),x=y("U8pU"),K=y("Kwbf"),G=y("WKfj");function C(g){var te=g.mode,Oe=g.options,_e=g.children,$e=g.backfill,Qe=g.allowClear,Te=g.placeholder,Ee=g.getInputElement,ye=g.showSearch,we=g.onSearch,ne=g.defaultOpen,z=g.autoFocus,Ne=g.labelInValue,be=g.value,St=g.inputValue,Ze=g.optionLabelProp,Ke=te==="multiple"||te==="tags",Re=ye!==void 0?ye:Ke||te==="combobox",Fe=Oe||m(_e);if(Object(K.a)(te!=="tags"||Fe.every(function(Be){return!Be.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),te==="tags"||te==="combobox"){var Ge=Fe.some(function(Be){return Be.options?Be.options.some(function(ze){return typeof("value"in ze?ze.value:ze.key)=="number"}):typeof("value"in Be?Be.value:Be.key)=="number"});Object(K.a)(!Ge,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(K.a)(te!=="combobox"||!Ze,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(K.a)(te==="combobox"||!$e,"`backfill` only works with `combobox` mode."),Object(K.a)(te==="combobox"||!Ee,"`getInputElement` only work with `combobox` mode."),Object(K.b)(te!=="combobox"||!Ee||!Qe||!Te,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),we&&!Re&&te!=="combobox"&&te!=="tags"&&Object(K.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(K.b)(!ne||z,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),be!=null){var Ye=Object(G.d)(be);Object(K.a)(!Ne||Ye.every(function(Be){return Object(x.a)(Be)==="object"&&("key"in Be||"value"in Be)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(K.a)(!Ke||Array.isArray(be),"`value` should be array when `mode` is `multiple` or `tags`")}if(_e){var Ve=null;Object(De.a)(_e).some(function(Be){if(!ue.isValidElement(Be)||!Be.type)return!1;var ze=Be.type;if(ze.isSelectOption)return!1;if(ze.isSelectOptGroup){var Lt=Object(De.a)(Be.props.children).every(function(ft){return!ue.isValidElement(ft)||!Be.type||ft.type.isSelectOption?!0:(Ve=ft.type,!1)});return!Lt}return Ve=ze,!0}),Ve&&Object(K.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ve.displayName||Ve.name||Ve,"`.")),Object(K.a)(St===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var E=C,J=Object(T.a)({prefixCls:"rc-select",components:{optionList:oe},convertChildrenToData:m,flattenOptions:ge.d,getLabeledValue:ge.e,filterOptions:ge.b,isValueDisabled:ge.g,findValueOption:ge.c,warningProps:E,fillOptionsWithMissingValue:ge.a}),L=function(g){Object(Z.a)(Oe,g);var te=Object(fe.a)(Oe);function Oe(){var _e;return Object(B.a)(this,Oe),_e=te.apply(this,arguments),_e.selectRef=ue.createRef(),_e.focus=function(){_e.selectRef.current.focus()},_e.blur=function(){_e.selectRef.current.blur()},_e}return Object(me.a)(Oe,[{key:"render",value:function(){return ue.createElement(J,Object.assign({ref:this.selectRef},this.props))}}]),Oe}(ue.Component);L.Option=Le,L.OptGroup=le;var de=L,w=qe.c=de},M8RZ:function(it,qe,y){"use strict";y.d(qe,"a",function(){return A});var B=y("fWQN"),me=y("mtLc"),Z=y("yKVA"),fe=y("879j"),ue=y("q1tI"),ee=y.n(ue),O=y("i8i4"),N=y.n(O),A=function(U){Object(Z.a)(R,U);var k=Object(fe.a)(R);function R(q){var $;Object(B.a)(this,R),$=k.call(this,q);var F=window.document;return $.node=F.createElement("div"),F.body.appendChild($.node),$}return Object(me.a)(R,[{key:"render",value:function(){var $=this.props.children;return Object(O.createPortal)($,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),R}(ee.a.Component)},O2Wb:function(it,qe,y){it.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OLES:function(it,qe,y){"use strict";var B=y("U8pU"),me=y("VTBJ"),Z=y("Ff2n"),fe=y("q1tI"),ue=y("uciX"),ee=y("7ixt"),O=function(q){var $=q.overlay,F=q.prefixCls,H=q.id,X=q.overlayInnerStyle;return fe.createElement("div",{className:"".concat(F,"-inner"),id:H,role:"tooltip",style:X},typeof $=="function"?$():$)},N=O,A=function(q,$){var F=q.overlayClassName,H=q.trigger,X=H===void 0?["hover"]:H,oe=q.mouseEnterDelay,se=oe===void 0?0:oe,Le=q.mouseLeaveDelay,Me=Le===void 0?.1:Le,le=q.overlayStyle,ve=q.prefixCls,De=ve===void 0?"rc-tooltip":ve,Y=q.children,m=q.onVisibleChange,ge=q.afterVisibleChange,T=q.transitionName,x=q.animation,K=q.placement,G=K===void 0?"right":K,C=q.align,E=C===void 0?{}:C,J=q.destroyTooltipOnHide,L=J===void 0?!1:J,de=q.defaultVisible,w=q.getTooltipContainer,g=q.overlayInnerStyle,te=Object(Z.a)(q,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Oe=Object(fe.useRef)(null);Object(fe.useImperativeHandle)($,function(){return Oe.current});var _e=Object(me.a)({},te);"visible"in q&&(_e.popupVisible=q.visible);var $e=function(){var we=q.arrowContent,ne=we===void 0?null:we,z=q.overlay,Ne=q.id;return[fe.createElement("div",{className:"".concat(De,"-arrow"),key:"arrow"},ne),fe.createElement(N,{key:"content",prefixCls:De,id:Ne,overlay:z,overlayInnerStyle:g})]},Qe=!1,Te=!1;if(typeof L=="boolean")Qe=L;else if(L&&Object(B.a)(L)==="object"){var Ee=L.keepParent;Qe=Ee===!0,Te=Ee===!1}return fe.createElement(ue.a,Object.assign({popupClassName:F,prefixCls:De,popup:$e,action:X,builtinPlacements:ee.a,popupPlacement:G,ref:Oe,popupAlign:E,getPopupContainer:w,onPopupVisibleChange:m,afterPopupVisibleChange:ge,popupTransitionName:T,popupAnimation:x,defaultPopupVisible:de,destroyPopupOnHide:Qe,autoDestroy:Te,mouseLeaveDelay:Me,popupStyle:le,mouseEnterDelay:se},_e),Y)},U=Object(fe.forwardRef)(A),k=qe.a=U},Ot1p:function(it,qe,y){"use strict";var B=y("2qtc"),me=y("kLXV"),Z=y("rAM+"),fe=y("miYZ"),ue=y("tsqr"),ee=y("9og8"),O=y("tJVT"),N=y("jrin"),A=y("WmNS"),U=y.n(A),k=y("q1tI"),R=y.n(k),q=y("VrN/"),$=y.n(q),F=y("bdgK"),H=y("p77/"),X=y("Bd2K"),oe=y("ELLl"),se=y("19Vz"),Le=y("lZu9"),Me=y("+NIl"),le=y("kSUc"),ve=y("9Bee"),De=function(xe){var rt=xe.value,mt=rt===void 0?"":rt,Xe=xe.className,Dt=xe.showTextOnly,kt=xe.showLines,Ft=xe.style,Pt=Ft===void 0?{}:Ft,ct=Object(k.useMemo)(function(){return""},[mt]);return R.a.createElement(R.a.Fragment,null,R.a.createElement("div",{dangerouslySetInnerHTML:{__html:ct}}))},Y=y("Q9mQ"),m=y("diRs"),ge=y("0Owb"),T=y("dejd"),x=y("C+DQ"),K=y("D1Df"),G=y.n(K),C=y("1vsH"),E=y("m3rI"),J=[{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 L(xe){var rt=xe.onActionCallback,mt=xe.title,Xe=xe.icon,Dt=xe.actionName,kt=xe.className,Ft=kt===void 0?"":kt,Pt=xe.children;function ct(){rt(Dt)}return R.a.createElement("a",{title:mt,className:Ft,onClick:ct},R.a.createElement("i",{className:"md-iconfont ".concat(Xe)}),Pt)}var de=function(xe){var rt=xe.watch,mt=xe.showNullButton,Xe=xe.onActionCallback,Dt=xe.fullScreen,kt=xe.insertTemp,Ft=xe.hidetoolBar,Pt=xe.uuid,ct=xe.setOpenPhones,Wt=Object(C.E)("_educoder_session_login"),Nt=Object(C.E)("_educoder_session"),He=[].concat(J,[{title:"".concat(rt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(rt?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return R.a.createElement("ul",{className:"markdown-toolbar-container"},!Ft&&He.map(function(dt,gt){return R.a.createElement("li",{key:gt},dt.actionName?R.a.createElement(L,Object(ge.a)({},dt,{onActionCallback:Xe})):R.a.createElement("span",{className:"v-line"}))}),mt?R.a.createElement("li",null,R.a.createElement(L,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Xe},R.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,kt&&R.a.createElement("li",null,R.a.createElement(L,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(kt),onActionCallback:Xe},R.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),R.a.createElement("li",null,R.a.createElement(m.a,{title:"\u6253\u5F00\u624B\u673A\u626B\u4E00\u626B",content:R.a.createElement("div",null,R.a.createElement("span",{style:{display:"none"}},location.origin+"/react/build/upload.html?_educoder_session_login="+Wt+"&_educoder_session="+Nt+"&key="+Pt+"&api="+encodeURIComponent(E.a.API_SERVER)),R.a.createElement(G.a,{size:150,fgColor:"#000",value:location.origin+"/react/build/upload.html?_educoder_session_login="+Wt+"&_educoder_session="+Nt+"&key="+Pt+"&api="+encodeURIComponent(E.a.API_SERVER)}))},R.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return ct(!0)}},"\u624B\u673A\u4E0A\u4F20\u6587\u4EF6"))),R.a.createElement("li",{className:"btn-full-screen"},R.a.createElement(L,{icon:"".concat(Dt?"icon-shrink":"icon-enlarge"),title:Dt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Xe})))},w=y("M8RZ"),g=y("+L6B"),te=y("2/Rp"),Oe=y("y8nQ"),_e=y("Vl3Y"),$e=y("5NDa"),Qe=y("5rEg"),Te={labelCol:{span:4},wrapperCol:{span:20}},Ee=function(xe){var rt=xe.callback,mt=xe.onCancel;function Xe(Dt){rt(Dt)}return R.a.createElement(_e.a,Object(ge.a)({},Te,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Xe}),R.a.createElement(_e.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},R.a.createElement(Qe.a,null)),R.a.createElement(_e.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},R.a.createElement(Qe.a,null)),R.a.createElement("div",{className:"flex-container flex-end"},R.a.createElement(te.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),R.a.createElement(te.a,{type:"ghost",onClick:mt},"\u53D6\u6D88")))},ye=y("7ahc"),we=y("k1fw"),ne=y("HmJG"),z=y("BjJ7"),Ne=_e.a.useForm,be={width:280,marginRight:10},St={labelCol:{span:5},wrapperCol:{span:19}},Ze=function(xe){var rt=xe.callback,mt=xe.onCancel,Xe=Ne(),Dt=Object(O.a)(Xe,1),kt=Dt[0],Ft=Object(k.useRef)();function Pt(Nt){rt(Object(we.a)(Object(we.a)({},Nt),{},{name:Ft.current}))}function ct(Nt,He){kt.setFieldsValue({src:"/api/attachments/".concat(Nt.id,"?type=").concat(Nt.content_type),type:He.type})}function Wt(Nt){var He=Nt.target.files[0];Ft.current=He.name,Re(He,ct)}return R.a.createElement(_e.a,Object(ge.a)({form:kt},St,{className:"upload-image-panel",onFinish:Pt}),R.a.createElement(_e.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},R.a.createElement("div",{className:"flex-container"},R.a.createElement(_e.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},R.a.createElement(Qe.a,{style:be})),R.a.createElement(Ke,{onFileChange:Wt}))),R.a.createElement(_e.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},R.a.createElement(Qe.a,{style:{width:264}})),R.a.createElement(_e.a.Item,{style:{textAlign:"right"}},R.a.createElement(te.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),R.a.createElement(te.a,{type:"ghost",onClick:mt},"\u53D6\u6D88")))};function Ke(xe){var rt=xe.onFileChange;return R.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",R.a.createElement("input",{type:"file",onChange:rt}))}function Re(xe,rt){if(!xe)throw new String("\u6CA1\u6709\u6587\u4EF6");var mt=new FormData;mt.append("editormd-image-file",xe),mt.append("file_param_name","editormd-image-file"),mt.append("byxhr","true");var Xe=new window.XMLHttpRequest;Xe.withCredentials=!0,Xe.addEventListener("load",function(Dt){rt(JSON.parse(Dt.target.responseText),xe)},!1),Xe.addEventListener("error",function(Dt){console.error(Dt)},!1),Xe.open("POST","".concat(z.a,"/api/attachments.json")),Xe.send(mt)}var Fe=y("giR+"),Ge=y("fyUT"),Ye=y("7Kak"),Ve=y("9yH6"),Be=Ve.a.Group,ze={margin:"0 8px"},Lt=function(xe){var rt=xe.callback,mt=xe.onCancel;function Xe(Dt){rt(Dt)}return R.a.createElement(_e.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Xe},R.a.createElement("div",{className:"flex-container"},R.a.createElement("span",{style:ze},"\u5355\u5143\u683C\u6570\uFF1A"),R.a.createElement("span",{style:ze},"\u884C\u6570"),R.a.createElement(_e.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},R.a.createElement(Ge.a,null)),R.a.createElement("span",{style:ze},"\u5217\u6570"),R.a.createElement(_e.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},R.a.createElement(Ge.a,null))),R.a.createElement("div",{className:"flex-container",style:{marginTop:12}},R.a.createElement("span",{style:ze},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),R.a.createElement(_e.a.Item,{name:"align"},R.a.createElement(Be,null,R.a.createElement(Ve.a,{value:"default"},R.a.createElement("i",{className:"fa fa-align-justify"})),R.a.createElement(Ve.a,{value:"left"},R.a.createElement("i",{className:"fa fa-align-left"})),R.a.createElement(Ve.a,{value:"center"},R.a.createElement("i",{className:"fa fa-align-center"})),R.a.createElement(Ve.a,{value:"right"},R.a.createElement("i",{className:"fa fa-align-right"}))))),R.a.createElement("div",{className:"flex-container flex-end"},R.a.createElement(te.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),R.a.createElement(te.a,{type:"ghost",onClick:mt},"\u53D6\u6D88")))},ft=y("ErOA"),st=y("7Cbv"),ut="link",xt="upload-image",bt="code-block",pt="add-table",Se="------------",Rt={default:Se,left:":".concat(Se),center:":".concat(Se,":"),right:"".concat(Se,":")},ht=y("9VGf"),ke,Ae;function M(){}var j=0,I=1e4,b="\u2581",_=`
**\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 S(xe){return/^\d+$/.test(xe)?"".concat(xe,"px"):xe}var P=navigator.platform.toUpperCase().indexOf("MAC")>=0,re=P?"Cmd":"Ctrl",pe=["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"],Ce=(ke={},Object(N.a)(ke,re+"-B","bold"),Object(N.a)(ke,re+"-I","italic"),ke),Ct=(Ae={},Object(N.a)(Ae,ut,"\u6DFB\u52A0\u94FE\u63A5"),Object(N.a)(Ae,bt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(N.a)(Ae,xt,"\u6DFB\u52A0\u6587\u4EF6"),Object(N.a)(Ae,pt,"\u6DFB\u52A0\u8868\u683C"),Ae),At=qe.a=function(xe){var rt=xe.defaultValue,mt=rt===void 0?"":rt,Xe=xe.onChange,Dt=xe.width,kt=Dt===void 0?"100%":Dt,Ft=xe.height,Pt=Ft===void 0?400:Ft,ct=xe.miniToolbar,Wt=ct===void 0?!1:ct,Nt=xe.isFocus,He=Nt===void 0?!1:Nt,dt=xe.watch,gt=xe.insertTemp,Et=xe.mode,Xt=Et===void 0?"markdown":Et,Gt=xe.id,tn=Gt===void 0?"markdown-editor-id":Gt,Ht=xe.showResizeBar,yt=Ht===void 0?!1:Ht,Yt=xe.noStorage,Mt=Yt===void 0?!1:Yt,qt=xe.showNullButton,It=qt===void 0?!1:qt,Cn=xe.hidetoolBar,ai=Cn===void 0?!1:Cn,ti=xe.fullScreen,je=ti===void 0?!1:ti,et=xe.onBlur,an=xe.onCMBeforeChange,hn=xe.onFullScreen,gn=xe.className,En=gn===void 0?"":gn,h=xe.disablePaste,o=h===void 0?!1:h,a=xe.placeholder,u=a===void 0?"":a,p=xe.values,c=p===void 0?"":p,V=Object(k.useState)(null),Ue=Object(O.a)(V,2),he=Ue[0],wt=Ue[1],ae=Object(k.useState)(mt),Q=Object(O.a)(ae,2),Ie=Q[0],ot=Q[1],at=Object(k.useState)(dt),lt=Object(O.a)(at,2),Ot=lt[0],Qt=lt[1],mn=Object(k.useState)(je),nn=Object(O.a)(mn,2),Zt=nn[0],wn=nn[1],Bn=Object(k.useState)(""),vn=Object(O.a)(Bn,2),Yn=vn[0],yn=vn[1],Mn=Object(k.useState)(0),pi=Object(O.a)(Mn,2),Fn=pi[0],ni=pi[1],Ni=Object(k.useState)(Pt),Ii=Object(O.a)(Ni,2),ji=Ii[0],kn=Ii[1],rn=Object(k.useState)(!1),Wn=Object(O.a)(rn,2),on=Wn[0],zn=Wn[1],fn=Object(k.useRef)(Object(st.a)()),Ei=Object(k.useRef)(!1),Pn=Object(k.useRef)(),On=Object(k.useRef)(),mi=Object(k.useRef)(),wi=Object(k.useRef)(),Si=Object(k.useRef)(),Br=function(){var Tt=Object(ee.a)(U.a.mark(function zt(){var Ut,Kt;return U.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return ln.next=2,Object(ft.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:fn.current}});case 2:Kt=ln.sent,Kt!=null&&(Ut=Kt.attachments)!==null&&Ut!==void 0&&Ut.length&&(console.log("cm:",he,On),Kt.attachments.map(function(Jt){Jt.content_type.indexOf("image")>-1?he.replaceSelection("![,](/api/attachments/".concat(Jt.id,"?type=").concat(Jt.content_type,")")):Jt.content_type.indexOf("video")>-1?he.replaceSelection('<video width="100%" controls src="'.concat(E.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Jt.content_type.indexOf("pdf")>-1?he.replaceSelection('<a href="'.concat(E.a.API_SERVER,"/api/attachments/").concat(Jt.id,"?type=").concat(Jt.content_type,'&disposition=inline" target="_blank">').concat(Jt.name,"</a>")):he.replaceSelection("[".concat(Jt.name,"](").concat(E.a.API_SERVER,"/api/attachments/").concat(Jt.id,"?type=").concat(Jt.content_type,")"))}));case 4:case"end":return ln.stop()}},zt)}));return function(){return Tt.apply(this,arguments)}}();Object(k.useEffect)(function(){ot(c),he==null||he.setValue(c)},[c]),Object(k.useEffect)(function(){hn==null||hn(Zt)},[Zt]),Object(k.useEffect)(function(){if(On.current){var Tt=$.a.fromTextArea(On.current,{mode:Xt,lineNumbers:!Wt,lineWrapping:!0,value:mt,autoCloseTags:!0,autoCloseBrackets:!0});He&&Tt.focus();function zt(Ut,Kt){if(o){Kt.preventDefault();return}var en=Kt.clipboardData;if(en){var ln=en.types.toString(),Jt=en.items;if(ln==="Files"||en.types.indexOf("Files")>-1){if(Kt.preventDefault(),Xt=="stex")return;try{var _n,Dn=Jt[1];((_n=Jt[0])===null||_n===void 0?void 0:_n.kind)==="file"&&(Dn=Jt[0]);var $t=Dn.getAsFile(),Ui=$t.name.split(".").pop();Re($t,function(un){if(un.id){var Hn,dn,ui;($t==null||((Hn=$t.type)===null||Hn===void 0)?void 0:Hn.indexOf("image"))>-1?Tt.replaceSelection("![,](/api/attachments/".concat(un.id,"?type=").concat(un.content_type,")")):($t==null||((dn=$t.type)===null||dn===void 0)?void 0:dn.indexOf("video"))>-1?Tt.replaceSelection('<video width="100%" controls src="'.concat(E.a.API_SERVER,"/api/attachments/").concat(un.id,'"></video>')):($t==null||((ui=$t.type)===null||ui===void 0)?void 0:ui.indexOf("pdf"))>-1?Tt.replaceSelection('<a href="'.concat(E.a.API_SERVER,"/api/attachments/").concat(un.id,"?type=").concat($t.type,'&disposition=inline" target="_blank">').concat($t.name,"</a>")):pe.includes(Ui)?Tt.replaceSelection('<a href="'.concat(E.a.API_SERVER,"/api/attachments/").concat(un.id,'?type=office&disposition=inline" target="_blank">').concat($t.name,"</a>")):Tt.replaceSelection("[".concat($t.name,"](").concat(E.a.API_SERVER,"/api/attachments/").concat(un.id,"?type=").concat(un.content_type,")"))}else(un==null?void 0:un.status)===401&&(document.location.href="/user/login")})}catch(un){ue.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Tt.on("paste",zt),Tt.on("dragleave",function(Ut,Kt){mi.current.classList.remove("mouse-hover-md")}),Tt.on("dragover",function(Ut,Kt){mi.current.classList.add("mouse-hover-md")}),Tt.on("drop",function(Ut,Kt){mi.current.classList.add("mouse-hover-md");var en;if(en=Kt.dataTransfer.files,en.length>0){Kt.preventDefault(),Kt.stopPropagation();for(var ln=function(Dn){var $t=en[Dn],Ui=$t.name.split(".").pop();Re($t,function(un){if(un.id){var Hn,dn,ui;($t==null||((Hn=$t.type)===null||Hn===void 0)?void 0:Hn.indexOf("image"))>-1?Tt.replaceSelection("![,](/api/attachments/".concat(un.id,"?type=").concat(un.content_type,")")):($t==null||((dn=$t.type)===null||dn===void 0)?void 0:dn.indexOf("video"))>-1?Tt.replaceSelection('<video width="100%" controls src="'.concat(E.a.API_SERVER,"/api/attachments/").concat(un.id,'"></video>')):($t==null||((ui=$t.type)===null||ui===void 0)?void 0:ui.indexOf("pdf"))>-1?Tt.replaceSelection('<a href="'.concat(E.a.API_SERVER,"/api/attachments/").concat(un.id,"?type=").concat($t.type,'&disposition=inline" target="_blank">').concat($t.name,"</a>")):pe.includes(Ui)?Tt.replaceSelection('<a href="'.concat(E.a.API_SERVER,"/api/attachments/").concat(un.id,'?type=office&disposition=inline" target="_blank">').concat($t.name,"</a>")):Tt.replaceSelection("[".concat($t.name,"](").concat(E.a.API_SERVER,"/api/attachments/").concat(un.id,"?type=").concat(un.content_type,")"))}else(un==null?void 0:un.status)===401&&(document.location.href="/user/login")})},Jt=0;Jt<en.length;Jt++)ln(Jt)}}),wt(Tt),function(){Tt.off("paste",zt)}}},[]);var ci=Object(k.useCallback)(function(){if(mi.current)try{}catch(Tt){console.log(Tt,"---- to set md editor body height")}},[ji,mi,Zt]);Object(k.useEffect)(function(){function Tt(){var Ut=new F.default(function(Kt){var en=Object(Z.a)(Kt),ln;try{for(en.s();!(ln=en.n()).done;){var Jt=ln.value;(Jt.target.offsetHeight>0||Jt.target.offsetWidth>0)&&(ci(),he.setSize("100%","100%"),he.refresh())}}catch(_n){en.e(_n)}finally{en.f()}});return Ut.observe(On.current.parentElement),Ut}if(he){var zt=Tt();return function(){zt.unobserve(On.current.parentElement)}}},[he,ci]),Object(k.useEffect)(function(){if(he){for(var Tt=[],zt=function(){var Jt=Kt[Ut];en=Object(O.a)(Jt,2);var _n=en[0],Dn=en[1],$t=Object(N.a)({},_n,function(){Yi(Dn)});Tt.push($t),he.addKeyMap($t)},Ut=0,Kt=Object.entries(Ce);Ut<Kt.length;Ut++){var en;zt()}return Pn.current=setInterval(function(){Ei.current&&Br()},4e3),function(){clearInterval(Pn.current);var ln=Object(Z.a)(Tt),Jt;try{for(ln.s();!(Jt=ln.n()).done;){var _n=Jt.value;he.removeKeyMap(_n)}}catch(Dn){ln.e(Dn)}finally{ln.f()}}}},[he]),Object(k.useEffect)(function(){je!==Zt&&wn(je)},[je]),Object(ht.a)(function(){if(!Mt&&Fn>0){var Tt=new Date().getTime(),zt=window.sessionStorage.getItem(tn);Tt>=Fn+I&&(!zt||zt!==Ie)&&(window.sessionStorage.setItem(tn,Ie),zn(!0))}},I),Object(k.useEffect)(function(){Qt(dt)},[he,dt]),Object(k.useEffect)(function(){he&&(He&&he.focus())},[he,He]),Object(k.useEffect)(function(){if(Ot&&he){var Tt=he.getScrollerElement();function zt(Ut){var Kt=Ut.target;if(Si.current){var en=Kt.scrollTop/Kt.scrollHeight;Si.current.scrollTop=Si.current.scrollHeight*en}}return Tt.addEventListener("scroll",zt),function(){Tt.removeEventListener("scroll",zt)}}},[he,Ot]),Object(k.useEffect)(function(){if(he&&an){function Tt(zt,Ut){an(zt,Ut)}return he.on("beforeChange",Tt),function(){he.off("beforeChange",Tt)}}},[he,an]),Object(k.useEffect)(function(){if(he&&et){function Tt(){et(he.getValue())}return he.on("blur",Tt),function(){he.off("blur",Tt)}}},[he,et]),Object(k.useEffect)(function(){if(he){function Tt(zt){var Ut=zt.getValue();ot(Ut),ni(new Date().getTime()),zt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Xe&&Xe(Ut)}return he.on("change",Tt),function(){he.off("change",Tt)}}},[he,Xe]),Object(k.useEffect)(function(){he&&(mt==null?(he.setValue(""),ot("")):mt!==he.getValue()&&(he.setValue(mt),ot(mt),he.setCursor(he.lineCount(),0)))},[he,mt]);var Yi=Object(k.useCallback)(function(Tt){var zt=he.getCursor(),Ut=he.getSelection(),Kt=Ut.split(`
`);switch(Tt){case"bold":return he.replaceSelection("**"+Ut+"**"),Ut===""&&he.setCursor(zt.line,zt.ch+2),he.focus();case"italic":return he.replaceSelection("*"+Ut+"*"),Ut===""&&he.setCursor(zt.line,zt.ch+1),he.focus();case"code":return he.replaceSelection("`"+Ut+"`"),Ut===""&&he.setCursor(zt.line,zt.ch+1),he.focus();case"inline-latex":return he.replaceSelection("`$$"+Ut+"$$`"),Ut===""&&he.setCursor(zt.line,zt.ch+3),he.focus();case"latex":return he.replaceSelection("```latex\n"+Ut+"\n```"),he.setCursor(zt.line+1,Ut.length+1),he.focus();case"line-break":return he.replaceSelection(`<br/>
`),he.focus();case"list-ul":return Ut===""?he.replaceSelection("- "+Ut):he.replaceSelection(Kt.map(function(en){return en===""?"":"- ".concat(en)}).join(`
`)),he.focus();case"list-ol":return Ut===""?he.replaceSelection("1. "+Ut):he.replaceSelection(Kt.map(function(en,ln){return en===""?"":"".concat(ln+1,". ").concat(en)}).join(`
`)),he.focus();case"add-null-ch":return Ut===""&&he.setCursor(zt.line,zt.ch+1),he.replaceSelection(b),he.focus();case"inster-template-1":return Ut===""&&he.setCursor(zt.line,zt.ch),he.replaceSelection(_),he.focus();case"eraser":return he.setValue(""),he.focus();case"trigger-watch":return Qt(!Ot),he.focus();case"trigger-full-screen":return wn(!Zt),he.focus();case ut:yn(ut);return;case bt:yn(bt);return;case xt:yn(xt);return;case pt:yn(pt);return;default:throw new Error}},[he,Ot,Zt]),ii=Object(k.useCallback)(function(Tt){yn("");switch(Yn){case ut:var zt=Tt.title,Ut=Tt.link;return he.replaceSelection("[".concat(zt,"](").concat(Ut,")")),he.focus();case bt:var Kt=Tt.language,en=Tt.content;return he.replaceSelection(["```"+Kt,en,"```"].join(`
`)),he.focus();case xt:var ln=Tt.src,Jt=Tt.alt,_n=Tt.name;return ln.indexOf("type=image")>-1?he.replaceSelection("![ ".concat(Jt||""," ]( ").concat(ln,' "').concat(Jt||"",'" )')):ln.indexOf("type=application/pdf")>-1?he.replaceSelection('<a href="'.concat(ln,'&disposition=inline" target="_blank">').concat(_n,"</a>")):he.replaceSelection('<a href="'.concat(ln,'" target="_blank">').concat(_n,"</a>")),he.focus();case pt:for(var Dn=Tt.row,$t=Tt.col,Ui=Tt.align,un=`
`,Hn=0;Hn<Dn;Hn++){for(var dn=[],ui=[],pr=0;pr<$t;pr++)Hn===1&&ui.push(Rt[Ui]),dn.push(" ");Hn===1&&(un+="| ".concat(ui.join(" | "),` |
`)),un+="| ".concat(dn.join($t===1?"":" | "),` |
`)}return he.replaceSelection(un+`
`),he.focus();default:throw new Error}},[he,Yn]),Ji=Object(k.useMemo)(function(){switch(Yn){case ut:return R.a.createElement(Ee,{callback:ii,onCancel:bi});case bt:return R.a.createElement(ye.b,{callback:ii,onCancel:bi});case xt:return R.a.createElement(Ze,{callback:ii,onCancel:bi});case pt:return R.a.createElement(Lt,{callback:ii,onCancel:bi});default:return null}},[Yn]);function bi(){yn("")}Object(k.useEffect)(function(){if(wi.current){var Tt=wi.current,zt=!1,Ut=0;function Kt(Jt){zt=!0,Ut=Jt.pageY}function en(){zt=!1}function ln(Jt){if(zt){var _n=Jt.pageY-Ut;_n<0&&(_n=0),_n>300&&(_n=300);var Dn=Pt+_n+"px";kn(Dn)}}return Tt.addEventListener("mousedown",Kt),document.addEventListener("mousemove",ln),document.addEventListener("mouseup",en),function(){Tt.removeEventListener("mousedown",Kt),document.removeEventListener("mousemove",ln),document.removeEventListener("mouseup",en)}}},[he,wi]),Object(k.useEffect)(function(){kn(Pt)},[Pt]);var ki=S(kt),uo=S(ji),co={width:ki,height:uo},qo=Object(k.useMemo)(function(){if(Fn){var Tt=new Date(Fn),zt=Tt.getHours(),Ut=Tt.getMinutes(),Kt=Tt.getSeconds();return zt=zt<10?"0"+zt:zt,Ut=Ut<10?"0"+Ut:Ut,Kt=Kt<10?"0"+Kt:Kt,"".concat(zt,":").concat(Ut,":").concat(Kt)}return 0},[Fn]);function Qo(){window.sessionStorage.removeItem(tn),zn(!1),ni(0)}function ho(){zn(!1),ni(0),he.setValue(window.sessionStorage.getItem(tn))}function Fr(Tt,zt){var Ut=he.getValue();Ut=Ut.replace(Tt,zt),ot(Ut),he==null||he.setValue(Ut)}return R.a.createElement(k.Fragment,null,R.a.createElement("div",{className:"markdown-editor-wrapper",ref:mi},R.a.createElement("div",{className:"markdown-editor-container ".concat(En," ").concat(Ot?"on-preview":""," ").concat(Wt?"mini":""," ").concat(Zt?"full-screen":""),style:co},R.a.createElement(de,{insertTemp:gt,watch:Ot,fullScreen:Zt,showNullButton:It,onActionCallback:Yi,hidetoolBar:ai,uuid:fn.current,setOpenPhones:function(){Ei.current=!0}}),R.a.createElement("div",{className:"markdown-editor-body"},R.a.createElement("div",{className:"codemirror-container"},R.a.createElement("textarea",{ref:On,placeholder:u})),Ot?R.a.createElement("div",{ref:Si,className:"preview-container"},Xt==="stex"&&R.a.createElement(De,{value:Ie}),Xt!=="stex"&&R.a.createElement(ve.a,{edit:!0,value:Ie,replaces:Fr})):null))),yt?R.a.createElement("a",{ref:wi,className:"editor-resize"}):null,R.a.createElement(w.a,null,Ct[Yn]?R.a.createElement(me.a,{centered:!0,title:Ct[Yn],visible:!0,onCancel:bi,footer:null},Ji):null))}},PGNT:function(it,qe,y){it.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(it,qe,y){it.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"}},"RZ/O":function(it,qe,y){it.exports=y.p+"static/bi.9c9b0364.svg"},SJMd:function(it,qe){/**
* @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 y,B,me,Z=!1,fe,ue;window.PR_SHOULD_USE_CONTINUATION=!0;var ee,O;(function(){var N=window,A=["break,continue,do,else,for,if,return,while"],U=[A,"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"],k=[U,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],R=[k,"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"],q=[k,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],$=[k,"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"],F="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",H=[k,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],X="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",oe=[A,"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"],se=[A,"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"],Le=[A,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Me=[R,$,q,H,X,oe,se,Le],le=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,ve="str",De="kwd",Y="com",m="typ",ge="lit",T="pun",x="pln",K="tag",G="dec",C="src",E="atn",J="atv",L="nocode",de="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function w(Re){for(var Fe=0,Ge=!1,Ye=!1,Ve=0,Be=Re.length;Ve<Be;++Ve){var ze=Re[Ve];if(ze.ignoreCase)Ye=!0;else if(/[a-z]/i.test(ze.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ge=!0,Ye=!1;break}}var Lt={b:8,t:9,n:10,v:11,f:12,r:13};function ft(pt){var Se=pt.charCodeAt(0);if(Se!==92)return Se;var Rt=pt.charAt(1);return Se=Lt[Rt],Se||("0"<=Rt&&Rt<="7"?parseInt(pt.substring(1),8):Rt==="u"||Rt==="x"?parseInt(pt.substring(2),16):pt.charCodeAt(1))}function st(pt){if(pt<32)return(pt<16?"\\x0":"\\x")+pt.toString(16);var Se=String.fromCharCode(pt);return Se==="\\"||Se==="-"||Se==="]"||Se==="^"?"\\"+Se:Se}function ut(pt){var Se=pt.substring(1,pt.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")),Rt=[],ht=Se[0]==="^",ke=["["];ht&&ke.push("^");for(var Ae=ht?1:0,M=Se.length;Ae<M;++Ae){var j=Se[Ae];if(/\\[bdsw]/i.test(j))ke.push(j);else{var I=ft(j),b;Ae+2<M&&Se[Ae+1]==="-"?(b=ft(Se[Ae+2]),Ae+=2):b=I,Rt.push([I,b]),b<65||I>122||(b<65||I>90||Rt.push([Math.max(65,I)|32,Math.min(b,90)|32]),b<97||I>122||Rt.push([Math.max(97,I)&~32,Math.min(b,122)&~32]))}}Rt.sort(function(re,pe){return re[0]-pe[0]||pe[1]-re[1]});for(var _=[],S=[],Ae=0;Ae<Rt.length;++Ae){var P=Rt[Ae];P[0]<=S[1]+1?S[1]=Math.max(S[1],P[1]):_.push(S=P)}for(var Ae=0;Ae<_.length;++Ae){var P=_[Ae];ke.push(st(P[0])),P[1]>P[0]&&(P[1]+1>P[0]&&ke.push("-"),ke.push(st(P[1])))}return ke.push("]"),ke.join("")}function xt(pt){for(var Se=pt.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")),Rt=Se.length,ht=[],ke=0,Ae=0;ke<Rt;++ke){var M=Se[ke];if(M==="(")++Ae;else if(M.charAt(0)==="\\"){var j=+M.substring(1);j&&(j<=Ae?ht[j]=-1:Se[ke]=st(j))}}for(var ke=1;ke<ht.length;++ke)ht[ke]===-1&&(ht[ke]=++Fe);for(var ke=0,Ae=0;ke<Rt;++ke){var M=Se[ke];if(M==="(")++Ae,ht[Ae]||(Se[ke]="(?:");else if(M.charAt(0)==="\\"){var j=+M.substring(1);j&&j<=Ae&&(Se[ke]="\\"+ht[j])}}for(var ke=0;ke<Rt;++ke)Se[ke]==="^"&&Se[ke+1]!=="^"&&(Se[ke]="");if(pt.ignoreCase&&Ge)for(var ke=0;ke<Rt;++ke){var M=Se[ke],I=M.charAt(0);M.length>=2&&I==="["?Se[ke]=ut(M):I!=="\\"&&(Se[ke]=M.replace(/[a-zA-Z]/g,function(S){var P=S.charCodeAt(0);return"["+String.fromCharCode(P&~32,P|32)+"]"}))}return Se.join("")}for(var bt=[],Ve=0,Be=Re.length;Ve<Be;++Ve){var ze=Re[Ve];if(ze.global||ze.multiline)throw new Error(""+ze);bt.push("(?:"+xt(ze)+")")}return new RegExp(bt.join("|"),Ye?"gi":"g")}function g(Re,Fe){var Ge=/(?:^|\s)nocode(?:\s|$)/,Ye=[],Ve=0,Be=[],ze=0;function Lt(ft){var st=ft.nodeType;if(st==1){if(Ge.test(ft.className))return;for(var ut=ft.firstChild;ut;ut=ut.nextSibling)Lt(ut);var xt=ft.nodeName.toLowerCase();(xt==="br"||xt==="li")&&(Ye[ze]=`
`,Be[ze<<1]=Ve++,Be[ze++<<1|1]=ft)}else if(st==3||st==4){var bt=ft.nodeValue;bt.length&&(Fe?bt=bt.replace(/\r\n?/g,`
`):bt=bt.replace(/[ \t\r\n]+/g," "),Ye[ze]=bt,Be[ze<<1]=Ve,Ve+=bt.length,Be[ze++<<1|1]=ft)}}return Lt(Re),{sourceCode:Ye.join("").replace(/\n$/,""),spans:Be}}function te(Re,Fe,Ge,Ye,Ve){if(!Ge)return;var Be={sourceNode:Re,pre:1,langExtension:null,numberLines:null,sourceCode:Ge,spans:null,basePos:Fe,decorations:null};Ye(Be),Ve.push.apply(Ve,Be.decorations)}var Oe=/\S/;function _e(Re){for(var Fe=void 0,Ge=Re.firstChild;Ge;Ge=Ge.nextSibling){var Ye=Ge.nodeType;Fe=Ye===1?Fe?Re:Ge:Ye===3&&Oe.test(Ge.nodeValue)?Re:Fe}return Fe===Re?void 0:Fe}function $e(Re,Fe){var Ge={},Ye;(function(){for(var ze=Re.concat(Fe),Lt=[],ft={},st=0,ut=ze.length;st<ut;++st){var xt=ze[st],bt=xt[3];if(bt)for(var pt=bt.length;--pt>=0;)Ge[bt.charAt(pt)]=xt;var Se=xt[1],Rt=""+Se;ft.hasOwnProperty(Rt)||(Lt.push(Se),ft[Rt]=null)}Lt.push(/[\0-\uffff]/),Ye=w(Lt)})();var Ve=Fe.length,Be=function(ze){for(var Lt=ze.sourceCode,ft=ze.basePos,st=ze.sourceNode,ut=[ft,x],xt=0,bt=Lt.match(Ye)||[],pt={},Se=0,Rt=bt.length;Se<Rt;++Se){var ht=bt[Se],ke=pt[ht],Ae=void 0,M;if(typeof ke=="string")M=!1;else{var j=Ge[ht.charAt(0)];if(j)Ae=ht.match(j[1]),ke=j[0];else{for(var I=0;I<Ve;++I)if(j=Fe[I],Ae=ht.match(j[1]),Ae){ke=j[0];break}Ae||(ke=x)}M=ke.length>=5&&ke.substring(0,5)==="lang-",M&&!(Ae&&typeof Ae[1]=="string")&&(M=!1,ke=C),M||(pt[ht]=ke)}var b=xt;if(xt+=ht.length,!M)ut.push(ft+b,ke);else{var _=Ae[1],S=ht.indexOf(_),P=S+_.length;Ae[2]&&(P=ht.length-Ae[2].length,S=P-_.length);var re=ke.substring(5);te(st,ft+b,ht.substring(0,S),Be,ut),te(st,ft+b+S,_,z(re,_),ut),te(st,ft+b+P,ht.substring(P),Be,ut)}}ze.decorations=ut};return Be}function Qe(Re){var Fe=[],Ge=[];Re.tripleQuotedStrings?Fe.push([ve,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Re.multiLineStrings?Fe.push([ve,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Fe.push([ve,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Re.verbatimStrings&&Ge.push([ve,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ye=Re.hashComments;Ye&&(Re.cStyleComments?(Ye>1?Fe.push([Y,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Fe.push([Y,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ge.push([ve,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Fe.push([Y,/^#[^\r\n]*/,null,"#"])),Re.cStyleComments&&(Ge.push([Y,/^\/\/[^\r\n]*/,null]),Ge.push([Y,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ve=Re.regexLiterals;if(Ve){var Be=Ve>1?"":`
\r`,ze=Be?".":"[\\S\\s]",Lt="/(?=[^/*"+Be+"])(?:[^/\\x5B\\x5C"+Be+"]|\\x5C"+ze+"|\\x5B(?:[^\\x5C\\x5D"+Be+"]|\\x5C"+ze+")*(?:\\x5D|$))+/";Ge.push(["lang-regex",RegExp("^"+de+"("+Lt+")")])}var ft=Re.types;ft&&Ge.push([m,ft]);var st=(""+Re.keywords).replace(/^ | $/g,"");st.length&&Ge.push([De,new RegExp("^(?:"+st.replace(/[\s,]+/g,"|")+")\\b"),null]),Fe.push([x,/^\s+/,null,` \r
\xA0`]);var ut="^.[^\\s\\w.$@'\"`/\\\\]*";return Re.regexLiterals&&(ut+="(?!s*/)"),Ge.push([ge,/^@[a-z_$][a-z_$@0-9]*/i,null],[m,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[x,/^[a-z_$][a-z_$@0-9]*/i,null],[ge,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[x,/^\\[\s\S]?/,null],[T,new RegExp(ut),null]),$e(Fe,Ge)}var Te=Qe({keywords:Me,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ee(Re,Fe,Ge){for(var Ye=/(?:^|\s)nocode(?:\s|$)/,Ve=/\r\n?|\n/,Be=Re.ownerDocument,ze=Be.createElement("li");Re.firstChild;)ze.appendChild(Re.firstChild);var Lt=[ze];function ft(Se){var Rt=Se.nodeType;if(Rt==1&&!Ye.test(Se.className))if(Se.nodeName==="br")st(Se),Se.parentNode&&Se.parentNode.removeChild(Se);else for(var ht=Se.firstChild;ht;ht=ht.nextSibling)ft(ht);else if((Rt==3||Rt==4)&&Ge){var ke=Se.nodeValue,Ae=ke.match(Ve);if(Ae){var M=ke.substring(0,Ae.index);Se.nodeValue=M;var j=ke.substring(Ae.index+Ae[0].length);if(j){var I=Se.parentNode;I.insertBefore(Be.createTextNode(j),Se.nextSibling)}st(Se),M||Se.parentNode.removeChild(Se)}}}function st(Se){for(;!Se.nextSibling;)if(Se=Se.parentNode,!Se)return;function Rt(Ae,M){var j=M?Ae.cloneNode(!1):Ae,I=Ae.parentNode;if(I){var b=Rt(I,1),_=Ae.nextSibling;b.appendChild(j);for(var S=_;S;S=_)_=S.nextSibling,b.appendChild(S)}return j}for(var ht=Rt(Se.nextSibling,0),ke;(ke=ht.parentNode)&&ke.nodeType===1;)ht=ke;Lt.push(ht)}for(var ut=0;ut<Lt.length;++ut)ft(Lt[ut]);Fe===(Fe|0)&&Lt[0].setAttribute("value",Fe);var xt=Be.createElement("ol");xt.className="linenums";for(var bt=Math.max(0,Fe-1|0)||0,ut=0,pt=Lt.length;ut<pt;++ut)ze=Lt[ut],ze.className="L"+(ut+bt)%10,ze.firstChild||ze.appendChild(Be.createTextNode("\xA0")),xt.appendChild(ze);Re.appendChild(xt)}function ye(Re){var Fe=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Fe=Fe&&+Fe[1]<=8;var Ge=/\n/g,Ye=Re.sourceCode,Ve=Ye.length,Be=0,ze=Re.spans,Lt=ze.length,ft=0,st=Re.decorations,ut=st.length,xt=0;st[ut]=Ve;var bt,pt;for(pt=bt=0;pt<ut;)st[pt]!==st[pt+2]?(st[bt++]=st[pt++],st[bt++]=st[pt++]):pt+=2;for(ut=bt,pt=bt=0;pt<ut;){for(var Se=st[pt],Rt=st[pt+1],ht=pt+2;ht+2<=ut&&st[ht+1]===Rt;)ht+=2;st[bt++]=Se,st[bt++]=Rt,pt=ht}ut=st.length=bt;var ke=Re.sourceNode,Ae="";ke&&(Ae=ke.style.display,ke.style.display="none");try{for(var M=null;ft<Lt;){var j=ze[ft],I=ze[ft+2]||Ve,b=st[xt+2]||Ve,ht=Math.min(I,b),_=ze[ft+1],S;if(_.nodeType!==1&&(S=Ye.substring(Be,ht))){Fe&&(S=S.replace(Ge,"\r")),_.nodeValue=S;var P=_.ownerDocument,re=P.createElement("span");re.className=st[xt+1];var pe=_.parentNode;pe.replaceChild(re,_),re.appendChild(_),Be<I&&(ze[ft+1]=_=P.createTextNode(Ye.substring(ht,I)),pe.insertBefore(_,re.nextSibling))}Be=ht,Be>=I&&(ft+=2),Be>=b&&(xt+=2)}}finally{ke&&(ke.style.display=Ae)}}var we={};function ne(Re,Fe){for(var Ge=Fe.length;--Ge>=0;){var Ye=Fe[Ge];we.hasOwnProperty(Ye)?N.console&&console.warn("cannot override language handler %s",Ye):we[Ye]=Re}}function z(Re,Fe){return Re&&we.hasOwnProperty(Re)||(Re=/^\s*</.test(Fe)?"default-markup":"default-code"),we[Re]}ne(Te,["default-code"]),ne($e([],[[x,/^[^<?]+/],[G,/^<!\w[^>]*(?:>|$)/],[Y,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[T,/^(?:<[%?]|[%?]>)/],["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"]),ne($e([[x,/^[\s]+/,null,` \r
`],[J,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[K,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[E,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[T,/^[=<>\/]+/],["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"]),ne($e([],[[J,/^[\s\S]+/]]),["uq.val"]),ne(Qe({keywords:R,hashComments:!0,cStyleComments:!0,types:le}),["c","cc","cpp","cxx","cyc","m"]),ne(Qe({keywords:"null,true,false"}),["json"]),ne(Qe({keywords:$,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:le}),["cs"]),ne(Qe({keywords:q,cStyleComments:!0}),["java"]),ne(Qe({keywords:Le,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ne(Qe({keywords:oe,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ne(Qe({keywords:X,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ne(Qe({keywords:se,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ne(Qe({keywords:H,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ne(Qe({keywords:F,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ne($e([],[[ve,/^[\s\S]+/]]),["regex"]);function Ne(Re){var Fe=Re.langExtension;try{var Ge=g(Re.sourceNode,Re.pre),Ye=Ge.sourceCode;Re.sourceCode=Ye,Re.spans=Ge.spans,Re.basePos=0,z(Fe,Ye)(Re),ye(Re)}catch(Ve){N.console&&console.log(Ve&&Ve.stack||Ve)}}function be(Re,Fe,Ge){var Ye=Ge||!1,Ve=Fe||null,Be=document.createElement("div");Be.innerHTML="<pre>"+Re+"</pre>",Be=Be.firstChild,Ye&&Ee(Be,Ye,!0);var ze={langExtension:Ve,numberLines:Ye,sourceNode:Be,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ne(ze),Be.innerHTML}function St(Re,Fe){var Ge=Fe||document.body,Ye=Ge.ownerDocument||document;function Ve(j){return Ge.getElementsByTagName(j)}for(var Be=[Ve("pre"),Ve("code"),Ve("xmp")],ze=[],Lt=0;Lt<Be.length;++Lt)for(var ft=0,st=Be[Lt].length;ft<st;++ft)ze.push(Be[Lt][ft]);Be=null;var ut=Date;ut.now||(ut={now:function(){return+new Date}});var xt=0,bt=/\blang(?:uage)?-([\w.]+)(?!\S)/,pt=/\bprettyprint\b/,Se=/\bprettyprinted\b/,Rt=/pre|xmp/i,ht=/^code$/i,ke=/^(?:pre|code|xmp)$/i,Ae={};function M(){for(var j=N.PR_SHOULD_USE_CONTINUATION?ut.now()+250:Infinity;xt<ze.length&&ut.now()<j;xt++){for(var I=ze[xt],b=Ae,_=I;_=_.previousSibling;){var S=_.nodeType,P=(S===7||S===8)&&_.nodeValue;if(P?!/^\??prettify\b/.test(P):S!==3||/\S/.test(_.nodeValue))break;if(P){b={},P.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Pt,ct,Wt){b[ct]=Wt});break}}var re=I.className;if((b!==Ae||pt.test(re))&&!Se.test(re)){for(var pe=!1,Ce=I.parentNode;Ce;Ce=Ce.parentNode){var Ct=Ce.tagName;if(ke.test(Ct)&&Ce.className&&pt.test(Ce.className)){pe=!0;break}}if(!pe){I.className+=" prettyprinted";var At=b.lang;if(!At){At=re.match(bt);var xe;!At&&(xe=_e(I))&&ht.test(xe.tagName)&&(At=xe.className.match(bt)),At&&(At=At[1])}var rt;if(Rt.test(I.tagName))rt=1;else{var mt=I.currentStyle,Xe=Ye.defaultView,Dt=mt?mt.whiteSpace:Xe&&Xe.getComputedStyle?Xe.getComputedStyle(I,null).getPropertyValue("white-space"):0;rt=Dt&&Dt.substring(0,3)==="pre"}var kt=b.linenums;(kt=kt==="true"||+kt)||(kt=re.match(/\blinenums\b(?::(\d+))?/),kt=kt?kt[1]&&kt[1].length?+kt[1]:!0:!1),kt&&Ee(I,kt,rt);var Ft={langExtension:At,sourceNode:I,numberLines:kt,pre:rt,sourceCode:null,basePos:null,spans:null,decorations:null};Ne(Ft)}}}xt<ze.length?N.setTimeout(M,250):typeof Re=="function"&&Re()}M()}var Ze=N.PR={createSimpleLexer:$e,registerLangHandler:ne,sourceDecorator:Qe,PR_ATTRIB_NAME:E,PR_ATTRIB_VALUE:J,PR_COMMENT:Y,PR_DECLARATION:G,PR_KEYWORD:De,PR_LITERAL:ge,PR_NOCODE:L,PR_PLAIN:x,PR_PUNCTUATION:T,PR_SOURCE:C,PR_STRING:ve,PR_TAG:K,PR_TYPE:m,prettyPrintOne:Z?N.prettyPrintOne=be:ee=be,prettyPrint:O=Z?N.prettyPrint=St:O=St},Ke=N.define;typeof Ke=="function"&&Ke.amd&&Ke("google-code-prettify",[],function(){return Ze})})()},"VrN/":function(it,qe,y){(function(B,me){it.exports=me()})(this,function(){"use strict";var B=navigator.userAgent,me=navigator.platform,Z=/gecko\/\d/i.test(B),fe=/MSIE \d/.test(B),ue=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(B),ee=/Edge\/(\d+)/.exec(B),O=fe||ue||ee,N=O&&(fe?document.documentMode||6:+(ee||ue)[1]),A=!ee&&/WebKit\//.test(B),U=A&&/Qt\/\d+\.\d+/.test(B),k=!ee&&/Chrome\//.test(B),R=/Opera\//.test(B),q=/Apple Computer/.test(navigator.vendor),$=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(B),F=/PhantomJS/.test(B),H=!ee&&/AppleWebKit/.test(B)&&/Mobile\/\w+/.test(B),X=/Android/.test(B),oe=H||X||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(B),se=H||/Mac/.test(me),Le=/\bCrOS\b/.test(B),Me=/win/i.test(me),le=R&&B.match(/Version\/(\d*\.\d*)/);le&&(le=Number(le[1])),le&&le>=15&&(R=!1,A=!0);var ve=se&&(U||R&&(le==null||le<12.11)),De=Z||O&&N>=9;function Y(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var m=function(e,t){var i=e.className,n=Y(t).exec(i);if(n){var r=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(r?n[1]+r:"")}};function ge(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function T(e,t){return ge(e).appendChild(t)}function x(e,t,i,n){var r=document.createElement(e);if(i&&(r.className=i),n&&(r.style.cssText=n),typeof t=="string")r.appendChild(document.createTextNode(t));else if(t)for(var s=0;s<t.length;++s)r.appendChild(t[s]);return r}function K(e,t,i,n){var r=x(e,t,i,n);return r.setAttribute("role","presentation"),r}var G;document.createRange?G=function(e,t,i,n){var r=document.createRange();return r.setEnd(n||e,i),r.setStart(e,t),r}:G=function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(r){return n}return n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",t),n};function C(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 E(){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 J(e,t){var i=e.className;Y(t).test(i)||(e.className+=(i?" ":"")+t)}function L(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!Y(i[n]).test(t)&&(t+=" "+i[n]);return t}var de=function(e){e.select()};H?de=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:O&&(de=function(e){try{e.select()}catch(t){}});function w(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function g(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 te(e,t,i,n,r){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var s=n||0,l=r||0;;){var d=e.indexOf(" ",s);if(d<0||d>=t)return l+(t-s);l+=d-s,l+=i-l%i,s=d+1}}var Oe=function(){this.id=null,this.f=null,this.time=0,this.handler=w(this.onTimeout,this)};Oe.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Oe.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 _e(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var $e=50,Qe={toString:function(){return"CodeMirror.Pass"}},Te={scroll:!1},Ee={origin:"*mouse"},ye={origin:"+move"};function we(e,t,i){for(var n=0,r=0;;){var s=e.indexOf(" ",n);s==-1&&(s=e.length);var l=s-n;if(s==e.length||r+l>=t)return n+Math.min(l,t-r);if(r+=s-n,r+=i-r%i,n=s+1,r>=t)return n}}var ne=[""];function z(e){for(;ne.length<=e;)ne.push(Ne(ne)+" ");return ne[e]}function Ne(e){return e[e.length-1]}function be(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function St(e,t,i){for(var n=0,r=i(t);n<e.length&&i(e[n])<=r;)n++;e.splice(n,0,t)}function Ze(){}function Ke(e,t){var i;return Object.create?i=Object.create(e):(Ze.prototype=e,i=new Ze),t&&g(t,i),i}var Re=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Fe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Re.test(e))}function Ge(e,t){return t?t.source.indexOf("\\w")>-1&&Fe(e)?!0:t.test(e):Fe(e)}function Ye(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ve=/[\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 Be(e){return e.charCodeAt(0)>=768&&Ve.test(e)}function ze(e,t,i){for(;(i<0?t>0:t<e.length)&&Be(e.charAt(t));)t+=i;return t}function Lt(e,t,i){for(var n=t>i?-1:1;;){if(t==i)return t;var r=(t+i)/2,s=n<0?Math.ceil(r):Math.floor(r);if(s==t)return e(s)?t:i;e(s)?i=s:t=s+n}}function ft(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var r=!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),r=!0)}r||n(t,i,"ltr")}var st=null;function ut(e,t,i){var n;st=null;for(var r=0;r<e.length;++r){var s=e[r];if(s.from<t&&s.to>t)return r;s.to==t&&(s.from!=s.to&&i=="before"?n=r:st=r),s.from==t&&(s.from!=s.to&&i!="before"?n=r:st=r)}return n!=null?n:st}var xt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(v){return v<=247?e.charAt(v):1424<=v&&v<=1524?"R":1536<=v&&v<=1785?t.charAt(v-1536):1774<=v&&v<=2220?"r":8192<=v&&v<=8203?"w":v==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,d=/[1n]/;function f(v,D,W){this.level=v,this.from=D,this.to=W}return function(v,D){var W=D=="ltr"?"L":"R";if(v.length==0||D=="ltr"&&!n.test(v))return!1;for(var ce=v.length,ie=[],Pe=0;Pe<ce;++Pe)ie.push(i(v.charCodeAt(Pe)));for(var We=0,Je=W;We<ce;++We){var tt=ie[We];tt=="m"?ie[We]=Je:Je=tt}for(var vt=0,nt=W;vt<ce;++vt){var _t=ie[vt];_t=="1"&&nt=="r"?ie[vt]="n":s.test(_t)&&(nt=_t,_t=="r"&&(ie[vt]="R"))}for(var Bt=1,jt=ie[0];Bt<ce-1;++Bt){var Vt=ie[Bt];Vt=="+"&&jt=="1"&&ie[Bt+1]=="1"?ie[Bt]="1":Vt==","&&jt==ie[Bt+1]&&(jt=="1"||jt=="n")&&(ie[Bt]=jt),jt=Vt}for(var pn=0;pn<ce;++pn){var jn=ie[pn];if(jn==",")ie[pn]="N";else if(jn=="%"){var xn=void 0;for(xn=pn+1;xn<ce&&ie[xn]=="%";++xn);for(var oi=pn&&ie[pn-1]=="!"||xn<ce&&ie[xn]=="1"?"1":"N",Qn=pn;Qn<xn;++Qn)ie[Qn]=oi;pn=xn-1}}for(var Tn=0,Zn=W;Tn<ce;++Tn){var Gn=ie[Tn];Zn=="L"&&Gn=="1"?ie[Tn]="L":s.test(Gn)&&(Zn=Gn)}for(var Ln=0;Ln<ce;++Ln)if(r.test(ie[Ln])){var An=void 0;for(An=Ln+1;An<ce&&r.test(ie[An]);++An);for(var Sn=(Ln?ie[Ln-1]:W)=="L",ei=(An<ce?ie[An]:W)=="L",dr=Sn==ei?Sn?"L":"R":W,Di=Ln;Di<An;++Di)ie[Di]=dr;Ln=An-1}for(var Xn=[],yi,Un=0;Un<ce;)if(l.test(ie[Un])){var Yo=Un;for(++Un;Un<ce&&l.test(ie[Un]);++Un);Xn.push(new f(0,Yo,Un))}else{var xi=Un,Ki=Xn.length,$i=D=="rtl"?1:0;for(++Un;Un<ce&&ie[Un]!="L";++Un);for(var $n=xi;$n<Un;)if(d.test(ie[$n])){xi<$n&&(Xn.splice(Ki,0,new f(1,xi,$n)),Ki+=$i);var fr=$n;for(++$n;$n<Un&&d.test(ie[$n]);++$n);Xn.splice(Ki,0,new f(2,fr,$n)),Ki+=$i,xi=$n}else++$n;xi<Un&&Xn.splice(Ki,0,new f(1,xi,Un))}return D=="ltr"&&(Xn[0].level==1&&(yi=v.match(/^\s+/))&&(Xn[0].from=yi[0].length,Xn.unshift(new f(0,0,yi[0].length))),Ne(Xn).level==1&&(yi=v.match(/\s+$/))&&(Ne(Xn).to-=yi[0].length,Xn.push(new f(0,ce-yi[0].length,ce)))),D=="rtl"?Xn.reverse():Xn}}();function bt(e,t){var i=e.order;return i==null&&(i=e.order=xt(e.text,t)),i}var pt=[],Se=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]||pt).concat(i)}};function Rt(e,t){return e._handlers&&e._handlers[t]||pt}function ht(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,r=n&&n[t];if(r){var s=_e(r,i);s>-1&&(n[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function ke(e,t){var i=Rt(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),r=0;r<i.length;++r)i[r].apply(null,n)}function Ae(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ke(e,i||t.type,e,t),S(t)||t.codemirrorIgnore}function M(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)_e(i,t[n])==-1&&i.push(t[n])}function j(e,t){return Rt(e,t).length>0}function I(e){e.prototype.on=function(t,i){Se(this,t,i)},e.prototype.off=function(t,i){ht(this,t,i)}}function b(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function _(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function S(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function P(e){b(e),_(e)}function re(e){return e.target||e.srcElement}function pe(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),se&&e.ctrlKey&&t==1&&(t=3),t}var Ce=function(){if(O&&N<9)return!1;var e=x("div");return"draggable"in e||"dragDrop"in e}(),Ct;function At(e){if(Ct==null){var t=x("span","\u200B");T(e,x("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ct=t.offsetWidth<=1&&t.offsetHeight>2&&!(O&&N<8))}var i=Ct?x("span","\u200B"):x("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var xe;function rt(e){if(xe!=null)return xe;var t=T(e,document.createTextNode("A\u062EA")),i=G(t,0,1).getBoundingClientRect(),n=G(t,1,2).getBoundingClientRect();return ge(e),!i||i.left==i.right?!1:xe=n.right-i.right<3}var mt=`
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var r=e.indexOf(`
`,t);r==-1&&(r=e.length);var s=e.slice(t,e.charAt(r-1)=="\r"?r-1:r),l=s.indexOf("\r");l!=-1?(i.push(s.slice(0,l)),t+=l+1):(i.push(s),t=r+1)}return i}:function(e){return e.split(/\r\n?|\n/)},Xe=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},Dt=function(){var e=x("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),kt=null;function Ft(e){if(kt!=null)return kt;var t=T(e,x("span","x")),i=t.getBoundingClientRect(),n=G(t,0,1).getBoundingClientRect();return kt=Math.abs(i.left-n.left)>1}var Pt={},ct={};function Wt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Pt[e]=t}function Nt(e,t){ct[e]=t}function He(e){if(typeof e=="string"&&ct.hasOwnProperty(e))e=ct[e];else if(e&&typeof e.name=="string"&&ct.hasOwnProperty(e.name)){var t=ct[e.name];typeof t=="string"&&(t={name:t}),e=Ke(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return He("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return He("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function dt(e,t){t=He(t);var i=Pt[t.name];if(!i)return dt(e,"text/plain");var n=i(e,t);if(gt.hasOwnProperty(t.name)){var r=gt[t.name];for(var s in r){if(!r.hasOwnProperty(s))continue;n.hasOwnProperty(s)&&(n["_"+s]=n[s]),n[s]=r[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 gt={};function Et(e,t){var i=gt.hasOwnProperty(e)?gt[e]:gt[e]={};g(t,i)}function Xt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var r=t[n];r instanceof Array&&(r=r.concat([])),i[n]=r}return i}function Gt(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 tn(e,t,i){return e.startState?e.startState(t,i):!0}var Ht=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};Ht.prototype.eol=function(){return this.pos>=this.string.length},Ht.prototype.sol=function(){return this.pos==this.lineStart},Ht.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ht.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ht.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},Ht.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ht.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ht.prototype.skipToEnd=function(){this.pos=this.string.length},Ht.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ht.prototype.backUp=function(e){this.pos-=e},Ht.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=te(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?te(this.string,this.lineStart,this.tabSize):0)},Ht.prototype.indentation=function(){return te(this.string,null,this.tabSize)-(this.lineStart?te(this.string,this.lineStart,this.tabSize):0)},Ht.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(l){return i?l.toLowerCase():l},r=this.string.substr(this.pos,e.length);if(n(r)==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)}},Ht.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ht.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ht.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ht.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function yt(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 r=i.children[n],s=r.chunkSize();if(t<s){i=r;break}t-=s}return i.lines[t]}function Yt(e,t,i){var n=[],r=t.line;return e.iter(t.line,i.line+1,function(s){var l=s.text;r==i.line&&(l=l.slice(0,i.ch)),r==t.line&&(l=l.slice(t.ch)),n.push(l),++r}),n}function Mt(e,t,i){var n=[];return e.iter(t,i,function(r){n.push(r.text)}),n}function qt(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function It(e){if(e.parent==null)return null;for(var t=e.parent,i=_e(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var r=0;!(n.children[r]==t);++r)i+=n.children[r].chunkSize();return i+t.first}function Cn(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var r=e.children[n],s=r.height;if(t<s){e=r;continue e}t-=s,i+=r.chunkSize()}return i}while(!e.lines);for(var l=0;l<e.lines.length;++l){var d=e.lines[l],f=d.height;if(t<f)break;t-=f}return i+l}function ai(e,t){return t>=e.first&&t<e.first+e.size}function ti(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function je(e,t,i){if(i===void 0&&(i=null),!(this instanceof je))return new je(e,t,i);this.line=e,this.ch=t,this.sticky=i}function et(e,t){return e.line-t.line||e.ch-t.ch}function an(e,t){return e.sticky==t.sticky&&et(e,t)==0}function hn(e){return je(e.line,e.ch)}function gn(e,t){return et(e,t)<0?t:e}function En(e,t){return et(e,t)<0?e:t}function h(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 je(e.first,0);var i=e.first+e.size-1;return t.line>i?je(i,yt(e,i).text.length):a(t,yt(e,t.line).text.length)}function a(e,t){var i=e.ch;return i==null||i>t?je(e.line,t):i<0?je(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 p=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 p?new c(e,Xt(e.mode,t.state),i,t.lookAhead):new c(e,Xt(e.mode,t),i)},c.prototype.save=function(e){var t=e!==!1?Xt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new p(t,this.maxLookAhead):t};function V(e,t,i,n){var r=[e.state.modeGen],s={};lt(e,t.text,e.doc.mode,i,function(v,D){return r.push(v,D)},s,n);for(var l=i.state,d=function(v){i.baseTokens=r;var D=e.state.overlays[v],W=1,ce=0;i.state=!0,lt(e,t.text,D.mode,i,function(ie,Pe){for(var We=W;ce<ie;){var Je=r[W];Je>ie&&r.splice(W,1,ie,r[W+1],Je),W+=2,ce=Math.min(ie,Je)}if(!Pe)return;if(D.opaque)r.splice(We,W-We,ie,"overlay "+Pe),W=We+2;else for(;We<W;We+=2){var tt=r[We+1];r[We+1]=(tt?tt+" ":"")+"overlay "+Pe}},s),i.state=l,i.baseTokens=null,i.baseTokenPos=1},f=0;f<e.state.overlays.length;++f)d(f);return{styles:r,classes:s.bgClass||s.textClass?s:null}}function Ue(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=he(e,It(t)),r=t.text.length>e.options.maxHighlightLength&&Xt(e.doc.mode,n.state),s=V(e,t,n);r&&(n.state=r),t.stateAfter=n.save(!r),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 he(e,t,i){var n=e.doc,r=e.display;if(!n.mode.startState)return new c(n,!0,t);var s=Ot(e,t,i),l=s>n.first&&yt(n,s-1).stateAfter,d=l?c.fromSaved(n,l,s):new c(n,tn(n.mode),s);return n.iter(s,t,function(f){wt(e,f.text,d);var v=d.line;f.stateAfter=v==t-1||v%5==0||v>=r.viewFrom&&v<r.viewTo?d.save():null,d.nextLine()}),i&&(n.modeFrontier=d.line),d}function wt(e,t,i,n){var r=e.doc.mode,s=new Ht(t,e.options.tabSize,i);for(s.start=s.pos=n||0,t==""&&ae(r,i.state);!s.eol();)Q(r,s,i.state),s.start=s.pos}function ae(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=Gt(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function Q(e,t,i,n){for(var r=0;r<10;r++){n&&(n[0]=Gt(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 Ie=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function ot(e,t,i,n){var r=e.doc,s=r.mode,l;t=o(r,t);var d=yt(r,t.line),f=he(e,t.line,i),v=new Ht(d.text,e.options.tabSize,f),D;for(n&&(D=[]);(n||v.pos<t.ch)&&!v.eol();)v.start=v.pos,l=Q(s,v,f.state),n&&D.push(new Ie(v,l,Xt(r.mode,f.state)));return n?D:new Ie(v,l,f.state)}function at(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 lt(e,t,i,n,r,s,l){var d=i.flattenSpans;d==null&&(d=e.options.flattenSpans);var f=0,v=null,D=new Ht(t,e.options.tabSize,n),W,ce=e.options.addModeClass&&[null];for(t==""&&at(ae(i,n.state),s);!D.eol();){if(D.pos>e.options.maxHighlightLength?(d=!1,l&&wt(e,t,n,D.pos),D.pos=t.length,W=null):W=at(Q(i,D,n.state,ce),s),ce){var ie=ce[0].name;ie&&(W="m-"+(W?ie+" "+W:ie))}if(!d||v!=W){for(;f<D.start;)f=Math.min(D.start,f+5e3),r(f,v);v=W}D.start=D.pos}for(;f<D.pos;){var Pe=Math.min(D.pos,f+5e3);r(Pe,v),f=Pe}}function Ot(e,t,i){for(var n,r,s=e.doc,l=i?-1:t-(e.doc.mode.innerMode?1e3:100),d=t;d>l;--d){if(d<=s.first)return s.first;var f=yt(s,d-1),v=f.stateAfter;if(v&&(!i||d+(v instanceof p?v.lookAhead:0)<=s.modeFrontier))return d;var D=te(f.text,null,e.options.tabSize);(r==null||n>D)&&(r=d-1,n=D)}return r}function Qt(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 r=yt(e,n).stateAfter;if(r&&(!(r instanceof p)||n+r.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var mn=!1,nn=!1;function Zt(){mn=!0}function wn(){nn=!0}function Bn(e,t,i){this.marker=e,this.from=t,this.to=i}function vn(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function Yn(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function yn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Mn(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,d=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);if(d||s.from==t&&l.type=="bookmark"&&(!i||!s.marker.insertLeft)){var f=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);(n||(n=[])).push(new Bn(l,s.from,f?null:s.to))}}return n}function pi(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,d=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);if(d||s.from==t&&l.type=="bookmark"&&(!i||s.marker.insertLeft)){var f=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);(n||(n=[])).push(new Bn(l,f?null:s.from-t,s.to==null?null:s.to-t))}}return n}function Fn(e,t){if(t.full)return null;var i=ai(e,t.from.line)&&yt(e,t.from.line).markedSpans,n=ai(e,t.to.line)&&yt(e,t.to.line).markedSpans;if(!i&&!n)return null;var r=t.from.ch,s=t.to.ch,l=et(t.from,t.to)==0,d=Mn(i,r,l),f=pi(n,s,l),v=t.text.length==1,D=Ne(t.text).length+(v?r:0);if(d)for(var W=0;W<d.length;++W){var ce=d[W];if(ce.to==null){var ie=vn(f,ce.marker);ie?v&&(ce.to=ie.to==null?null:ie.to+D):ce.to=r}}if(f)for(var Pe=0;Pe<f.length;++Pe){var We=f[Pe];if(We.to!=null&&(We.to+=D),We.from==null){var Je=vn(d,We.marker);Je||(We.from=D,v&&(d||(d=[])).push(We))}else We.from+=D,v&&(d||(d=[])).push(We)}d&&(d=ni(d)),f&&f!=d&&(f=ni(f));var tt=[d];if(!v){var vt=t.text.length-2,nt;if(vt>0&&d)for(var _t=0;_t<d.length;++_t)d[_t].to==null&&(nt||(nt=[])).push(new Bn(d[_t].marker,null,null));for(var Bt=0;Bt<vt;++Bt)tt.push(nt);tt.push(f)}return tt}function ni(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 Ni(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(ie){if(ie.markedSpans)for(var Pe=0;Pe<ie.markedSpans.length;++Pe){var We=ie.markedSpans[Pe].marker;We.readOnly&&(!n||_e(n,We)==-1)&&(n||(n=[])).push(We)}}),!n)return null;for(var r=[{from:t,to:i}],s=0;s<n.length;++s)for(var l=n[s],d=l.find(0),f=0;f<r.length;++f){var v=r[f];if(et(v.to,d.from)<0||et(v.from,d.to)>0)continue;var D=[f,1],W=et(v.from,d.from),ce=et(v.to,d.to);(W<0||!l.inclusiveLeft&&!W)&&D.push({from:v.from,to:d.from}),(ce>0||!l.inclusiveRight&&!ce)&&D.push({from:d.to,to:v.to}),r.splice.apply(r,D),f+=D.length-3}return r}function Ii(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 ji(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function kn(e){return e.inclusiveLeft?-1:0}function rn(e){return e.inclusiveRight?1:0}function Wn(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),r=t.find(),s=et(n.from,r.from)||kn(e)-kn(t);if(s)return-s;var l=et(n.to,r.to)||rn(e)-rn(t);return l||t.id-e.id}function on(e,t){var i=nn&&e.markedSpans,n;if(i)for(var r=void 0,s=0;s<i.length;++s)r=i[s],r.marker.collapsed&&(t?r.from:r.to)==null&&(!n||Wn(n,r.marker)<0)&&(n=r.marker);return n}function zn(e){return on(e,!0)}function fn(e){return on(e,!1)}function Ei(e,t){var i=nn&&e.markedSpans,n;if(i)for(var r=0;r<i.length;++r){var s=i[r];s.marker.collapsed&&(s.from==null||s.from<t)&&(s.to==null||s.to>t)&&(!n||Wn(n,s.marker)<0)&&(n=s.marker)}return n}function Pn(e,t,i,n,r){var s=yt(e,t),l=nn&&s.markedSpans;if(l)for(var d=0;d<l.length;++d){var f=l[d];if(!f.marker.collapsed)continue;var v=f.marker.find(0),D=et(v.from,i)||kn(f.marker)-kn(r),W=et(v.to,n)||rn(f.marker)-rn(r);if(D>=0&&W<=0||D<=0&&W>=0)continue;if(D<=0&&(f.marker.inclusiveRight&&r.inclusiveLeft?et(v.to,i)>=0:et(v.to,i)>0)||D>=0&&(f.marker.inclusiveRight&&r.inclusiveLeft?et(v.from,n)<=0:et(v.from,n)<0))return!0}}function On(e){for(var t;t=zn(e);)e=t.find(-1,!0).line;return e}function mi(e){for(var t;t=fn(e);)e=t.find(1,!0).line;return e}function wi(e){for(var t,i;t=fn(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function Si(e,t){var i=yt(e,t),n=On(i);return i==n?t:It(n)}function Br(e,t){if(t>e.lastLine())return t;var i=yt(e,t),n;if(!ci(e,i))return t;for(;n=fn(i);)i=n.find(1,!0).line;return It(i)+1}function ci(e,t){var i=nn&&t.markedSpans;if(i)for(var n=void 0,r=0;r<i.length;++r){if(n=i[r],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&Yi(e,t,n))return!0}}function Yi(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return Yi(e,n.line,vn(n.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var r=void 0,s=0;s<t.markedSpans.length;++s)if(r=t.markedSpans[s],r.marker.collapsed&&!r.marker.widgetNode&&r.from==i.to&&(r.to==null||r.to!=i.from)&&(r.marker.inclusiveLeft||i.marker.inclusiveRight)&&Yi(e,t,r))return!0}function ii(e){e=On(e);for(var t=0,i=e.parent,n=0;n<i.lines.length;++n){var r=i.lines[n];if(r==e)break;t+=r.height}for(var s=i.parent;s;i=s,s=i.parent)for(var l=0;l<s.children.length;++l){var d=s.children[l];if(d==i)break;t+=d.height}return t}function Ji(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=zn(n);){var r=i.find(0,!0);n=r.from.line,t+=r.from.ch-r.to.ch}for(n=e;i=fn(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 bi(e){var t=e.display,i=e.doc;t.maxLine=yt(i,i.first),t.maxLineLength=Ji(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var r=Ji(n);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=n)})}var ki=function(e,t,i){this.text=e,ji(this,t),this.height=i?i(this):1};ki.prototype.lineNo=function(){return It(this)},I(ki);function uo(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ii(e),ji(e,i);var r=n?n(e):1;r!=e.height&&qt(e,r)}function co(e){e.parent=null,Ii(e)}var qo={},Qo={};function ho(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Qo:qo;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Fr(e,t){var i=K("span",null,null,A?"padding-right: .1px":null),n={pre:K("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var s=r?t.rest[r-1]:t.line,l=void 0;n.pos=0,n.addToken=zt,rt(e.display.measure)&&(l=bt(s,e.doc.direction))&&(n.addToken=Kt(n.addToken,l)),n.map=[];var d=t!=e.display.externalMeasured&&It(s);ln(s,n,Ue(e,s,d)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=L(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=L(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(At(e.display.measure))),r==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(A){var f=n.content.lastChild;(/\bcm-tab\b/.test(f.className)||f.querySelector&&f.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return ke(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=L(n.pre.className,n.textClass||"")),n}function Tt(e){var t=x("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function zt(e,t,i,n,r,s,l){if(!t)return;var d=e.splitSpaces?Ut(t,e.trailingSpace):t,f=e.cm.state.specialChars,v=!1,D;if(!f.test(t))e.col+=t.length,D=document.createTextNode(d),e.map.push(e.pos,e.pos+t.length,D),O&&N<9&&(v=!0),e.pos+=t.length;else{D=document.createDocumentFragment();for(var W=0;;){f.lastIndex=W;var ce=f.exec(t),ie=ce?ce.index-W:t.length-W;if(ie){var Pe=document.createTextNode(d.slice(W,W+ie));O&&N<9?D.appendChild(x("span",[Pe])):D.appendChild(Pe),e.map.push(e.pos,e.pos+ie,Pe),e.col+=ie,e.pos+=ie}if(!ce)break;W+=ie+1;var We=void 0;if(ce[0]==" "){var Je=e.cm.options.tabSize,tt=Je-e.col%Je;We=D.appendChild(x("span",z(tt),"cm-tab")),We.setAttribute("role","presentation"),We.setAttribute("cm-text"," "),e.col+=tt}else ce[0]=="\r"||ce[0]==`
`?(We=D.appendChild(x("span",ce[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),We.setAttribute("cm-text",ce[0]),e.col+=1):(We=e.cm.options.specialCharPlaceholder(ce[0]),We.setAttribute("cm-text",ce[0]),O&&N<9?D.appendChild(x("span",[We])):D.appendChild(We),e.col+=1);e.map.push(e.pos,e.pos+1,We),e.pos++}}if(e.trailingSpace=d.charCodeAt(t.length-1)==32,i||n||r||v||s||l){var vt=i||"";n&&(vt+=n),r&&(vt+=r);var nt=x("span",[D],vt,s);if(l)for(var _t in l)l.hasOwnProperty(_t)&&_t!="style"&&_t!="class"&&nt.setAttribute(_t,l[_t]);return e.content.appendChild(nt)}e.content.appendChild(D)}function Ut(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",r=0;r<e.length;r++){var s=e.charAt(r);s==" "&&i&&(r==e.length-1||e.charCodeAt(r+1)==32)&&(s="\xA0"),n+=s,i=s==" "}return n}function Kt(e,t){return function(i,n,r,s,l,d,f){r=r?r+" cm-force-border":"cm-force-border";for(var v=i.pos,D=v+n.length;;){for(var W=void 0,ce=0;ce<t.length&&!(W=t[ce],W.to>v&&W.from<=v);ce++);if(W.to>=D)return e(i,n,r,s,l,d,f);e(i,n.slice(0,W.to-v),r,s,null,d,f),s=null,n=n.slice(W.to-v),v=W.to}}}function en(e,t,i,n){var r=!n&&i.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!n&&e.cm.display.input.needsContentAttribute&&(r||(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",i.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function ln(e,t,i){var n=e.markedSpans,r=e.text,s=0;if(!n){for(var l=1;l<i.length;l+=2)t.addToken(t,r.slice(s,s=i[l]),ho(i[l+1],t.cm.options));return}for(var d=r.length,f=0,v=1,D="",W,ce,ie=0,Pe,We,Je,tt,vt;;){if(ie==f){Pe=We=Je=ce="",vt=null,tt=null,ie=Infinity;for(var nt=[],_t=void 0,Bt=0;Bt<n.length;++Bt){var jt=n[Bt],Vt=jt.marker;if(Vt.type=="bookmark"&&jt.from==f&&Vt.widgetNode)nt.push(Vt);else if(jt.from<=f&&(jt.to==null||jt.to>f||Vt.collapsed&&jt.to==f&&jt.from==f)){if(jt.to!=null&&jt.to!=f&&ie>jt.to&&(ie=jt.to,We=""),Vt.className&&(Pe+=" "+Vt.className),Vt.css&&(ce=(ce?ce+";":"")+Vt.css),Vt.startStyle&&jt.from==f&&(Je+=" "+Vt.startStyle),Vt.endStyle&&jt.to==ie&&(_t||(_t=[])).push(Vt.endStyle,jt.to),Vt.title&&((vt||(vt={})).title=Vt.title),Vt.attributes)for(var pn in Vt.attributes)(vt||(vt={}))[pn]=Vt.attributes[pn];Vt.collapsed&&(!tt||Wn(tt.marker,Vt)<0)&&(tt=jt)}else jt.from>f&&ie>jt.from&&(ie=jt.from)}if(_t)for(var jn=0;jn<_t.length;jn+=2)_t[jn+1]==ie&&(We+=" "+_t[jn]);if(!tt||tt.from==f)for(var xn=0;xn<nt.length;++xn)en(t,0,nt[xn]);if(tt&&(tt.from||0)==f){if(en(t,(tt.to==null?d+1:tt.to)-f,tt.marker,tt.from==null),tt.to==null)return;tt.to==f&&(tt=!1)}}if(f>=d)break;for(var oi=Math.min(d,ie);;){if(D){var Qn=f+D.length;if(!tt){var Tn=Qn>oi?D.slice(0,oi-f):D;t.addToken(t,Tn,W?W+Pe:Pe,Je,f+Tn.length==ie?We:"",ce,vt)}if(Qn>=oi){D=D.slice(oi-f),f=oi;break}f=Qn,Je=""}D=r.slice(s,s=i[v++]),W=ho(i[v++],t.cm.options)}}}function Jt(e,t,i){this.line=t,this.rest=wi(t),this.size=this.rest?It(Ne(this.rest))-i+1:1,this.node=this.text=null,this.hidden=ci(e,t)}function _n(e,t,i){for(var n=[],r,s=t;s<i;s=r){var l=new Jt(e.doc,yt(e.doc,s),s);r=s+l.size,n.push(l)}return n}var Dn=null;function $t(e){Dn?Dn.ops.push(e):e.ownsGroup=Dn={ops:[e],delayedCallbacks:[]}}function Ui(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 r=e.ops[n];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}}while(i<t.length)}function un(e,t){var i=e.ownsGroup;if(!i)return;try{Ui(i)}finally{Dn=null,t(i)}}var Hn=null;function dn(e,t){var i=Rt(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),r;Dn?r=Dn.delayedCallbacks:Hn?r=Hn:(r=Hn=[],setTimeout(ui,0));for(var s=function(d){r.push(function(){return i[d].apply(null,n)})},l=0;l<i.length;++l)s(l)}function ui(){var e=Hn;Hn=null;for(var t=0;t<e.length;++t)e[t]()}function pr(e,t,i,n){for(var r=0;r<t.changes.length;r++){var s=t.changes[r];s=="text"?Ds(e,t):s=="gutter"?ea(e,t,i,n):s=="class"?fo(e,t):s=="widget"&&Ns(e,t,n)}t.changes=null}function mr(e){return e.node==e.text&&(e.node=x("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),O&&N<8&&(e.node.style.zIndex=2)),e.node}function Ms(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=mr(t);t.background=n.insertBefore(x("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function Zo(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Fr(e,t)}function Ds(e,t){var i=t.text.className,n=Zo(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,fo(e,t)):i&&(t.text.className=i)}function fo(e,t){Ms(e,t),t.line.wrapClass?mr(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 ea(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 r=mr(t);t.gutterBackground=x("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),r.insertBefore(t.gutterBackground,t.text)}var s=t.line.gutterMarkers;if(e.options.lineNumbers||s){var l=mr(t),d=t.gutter=x("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(d),l.insertBefore(d,t.text),t.line.gutterClass&&(d.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!s||!s["CodeMirror-linenumbers"])&&(t.lineNumber=d.appendChild(x("div",ti(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var f=0;f<e.display.gutterSpecs.length;++f){var v=e.display.gutterSpecs[f].className,D=s.hasOwnProperty(v)&&s[v];D&&d.appendChild(x("div",[D],"CodeMirror-gutter-elt","left: "+n.gutterLeft[v]+"px; width: "+n.gutterWidth[v]+"px"))}}}function Ns(e,t,i){t.alignable&&(t.alignable=null);for(var n=Y("CodeMirror-linewidget"),r=t.node.firstChild,s=void 0;r;r=s)s=r.nextSibling,n.test(r.className)&&t.node.removeChild(r);ta(e,t,i)}function Is(e,t,i,n){var r=Zo(e,t);return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),fo(e,t),ea(e,t,i,n),ta(e,t,n),t.node}function ta(e,t,i){if(na(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)na(e,t.rest[n],t,i,!1)}function na(e,t,i,n,r){if(!t.widgets)return;for(var s=mr(i),l=0,d=t.widgets;l<d.length;++l){var f=d[l],v=x("div",[f.node],"CodeMirror-linewidget"+(f.className?" "+f.className:""));f.handleMouseEvents||v.setAttribute("cm-ignore-events","true"),js(f,v,i,n),e.display.input.setUneditable(v),r&&f.above?s.insertBefore(v,i.gutter||i.text):s.appendChild(v),dn(f,"redraw")}}function js(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var r=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(r-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=r+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function gr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!C(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;"),T(t.display.measure,x("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function Ci(e,t){for(var i=re(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 Wr(e){return e.lineSpace.offsetTop}function po(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ia(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=T(e.measure,x("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 gi(e){return $e-e.display.nativeBarWidth}function Bi(e){return e.display.scroller.clientWidth-gi(e)-e.display.barWidth}function mo(e){return e.display.scroller.clientHeight-gi(e)-e.display.barHeight}function Us(e,t,i){var n=e.options.lineWrapping,r=n&&Bi(e);if(!t.measure.heights||n&&t.measure.width!=r){var s=t.measure.heights=[];if(n){t.measure.width=r;for(var l=t.text.firstChild.getClientRects(),d=0;d<l.length-1;d++){var f=l[d],v=l[d+1];Math.abs(f.bottom-v.bottom)>2&&s.push((f.bottom+v.top)/2-i.top)}}s.push(i.bottom-i.top)}}function ra(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 r=0;r<e.rest.length;r++)if(It(e.rest[r])>i)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Bs(e,t){t=On(t);var i=It(t),n=e.display.externalMeasured=new Jt(e.doc,t,i);n.lineN=i;var r=n.built=Fr(e,n);return n.text=r.pre,T(e.display.lineMeasure,r.pre),n}function oa(e,t,i,n){return vi(e,qi(e,t),i,n)}function go(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[zi(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function qi(e,t){var i=It(t),n=go(e,i);n&&!n.text?n=null:n&&n.changes&&(pr(e,n,i,xo(e)),e.curOp.forceUpdate=!0),n||(n=Bs(e,t));var r=ra(n,t,i);return{line:t,view:n,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function vi(e,t,i,n,r){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||(Us(e,t.view,t.rect),t.hasHeights=!0),l=Ws(e,t,i,n),l.bogus||(t.cache[s]=l)),{left:l.left,right:l.right,top:r?l.rtop:l.top,bottom:r?l.rbottom:l.bottom}}var aa={left:0,right:0,top:0,bottom:0};function sa(e,t,i){for(var n,r,s,l,d,f,v=0;v<e.length;v+=3)if(d=e[v],f=e[v+1],t<d?(r=0,s=1,l="left"):t<f?(r=t-d,s=r+1):(v==e.length-3||t==f&&e[v+3]>t)&&(s=f-d,r=s-1,t>=f&&(l="right")),r!=null){if(n=e[v+2],d==f&&i==(n.insertLeft?"left":"right")&&(l=i),i=="left"&&r==0)for(;v&&e[v-2]==e[v-3]&&e[v-1].insertLeft;)n=e[(v-=3)+2],l="left";if(i=="right"&&r==f-d)for(;v<e.length-3&&e[v+3]==e[v+4]&&!e[v+5].insertLeft;)n=e[(v+=3)+2],l="right";break}return{node:n,start:r,end:s,collapse:l,coverStart:d,coverEnd:f}}function Fs(e,t){var i=aa;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var r=e.length-1;r>=0&&!((i=e[r]).left!=i.right);r--);return i}function Ws(e,t,i,n){var r=sa(t.map,i,n),s=r.node,l=r.start,d=r.end,f=r.collapse,v;if(s.nodeType==3){for(var D=0;D<4;D++){for(;l&&Be(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+d<r.coverEnd&&Be(t.line.text.charAt(r.coverStart+d));)++d;if(O&&N<9&&l==0&&d==r.coverEnd-r.coverStart?v=s.parentNode.getBoundingClientRect():v=Fs(G(s,l,d).getClientRects(),n),v.left||v.right||l==0)break;d=l,l=l-1,f="right"}O&&N<11&&(v=zs(e.display.measure,v))}else{l>0&&(f=n="right");var W;e.options.lineWrapping&&(W=s.getClientRects()).length>1?v=W[n=="right"?W.length-1:0]:v=s.getBoundingClientRect()}if(O&&N<9&&!l&&(!v||!v.left&&!v.right)){var ce=s.parentNode.getClientRects()[0];ce?v={left:ce.left,right:ce.left+Zi(e.display),top:ce.top,bottom:ce.bottom}:v=aa}for(var ie=v.top-t.rect.top,Pe=v.bottom-t.rect.top,We=(ie+Pe)/2,Je=t.view.measure.heights,tt=0;tt<Je.length-1&&!(We<Je[tt]);tt++);var vt=tt?Je[tt-1]:0,nt=Je[tt],_t={left:(f=="right"?v.right:v.left)-t.rect.left,right:(f=="left"?v.left:v.right)-t.rect.left,top:vt,bottom:nt};return!v.left&&!v.right&&(_t.bogus=!0),e.options.singleCursorHeightPerLine||(_t.rtop=ie,_t.rbottom=Pe),_t}function zs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ft(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 la(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 ua(e){e.display.externalMeasure=null,ge(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)la(e.display.view[t])}function vr(e){ua(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ca(){return k&&X?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ha(){return k&&X?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function vo(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=gr(e.widgets[i]));return t}function zr(e,t,i,n,r){if(!r){var s=vo(t);i.top+=s,i.bottom+=s}if(n=="line")return i;n||(n="local");var l=ii(t);if(n=="local"?l+=Wr(e.display):l-=e.display.viewOffset,n=="page"||n=="window"){var d=e.display.lineSpace.getBoundingClientRect();l+=d.top+(n=="window"?0:ha());var f=d.left+(n=="window"?0:ca());i.left+=f,i.right+=f}return i.top+=l,i.bottom+=l,i}function da(e,t,i){if(i=="div")return t;var n=t.left,r=t.top;if(i=="page")n-=ca(),r-=ha();else if(i=="local"||!i){var s=e.display.sizer.getBoundingClientRect();n+=s.left,r+=s.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:r-l.top}}function yo(e,t,i,n,r){return n||(n=yt(e.doc,t.line)),zr(e,n,oa(e,n,t.ch,r),i)}function hi(e,t,i,n,r,s){n=n||yt(e.doc,t.line),r||(r=qi(e,n));function l(Pe,We){var Je=vi(e,r,Pe,We?"right":"left",s);return We?Je.left=Je.right:Je.right=Je.left,zr(e,n,Je,i)}var d=bt(n,e.doc.direction),f=t.ch,v=t.sticky;if(f>=n.text.length?(f=n.text.length,v="before"):f<=0&&(f=0,v="after"),!d)return l(v=="before"?f-1:f,v=="before");function D(Pe,We,Je){var tt=d[We],vt=tt.level==1;return l(Je?Pe-1:Pe,vt!=Je)}var W=ut(d,f,v),ce=st,ie=D(f,W,v=="before");return ce!=null&&(ie.other=D(f,ce,v!="before")),ie}function fa(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=Zi(e.display)*t.ch);var n=yt(e.doc,t.line),r=ii(n)+Wr(e.display);return{left:i,right:i,top:r,bottom:r+n.height}}function bo(e,t,i,n,r){var s=je(e,t,i);return s.xRel=r,n&&(s.outside=n),s}function Co(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return bo(n.first,0,null,-1,-1);var r=Cn(n,i),s=n.first+n.size-1;if(r>s)return bo(n.first+n.size-1,yt(n,s).text.length,null,1,1);t<0&&(t=0);for(var l=yt(n,r);;){var d=Hs(e,l,r,t,i),f=Ei(l,d.ch+(d.xRel>0||d.outside>0?1:0));if(!f)return d;var v=f.find(1);if(v.line==r)return v;l=yt(n,r=v.line)}}function pa(e,t,i,n){n-=vo(t);var r=t.text.length,s=Lt(function(l){return vi(e,i,l-1).bottom<=n},r,0);return r=Lt(function(l){return vi(e,i,l).top>n},s,r),{begin:s,end:r}}function ma(e,t,i,n){i||(i=qi(e,t));var r=zr(e,t,vi(e,i,n),"line").top;return pa(e,t,i,r)}function _o(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function Hs(e,t,i,n,r){r-=ii(t);var s=qi(e,t),l=vo(t),d=0,f=t.text.length,v=!0,D=bt(t,e.doc.direction);if(D){var W=(e.options.lineWrapping?Vs:Gs)(e,t,i,s,D,n,r);v=W.level!=1,d=v?W.from:W.to-1,f=v?W.to:W.from-1}var ce=null,ie=null,Pe=Lt(function(Bt){var jt=vi(e,s,Bt);return jt.top+=l,jt.bottom+=l,_o(jt,n,r,!1)?(jt.top<=r&&jt.left<=n&&(ce=Bt,ie=jt),!0):!1},d,f),We,Je,tt=!1;if(ie){var vt=n-ie.left<ie.right-n,nt=vt==v;Pe=ce+(nt?0:1),Je=nt?"after":"before",We=vt?ie.left:ie.right}else{!v&&(Pe==f||Pe==d)&&Pe++,Je=Pe==0?"after":Pe==t.text.length?"before":vi(e,s,Pe-(v?1:0)).bottom+l<=r==v?"after":"before";var _t=hi(e,je(i,Pe,Je),"line",t,s);We=_t.left,tt=r<_t.top?-1:r>=_t.bottom?1:0}return Pe=ze(t.text,Pe,1),bo(i,Pe,Je,tt,n-We)}function Gs(e,t,i,n,r,s,l){var d=Lt(function(W){var ce=r[W],ie=ce.level!=1;return _o(hi(e,je(i,ie?ce.to:ce.from,ie?"before":"after"),"line",t,n),s,l,!0)},0,r.length-1),f=r[d];if(d>0){var v=f.level!=1,D=hi(e,je(i,v?f.from:f.to,v?"after":"before"),"line",t,n);_o(D,s,l,!0)&&D.top>l&&(f=r[d-1])}return f}function Vs(e,t,i,n,r,s,l){var d=pa(e,t,n,l),f=d.begin,v=d.end;/\s/.test(t.text.charAt(v-1))&&v--;for(var D=null,W=null,ce=0;ce<r.length;ce++){var ie=r[ce];if(ie.from>=v||ie.to<=f)continue;var Pe=ie.level!=1,We=vi(e,n,Pe?Math.min(v,ie.to)-1:Math.max(f,ie.from)).right,Je=We<s?s-We+1e9:We-s;(!D||W>Je)&&(D=ie,W=Je)}return D||(D=r[r.length-1]),D.from<f&&(D={from:f,to:D.to,level:D.level}),D.to>v&&(D={from:D.from,to:v,level:D.level}),D}var Fi;function Qi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Fi==null){Fi=x("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Fi.appendChild(document.createTextNode("x")),Fi.appendChild(x("br"));Fi.appendChild(document.createTextNode("x"))}T(e.measure,Fi);var i=Fi.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),ge(e.measure),i||1}function Zi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=x("span","xxxxxxxxxx"),i=x("pre",[t],"CodeMirror-line-like");T(e.measure,i);var n=t.getBoundingClientRect(),r=(n.right-n.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function xo(e){for(var t=e.display,i={},n={},r=t.gutters.clientLeft,s=t.gutters.firstChild,l=0;s;s=s.nextSibling,++l){var d=e.display.gutterSpecs[l].className;i[d]=s.offsetLeft+s.clientLeft+r,n[d]=s.clientWidth}return{fixedPos:Eo(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function Eo(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ga(e){var t=Qi(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/Zi(e.display)-3);return function(r){if(ci(e.doc,r))return 0;var s=0;if(r.widgets)for(var l=0;l<r.widgets.length;l++)r.widgets[l].height&&(s+=r.widgets[l].height);return i?s+(Math.ceil(r.text.length/n)||1)*t:s+t}}function wo(e){var t=e.doc,i=ga(e);t.iter(function(n){var r=i(n);r!=n.height&&qt(n,r)})}function Wi(e,t,i,n){var r=e.display;if(!i&&re(t).getAttribute("cm-not-content")=="true")return null;var s,l,d=r.lineSpace.getBoundingClientRect();try{s=t.clientX-d.left,l=t.clientY-d.top}catch(W){return null}var f=Co(e,s,l),v;if(n&&f.xRel>0&&(v=yt(e.doc,f.line).text).length==f.ch){var D=te(v,v.length,e.options.tabSize)-v.length;f=je(f.line,Math.max(0,Math.round((s-ia(e.display).left)/Zi(e.display))-D))}return f}function zi(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 Jn(e,t,i,n){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),n||(n=0);var r=e.display;if(n&&i<r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>t)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)nn&&Si(e.doc,t)<r.viewTo&&Ti(e);else if(i<=r.viewFrom)nn&&Br(e.doc,i+n)>r.viewFrom?Ti(e):(r.viewFrom+=n,r.viewTo+=n);else if(t<=r.viewFrom&&i>=r.viewTo)Ti(e);else if(t<=r.viewFrom){var s=Hr(e,i,i+n,1);s?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=n):Ti(e)}else if(i>=r.viewTo){var l=Hr(e,t,t,-1);l?(r.view=r.view.slice(0,l.index),r.viewTo=l.lineN):Ti(e)}else{var d=Hr(e,t,t,-1),f=Hr(e,i,i+n,1);d&&f?(r.view=r.view.slice(0,d.index).concat(_n(e,d.lineN,f.lineN)).concat(r.view.slice(f.index)),r.viewTo+=n):Ti(e)}var v=r.externalMeasured;v&&(i<v.lineN?v.lineN+=n:t<v.lineN+v.size&&(r.externalMeasured=null))}function Ri(e,t,i){e.curOp.viewChanged=!0;var n=e.display,r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var s=n.view[zi(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);_e(l,i)==-1&&l.push(i)}function Ti(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Hr(e,t,i,n){var r=zi(e,t),s,l=e.display.view;if(!nn||i==e.doc.first+e.doc.size)return{index:r,lineN:i};for(var d=e.display.viewFrom,f=0;f<r;f++)d+=l[f].size;if(d!=t){if(n>0){if(r==l.length-1)return null;s=d+l[r].size-t,r++}else s=d-t;t+=s,i+=s}for(;Si(e.doc,i)!=i;){if(r==(n<0?0:l.length-1))return null;i+=n*l[r-(n<0?1:0)].size,r+=n}return{index:r,lineN:i}}function Xs(e,t,i){var n=e.display,r=n.view;r.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=_n(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=_n(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(zi(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(_n(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,zi(e,i)))),n.viewTo=i}function va(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var r=t[n];!r.hidden&&(!r.node||r.changes)&&++i}return i}function yr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ya(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},r=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 d=i.sel.ranges[l];if(d.from().line>=e.display.viewTo||d.to().line<e.display.viewFrom)continue;var f=d.empty();(f||e.options.showCursorWhenSelecting)&&ba(e,d.head,r),f||Ks(e,d,s)}return n}function ba(e,t,i){var n=hi(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=i.appendChild(x("div","\xA0","CodeMirror-cursor"));if(r.style.left=n.left+"px",r.style.top=n.top+"px",r.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var s=i.appendChild(x("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 Gr(e,t){return e.top-t.top||e.left-t.left}function Ks(e,t,i){var n=e.display,r=e.doc,s=document.createDocumentFragment(),l=ia(e.display),d=l.left,f=Math.max(n.sizerWidth,Bi(e)-n.sizer.offsetLeft)-l.right,v=r.direction=="ltr";function D(nt,_t,Bt,jt){_t<0&&(_t=0),_t=Math.round(_t),jt=Math.round(jt),s.appendChild(x("div",null,"CodeMirror-selected","position: absolute; left: "+nt+`px;
top: `+_t+"px; width: "+(Bt==null?f-nt:Bt)+`px;
height: `+(jt-_t)+"px"))}function W(nt,_t,Bt){var jt=yt(r,nt),Vt=jt.text.length,pn,jn;function xn(Tn,Zn){return yo(e,je(nt,Tn),"div",jt,Zn)}function oi(Tn,Zn,Gn){var Ln=ma(e,jt,null,Tn),An=Zn=="ltr"==(Gn=="after")?"left":"right",Sn=Gn=="after"?Ln.begin:Ln.end-(/\s/.test(jt.text.charAt(Ln.end-1))?2:1);return xn(Sn,An)[An]}var Qn=bt(jt,r.direction);return ft(Qn,_t||0,Bt==null?Vt:Bt,function(Tn,Zn,Gn,Ln){var An=Gn=="ltr",Sn=xn(Tn,An?"left":"right"),ei=xn(Zn-1,An?"right":"left"),dr=_t==null&&Tn==0,Di=Bt==null&&Zn==Vt,Xn=Ln==0,yi=!Qn||Ln==Qn.length-1;if(ei.top-Sn.top<=3){var Un=(v?dr:Di)&&Xn,Yo=(v?Di:dr)&&yi,xi=Un?d:(An?Sn:ei).left,Ki=Yo?f:(An?ei:Sn).right;D(xi,Sn.top,Ki-xi,Sn.bottom)}else{var $i,$n,fr,Jo;An?($i=v&&dr&&Xn?d:Sn.left,$n=v?f:oi(Tn,Gn,"before"),fr=v?d:oi(Zn,Gn,"after"),Jo=v&&Di&&yi?f:ei.right):($i=v?oi(Tn,Gn,"before"):d,$n=!v&&dr&&Xn?f:Sn.right,fr=!v&&Di&&yi?d:ei.left,Jo=v?oi(Zn,Gn,"after"):f),D($i,Sn.top,$n-$i,Sn.bottom),Sn.bottom<ei.top&&D(d,Sn.bottom,null,ei.top),D(fr,ei.top,Jo-fr,ei.bottom)}(!pn||Gr(Sn,pn)<0)&&(pn=Sn),Gr(ei,pn)<0&&(pn=ei),(!jn||Gr(Sn,jn)<0)&&(jn=Sn),Gr(ei,jn)<0&&(jn=ei)}),{start:pn,end:jn}}var ce=t.from(),ie=t.to();if(ce.line==ie.line)W(ce.line,ce.ch,ie.ch);else{var Pe=yt(r,ce.line),We=yt(r,ie.line),Je=On(Pe)==On(We),tt=W(ce.line,ce.ch,Je?Pe.text.length+1:null).end,vt=W(ie.line,Je?0:null,ie.ch).start;Je&&(tt.top<vt.top-2?(D(tt.right,tt.top,null,tt.bottom),D(d,vt.top,vt.left,vt.bottom)):D(tt.right,tt.top,vt.left-tt.right,tt.bottom)),tt.bottom<vt.top&&D(d,tt.bottom,null,vt.top)}i.appendChild(s)}function So(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()||er(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Ca(e){e.state.focused||(e.display.input.focus(),ko(e))}function _a(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,er(e))},100)}function ko(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(ke(e,"focus",e,t),e.state.focused=!0,J(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),A&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),So(e)}function er(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(ke(e,"blur",e,t),e.state.focused=!1,m(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Vr(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var r=t.view[n],s=e.options.lineWrapping,l=void 0,d=0;if(r.hidden)continue;if(O&&N<8){var f=r.node.offsetTop+r.node.offsetHeight;l=f-i,i=f}else{var v=r.node.getBoundingClientRect();l=v.bottom-v.top,!s&&r.text.firstChild&&(d=r.text.firstChild.getBoundingClientRect().right-v.left-1)}var D=r.line.height-l;if((D>.005||D<-.005)&&(qt(r.line,l),xa(r.line),r.rest))for(var W=0;W<r.rest.length;W++)xa(r.rest[W]);if(d>e.display.sizerWidth){var ce=Math.ceil(d/Zi(e.display));ce>e.display.maxLineLength&&(e.display.maxLineLength=ce,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function xa(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 Xr(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Wr(e));var r=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,s=Cn(t,n),l=Cn(t,r);if(i&&i.ensure){var d=i.ensure.from.line,f=i.ensure.to.line;d<s?(s=d,l=Cn(t,ii(yt(t,d))+e.wrapper.clientHeight)):Math.min(f,t.lastLine())>=l&&(s=Cn(t,ii(yt(t,f))-e.wrapper.clientHeight),l=f)}return{from:s,to:Math.max(l,s+1)}}function $s(e,t){if(Ae(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),r=null;if(t.top+n.top<0?r=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),r!=null&&!F){var s=x("div","\u200B",null,`position: absolute;
top: `+(t.top-i.viewOffset-Wr(e.display))+`px;
height: `+(t.bottom-t.top+gi(e)+i.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(r),e.display.lineSpace.removeChild(s)}}function Ys(e,t,i,n){n==null&&(n=0);var r;!e.options.lineWrapping&&t==i&&(t=t.ch?je(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?je(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,d=hi(e,t),f=!i||i==t?d:hi(e,i);r={left:Math.min(d.left,f.left),top:Math.min(d.top,f.top)-n,right:Math.max(d.left,f.left),bottom:Math.max(d.bottom,f.bottom)+n};var v=Ro(e,r),D=e.doc.scrollTop,W=e.doc.scrollLeft;if(v.scrollTop!=null&&(Cr(e,v.scrollTop),Math.abs(e.doc.scrollTop-D)>1&&(l=!0)),v.scrollLeft!=null&&(Hi(e,v.scrollLeft),Math.abs(e.doc.scrollLeft-W)>1&&(l=!0)),!l)break}return r}function Js(e,t){var i=Ro(e,t);i.scrollTop!=null&&Cr(e,i.scrollTop),i.scrollLeft!=null&&Hi(e,i.scrollLeft)}function Ro(e,t){var i=e.display,n=Qi(e.display);t.top<0&&(t.top=0);var r=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,s=mo(e),l={};t.bottom-t.top>s&&(t.bottom=t.top+s);var d=e.doc.height+po(i),f=t.top<n,v=t.bottom>d-n;if(t.top<r)l.scrollTop=f?0:t.top;else if(t.bottom>r+s){var D=Math.min(t.top,(v?d:t.bottom)-s);D!=r&&(l.scrollTop=D)}var W=e.options.fixedGutter?0:i.gutters.offsetWidth,ce=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-W,ie=Bi(e)-i.gutters.offsetWidth,Pe=t.right-t.left>ie;return Pe&&(t.right=t.left+ie),t.left<10?l.scrollLeft=0:t.left<ce?l.scrollLeft=Math.max(0,t.left+W-(Pe?0:10)):t.right>ie+ce-3&&(l.scrollLeft=t.right+(Pe?0:10)-ie),l}function To(e,t){if(t==null)return;Kr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function tr(e){Kr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function br(e,t,i){(t!=null||i!=null)&&Kr(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function qs(e,t){Kr(e),e.curOp.scrollToPos=t}function Kr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=fa(e,t.from),n=fa(e,t.to);Ea(e,i,n,t.margin)}}function Ea(e,t,i,n){var r=Ro(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});br(e,r.scrollLeft,r.scrollTop)}function Cr(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;Z||Po(e,{top:t}),wa(e,t,!0),Z&&Po(e),Er(e,100)}function wa(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 Hi(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,Aa(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function _r(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+po(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+gi(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Gi=function(e,t,i){this.cm=i;var n=this.vert=x("div",[x("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=x("div",[x("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=r.tabIndex=-1,e(n),e(r),Se(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Se(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,O&&N<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Gi.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 r=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+r)+"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}},Gi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Gi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Gi.prototype.zeroWidthHack=function(){var e=se&&!$?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Oe,this.disableVert=new Oe},Gi.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function n(){var r=e.getBoundingClientRect(),s=i=="vert"?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1);s!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},Gi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var xr=function(){};xr.prototype.update=function(){return{bottom:0,right:0}},xr.prototype.setScrollLeft=function(){},xr.prototype.setScrollTop=function(){},xr.prototype.clear=function(){};function nr(e,t){t||(t=_r(e));var i=e.display.barWidth,n=e.display.barHeight;Sa(e,t);for(var r=0;r<4&&i!=e.display.barWidth||n!=e.display.barHeight;r++)i!=e.display.barWidth&&e.options.lineWrapping&&Vr(e),Sa(e,_r(e)),i=e.display.barWidth,n=e.display.barHeight}function Sa(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 ka={native:Gi,null:xr};function Ra(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&m(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new ka[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Se(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"?Hi(e,t):Cr(e,t)},e),e.display.scrollbars.addClass&&J(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function Vi(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:++Qs},$t(e.curOp)}function Xi(e){var t=e.curOp;t&&un(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;Zs(i)})}function Zs(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 r=0;r<t.length;r++)nl(t[r]);for(var s=0;s<t.length;s++)il(t[s]);for(var l=0;l<t.length;l++)rl(t[l])}function el(e){var t=e.cm,i=t.display;al(t),e.updateMaxLine&&bi(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 $r(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ao(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Vr(t),e.barMeasure=_r(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=oa(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+gi(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Bi(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&&Hi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==E();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&nr(t,e.barMeasure),e.updatedDisplay&&Lo(t,e.barMeasure),e.selectionChanged&&So(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&Ca(e.cm)}function rl(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&Ta(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&wa(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Hi(t,e.scrollLeft,!0,!0),e.scrollToPos){var r=Ys(t,o(n,e.scrollToPos.from),o(n,e.scrollToPos.to),e.scrollToPos.margin);$s(t,r)}var s=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(s)for(var d=0;d<s.length;++d)s[d].lines.length||ke(s[d],"hide");if(l)for(var f=0;f<l.length;++f)l[f].lines.length&&ke(l[f],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ke(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ri(e,t){if(e.curOp)return t();Vi(e);try{return t()}finally{Xi(e)}}function Nn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Vi(e);try{return t.apply(e,arguments)}finally{Xi(e)}}}function Kn(e){return function(){if(this.curOp)return e.apply(this,arguments);Vi(this);try{return e.apply(this,arguments)}finally{Xi(this)}}}function In(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Vi(t);try{return e.apply(this,arguments)}finally{Xi(t)}}}function Er(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,w(ol,e))}function ol(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=he(e,t.highlightFrontier),r=[];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,d=s.text.length>e.options.maxHighlightLength?Xt(t.mode,n.state):null,f=V(e,s,n,!0);d&&(n.state=d),s.styles=f.styles;var v=s.styleClasses,D=f.classes;D?s.styleClasses=D:v&&(s.styleClasses=null);for(var W=!l||l.length!=s.styles.length||v!=D&&(!v||!D||v.bgClass!=D.bgClass||v.textClass!=D.textClass),ce=0;!W&&ce<l.length;++ce)W=l[ce]!=s.styles[ce];W&&r.push(n.line),s.stateAfter=n.save(),n.nextLine()}else s.text.length<=e.options.maxHighlightLength&&wt(e,s.text,n),s.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return Er(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),r.length&&ri(e,function(){for(var s=0;s<r.length;s++)Ri(e,r[s],"text")})}var $r=function(e,t,i){var n=e.display;this.viewport=t,this.visible=Xr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Bi(e),this.force=i,this.dims=xo(e),this.events=[]};$r.prototype.signal=function(e,t){j(e,t)&&this.events.push(arguments)},$r.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ke.apply(null,this.events[e])};function al(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=gi(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=gi(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=E();if(!t||!C(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&C(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==E())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&C(document.body,e.anchorNode)&&C(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 Ao(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return Ti(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&&va(e)==0)return!1;Pa(e)&&(Ti(e),t.dims=xo(e));var r=n.first+n.size,s=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(r,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(r,i.viewTo)),nn&&(s=Si(e.doc,s),l=Br(e.doc,l));var d=s!=i.viewFrom||l!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Xs(e,s,l),i.viewOffset=ii(yt(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var f=va(e);if(!d&&f==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var v=sl(e);return f>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),f>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(v),ge(i.cursorDiv),ge(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,d&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Er(e,400)),i.updateLineNumbers=null,!0}function Ta(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Bi(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+po(e.display)-mo(e),i.top)}),t.visible=Xr(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Xr(e.display,e.doc,i));if(!Ao(e,t))break;Vr(e);var r=_r(e);yr(e),nr(e,r),Lo(e,r),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 Po(e,t){var i=new $r(e,t);if(Ao(e,i)){Vr(e),Ta(e,i);var n=_r(e);yr(e),nr(e,n),Lo(e,n),i.finish()}}function ul(e,t,i){var n=e.display,r=e.options.lineNumbers,s=n.lineDiv,l=s.firstChild;function d(Pe){var We=Pe.nextSibling;return A&&se&&e.display.currentWheelTarget==Pe?Pe.style.display="none":Pe.parentNode.removeChild(Pe),We}for(var f=n.view,v=n.viewFrom,D=0;D<f.length;D++){var W=f[D];if(!W.hidden)if(!W.node||W.node.parentNode!=s){var ce=Is(e,W,v,i);s.insertBefore(ce,l)}else{for(;l!=W.node;)l=d(l);var ie=r&&t!=null&&t<=v&&W.lineNumber;W.changes&&(_e(W.changes,"gutter")>-1&&(ie=!1),pr(e,W,v,i)),ie&&(ge(W.lineNumber),W.lineNumber.appendChild(document.createTextNode(ti(e.options,v)))),l=W.node.nextSibling}v+=W.size}for(;l;)l=d(l)}function Oo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Lo(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+gi(e)+"px"}function Aa(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=Eo(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=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 d=i[l].alignable;if(d)for(var f=0;f<d.length;f++)d[f].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=n+r+"px")}function Pa(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=ti(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var r=n.measure.appendChild(x("div",[x("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=r.firstChild.offsetWidth,l=r.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",Oo(e.display),!0}return!1}function Mo(e,t){for(var i=[],n=!1,r=0;r<e.length;r++){var s=e[r],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 Oa(e){var t=e.gutters,i=e.gutterSpecs;ge(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var r=i[n],s=r.className,l=r.style,d=t.appendChild(x("div",null,"CodeMirror-gutter "+s));l&&(d.style.cssText=l),s=="CodeMirror-linenumbers"&&(e.lineGutter=d,d.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Oo(e)}function wr(e){Oa(e.display),Jn(e),Aa(e)}function cl(e,t,i,n){var r=this;this.input=i,r.scrollbarFiller=x("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=x("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=K("div",null,"CodeMirror-code"),r.selectionDiv=x("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=x("div",null,"CodeMirror-cursors"),r.measure=x("div",null,"CodeMirror-measure"),r.lineMeasure=x("div",null,"CodeMirror-measure"),r.lineSpace=K("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var s=K("div",[r.lineSpace],"CodeMirror-lines");r.mover=x("div",[s],null,"position: relative"),r.sizer=x("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=x("div",null,null,"position: absolute; height: "+$e+"px; width: 1px;"),r.gutters=x("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=x("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=x("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),O&&N<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),!A&&!(Z&&oe)&&(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,r.gutterSpecs=Mo(n.gutters,n.lineNumbers),Oa(r),i.init(r)}var Yr=0,si=null;O?si=-.53:Z?si=15:k?si=-.7:q&&(si=-1/3);function La(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 hl(e){var t=La(e);return t.x*=si,t.y*=si,t}function Ma(e,t){var i=La(t),n=i.x,r=i.y,s=e.display,l=s.scroller,d=l.scrollWidth>l.clientWidth,f=l.scrollHeight>l.clientHeight;if(!(n&&d||r&&f))return;if(r&&se&&A){e:for(var v=t.target,D=s.view;v!=l;v=v.parentNode)for(var W=0;W<D.length;W++)if(D[W].node==v){e.display.currentWheelTarget=v;break e}}if(n&&!Z&&!R&&si!=null){r&&f&&Cr(e,Math.max(0,l.scrollTop+r*si)),Hi(e,Math.max(0,l.scrollLeft+n*si)),(!r||r&&f)&&b(t),s.wheelStartX=null;return}if(r&&si!=null){var ce=r*si,ie=e.doc.scrollTop,Pe=ie+s.wrapper.clientHeight;ce<0?ie=Math.max(0,ie+ce-50):Pe=Math.min(e.doc.height,Pe+ce+50),Po(e,{top:ie,bottom:Pe})}Yr<20&&(s.wheelStartX==null?(s.wheelStartX=l.scrollLeft,s.wheelStartY=l.scrollTop,s.wheelDX=n,s.wheelDY=r,setTimeout(function(){if(s.wheelStartX==null)return;var We=l.scrollLeft-s.wheelStartX,Je=l.scrollTop-s.wheelStartY,tt=Je&&s.wheelDY&&Je/s.wheelDY||We&&s.wheelDX&&We/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!tt)return;si=(si*Yr+tt)/(Yr+1),++Yr},200)):(s.wheelDX+=n,s.wheelDY+=r))}var li=function(e,t){this.ranges=e,this.primIndex=t};li.prototype.primary=function(){return this.ranges[this.primIndex]},li.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(!an(i.anchor,n.anchor)||!an(i.head,n.head))return!1}return!0},li.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new sn(hn(this.ranges[t].anchor),hn(this.ranges[t].head));return new li(e,this.primIndex)},li.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},li.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(et(t,n.from())>=0&&et(e,n.to())<=0)return i}return-1};var sn=function(e,t){this.anchor=e,this.head=t};sn.prototype.from=function(){return En(this.anchor,this.head)},sn.prototype.to=function(){return gn(this.anchor,this.head)},sn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function di(e,t,i){var n=e&&e.options.selectionsMayTouch,r=t[i];t.sort(function(ce,ie){return et(ce.from(),ie.from())}),i=_e(t,r);for(var s=1;s<t.length;s++){var l=t[s],d=t[s-1],f=et(d.to(),l.from());if(n&&!l.empty()?f>0:f>=0){var v=En(d.from(),l.from()),D=gn(d.to(),l.to()),W=d.empty()?l.from()==l.head:d.from()==d.head;s<=i&&--i,t.splice(--s,2,new sn(W?D:v,W?v:D))}}return new li(t,i)}function Ai(e,t){return new li([new sn(e,t||e)],0)}function Pi(e){return e.text?je(e.from.line+e.text.length-1,Ne(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Da(e,t){if(et(e,t.from)<0)return e;if(et(e,t.to)<=0)return Pi(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+=Pi(t).ch-t.to.ch),je(i,n)}function Do(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var r=e.sel.ranges[n];i.push(new sn(Da(r.anchor,t),Da(r.head,t)))}return di(e.cm,i,e.sel.primIndex)}function Na(e,t,i){return e.line==t.line?je(i.line,e.ch-t.ch+i.ch):je(i.line+(e.line-t.line),e.ch)}function dl(e,t,i){for(var n=[],r=je(e.first,0),s=r,l=0;l<t.length;l++){var d=t[l],f=Na(d.from,r,s),v=Na(Pi(d),r,s);if(r=d.to,s=v,i=="around"){var D=e.sel.ranges[l],W=et(D.head,D.anchor)<0;n[l]=new sn(W?v:f,W?f:v)}else n[l]=new sn(f,f)}return new li(n,e.sel.primIndex)}function No(e){e.doc.mode=dt(e.options,e.doc.modeOption),Sr(e)}function Sr(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,Er(e,100),e.state.modeGen++,e.curOp&&Jn(e)}function Ia(e,t){return t.from.ch==0&&t.to.ch==0&&Ne(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Io(e,t,i,n){function r(vt){return i?i[vt]:null}function s(vt,nt,_t){uo(vt,nt,_t,n),dn(vt,"change",vt,t)}function l(vt,nt){for(var _t=[],Bt=vt;Bt<nt;++Bt)_t.push(new ki(v[Bt],r(Bt),n));return _t}var d=t.from,f=t.to,v=t.text,D=yt(e,d.line),W=yt(e,f.line),ce=Ne(v),ie=r(v.length-1),Pe=f.line-d.line;if(t.full)e.insert(0,l(0,v.length)),e.remove(v.length,e.size-v.length);else if(Ia(e,t)){var We=l(0,v.length-1);s(W,W.text,ie),Pe&&e.remove(d.line,Pe),We.length&&e.insert(d.line,We)}else if(D==W)if(v.length==1)s(D,D.text.slice(0,d.ch)+ce+D.text.slice(f.ch),ie);else{var Je=l(1,v.length-1);Je.push(new ki(ce+D.text.slice(f.ch),ie,n)),s(D,D.text.slice(0,d.ch)+v[0],r(0)),e.insert(d.line+1,Je)}else if(v.length==1)s(D,D.text.slice(0,d.ch)+v[0]+W.text.slice(f.ch),r(0)),e.remove(d.line+1,Pe);else{s(D,D.text.slice(0,d.ch)+v[0],r(0)),s(W,ce+W.text.slice(f.ch),ie);var tt=l(1,v.length-1);Pe>1&&e.remove(d.line+1,Pe-1),e.insert(d.line+1,tt)}dn(e,"change",e,t)}function Oi(e,t,i){function n(r,s,l){if(r.linked)for(var d=0;d<r.linked.length;++d){var f=r.linked[d];if(f.doc==s)continue;var v=l&&f.sharedHist;if(i&&!v)continue;t(f.doc,v),n(f.doc,r,v)}}n(e,null,!0)}function ja(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,wo(e),No(e),Ua(e),e.options.lineWrapping||bi(e),e.options.mode=t.modeOption,Jn(e)}function Ua(e){(e.doc.direction=="rtl"?J:m)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){ri(e,function(){Ua(e),Jn(e)})}function Jr(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 jo(e,t){var i={from:hn(t.from),to:Pi(t),text:Yt(e,t.from,t.to)};return Wa(e,i,t.from.line,t.to.line+1),Oi(e,function(n){return Wa(n,i,t.from.line,t.to.line+1)},!0),i}function Ba(e){for(;e.length;){var t=Ne(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ba(e.done),Ne(e.done);if(e.done.length&&!Ne(e.done).ranges)return Ne(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ne(e.done)}function Fa(e,t,i,n){var r=e.history;r.undone.length=0;var s=+new Date,l,d;if((r.lastOp==n||r.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&r.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=pl(r,r.lastOp==n)))d=Ne(l.changes),et(t.from,t.to)==0&&et(t.from,d.to)==0?d.to=Pi(t):l.changes.push(jo(e,t));else{var f=Ne(r.done);for((!f||!f.ranges)&&qr(e.sel,r.done),l={changes:[jo(e,t)],generation:r.generation},r.done.push(l);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(i),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=s,r.lastOp=r.lastSelOp=n,r.lastOrigin=r.lastSelOrigin=t.origin,d||ke(e,"historyAdded")}function ml(e,t,i,n){var r=t.charAt(0);return r=="*"||r=="+"&&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 r=e.history,s=n&&n.origin;i==r.lastSelOp||s&&r.lastSelOrigin==s&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==s||ml(e,s,Ne(r.done),t))?r.done[r.done.length-1]=t:qr(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=s,r.lastSelOp=i,n&&n.clearRedo!==!1&&Ba(r.undone)}function qr(e,t){var i=Ne(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Wa(e,t,i,n){var r=t["spans_"+e.id],s=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(l){l.markedSpans&&((r||(r=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=[],r=0;r<t.text.length;++r)n.push(vl(i[r]));return n}function za(e,t){var i=yl(e,t),n=Fn(e,t);if(!i)return n;if(!n)return i;for(var r=0;r<i.length;++r){var s=i[r],l=n[r];if(s&&l){e:for(var d=0;d<l.length;++d){for(var f=l[d],v=0;v<s.length;++v)if(s[v].marker==f.marker)continue e;s.push(f)}}else l&&(i[r]=l)}return i}function ir(e,t,i){for(var n=[],r=0;r<e.length;++r){var s=e[r];if(s.ranges){n.push(i?li.prototype.deepCopy.call(s):s);continue}var l=s.changes,d=[];n.push({changes:d});for(var f=0;f<l.length;++f){var v=l[f],D=void 0;if(d.push({from:v.from,to:v.to,text:v.text}),t)for(var W in v)(D=W.match(/^spans_(\d+)$/))&&(_e(t,Number(D[1]))>-1&&(Ne(d)[W]=v[W],delete v[W]))}}return n}function Uo(e,t,i,n){if(n){var r=e.anchor;if(i){var s=et(t,r)<0;s!=et(i,r)<0?(r=t,t=i):s!=et(t,i)<0&&(t=i)}return new sn(r,t)}else return new sn(i||t,t)}function Qr(e,t,i,n,r){r==null&&(r=e.cm&&(e.cm.display.shift||e.extend)),Vn(e,new li([Uo(e.sel.primary(),t,i,r)],0),n)}function Ha(e,t,i){for(var n=[],r=e.cm&&(e.cm.display.shift||e.extend),s=0;s<e.sel.ranges.length;s++)n[s]=Uo(e.sel.ranges[s],t[s],null,r);var l=di(e.cm,n,e.sel.primIndex);Vn(e,l,i)}function Bo(e,t,i,n){var r=e.sel.ranges.slice(0);r[t]=i,Vn(e,di(e.cm,r,e.sel.primIndex),n)}function Ga(e,t,i,n){Vn(e,Ai(t,i),n)}function bl(e,t,i){var n={ranges:t.ranges,update:function(r){this.ranges=[];for(var s=0;s<r.length;s++)this.ranges[s]=new sn(o(e,r[s].anchor),o(e,r[s].head))},origin:i&&i.origin};return ke(e,"beforeSelectionChange",e,n),e.cm&&ke(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?di(e.cm,n.ranges,n.ranges.length-1):t}function Va(e,t,i){var n=e.history.done,r=Ne(n);r&&r.ranges?(n[n.length-1]=t,Zr(e,t,i)):Vn(e,t,i)}function Vn(e,t,i){Zr(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function Zr(e,t,i){(j(e,"beforeSelectionChange")||e.cm&&j(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(et(t.primary().head,e.sel.primary().head)<0?-1:1);Xa(e,$a(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&tr(e.cm)}function Xa(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,M(e.cm)),dn(e,"cursorActivity",e)}function Ka(e){Xa(e,$a(e,e.sel,null,!1))}function $a(e,t,i,n){for(var r,s=0;s<t.ranges.length;s++){var l=t.ranges[s],d=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[s],f=eo(e,l.anchor,d&&d.anchor,i,n),v=eo(e,l.head,d&&d.head,i,n);(r||f!=l.anchor||v!=l.head)&&(r||(r=t.ranges.slice(0,s)),r[s]=new sn(f,v))}return r?di(e.cm,r,t.primIndex):t}function rr(e,t,i,n,r){var s=yt(e,t.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var d=s.markedSpans[l],f=d.marker,v="selectLeft"in f?!f.selectLeft:f.inclusiveLeft,D="selectRight"in f?!f.selectRight:f.inclusiveRight;if((d.from==null||(v?d.from<=t.ch:d.from<t.ch))&&(d.to==null||(D?d.to>=t.ch:d.to>t.ch))){if(r&&(ke(f,"beforeCursorEnter"),f.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!f.atomic)continue;if(i){var W=f.find(n<0?1:-1),ce=void 0;if((n<0?D:v)&&(W=Ya(e,W,-n,W&&W.line==t.line?s:null)),W&&W.line==t.line&&(ce=et(W,i))&&(n<0?ce<0:ce>0))return rr(e,W,t,n,r)}var ie=f.find(n<0?-1:1);return(n<0?v:D)&&(ie=Ya(e,ie,n,ie.line==t.line?s:null)),ie?rr(e,ie,t,n,r):null}}return t}function eo(e,t,i,n,r){var s=n||1,l=rr(e,t,i,s,r)||!r&&rr(e,t,i,s,!0)||rr(e,t,i,-s,r)||!r&&rr(e,t,i,-s,!0);return l||(e.cantEdit=!0,je(e.first,0))}function Ya(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,je(t.line-1)):null:i>0&&t.ch==(n||yt(e,t.line)).text.length?t.line<e.first+e.size-1?je(t.line+1,0):null:new je(t.line,t.ch+i)}function Ja(e){e.setSelection(je(e.firstLine(),0),je(e.lastLine()),Te)}function qa(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(r,s,l,d){r&&(n.from=o(e,r)),s&&(n.to=o(e,s)),l&&(n.text=l),d!==void 0&&(n.origin=d)}),ke(e,"beforeChange",e,n),e.cm&&ke(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 or(e,t,i){if(e.cm){if(!e.cm.curOp)return Nn(e.cm,or)(e,t,i);if(e.cm.state.suppressEdits)return}if((j(e,"beforeChange")||e.cm&&j(e.cm,"beforeChange"))&&(t=qa(e,t,!0),!t))return;var n=mn&&!i&&Ni(e,t.from,t.to);if(n)for(var r=n.length-1;r>=0;--r)Qa(e,{from:n[r].from,to:n[r].to,text:r?[""]:t.text,origin:t.origin});else Qa(e,t)}function Qa(e,t){if(t.text.length==1&&t.text[0]==""&&et(t.from,t.to)==0)return;var i=Do(e,t);Fa(e,t,i,e.cm?e.cm.curOp.id:NaN),kr(e,t,i,Fn(e,t));var n=[];Oi(e,function(r,s){!s&&_e(n,r.history)==-1&&(ns(r.history,t),n.push(r.history)),kr(r,t,null,Fn(r,t))})}function to(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var r=e.history,s,l=e.sel,d=t=="undo"?r.done:r.undone,f=t=="undo"?r.undone:r.done,v=0;v<d.length&&!(s=d[v],i?s.ranges&&!s.equals(e.sel):!s.ranges);v++);if(v==d.length)return;for(r.lastOrigin=r.lastSelOrigin=null;;)if(s=d.pop(),s.ranges){if(qr(s,f),i&&!s.equals(e.sel)){Vn(e,s,{clearRedo:!1});return}l=s}else if(n){d.push(s);return}else break;var D=[];qr(l,f),f.push({changes:D,generation:r.generation}),r.generation=s.generation||++r.maxGeneration;for(var W=j(e,"beforeChange")||e.cm&&j(e.cm,"beforeChange"),ce=function(We){var Je=s.changes[We];if(Je.origin=t,W&&!qa(e,Je,!1))return d.length=0,{};D.push(jo(e,Je));var tt=We?Do(e,Je):Ne(d);kr(e,Je,tt,za(e,Je)),!We&&e.cm&&e.cm.scrollIntoView({from:Je.from,to:Pi(Je)});var vt=[];Oi(e,function(nt,_t){!_t&&_e(vt,nt.history)==-1&&(ns(nt.history,Je),vt.push(nt.history)),kr(nt,Je,null,za(nt,Je))})},ie=s.changes.length-1;ie>=0;--ie){var Pe=ce(ie);if(Pe)return Pe.v}}function Za(e,t){if(t==0)return;if(e.first+=t,e.sel=new li(be(e.sel.ranges,function(r){return new sn(je(r.anchor.line+t,r.anchor.ch),je(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){Jn(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)Ri(e.cm,n,"gutter")}}function kr(e,t,i,n){if(e.cm&&!e.cm.curOp)return Nn(e.cm,kr)(e,t,i,n);if(t.to.line<e.first){Za(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 r=t.text.length-1-(e.first-t.from.line);Za(e,r),t={from:je(e.first,0),to:je(t.to.line+r,t.to.ch),text:[Ne(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:je(s,yt(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Yt(e,t.from,t.to),i||(i=Do(e,t)),e.cm?Cl(e.cm,t,n):Io(e,t,n),Zr(e,i,Te),e.cantEdit&&eo(e,je(e.firstLine(),0))&&(e.cantEdit=!1)}function Cl(e,t,i){var n=e.doc,r=e.display,s=t.from,l=t.to,d=!1,f=s.line;e.options.lineWrapping||(f=It(On(yt(n,s.line))),n.iter(f,l.line+1,function(ie){if(ie==r.maxLine)return d=!0,!0})),n.sel.contains(t.from,t.to)>-1&&M(e),Io(n,t,i,ga(e)),e.options.lineWrapping||(n.iter(f,s.line+t.text.length,function(ie){var Pe=Ji(ie);Pe>r.maxLineLength&&(r.maxLine=ie,r.maxLineLength=Pe,r.maxLineChanged=!0,d=!1)}),d&&(e.curOp.updateMaxLine=!0)),Qt(n,s.line),Er(e,400);var v=t.text.length-(l.line-s.line)-1;t.full?Jn(e):s.line==l.line&&t.text.length==1&&!Ia(e.doc,t)?Ri(e,s.line,"text"):Jn(e,s.line,l.line+1,v);var D=j(e,"changes"),W=j(e,"change");if(W||D){var ce={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};W&&dn(e,"change",e,ce),D&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(ce)}e.display.selForContextMenu=null}function ar(e,t,i,n,r){var s;n||(n=i),et(n,i)<0&&(s=[n,i],i=s[0],n=s[1]),typeof t=="string"&&(t=e.splitLines(t)),or(e,{from:i,to:n,text:t,origin:r})}function es(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function ts(e,t,i,n){for(var r=0;r<e.length;++r){var s=e[r],l=!0;if(s.ranges){s.copied||(s=e[r]=s.deepCopy(),s.copied=!0);for(var d=0;d<s.ranges.length;d++)es(s.ranges[d].anchor,t,i,n),es(s.ranges[d].head,t,i,n);continue}for(var f=0;f<s.changes.length;++f){var v=s.changes[f];if(i<v.from.line)v.from=je(v.from.line+n,v.from.ch),v.to=je(v.to.line+n,v.to.ch);else if(t<=v.to.line){l=!1;break}}l||(e.splice(0,r+1),r=0)}}function ns(e,t){var i=t.from.line,n=t.to.line,r=t.text.length-(n-i)-1;ts(e.done,i,n,r),ts(e.undone,i,n,r)}function Rr(e,t,i,n){var r=t,s=t;return typeof t=="number"?s=yt(e,h(e,t)):r=It(t),r==null?null:(n(s,r)&&e.cm&&Ri(e.cm,r,i),s)}function Tr(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}Tr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var r=this.lines[i];this.height-=r.height,co(r),dn(r,"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 Ar(e){this.children=e;for(var t=0,i=0,n=0;n<e.length;++n){var r=e[n];t+=r.chunkSize(),i+=r.height,r.parent=this}this.size=t,this.height=i,this.parent=null}Ar.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],r=n.chunkSize();if(e<r){var s=Math.min(t,r-e),l=n.height;if(n.removeInner(e,s),this.height-=l-n.height,r==s&&(this.children.splice(i--,1),n.parent=null),(t-=s)==0)break;e=0}else e-=r}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Tr))){var d=[];this.collapse(d),this.children=[new Tr(d)],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 r=this.children[n],s=r.chunkSize();if(e<=s){if(r.insertInner(e,t,i),r.lines&&r.lines.length>50){for(var l=r.lines.length%25+25,d=l;d<r.lines.length;){var f=new Tr(r.lines.slice(d,d+=25));r.height-=f.height,this.children.splice(++n,0,f),f.parent=this}r.lines=r.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 Ar(t);if(e.parent){e.size-=i.size,e.height-=i.height;var r=_e(e.parent.children,e);e.parent.children.splice(r+1,0,i)}else{var n=new Ar(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 r=this.children[n],s=r.chunkSize();if(e<s){var l=Math.min(t,s-e);if(r.iterN(e,l,i))return!0;if((t-=l)==0)break;e=0}else e-=s}}};var Pr=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};Pr.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=It(i);if(n==null||!t)return;for(var r=0;r<t.length;++r)t[r]==this&&t.splice(r--,1);t.length||(i.widgets=null);var s=gr(this);qt(i,Math.max(0,i.height-s)),e&&(ri(e,function(){is(e,i,-s),Ri(e,n,"widget")}),dn(e,"lineWidgetCleared",e,this,n))},Pr.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var r=gr(this)-t;if(!r)return;ci(this.doc,n)||qt(n,n.height+r),i&&ri(i,function(){i.curOp.forceUpdate=!0,is(i,n,r),dn(i,"lineWidgetChanged",i,e,It(n))})},I(Pr);function is(e,t,i){ii(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&To(e,i)}function _l(e,t,i,n){var r=new Pr(e,i,n),s=e.cm;return s&&r.noHScroll&&(s.display.alignWidgets=!0),Rr(e,t,"widget",function(l){var d=l.widgets||(l.widgets=[]);if(r.insertAt==null?d.push(r):d.splice(Math.min(d.length-1,Math.max(0,r.insertAt)),0,r),r.line=l,s&&!ci(e,l)){var f=ii(l)<e.scrollTop;qt(l,l.height+gr(r)),f&&To(s,r.height),s.curOp.forceUpdate=!0}return!0}),s&&dn(s,"lineWidgetAdded",s,r,typeof t=="number"?t:It(t)),r}var rs=0,Li=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++rs};Li.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Vi(e),j(this,"clear")){var i=this.find();i&&dn(this,"clear",i.from,i.to)}for(var n=null,r=null,s=0;s<this.lines.length;++s){var l=this.lines[s],d=vn(l.markedSpans,this);e&&!this.collapsed?Ri(e,It(l),"text"):e&&(d.to!=null&&(r=It(l)),d.from!=null&&(n=It(l))),l.markedSpans=Yn(l.markedSpans,d),d.from==null&&this.collapsed&&!ci(this.doc,l)&&e&&qt(l,Qi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var f=0;f<this.lines.length;++f){var v=On(this.lines[f]),D=Ji(v);D>e.display.maxLineLength&&(e.display.maxLine=v,e.display.maxLineLength=D,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Jn(e,n,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ka(e.doc)),e&&dn(e,"markerCleared",e,this,n,r),t&&Xi(e),this.parent&&this.parent.clear()},Li.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,r=0;r<this.lines.length;++r){var s=this.lines[r],l=vn(s.markedSpans,this);if(l.from!=null&&(i=je(t?s:It(s),l.from),e==-1))return i;if(l.to!=null&&(n=je(t?s:It(s),l.to),e==1))return n}return i&&{from:i,to:n}},Li.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;ri(n,function(){var r=t.line,s=It(t.line),l=go(n,s);if(l&&(la(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!ci(i.doc,r)&&i.height!=null){var d=i.height;i.height=null;var f=gr(i)-d;f&&qt(r,r.height+f)}dn(n,"markerChanged",n,e)})},Li.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||_e(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Li.prototype.detachLine=function(e){if(this.lines.splice(_e(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},I(Li);function sr(e,t,i,n,r){if(n&&n.shared)return xl(e,t,i,n,r);if(e.cm&&!e.cm.curOp)return Nn(e.cm,sr)(e,t,i,n,r);var s=new Li(e,r),l=et(t,i);if(n&&g(n,s,!1),l>0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=K("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(Pn(e,t.line,t,i,s)||t.line!=i.line&&Pn(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");wn()}s.addToHistory&&Fa(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var d=t.line,f=e.cm,v;if(e.iter(d,i.line+1,function(W){f&&s.collapsed&&!f.options.lineWrapping&&On(W)==f.display.maxLine&&(v=!0),s.collapsed&&d!=t.line&&qt(W,0),yn(W,new Bn(s,d==t.line?t.ch:null,d==i.line?i.ch:null)),++d}),s.collapsed&&e.iter(t.line,i.line+1,function(W){ci(e,W)&&qt(W,0)}),s.clearOnEnter&&Se(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(Zt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++rs,s.atomic=!0),f){if(v&&(f.curOp.updateMaxLine=!0),s.collapsed)Jn(f,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var D=t.line;D<=i.line;D++)Ri(f,D,"text");s.atomic&&Ka(f.doc),dn(f,"markerAdded",f,s)}return s}var Or=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Or.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();dn(this,"clear")},Or.prototype.find=function(e,t){return this.primary.find(e,t)},I(Or);function xl(e,t,i,n,r){n=g(n),n.shared=!1;var s=[sr(e,t,i,n,r)],l=s[0],d=n.widgetNode;return Oi(e,function(f){d&&(n.widgetNode=d.cloneNode(!0)),s.push(sr(f,o(f,t),o(f,i),n,r));for(var v=0;v<f.linked.length;++v)if(f.linked[v].isParent)return;l=Ne(s)}),new Or(s,l)}function os(e){return e.findMarks(je(e.first,0),e.clipPos(je(e.lastLine())),function(t){return t.parent})}function El(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.find(),s=e.clipPos(r.from),l=e.clipPos(r.to);if(et(s,l)){var d=sr(e,s,l,n.primary,n.primary.type);n.markers.push(d),d.parent=n}}}function wl(e){for(var t=function(n){var r=e[n],s=[r.primary.doc];Oi(r.primary.doc,function(f){return s.push(f)});for(var l=0;l<r.markers.length;l++){var d=r.markers[l];_e(s,d.doc)==-1&&(d.parent=null,r.markers.splice(l--,1))}},i=0;i<e.length;i++)t(i)}var Sl=0,qn=function(e,t,i,n,r){if(!(this instanceof qn))return new qn(e,t,i,n,r);i==null&&(i=0),Ar.call(this,[new Tr([new ki("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var s=je(i,0);this.sel=Ai(s),this.history=new Jr(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=r=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Io(this,{from:s,to:s,text:e}),Vn(this,Ai(s),Te)};qn.prototype=Ke(Ar.prototype,{constructor:qn,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=Mt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:In(function(e){var t=je(this.first,0),i=this.first+this.size-1;or(this,{from:t,to:je(i,yt(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&br(this.cm,0,0),Vn(this,Ai(t),Te)}),replaceRange:function(e,t,i,n){t=o(this,t),i=i?o(this,i):t,ar(this,e,t,i,n)},getRange:function(e,t,i){var n=Yt(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(ai(this,e))return yt(this,e)},getLineNumber:function(e){return It(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=yt(this,e)),On(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:In(function(e,t,i){Ga(this,o(this,typeof e=="number"?je(e,t||0):e),null,i)}),setSelection:In(function(e,t,i){Ga(this,o(this,e),o(this,t||e),i)}),extendSelection:In(function(e,t,i){Qr(this,o(this,e),t&&o(this,t),i)}),extendSelections:In(function(e,t){Ha(this,u(this,e),t)}),extendSelectionsBy:In(function(e,t){var i=be(this.sel.ranges,e);Ha(this,u(this,i),t)}),setSelections:In(function(e,t,i){if(!e.length)return;for(var n=[],r=0;r<e.length;r++)n[r]=new sn(o(this,e[r].anchor),o(this,e[r].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Vn(this,di(this.cm,n,t),i)}),addSelection:In(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new sn(o(this,e),o(this,t||e))),Vn(this,di(this.cm,n,n.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,n=0;n<t.length;n++){var r=Yt(this,t[n].from(),t[n].to());i=i?i.concat(r):r}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 r=Yt(this,i[n].from(),i[n].to());e!==!1&&(r=r.join(e||this.lineSeparator())),t[n]=r}return t},replaceSelection:function(e,t,i){for(var n=[],r=0;r<this.sel.ranges.length;r++)n[r]=e;this.replaceSelections(n,t,i||"+input")},replaceSelections:In(function(e,t,i){for(var n=[],r=this.sel,s=0;s<r.ranges.length;s++){var l=r.ranges[s];n[s]={from:l.from(),to:l.to(),text:this.splitLines(e[s]),origin:i}}for(var d=t&&t!="end"&&dl(this,n,t),f=n.length-1;f>=0;f--)or(this,n[f]);d?Va(this,d):this.cm&&tr(this.cm)}),undo:In(function(){to(this,"undo")}),redo:In(function(){to(this,"redo")}),undoSelection:In(function(){to(this,"undo",!0)}),redoSelection:In(function(){to(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 r=0;r<e.undone.length;r++)e.undone[r].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Jr(this.history.maxGeneration),Oi(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:ir(this.history.done),undone:ir(this.history.undone)}},setHistory:function(e){var t=this.history=new Jr(this.history.maxGeneration);t.done=ir(e.done.slice(0),null,!0),t.undone=ir(e.undone.slice(0),null,!0)},setGutterMarker:In(function(e,t,i){return Rr(this,e,"gutter",function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&Ye(r)&&(n.gutterMarkers=null),!0})}),clearGutter:In(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&Rr(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Ye(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!ai(this,e))return null;if(t=e,e=yt(this,e),!e)return null}else if(t=It(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:In(function(e,t,i){return Rr(this,e,t=="gutter"?"gutter":"class",function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[r])n[r]=i;else{if(Y(i).test(n[r]))return!1;n[r]+=" "+i}return!0})}),removeLineClass:In(function(e,t,i){return Rr(this,e,t=="gutter"?"gutter":"class",function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",s=n[r];if(s)if(i==null)n[r]=null;else{var l=s.match(Y(i));if(!l)return!1;var d=l.index+l[0].length;n[r]=s.slice(0,l.index)+(!l.index||d==s.length?"":" ")+s.slice(d)||null}else return!1;return!0})}),addLineWidget:In(function(e,t,i){return _l(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return sr(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),sr(this,e,e,i,"bookmark")},findMarksAt:function(e){e=o(this,e);var t=[],i=yt(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var r=i[n];(r.from==null||r.from<=e.ch)&&(r.to==null||r.to>=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,i){e=o(this,e),t=o(this,t);var n=[],r=e.line;return this.iter(e.line,t.line+1,function(s){var l=s.markedSpans;if(l)for(var d=0;d<l.length;d++){var f=l[d];!(f.to!=null&&r==e.line&&e.ch>=f.to||f.from==null&&r!=e.line||f.from!=null&&r==t.line&&f.from>=t.ch)&&(!i||i(f.marker))&&n.push(f.marker.parent||f.marker)}++r}),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(r){var s=r.text.length+n;if(s>e)return t=e,!0;e-=s,++i}),o(this,je(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 qn(Mt(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 qn(Mt(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}],El(n,os(this)),n},unlinkDoc:function(e){if(e instanceof bn&&(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(os(this));break}if(e.history==this.history){var n=[e.id];Oi(e,function(r){return n.push(r.id)},!0),e.history=new Jr(null),e.history.done=ir(this.history.done,n),e.history.undone=ir(this.history.undone,n)}},iterLinkedDocs:function(e){Oi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):mt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:In(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)})}),qn.prototype.eachLine=qn.prototype.iter;var as=0;function kl(e){var t=this;if(ss(t),Ae(t,e)||Ci(t.display,e))return;b(e),O&&(as=+new Date);var i=Wi(t,e,!0),n=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var r=n.length,s=Array(r),l=0,d=function(){++l==r&&Nn(t,function(){i=o(t.doc,i);var ie={from:i,to:i,text:t.doc.splitLines(s.filter(function(Pe){return Pe!=null}).join(t.doc.lineSeparator())),origin:"paste"};or(t.doc,ie),Va(t.doc,Ai(o(t.doc,i),o(t.doc,Pi(ie))))})()},f=function(ie,Pe){if(t.options.allowDropFileTypes&&_e(t.options.allowDropFileTypes,ie.type)==-1){d();return}var We=new FileReader;We.onerror=function(){return d()},We.onload=function(){var Je=We.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Je)){d();return}s[Pe]=Je,d()},We.readAsText(ie)},v=0;v<n.length;v++)f(n[v],v);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 D=e.dataTransfer.getData("Text");if(D){var W;if(t.state.draggingText&&!t.state.draggingText.copy&&(W=t.listSelections()),Zr(t.doc,Ai(i,i)),W)for(var ce=0;ce<W.length;++ce)ar(t.doc,"",W[ce].anchor,W[ce].head,"drag");t.replaceSelection(D,"around","paste"),t.display.input.focus()}}catch(ie){}}}function Rl(e,t){if(O&&(!e.state.draggingText||+new Date-as<100)){P(t);return}if(Ae(e,t)||Ci(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!q){var i=x("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",R&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),R&&i.parentNode.removeChild(i)}}function Tl(e,t){var i=Wi(e,t);if(!i)return;var n=document.createDocumentFragment();ba(e,i,n),e.display.dragCursor||(e.display.dragCursor=x("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),T(e.display.dragCursor,n)}function ss(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ls(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&i.push(r)}i.length&&i[0].operation(function(){for(var s=0;s<i.length;s++)e(i[s])})}var us=!1;function Al(){if(us)return;Pl(),us=!0}function Pl(){var e;Se(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ls(Ol)},100))}),Se(window,"blur",function(){return ls(er)})}function Ol(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Mi={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"},Lr=0;Lr<10;Lr++)Mi[Lr+48]=Mi[Lr+96]=String(Lr);for(var no=65;no<=90;no++)Mi[no]=String.fromCharCode(no);for(var Mr=1;Mr<=12;Mr++)Mi[Mr+111]=Mi[Mr+63235]="F"+Mr;var _i={};_i.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"},_i.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"},_i.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"},_i.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"]},_i.default=se?_i.macDefault:_i.pcDefault;function Ll(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,r,s,l=0;l<t.length-1;l++){var d=t[l];if(/^(cmd|meta|m)$/i.test(d))s=!0;else if(/^a(lt)?$/i.test(d))i=!0;else if(/^(c|ctrl|control)$/i.test(d))n=!0;else if(/^s(hift)?$/i.test(d))r=!0;else throw new Error("Unrecognized modifier name: "+d)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),s&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Ml(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 r=be(i.split(" "),Ll),s=0;s<r.length;s++){var l=void 0,d=void 0;s==r.length-1?(d=r.join(" "),l=n):(d=r.slice(0,s+1).join(" "),l="...");var f=t[d];if(!f)t[d]=l;else if(f!=l)throw new Error("Inconsistent bindings for "+d)}delete e[i]}for(var v in t)e[v]=t[v];return e}function lr(e,t,i,n){t=io(t);var r=t.call?t.call(e,n):t[e];if(r===!1)return"nothing";if(r==="...")return"multi";if(r!=null&&i(r))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return lr(e,t.fallthrough,i,n);for(var s=0;s<t.fallthrough.length;s++){var l=lr(e,t.fallthrough[s],i,n);if(l)return l}}}function cs(e){var t=typeof e=="string"?e:Mi[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function hs(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(ve?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(ve?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function ds(e,t){if(R&&e.keyCode==34&&e.char)return!1;var i=Mi[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),hs(i,e,t))}function io(e){return typeof e=="string"?_i[e]:e}function ur(e,t){for(var i=e.doc.sel.ranges,n=[],r=0;r<i.length;r++){for(var s=t(i[r]);n.length&&et(s.from,Ne(n).to)<=0;){var l=n.pop();if(et(l.from,s.from)<0){s.from=l.from;break}}n.push(s)}ri(e,function(){for(var d=n.length-1;d>=0;d--)ar(e.doc,"",n[d].from,n[d].to,"+delete");tr(e)})}function Fo(e,t,i){var n=ze(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Wo(e,t,i){var n=Fo(e,t.ch,i);return n==null?null:new je(t.line,n,i<0?"after":"before")}function zo(e,t,i,n,r){if(e){t.doc.direction=="rtl"&&(r=-r);var s=bt(i,t.doc.direction);if(s){var l=r<0?Ne(s):s[0],d=r<0==(l.level==1),f=d?"after":"before",v;if(l.level>0||t.doc.direction=="rtl"){var D=qi(t,i);v=r<0?i.text.length-1:0;var W=vi(t,D,v).top;v=Lt(function(ce){return vi(t,D,ce).top==W},r<0==(l.level==1)?l.from:l.to-1,v),f=="before"&&(v=Fo(i,v,1))}else v=r<0?l.to:l.from;return new je(n,v,f)}}return new je(n,r<0?i.text.length:0,r<0?"before":"after")}function Dl(e,t,i,n){var r=bt(t,e.doc.direction);if(!r)return Wo(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=ut(r,i.ch,i.sticky),l=r[s];if(e.doc.direction=="ltr"&&l.level%2==0&&(n>0?l.to>i.ch:l.from<i.ch))return Wo(t,i,n);var d=function(tt,vt){return Fo(t,tt instanceof je?tt.ch:tt,vt)},f,v=function(tt){return e.options.lineWrapping?(f=f||qi(e,t),ma(e,t,f,tt)):{begin:0,end:t.text.length}},D=v(i.sticky=="before"?d(i,-1):i.ch);if(e.doc.direction=="rtl"||l.level==1){var W=l.level==1==n<0,ce=d(i,W?1:-1);if(ce!=null&&(W?ce<=l.to&&ce<=D.end:ce>=l.from&&ce>=D.begin)){var ie=W?"before":"after";return new je(i.line,ce,ie)}}var Pe=function(tt,vt,nt){for(var _t=function(pn,jn){return jn?new je(i.line,d(pn,1),"before"):new je(i.line,pn,"after")};tt>=0&&tt<r.length;tt+=vt){var Bt=r[tt],jt=vt>0==(Bt.level!=1),Vt=jt?nt.begin:d(nt.end,-1);if(Bt.from<=Vt&&Vt<Bt.to)return _t(Vt,jt);if(Vt=jt?Bt.from:d(Bt.to,-1),nt.begin<=Vt&&Vt<nt.end)return _t(Vt,jt)}},We=Pe(s+n,n,D);if(We)return We;var Je=n>0?D.end:d(D.begin,-1);return Je!=null&&!(n>0&&Je==t.text.length)&&(We=Pe(n>0?0:r.length-1,n,v(Je)),We)?We:null}var Dr={selectAll:Ja,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Te)},killLine:function(e){return ur(e,function(t){if(t.empty()){var i=yt(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:je(t.head.line+1,0)}:{from:t.head,to:je(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return ur(e,function(t){return{from:je(t.from().line,0),to:o(e.doc,je(t.to().line+1,0))}})},delLineLeft:function(e){return ur(e,function(t){return{from:je(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return ur(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 ur(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(je(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(je(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return fs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ps(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")},ye)},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")},ye)},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/)?ps(e,t.head):n},ye)},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,r=0;r<i.length;r++){var s=i[r].from(),l=te(e.getLine(s.line),s.ch,n);t.push(z(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ri(e,function(){for(var t=e.listSelections(),i=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var r=t[n].head,s=yt(e.doc,r.line).text;if(s){if(r.ch==s.length&&(r=new je(r.line,r.ch-1)),r.ch>0)r=new je(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),je(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var l=yt(e.doc,r.line-1).text;l&&(r=new je(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),je(r.line-1,l.length-1),r,"+transpose"))}}i.push(new sn(r,r))}e.setSelections(i)})},newlineAndIndent:function(e){return ri(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);tr(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function fs(e,t){var i=yt(e.doc,t),n=On(i);return n!=i&&(t=It(n)),zo(!0,e,n,t,1)}function Nl(e,t){var i=yt(e.doc,t),n=mi(i);return n!=i&&(t=It(n)),zo(!0,e,i,t,-1)}function ps(e,t){var i=fs(e,t.line),n=yt(e.doc,i.line),r=bt(n,e.doc.direction);if(!r||r[0].level==0){var s=Math.max(i.ch,n.text.search(/\S/)),l=t.line==i.line&&t.ch<=s&&t.ch;return je(i.line,l?0:s,i.sticky)}return i}function ro(e,t,i){if(typeof t=="string"&&(t=Dr[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),r=t(e)!=Qe}finally{e.display.shift=n,e.state.suppressEdits=!1}return r}function Il(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var r=lr(t,e.state.keyMaps[n],i,e);if(r)return r}return e.options.extraKeys&&lr(t,e.options.extraKeys,i,e)||lr(t,e.options.keyMap,i,e)}var jl=new Oe;function Nr(e,t,i,n){var r=e.state.keySeq;if(r){if(cs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:jl.set(50,function(){e.state.keySeq==r&&(e.state.keySeq=null,e.display.input.reset())}),ms(e,r+" "+t,i,n))return!0}return ms(e,t,i,n)}function ms(e,t,i,n){var r=Il(e,t,n);return r=="multi"&&(e.state.keySeq=t),r=="handled"&&dn(e,"keyHandled",e,t,i),(r=="handled"||r=="multi")&&(b(i),So(e)),!!r}function gs(e,t){var i=ds(t,!0);return i?t.shiftKey&&!e.state.keySeq?Nr(e,"Shift-"+i,t,function(n){return ro(e,n,!0)})||Nr(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return ro(e,n)}):Nr(e,i,t,function(n){return ro(e,n)}):!1}function Ul(e,t,i){return Nr(e,"'"+i+"'",t,function(n){return ro(e,n,!0)})}var Ho=null;function vs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=E(),Ae(t,e))return;O&&N<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=gs(t,e);R&&(Ho=n?i:null,!n&&i==88&&!Dt&&(se?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),Z&&!se&&!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;J(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(m(t,"CodeMirror-crosshair"),ht(document,"keyup",i),ht(document,"mouseover",i))}Se(document,"keyup",i),Se(document,"mouseover",i)}function ys(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ae(this,e)}function bs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Ci(t.display,e)||Ae(t,e)||e.ctrlKey&&!e.altKey||se&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(R&&i==Ho){Ho=null,b(e);return}if(R&&(!e.which||e.which<10)&&gs(t,e))return;var r=String.fromCharCode(n==null?i:n);if(r=="\b")return;if(Ul(t,e,r))return;t.display.input.onKeyPress(e)}var Fl=400,Go=function(e,t,i){this.time=e,this.pos=t,this.button=i};Go.prototype.compare=function(e,t,i){return this.time+Fl>e&&et(t,this.pos)==0&&i==this.button};var Ir,jr;function Wl(e,t){var i=+new Date;return jr&&jr.compare(i,e,t)?(Ir=jr=null,"triple"):Ir&&Ir.compare(i,e,t)?(jr=new Go(i,e,t),Ir=null,"double"):(Ir=new Go(i,e,t),jr=null,"single")}function Cs(e){var t=this,i=t.display;if(Ae(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,Ci(i,e)){A||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Vo(t,e))return;var n=Wi(t,e),r=pe(e),s=n?Wl(n,r):"single";if(window.focus(),r==1&&t.state.selectingText&&t.state.selectingText(e),n&&zl(t,r,n,s,e))return;r==1?n?Gl(t,n,s,e):re(e)==i.scroller&&b(e):r==2?(n&&Qr(t.doc,n),setTimeout(function(){return i.input.focus()},20)):r==3&&(De?t.display.input.onContextMenu(e):_a(t))}function zl(e,t,i,n,r){var s="Click";return n=="double"?s="Double"+s:n=="triple"&&(s="Triple"+s),s=(t==1?"Left":t==2?"Middle":"Right")+s,Nr(e,hs(s,r),r,function(l){if(typeof l=="string"&&(l=Dr[l]),!l)return!1;var d=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),d=l(e,i)!=Qe}finally{e.state.suppressEdits=!1}return d})}function Hl(e,t,i){var n=e.getOption("configureMouse"),r=n?n(e,t,i):{};if(r.unit==null){var s=Le?i.shiftKey&&i.metaKey:i.altKey;r.unit=s?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(r.extend==null||e.doc.extend)&&(r.extend=e.doc.extend||i.shiftKey),r.addNew==null&&(r.addNew=se?i.metaKey:i.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(se?i.altKey:i.ctrlKey)),r}function Gl(e,t,i,n){O?setTimeout(w(Ca,e),0):e.curOp.focus=E();var r=Hl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&Ce&&!e.isReadOnly()&&i=="single"&&(l=s.contains(t))>-1&&(et((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(et(l.to(),t)>0||t.xRel<0)?Vl(e,n,t,r):Xl(e,n,t,r)}function Vl(e,t,i,n){var r=e.display,s=!1,l=Nn(e,function(v){A&&(r.scroller.draggable=!1),e.state.draggingText=!1,ht(r.wrapper.ownerDocument,"mouseup",l),ht(r.wrapper.ownerDocument,"mousemove",d),ht(r.scroller,"dragstart",f),ht(r.scroller,"drop",l),s||(b(v),n.addNew||Qr(e.doc,i,null,null,n.extend),A&&!q||O&&N==9?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),d=function(v){s=s||Math.abs(t.clientX-v.clientX)+Math.abs(t.clientY-v.clientY)>=10},f=function(){return s=!0};A&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),Se(r.wrapper.ownerDocument,"mouseup",l),Se(r.wrapper.ownerDocument,"mousemove",d),Se(r.scroller,"dragstart",f),Se(r.scroller,"drop",l),_a(e),setTimeout(function(){return r.input.focus()},20)}function _s(e,t,i){if(i=="char")return new sn(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new sn(je(t.line,0),o(e.doc,je(t.line+1,0)));var n=i(e,t);return new sn(n.from,n.to)}function Xl(e,t,i,n){var r=e.display,s=e.doc;b(t);var l,d,f=s.sel,v=f.ranges;if(n.addNew&&!n.extend?(d=s.sel.contains(i),d>-1?l=v[d]:l=new sn(i,i)):(l=s.sel.primary(),d=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new sn(i,i)),i=Wi(e,t,!0,!0),d=-1;else{var D=_s(e,i,n.unit);n.extend?l=Uo(l,D.anchor,D.head,n.extend):l=D}n.addNew?d==-1?(d=v.length,Vn(s,di(e,v.concat([l]),d),{scroll:!1,origin:"*mouse"})):v.length>1&&v[d].empty()&&n.unit=="char"&&!n.extend?(Vn(s,di(e,v.slice(0,d).concat(v.slice(d+1)),0),{scroll:!1,origin:"*mouse"}),f=s.sel):Bo(s,d,l,Ee):(d=0,Vn(s,new li([l],0),Ee),f=s.sel);var W=i;function ce(nt){if(et(W,nt)==0)return;if(W=nt,n.unit=="rectangle"){for(var _t=[],Bt=e.options.tabSize,jt=te(yt(s,i.line).text,i.ch,Bt),Vt=te(yt(s,nt.line).text,nt.ch,Bt),pn=Math.min(jt,Vt),jn=Math.max(jt,Vt),xn=Math.min(i.line,nt.line),oi=Math.min(e.lastLine(),Math.max(i.line,nt.line));xn<=oi;xn++){var Qn=yt(s,xn).text,Tn=we(Qn,pn,Bt);pn==jn?_t.push(new sn(je(xn,Tn),je(xn,Tn))):Qn.length>Tn&&_t.push(new sn(je(xn,Tn),je(xn,we(Qn,jn,Bt))))}_t.length||_t.push(new sn(i,i)),Vn(s,di(e,f.ranges.slice(0,d).concat(_t),d),{origin:"*mouse",scroll:!1}),e.scrollIntoView(nt)}else{var Zn=l,Gn=_s(e,nt,n.unit),Ln=Zn.anchor,An;et(Gn.anchor,Ln)>0?(An=Gn.head,Ln=En(Zn.from(),Gn.anchor)):(An=Gn.anchor,Ln=gn(Zn.to(),Gn.head));var Sn=f.ranges.slice(0);Sn[d]=Kl(e,new sn(o(s,Ln),An)),Vn(s,di(e,Sn,d),Ee)}}var ie=r.wrapper.getBoundingClientRect(),Pe=0;function We(nt){var _t=++Pe,Bt=Wi(e,nt,!0,n.unit=="rectangle");if(!Bt)return;if(et(Bt,W)!=0){e.curOp.focus=E(),ce(Bt);var jt=Xr(r,s);(Bt.line>=jt.to||Bt.line<jt.from)&&setTimeout(Nn(e,function(){Pe==_t&&We(nt)}),150)}else{var Vt=nt.clientY<ie.top?-20:nt.clientY>ie.bottom?20:0;Vt&&setTimeout(Nn(e,function(){if(Pe!=_t)return;r.scroller.scrollTop+=Vt,We(nt)}),50)}}function Je(nt){e.state.selectingText=!1,Pe=Infinity,nt&&(b(nt),r.input.focus()),ht(r.wrapper.ownerDocument,"mousemove",tt),ht(r.wrapper.ownerDocument,"mouseup",vt),s.history.lastSelOrigin=null}var tt=Nn(e,function(nt){nt.buttons===0||!pe(nt)?Je(nt):We(nt)}),vt=Nn(e,Je);e.state.selectingText=vt,Se(r.wrapper.ownerDocument,"mousemove",tt),Se(r.wrapper.ownerDocument,"mouseup",vt)}function Kl(e,t){var i=t.anchor,n=t.head,r=yt(e.doc,i.line);if(et(i,n)==0&&i.sticky==n.sticky)return t;var s=bt(r);if(!s)return t;var l=ut(s,i.ch,i.sticky),d=s[l];if(d.from!=i.ch&&d.to!=i.ch)return t;var f=l+(d.from==i.ch==(d.level!=1)?0:1);if(f==0||f==s.length)return t;var v;if(n.line!=i.line)v=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var D=ut(s,n.ch,n.sticky),W=D-l||(n.ch-i.ch)*(d.level==1?-1:1);D==f-1||D==f?v=W<0:v=W>0}var ce=s[f+(v?-1:0)],ie=v==(ce.level==1),Pe=ie?ce.from:ce.to,We=ie?"after":"before";return i.ch==Pe&&i.sticky==We?t:new sn(new je(i.line,Pe,We),n)}function xs(e,t,i,n){var r,s;if(t.touches)r=t.touches[0].clientX,s=t.touches[0].clientY;else try{r=t.clientX,s=t.clientY}catch(ce){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&b(t);var l=e.display,d=l.lineDiv.getBoundingClientRect();if(s>d.bottom||!j(e,i))return S(t);s-=d.top-l.viewOffset;for(var f=0;f<e.display.gutterSpecs.length;++f){var v=l.gutters.childNodes[f];if(v&&v.getBoundingClientRect().right>=r){var D=Cn(e.doc,s),W=e.display.gutterSpecs[f];return ke(e,i,e,D,W.className,t),S(t)}}}function Vo(e,t){return xs(e,t,"gutterClick",!0)}function Es(e,t){if(Ci(e.display,t)||$l(e,t))return;if(Ae(e,t,"contextmenu"))return;De||e.display.input.onContextMenu(t)}function $l(e,t){return j(e,"gutterContextMenu")?xs(e,t,"gutterContextMenu",!1):!1}function ws(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vr(e)}var cr={toString:function(){return"CodeMirror.Init"}},Ss={},oo={};function Yl(e){var t=e.optionHandlers;function i(n,r,s,l){e.defaults[n]=r,s&&(t[n]=l?function(d,f,v){v!=cr&&s(d,f,v)}:s)}e.defineOption=i,e.Init=cr,i("value","",function(n,r){return n.setValue(r)},!0),i("mode",null,function(n,r){n.doc.modeOption=r,No(n)},!0),i("indentUnit",2,No,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){Sr(n),vr(n),Jn(n)},!0),i("lineSeparator",null,function(n,r){if(n.doc.lineSep=r,!r)return;var s=[],l=n.doc.first;n.doc.iter(function(f){for(var v=0;;){var D=f.text.indexOf(r,v);if(D==-1)break;v=D+r.length,s.push(je(l,D))}l++});for(var d=s.length-1;d>=0;d--)ar(n.doc,r,s[d],je(s[d].line,s[d].ch+r.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,r,s){n.state.specialChars=new RegExp(r.source+(r.test(" ")?"":"| "),"g"),s!=cr&&n.refresh()}),i("specialCharPlaceholder",Tt,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",oe?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(n,r){return n.getInputField().spellcheck=r},!0),i("autocorrect",!1,function(n,r){return n.getInputField().autocorrect=r},!0),i("autocapitalize",!1,function(n,r){return n.getInputField().autocapitalize=r},!0),i("rtlMoveVisually",!Me),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){ws(n),wr(n)},!0),i("keyMap","default",function(n,r,s){var l=io(r),d=s!=cr&&io(s);d&&d.detach&&d.detach(n,l),l.attach&&l.attach(n,d||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,ql,!0),i("gutters",[],function(n,r){n.display.gutterSpecs=Mo(r,n.options.lineNumbers),wr(n)},!0),i("fixedGutter",!0,function(n,r){n.display.gutters.style.left=r?Eo(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return nr(n)},!0),i("scrollbarStyle","native",function(n){Ra(n),nr(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,r){n.display.gutterSpecs=Mo(n.options.gutters,r),wr(n)},!0),i("firstLineNumber",1,wr,!0),i("lineNumberFormatter",function(n){return n},wr,!0),i("showCursorWhenSelecting",!1,yr,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,r){r=="nocursor"&&(er(n),n.display.input.blur()),n.display.input.readOnlyChanged(r)}),i("screenReaderLabel",null,function(n,r){r=r===""?null:r,n.display.input.screenReaderLabelChanged(r)}),i("disableInput",!1,function(n,r){r||n.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,yr,!0),i("singleCursorHeightPerLine",!0,yr,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,Sr,!0),i("addModeClass",!1,Sr,!0),i("pollInterval",100),i("undoDepth",200,function(n,r){return n.doc.history.undoDepth=r}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,Sr,!0),i("moveInputWithCursor",!0,function(n,r){r||n.display.input.resetPosition()}),i("tabindex",null,function(n,r){return n.display.input.getField().tabIndex=r||""}),i("autofocus",null),i("direction","ltr",function(n,r){return n.doc.setDirection(r)},!0),i("phrases",null)}function Jl(e,t,i){var n=i&&i!=cr;if(!t!=!n){var r=e.display.dragFunctions,s=t?Se:ht;s(e.display.scroller,"dragstart",r.start),s(e.display.scroller,"dragenter",r.enter),s(e.display.scroller,"dragover",r.over),s(e.display.scroller,"dragleave",r.leave),s(e.display.scroller,"drop",r.drop)}}function ql(e){e.options.lineWrapping?(J(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(m(e.display.wrapper,"CodeMirror-wrap"),bi(e)),wo(e),Jn(e),vr(e),setTimeout(function(){return nr(e)},100)}function bn(e,t){var i=this;if(!(this instanceof bn))return new bn(e,t);this.options=t=t?g(t):{},g(Ss,t,!1);var n=t.value;typeof n=="string"?n=new qn(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var r=new bn.inputStyles[t.inputStyle](this),s=this.display=new cl(e,n,r,t);s.wrapper.CodeMirror=this,ws(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ra(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 Oe,keySeq:null,specialChars:null},t.autofocus&&!oe&&s.input.focus(),O&&N<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Al(),Vi(this),this.curOp.forceUpdate=!0,ja(this,n),t.autofocus&&!oe||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&ko(i)},20):er(this);for(var l in oo)oo.hasOwnProperty(l)&&oo[l](this,t[l],cr);Pa(this),t.finishInit&&t.finishInit(this);for(var d=0;d<Xo.length;++d)Xo[d](this);Xi(this),A&&t.lineWrapping&&getComputedStyle(s.lineDiv).textRendering=="optimizelegibility"&&(s.lineDiv.style.textRendering="auto")}bn.defaults=Ss,bn.optionHandlers=oo;function Ql(e){var t=e.display;Se(t.scroller,"mousedown",Nn(e,Cs)),O&&N<11?Se(t.scroller,"dblclick",Nn(e,function(f){if(Ae(e,f))return;var v=Wi(e,f);if(!v||Vo(e,f)||Ci(e.display,f))return;b(f);var D=e.findWordAt(v);Qr(e.doc,D.anchor,D.head)})):Se(t.scroller,"dblclick",function(f){return Ae(e,f)||b(f)}),Se(t.scroller,"contextmenu",function(f){return Es(e,f)}),Se(t.input.getField(),"contextmenu",function(f){t.scroller.contains(f.target)||Es(e,f)});var i,n={end:0};function r(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function s(f){if(f.touches.length!=1)return!1;var v=f.touches[0];return v.radiusX<=1&&v.radiusY<=1}function l(f,v){if(v.left==null)return!0;var D=v.left-f.left,W=v.top-f.top;return D*D+W*W>20*20}Se(t.scroller,"touchstart",function(f){if(!Ae(e,f)&&!s(f)&&!Vo(e,f)){t.input.ensurePolled(),clearTimeout(i);var v=+new Date;t.activeTouch={start:v,moved:!1,prev:v-n.end<=300?n:null},f.touches.length==1&&(t.activeTouch.left=f.touches[0].pageX,t.activeTouch.top=f.touches[0].pageY)}}),Se(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Se(t.scroller,"touchend",function(f){var v=t.activeTouch;if(v&&!Ci(t,f)&&v.left!=null&&!v.moved&&new Date-v.start<300){var D=e.coordsChar(t.activeTouch,"page"),W;!v.prev||l(v,v.prev)?W=new sn(D,D):!v.prev.prev||l(v,v.prev.prev)?W=e.findWordAt(D):W=new sn(je(D.line,0),o(e.doc,je(D.line+1,0))),e.setSelection(W.anchor,W.head),e.focus(),b(f)}r()}),Se(t.scroller,"touchcancel",r),Se(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Cr(e,t.scroller.scrollTop),Hi(e,t.scroller.scrollLeft,!0),ke(e,"scroll",e))}),Se(t.scroller,"mousewheel",function(f){return Ma(e,f)}),Se(t.scroller,"DOMMouseScroll",function(f){return Ma(e,f)}),Se(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(f){Ae(e,f)||P(f)},over:function(f){Ae(e,f)||(Tl(e,f),P(f))},start:function(f){return Rl(e,f)},drop:Nn(e,kl),leave:function(f){Ae(e,f)||ss(e)}};var d=t.input.getField();Se(d,"keyup",function(f){return ys.call(e,f)}),Se(d,"keydown",Nn(e,vs)),Se(d,"keypress",Nn(e,bs)),Se(d,"focus",function(f){return ko(e,f)}),Se(d,"blur",function(f){return er(e,f)})}var Xo=[];bn.defineInitHook=function(e){return Xo.push(e)};function Ur(e,t,i,n){var r=e.doc,s;i==null&&(i="add"),i=="smart"&&(r.mode.indent?s=he(e,t).state:i="prev");var l=e.options.tabSize,d=yt(r,t),f=te(d.text,null,l);d.stateAfter&&(d.stateAfter=null);var v=d.text.match(/^\s*/)[0],D;if(!n&&!/\S/.test(d.text))D=0,i="not";else if(i=="smart"&&(D=r.mode.indent(s,d.text.slice(v.length),d.text),D==Qe||D>150)){if(!n)return;i="prev"}i=="prev"?t>r.first?D=te(yt(r,t-1).text,null,l):D=0:i=="add"?D=f+e.options.indentUnit:i=="subtract"?D=f-e.options.indentUnit:typeof i=="number"&&(D=f+i),D=Math.max(0,D);var W="",ce=0;if(e.options.indentWithTabs)for(var ie=Math.floor(D/l);ie;--ie)ce+=l,W+=" ";if(ce<D&&(W+=z(D-ce)),W!=v)return ar(r,W,je(t,0),je(t,v.length),"+input"),d.stateAfter=null,!0;for(var Pe=0;Pe<r.sel.ranges.length;Pe++){var We=r.sel.ranges[Pe];if(We.head.line==t&&We.head.ch<v.length){var Je=je(t,v.length);Bo(r,Pe,new sn(Je,Je));break}}}var fi=null;function ao(e){fi=e}function Ko(e,t,i,n,r){var s=e.doc;e.display.shift=!1,n||(n=s.sel);var l=+new Date-200,d=r=="paste"||e.state.pasteIncoming>l,f=mt(t),v=null;if(d&&n.ranges.length>1)if(fi&&fi.text.join(`
`)==t){if(n.ranges.length%fi.text.length==0){v=[];for(var D=0;D<fi.text.length;D++)v.push(s.splitLines(fi.text[D]))}}else f.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(v=be(f,function(tt){return[tt]}));for(var W=e.curOp.updateInput,ce=n.ranges.length-1;ce>=0;ce--){var ie=n.ranges[ce],Pe=ie.from(),We=ie.to();ie.empty()&&(i&&i>0?Pe=je(Pe.line,Pe.ch-i):e.state.overwrite&&!d?We=je(We.line,Math.min(yt(s,We.line).text.length,We.ch+Ne(f).length)):d&&fi&&fi.lineWise&&fi.text.join(`
`)==f.join(`
`)&&(Pe=We=je(Pe.line,0)));var Je={from:Pe,to:We,text:v?v[ce%v.length]:f,origin:r||(d?"paste":e.state.cutIncoming>l?"cut":"+input")};or(e.doc,Je),dn(e,"inputRead",e,Je)}t&&!d&&Rs(e,t),tr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=W),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ks(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&ri(t,function(){return Ko(t,i,0,null,"paste")}),!0}function Rs(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 r=i.ranges[n];if(r.head.ch>100||n&&i.ranges[n-1].head.line==r.head.line)continue;var s=e.getModeAt(r.head),l=!1;if(s.electricChars){for(var d=0;d<s.electricChars.length;d++)if(t.indexOf(s.electricChars.charAt(d))>-1){l=Ur(e,r.head.line,"smart");break}}else s.electricInput&&(s.electricInput.test(yt(e.doc,r.head.line).text.slice(0,r.head.ch))&&(l=Ur(e,r.head.line,"smart")));l&&dn(e,"electricInput",e,r.head.line)}}function Ts(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var r=e.doc.sel.ranges[n].head.line,s={anchor:je(r,0),head:je(r+1,0)};i.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:i}}function As(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ps(){var e=x("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=x("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return A?e.style.width="1000px":e.setAttribute("wrap","off"),H&&(e.style.border="1px solid black"),As(e),t}function Zl(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,r){var s=this.options,l=s[n];if(s[n]==r&&n!="mode")return;s[n]=r,t.hasOwnProperty(n)&&Nn(this,t[n])(this,r,l),ke(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,r){this.state.keyMaps[r?"push":"unshift"](io(n))},removeKeyMap:function(n){for(var r=this.state.keyMaps,s=0;s<r.length;++s)if(r[s]==n||r[s].name==n)return r.splice(s,1),!0},addOverlay:Kn(function(n,r){var s=n.token?n:e.getMode(this.options,n);if(s.startState)throw new Error("Overlays may not be stateful.");St(this.state.overlays,{mode:s,modeSpec:n,opaque:r&&r.opaque,priority:r&&r.priority||0},function(l){return l.priority}),this.state.modeGen++,Jn(this)}),removeOverlay:Kn(function(n){for(var r=this.state.overlays,s=0;s<r.length;++s){var l=r[s].modeSpec;if(l==n||typeof n=="string"&&l.name==n){r.splice(s,1),this.state.modeGen++,Jn(this);return}}}),indentLine:Kn(function(n,r,s){typeof r!="string"&&typeof r!="number"&&(r==null?r=this.options.smartIndent?"smart":"prev":r=r?"add":"subtract"),ai(this.doc,n)&&Ur(this,n,r,s)}),indentSelection:Kn(function(n){for(var r=this.doc.sel.ranges,s=-1,l=0;l<r.length;l++){var d=r[l];if(d.empty())d.head.line>s&&(Ur(this,d.head.line,n,!0),s=d.head.line,l==this.doc.sel.primIndex&&tr(this));else{var f=d.from(),v=d.to(),D=Math.max(s,f.line);s=Math.min(this.lastLine(),v.line-(v.ch?0:1))+1;for(var W=D;W<s;++W)Ur(this,W,n);var ce=this.doc.sel.ranges;f.ch==0&&r.length==ce.length&&ce[l].from().ch>0&&Bo(this.doc,l,new sn(f,ce[l].to()),Te)}}}),getTokenAt:function(n,r){return ot(this,n,r)},getLineTokens:function(n,r){return ot(this,je(n),r,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var r=Ue(this,yt(this.doc,n.line)),s=0,l=(r.length-1)/2,d=n.ch,f;if(d==0)f=r[2];else for(;;){var v=s+l>>1;if((v?r[v*2-1]:0)>=d)l=v;else if(r[v*2+1]<d)s=v+1;else{f=r[v*2+2];break}}var D=f?f.indexOf("overlay "):-1;return D<0?f:D==0?null:f.slice(0,D-1)},getModeAt:function(n){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(n).state).mode:r},getHelper:function(n,r){return this.getHelpers(n,r)[0]},getHelpers:function(n,r){var s=[];if(!i.hasOwnProperty(r))return s;var l=i[r],d=this.getModeAt(n);if(typeof d[r]=="string")l[d[r]]&&s.push(l[d[r]]);else if(d[r])for(var f=0;f<d[r].length;f++){var v=l[d[r][f]];v&&s.push(v)}else d.helperType&&l[d.helperType]?s.push(l[d.helperType]):l[d.name]&&s.push(l[d.name]);for(var D=0;D<l._global.length;D++){var W=l._global[D];W.pred(d,this)&&_e(s,W.val)==-1&&s.push(W.val)}return s},getStateAfter:function(n,r){var s=this.doc;return n=h(s,n==null?s.first+s.size-1:n),he(this,n+1,r).state},cursorCoords:function(n,r){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(),hi(this,s,r||"page")},charCoords:function(n,r){return yo(this,o(this.doc,n),r||"page")},coordsChar:function(n,r){return n=da(this,n,r||"page"),Co(this,n.left,n.top)},lineAtHeight:function(n,r){return n=da(this,{top:n,left:0},r||"page").top,Cn(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,r,s){var l=!1,d;if(typeof n=="number"){var f=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>f&&(n=f,l=!0),d=yt(this.doc,n)}else d=n;return zr(this,d,{top:0,left:0},r||"page",s||l).top+(l?this.doc.height-ii(d):0)},defaultTextHeight:function(){return Qi(this.display)},defaultCharWidth:function(){return Zi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,r,s,l,d){var f=this.display;n=hi(this,o(this.doc,n));var v=n.bottom,D=n.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),f.sizer.appendChild(r),l=="over")v=n.top;else if(l=="above"||l=="near"){var W=Math.max(f.wrapper.clientHeight,this.doc.height),ce=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);(l=="above"||n.bottom+r.offsetHeight>W)&&n.top>r.offsetHeight?v=n.top-r.offsetHeight:n.bottom+r.offsetHeight<=W&&(v=n.bottom),D+r.offsetWidth>ce&&(D=ce-r.offsetWidth)}r.style.top=v+"px",r.style.left=r.style.right="",d=="right"?(D=f.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(d=="left"?D=0:d=="middle"&&(D=(f.sizer.clientWidth-r.offsetWidth)/2),r.style.left=D+"px"),s&&Js(this,{left:D,top:v,right:D+r.offsetWidth,bottom:v+r.offsetHeight})},triggerOnKeyDown:Kn(vs),triggerOnKeyPress:Kn(bs),triggerOnKeyUp:ys,triggerOnMouseDown:Kn(Cs),execCommand:function(n){if(Dr.hasOwnProperty(n))return Dr[n].call(null,this)},triggerElectric:Kn(function(n){Rs(this,n)}),findPosH:function(n,r,s,l){var d=1;r<0&&(d=-1,r=-r);for(var f=o(this.doc,n),v=0;v<r&&!(f=$o(this.doc,f,d,s,l),f.hitSide);++v);return f},moveH:Kn(function(n,r){var s=this;this.extendSelectionsBy(function(l){return s.display.shift||s.doc.extend||l.empty()?$o(s.doc,l.head,n,r,s.options.rtlMoveVisually):n<0?l.from():l.to()},ye)}),deleteH:Kn(function(n,r){var s=this.doc.sel,l=this.doc;s.somethingSelected()?l.replaceSelection("",null,"+delete"):ur(this,function(d){var f=$o(l,d.head,n,r,!1);return n<0?{from:f,to:d.head}:{from:d.head,to:f}})}),findPosV:function(n,r,s,l){var d=1,f=l;r<0&&(d=-1,r=-r);for(var v=o(this.doc,n),D=0;D<r;++D){var W=hi(this,v,"div");if(f==null?f=W.left:W.left=f,v=Os(this,W,d,s),v.hitSide)break}return v},moveV:Kn(function(n,r){var s=this,l=this.doc,d=[],f=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(D){if(f)return n<0?D.from():D.to();var W=hi(s,D.head,"div");D.goalColumn!=null&&(W.left=D.goalColumn),d.push(W.left);var ce=Os(s,W,n,r);return r=="page"&&D==l.sel.primary()&&To(s,yo(s,ce,"div").top-W.top),ce},ye),d.length)for(var v=0;v<l.sel.ranges.length;v++)l.sel.ranges[v].goalColumn=d[v]}),findWordAt:function(n){var r=this.doc,s=yt(r,n.line).text,l=n.ch,d=n.ch;if(s){var f=this.getHelper(n,"wordChars");(n.sticky=="before"||d==s.length)&&l?--l:++d;for(var v=s.charAt(l),D=Ge(v,f)?function(W){return Ge(W,f)}:/\s/.test(v)?function(W){return/\s/.test(W)}:function(W){return!/\s/.test(W)&&!Ge(W)};l>0&&D(s.charAt(l-1));)--l;for(;d<s.length&&D(s.charAt(d));)++d}return new sn(je(n.line,l),je(n.line,d))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?J(this.display.cursorDiv,"CodeMirror-overwrite"):m(this.display.cursorDiv,"CodeMirror-overwrite"),ke(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==E()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Kn(function(n,r){br(this,n,r)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-gi(this)-this.display.barHeight,width:n.scrollWidth-gi(this)-this.display.barWidth,clientHeight:mo(this),clientWidth:Bi(this)}},scrollIntoView:Kn(function(n,r){n==null?(n={from:this.doc.sel.primary().head,to:null},r==null&&(r=this.options.cursorScrollMargin)):typeof n=="number"?n={from:je(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=r||0,n.from.line!=null?qs(this,n):Ea(this,n.from,n.to,n.margin)}),setSize:Kn(function(n,r){var s=this,l=function(f){return typeof f=="number"||/^\d+$/.test(String(f))?f+"px":f};n!=null&&(this.display.wrapper.style.width=l(n)),r!=null&&(this.display.wrapper.style.height=l(r)),this.options.lineWrapping&&ua(this);var d=this.display.viewFrom;this.doc.iter(d,this.display.viewTo,function(f){if(f.widgets){for(var v=0;v<f.widgets.length;v++)if(f.widgets[v].noHScroll){Ri(s,d,"widget");break}}++d}),this.curOp.forceUpdate=!0,ke(this,"refresh",this)}),operation:function(n){return ri(this,n)},startOperation:function(){return Vi(this)},endOperation:function(){return Xi(this)},refresh:Kn(function(){var n=this.display.cachedTextHeight;Jn(this),this.curOp.forceUpdate=!0,vr(this),br(this,this.doc.scrollLeft,this.doc.scrollTop),Oo(this.display),(n==null||Math.abs(n-Qi(this.display))>.5||this.options.lineWrapping)&&wo(this),ke(this,"refresh",this)}),swapDoc:Kn(function(n){var r=this.doc;return r.cm=null,this.state.selectingText&&this.state.selectingText(),ja(this,n),vr(this),this.display.input.reset(),br(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,dn(this,"swapDoc",this,r),r}),phrase:function(n){var r=this.options.phrases;return r&&Object.prototype.hasOwnProperty.call(r,n)?r[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}},I(e),e.registerHelper=function(n,r,s){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][r]=s},e.registerGlobalHelper=function(n,r,s,l){e.registerHelper(n,r,l),i[n]._global.push({pred:s,val:l})}}function $o(e,t,i,n,r){var s=t,l=i,d=yt(e,t.line),f=r&&e.direction=="rtl"?-i:i;function v(){var vt=t.line+f;return vt<e.first||vt>=e.first+e.size?!1:(t=new je(vt,t.ch,t.sticky),d=yt(e,vt))}function D(vt){var nt;if(n=="codepoint"){var _t=d.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(_t)?nt=null:nt=new je(t.line,Math.max(0,Math.min(d.text.length,t.ch+i*(_t>=55296&&_t<56320?2:1))),-i)}else r?nt=Dl(e.cm,d,t,i):nt=Wo(d,t,i);if(nt==null)if(!vt&&v())t=zo(r,e.cm,d,t.line,f);else return!1;else t=nt;return!0}if(n=="char"||n=="codepoint")D();else if(n=="column")D(!0);else if(n=="word"||n=="group")for(var W=null,ce=n=="group",ie=e.cm&&e.cm.getHelper(t,"wordChars"),Pe=!0;!(i<0&&!D(!Pe));Pe=!1){var We=d.text.charAt(t.ch)||`
`,Je=Ge(We,ie)?"w":ce&&We==`
`?"n":!ce||/\s/.test(We)?null:"p";if(ce&&!Pe&&!Je&&(Je="s"),W&&W!=Je){i<0&&(i=1,D(),t.sticky="after");break}if(Je&&(W=Je),i>0&&!D(!Pe))break}var tt=eo(e,t,s,l,!0);return an(s,tt)&&(tt.hitSide=!0),tt}function Os(e,t,i,n){var r=e.doc,s=t.left,l;if(n=="page"){var d=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),f=Math.max(d-.5*Qi(e.display),3);l=(i>0?t.bottom:t.top)+i*f}else n=="line"&&(l=i>0?t.bottom+3:t.top-3);for(var v;!(v=Co(e,s,l),!v.outside);){if(i<0?l<=0:l>=r.height){v.hitSide=!0;break}l+=i*5}return v}var cn=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Oe,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};cn.prototype.init=function(e){var t=this,i=this,n=i.cm,r=i.div=e.lineDiv;As(r,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function s(d){for(var f=d.target;f;f=f.parentNode){if(f==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(f.className))break}return!1}Se(r,"paste",function(d){if(!s(d)||Ae(n,d)||ks(d,n))return;N<=11&&setTimeout(Nn(n,function(){return t.updateFromDOM()}),20)}),Se(r,"compositionstart",function(d){t.composing={data:d.data,done:!1}}),Se(r,"compositionupdate",function(d){t.composing||(t.composing={data:d.data,done:!1})}),Se(r,"compositionend",function(d){t.composing&&(d.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Se(r,"touchstart",function(){return i.forceCompositionEnd()}),Se(r,"input",function(){t.composing||t.readFromDOMSoon()});function l(d){if(!s(d)||Ae(n,d))return;if(n.somethingSelected())ao({lineWise:!1,text:n.getSelections()}),d.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var f=Ts(n);ao({lineWise:!0,text:f.text}),d.type=="cut"&&n.operation(function(){n.setSelections(f.ranges,0,Te),n.replaceSelection("",null,"cut")})}else return;if(d.clipboardData){d.clipboardData.clearData();var v=fi.text.join(`
`);if(d.clipboardData.setData("Text",v),d.clipboardData.getData("Text")==v){d.preventDefault();return}}var D=Ps(),W=D.firstChild;n.display.lineSpace.insertBefore(D,n.display.lineSpace.firstChild),W.value=fi.text.join(`
`);var ce=document.activeElement;de(W),setTimeout(function(){n.display.lineSpace.removeChild(D),ce.focus(),ce==r&&i.showPrimarySelection()},50)}Se(r,"copy",l),Se(r,"cut",l)},cn.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},cn.prototype.prepareSelection=function(){var e=ya(this.cm,!1);return e.focus=document.activeElement==this.div,e},cn.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},cn.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},cn.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),r=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||r.line<t.display.viewFrom){e.removeAllRanges();return}var s=so(t,e.anchorNode,e.anchorOffset),l=so(t,e.focusNode,e.focusOffset);if(s&&!s.bad&&l&&!l.bad&&et(En(s,l),n)==0&&et(gn(s,l),r)==0)return;var d=t.display.view,f=n.line>=t.display.viewFrom&&Ls(t,n)||{node:d[0].measure.map[2],offset:0},v=r.line<t.display.viewTo&&Ls(t,r);if(!v){var D=d[d.length-1].measure,W=D.maps?D.maps[D.maps.length-1]:D.map;v={node:W[W.length-1],offset:W[W.length-2]-W[W.length-3]}}if(!f||!v){e.removeAllRanges();return}var ce=e.rangeCount&&e.getRangeAt(0),ie;try{ie=G(f.node,f.offset,v.offset,v.node)}catch(Pe){}ie&&(!Z&&t.state.focused?(e.collapse(f.node,f.offset),ie.collapsed||(e.removeAllRanges(),e.addRange(ie))):(e.removeAllRanges(),e.addRange(ie)),ce&&e.anchorNode==null?e.addRange(ce):Z&&this.startGracePeriod()),this.rememberSelection()},cn.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)},cn.prototype.showMultipleSelections=function(e){T(this.cm.display.cursorDiv,e.cursors),T(this.cm.display.selectionDiv,e.selection)},cn.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},cn.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return C(this.div,t)},cn.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},cn.prototype.blur=function(){this.div.blur()},cn.prototype.getField=function(){return this.div},cn.prototype.supportsTouch=function(){return!0},cn.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():ri(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)},cn.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},cn.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(X&&k&&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=so(t,e.anchorNode,e.anchorOffset),n=so(t,e.focusNode,e.focusOffset);i&&n&&ri(t,function(){Vn(t.doc,Ai(i,n),Te),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},cn.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(),r=i.to();if(n.ch==0&&n.line>e.firstLine()&&(n=je(n.line-1,yt(e.doc,n.line-1).length)),r.ch==yt(e.doc,r.line).text.length&&r.line<e.lastLine()&&(r=je(r.line+1,0)),n.line<t.viewFrom||r.line>t.viewTo-1)return!1;var s,l,d;n.line==t.viewFrom||(s=zi(e,n.line))==0?(l=It(t.view[0].line),d=t.view[0].node):(l=It(t.view[s].line),d=t.view[s-1].node.nextSibling);var f=zi(e,r.line),v,D;if(f==t.view.length-1?(v=t.viewTo-1,D=t.lineDiv.lastChild):(v=It(t.view[f+1].line)-1,D=t.view[f+1].node.previousSibling),!d)return!1;for(var W=e.doc.splitLines(tu(e,d,D,l,v)),ce=Yt(e.doc,je(l,0),je(v,yt(e.doc,v).text.length));W.length>1&&ce.length>1;)if(Ne(W)==Ne(ce))W.pop(),ce.pop(),v--;else if(W[0]==ce[0])W.shift(),ce.shift(),l++;else break;for(var ie=0,Pe=0,We=W[0],Je=ce[0],tt=Math.min(We.length,Je.length);ie<tt&&We.charCodeAt(ie)==Je.charCodeAt(ie);)++ie;for(var vt=Ne(W),nt=Ne(ce),_t=Math.min(vt.length-(W.length==1?ie:0),nt.length-(ce.length==1?ie:0));Pe<_t&&vt.charCodeAt(vt.length-Pe-1)==nt.charCodeAt(nt.length-Pe-1);)++Pe;if(W.length==1&&ce.length==1&&l==n.line)for(;ie&&ie>n.ch&&vt.charCodeAt(vt.length-Pe-1)==nt.charCodeAt(nt.length-Pe-1);)ie--,Pe++;W[W.length-1]=vt.slice(0,vt.length-Pe).replace(/^\u200b+/,""),W[0]=W[0].slice(ie).replace(/\u200b+$/,"");var Bt=je(l,ie),jt=je(v,ce.length?Ne(ce).length-Pe:0);if(W.length>1||W[0]||et(Bt,jt))return ar(e.doc,W,Bt,jt,"+input"),!0},cn.prototype.ensurePolled=function(){this.forceCompositionEnd()},cn.prototype.reset=function(){this.forceCompositionEnd()},cn.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},cn.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)},cn.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&ri(this.cm,function(){return Jn(e.cm)})},cn.prototype.setUneditable=function(e){e.contentEditable="false"},cn.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Nn(this.cm,Ko)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},cn.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},cn.prototype.onContextMenu=function(){},cn.prototype.resetPosition=function(){},cn.prototype.needsContentAttribute=!0;function Ls(e,t){var i=go(e,t.line);if(!i||i.hidden)return null;var n=yt(e.doc,t.line),r=ra(i,n,t.line),s=bt(n,e.doc.direction),l="left";if(s){var d=ut(s,t.ch);l=d%2?"right":"left"}var f=sa(r.map,t.ch,l);return f.offset=f.collapse=="right"?f.end:f.start,f}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function hr(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,r){var s="",l=!1,d=e.doc.lineSeparator(),f=!1;function v(ie){return function(Pe){return Pe.id==ie}}function D(){l&&(s+=d,f&&(s+=d),l=f=!1)}function W(ie){ie&&(D(),s+=ie)}function ce(ie){if(ie.nodeType==1){var Pe=ie.getAttribute("cm-text");if(Pe){W(Pe);return}var We=ie.getAttribute("cm-marker"),Je;if(We){var tt=e.findMarks(je(n,0),je(r+1,0),v(+We));tt.length&&(Je=tt[0].find(0))&&W(Yt(e.doc,Je.from,Je.to).join(d));return}if(ie.getAttribute("contenteditable")=="false")return;var vt=/^(pre|div|p|li|table|br)$/i.test(ie.nodeName);if(!/^br$/i.test(ie.nodeName)&&ie.textContent.length==0)return;vt&&D();for(var nt=0;nt<ie.childNodes.length;nt++)ce(ie.childNodes[nt]);/^(pre|p)$/i.test(ie.nodeName)&&(f=!0),vt&&(l=!0)}else ie.nodeType==3&&W(ie.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(ce(t),t==i);)t=t.nextSibling,f=!1;return s}function so(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return hr(e.clipPos(je(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 r=0;r<e.display.view.length;r++){var s=e.display.view[r];if(s.node==n)return nu(s,t,i)}}function nu(e,t,i){var n=e.text.firstChild,r=!1;if(!t||!C(n,t))return hr(je(It(e.line),0),!0);if(t==n&&(r=!0,t=n.childNodes[i],i=0,!t)){var s=e.rest?Ne(e.rest):e.line;return hr(je(It(s),s.text.length),r)}var l=t.nodeType==3?t:null,d=t;for(!l&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(l=t.firstChild,i&&(i=l.nodeValue.length));d.parentNode!=n;)d=d.parentNode;var f=e.measure,v=f.maps;function D(Je,tt,vt){for(var nt=-1;nt<(v?v.length:0);nt++)for(var _t=nt<0?f.map:v[nt],Bt=0;Bt<_t.length;Bt+=3){var jt=_t[Bt+2];if(jt==Je||jt==tt){var Vt=It(nt<0?e.line:e.rest[nt]),pn=_t[Bt]+vt;return(vt<0||jt!=Je)&&(pn=_t[Bt+(vt?1:0)]),je(Vt,pn)}}}var W=D(l,d,i);if(W)return hr(W,r);for(var ce=d.nextSibling,ie=l?l.nodeValue.length-i:0;ce;ce=ce.nextSibling){if(W=D(ce,ce.firstChild,0),W)return hr(je(W.line,W.ch-ie),r);ie+=ce.textContent.length}for(var Pe=d.previousSibling,We=i;Pe;Pe=Pe.previousSibling){if(W=D(Pe,Pe.firstChild,-1),W)return hr(je(W.line,W.ch+We),r);We+=Pe.textContent.length}}var Rn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Oe,this.hasSelection=!1,this.composing=null};Rn.prototype.init=function(e){var t=this,i=this,n=this.cm;this.createField(e);var r=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),H&&(r.style.width="0px"),Se(r,"input",function(){O&&N>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Se(r,"paste",function(l){if(Ae(n,l)||ks(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if(Ae(n,l))return;if(n.somethingSelected())ao({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var d=Ts(n);ao({lineWise:!0,text:d.text}),l.type=="cut"?n.setSelections(d.ranges,null,Te):(i.prevInput="",r.value=d.text.join(`
`),de(r))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}Se(r,"cut",s),Se(r,"copy",s),Se(e.scroller,"paste",function(l){if(Ci(e,l)||Ae(n,l))return;if(!r.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var d=new Event("paste");d.clipboardData=l.clipboardData,r.dispatchEvent(d)}),Se(e.lineSpace,"selectstart",function(l){Ci(e,l)||b(l)}),Se(r,"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"})}}),Se(r,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},Rn.prototype.createField=function(e){this.wrapper=Ps(),this.textarea=this.wrapper.firstChild},Rn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Rn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=ya(e);if(e.options.moveInputWithCursor){var r=hi(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,r.top+l.top-s.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+l.left-s.left))}return n},Rn.prototype.showSelection=function(e){var t=this.cm,i=t.display;T(i.cursorDiv,e.cursors),T(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Rn.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&&de(this.textarea),O&&N>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",O&&N>=9&&(this.hasSelection=null))},Rn.prototype.getField=function(){return this.textarea},Rn.prototype.supportsTouch=function(){return!1},Rn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!oe||E()!=this.textarea))try{this.textarea.focus()}catch(e){}},Rn.prototype.blur=function(){this.textarea.blur()},Rn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Rn.prototype.receivedFocus=function(){this.slowPoll()},Rn.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()})},Rn.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)},Rn.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Xe(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var r=i.value;if(r==n&&!t.somethingSelected())return!1;if(O&&N>=9&&this.hasSelection===r||se&&/[\uf700-\uf7ff]/.test(r))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var s=r.charCodeAt(0);if(s==8203&&!n&&(n="\u200B"),s==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,d=Math.min(n.length,r.length);l<d&&n.charCodeAt(l)==r.charCodeAt(l);)++l;return ri(t,function(){Ko(t,r.slice(l),n.length-l,null,e.composing?"*compose":null),r.length>1e3||r.indexOf(`
`)>-1?i.value=e.prevInput="":e.prevInput=r,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Rn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Rn.prototype.onKeyPress=function(){O&&N>=9&&(this.hasSelection=null),this.fastPoll()},Rn.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=Wi(i,e),l=n.scroller.scrollTop;if(!s||R)return;var d=i.options.resetSelectionOnContextMenu;d&&i.doc.sel.contains(s)==-1&&Nn(i,Vn)(i.doc,Ai(s),Te);var f=r.style.cssText,v=t.wrapper.style.cssText,D=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-D.top-5)+"px; left: "+(e.clientX-D.left-5)+`px;
z-index: 1000; background: `+(O?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var W;A&&(W=window.scrollY),n.input.focus(),A&&window.scrollTo(null,W),n.input.reset(),i.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=ie,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function ce(){if(r.selectionStart!=null){var We=i.somethingSelected(),Je="\u200B"+(We?r.value:"");r.value="\u21DA",r.value=Je,t.prevInput=We?"":"\u200B",r.selectionStart=1,r.selectionEnd=Je.length,n.selForContextMenu=i.doc.sel}}function ie(){if(t.contextMenuPending!=ie)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=v,r.style.cssText=f,O&&N<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),r.selectionStart!=null){(!O||O&&N<9)&&ce();var We=0,Je=function(){n.selForContextMenu==i.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?Nn(i,Ja)(i):We++<10?n.detectingSelectAll=setTimeout(Je,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(Je,200)}}if(O&&N>=9&&ce(),De){P(e);var Pe=function(){ht(window,"mouseup",Pe),setTimeout(ie,20)};Se(window,"mouseup",Pe)}else setTimeout(ie,50)},Rn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Rn.prototype.setUneditable=function(){},Rn.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?g(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=E();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=d.getValue()}var r;if(e.form&&(Se(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var s=e.form;r=s.submit;try{var l=s.submit=function(){n(),s.submit=r,s.submit(),s.submit=l}}catch(f){}}t.finishInit=function(f){f.save=n,f.getTextArea=function(){return e},f.toTextArea=function(){f.toTextArea=isNaN,n(),e.parentNode.removeChild(f.getWrapperElement()),e.style.display="",e.form&&(ht(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var d=bn(function(f){return e.parentNode.insertBefore(f,e.nextSibling)},t);return d}function ru(e){e.off=ht,e.on=Se,e.wheelEventPixels=hl,e.Doc=qn,e.splitLines=mt,e.countColumn=te,e.findColumn=we,e.isWordChar=Fe,e.Pass=Qe,e.signal=ke,e.Line=ki,e.changeEnd=Pi,e.scrollbarModel=ka,e.Pos=je,e.cmpPos=et,e.modes=Pt,e.mimeModes=ct,e.resolveMode=He,e.getMode=dt,e.modeExtensions=gt,e.extendMode=Et,e.copyState=Xt,e.startState=tn,e.innerMode=Gt,e.commands=Dr,e.keyMap=_i,e.keyName=ds,e.isModifierKey=cs,e.lookupKey=lr,e.normalizeKeyMap=Ml,e.StringStream=Ht,e.SharedTextMarker=Or,e.TextMarker=Li,e.LineWidget=Pr,e.e_preventDefault=b,e.e_stopPropagation=_,e.e_stop=P,e.addClass=J,e.contains=C,e.rmClass=m,e.keyNames=Mi}Yl(bn),Zl(bn);var ou="iter insert remove copy getEditor constructor".split(" ");for(var lo in qn.prototype)qn.prototype.hasOwnProperty(lo)&&_e(ou,lo)<0&&(bn.prototype[lo]=function(e){return function(){return e.apply(this.doc,arguments)}}(qn.prototype[lo]));return I(qn),bn.inputStyles={textarea:Rn,contenteditable:cn},bn.defineMode=function(e){!bn.defaults.mode&&e!="null"&&(bn.defaults.mode=e),Wt.apply(this,arguments)},bn.defineMIME=Nt,bn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),bn.defineMIME("text/plain","null"),bn.defineExtension=function(e,t){bn.prototype[e]=t},bn.defineDocExtension=function(e,t){qn.prototype[e]=t},bn.fromTextArea=iu,ru(bn),bn.version="5.58.2",bn})},Y1PL:function(it,qe,y){"use strict";y.r(qe),y.d(qe,"ResizableTextArea",function(){return _e});var B=y("wx14"),me=y("1OyB"),Z=y("vuIU"),fe=y("Ji7U"),ue=y("LK+K"),ee=y("q1tI"),O=y("VTBJ"),N=y("rePB"),A=y("Zm9Q"),U=y("Kwbf"),k=y("c+Xe"),R=y("m+aA"),q=y("bdgK"),$=new Map;function F(Te){Te.forEach(function(Ee){var ye,we=Ee.target;(ye=$.get(we))===null||ye===void 0||ye.forEach(function(ne){return ne(we)})})}var H=new q.default(F),X=null,oe=null;function se(Te,Ee){$.has(Te)||($.set(Te,new Set),H.observe(Te)),$.get(Te).add(Ee)}function Le(Te,Ee){$.has(Te)&&($.get(Te).delete(Ee),$.get(Te).size||(H.unobserve(Te),$.delete(Te)))}var Me=function(Te){Object(fe.a)(ye,Te);var Ee=Object(ue.a)(ye);function ye(){return Object(me.a)(this,ye),Ee.apply(this,arguments)}return Object(Z.a)(ye,[{key:"render",value:function(){return this.props.children}}]),ye}(ee.Component),le=ee.createContext(null);function ve(Te){var Ee=Te.children,ye=Te.onBatchResize,we=ee.useRef(0),ne=ee.useRef([]),z=ee.useContext(le),Ne=ee.useCallback(function(be,St,Ze){we.current+=1;var Ke=we.current;ne.current.push({size:be,element:St,data:Ze}),Promise.resolve().then(function(){Ke===we.current&&(ye==null||ye(ne.current),ne.current=[])}),z==null||z(be,St,Ze)},[ye,z]);return ee.createElement(le.Provider,{value:Ne},Ee)}function De(Te){var Ee=Te.children,ye=Te.disabled,we=ee.useRef(null),ne=ee.useRef(null),z=ee.useContext(le),Ne=ee.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),be=ee.isValidElement(Ee)&&Object(k.c)(Ee),St=be?Ee.ref:null,Ze=ee.useMemo(function(){return Object(k.a)(St,we)},[St,we]),Ke=ee.useRef(Te);Ke.current=Te;var Re=ee.useCallback(function(Fe){var Ge=Ke.current,Ye=Ge.onResize,Ve=Ge.data,Be=Fe.getBoundingClientRect(),ze=Be.width,Lt=Be.height,ft=Fe.offsetWidth,st=Fe.offsetHeight,ut=Math.floor(ze),xt=Math.floor(Lt);if(Ne.current.width!==ut||Ne.current.height!==xt||Ne.current.offsetWidth!==ft||Ne.current.offsetHeight!==st){var bt={width:ut,height:xt,offsetWidth:ft,offsetHeight:st};Ne.current=bt;var pt=ft===Math.round(ze)?ze:ft,Se=st===Math.round(Lt)?Lt:st,Rt=Object(O.a)(Object(O.a)({},bt),{},{offsetWidth:pt,offsetHeight:Se});z==null||z(Rt,Fe,Ve),Ye&&Promise.resolve().then(function(){Ye(Rt,Fe)})}},[]);return ee.useEffect(function(){var Fe=Object(R.a)(we.current)||Object(R.a)(ne.current);return Fe&&!ye&&se(Fe,Re),function(){return Le(Fe,Re)}},[we.current,ye]),ee.createElement(Me,{ref:ne},be?ee.cloneElement(Ee,{ref:Ze}):Ee)}var Y="rc-observer-key";function m(Te){var Ee=Te.children,ye=Object(A.a)(Ee);return ye.map(function(we,ne){var z=(we==null?void 0:we.key)||"".concat(Y,"-").concat(ne);return ee.createElement(De,Object(B.a)({},Te,{key:z}),we)})}m.Collection=ve;var ge=m,T=y("bT9E"),x=y("TSYQ"),K=y.n(x),G=`
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
`,C=["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"],E={},J;function L(Te){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ye=Te.getAttribute("id")||Te.getAttribute("data-reactid")||Te.getAttribute("name");if(Ee&&E[ye])return E[ye];var we=window.getComputedStyle(Te),ne=we.getPropertyValue("box-sizing")||we.getPropertyValue("-moz-box-sizing")||we.getPropertyValue("-webkit-box-sizing"),z=parseFloat(we.getPropertyValue("padding-bottom"))+parseFloat(we.getPropertyValue("padding-top")),Ne=parseFloat(we.getPropertyValue("border-bottom-width"))+parseFloat(we.getPropertyValue("border-top-width")),be=C.map(function(Ze){return"".concat(Ze,":").concat(we.getPropertyValue(Ze))}).join(";"),St={sizingStyle:be,paddingSize:z,borderSize:Ne,boxSizing:ne};return Ee&&ye&&(E[ye]=St),St}function de(Te){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ye=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,we=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;J||(J=document.createElement("textarea"),J.setAttribute("tab-index","-1"),J.setAttribute("aria-hidden","true"),document.body.appendChild(J)),Te.getAttribute("wrap")?J.setAttribute("wrap",Te.getAttribute("wrap")):J.removeAttribute("wrap");var ne=L(Te,Ee),z=ne.paddingSize,Ne=ne.borderSize,be=ne.boxSizing,St=ne.sizingStyle;J.setAttribute("style","".concat(St,";").concat(G)),J.value=Te.value||Te.placeholder||"";var Ze=Number.MIN_SAFE_INTEGER,Ke=Number.MAX_SAFE_INTEGER,Re=J.scrollHeight,Fe;if(be==="border-box"?Re+=Ne:be==="content-box"&&(Re-=z),ye!==null||we!==null){J.value=" ";var Ge=J.scrollHeight-z;ye!==null&&(Ze=Ge*ye,be==="border-box"&&(Ze=Ze+z+Ne),Re=Math.max(Ze,Re)),we!==null&&(Ke=Ge*we,be==="border-box"&&(Ke=Ke+z+Ne),Fe=Re>Ke?"":"hidden",Re=Math.min(Ke,Re))}return{height:Re,minHeight:Ze,maxHeight:Ke,overflowY:Fe,resize:"none"}}var w=y("Gytx"),g=y.n(w),te;(function(Te){Te[Te.NONE=0]="NONE",Te[Te.RESIZING=1]="RESIZING",Te[Te.RESIZED=2]="RESIZED"})(te||(te={}));var Oe=function(Te){Object(fe.a)(ye,Te);var Ee=Object(ue.a)(ye);function ye(we){var ne;return Object(me.a)(this,ye),ne=Ee.call(this,we),ne.nextFrameActionId=void 0,ne.resizeFrameId=void 0,ne.textArea=void 0,ne.saveTextArea=function(z){ne.textArea=z},ne.handleResize=function(z){var Ne=ne.state.resizeStatus,be=ne.props,St=be.autoSize,Ze=be.onResize;if(Ne!==te.NONE)return;typeof Ze=="function"&&Ze(z),St&&ne.resizeOnNextFrame()},ne.resizeOnNextFrame=function(){cancelAnimationFrame(ne.nextFrameActionId),ne.nextFrameActionId=requestAnimationFrame(ne.resizeTextarea)},ne.resizeTextarea=function(){var z=ne.props.autoSize;if(!z||!ne.textArea)return;var Ne=z.minRows,be=z.maxRows,St=de(ne.textArea,!1,Ne,be);ne.setState({textareaStyles:St,resizeStatus:te.RESIZING},function(){cancelAnimationFrame(ne.resizeFrameId),ne.resizeFrameId=requestAnimationFrame(function(){ne.setState({resizeStatus:te.RESIZED},function(){ne.resizeFrameId=requestAnimationFrame(function(){ne.setState({resizeStatus:te.NONE}),ne.fixFirefoxAutoScroll()})})})})},ne.renderTextArea=function(){var z=ne.props,Ne=z.prefixCls,be=Ne===void 0?"rc-textarea":Ne,St=z.autoSize,Ze=z.onResize,Ke=z.className,Re=z.disabled,Fe=ne.state,Ge=Fe.textareaStyles,Ye=Fe.resizeStatus,Ve=Object(T.a)(ne.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Be=K()(be,Ke,Object(N.a)({},"".concat(be,"-disabled"),Re));"value"in Ve&&(Ve.value=Ve.value||"");var ze=Object(O.a)(Object(O.a)(Object(O.a)({},ne.props.style),Ge),Ye===te.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return ee.createElement(ge,{onResize:ne.handleResize,disabled:!(St||Ze)},ee.createElement("textarea",Object(B.a)({},Ve,{className:Be,style:ze,ref:ne.saveTextArea})))},ne.state={textareaStyles:{},resizeStatus:te.NONE},ne}return Object(Z.a)(ye,[{key:"componentDidUpdate",value:function(ne){(ne.value!==this.props.value||!g()(ne.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 ne=this.textArea.selectionStart,z=this.textArea.selectionEnd;this.textArea.setSelectionRange(ne,z)}}catch(Ne){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ye}(ee.Component),_e=Oe,$e=function(Te){Object(fe.a)(ye,Te);var Ee=Object(ue.a)(ye);function ye(we){var ne;Object(me.a)(this,ye),ne=Ee.call(this,we),ne.resizableTextArea=void 0,ne.focus=function(){ne.resizableTextArea.textArea.focus()},ne.saveTextArea=function(Ne){ne.resizableTextArea=Ne},ne.handleChange=function(Ne){var be=ne.props.onChange;ne.setValue(Ne.target.value,function(){ne.resizableTextArea.resizeTextarea()}),be&&be(Ne)},ne.handleKeyDown=function(Ne){var be=ne.props,St=be.onPressEnter,Ze=be.onKeyDown;Ne.keyCode===13&&St&&St(Ne),Ze&&Ze(Ne)};var z=typeof we.value=="undefined"||we.value===null?we.defaultValue:we.value;return ne.state={value:z},ne}return Object(Z.a)(ye,[{key:"setValue",value:function(ne,z){"value"in this.props||this.setState({value:ne},z)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return ee.createElement(_e,Object(B.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ne){return"value"in ne?{value:ne.value}:null}}]),ye}(ee.Component),Qe=qe.default=$e},ZW9T:function(it,qe,y){"use strict";y.d(qe,"a",function(){return Me});var B=y("k1fw"),me=y("miYZ"),Z=y("tsqr"),fe=y("rAM+"),ue=y("tJVT"),ee=y("PpiC"),O=y("q1tI"),N=y.n(O),A=y("bdgK");function U(le,ve,De,Y,m){var ge=ve.getWordUntilPosition(De),T={startLineNumber:De.lineNumber,endLineNumber:De.lineNumber,startColumn:ge.startColumn,endColumn:ge.endColumn},x=Y.map(function(K){return{label:K,kind:le.languages.CompletionItemKind.Keyword,insertText:K,insertTextRules:le.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:T}});return m.map(function(K){x.push(Object(B.a)(Object(B.a)({},K),{},{range:T}))}),x}var k=function(le){var ve={label:"ifelse",kind:le.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`),insertTextRules:le.languages.CompletionItemInsertTextRule.InsertAsSnippet},De=["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"];le.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(T,x){var K=U(le,T,x,De,[ve]);return{suggestions:K}}});var Y=["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"];le.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(T,x){var K=[{label:"print",kind:le.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
`),insertTextRules:le.languages.CompletionItemInsertTextRule.InsertAsSnippet}],G=U(le,T,x,Y,K);return{suggestions:G}}});var m=["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"];le.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(T,x){var K=[ve,{label:"main",kind:le.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
`),insertTextRules:le.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:le.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
`),insertTextRules:le.languages.CompletionItemInsertTextRule.InsertAsSnippet}],G=U(le,T,x,m,K);return{suggestions:G}}})},R="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",q=y("LvDl");function $(le){return/^\d+$/.test(le)?"".concat(le,"px"):le}function F(){}var H=!1,X={"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 oe(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ve=le;if(Array.isArray(le)){for(var De=0;De<le.length;De++){var Y=X[le[De]];if(Y)return Y}return ve[0]}return X[ve]||ve}var se=null,Le=qe.b=function(le){var ve=le.width,De=ve===void 0?"100%":ve,Y=le.height,m=Y===void 0?"100%":Y,ge=le.value,T=le.language,x=T===void 0?"javascript":T,K=le.style,G=K===void 0?{}:K,C=le.options,E=C===void 0?{}:C,J=le.overrideServices,L=J===void 0?{}:J,de=le.theme,w=de===void 0?"vs-dark":de,g=le.onEditBlur,te=le.onSave,Oe=le.autoHeight,_e=Oe===void 0?!1:Oe,$e=le.forbidCopy,Qe=$e===void 0?!1:$e,Te=le.onChange,Ee=Te===void 0?F:Te,ye=le.editorDidMount,we=ye===void 0?F:ye,ne=le.onFocus,z=ne===void 0?F:ne,Ne=le.filename,be=Ne===void 0?"educoder.txt":Ne,St=Object(ee.a)(le,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),Ze=Object(O.useRef)(),Ke=Object(O.useRef)({}),Re=Object(O.useRef)(),Fe=Object(O.useRef)(!1),Ge=Object(O.useRef)(),Ye=Object(O.useState)(!1),Ve=Object(ue.a)(Ye,2),Be=Ve[0],ze=Ve[1];function Lt(){var S;return Ze.current&&(S=new A.default(function(P){var re=Object(fe.a)(P),pe;try{for(re.s();!(pe=re.n()).done;){var Ce=pe.value;(Ce.target.offsetHeight>0||Ce.target.offsetWidth>0)&&Ke.current.instance.layout()}}catch(Ct){re.e(Ct)}finally{re.f()}}),S.observe(Ze.current)),S}function ft(){Z.b.warn(decodeURIComponent(R))}var st=function(){var P=Ke.current.instance;if(ge!=null&&P&&Be){var re=P.getModel();re&&ge!==re.getValue()&&(H=!0,re.setValue(ge),P.layout(),H=!1)}};Object(O.useEffect)(function(){Re.current&&clearTimeout(Re.current),Re.current=setTimeout(function(){st()},500)},[ge,Be,Ke.current]);function ut(){var S=Ke.current.instance;if(S){var P=S.getSelection(),re=Ke.current.pastePos||{},pe=new se.Range(re.startLineNumber||P.endLineNumber,re.startColumn||P.endColumn,re.endLineNumber||P.endLineNumber,re.endColumn||P.endColumn);setTimeout(function(){S.executeEdits("",[{range:pe,text:""}])},300)}}function xt(S){(window.navigator.platform.match("Mac")?S.metaKey:S.ctrlKey)&&S.keyCode==83&&(S.preventDefault(),te())}var bt=function(){if(_e&&Ke.current.instance){var P=Ke.current.instance.getContentHeight();b(P<m?m:P)}else b(m)};function pt(S){var P=document.createEvent("MouseEvents");P.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),S.dispatchEvent(P)}function Se(S,P){var re=window.URL||window.webkitURL||window,pe=new Blob([P]),Ce=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ce.href=re.createObjectURL(pe),Ce.download=S,pt(Ce)}Object(O.useEffect)(function(){bt()},[bt]),Object(O.useEffect)(function(){Ze.current&&!Be&&y.e(27).then(y.t.bind(null,"M/lh",7)).then(function(S){try{se=S,Ke.current.instance=se.editor.create(Ze.current,{value:ge,language:oe(x),theme:w,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},L);var P=Ke.current.instance;if(we(P,se),setTimeout(function(){bt(),Ke.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Se(be||"educoder.txt",P.getValue())}})},500),Ke.current.subscription=P.onDidChangeModelContent(function(pe){Fe.current?clearTimeout(Ge.current):(bt(),Ee(P.getValue(),pe)),Ge.current=setTimeout(function(){Fe.current=!1},500)}),window.Monaco||k(se),Qe&&(P.addCommand(se.KeyMod.CtrlCmd|se.KeyMod.Shift|se.KeyCode.KEY_V,function(){return ft(),null}),P.addCommand(se.KeyMod.CtrlCmd|se.KeyCode.KEY_C,function(){return ft(),null})),window.Monaco=se,g&&P.onDidBlurEditorWidget(function(){g(P.getValue())}),z&&P.onDidFocusEditorText(function(){z(P.getValue())}),Qe){P.addCommand(se.KeyMod.CtrlCmd|se.KeyCode.KEY_V,function(){return ft(),null}),P.onDidPaste(function(pe){Ke.current.pastePos=pe});try{window.addEventListener("paste",ut)}catch(pe){}}var re=Lt();return ze(!0),function(){var pe=Ke.current.instance;pe.dispose();var Ce=pe.getModel();Ce&&Ce.dispose(),Ke.current.subscription&&Ke.current.subscription.dispose(),Qe&&window.removeEventListener("paste",ut),re.unobserve(Ze.current)}}catch(pe){}})},[]),Object(O.useEffect)(function(){var S=Ke.current.instance;if(S&&Be)return document.addEventListener("keydown",xt,!1),function(){document.removeEventListener("keydown",xt)}},[te,Be]),Object(O.useEffect)(function(){var S=Ke.current.instance;if(S&&Be){var P=oe(x);se.editor.setModelLanguage(S.getModel(),P),console.log("language:",x,S.getModel(),P)}},[x,Be]),Object(O.useEffect)(function(){var S=Ke.current.instance;S&&Be&&se.editor.setTheme(w)},[w,Be]),Object(O.useEffect)(function(){var S=Ke.current.instance;S&&Be&&(S.updateOptions(Object(B.a)({},E)),setTimeout(function(){S.getModel().updateOptions(Object(B.a)({},E))},200))},[JSON.stringify(E),Be]),Object(O.useEffect)(function(){var S=Ke.current.instance;S&&Be&&S.layout()},[De,m,Be]);var Rt=Object(O.useState)($(De)),ht=Object(ue.a)(Rt,2),ke=ht[0],Ae=ht[1],M=Object(O.useState)($(m)),j=Object(ue.a)(M,2),I=j[0],b=j[1],_=Object(B.a)(Object(B.a)({},G),{},{width:ke,height:I});return N.a.createElement("div",{className:"my-monaco-editor",ref:Ze,style:_})};function Me(le){var ve=le.width,De=ve===void 0?"100%":ve,Y=le.height,m=Y===void 0?"100%":Y,ge=le.original,T=le.modified,x=le.language,K=le.options,G=K===void 0?{}:K,C=Object(O.useRef)(),E=Object(O.useState)(null),J=Object(ue.a)(E,2),L=J[0],de=J[1];function w(_e){var $e;return C.current&&($e=new A.default(function(Qe){var Te=Object(fe.a)(Qe),Ee;try{for(Te.s();!(Ee=Te.n()).done;){var ye=Ee.value;(ye.target.offsetHeight>0||ye.target.offsetWidth>0)&&_e.layout()}}catch(we){Te.e(we)}finally{Te.f()}}),$e.observe(C.current)),$e}Object(O.useEffect)(function(){C.current&&y.e(27).then(y.t.bind(null,"M/lh",7)).then(function(_e){se=_e;var $e=se.editor.createDiffEditor(C.current,Object(B.a)(Object(B.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},G),{},{wordWrap:!0}));de($e);var Qe=w($e);return function(){$e.dispose();var Te=$e.getModel();Te&&Te.dispose(),Qe.unobserve(C.current)}})},[]),Object(O.useEffect)(function(){L&&L.setModel({original:se.editor.createModel(ge,x),modified:se.editor.createModel(T,x)})},[ge,T,x,L]);var g=$(De),te=$(m),Oe={width:g,height:te};return N.a.createElement("div",{className:"my-diff-editor",ref:C,style:Oe})}},ZpRC:function(it,qe,y){"use strict";function B(k){return typeof k=="object"&&k!=null&&k.nodeType===1}function me(k,R){return(!R||k!=="hidden")&&k!=="visible"&&k!=="clip"}function Z(k,R){if(k.clientHeight<k.scrollHeight||k.clientWidth<k.scrollWidth){var q=getComputedStyle(k,null);return me(q.overflowY,R)||me(q.overflowX,R)||function($){var F=function(H){if(!H.ownerDocument||!H.ownerDocument.defaultView)return null;try{return H.ownerDocument.defaultView.frameElement}catch(X){return null}}($);return!!F&&(F.clientHeight<$.scrollHeight||F.clientWidth<$.scrollWidth)}(k)}return!1}function fe(k,R,q,$,F,H,X,oe){return H<k&&X>R||H>k&&X<R?0:H<=k&&oe<=q||X>=R&&oe>=q?H-k-$:X>R&&oe<q||H<k&&oe>q?X-R+F:0}var ue=function(k,R){var q=window,$=R.scrollMode,F=R.block,H=R.inline,X=R.boundary,oe=R.skipOverflowHiddenElements,se=typeof X=="function"?X:function(Ge){return Ge!==X};if(!B(k))throw new TypeError("Invalid target");for(var Le=document.scrollingElement||document.documentElement,Me=[],le=k;B(le)&&se(le);){if((le=le.parentElement)===Le){Me.push(le);break}le!=null&&le===document.body&&Z(le)&&!Z(document.documentElement)||le!=null&&Z(le,oe)&&Me.push(le)}for(var ve=q.visualViewport?q.visualViewport.width:innerWidth,De=q.visualViewport?q.visualViewport.height:innerHeight,Y=window.scrollX||pageXOffset,m=window.scrollY||pageYOffset,ge=k.getBoundingClientRect(),T=ge.height,x=ge.width,K=ge.top,G=ge.right,C=ge.bottom,E=ge.left,J=F==="start"||F==="nearest"?K:F==="end"?C:K+T/2,L=H==="center"?E+x/2:H==="end"?G:E,de=[],w=0;w<Me.length;w++){var g=Me[w],te=g.getBoundingClientRect(),Oe=te.height,_e=te.width,$e=te.top,Qe=te.right,Te=te.bottom,Ee=te.left;if($==="if-needed"&&K>=0&&E>=0&&C<=De&&G<=ve&&K>=$e&&C<=Te&&E>=Ee&&G<=Qe)return de;var ye=getComputedStyle(g),we=parseInt(ye.borderLeftWidth,10),ne=parseInt(ye.borderTopWidth,10),z=parseInt(ye.borderRightWidth,10),Ne=parseInt(ye.borderBottomWidth,10),be=0,St=0,Ze="offsetWidth"in g?g.offsetWidth-g.clientWidth-we-z:0,Ke="offsetHeight"in g?g.offsetHeight-g.clientHeight-ne-Ne:0;if(Le===g)be=F==="start"?J:F==="end"?J-De:F==="nearest"?fe(m,m+De,De,ne,Ne,m+J,m+J+T,T):J-De/2,St=H==="start"?L:H==="center"?L-ve/2:H==="end"?L-ve:fe(Y,Y+ve,ve,we,z,Y+L,Y+L+x,x),be=Math.max(0,be+m),St=Math.max(0,St+Y);else{be=F==="start"?J-$e-ne:F==="end"?J-Te+Ne+Ke:F==="nearest"?fe($e,Te,Oe,ne,Ne+Ke,J,J+T,T):J-($e+Oe/2)+Ke/2,St=H==="start"?L-Ee-we:H==="center"?L-(Ee+_e/2)+Ze/2:H==="end"?L-Qe+z+Ze:fe(Ee,Qe,_e,we,z+Ze,L,L+x,x);var Re=g.scrollLeft,Fe=g.scrollTop;J+=Fe-(be=Math.max(0,Math.min(Fe+be,g.scrollHeight-Oe+Ke))),L+=Re-(St=Math.max(0,Math.min(Re+St,g.scrollWidth-_e+Ze)))}de.push({el:g,top:be,left:St})}return de};function ee(k){return k===Object(k)&&Object.keys(k).length!==0}function O(k,R){R===void 0&&(R="auto");var q="scrollBehavior"in document.body.style;k.forEach(function($){var F=$.el,H=$.top,X=$.left;F.scroll&&q?F.scroll({top:H,left:X,behavior:R}):(F.scrollTop=H,F.scrollLeft=X)})}function N(k){return k===!1?{block:"end",inline:"nearest"}:ee(k)?k:{block:"start",inline:"nearest"}}function A(k,R){var q=!k.ownerDocument.documentElement.contains(k);if(ee(R)&&typeof R.behavior=="function")return R.behavior(q?[]:ue(k,R));if(q)return;var $=N(R);return O(ue(k,$),$.behavior)}var U=qe.a=A},aRTE:function(it,qe){it.exports={L:1,M:0,Q:3,H:2}},bT9E:function(it,qe,y){"use strict";y.d(qe,"a",function(){return me});var B=y("VTBJ");function me(Z,fe){var ue=Object(B.a)({},Z);return Array.isArray(fe)&&fe.forEach(function(ee){delete ue[ee]}),ue}},c5Ni:function(it,qe,y){},dQei:function(it,qe){for(var y={glog:function(me){if(me<1)throw new Error("glog("+me+")");return y.LOG_TABLE[me]},gexp:function(me){for(;me<0;)me+=255;for(;me>=256;)me-=255;return y.EXP_TABLE[me]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},B=0;B<8;B++)y.EXP_TABLE[B]=1<<B;for(var B=8;B<256;B++)y.EXP_TABLE[B]=y.EXP_TABLE[B-4]^y.EXP_TABLE[B-5]^y.EXP_TABLE[B-6]^y.EXP_TABLE[B-8];for(var B=0;B<255;B++)y.LOG_TABLE[y.EXP_TABLE[B]]=B;it.exports=y},dWSS:function(it,qe,y){var B=y("dQei");function me(Z,fe){if(Z.length==null)throw new Error(Z.length+"/"+fe);for(var ue=0;ue<Z.length&&Z[ue]==0;)ue++;this.num=new Array(Z.length-ue+fe);for(var ee=0;ee<Z.length-ue;ee++)this.num[ee]=Z[ee+ue]}me.prototype={get:function(Z){return this.num[Z]},getLength:function(){return this.num.length},multiply:function(Z){for(var fe=new Array(this.getLength()+Z.getLength()-1),ue=0;ue<this.getLength();ue++)for(var ee=0;ee<Z.getLength();ee++)fe[ue+ee]^=B.gexp(B.glog(this.get(ue))+B.glog(Z.get(ee)));return new me(fe,0)},mod:function(Z){if(this.getLength()-Z.getLength()<0)return this;for(var fe=B.glog(this.get(0))-B.glog(Z.get(0)),ue=new Array(this.getLength()),ee=0;ee<this.getLength();ee++)ue[ee]=this.get(ee);for(var ee=0;ee<Z.getLength();ee++)ue[ee]^=B.gexp(B.glog(Z.get(ee))+fe);return new me(ue,0).mod(Z)}},it.exports=me},dejd:function(it,qe,y){},dmUQ:function(it,qe,y){"use strict";var B=y("Ff2n"),me=y("rePB"),Z=y("1OyB"),fe=y("vuIU"),ue=y("Ji7U"),ee=y("md7G"),O=y("foSv"),N=y("q1tI"),A=y.n(N),U=y("TSYQ"),k=y.n(U),R=y("4IlW");function q(T,x){var K=Object.keys(T);if(Object.getOwnPropertySymbols){var G=Object.getOwnPropertySymbols(T);x&&(G=G.filter(function(C){return Object.getOwnPropertyDescriptor(T,C).enumerable})),K.push.apply(K,G)}return K}function $(T){for(var x=1;x<arguments.length;x++){var K=arguments[x]!=null?arguments[x]:{};x%2?q(Object(K),!0).forEach(function(G){Object(me.a)(T,G,K[G])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(K)):q(Object(K)).forEach(function(G){Object.defineProperty(T,G,Object.getOwnPropertyDescriptor(K,G))})}return T}function F(T){var x=H();return function(){var G=Object(O.a)(T),C;if(x){var E=Object(O.a)(this).constructor;C=Reflect.construct(G,arguments,E)}else C=G.apply(this,arguments);return Object(ee.a)(this,C)}}function H(){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(T){return!1}}function X(){}function oe(T){T.preventDefault()}var se=function(x){return x.replace(/[^\w.-]+/g,"")},Le=200,Me=600,le=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,ve=function(x){return x!=null},De=function(x,K){return K===x||typeof K=="number"&&typeof x=="number"&&isNaN(K)&&isNaN(x)},Y=function(T){Object(ue.a)(K,T);var x=F(K);function K(G){var C;Object(Z.a)(this,K),C=x.call(this,G),C.onKeyDown=function(L){var de=C.props,w=de.onKeyDown,g=de.onPressEnter;if(L.keyCode===R.a.UP){var te=C.getRatio(L);C.up(L,te,null),C.stop()}else if(L.keyCode===R.a.DOWN){var Oe=C.getRatio(L);C.down(L,Oe,null),C.stop()}else L.keyCode===R.a.ENTER&&g&&g(L);if(C.recordCursorPosition(),C.lastKeyCode=L.keyCode,w){for(var _e=arguments.length,$e=new Array(_e>1?_e-1:0),Qe=1;Qe<_e;Qe++)$e[Qe-1]=arguments[Qe];w.apply(void 0,[L].concat($e))}},C.onKeyUp=function(L){var de=C.props.onKeyUp;if(C.stop(),C.recordCursorPosition(),de){for(var w=arguments.length,g=new Array(w>1?w-1:0),te=1;te<w;te++)g[te-1]=arguments[te];de.apply(void 0,[L].concat(g))}},C.onChange=function(L){var de=C.props.onChange;C.state.focused&&(C.inputting=!0),C.rawInput=C.props.parser(C.getValueFromEvent(L)),C.setState({inputValue:C.rawInput}),de(C.toNumber(C.rawInput))},C.onMouseUp=function(){var L=C.props.onMouseUp;C.recordCursorPosition(),L&&L.apply(void 0,arguments)},C.onFocus=function(){var L;C.setState({focused:!0}),(L=C.props).onFocus.apply(L,arguments)},C.onBlur=function(){var L=C.props.onBlur;C.inputting=!1,C.setState({focused:!1});var de=C.getCurrentValidValue(C.state.inputValue),w=C.setValue(de,X);if(L){var g=C.input.value,te=C.getInputDisplayValue({focus:!1,value:w});C.input.value=te&&Number(te),L.apply(void 0,arguments),C.input.value=g}},C.getRatio=function(L){var de=1;return L.metaKey||L.ctrlKey?de=.1:L.shiftKey&&(de=10),de},C.getFullNum=function(L){return isNaN(L)?L:/e/i.test(String(L))?Number(L).toFixed(18).replace(/\.?0+$/,""):L},C.getPrecision=function(L){if(ve(C.props.precision))return C.props.precision;var de=String(L);if(de.indexOf("e-")>=0)return parseInt(de.slice(de.indexOf("e-")+2),10);var w=0;return de.indexOf(".")>=0&&(w=de.length-de.indexOf(".")-1),w},C.getInputDisplayValue=function(L){var de=L||C.state,w=de.focused,g=de.inputValue,te=de.value,Oe;w?Oe=g:Oe=C.toPrecisionAsStep(te),Oe==null&&(Oe="");var _e=C.formatWrapper(Oe);return ve(C.props.decimalSeparator)&&(_e=_e.toString().replace(".",C.props.decimalSeparator)),_e},C.recordCursorPosition=function(){try{C.cursorStart=C.input.selectionStart,C.cursorEnd=C.input.selectionEnd,C.currentValue=C.input.value,C.cursorBefore=C.input.value.substring(0,C.cursorStart),C.cursorAfter=C.input.value.substring(C.cursorEnd)}catch(L){}},C.restoreByAfter=function(L){if(L===void 0)return!1;var de=C.input.value,w=de.lastIndexOf(L);if(w===-1)return!1;var g=C.cursorBefore.length;return C.lastKeyCode===R.a.DELETE&&C.cursorBefore.charAt(g-1)===L[0]?(C.fixCaret(g,g),!0):w+L.length===de.length?(C.fixCaret(w,w),!0):!1},C.partRestoreByAfter=function(L){return L===void 0?!1:Array.prototype.some.call(L,function(de,w){var g=L.substring(w);return C.restoreByAfter(g)})},C.isNotCompleteNumber=function(L){return isNaN(L)||L===""||L===null||L&&L.toString().indexOf(".")===L.toString().length-1},C.stop=function(){C.autoStepTimer&&clearTimeout(C.autoStepTimer)},C.down=function(L,de,w){C.pressingUpOrDown=!0,C.step("down",L,de,w)},C.up=function(L,de,w){C.pressingUpOrDown=!0,C.step("up",L,de,w)},C.saveInput=function(L){C.input=L};var E=G.value;E===void 0&&(E=G.defaultValue),C.state={focused:G.autoFocus};var J=C.getValidValue(C.toNumber(E));return C.state=$($({},C.state),{},{inputValue:C.toPrecisionAsStep(J),value:J}),C}return Object(fe.a)(K,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(C){var E=this.props,J=E.value,L=E.onChange,de=E.max,w=E.min,g=this.state.focused;if(C){if(!De(C.value,J)||!De(C.max,de)||!De(C.min,w)){var te=g?J:this.getValidValue(J),Oe;this.pressingUpOrDown?Oe=te:this.inputting?Oe=this.rawInput:Oe=this.toPrecisionAsStep(te),this.setState({value:te,inputValue:Oe})}var _e="value"in this.props?J:this.state.value;"max"in this.props&&C.max!==de&&typeof _e=="number"&&_e>de&&L&&L(de),"min"in this.props&&C.min!==w&&typeof _e=="number"&&_e<w&&L&&L(w)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var $e=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===R.a.BACKSPACE?$e=this.cursorStart-1:this.lastKeyCode===R.a.DELETE&&($e=this.cursorStart):$e=this.input.value.length,this.fixCaret($e,$e)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case R.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case R.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Qe){}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(C){var E=C;return E===""?E="":this.isNotCompleteNumber(parseFloat(E))?E=this.state.value:E=this.getValidValue(E),this.toNumber(E)}},{key:"getValueFromEvent",value:function(C){var E=C.target.value.trim().replace(/。/g,".");return ve(this.props.decimalSeparator)&&(E=E.replace(this.props.decimalSeparator,".")),E}},{key:"getValidValue",value:function(C){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,L=parseFloat(C);return isNaN(L)?C:(L<E&&(L=E),L>J&&(L=J),L)}},{key:"setValue",value:function(C,E){var J=this.props.precision,L=this.isNotCompleteNumber(parseFloat(C))?null:parseFloat(C),de=this.state.value,w=de===void 0?null:de,g=this.state.inputValue,te=g===void 0?null:g,Oe=typeof L=="number"?L.toFixed(J):"".concat(L),_e=L!==w||Oe!=="".concat(te);return"value"in this.props?(te=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:te},E)):this.setState({value:L,inputValue:this.toPrecisionAsStep(C)},E),_e&&this.props.onChange(L),L}},{key:"getMaxPrecision",value:function(C){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,J=this.props,L=J.precision,de=J.step;if(ve(L))return L;var w=this.getPrecision(E),g=this.getPrecision(de),te=this.getPrecision(C);return C?Math.max(te,w+g):w+g}},{key:"getPrecisionFactor",value:function(C){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,J=this.getMaxPrecision(C,E);return Math.pow(10,J)}},{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(C){return this.props.formatter?this.props.formatter(C):C}},{key:"toPrecisionAsStep",value:function(C){if(this.isNotCompleteNumber(C)||C==="")return C;var E=Math.abs(this.getMaxPrecision(C));return isNaN(E)?C.toString():Number(C).toFixed(E)}},{key:"toNumber",value:function(C){var E=this.props.precision,J=this.state.focused,L=C&&C.length>16&&J;return this.isNotCompleteNumber(C)||L?C:ve(E)?Math.round(C*Math.pow(10,E))/Math.pow(10,E):Number(C)}},{key:"upStep",value:function(C,E){var J=this.props.step,L=this.getPrecisionFactor(C,E),de=Math.abs(this.getMaxPrecision(C,E)),w=((L*C+L*J*E)/L).toFixed(de);return this.toNumber(w)}},{key:"downStep",value:function(C,E){var J=this.props.step,L=this.getPrecisionFactor(C,E),de=Math.abs(this.getMaxPrecision(C,E)),w=((L*C-L*J*E)/L).toFixed(de);return this.toNumber(w)}},{key:"step",value:function(C,E){var J=this,L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,de=arguments.length>3?arguments[3]:void 0;this.stop(),E&&(E.persist(),E.preventDefault());var w=this.props;if(w.disabled)return;var g=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(g))return;var te=this["".concat(C,"Step")](g,L),Oe=te>w.max||te<w.min;if(te>w.max?te=w.max:te<w.min&&(te=w.min),this.setValue(te,null),this.setState({focused:!0},function(){J.pressingUpOrDown=!1}),Oe)return;this.autoStepTimer=setTimeout(function(){J[C](E,L,!0)},de?Le:Me)}},{key:"fixCaret",value:function(C,E){if(C===void 0||E===void 0||!this.input||!this.input.value)return;try{var J=this.input.selectionStart,L=this.input.selectionEnd;(C!==J||E!==L)&&this.input.setSelectionRange(C,E)}catch(de){}}},{key:"render",value:function(){var C,E=this.props,J=E.prefixCls,L=E.disabled,de=E.readOnly,w=E.useTouch,g=E.autoComplete,te=E.upHandler,Oe=E.downHandler,_e=E.className,$e=E.max,Qe=E.min,Te=E.style,Ee=E.title,ye=E.onMouseEnter,we=E.onMouseLeave,ne=E.onMouseOver,z=E.onMouseOut,Ne=E.required,be=E.onClick,St=E.tabIndex,Ze=E.type,Ke=E.placeholder,Re=E.id,Fe=E.inputMode,Ge=E.pattern,Ye=E.step,Ve=E.maxLength,Be=E.autoFocus,ze=E.name,Lt=E.onPaste,ft=E.onInput,st=Object(B.a)(E,["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"]),ut=this.state,xt=ut.value,bt=ut.focused,pt=k()(J,(C={},Object(me.a)(C,_e,!!_e),Object(me.a)(C,"".concat(J,"-disabled"),L),Object(me.a)(C,"".concat(J,"-focused"),bt),C)),Se={};Object.keys(st).forEach(function(P){(P.substr(0,5)==="data-"||P.substr(0,5)==="aria-"||P==="role")&&(Se[P]=st[P])});var Rt=!de&&!L,ht=this.getInputDisplayValue(null),ke=(xt||xt===0)&&(isNaN(xt)||Number(xt)>=$e),Ae=(xt||xt===0)&&(isNaN(xt)||Number(xt)<=Qe),M=ke||L||de,j=Ae||L||de,I=k()("".concat(J,"-handler"),"".concat(J,"-handler-up"),Object(me.a)({},"".concat(J,"-handler-up-disabled"),M)),b=k()("".concat(J,"-handler"),"".concat(J,"-handler-down"),Object(me.a)({},"".concat(J,"-handler-down-disabled"),j)),_=w?{onTouchStart:M?X:this.up,onTouchEnd:this.stop}:{onMouseDown:M?X:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},S=w?{onTouchStart:j?X:this.down,onTouchEnd:this.stop}:{onMouseDown:j?X:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return A.a.createElement("div",{className:pt,style:Te,title:Ee,onMouseEnter:ye,onMouseLeave:we,onMouseOver:ne,onMouseOut:z,onFocus:function(){return null},onBlur:function(){return null}},A.a.createElement("div",{className:"".concat(J,"-handler-wrap")},A.a.createElement("span",Object.assign({unselectable:"on"},_,{role:"button","aria-label":"Increase Value","aria-disabled":M,className:I}),te||A.a.createElement("span",{unselectable:"on",className:"".concat(J,"-handler-up-inner"),onClick:oe})),A.a.createElement("span",Object.assign({unselectable:"on"},S,{role:"button","aria-label":"Decrease Value","aria-disabled":j,className:b}),Oe||A.a.createElement("span",{unselectable:"on",className:"".concat(J,"-handler-down-inner"),onClick:oe}))),A.a.createElement("div",{className:"".concat(J,"-input-wrap")},A.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Qe,"aria-valuemax":$e,"aria-valuenow":xt,required:Ne,type:Ze,placeholder:Ke,onPaste:Lt,onClick:be,onMouseUp:this.onMouseUp,className:"".concat(J,"-input"),tabIndex:St,autoComplete:g,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Rt?this.onKeyDown:X,onKeyUp:Rt?this.onKeyUp:X,autoFocus:Be,maxLength:Ve,readOnly:de,disabled:L,max:$e,min:Qe,step:Ye,name:ze,title:Ee,id:Re,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ht),pattern:Ge,inputMode:Fe,onInput:ft},Se))))}}]),K}(A.a.Component);Y.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:le,min:-le,step:1,style:{},onChange:X,onKeyDown:X,onPressEnter:X,onFocus:X,onBlur:X,parser:se,required:!1,autoComplete:"off"};var m=Y,ge=qe.a=m},f4xo:function(it,qe,y){var B=y("nVVt");function me(Z){this.mode=B.MODE_8BIT_BYTE,this.data=Z}me.prototype={getLength:function(Z){return this.data.length},write:function(Z){for(var fe=0;fe<this.data.length;fe++)Z.put(this.data.charCodeAt(fe),8)}},it.exports=me},kSUc:function(it,qe,y){},kqOp:function(it,qe,y){"use strict";y.d(qe,"a",function(){return U});var B=y("0Owb"),me=y("fWQN"),Z=y("mtLc"),fe=y("yKVA"),ue=y("879j"),ee=y("q1tI"),O=y.n(ee),N=y("Ot1p"),A="\u2581",U=function(k){Object(fe.a)(q,k);var R=Object(ue.a)(q);function q(){var $;Object(me.a)(this,q);for(var F=arguments.length,H=new Array(F),X=0;X<F;X++)H[X]=arguments[X];return $=R.call.apply(R,[this].concat(H)),$.getChCountBeforeCursor=function(oe,se){for(var Le=se.line,Me=0,le=0;le<Le;le++)Me+=oe.getLine(le).split(A).length-1;var ve=oe.getLine(Le).substring(0,se.ch);return Me+=ve.split(A).length-1,Me},$.onCMBeforeChange=function(oe,se){var Le=oe.getRange(se.from,se.to),Me=0;if(se.text.forEach(function(Y){Me+=Y.split(A).length-1}),Le&&Le.indexOf(A)!=-1){var le=Le.split(A).length-1,ve=$.getChCountBeforeCursor(oe,se.from);console.log("\u5220\u9664".concat(le,"\u4E2A\uFF0C \u4E4B\u524D\u6709").concat(ve,"\u4E2A\uFF0C\u65B0\u589E").concat(Me,"\u4E2A")),$.props.deleteEmptyDisabled?se.cancel():$.props.onPlaceholderChange&&$.props.onPlaceholderChange(ve,le,Me)}else if(Me){var De=$.getChCountBeforeCursor(oe,se.from);console.log("\u65B0\u589E".concat(Me,"\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(De,"\u4E2A")),$.props.onPlaceholderChange&&$.props.onPlaceholderChange(De,0,Me)}},$}return Object(Z.a)(q,[{key:"render",value:function(){return O.a.createElement(N.a,Object(B.a)({},this.props,{onCMBeforeChange:this.onCMBeforeChange}))}}]),q}(ee.Component)},lZu9:function(it,qe,y){(function(B){B(y("VrN/"),y("1eCo"),y("8EBN"))})(function(B){"use strict";B.defineMode("markdown",function(me,Z){var fe=B.getMode(me,"text/html"),ue=fe.name=="null";function ee(w){if(B.findModeByName){var g=B.findModeByName(w);g&&(w=g.mime||g.mimes[0])}var te=B.getMode(me,w);return te.name=="null"?null:te}Z.highlightFormatting===void 0&&(Z.highlightFormatting=!1),Z.maxBlockquoteDepth===void 0&&(Z.maxBlockquoteDepth=0),Z.taskLists===void 0&&(Z.taskLists=!1),Z.strikethrough===void 0&&(Z.strikethrough=!1),Z.emoji===void 0&&(Z.emoji=!1),Z.fencedCodeBlockHighlighting===void 0&&(Z.fencedCodeBlockHighlighting=!0),Z.fencedCodeBlockDefaultMode===void 0&&(Z.fencedCodeBlockDefaultMode="text/plain"),Z.xml===void 0&&(Z.xml=!0),Z.tokenTypeOverrides===void 0&&(Z.tokenTypeOverrides={});var O={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 N in O)O.hasOwnProperty(N)&&Z.tokenTypeOverrides[N]&&(O[N]=Z.tokenTypeOverrides[N]);var A=/^([*\-_])(?:\s*\1){2,}\s*$/,U=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,k=/^\[(x| )\](?=\s)/i,R=Z.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,q=/^ {0,3}(?:\={1,}|-{2,})\s*$/,$=/^[^#!\[\]*_\\<>` "'(~:]+/,F=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,H=/^\s*\[[^\]]+?\]:.*$/,X=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,oe=" ";function se(w,g,te){return g.f=g.inline=te,te(w,g)}function Le(w,g,te){return g.f=g.block=te,te(w,g)}function Me(w){return!w||!/\S/.test(w.string)}function le(w){if(w.linkTitle=!1,w.linkHref=!1,w.linkText=!1,w.em=!1,w.strong=!1,w.strikethrough=!1,w.quote=0,w.indentedCode=!1,w.f==De){var g=ue;if(!g){var te=B.innerMode(fe,w.htmlState);g=te.mode.name=="xml"&&te.state.tagStart===null&&!te.state.context&&te.state.tokenize.isInText}g&&(w.f=T,w.block=ve,w.htmlState=null)}return w.trailingSpace=0,w.trailingSpaceNewLine=!1,w.prevLine=w.thisLine,w.thisLine={stream:null},null}function ve(w,g){var te=w.column()===g.indentation,Oe=Me(g.prevLine.stream),_e=g.indentedCode,$e=g.prevLine.hr,Qe=g.list!==!1,Te=(g.listStack[g.listStack.length-1]||0)+3;g.indentedCode=!1;var Ee=g.indentation;if(g.indentationDiff===null&&(g.indentationDiff=g.indentation,Qe)){for(g.list=null;Ee<g.listStack[g.listStack.length-1];)g.listStack.pop(),g.listStack.length?g.indentation=g.listStack[g.listStack.length-1]:g.list=!1;g.list!==!1&&(g.indentationDiff=Ee-g.listStack[g.listStack.length-1])}var ye=!Oe&&!$e&&!g.prevLine.header&&(!Qe||!_e)&&!g.prevLine.fencedCodeEnd,we=(g.list===!1||$e||Oe)&&g.indentation<=Te&&w.match(A),ne=null;if(g.indentationDiff>=4&&(_e||g.prevLine.fencedCodeEnd||g.prevLine.header||Oe))return w.skipToEnd(),g.indentedCode=!0,O.code;if(w.eatSpace())return null;if(te&&g.indentation<=Te&&(ne=w.match(R))&&ne[1].length<=6)return g.quote=0,g.header=ne[1].length,g.thisLine.header=!0,Z.highlightFormatting&&(g.formatting="header"),g.f=g.inline,m(g);if(g.indentation<=Te&&w.eat(">"))return g.quote=te?1:g.quote+1,Z.highlightFormatting&&(g.formatting="quote"),w.eatSpace(),m(g);if(!we&&!g.setext&&te&&g.indentation<=Te&&(ne=w.match(U))){var z=ne[1]?"ol":"ul";return g.indentation=Ee+w.current().length,g.list=!0,g.quote=0,g.listStack.push(g.indentation),g.em=!1,g.strong=!1,g.code=!1,g.strikethrough=!1,Z.taskLists&&w.match(k,!1)&&(g.taskList=!0),g.f=g.inline,Z.highlightFormatting&&(g.formatting=["list","list-"+z]),m(g)}else{if(te&&g.indentation<=Te&&(ne=w.match(F,!0)))return g.quote=0,g.fencedEndRE=new RegExp(ne[1]+"+ *$"),g.localMode=Z.fencedCodeBlockHighlighting&&ee(ne[2]||Z.fencedCodeBlockDefaultMode),g.localMode&&(g.localState=B.startState(g.localMode)),g.f=g.block=Y,Z.highlightFormatting&&(g.formatting="code-block"),g.code=-1,m(g);if(g.setext||(!ye||!Qe)&&!g.quote&&g.list===!1&&!g.code&&!we&&!H.test(w.string)&&(ne=w.lookAhead(1))&&(ne=ne.match(q)))return g.setext?(g.header=g.setext,g.setext=0,w.skipToEnd(),Z.highlightFormatting&&(g.formatting="header")):(g.header=ne[0].charAt(0)=="="?1:2,g.setext=g.header),g.thisLine.header=!0,g.f=g.inline,m(g);if(we)return w.skipToEnd(),g.hr=!0,g.thisLine.hr=!0,O.hr;if(w.peek()==="[")return se(w,g,E)}return se(w,g,g.inline)}function De(w,g){var te=fe.token(w,g.htmlState);if(!ue){var Oe=B.innerMode(fe,g.htmlState);(Oe.mode.name=="xml"&&Oe.state.tagStart===null&&!Oe.state.context&&Oe.state.tokenize.isInText||g.md_inside&&w.current().indexOf(">")>-1)&&(g.f=T,g.block=ve,g.htmlState=null)}return te}function Y(w,g){var te=g.listStack[g.listStack.length-1]||0,Oe=g.indentation<te,_e=te+3;if(g.fencedEndRE&&g.indentation<=_e&&(Oe||w.match(g.fencedEndRE))){Z.highlightFormatting&&(g.formatting="code-block");var $e;return Oe||($e=m(g)),g.localMode=g.localState=null,g.block=ve,g.f=T,g.fencedEndRE=null,g.code=0,g.thisLine.fencedCodeEnd=!0,Oe?Le(w,g,g.block):$e}else return g.localMode?g.localMode.token(w,g.localState):(w.skipToEnd(),O.code)}function m(w){var g=[];if(w.formatting){g.push(O.formatting),typeof w.formatting=="string"&&(w.formatting=[w.formatting]);for(var te=0;te<w.formatting.length;te++)g.push(O.formatting+"-"+w.formatting[te]),w.formatting[te]==="header"&&g.push(O.formatting+"-"+w.formatting[te]+"-"+w.header),w.formatting[te]==="quote"&&(!Z.maxBlockquoteDepth||Z.maxBlockquoteDepth>=w.quote?g.push(O.formatting+"-"+w.formatting[te]+"-"+w.quote):g.push("error"))}if(w.taskOpen)return g.push("meta"),g.length?g.join(" "):null;if(w.taskClosed)return g.push("property"),g.length?g.join(" "):null;if(w.linkHref?g.push(O.linkHref,"url"):(w.strong&&g.push(O.strong),w.em&&g.push(O.em),w.strikethrough&&g.push(O.strikethrough),w.emoji&&g.push(O.emoji),w.linkText&&g.push(O.linkText),w.code&&g.push(O.code),w.image&&g.push(O.image),w.imageAltText&&g.push(O.imageAltText,"link"),w.imageMarker&&g.push(O.imageMarker)),w.header&&g.push(O.header,O.header+"-"+w.header),w.quote&&(g.push(O.quote),!Z.maxBlockquoteDepth||Z.maxBlockquoteDepth>=w.quote?g.push(O.quote+"-"+w.quote):g.push(O.quote+"-"+Z.maxBlockquoteDepth)),w.list!==!1){var Oe=(w.listStack.length-1)%3;Oe?Oe===1?g.push(O.list2):g.push(O.list3):g.push(O.list1)}return w.trailingSpaceNewLine?g.push("trailing-space-new-line"):w.trailingSpace&&g.push("trailing-space-"+(w.trailingSpace%2?"a":"b")),g.length?g.join(" "):null}function ge(w,g){return w.match($,!0)?m(g):void 0}function T(w,g){var te=g.text(w,g);if(typeof te!="undefined")return te;if(g.list)return g.list=null,m(g);if(g.taskList){var Oe=w.match(k,!0)[1]===" ";return Oe?g.taskOpen=!0:g.taskClosed=!0,Z.highlightFormatting&&(g.formatting="task"),g.taskList=!1,m(g)}if(g.taskOpen=!1,g.taskClosed=!1,g.header&&w.match(/^#+$/,!0))return Z.highlightFormatting&&(g.formatting="header"),m(g);var _e=w.next();if(g.linkTitle){g.linkTitle=!1;var $e=_e;_e==="("&&($e=")"),$e=($e+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Qe="^\\s*(?:[^"+$e+"\\\\]+|\\\\\\\\|\\\\.)"+$e;if(w.match(new RegExp(Qe),!0))return O.linkHref}if(_e==="`"){var Te=g.formatting;Z.highlightFormatting&&(g.formatting="code"),w.eatWhile("`");var Ee=w.current().length;if(g.code==0&&(!g.quote||Ee==1))return g.code=Ee,m(g);if(Ee==g.code){var ye=m(g);return g.code=0,ye}else return g.formatting=Te,m(g)}else if(g.code)return m(g);if(_e==="\\"&&(w.next(),Z.highlightFormatting)){var we=m(g),ne=O.formatting+"-escape";return we?we+" "+ne:ne}if(_e==="!"&&w.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return g.imageMarker=!0,g.image=!0,Z.highlightFormatting&&(g.formatting="image"),m(g);if(_e==="["&&g.imageMarker&&w.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return g.imageMarker=!1,g.imageAltText=!0,Z.highlightFormatting&&(g.formatting="image"),m(g);if(_e==="]"&&g.imageAltText){Z.highlightFormatting&&(g.formatting="image");var we=m(g);return g.imageAltText=!1,g.image=!1,g.inline=g.f=K,we}if(_e==="["&&!g.image)return g.linkText&&w.match(/^.*?\]/)||(g.linkText=!0,Z.highlightFormatting&&(g.formatting="link")),m(g);if(_e==="]"&&g.linkText){Z.highlightFormatting&&(g.formatting="link");var we=m(g);return g.linkText=!1,g.inline=g.f=w.match(/\(.*?\)| ?\[.*?\]/,!1)?K:T,we}if(_e==="<"&&w.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=x,Z.highlightFormatting&&(g.formatting="link");var we=m(g);return we?we+=" ":we="",we+O.linkInline}if(_e==="<"&&w.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=x,Z.highlightFormatting&&(g.formatting="link");var we=m(g);return we?we+=" ":we="",we+O.linkEmail}if(Z.xml&&_e==="<"&&w.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var z=w.string.indexOf(">",w.pos);if(z!=-1){var Ne=w.string.substring(w.start,z);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ne)&&(g.md_inside=!0)}return w.backUp(1),g.htmlState=B.startState(fe),Le(w,g,De)}if(Z.xml&&_e==="<"&&w.match(/^\/\w*?>/))return g.md_inside=!1,"tag";if(_e==="*"||_e==="_"){for(var be=1,St=w.pos==1?" ":w.string.charAt(w.pos-2);be<3&&w.eat(_e);)be++;var Ze=w.peek()||" ",Ke=!/\s/.test(Ze)&&(!X.test(Ze)||/\s/.test(St)||X.test(St)),Re=!/\s/.test(St)&&(!X.test(St)||/\s/.test(Ze)||X.test(Ze)),Fe=null,Ge=null;if(be%2&&(!g.em&&Ke&&(_e==="*"||!Re||X.test(St))?Fe=!0:g.em==_e&&Re&&(_e==="*"||!Ke||X.test(Ze))&&(Fe=!1)),be>1&&(!g.strong&&Ke&&(_e==="*"||!Re||X.test(St))?Ge=!0:g.strong==_e&&Re&&(_e==="*"||!Ke||X.test(Ze))&&(Ge=!1)),Ge!=null||Fe!=null){Z.highlightFormatting&&(g.formatting=Fe==null?"strong":Ge==null?"em":"strong em"),Fe===!0&&(g.em=_e),Ge===!0&&(g.strong=_e);var ye=m(g);return Fe===!1&&(g.em=!1),Ge===!1&&(g.strong=!1),ye}}else if(_e===" "&&(w.eat("*")||w.eat("_"))){if(w.peek()===" ")return m(g);w.backUp(1)}if(Z.strikethrough){if(_e==="~"&&w.eatWhile(_e)){if(g.strikethrough){Z.highlightFormatting&&(g.formatting="strikethrough");var ye=m(g);return g.strikethrough=!1,ye}else if(w.match(/^[^\s]/,!1))return g.strikethrough=!0,Z.highlightFormatting&&(g.formatting="strikethrough"),m(g)}else if(_e===" "&&w.match(/^~~/,!0)){if(w.peek()===" ")return m(g);w.backUp(2)}}if(Z.emoji&&_e===":"&&w.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){g.emoji=!0,Z.highlightFormatting&&(g.formatting="emoji");var Ye=m(g);return g.emoji=!1,Ye}return _e===" "&&(w.match(/^ +$/,!1)?g.trailingSpace++:g.trailingSpace&&(g.trailingSpaceNewLine=!0)),m(g)}function x(w,g){var te=w.next();if(te===">"){g.f=g.inline=T,Z.highlightFormatting&&(g.formatting="link");var Oe=m(g);return Oe?Oe+=" ":Oe="",Oe+O.linkInline}return w.match(/^[^>]+/,!0),O.linkInline}function K(w,g){if(w.eatSpace())return null;var te=w.next();return te==="("||te==="["?(g.f=g.inline=C(te==="("?")":"]"),Z.highlightFormatting&&(g.formatting="link-string"),g.linkHref=!0,m(g)):"error"}var G={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function C(w){return function(g,te){var Oe=g.next();if(Oe===w){te.f=te.inline=T,Z.highlightFormatting&&(te.formatting="link-string");var _e=m(te);return te.linkHref=!1,_e}return g.match(G[w]),te.linkHref=!0,m(te)}}function E(w,g){return w.match(/^([^\]\\]|\\.)*\]:/,!1)?(g.f=J,w.next(),Z.highlightFormatting&&(g.formatting="link"),g.linkText=!0,m(g)):se(w,g,T)}function J(w,g){if(w.match(/^\]:/,!0)){g.f=g.inline=L,Z.highlightFormatting&&(g.formatting="link");var te=m(g);return g.linkText=!1,te}return w.match(/^([^\]\\]|\\.)+/,!0),O.linkText}function L(w,g){return w.eatSpace()?null:(w.match(/^[^\s]+/,!0),w.peek()===void 0?g.linkTitle=!0:w.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),g.f=g.inline=T,O.linkHref+" url")}var de={startState:function(){return{f:ve,prevLine:{stream:null},thisLine:{stream:null},block:ve,htmlState:null,indentation:0,inline:T,text:ge,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(w){return{f:w.f,prevLine:w.prevLine,thisLine:w.thisLine,block:w.block,htmlState:w.htmlState&&B.copyState(fe,w.htmlState),indentation:w.indentation,localMode:w.localMode,localState:w.localMode?B.copyState(w.localMode,w.localState):null,inline:w.inline,text:w.text,formatting:!1,linkText:w.linkText,linkTitle:w.linkTitle,linkHref:w.linkHref,code:w.code,em:w.em,strong:w.strong,strikethrough:w.strikethrough,emoji:w.emoji,header:w.header,setext:w.setext,hr:w.hr,taskList:w.taskList,list:w.list,listStack:w.listStack.slice(0),quote:w.quote,indentedCode:w.indentedCode,trailingSpace:w.trailingSpace,trailingSpaceNewLine:w.trailingSpaceNewLine,md_inside:w.md_inside,fencedEndRE:w.fencedEndRE}},token:function(w,g){if(g.formatting=!1,w!=g.thisLine.stream){if(g.header=0,g.hr=!1,w.match(/^\s*$/,!0))return le(g),null;if(g.prevLine=g.thisLine,g.thisLine={stream:w},g.taskList=!1,g.trailingSpace=0,g.trailingSpaceNewLine=!1,!g.localState&&(g.f=g.block,g.f!=De)){var te=w.match(/^\s*/,!0)[0].replace(/\t/g,oe).length;if(g.indentation=te,g.indentationDiff=null,te>0)return null}}return g.f(w,g)},innerMode:function(w){return w.block==De?{state:w.htmlState,mode:fe}:w.localState?{state:w.localState,mode:w.localMode}:{state:w,mode:de}},indent:function(w,g,te){return w.block==De&&fe.indent?fe.indent(w.htmlState,g,te):w.localState&&w.localMode.indent?w.localMode.indent(w.localState,g,te):B.Pass},blankLine:le,getType:m,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return de},"xml"),B.defineMIME("text/markdown","markdown"),B.defineMIME("text/x-markdown","markdown")})},nVVt:function(it,qe){it.exports={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3}},osHv:function(it,qe,y){(function(B){B(y("VrN/"))})(function(B){"use strict";var me=B.Pos;function Z(X,oe){return X.line-oe.line||X.ch-oe.ch}var fe="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",ue=fe+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",ee=new RegExp("<(/?)(["+fe+"]["+ue+"]*)","g");function O(X,oe,se,Le){this.line=oe,this.ch=se,this.cm=X,this.text=X.getLine(oe),this.min=Le?Math.max(Le.from,X.firstLine()):X.firstLine(),this.max=Le?Math.min(Le.to-1,X.lastLine()):X.lastLine()}function N(X,oe){var se=X.cm.getTokenTypeAt(me(X.line,oe));return se&&/\btag\b/.test(se)}function A(X){return X.line>=X.max?void 0:(X.ch=0,X.text=X.cm.getLine(++X.line),!0)}function U(X){return X.line<=X.min?void 0:(X.text=X.cm.getLine(--X.line),X.ch=X.text.length,!0)}function k(X){for(;;){var oe=X.text.indexOf(">",X.ch);if(oe==-1){if(A(X))continue;return}if(!N(X,oe+1)){X.ch=oe+1;continue}var se=X.text.lastIndexOf("/",oe),Le=se>-1&&!/\S/.test(X.text.slice(se+1,oe));return X.ch=oe+1,Le?"selfClose":"regular"}}function R(X){for(;;){var oe=X.ch?X.text.lastIndexOf("<",X.ch-1):-1;if(oe==-1){if(U(X))continue;return}if(!N(X,oe+1)){X.ch=oe;continue}ee.lastIndex=oe,X.ch=oe;var se=ee.exec(X.text);if(se&&se.index==oe)return se}}function q(X){for(;;){ee.lastIndex=X.ch;var oe=ee.exec(X.text);if(!oe){if(A(X))continue;return}if(!N(X,oe.index+1)){X.ch=oe.index+1;continue}return X.ch=oe.index+oe[0].length,oe}}function $(X){for(;;){var oe=X.ch?X.text.lastIndexOf(">",X.ch-1):-1;if(oe==-1){if(U(X))continue;return}if(!N(X,oe+1)){X.ch=oe;continue}var se=X.text.lastIndexOf("/",oe),Le=se>-1&&!/\S/.test(X.text.slice(se+1,oe));return X.ch=oe+1,Le?"selfClose":"regular"}}function F(X,oe){for(var se=[];;){var Le=q(X),Me,le=X.line,ve=X.ch-(Le?Le[0].length:0);if(!Le||!(Me=k(X)))return;if(Me=="selfClose")continue;if(Le[1]){for(var De=se.length-1;De>=0;--De)if(se[De]==Le[2]){se.length=De;break}if(De<0&&(!oe||oe==Le[2]))return{tag:Le[2],from:me(le,ve),to:me(X.line,X.ch)}}else se.push(Le[2])}}function H(X,oe){for(var se=[];;){var Le=$(X);if(!Le)return;if(Le=="selfClose"){R(X);continue}var Me=X.line,le=X.ch,ve=R(X);if(!ve)return;if(ve[1])se.push(ve[2]);else{for(var De=se.length-1;De>=0;--De)if(se[De]==ve[2]){se.length=De;break}if(De<0&&(!oe||oe==ve[2]))return{tag:ve[2],from:me(X.line,X.ch),to:me(Me,le)}}}}B.registerHelper("fold","xml",function(X,oe){for(var se=new O(X,oe.line,0);;){var Le=q(se);if(!Le||se.line!=oe.line)return;var Me=k(se);if(!Me)return;if(!Le[1]&&Me!="selfClose"){var le=me(se.line,se.ch),ve=F(se,Le[2]);return ve&&Z(ve.from,le)>0?{from:le,to:ve.from}:null}}}),B.findMatchingTag=function(X,oe,se){var Le=new O(X,oe.line,oe.ch,se);if(Le.text.indexOf(">")==-1&&Le.text.indexOf("<")==-1)return;var Me=k(Le),le=Me&&me(Le.line,Le.ch),ve=Me&&R(Le);if(!Me||!ve||Z(Le,oe)>0)return;var De={from:me(Le.line,Le.ch),to:le,tag:ve[2]};return Me=="selfClose"?{open:De,close:null,at:"open"}:ve[1]?{open:H(Le,ve[2]),close:De,at:"close"}:(Le=new O(X,le.line,le.ch,se),{open:De,close:F(Le,ve[2]),at:"open"})},B.findEnclosingTag=function(X,oe,se,Le){for(var Me=new O(X,oe.line,oe.ch,se);;){var le=H(Me,Le);if(!le)break;var ve=new O(X,oe.line,oe.ch,se),De=F(ve,le.tag);if(De)return{open:le,close:De}}},B.scanForClosingTag=function(X,oe,se,Le){var Me=new O(X,oe.line,oe.ch,Le?{from:0,to:Le}:null);return F(Me,se)}})},p5ED:function(it,qe,y){"use strict";var B=y("+L6B"),me=y("2/Rp"),Z=y("5Dmo"),fe=y("3S7+"),ue=y("k1fw"),ee=y("9og8"),O=y("tJVT"),N=y("WmNS"),A=y.n(N),U=y("q1tI"),k=y.n(U),R=y("vHTk"),q=y.n(R),$=y("yEEn"),F=y("ZW9T"),H=y("1vsH"),X=y("V0Rq"),oe=y("m3rI"),se=function(Me){var le=Me.name,ve=Me.data,De=Me.theme,Y=Me.type,m=Me.filename,ge=Me.monacoEditor,T=Me.className,x=Me.style,K=Me.close,G=Me.onClose,C=Me.hasMask,E=Me.otherData,J=E===void 0?{}:E,L=Object(U.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),de=Object(O.a)(L,2),w=de[0],g=de[1],te=Object(U.useState)(""),Oe=Object(O.a)(te,2),_e=Oe[0],$e=Oe[1],Qe=Object(U.useState)(),Te=Object(O.a)(Qe,2),Ee=Te[0],ye=Te[1],we,ne=1024*1024,z=10*ne,Ne=Object(U.useRef)();Y==="office"&&(Y="other",we=Object(H.R)(ve).filesize,we>z&&(Y="other")),m&&(ge.filename=m),Object(U.useEffect)(function(){var Ke,Re,Fe=(Ke=document.cookie)===null||Ke===void 0||((Re=Ke.replace(/\s/g,""))===null||Re===void 0)?void 0:Re.split(";");Fe==null||Fe.map(function(Ge){var Ye=Ge.split("=");Ye[0]==="_educoder_session"&&$e(Ye[1])})},[]),Object(U.useEffect)(function(){Y==="office"&&be()},[Y]);var be=function(){var Ke=Object(ee.a)(A.a.mark(function Re(){var Fe,Ge,Ye;return A.a.wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:return console.log("data:",ve),Fe=ve,ve.startsWith("http")||(Fe=location.origin+Fe),Ge=new URL(Fe).pathname.split("/").pop(),Be.next=6,Object(X.U)({attachment_id:Ge});case 6:Ye=Be.sent,ye(Ye);case 8:case"end":return Be.stop()}},Re)}));return function(){return Ke.apply(this,arguments)}}(),St=function(){if(ve.startsWith("http")||ve.startsWith("blob:")){Ze();return}Object(H.x)(m||"educoder",ve,m)},Ze=function(){Object(H.v)(m||"educoder",decodeURIComponent(ve))};return k.a.createElement("div",{style:Object(ue.a)({},x||{}),className:"".concat(C&&q.a.bgBlack," ").concat(Y?q.a.wrp:"hide")},K&&k.a.createElement("div",{className:q.a.close,ref:Ne},k.a.createElement(fe.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ne.current}},k.a.createElement("span",{onClick:Ze},k.a.createElement("i",{className:"icon-quxiaozhiding"}))),k.a.createElement(fe.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ne.current}},k.a.createElement("span",{className:"",onClick:function(){G(),ye(null)}},k.a.createElement("i",{className:"icon-guanbi1"})))),k.a.createElement("div",{className:"".concat(q.a[T]," ").concat(T," ").concat(q.a.monaco," ").concat(Y==="txt"?"show":"hide")},Y==="txt"&&k.a.createElement(F.b,ge)),Y==="audio"&&k.a.createElement("audio",{src:"".concat((ve==null?void 0:ve.indexOf("http://"))>-1||(ve==null?void 0:ve.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(ve),autoPlay:!0}),Y==="video"&&k.a.createElement(k.a.Fragment,null,(ve==null?void 0:ve.indexOf("http"))>-1?k.a.createElement("video",{controls:!0,src:"".concat(ve),autoPlay:!0}):k.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(ve),autoPlay:!0})),Y==="office"&&Ee&&k.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(Ee.key,"&url=").concat(oe.a.API_SERVER+Ee.url,"&callbackUrl=").concat(oe.a.API_SERVER+Ee.callbackUrl,"&fileType=").concat(Ee.fileType,"&title=").concat(Ee.title,"&model=view")}),(Y==="xlsx"||Y==="doc"||Y==="pptx"||Y==="docx")&&k.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(J.key,"&url=").concat(oe.a.API_SERVER+J.url,"&callbackUrl=").concat(oe.a.API_SERVER+J.callbackUrl,"&fileType=").concat(J.fileType,"&title=").concat(J.title,"&model=").concat(J.model)}),Y==="html"&&k.a.createElement("iframe",{src:ve+"&disposition=inline"}),Y==="pdf"&&k.a.createElement("embed",{className:q.a.embed,src:ve,type:"application/pdf"}),Y==="image"&&k.a.createElement("img",{src:"".concat((ve==null?void 0:ve.indexOf("http://"))>-1||(ve==null?void 0:ve.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(ve)}),Y==="other"&&k.a.createElement("div",null,k.a.createElement(me.a,{type:"primary",size:"large",onClick:St},k.a.createElement($.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),Y==="download"&&k.a.createElement(me.a,{type:"primary",size:"large",onClick:St},k.a.createElement($.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))};qe.a=se},"p77/":function(it,qe,y){},"rAM+":function(it,qe,y){"use strict";y.d(qe,"a",function(){return me});var B=y("Qw5x");function me(Z,fe){var ue;if(typeof Symbol=="undefined"||Z[Symbol.iterator]==null){if(Array.isArray(Z)||(ue=Object(B.a)(Z))||fe&&Z&&typeof Z.length=="number"){ue&&(Z=ue);var ee=0,O=function(){};return{s:O,n:function(){return ee>=Z.length?{done:!0}:{done:!1,value:Z[ee++]}},e:function(R){throw R},f:O}}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 N=!0,A=!1,U;return{s:function(){ue=Z[Symbol.iterator]()},n:function(){var R=ue.next();return N=R.done,R},e:function(R){A=!0,U=R},f:function(){try{!N&&ue.return!=null&&ue.return()}finally{if(A)throw U}}}}},rUJ1:function(it,qe){const y=/[&<>"']/,B=/[&<>"']/g,me=/[<>"']|&(?!#?\w+;)/,Z=/[<>"']|&(?!#?\w+;)/g,fe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ue=Y=>fe[Y];function ee(Y,m){if(m){if(y.test(Y))return Y.replace(B,ue)}else if(me.test(Y))return Y.replace(Z,ue);return Y}const O=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function N(Y){return Y.replace(O,(m,ge)=>(ge=ge.toLowerCase(),ge==="colon"?":":ge.charAt(0)==="#"?ge.charAt(1)==="x"?String.fromCharCode(parseInt(ge.substring(2),16)):String.fromCharCode(+ge.substring(1)):""))}const A=/(^|[^\[])\^/g;function U(Y,m){Y=Y.source||Y,m=m||"";const ge={replace:(T,x)=>(x=x.source||x,x=x.replace(A,"$1"),Y=Y.replace(T,x),ge),getRegex:()=>new RegExp(Y,m)};return ge}const k=/[^\w:]/g,R=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function q(Y,m,ge){if(Y){let T;try{T=decodeURIComponent(N(ge)).replace(k,"").toLowerCase()}catch(x){return null}if(T.indexOf("javascript:")===0||T.indexOf("vbscript:")===0||T.indexOf("data:")===0)return null}m&&!R.test(ge)&&(ge=oe(m,ge));try{ge=encodeURI(ge).replace(/%25/g,"%")}catch(T){return null}return ge}const $={},F=/^[^:]+:\/*[^/]*$/,H=/^([^:]+:)[\s\S]*$/,X=/^([^:]+:\/*[^/]*)[\s\S]*$/;function oe(Y,m){$[" "+Y]||(F.test(Y)?$[" "+Y]=Y+"/":$[" "+Y]=le(Y,"/",!0)),Y=$[" "+Y];const ge=Y.indexOf(":")===-1;return m.substring(0,2)==="//"?ge?m:Y.replace(H,"$1")+m:m.charAt(0)==="/"?ge?m:Y.replace(X,"$1")+m:Y+m}const se={exec:function(){}};function Le(Y){let m=1,ge,T;for(;m<arguments.length;m++){ge=arguments[m];for(T in ge)Object.prototype.hasOwnProperty.call(ge,T)&&(Y[T]=ge[T])}return Y}function Me(Y,m){const ge=Y.replace(/\|/g,(K,G,C)=>{let E=!1,J=G;for(;--J>=0&&C[J]==="\\";)E=!E;return E?"|":" |"}),T=ge.split(/ \|/);let x=0;if(T.length>m)T.splice(m);else for(;T.length<m;)T.push("");for(;x<T.length;x++)T[x]=T[x].trim().replace(/\\\|/g,"|");return T}function le(Y,m,ge){const T=Y.length;if(T===0)return"";let x=0;for(;x<T;){const K=Y.charAt(T-x-1);if(K===m&&!ge)x++;else if(K!==m&&ge)x++;else break}return Y.substr(0,T-x)}function ve(Y,m){if(Y.indexOf(m[1])===-1)return-1;const ge=Y.length;let T=0,x=0;for(;x<ge;x++)if(Y[x]==="\\")x++;else if(Y[x]===m[0])T++;else if(Y[x]===m[1]&&(T--,T<0))return x;return-1}function De(Y){Y&&Y.sanitize&&!Y.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")}it.exports={escape:ee,unescape:N,edit:U,cleanUrl:q,resolveUrl:oe,noopTest:se,merge:Le,splitCells:Me,rtrim:le,findClosingBracket:ve,checkSanitizeDeprecation:De}},rcnY:function(it,qe,y){var B=y("aRTE");function me(Z,fe){this.totalCount=Z,this.dataCount=fe}me.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]],me.getRSBlocks=function(Z,fe){var ue=me.getRsBlockTable(Z,fe);if(ue==null)throw new Error("bad rs block @ typeNumber:"+Z+"/errorCorrectLevel:"+fe);for(var ee=ue.length/3,O=new Array,N=0;N<ee;N++)for(var A=ue[N*3+0],U=ue[N*3+1],k=ue[N*3+2],R=0;R<A;R++)O.push(new me(U,k));return O},me.getRsBlockTable=function(Z,fe){switch(fe){case B.L:return me.RS_BLOCK_TABLE[(Z-1)*4+0];case B.M:return me.RS_BLOCK_TABLE[(Z-1)*4+1];case B.Q:return me.RS_BLOCK_TABLE[(Z-1)*4+2];case B.H:return me.RS_BLOCK_TABLE[(Z-1)*4+3];default:return}},it.exports=me},sDPU:function(it,qe,y){"use strict";y.r(qe);var B=y("cWXX"),me=y("/ezw"),Z=y("k1fw"),fe=y("9og8"),ue=y("tJVT"),ee=y("WmNS"),O=y.n(ee),N=y("q1tI"),A=y.n(N),U=y("Ty5D"),k=y("9kvl"),R=y("FIWC"),q=y.n(R),$=y("sbIO"),F=y("ErOA"),H=y("LvDl"),X=y.n(H),oe=function(Le){var Me,le,ve,De,Y=Le.paperlibrary,m=Le.user,ge=Le.globalSetting,T=Le.dispatch,x=Le.location,K=(x==null||((Me=x.query)===null||Me===void 0)?void 0:Me.select)||0,G=Object(N.useState)(!1),C=Object(ue.a)(G,2),E=C[0],J=C[1],L=Object(N.useState)(!0),de=Object(ue.a)(L,2),w=de[0],g=de[1],te=Object(N.useState)(Number(K)),Oe=Object(ue.a)(te,2),_e=Oe[0],$e=Oe[1],Qe=Object(N.useState)({}),Te=Object(ue.a)(Qe,2),Ee=Te[0],ye=Te[1],we=Object(U.i)(),ne=m.userInfo;Object(N.useEffect)(function(){return T({type:"globalSetting/footerToggle",payload:!1}),function(){T({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(N.useEffect)(function(){return T({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),T({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1}),function(){T({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),T({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}},[]),Object(N.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]),Object(N.useEffect)(function(){z(_e)},[]);var z=function(){var Re=Object(fe.a)(O.a.mark(function Fe(){var Ge,Ye,Ve=arguments;return O.a.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:return Ge=Ve.length>0&&Ve[0]!==void 0?Ve[0]:0,console.log(we),ze.next=4,Object(F.a)("/api/exercises/".concat(we.categoryId,"/preview_random_exercise.json"),{method:"get",params:{num:Ge}});case 4:Ye=ze.sent,g(!1),ye(Ne(Ye));case 7:case"end":return ze.stop()}},Fe)}));return function(){return Re.apply(this,arguments)}}(),Ne=function(Fe){var Ge={1:"\u4E00",2:"\u4E8C",3:"\u4E09",4:"\u56DB",5:"\u4E94",6:"\u516D",7:"\u4E03"};if(!Fe)return;var Ye=Fe||{},Ve=Ye.exam,Be=Ye.single_questions,ze=Ye.multiple_questions,Lt=Ye.judgement_questions,ft=Ye.program_questions,st=Ye.completion_questions,ut=Ye.subjective_questions,xt=Ye.practical_questions,bt=Ye.combination_questions,pt=Ye.fileupload_questions,Se=Ye.photograph_questions,Rt=[Object(Z.a)({type:"SINGLE",name:"\u5355\u9009\u9898"},Be),Object(Z.a)({type:"MULTIPLE",name:"\u591A\u9009\u9898"},ze),Object(Z.a)({type:"COMPLETION",name:"\u586B\u7A7A\u9898"},st),Object(Z.a)({type:"JUDGMENT",name:"\u5224\u65AD\u9898"},Lt),Object(Z.a)({type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},ut),Object(Z.a)({type:"PROGRAM",name:"\u7F16\u7A0B\u9898"},ft),Object(Z.a)({type:"SUBJECTIVE",name:"\u6587\u4EF6\u4E0A\u4F20\u9898"},pt),Object(Z.a)({type:"SUBJECTIVE",name:"\u62CD\u7167\u4E0A\u4F20\u9898"},Se),Object(Z.a)({type:"PRACTICAL",name:"\u5B9E\u8BAD\u9898"},xt),Object(Z.a)({type:"COMBINATION",name:"\u63A5\u9F99\u9898"},bt)],ht=[],ke=0,Ae=0,M=Rt.filter(function(j){return j.questions_count>0}).map(function(j,I){var b;return(b=j.questions)===null||b===void 0||b.forEach(function(_){ht.push(_.id),ke=ke+_.score,Ae=Ae+1}),Object(Z.a)(Object(Z.a)({},j),{number:Ge[I+1]})});return{all_questions_count:Ae,all_score:ke,questionList:M,ids:ht,exam:Ve}},be=function(){k.d.push("/classrooms/".concat(we.coursesId,"/exercise"))},St=function(){alert("\u4FDD\u5B58")},Ze=function(){var Re=Object(fe.a)(O.a.mark(function Fe(Ge,Ye){var Ve,Be,ze;return O.a.wrap(function(ft){for(;;)switch(ft.prev=ft.next){case 0:return ft.next=2,Object(F.a)("/api/exercises/".concat(we.categoryId,"/toggle_random_question.json"),{method:"post",body:{question_id:Ge==null?void 0:Ge.single_question_id,type:Ge==null?void 0:Ge.type}});case 2:Ve=ft.sent,Ve!=null&&Ve.question&&(ze=Object(H.cloneDeep)(Ee),ze.questionList=ze==null||((Be=ze.questionList)===null||Be===void 0)?void 0:Be.map(function(st){if(st.type===Ye.type){var ut=Object(H.cloneDeep)(st==null?void 0:st.questions);return ut.splice(Ye.index,1,Ve==null?void 0:Ve.question),Object(Z.a)(Object(Z.a)({},st),{},{questions:ut})}return st}),ye(ze));case 4:case"end":return ft.stop()}},Fe)}));return function(Ge,Ye){return Re.apply(this,arguments)}}(),Ke=function(){var Re=Object(fe.a)(O.a.mark(function Fe(Ge){return O.a.wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:document.body.scrollIntoView(),z(Ge),$e(Ge);case 3:case"end":return Ve.stop()}},Fe)}));return function(Ge){return Re.apply(this,arguments)}}();return console.log(Object(U.h)(),"location333"),A.a.createElement("section",{className:q.a.wrap},A.a.createElement(me.a,{loading:w,active:!0,paragraph:{rows:5}},((le=Object(U.h)())===null||le===void 0||((ve=le.pathname)===null||ve===void 0)?void 0:ve.includes("preview"))&&A.a.createElement("div",{className:q.a.crumbs},A.a.createElement("b",null),A.a.createElement("span",{className:"current",onClick:function(){return k.d.push("/classrooms/".concat(we.coursesId,"/exercise"))}},"".concat(ne==null||((De=ne.course)===null||De===void 0)?void 0:De.course_name,">")),A.a.createElement("span",{className:"current",onClick:function(){return k.d.push("/classrooms/".concat(we.coursesId,"/exercise"))}},"\u8BD5\u5377\u5217\u8868>"),A.a.createElement("span",{style:{color:"#bebebe"}},"\u9884\u89C8")),A.a.createElement($.a,{loading:E,submit:St,goBack:be,data:Ee,selectValue:_e,editPreview:!0,onExchange:Ze,onSkipExamination:Ke})))};qe.default=Object(k.a)(function(se){var Le=se.paperlibrary,Me=se.user,le=se.globalSetting;return{paperlibrary:Le,user:Me,globalSetting:le}})(oe)},sbIO:function(it,qe,y){"use strict";var B=y("DjyN"),me=y("NUBc"),Z=y("5Dmo"),fe=y("3S7+"),ue=y("/zsF"),ee=y("PArb"),O=y("Q9mQ"),N=y("diRs"),A=y("+L6B"),U=y("2/Rp"),k=y("7Kak"),R=y("9yH6"),q=y("5NDa"),$=y("5rEg"),F=y("miYZ"),H=y("tsqr"),X=y("9og8"),oe=y("giR+"),se=y("fyUT"),Le=y("2qtc"),Me=y("kLXV"),le=y("tJVT"),ve=y("WmNS"),De=y.n(ve),Y=y("q1tI"),m=y.n(Y),ge=y("PsQE"),T=y.n(ge),x=y("0eGx"),K=y.n(x),G=y("9Bee"),C=y("Ty5D"),E=y("9kvl"),J=y("ErOA"),L=y("+yhJ"),de=y.n(L),w=y("RZ/O"),g=y.n(w),te=y("LvDl"),Oe=y("6K3P"),_e=y.n(Oe),$e=y("sRBo"),Qe=y("kaz8"),Te=y("oBTY"),Ee=y("PpiC"),ye=y("Ot1p"),we=y("kqOp"),ne=y("7qnI"),z=y("1vsH"),Ne=y("PGNT"),be=y.n(Ne),St=["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"],Ze=function(M,j){var I=M.globalSetting,b=M.loading,_=M.dispatch,S=M.isEdit,P=M.editData,re=Object(Ee.a)(M,["globalSetting","loading","dispatch","isEdit","editData"]),pe=Object(Y.useState)(""),Ce=Object(le.a)(pe,2),Ct=Ce[0],At=Ce[1],xe=Object(Y.useState)(""),rt=Object(le.a)(xe,2),mt=rt[0],Xe=rt[1],Dt=Object(Y.useState)([]),kt=Object(le.a)(Dt,2),Ft=kt[0],Pt=kt[1],ct=Object(Y.useState)(""),Wt=Object(le.a)(ct,2),Nt=Wt[0],He=Wt[1],dt=Object(Y.useState)(),gt=Object(le.a)(dt,2),Et=gt[0],Xt=gt[1],Gt=Object(Y.useState)(!1),tn=Object(le.a)(Gt,2),Ht=tn[0],yt=tn[1];Object(Y.useEffect)(function(){if(!P||!S)return;At(P==null?void 0:P.name),Xe(P==null?void 0:P.analysis),Xt(P==null?void 0:P.is_ordered),yt(!0)},[P]),Object(Y.useEffect)(function(){if(!Ht)return;var je=P==null?void 0:P.standard_answer.map(function(et){return et.answer_text});Pt(je),yt(!1)},[Ht]),Object(Y.useImperativeHandle)(j,function(){return{onSave:Yt,Clear:Mt}});var Yt=function(){var et=[],an=!1;return Ct?(Ft.forEach(function(hn,gn){et.push({position:gn+1,answer_text:[]}),hn.forEach(function(En,h){et[gn].answer_text.push(En),(!En||!Object(z.bb)(En,1e4))&&(He("".concat(gn,"-").concat(h)),H.b.info(En?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),an=!0)})}),an?!1:(et==null?void 0:et.length)>20?(H.b.warn("\u586B\u7A7A\u9898\u6807\u51C6\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A/\u4E0D\u80FD\u8D85\u8FC720\u4E2A\uFF01"),!1):{name:Ct,analysis:mt,standard_answers:et,is_ordered:Et}):(H.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},Mt=function(){At(""),Xe(""),Pt([]),Xt(!1)},qt=function(et,an,hn){var gn=Ft.slice();if(an&&gn.splice(et,an),hn)for(var En=0;En<hn;En++)gn.splice(et+En,0,[""]);Pt(gn)},It=function(et,an,hn){He("");var gn=Ft.slice();gn[et][an]=hn,Pt(gn)},Cn=function(et){var an=Ft.slice();an[et]=[].concat(Object(Te.a)(an[et]),[""]),Pt(an)},ai=function(et,an){var hn=Ft.slice();if(!hn[et][an]){hn[et]=hn[et].filter(function(gn,En){return En!==an}),Pt(hn);return}Me.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:be.a.modal,onOk:function(){hn[et]=hn[et].filter(function(En,h){return h!==an}),Pt(hn)}})},ti=function(et){Me.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:be.a.modal,onOk:function(){var hn=Ft.slice();hn=Ft.filter(function(gn,En){return et!==En}),Pt(hn)}})};return m.a.createElement("section",{className:be.a.wrap},m.a.createElement("p",{className:be.a.titleWrap},m.a.createElement("span",{className:be.a.required},"*"),m.a.createElement("span",{className:be.a.title},"\u9898\u5E72\uFF1A")),m.a.createElement("div",null,m.a.createElement(we.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:Ct,onChange:function(et){return At(et)},showNullButton:!0,onPlaceholderChange:qt})),m.a.createElement("div",{className:"mt20"},Ft.map(function(je,et){return m.a.createElement(ne.a,{key:et,answers:je,index:et,flex:1,is_md:!0,activeOptionErrorIndex:Nt,onAnswerChange:It,addChildAnswer:Cn,deleteChildAnswer:ai,deleteChildAnswermain:ti})})),m.a.createElement("div",{className:"mt20"},Ft.length>1&&m.a.createElement("span",null,m.a.createElement(Qe.a,{checked:Et,onChange:function(et){return Xt(et.target.checked)},className:"".concat(be.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),m.a.createElement("span",{className:"".concat(be.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"))),m.a.createElement("p",{className:be.a.titleWrap},m.a.createElement("span",{className:be.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),m.a.createElement(ye.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:mt,onChange:function(et){return Xe(et)}}))},Ke=Object(E.a)(function(Ae){var M=Ae.loading,j=Ae.globalSetting;return{globalSetting:j,loading:M.effects}},null,null,{forwardRef:!0})(Object(Y.forwardRef)(Ze)),Re=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Fe=function(M,j){var I=M.globalSetting,b=M.loading,_=M.editData,S=M.dispatch,P=M.onRef,re=P===void 0?function(){}:P,pe=M.isEdit,Ce=Object(Ee.a)(M,["globalSetting","loading","editData","dispatch","onRef","isEdit"]),Ct=Object(Y.useState)(),At=Object(le.a)(Ct,2),xe=At[0],rt=At[1],mt=Object(Y.useState)(""),Xe=Object(le.a)(mt,2),Dt=Xe[0],kt=Xe[1],Ft=Object(Y.useState)(""),Pt=Object(le.a)(Ft,2),ct=Pt[0],Wt=Pt[1];Object(Y.useEffect)(function(){if(!_||!pe)return;kt(_==null?void 0:_.name),Wt(_==null?void 0:_.analysis);var dt=_==null?void 0:_.choices.find(function(gt){return gt.is_answer});rt(dt.choice_text==="\u6B63\u786E"?"0":"1")},[_]),Object(Y.useImperativeHandle)(j,function(){return{onSave:Nt,Clear:He}});var Nt=function(){if(!Dt)return H.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(!xe)return H.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),!1;var gt=[{choice_text:"\u6B63\u786E",is_answer:xe==="0"?1:0},{choice_text:"\u9519\u8BEF",is_answer:xe==="1"?1:0}];return{name:Dt,choices:gt,analysis:ct}},He=function(){kt(""),Wt(""),rt("")};return m.a.createElement("section",{className:be.a.wrap},m.a.createElement("p",{className:be.a.titleWrap},m.a.createElement("span",{className:be.a.required},"*"),m.a.createElement("span",{className:be.a.title},"\u9898\u5E72\uFF1A")),m.a.createElement(ye.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Dt,onChange:function(gt){return kt(gt)}}),m.a.createElement("p",{className:be.a.titleWrap},m.a.createElement("span",{className:be.a.required},"*"),m.a.createElement("span",{className:be.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",m.a.createElement("span",{className:be.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),m.a.createElement(R.a.Group,{buttonStyle:"solid",value:xe,onChange:function(gt){return rt(gt.target.value)}},m.a.createElement(R.a.Button,{value:"0",className:"".concat(be.a.radio," mr40")},"\u6B63\u786E"),m.a.createElement(R.a.Button,{value:"1",className:be.a.radio},"\u9519\u8BEF")),m.a.createElement("p",{className:be.a.titleWrap},m.a.createElement("span",{className:be.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),m.a.createElement(ye.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:ct,onChange:function(gt){return Wt(gt)}}))},Ge=Object(E.a)(function(Ae){var M=Ae.loading,j=Ae.globalSetting;return{globalSetting:j,loading:M.effects}},null,null,{forwardRef:!0})(Object(Y.forwardRef)(Fe)),Ye=["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"],Ve=function(M,j){var I=M.editData,b=M.globalSetting,_=M.loading,S=M.dispatch,P=M.onRef,re=P===void 0?function(){}:P,pe=M.isEdit,Ce=Object(Ee.a)(M,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),Ct=Object(Y.useState)([]),At=Object(le.a)(Ct,2),xe=At[0],rt=At[1],mt=Object(Y.useState)(),Xe=Object(le.a)(mt,2),Dt=Xe[0],kt=Xe[1],Ft=Object(Y.useState)([]),Pt=Object(le.a)(Ft,2),ct=Pt[0],Wt=Pt[1],Nt=Object(Y.useState)(""),He=Object(le.a)(Nt,2),dt=He[0],gt=He[1],Et=Object(Y.useState)(""),Xt=Object(le.a)(Et,2),Gt=Xt[0],tn=Xt[1];Object(Y.useEffect)(function(){rt(["","","",""])},[]),Object(Y.useEffect)(function(){if(!I||!pe)return;gt(I==null?void 0:I.name),tn(I==null?void 0:I.analysis),rt(I==null?void 0:I.choices.map(function(Mt){return Mt.choice_text}));var Yt=[];I==null||I.choices.map(function(Mt,qt){Mt.is_answer&&Yt.push(qt)}),Wt(Yt)},[I]),Object(Y.useImperativeHandle)(j,function(){return{onSave:Ht,Clear:yt}});var Ht=function(){if(!dt)return H.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;var Mt=xe.findIndex(function(It){return!It});if(Mt>-1)return H.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Ye[Mt]," \u9009\u9879\u7684\u5185\u5BB9")),!1;if(!ct.length)return H.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(ct.length<2)return H.b.info("\u591A\u9009\u9898\u6700\u5C0F\u6B63\u786E\u9009\u9879\u4E3A2\u4E2A"),!1;var qt=xe.map(function(It,Cn){return{choice_text:It,is_answer:ct.includes(Cn)?1:0}});return{name:dt,choices:qt,analysis:Gt}},yt=function(){rt(["","","",""]),gt(""),tn(""),Wt("")};return m.a.createElement("section",{className:be.a.wrap},m.a.createElement("p",{className:be.a.titleWrap},m.a.createElement("span",{className:be.a.required},"*"),m.a.createElement("span",{className:be.a.title},"\u9898\u5E72\uFF1A")),m.a.createElement(ye.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:dt,onChange:function(Mt){return gt(Mt)}}),m.a.createElement("p",{className:be.a.titleWrap},m.a.createElement("span",{className:be.a.required},"*"),m.a.createElement("span",{className:be.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",m.a.createElement("span",{className:be.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),xe.map(function(Yt,Mt){return m.a.createElement("div",{className:be.a.choiceWrap,key:Mt},m.a.createElement(fe.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},m.a.createElement("div",{className:"".concat(be.a.answer," ").concat(ct.includes(Mt)?be.a.activeAnswer:""),onClick:function(){ct.includes(Mt)?Wt(ct.filter(function(It){return It!==Mt})):Wt([].concat(Object(Te.a)(ct),[Mt]))}},Ye[Mt])),m.a.createElement("div",{className:be.a.editorWrap},Dt===Mt?m.a.createElement(ye.a,{id:"single-question-option-".concat(Mt),watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Yt,onChange:function(It){xe[Mt]=It,rt(xe)}}):m.a.createElement("div",{className:be.a.htmlWrap,onClick:function(){return kt(Mt)}},m.a.createElement(G.a,{value:Yt}))),Mt>1&&m.a.createElement(fe.a,{title:"\u5220\u9664"},m.a.createElement("i",{className:"".concat(be.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){rt(xe.filter(function(It,Cn){return Cn!==Mt})),ct.includes(Mt)?Wt(ct.filter(function(It){return It!==Mt})):Wt([].concat(Object(Te.a)(ct),[Mt]))}})),Mt<7&&Mt===xe.length-1&&m.a.createElement(fe.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},m.a.createElement("i",{className:"".concat(be.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return rt([].concat(Object(Te.a)(xe),[""]))}})))}),m.a.createElement("p",{className:be.a.titleWrap},m.a.createElement("span",{className:be.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),m.a.createElement(ye.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Gt,onChange:function(Mt){return tn(Mt)}}))},Be=Object(E.a)(function(Ae){var M=Ae.loading,j=Ae.globalSetting;return{globalSetting:j,loading:M.effects}},null,null,{forwardRef:!0})(Object(Y.forwardRef)(Ve)),ze=["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"],Lt=function(M,j){var I=M.editData,b=M.globalSetting,_=M.loading,S=M.dispatch,P=M.onRef,re=P===void 0?function(){}:P,pe=M.isEdit,Ce=Object(Ee.a)(M,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),Ct=Object(Y.useState)([]),At=Object(le.a)(Ct,2),xe=At[0],rt=At[1],mt=Object(Y.useState)(),Xe=Object(le.a)(mt,2),Dt=Xe[0],kt=Xe[1],Ft=Object(Y.useState)(),Pt=Object(le.a)(Ft,2),ct=Pt[0],Wt=Pt[1],Nt=Object(Y.useState)(""),He=Object(le.a)(Nt,2),dt=He[0],gt=He[1],Et=Object(Y.useState)(""),Xt=Object(le.a)(Et,2),Gt=Xt[0],tn=Xt[1];Object(Y.useEffect)(function(){rt(["","","",""])},[]),Object(Y.useEffect)(function(){if(!I||!pe)return;gt(I==null?void 0:I.name),tn(I==null?void 0:I.analysis),rt(I==null?void 0:I.choices.map(function(Yt){return Yt.choice_text})),Wt(I==null?void 0:I.choices.findIndex(function(Yt){return Yt.is_answer}))},[I]),Object(Y.useImperativeHandle)(j,function(){return{onSave:Ht,Clear:yt}});var Ht=function(){if(!dt)return H.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;var Mt=xe.findIndex(function(It){return!It});if(Mt>-1)return H.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(ze[Mt]," \u9009\u9879\u7684\u5185\u5BB9")),!1;if(console.log("activeAnswer: ",ct),!(typeof ct=="number"))return H.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 qt=xe.map(function(It,Cn){return{choice_text:It,is_answer:ct===Cn?1:0}});return{name:dt,choices:qt,analysis:Gt}},yt=function(){rt(["","","",""]),gt(""),tn(""),Wt("")};return m.a.createElement("section",{className:be.a.wrap},m.a.createElement("p",{className:be.a.titleWrap},m.a.createElement("span",{className:be.a.required},"*"),m.a.createElement("span",{className:be.a.title},"\u9898\u5E72\uFF1A")),m.a.createElement(ye.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:dt,onChange:function(Mt){return gt(Mt)}}),m.a.createElement("p",{className:be.a.titleWrap},m.a.createElement("span",{className:be.a.required},"*"),m.a.createElement("span",{className:be.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",m.a.createElement("span",{className:be.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),xe.map(function(Yt,Mt){return m.a.createElement("div",{className:be.a.choiceWrap,key:Mt},m.a.createElement(fe.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},m.a.createElement("div",{className:"".concat(be.a.answer," ").concat(ct===Mt?be.a.activeAnswer:""),onClick:function(){return Wt(Mt)}},ze[Mt])),m.a.createElement("div",{className:be.a.editorWrap},Dt===Mt?m.a.createElement(ye.a,{id:"single-question-option-".concat(Mt),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Yt,onChange:function(It){xe[Mt]=It,rt(xe)}}):m.a.createElement("div",{className:be.a.htmlWrap,onClick:function(){return kt(Mt)}},m.a.createElement(G.a,{value:Yt}))),Mt>1&&m.a.createElement(fe.a,{title:"\u5220\u9664"},m.a.createElement("i",{className:"".concat(be.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){rt(xe.filter(function(It,Cn){return Cn!==Mt})),Mt===ct&&Wt(null)}})),Mt<7&&Mt===xe.length-1&&m.a.createElement(fe.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},m.a.createElement("i",{className:"".concat(be.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return rt([].concat(Object(Te.a)(xe),[""]))}})))}),m.a.createElement("p",{className:be.a.titleWrap},m.a.createElement("span",{className:be.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),m.a.createElement(ye.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Gt,onChange:function(Mt){return tn(Mt)}}))},ft=Object(E.a)(function(Ae){var M=Ae.loading,j=Ae.globalSetting;return{globalSetting:j,loading:M.effects}},null,null,{forwardRef:!0})(Object(Y.forwardRef)(Lt)),st=["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"],ut=function(M,j){var I=M.editData,b=M.globalSetting,_=M.loading,S=M.dispatch,P=M.onRef,re=P===void 0?function(){}:P,pe=M.isEdit,Ce=Object(Ee.a)(M,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),Ct=Object(Y.useState)(""),At=Object(le.a)(Ct,2),xe=At[0],rt=At[1],mt=Object(Y.useState)(""),Xe=Object(le.a)(mt,2),Dt=Xe[0],kt=Xe[1],Ft=Object(Y.useState)(""),Pt=Object(le.a)(Ft,2),ct=Pt[0],Wt=Pt[1];Object(Y.useEffect)(function(){var dt;if(!I||!pe)return;rt(I==null?void 0:I.name),kt(I==null?void 0:I.analysis),Wt(I==null||((dt=I.answer_texts)===null||dt===void 0)?void 0:dt[0])},[I]),Object(Y.useImperativeHandle)(j,function(){return{onSave:Nt,Clear:He}});var Nt=function(){return xe?ct?{name:xe,answer_texts:[ct],analysis:Dt}:(H.b.info("\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848"),!1):(H.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},He=function(){rt(""),kt(""),Wt("")};return m.a.createElement("section",{className:be.a.wrap},m.a.createElement("p",{className:be.a.titleWrap},m.a.createElement("span",{className:be.a.required},"*"),m.a.createElement("span",{className:be.a.title},"\u9898\u5E72\uFF1A")),m.a.createElement(ye.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:xe,onChange:function(gt){return rt(gt)}}),m.a.createElement("p",{className:be.a.titleWrap},m.a.createElement("span",{className:be.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),m.a.createElement(ye.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:ct,onChange:function(gt){return Wt(gt)}}),m.a.createElement("p",{className:be.a.titleWrap},m.a.createElement("span",{className:be.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),m.a.createElement(ye.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Dt,onChange:function(gt){return kt(gt)}}))},xt=Object(E.a)(function(Ae){var M=Ae.loading,j=Ae.globalSetting;return{globalSetting:j,loading:M.effects}},null,null,{forwardRef:!0})(Object(Y.forwardRef)(ut)),bt=y("k1fw"),pt=["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"],Se=function(M,j){var I=M.globalSetting,b=M.loading,_=M.dispatch,S=M.editData,P=M.onRef,re=P===void 0?function(){}:P,pe=M.isEdit,Ce=Object(Ee.a)(M,["globalSetting","loading","dispatch","editData","onRef","isEdit"]),Ct=Object(Y.useState)(""),At=Object(le.a)(Ct,2),xe=At[0],rt=At[1],mt=Object(Y.useState)([]),Xe=Object(le.a)(mt,2),Dt=Xe[0],kt=Xe[1];console.log(Dt),Object(Y.useEffect)(function(){var Nt;if(!S||!pe)return;rt(S==null?void 0:S.name);var He=S==null||((Nt=S.sub_item_banks)===null||Nt===void 0)?void 0:Nt.map(function(dt){var gt,Et,Xt;return Object(bt.a)(Object(bt.a)({},dt),{},{id:dt.id,open:!1,qusList:dt==null||((gt=dt.choices)===null||gt===void 0)?void 0:gt.map(function(Gt){return Gt.choice_text}),activeQusEditor:null,qusAnswer:(Et=[dt==null||((Xt=dt.choices)===null||Xt===void 0)?void 0:Xt.findIndex(function(Gt){return Gt.is_answer})])===null||Et===void 0?void 0:Et.filter(function(Gt){return Gt!==-1})})});kt(He)},[S]),Object(Y.useImperativeHandle)(j,function(){return{onSave:Ft,Clear:Pt}});var Ft=function(){if(!xe)return H.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(Dt.length===0)return H.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),!1;for(var He=0;He<Dt.length;He++){var dt,gt=Dt[He];if(!(gt!=null&&gt.name))return H.b.info("\u8BF7\u60A8\u8F93\u5165\u7B2C".concat(He+1,"\u5C0F\u9898\u9898\u5E72")),!1;var Et=gt==null||((dt=gt.qusList)===null||dt===void 0)?void 0:dt.findIndex(function(Gt){return!Gt});if(Et>-1)return H.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(He+1,"\u5C0F\u9898").concat(pt[Et],"\u9009\u9879\u7684\u5185\u5BB9")),!1;if(!(gt!=null&&gt.qusAnswer.length))return H.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(He+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),!1}var Xt=Dt.map(function(Gt){return{id:Gt.id>1?Gt.id:null,name:Gt.name,item_type:Gt.item_type,analysis:Gt.analysis,choices:Gt.qusList.map(function(tn,Ht){return{choice_text:tn,is_answer:Gt.qusAnswer[0]===Ht?1:0}})}});return{name:xe,sub_item_banks:Xt}},Pt=function(){rt(""),kt([])},ct=function(){var He={id:Math.random(),item_type:"SINGLE",open:!1,name:"",qusList:["","","",""],activeQusEditor:null,qusAnswer:[],analysis:""};kt(Dt.concat(He))},Wt=function(He,dt,gt){var Et=Object(te.cloneDeep)(Dt);if(He==="open"&&(Et[dt].open=!Et[dt].open),He==="delete"&&Et.splice(dt,1),He==="value"&&(Et[dt].name=gt),He==="answer"&&(Et[dt].qusAnswer=[gt]),He==="edit"&&(Et[dt].activeQusEditor=gt),He==="details"&&(Et[dt].qusList[Et[dt].activeQusEditor]=gt),He==="addQus"&&(Et[dt].qusList=Et[dt].qusList.concat("")),He==="deleteQus"){var Xt;Et[dt].qusList=Et[dt].qusList.filter(function(Gt,tn){return tn!==gt}),Et[dt].qusAnswer=(Xt=Et[dt].qusAnswer)===null||Xt===void 0?void 0:Xt.filter(function(Gt){return Gt!==gt})}He==="analysis"&&(Et[dt].analysis=gt),kt(Et)};return m.a.createElement("section",{className:be.a.wrap},m.a.createElement("p",{className:be.a.titleWrap},m.a.createElement("span",{className:be.a.required},"*"),m.a.createElement("span",{className:be.a.title},"\u9898\u5E72\uFF1A")),m.a.createElement(ye.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:xe,onChange:function(He){return rt(He)}}),Dt==null?void 0:Dt.map(function(Nt,He){var dt;return m.a.createElement("div",{className:be.a.fold,key:Nt.id},m.a.createElement("div",{onClick:function(){return Wt("open",He)},className:be.a.head},m.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:Nt.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),m.a.createElement("span",null,"\u7B2C",He+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),m.a.createElement("b",{style:{visibility:"hidden"},onClick:function(Et){Et.stopPropagation(),Wt("delete",He)},className:"iconfont icon-shanchu8"})),m.a.createElement("div",{className:"mb10",style:{display:Nt.open?"block":"none"}},m.a.createElement(ye.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Nt==null?void 0:Nt.name,onChange:function(Et){return Wt("value",He,Et)}}),m.a.createElement("p",{className:be.a.titleWrap},m.a.createElement("span",{className:be.a.required},"*"),m.a.createElement("span",{className:be.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",m.a.createElement("span",{className:be.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Nt==null||((dt=Nt.qusList)===null||dt===void 0)?void 0:dt.map(function(gt,Et){var Xt,Gt;return m.a.createElement("div",{className:be.a.choiceWrap,key:Et},m.a.createElement(fe.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},m.a.createElement("div",{className:"".concat(be.a.answer," ").concat(Nt!=null&&(Xt=Nt.qusAnswer)!==null&&Xt!==void 0&&Xt.includes(Et)?be.a.activeAnswer:""),onClick:function(){return Wt("answer",He,Et)}},pt[Et])),m.a.createElement("div",{className:be.a.editorWrap},(Nt==null?void 0:Nt.activeQusEditor)===Et?m.a.createElement(ye.a,{id:"single-question-option-".concat(Et),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:gt,onChange:function(Ht){return Wt("details",He,Ht)}}):m.a.createElement("div",{className:be.a.htmlWrap,onClick:function(){return Wt("edit",He,Et)}},m.a.createElement(G.a,{value:gt}))),Et>1&&m.a.createElement(fe.a,{title:"\u5220\u9664"},m.a.createElement("i",{className:"".concat(be.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Wt("deleteQus",He,Et)}})),Et<7&&Et===(Nt==null||((Gt=Nt.qusList)===null||Gt===void 0)?void 0:Gt.length)-1&&m.a.createElement(fe.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},m.a.createElement("i",{className:"".concat(be.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Wt("addQus",He)}})))}),m.a.createElement("p",{className:"mb10 mt10"},m.a.createElement("span",{className:be.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),m.a.createElement(ye.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Nt.analysis,onChange:function(Et){return Wt("analysis",He,Et)}})))}))},Rt=Object(E.a)(function(Ae){var M=Ae.loading,j=Ae.globalSetting;return{globalSetting:j,loading:M.effects}},null,null,{forwardRef:!0})(Object(Y.forwardRef)(Se)),ht=function(M){var j,I,b,_,S,P,re,pe,Ce=M.data,Ct=M.submit,At=M.goBack,xe=M.loading,rt=M.onTypeScore,mt=M.editPreview,Xe=mt===void 0?!1:mt,Dt=M.onSkipExamination,kt=M.selectValue,Ft=M.onExchange,Pt=Object(Y.useRef)(),ct=Object(Y.useRef)(Object(te.debounce)(function(){return qt()},100,{leading:!0,trailing:!0})),Wt=Object(Y.useState)(null),Nt=Object(le.a)(Wt,2),He=Nt[0],dt=Nt[1],gt=Object(Y.useState)(!1),Et=Object(le.a)(gt,2),Xt=Et[0],Gt=Et[1],tn=Object(C.i)();Object(Y.useEffect)(function(){return window.addEventListener("scroll",ct==null?void 0:ct.current),function(){window.removeEventListener("scroll",ct==null?void 0:ct.current)}},[]),Object(Y.useEffect)(function(){Gt(!0)},[]),Object(Y.useEffect)(function(){var ae,Q,Ie,ot,at=(ae=document.getElementById("examName"))===null||ae===void 0||((Q=ae.getElementsByClassName("ant-pagination-options-quick-jumper"))===null||Q===void 0||((Ie=Q[0])===null||Ie===void 0||((ot=Ie.childNodes)===null||ot===void 0)))?void 0:ot[2];at&&(at.nodeValue="\u4EFD")},[Ce]);var Ht=function(Q){var Ie=parseInt(Q);return isNaN(Ie)?"":Ie};function yt(){var ae=0,Q=0,Ie=0;return document.body&&(Q=document.body.scrollTop),document.documentElement&&(Ie=document.documentElement.scrollTop),ae=Q-Ie>0?Q:Ie,ae}function Yt(){var ae=0,Q=0,Ie=0;return document.body&&(Q=document.body.scrollHeight),document.documentElement&&(Ie=document.documentElement.scrollHeight),ae=Q-Ie>0?Q:Ie,ae}function Mt(){var ae=0;return document.compatMode=="CSS1Compat"?ae=document.documentElement.clientHeight:ae=document.body.clientHeight,ae}var qt=function(){var Q=document.getElementById("preview_btns"),Ie=document.getElementById("preview_btns_else");yt()+Mt()>=Yt()-68?(Q.style.visibility="hidden",Ie.style.visibility="visible"):(Q.style.visibility="visible",Ie.style.visibility="hidden")},It=["\u5BB9\u6613","\u7B80\u5355","\u9002\u4E2D","\u56F0\u96BE"],Cn=function(Q){var Ie,ot=[];return m.a.createElement(m.a.Fragment,null,m.a.createElement("aside",{className:T.a.single},Q==null||((Ie=Q.choices)===null||Ie===void 0)?void 0:Ie.map(function(at,lt){return at.is_answer&&ot.push(an[lt]),m.a.createElement("ul",{key:lt},m.a.createElement("li",null,an[lt],"\u3001"),m.a.createElement("li",null,m.a.createElement(G.a,{value:at.choice_text})))})),m.a.createElement("div",{className:T.a.analysis},m.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",ot.join(""),m.a.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",It[Q.difficulty])),m.a.createElement("aside",null,m.a.createElement("span",{className:T.a.text},"\u89E3\u6790:"),m.a.createElement(G.a,{value:Q.analysis?Q.analysis:"\u6682\u65E0\u89E3\u6790"})),m.a.createElement("ul",null,m.a.createElement("li",null,m.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(Q==null?void 0:Q.discipline_name,"/").concat(Q==null?void 0:Q.sub_discipline_name)),m.a.createElement("li",null,m.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Q==null?void 0:Q.tag_discipline_name))))},ai=function(Q){var Ie,ot=Q==null||((Ie=Q.standard_answer)===null||Ie===void 0)?void 0:Ie.map(function(at){var lt;return"\u7B54\u6848\uFF08\u586B\u7A7A".concat(at.position,"\uFF09\uFF1A").concat(at==null||((lt=at.answer_text)===null||lt===void 0)?void 0:lt.join("\u3001"))});return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{className:T.a.analysis},m.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",ot),m.a.createElement("aside",null,m.a.createElement("span",{className:T.a.text},"\u89E3\u6790:"),m.a.createElement(G.a,{value:Q.analysis?Q.analysis:"\u6682\u65E0\u89E3\u6790"})),m.a.createElement("ul",null,m.a.createElement("li",null,m.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(Q==null?void 0:Q.discipline_name,"/").concat(Q==null?void 0:Q.sub_discipline_name)),m.a.createElement("li",null,m.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Q==null?void 0:Q.tag_discipline_name))))},ti=function(Q){var Ie;return m.a.createElement("div",{className:T.a.analysis},m.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",Q==null||((Ie=Q.answer_texts)===null||Ie===void 0)?void 0:Ie[0]),m.a.createElement("aside",null,m.a.createElement("span",{className:T.a.text},"\u89E3\u6790:"),m.a.createElement(G.a,{value:Q.analysis?Q.analysis:"\u6682\u65E0\u89E3\u6790"})),m.a.createElement("ul",null,m.a.createElement("li",null,m.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(Q==null?void 0:Q.discipline_name,"/").concat(Q==null?void 0:Q.sub_discipline_name)),m.a.createElement("li",null,m.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Q==null?void 0:Q.tag_discipline_name)))},je=function(Q){var Ie;return m.a.createElement("div",{className:T.a.analysis},m.a.createElement("aside",null,m.a.createElement("span",{className:T.a.text},"\u9884\u671F\u8F93\u51FA:"),m.a.createElement(G.a,{value:Q==null||((Ie=Q.program_attr)===null||Ie===void 0)?void 0:Ie.description})),m.a.createElement("ul",null,m.a.createElement("li",null,m.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(Q==null?void 0:Q.discipline_name,"/").concat(Q==null?void 0:Q.sub_discipline_name)),m.a.createElement("li",null,m.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Q==null?void 0:Q.tag_discipline_name)))},et=function(Q,Ie){var ot;return m.a.createElement("div",null,Q==null||((ot=Q.sub_item_banks)===null||ot===void 0)?void 0:ot.map(function(at,lt){var Ot,Qt=[];return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{style:{marginLeft:25,fontSize:"16px",color:"#333"}},Ie+1+"."+(lt+1),"\uFF08\u5355\u9009\u9898\uFF09",at.name),m.a.createElement("aside",{className:T.a.single},at==null||((Ot=at.choices)===null||Ot===void 0)?void 0:Ot.map(function(mn,nn){return mn.is_answer&&Qt.push(an[nn]),m.a.createElement("ul",{key:nn},m.a.createElement("li",null,an[nn],"\u3001"),m.a.createElement("li",null,m.a.createElement(G.a,{value:mn.choice_text})))})),m.a.createElement("div",{className:T.a.analysis},m.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",Qt.join(""),m.a.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",It[at.difficulty])),m.a.createElement("aside",null,m.a.createElement("span",{className:T.a.text},"\u89E3\u6790:"),m.a.createElement(G.a,{value:at.analysis?at.analysis:"\u6682\u65E0\u89E3\u6790"})),m.a.createElement("ul",null,m.a.createElement("li",null,m.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(Q==null?void 0:Q.discipline_name,"/").concat(Q==null?void 0:Q.sub_discipline_name)),m.a.createElement("li",null,m.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Q==null?void 0:Q.tag_discipline_name))))}))},an=["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"],hn=function(Q){console.log("---",Q);var Ie=[];Q.questions.map(function(at){return at==null?void 0:at.sub_item_banks.map(function(lt){Ie.push(lt)})});var ot=0;Q.type==="COMBINATION"?ot=Q.questions_score/Ie.length:ot=Q.questions_score/Q.questions_count,Me.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u5206\u6570\u8BBE\u7F6E",content:m.a.createElement("div",{className:T.a.modalColumn},m.a.createElement("div",{className:T.a.modalRow,style:{justifyContent:"flex-start"}},m.a.createElement("sup",{className:T.a.sup},"*"),m.a.createElement("span",null,Q==null?void 0:Q.name,(Q==null?void 0:Q.type)==="COMBINATION"&&"\u4E2D\u7684\u6BCF\u5C0F\u9898","\uFF1A"),m.a.createElement(se.a,{min:1,parser:Ht,defaultValue:ot,onChange:function(lt){ot=lt}}),m.a.createElement("span",{className:"ml5"},"\u5206/\u9898"))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var at=Object(X.a)(De.a.mark(function Ot(){var Qt,mn;return De.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:if(ot){Zt.next=3;break}return H.b.warn("\u5206\u6570\u4E0D\u80FD\u4E3A\u7A7A\u6216\u4E3A0"),Zt.abrupt("return",Promise.reject());case 3:Q.type==="COMBINATION"?(Qt={type:Q==null?void 0:Q.type,score:ot,scoreTotal:ot*(Ie==null?void 0:Ie.length)},rt(Qt)):(mn={type:Q==null?void 0:Q.type,score:ot,scoreTotal:ot*Q.questions_count},rt(mn));case 4:case"end":return Zt.stop()}},Ot)}));function lt(){return at.apply(this,arguments)}return lt}()})},gn=function(){var Q="";Me.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u4FDD\u5B58\u8BD5\u5377",content:m.a.createElement("div",{className:T.a.modalColumn},m.a.createElement("div",{style:{color:"#676A6C",display:"flex"},className:"font14 mt20"},m.a.createElement("img",{style:{marginRight:5},src:_e.a}),"\u4FDD\u5B58\u540E\u5355\u72EC\u751F\u6210\u4E00\u4EFD\u4EBA\u5DE5\u7EC4\u5377\u7C7B\u578B\u7684\u56FA\u5B9A\u8BD5\u5377\u3002"),m.a.createElement("div",{className:T.a.modalRow,style:{marginTop:20}},m.a.createElement("sup",{className:T.a.sup},"*"),m.a.createElement("span",{style:{flexShrink:0}},"\u8BD5\u5377\u540D\u79F0\uFF1A"),m.a.createElement($.a,{placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0",min:0,maxLength:60,defaultValue:Q,onChange:function(ot){Q=ot.target.value}}))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Ie=Object(X.a)(De.a.mark(function at(){var lt,Ot,Qt,mn,nn;return De.a.wrap(function(wn){for(;;)switch(wn.prev=wn.next){case 0:if(Q){wn.next=3;break}return H.b.warn("\u8BD5\u5377\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"),wn.abrupt("return",Promise.reject());case 3:return Ot=[],Qt=[],mn=[],Ce==null||((lt=Ce.questionList)===null||lt===void 0)||lt.forEach(function(Bn){var vn;(vn=Bn.questions)===null||vn===void 0||vn.forEach(function(Yn){Ot.push(Yn.id),Qt.push(Bn.questions_score/Bn.questions_count),Bn.type==="COMBINATION"&&mn.push({id:Yn.id,sub_item_bank_ids:Yn.sub_item_banks.map(function(yn){return yn.id})})})}),console.log("-----",mn),nn={item_bank_ids:Ot,item_bank_scores:Qt,name:Q,combination_item_banks:mn},wn.next=11,Ct(nn);case 11:case"end":return wn.stop()}},at)}));function ot(){return Ie.apply(this,arguments)}return ot}()})},En=function(Q,Ie,ot,at){var lt,Ot=(lt=at.questions)===null||lt===void 0?void 0:lt.map(function(nn){return nn.id}),Qt="default",mn=Me.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:m.a.createElement("div",null,m.a.createElement("p",null,"\u7CFB\u7EDF\u6309\u4EE5\u4E0B\u89C4\u5219\u4E3A\u60A8\u66F4\u6362\u8BE5\u8BD5\u9898"),m.a.createElement("div",null,m.a.createElement("span",null,"\u4F7F\u7528\u9891\u5EA6\uFF1A"),m.a.createElement(R.a.Group,{defaultValue:Qt,onChange:function(Zt){Qt=Zt.target.value}},m.a.createElement(R.a,{value:"default"},"\u4E0D\u8BBE\u5B9A"),m.a.createElement(R.a,{value:"high"},"\u4F7F\u7528\u6B21\u6570\u9AD8"),m.a.createElement(R.a,{value:"low"},"\u4F7F\u7528\u6B21\u6570\u4F4E")))),cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var nn=Object(X.a)(De.a.mark(function wn(){return De.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return mn.update({cancelButtonProps:{disabled:!0}}),vn.next=3,Ft({single_question_id:Q,seleted_item_bank_ids:Ot,type:Qt},{type:Ie,index:ot});case 3:mn.update({cancelButtonProps:{disabled:!1}}),H.b.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u8BD5\u9898");case 5:case"end":return vn.stop()}},wn)}));function Zt(){return nn.apply(this,arguments)}return Zt}()})},h=function(Q){var Ie,ot=(Ie=Q.questions)===null||Ie===void 0?void 0:Ie.map(function(Ot){return Ot.id}),at=Q.name,lt=Me.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:"\u786E\u8BA4\u66F4\u6362".concat(at,"\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F"),cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Ot=Object(X.a)(De.a.mark(function mn(){return De.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return lt.update({cancelButtonProps:{disabled:!0}}),Zt.next=3,Ft({seleted_item_bank_ids:ot},{type:Q.type});case 3:lt.update({cancelButtonProps:{disabled:!1}}),H.b.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210".concat(at,"\u8BD5\u9898"));case 5:case"end":return Zt.stop()}},mn)}));function Qt(){return Ot.apply(this,arguments)}return Qt}()})},o=function(){var Q=Me.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 Ie=Object(X.a)(De.a.mark(function at(){return De.a.wrap(function(Ot){for(;;)switch(Ot.prev=Ot.next){case 0:return Q.update({cancelButtonProps:{disabled:!0}}),Ot.next=3,Ft();case 3:Q.update({cancelButtonProps:{disabled:!1}}),H.b.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u6574\u5F20\u8BD5\u9898");case 5:case"end":return Ot.stop()}},at)}));function ot(){return Ie.apply(this,arguments)}return ot}()})},a=function(Q){console.log(Q,"key"),Dt(Q-1)},u=function(){return m.a.createElement(m.a.Fragment,null,m.a.createElement(N.a,{color:"#55575D",overlayClassName:T.a.popover,visible:Xt,getPopupContainer:function(Ie){return Ie==null?void 0:Ie.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"},m.a.createElement(U.a,{onMouseEnter:function(){return Gt(!0)},onMouseLeave:function(){return Gt(!1)},onClick:function(){gn()}},"\u4FDD\u5B58")),m.a.createElement(U.a,{onClick:function(){document.body.scrollIntoView(),At()}},"\u8FD4\u56DE"),m.a.createElement(U.a,{loading:xe,onClick:function(){return Ct()},type:"primary"},"\u63D0\u4EA4"))},p=function(){var Q;return m.a.createElement(m.a.Fragment,null,m.a.createElement(U.a,{onClick:At},"\u8FD4\u56DE"),kt>0&&m.a.createElement(U.a,{onClick:function(){return a(kt)},type:"primary"},"\u4E0A\u4E00\u4EFD"),kt<(Ce==null||((Q=Ce.exam)===null||Q===void 0)?void 0:Q.total_num)-1&&m.a.createElement(U.a,{onClick:function(){return a(kt+2)}},"\u4E0B\u4E00\u4EFD"))},c=function(Q,Ie){if(console.log(Q,222),Ie==="SINGLE")return m.a.createElement(m.a.Fragment,null,m.a.createElement(ft,{ref:Pt,editData:Q,isEdit:!0}),m.a.createElement(ee.a,null));if(Ie==="MULTIPLE")return m.a.createElement(m.a.Fragment,null,m.a.createElement(Be,{ref:Pt,editData:Q,isEdit:!0}),m.a.createElement(ee.a,null));if(Ie==="JUDGMENT")return m.a.createElement(m.a.Fragment,null,m.a.createElement(Ge,{ref:Pt,editData:Q,isEdit:!0}),m.a.createElement(ee.a,null));if(Ie==="COMPLETION")return m.a.createElement(m.a.Fragment,null,m.a.createElement(Ke,{ref:Pt,editData:Q,isEdit:!0}),m.a.createElement(ee.a,null));if(Ie==="SUBJECTIVE")return m.a.createElement(m.a.Fragment,null,m.a.createElement(xt,{ref:Pt,editData:Q,isEdit:!0}),m.a.createElement(ee.a,null));if(Ie==="COMBINATION")return m.a.createElement(m.a.Fragment,null,m.a.createElement(Rt,{ref:Pt,editData:Q,isEdit:!0}),m.a.createElement(ee.a,null));if(Ie==="PROGRAM"){var ot;E.d.push("/problems/".concat(Q==null||((ot=Q.program_attr)===null||ot===void 0)?void 0:ot.identifier,"/edit?type=exercises&express_id=").concat(tn.categoryId,"&question_id=").concat(Q==null?void 0:Q.id,"&score=").concat(Q==null?void 0:Q.score,"&callback_url=").concat(location.pathname,"&select=").concat(kt,"&exercise=true"))}},V=function(){var ae=Object(X.a)(De.a.mark(function Q(Ie,ot){var at,lt,Ot,Qt,mn,nn,Zt,wn,Bn,vn;return De.a.wrap(function(yn){for(;;)switch(yn.prev=yn.next){case 0:return yn.next=2,(at=Pt.current)===null||at===void 0?void 0:at.onSave();case 2:if(lt=yn.sent,lt){yn.next=5;break}return yn.abrupt("return");case 5:return Ot={question_score:ot.score,analysis:lt.analysis},console.log(lt,"editorData"),(Ie==="SINGLE"||Ie==="MULTIPLE"||Ie==="JUDGMENT")&&(mn=[],nn=[],Ot.question_type=Ie==="JUDGMENT"?2:1,Ot.question_title=lt==null?void 0:lt.name,lt==null||((Qt=lt.choices)===null||Qt===void 0)||Qt.forEach(function(Mn,pi){mn.push(Mn.choice_text),Mn!=null&&Mn.is_answer&&nn.push(pi+1)}),Ot.question_choices=mn,Ot.standard_answers=nn),Ie==="COMPLETION"&&(Ot.is_ordered=lt.is_ordered,Ot.question_title=lt==null?void 0:lt.name,Ot.question_type=3,wn=[],lt==null||((Zt=lt.standard_answers)===null||Zt===void 0)||Zt.forEach(function(Mn,pi){wn.push({choice_id:Mn.position,answer_text:Mn.answer_text})}),Ot.standard_answers=wn),Ie==="SUBJECTIVE"&&(Ot.question_title=lt==null?void 0:lt.name,Ot.question_type=3,Ot.standard_answers=lt==null?void 0:lt.answer_texts),Ie==="COMBINATION"&&(Ot.question_title=lt==null?void 0:lt.name,Ot.question_type=7,Ot.sub_questions=lt==null||((Bn=lt.sub_item_banks)===null||Bn===void 0)?void 0:Bn.map(function(Mn,pi){return{id:Mn.id,question_title:Mn.name,question_type:1,question_choices:Mn.choices.map(function(Fn){return Fn.choice_text}),standard_answers:[Mn.choices.findIndex(function(Fn){return Fn.is_answer})+1],analysis:Mn.analysis}}),delete Ot.analysis),yn.next=13,Object(J.a)("/api/exercise_questions/".concat(ot.id,".json"),{method:"put",body:Ot});case 13:vn=yn.sent,(vn==null?void 0:vn.status)===0&&(H.b.success("\u7F16\u8F91\u6210\u529F"),a(kt+1)),dt(null);case 16:case"end":return yn.stop()}},Q)}));return function(Ie,ot){return ae.apply(this,arguments)}}(),Ue=function(){for(var Q=[],Ie=0;Ie<(Ce==null||((ot=Ce.exam)===null||ot===void 0)?void 0:ot.total_num);Ie++){var ot;Q.push({})}return Q};console.log(Ue(),"data");var he=Ce==null||((j=Ce.questionList)===null||j===void 0)?void 0:j.reduce(function(ae,Q){return ae+Q.questions_score},0),wt=Xe&&(Ce==null||((I=Ce.exam)===null||I===void 0)?void 0:I.exercise_status)!==1;return m.a.createElement("section",{className:T.a.wrap},m.a.createElement("div",{id:"id_left_preview",className:T.a.left,onMouseEnter:function(Q){var Ie=document.getElementById("id_left_preview");Ie.style.overflowY="auto"},onMouseLeave:function(Q){var Ie=document.getElementById("id_left_preview");Ie.style.overflowY="hidden"}},m.a.createElement("div",{className:T.a.title},m.a.createElement("div",null,m.a.createElement("b",null),m.a.createElement("span",null,"\u7B54\u9898\u5361"))),m.a.createElement("div",{className:T.a.total},m.a.createElement("div",null,m.a.createElement("img",{src:de.a}),m.a.createElement("span",null,"\u9898\u6570(\u9053)"),m.a.createElement("aside",null,Ce==null?void 0:Ce.all_questions_count)),m.a.createElement("div",{className:"mr30 ml30"},m.a.createElement("img",{src:g.a}),m.a.createElement("span",null,"\u603B\u5206(\u5206)"),m.a.createElement("aside",null,he)),m.a.createElement("div",null,m.a.createElement("img",{src:K.a}),m.a.createElement("span",null,"\u65F6\u957F(\u5206)"),m.a.createElement("aside",null,Ce==null||((b=Ce.exam)===null||b===void 0)?void 0:b.time))),Ce==null||((_=Ce.questionList)===null||_===void 0)?void 0:_.map(function(ae,Q){var Ie;return m.a.createElement("div",{className:T.a.list,key:Q},m.a.createElement("div",{className:T.a.name},m.a.createElement("b",null),m.a.createElement("span",null,ae.name)),m.a.createElement("aside",null,m.a.createElement("div",null,"\u5171",m.a.createElement("span",{className:T.a.b},ae.questions_count),"\u9898 ",m.a.createElement("span",{className:T.a.l},"|"),"\u5171",m.a.createElement("span",{className:T.a.r},ae.questions_score),"\u5206"),m.a.createElement("div",{className:T.a.answerSheet},ae==null||((Ie=ae.questions)===null||Ie===void 0)?void 0:Ie.map(function(ot,at){return m.a.createElement("div",{onClick:function(){var Ot="Anchor_".concat(ot.id),Qt=document.getElementById(Ot);Qt&&setTimeout(function(){return Qt.scrollIntoView({block:"center",behavior:"smooth"})})},key:ot.id,className:T.a.tag},at+1)}))))})),m.a.createElement("div",{className:T.a.right},m.a.createElement("div",{className:T.a.examName,id:"examName"},m.a.createElement("div",{className:T.a.name},m.a.createElement(fe.a,{title:Ce==null||((S=Ce.exam)===null||S===void 0)?void 0:S.name,getPopupContainer:function(Q){return Q.parentNode}},m.a.createElement("span",{className:T.a.t},Ce==null||((P=Ce.exam)===null||P===void 0)?void 0:P.name))),Xe?m.a.createElement(me.a,{showTotal:function(Q){return m.a.createElement("span",{style:{color:"#656F87",fontSize:14}},"\u5171\u8BA1",m.a.createElement("span",{className:"c-light-primary"},Q),"\u4EFD\u8BD5\u5377")},total:Ce==null||((re=Ce.exam)===null||re===void 0)?void 0:re.total_num,pageSize:1,current:kt+1,showSizeChanger:!1,onChange:a,showQuickJumper:!0,hideOnSinglePage:!1}):m.a.createElement(U.a,{onClick:o,type:"primary"},"\u968F\u673A\u66F4\u6362")),m.a.createElement("div",{className:T.a.topWarp},Ce==null||((pe=Ce.questionList)===null||pe===void 0)?void 0:pe.map(function(ae,Q){var Ie,ot;return m.a.createElement(m.a.Fragment,{key:Q},m.a.createElement("div",{className:T.a.head,style:Q===0?{border:0,marginTop:-16}:{}},m.a.createElement("div",{className:T.a.name},m.a.createElement("b",null),m.a.createElement("span",null,ae.name)),m.a.createElement("div",{className:T.a.so},"\u5171",m.a.createElement("span",{className:T.a.b},ae.questions_count," "),"\u9898 ",ae.type==="COMBINATION"&&"\uFF08\u5305\u542B".concat(ae==null||((Ie=ae.questions)===null||Ie===void 0)?void 0:Ie.map(function(at){var lt;return at==null||((lt=at.sub_item_banks)===null||lt===void 0)?void 0:lt.length}).reduce(function(at,lt){return at+lt}),"\u5C0F\u9898\uFF09"),m.a.createElement("span",{className:T.a.l},"|"),"\u5171",m.a.createElement("span",{className:T.a.r},ae.questions_score),"\u5206"),!Xe&&m.a.createElement("div",{className:T.a.btn},m.a.createElement(U.a,{onClick:function(){hn(ae)},type:"primary",ghost:!0,className:"mr20"},"\u8BBE\u7F6E\u5F97\u5206"),m.a.createElement(U.a,{onClick:function(){return h(ae)},type:"primary",ghost:!0},"\u968F\u673A\u66F4\u6362"))),ae==null||((ot=ae.questions)===null||ot===void 0)?void 0:ot.map(function(at,lt){return He===at.id?m.a.createElement("div",{id:"Anchor_".concat(at.id),className:T.a.content,style:{padding:0,marginTop:10},key:at.id},m.a.createElement("div",{style:{float:"right",marginTop:-6}},m.a.createElement(U.a,{onClick:function(){return dt(null)},className:"mr20",type:"primary",ghost:!0},"\u53D6\u6D88"),m.a.createElement(U.a,{onClick:function(){return V(ae==null?void 0:ae.type,at)},type:"primary"},"\u4FDD\u5B58")),c(at,ae.type)):m.a.createElement("div",{id:"Anchor_".concat(at.id),className:T.a.content,key:at.id},m.a.createElement("div",{className:T.a.titleWrap},m.a.createElement(G.a,{style:{paddingRight:10},className:T.a.titleHtml,value:lt+1+"\u3001"+"".concat((at==null?void 0:at.item_type)==="combination"?"\uFF08\u9898\u5E72\uFF09":"")+at.name}),Xe&&m.a.createElement(U.a,{disabled:wt,onClick:function(){if(He){H.b.warn("\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898");return}dt(at.id)},type:"primary",className:"mr20",style:{marginLeft:"auto"},ghost:!0},"\u7F16\u8F91"),m.a.createElement(U.a,{disabled:wt,onClick:function(){return En(at.id,ae.type,lt,ae)},type:"primary",ghost:!0},"\u6362\u4E00\u9898")),(ae.type==="SINGLE"||ae.type==="JUDGMENT"||ae.type==="MULTIPLE")&&Cn(at),ae.type==="COMPLETION"&&ai(at),ae.type==="SUBJECTIVE"&&ti(at),ae.type==="FILEUPLOAD"&&ti(at),ae.type==="PHOTOGRAPH"&&ti(at),ae.type==="PROGRAM"&&je(at),ae.type==="COMBINATION"&&et(at,lt),m.a.createElement("div",null))}))})),m.a.createElement("div",{className:T.a.btnsElse,id:"preview_btns_else"},Xe?p():u()),m.a.createElement("div",{className:T.a.btnsWrap,id:"preview_btns"},m.a.createElement("div",{className:T.a.btns},Xe?p():u()))))},ke=qe.a=ht},vHTk:function(it,qe,y){it.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wU8J:function(it,qe){function y(){this.buffer=new Array,this.length=0}y.prototype={get:function(B){var me=Math.floor(B/8);return(this.buffer[me]>>>7-B%8&1)==1},put:function(B,me){for(var Z=0;Z<me;Z++)this.putBit((B>>>me-Z-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(B){var me=Math.floor(this.length/8);this.buffer.length<=me&&this.buffer.push(0),B&&(this.buffer[me]|=128>>>this.length%8),this.length++}},it.exports=y}}]);