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__HttpStatus__HpcCourse.fe...

350 lines
612 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[154,6,7,17],{"+NIl":function(ot,Qe,k){(function(H){H(k("VrN/"))})(function(H){"use strict";H.defineMode("stex",function(se,ne){"use strict";function we(Q,U){Q.cmdState.push(U)}function fe(Q){return Q.cmdState.length>0?Q.cmdState[Q.cmdState.length-1]:null}function z(Q){var U=Q.cmdState.pop();U&&U.closeBracket()}function T(Q){for(var U=Q.cmdState,Z=U.length-1;Z>=0;Z--){var W=U[Z];if(W.name=="DEFAULT")continue;return W}return{styleIdentifier:function(){return null}}}function R(Q,U,Z){return function(){this.name=Q,this.bracketNo=0,this.style=U,this.styles=Z,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var B={};B.importmodule=R("importmodule","tag",["string","builtin"]),B.documentclass=R("documentclass","tag",["","atom"]),B.usepackage=R("usepackage","tag",["atom"]),B.begin=R("begin","tag",["atom"]),B.end=R("end","tag",["atom"]),B.label=R("label","tag",["atom"]),B.ref=R("ref","tag",["atom"]),B.eqref=R("eqref","tag",["atom"]),B.cite=R("cite","tag",["atom"]),B.bibitem=R("bibitem","tag",["atom"]),B.Bibitem=R("Bibitem","tag",["atom"]),B.RBibitem=R("RBibitem","tag",["atom"]),B.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function _(Q,U){Q.f=U}function L(Q,U){var Z;if(Q.match(/^\\[a-zA-Z@]+/)){var W=Q.current().slice(1);return Z=B.hasOwnProperty(W)?B[W]:B.DEFAULT,Z=new Z,we(U,Z),_(U,te),Z.style}if(Q.match(/^\\[$&%#{}_]/))return"tag";if(Q.match(/^\\[,;!\/\\]/))return"tag";if(Q.match("\\["))return _(U,function(ae,Ie){return E(ae,Ie,"\\]")}),"keyword";if(Q.match("\\("))return _(U,function(ae,Ie){return E(ae,Ie,"\\)")}),"keyword";if(Q.match("$$"))return _(U,function(ae,Ie){return E(ae,Ie,"$$")}),"keyword";if(Q.match("$"))return _(U,function(ae,Ie){return E(ae,Ie,"$")}),"keyword";var ce=Q.next();if(ce=="%")return Q.skipToEnd(),"comment";if(ce=="}"||ce=="]"){if(Z=fe(U),Z)Z.closeBracket(ce),_(U,te);else return"error";return"bracket"}else return ce=="{"||ce=="["?(Z=B.DEFAULT,Z=new Z,we(U,Z),"bracket"):/\d/.test(ce)?(Q.eatWhile(/[\w.%]/),"atom"):(Q.eatWhile(/[\w\-_]/),Z=T(U),Z.name=="begin"&&(Z.argument=Q.current()),Z.styleIdentifier())}function E(Q,U,Z){if(Q.eatSpace())return null;if(Z&&Q.match(Z))return _(U,L),"keyword";if(Q.match(/^\\[a-zA-Z@]+/))return"tag";if(Q.match(/^[a-zA-Z]+/))return"variable-2";if(Q.match(/^\\[$&%#{}_]/))return"tag";if(Q.match(/^\\[,;!\/]/))return"tag";if(Q.match(/^[\^_&]/))return"tag";if(Q.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(Q.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var W=Q.next();return W=="{"||W=="}"||W=="["||W=="]"||W=="("||W==")"?"bracket":W=="%"?(Q.skipToEnd(),"comment"):"error"}function te(Q,U){var Z=Q.peek(),W;return Z=="{"||Z=="["?(W=fe(U),W.openBracket(Z),Q.eat(Z),_(U,L),"bracket"):/[ \t\r]/.test(Z)?(Q.eat(Z),null):(_(U,L),z(U),L(Q,U))}return{startState:function(){var Q=ne.inMathMode?function(U,Z){return E(U,Z)}:L;return{cmdState:[],f:Q}},copyState:function(Q){return{cmdState:Q.cmdState.slice(),f:Q.f}},token:function(Q,U){return U.f(Q,U)},blankLine:function(Q){Q.f=L,Q.cmdState.length=0},lineComment:"%"}}),H.defineMIME("text/x-stex","stex"),H.defineMIME("text/x-latex","stex")})},"19Vz":function(ot,Qe,k){(function(H){H(k("VrN/"))})(function(H){H.defineOption("placeholder","",function(R,B,_){var L=_&&_!=H.Init;if(B&&!L)R.on("blur",fe),R.on("change",z),R.on("swapDoc",z),H.on(R.getInputField(),"compositionupdate",R.state.placeholderCompose=function(){we(R)}),z(R);else if(!B&&L){R.off("blur",fe),R.off("change",z),R.off("swapDoc",z),H.off(R.getInputField(),"compositionupdate",R.state.placeholderCompose),se(R);var E=R.getWrapperElement();E.className=E.className.replace(" CodeMirror-empty","")}B&&!R.hasFocus()&&fe(R)});function se(R){R.state.placeholder&&(R.state.placeholder.parentNode.removeChild(R.state.placeholder),R.state.placeholder=null)}function ne(R){se(R);var B=R.state.placeholder=document.createElement("pre");B.style.cssText="height: 0; overflow: visible",B.style.direction=R.getOption("direction"),B.className="CodeMirror-placeholder CodeMirror-line-like";var _=R.getOption("placeholder");typeof _=="string"&&(_=document.createTextNode(_)),B.appendChild(_),R.display.lineSpace.insertBefore(B,R.display.lineSpace.firstChild)}function we(R){setTimeout(function(){var B=!1,_=R.getInputField();_.nodeName=="TEXTAREA"?B=!_.value:R.lineCount()==1&&(B=!/[^\u200b]/.test(_.querySelector(".CodeMirror-line").textContent)),B?ne(R):se(R)},20)}function fe(R){T(R)&&ne(R)}function z(R){var B=R.getWrapperElement(),_=T(R);B.className=B.className.replace(" CodeMirror-empty","")+(_?" CodeMirror-empty":""),_?ne(R):se(R)}function T(R){return R.lineCount()===1&&R.getLine(0)===""}})},"1eCo":function(ot,Qe,k){(function(H){H(k("VrN/"))})(function(H){"use strict";var se={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},ne={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};H.defineMode("xml",function(we,fe){var z=we.indentUnit,T={},R=fe.htmlMode?se:ne;for(var B in R)T[B]=R[B];for(var B in fe)T[B]=fe[B];var _,L;function E(M,de){function ie(P){return de.tokenize=P,P(M,de)}var w=M.next();if(w=="<")return M.eat("!")?M.eat("[")?M.match("CDATA[")?ie(U("atom","]]>")):null:M.match("--")?ie(U("comment","-->")):M.match("DOCTYPE",!0,!0)?(M.eatWhile(/[\w\._\-]/),ie(Z(1))):null:M.eat("?")?(M.eatWhile(/[\w\._\-]/),de.tokenize=U("meta","?>"),"meta"):(_=M.eat("/")?"closeTag":"openTag",de.tokenize=te,"tag bracket");if(w=="&"){var j;return M.eat("#")?M.eat("x")?j=M.eatWhile(/[a-fA-F\d]/)&&M.eat(";"):j=M.eatWhile(/[\d]/)&&M.eat(";"):j=M.eatWhile(/[\w\.\-:]/)&&M.eat(";"),j?"atom":"error"}else return M.eatWhile(/[^&<]/),null}E.isInText=!0;function te(M,de){var ie=M.next();if(ie==">"||ie=="/"&&M.eat(">"))return de.tokenize=E,_=ie==">"?"endTag":"selfcloseTag","tag bracket";if(ie=="=")return _="equals",null;if(ie=="<"){de.tokenize=E,de.state=Ie,de.tagName=de.tagStart=null;var w=de.tokenize(M,de);return w?w+" tag error":"tag error"}else return/[\'\"]/.test(ie)?(de.tokenize=Q(ie),de.stringStartCol=M.column(),de.tokenize(M,de)):(M.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Q(M){var de=function(ie,w){for(;!ie.eol();)if(ie.next()==M){w.tokenize=te;break}return"string"};return de.isInAttribute=!0,de}function U(M,de){return function(ie,w){for(;!ie.eol();){if(ie.match(de)){w.tokenize=E;break}ie.next()}return M}}function Z(M){return function(de,ie){for(var w;(w=de.next())!=null;){if(w=="<")return ie.tokenize=Z(M+1),ie.tokenize(de,ie);if(w==">")if(M==1){ie.tokenize=E;break}else return ie.tokenize=Z(M-1),ie.tokenize(de,ie)}return"meta"}}function W(M,de,ie){this.prev=M.context,this.tagName=de,this.indent=M.indented,this.startOfLine=ie,(T.doNotIndent.hasOwnProperty(de)||M.context&&M.context.noIndent)&&(this.noIndent=!0)}function ce(M){M.context&&(M.context=M.context.prev)}function ae(M,de){for(var ie;;){if(!M.context)return;if(ie=M.context.tagName,!T.contextGrabbers.hasOwnProperty(ie)||!T.contextGrabbers[ie].hasOwnProperty(de))return;ce(M)}}function Ie(M,de,ie){return M=="openTag"?(ie.tagStart=de.column(),$e):M=="closeTag"?Se:Ie}function $e(M,de,ie){return M=="word"?(ie.tagName=de.current(),L="tag",ke):T.allowMissingTagName&&M=="endTag"?(L="tag bracket",ke(M,de,ie)):(L="error",$e)}function Se(M,de,ie){if(M=="word"){var w=de.current();return ie.context&&ie.context.tagName!=w&&T.implicitlyClosed.hasOwnProperty(ie.context.tagName)&&ce(ie),ie.context&&ie.context.tagName==w||T.matchClosing===!1?(L="tag",De):(L="tag error",Ve)}else return T.allowMissingTagName&&M=="endTag"?(L="tag bracket",De(M,de,ie)):(L="error",Ve)}function De(M,de,ie){return M!="endTag"?(L="error",De):(ce(ie),Ie)}function Ve(M,de,ie){return L="error",De(M,de,ie)}function ke(M,de,ie){if(M=="word")return L="attribute",Te;if(M=="endTag"||M=="selfcloseTag"){var w=ie.tagName,j=ie.tagStart;return ie.tagName=ie.tagStart=null,M=="selfcloseTag"||T.autoSelfClosers.hasOwnProperty(w)?ae(ie,w):(ae(ie,w),ie.context=new W(ie,w,j==ie.indented)),Ie}return L="error",ke}function Te(M,de,ie){return M=="equals"?Pe:(T.allowMissing||(L="error"),ke(M,de,ie))}function Pe(M,de,ie){return M=="string"?ye:M=="word"&&T.allowUnquoted?(L="string",ke):(L="error",ke(M,de,ie))}function ye(M,de,ie){return M=="string"?ye:ke(M,de,ie)}return{startState:function(M){var de={tokenize:E,state:Ie,indented:M||0,tagName:null,tagStart:null,context:null};return M!=null&&(de.baseIndent=M),de},token:function(M,de){if(!de.tagName&&M.sol()&&(de.indented=M.indentation()),M.eatSpace())return null;_=null;var ie=de.tokenize(M,de);return(ie||_)&&ie!="comment"&&(L=null,de.state=de.state(_||ie,M,de),L&&(ie=L=="error"?ie+" error":L)),ie},indent:function(M,de,ie){var w=M.context;if(M.tokenize.isInAttribute)return M.tagStart==M.indented?M.stringStartCol+1:M.indented+z;if(w&&w.noIndent)return H.Pass;if(M.tokenize!=te&&M.tokenize!=E)return ie?ie.match(/^(\s*)/)[0].length:0;if(M.tagName)return T.multilineTagIndentPastTag!==!1?M.tagStart+M.tagName.length+2:M.tagStart+z*(T.multilineTagIndentFactor||1);if(T.alignCDATA&&/<!\[CDATA\[/.test(de))return 0;var j=de&&/^<(\/)?([\w_:\.-]*)/.exec(de);if(j&&j[1])for(;w;)if(w.tagName==j[2]){w=w.prev;break}else if(T.implicitlyClosed.hasOwnProperty(w.tagName))w=w.prev;else break;else if(j)for(;w;){var P=T.contextGrabbers[w.tagName];if(P&&P.hasOwnProperty(j[2]))w=w.prev;else break}for(;w&&w.prev&&!w.startOfLine;)w=w.prev;return w?w.indent+z:M.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:T.htmlMode?"html":"xml",helperType:T.htmlMode?"html":"xml",skipAttribute:function(M){M.state==Pe&&(M.state=ke)},xmlCurrentTag:function(M){return M.tagName?{name:M.tagName,close:M.type=="closeTag"}:null},xmlCurrentContext:function(M){for(var de=[],ie=M.context;ie;ie=ie.prev)ie.tagName&&de.push(ie.tagName);return de.reverse()}}}),H.defineMIME("text/xml","xml"),H.defineMIME("application/xml","xml"),H.mimeModes.hasOwnProperty("text/html")||H.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"7Cbv":function(ot,Qe,k){"use strict";var H=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),se=new Uint8Array(16);function ne(){if(!H)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return H(se)}var we=/^(?:[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 fe(te){return typeof te=="string"&&we.test(te)}for(var z=fe,T=[],R=0;R<256;++R)T.push((R+256).toString(16).substr(1));function B(te){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,U=(T[te[Q+0]]+T[te[Q+1]]+T[te[Q+2]]+T[te[Q+3]]+"-"+T[te[Q+4]]+T[te[Q+5]]+"-"+T[te[Q+6]]+T[te[Q+7]]+"-"+T[te[Q+8]]+T[te[Q+9]]+"-"+T[te[Q+10]]+T[te[Q+11]]+T[te[Q+12]]+T[te[Q+13]]+T[te[Q+14]]+T[te[Q+15]]).toLowerCase();if(!z(U))throw TypeError("Stringified UUID is invalid");return U}var _=B;function L(te,Q,U){te=te||{};var Z=te.random||(te.rng||ne)();if(Z[6]=Z[6]&15|64,Z[8]=Z[8]&63|128,Q){U=U||0;for(var W=0;W<16;++W)Q[U+W]=Z[W];return Q}return _(Z)}var E=Qe.a=L},"7ahc":function(ot,Qe,k){"use strict";k.d(Qe,"a",function(){return $e});var H=k("k1fw"),se=k("0Owb"),ne=k("+L6B"),we=k("2/Rp"),fe=k("y8nQ"),z=k("Vl3Y"),T=k("tJVT"),R=k("OaEy"),B=k("2fM7"),_=k("q1tI"),L=k.n(_),E=k("VrN/"),te=k.n(E),Q=k("p77/"),U=k.n(Q),Z=k("c5Ni"),W=k.n(Z),ce=B.a.Option,ae={labelCol:{span:4},wrapperCol:{span:20}},Ie={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(Se){var De=Se.callback,Ve=Se.onCancel,ke=Object(_.useState)("python"),Te=Object(T.a)(ke,2),Pe=Te[0],ye=Te[1];function M(ie){ye(Ie[ie][1])}function de(ie){De(ie)}return L.a.createElement(z.a,Object(se.a)({},ae,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:de}),L.a.createElement(z.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},L.a.createElement(B.a,{onChange:M},Object.keys(Ie).map(function(ie){return L.a.createElement(ce,{key:ie,value:ie},Ie[ie][0])}))),L.a.createElement(z.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},L.a.createElement($e,{mode:Pe})),L.a.createElement("div",{className:"flex-container flex-end"},L.a.createElement(we.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),L.a.createElement(we.a,{type:"ghost",onClick:Ve},"\u53D6\u6D88")))};function $e(Se){var De=Se.value,Ve=Se.onChange,ke=Se.mode,Te=Se.options,Pe=Te===void 0?{}:Te,ye=Object(_.useRef)(),M=Object(_.useState)(),de=Object(T.a)(M,2),ie=de[0],w=de[1];return Object(_.useEffect)(function(){if(ie){function j(P){var S=P.getValue();Ve&&Ve(S)}return ie.on("change",j),function(){ie.off("change",j)}}},[ie,Ve]),Object(_.useEffect)(function(){ie&&ie.setOption("mode",ke)},[ie,ke]),Object(_.useEffect)(function(){ie&&((De!==ie.getValue()||De==="")&&setTimeout(function(){ie.setValue(De||" ")},300))},[ie,De]),Object(_.useEffect)(function(){if(ye.current&&!ie){var j=te.a.fromTextArea(ye.current,Object(H.a)({mode:ke,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Pe));w(j)}},[ye.current,ie]),L.a.createElement("div",{className:"my-codemirror-container"},L.a.createElement("textarea",{ref:ye}))}},"7ixt":function(ot,Qe,k){"use strict";k.d(Qe,"a",function(){return ne});var H={adjustX:1,adjustY:1},se=[0,0],ne={left:{points:["cr","cl"],overflow:H,offset:[-4,0],targetOffset:se},right:{points:["cl","cr"],overflow:H,offset:[4,0],targetOffset:se},top:{points:["bc","tc"],overflow:H,offset:[0,-4],targetOffset:se},bottom:{points:["tc","bc"],overflow:H,offset:[0,4],targetOffset:se},topLeft:{points:["bl","tl"],overflow:H,offset:[0,-4],targetOffset:se},leftTop:{points:["tr","tl"],overflow:H,offset:[-4,0],targetOffset:se},topRight:{points:["br","tr"],overflow:H,offset:[0,-4],targetOffset:se},rightTop:{points:["tl","tr"],overflow:H,offset:[4,0],targetOffset:se},bottomRight:{points:["tr","br"],overflow:H,offset:[0,4],targetOffset:se},rightBottom:{points:["bl","br"],overflow:H,offset:[4,0],targetOffset:se},bottomLeft:{points:["tl","bl"],overflow:H,offset:[0,4],targetOffset:se},leftBottom:{points:["br","bl"],overflow:H,offset:[-4,0],targetOffset:se}},we=ne},"8EBN":function(ot,Qe,k){(function(H){H(k("VrN/"))})(function(H){"use strict";H.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 se=0;se<H.modeInfo.length;se++){var ne=H.modeInfo[se];ne.mimes&&(ne.mime=ne.mimes[0])}H.findModeByMIME=function(we){we=we.toLowerCase();for(var fe=0;fe<H.modeInfo.length;fe++){var z=H.modeInfo[fe];if(z.mime==we)return z;if(z.mimes){for(var T=0;T<z.mimes.length;T++)if(z.mimes[T]==we)return z}}if(/\+xml$/.test(we))return H.findModeByMIME("application/xml");if(/\+json$/.test(we))return H.findModeByMIME("application/json")},H.findModeByExtension=function(we){we=we.toLowerCase();for(var fe=0;fe<H.modeInfo.length;fe++){var z=H.modeInfo[fe];if(z.ext){for(var T=0;T<z.ext.length;T++)if(z.ext[T]==we)return z}}},H.findModeByFileName=function(we){for(var fe=0;fe<H.modeInfo.length;fe++){var z=H.modeInfo[fe];if(z.file&&z.file.test(we))return z}var T=we.lastIndexOf("."),R=T>-1&&we.substring(T+1,we.length);if(R)return H.findModeByExtension(R)},H.findModeByName=function(we){we=we.toLowerCase();for(var fe=0;fe<H.modeInfo.length;fe++){var z=H.modeInfo[fe];if(z.name.toLowerCase()==we)return z;if(z.alias){for(var T=0;T<z.alias.length;T++)if(z.alias[T].toLowerCase()==we)return z}}}})},"8hTe":function(ot,Qe,k){ot.exports={button:"button___1wy9m"}},"9Bee":function(ot,Qe,k){"use strict";var H=k("DYRE"),se=k("zeV3"),ne=k("+L6B"),we=k("2/Rp"),fe=k("k1fw"),z=k("9og8"),T=k("tJVT"),R=k("WmNS"),B=k.n(R),_=k("q1tI"),L=k.n(_),E=k("vg9a"),te=k("DlQD"),Q=k.n(te),U=k("rUJ1");function Z(c,o){var a=c.match(/^(\s+)(?:```)/);if(a===null)return o;var u=a[1];return o.split(`
`).map(function(m){var h=m.match(/^\s+/);if(h===null)return m;var K=Object(T.a)(h,1),Ne=K[0];return Ne.length>=u.length?m.slice(u.length):m}).join(`
`)}var W=[],ce=["<ul>"],ae=new Q.a.Renderer,Ie=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function $e(){W.length=0,ce=["<ul>"]}var Se={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function De(c,o,a,u){if(o>=c.length||c[o].level<=a)return o;var m=c[o];u.push("<li><a href='#"+m.anchor+"'>"+m.text+"</a>"),o++;var h=[];return o=De(c,o,m.level,h),h.length>0&&(u.push("<ul>"),h.forEach(function(K){u.push(K)}),u.push("</ul>")),u.push("</li>"),o=De(c,o,a,u),o}function Ve(){return De(W,0,0,ce),ce.push("</ul>"),ce.join("")}var ke={heading:function(o){var a=Ie.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],m=Z(u,a[3]||""),h=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(h)>=0){var K=ye(),Ne=m;m=K,M[K]={type:"block",expression:Ne}}return{type:"code",raw:u,lang:h,text:m}}}},Te=/(?:\${2})([^\n`]+?)(?:\${2})/gi,Pe=0,ye=function(){return"__special_katext_id_".concat(Pe++,"__")},M={};function de(){return M}function ie(){Pe=0,M={}}function w(c){return c=c.replace(Te,function(o,a){var u=ye();return M[u]={type:"inline",expression:a},u}),c}var j=ae.listitem;ae.listitem=function(c){return j(w(c))};var P=ae.paragraph;ae.paragraph=function(c){return P(w(c))};var S=ae.tablecell;ae.tablecell=function(c,o){return S(w(c),o)},ae.code=function(c,o,a){var u=(o||"").match(/\S*/)[0];return u?["latex","katex","math"].indexOf(u)>=0?"<p class='editormd-tex'>".concat(c,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(o,'">').concat(a?c:Object(U.escape)(c,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(a?c:Object(U.escape)(c,!0))+"</code></pre>"},ae.heading=function(c,o,a){var u=this.options.headerPrefix+a.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return W.push({anchor:u,level:o,text:c}),"<h"+o+' id="'+u+'">'+c+"</h"+o+">"},Q.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),Q.a.use({tokenizer:ke,renderer:ae});var D=Q.a,p=k("SJMd"),d=k("ulZh"),C=k.n(d),F=k("m3rI"),J=k("Oy/b"),xe=k("p5ED"),Me=k("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 ge=function(c,o){return(ge=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var m in u)Object.prototype.hasOwnProperty.call(u,m)&&(a[m]=u[m])})(c,o)};function ve(c,o){function a(){this.constructor=c}ge(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function me(c,o,a,u){return new(a||(a=Promise))(function(m,h){function K(ht){try{pe(u.next(ht))}catch(Be){h(Be)}}function Ne(ht){try{pe(u.throw(ht))}catch(Be){h(Be)}}function pe(ht){var Be;ht.done?m(ht.value):(Be=ht.value,Be instanceof a?Be:new a(function(Et){Et(Be)})).then(K,Ne)}pe((u=u.apply(c,o||[])).next())})}function ue(c,o){var a,u,m,h,K={label:0,sent:function(){if(1&m[0])throw m[1];return m[1]},trys:[],ops:[]};return h={next:Ne(0),throw:Ne(1),return:Ne(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function Ne(pe){return function(ht){return function(Be){if(a)throw new TypeError("Generator is already executing.");for(;K;)try{if(a=1,u&&(m=2&Be[0]?u.return:Be[0]?u.throw||((m=u.return)&&m.call(u),0):u.next)&&!(m=m.call(u,Be[1])).done)return m;switch(u=0,m&&(Be=[2&Be[0],m.value]),Be[0]){case 0:case 1:m=Be;break;case 4:return K.label++,{value:Be[1],done:!1};case 5:K.label++,u=Be[1],Be=[0];continue;case 7:Be=K.ops.pop(),K.trys.pop();continue;default:if(!(m=K.trys,(m=m.length>0&&m[m.length-1])||Be[0]!==6&&Be[0]!==2)){K=0;continue}if(Be[0]===3&&(!m||Be[1]>m[0]&&Be[1]<m[3])){K.label=Be[1];break}if(Be[0]===6&&K.label<m[1]){K.label=m[1],m=Be;break}if(m&&K.label<m[2]){K.label=m[2],K.ops.push(Be);break}m[2]&&K.ops.pop(),K.trys.pop();continue}Be=o.call(c,K)}catch(Et){Be=[6,Et],u=0}finally{a=m=0}if(5&Be[0])throw Be[1];return{value:Be[0]?Be[1]:void 0,done:!0}}([pe,ht])}}}function q(){for(var c=0,o=0,a=arguments.length;o<a;o++)c+=arguments[o].length;var u=Array(c),m=0;for(o=0;o<a;o++)for(var h=arguments[o],K=0,Ne=h.length;K<Ne;K++,m++)u[m]=h[K];return u}var G=function(){function c(){}return c.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},c.setAttributes=function(o,a){for(var u=0,m=a;u<m.length;u++){var h=m[u],K=h[0],Ne=h[1];o.setAttribute(K,Ne)}},c.createRect=function(o,a,u){var m=document.createElementNS("http://www.w3.org/2000/svg","rect");return m.setAttribute("width",o.toString()),m.setAttribute("height",a.toString()),u&&c.setAttributes(m,u),m},c.createLine=function(o,a,u,m,h){var K=document.createElementNS("http://www.w3.org/2000/svg","line");return K.setAttribute("x1",o.toString()),K.setAttribute("y1",a.toString()),K.setAttribute("x2",u.toString()),K.setAttribute("y2",m.toString()),h&&c.setAttributes(K,h),K},c.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&c.setAttributes(u,a),u},c.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&&c.setAttributes(u,a),u},c.createEllipse=function(o,a,u){var m=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return m.setAttribute("cx",(o/2).toString()),m.setAttribute("cy",(a/2).toString()),m.setAttribute("rx",(o/2).toString()),m.setAttribute("ry",(a/2).toString()),u&&c.setAttributes(m,u),m},c.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&c.setAttributes(a,o),a},c.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},c.createMarker=function(o,a,u,m,h,K,Ne){var pe=document.createElementNS("http://www.w3.org/2000/svg","marker");return c.setAttributes(pe,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",m.toString()],["refX",h.toString()],["refY",K.toString()]]),pe.appendChild(Ne),pe},c.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&c.setAttributes(a,o),a},c.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&c.setAttributes(u,a),u},c.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&c.setAttributes(a,o),a},c.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},c.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&c.setAttributes(u,a),u},c}(),b=function(){function c(){}return c.addKey=function(o){c.key=o},Object.defineProperty(c,"isLicensed",{get:function(){return!!c.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(c.key)},enumerable:!1,configurable:!0}),c}(),X=function(){function c(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return c.prototype.rasterize=function(o,a,u){var m=this;return new Promise(function(h){var K=u!==void 0?u:document.createElement("canvas");o===null&&(m.markersOnly=!0,m.naturalSize=!1);var Ne=document.createElementNS("http://www.w3.org/2000/svg","svg");Ne.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ne.setAttribute("width",a.width.baseVal.valueAsString),Ne.setAttribute("height",a.height.baseVal.valueAsString),Ne.setAttribute("viewBox","0 0 "+a.viewBox.baseVal.width.toString()+" "+a.viewBox.baseVal.height.toString()),Ne.innerHTML=a.innerHTML,m.naturalSize===!0?(Ne.width.baseVal.value=o.naturalWidth,Ne.height.baseVal.value=o.naturalHeight):m.width!==void 0&&m.height!==void 0&&(Ne.width.baseVal.value=m.width,Ne.height.baseVal.value=m.height),K.width=Ne.width.baseVal.value,K.height=Ne.height.baseVal.value;var pe=Ne.outerHTML,ht=K.getContext("2d");m.markersOnly!==!0&&ht.drawImage(o,0,0,K.width,K.height);var Be=window.URL,Et=new Image(K.width,K.height);Et.setAttribute("crossOrigin","anonymous");var It=new Blob([pe],{type:"image/svg+xml"}),zt=Be.createObjectURL(It);Et.onload=function(){ht.drawImage(Et,0,0),Be.revokeObjectURL(zt);var Fn=K.toDataURL(m.imageType,m.imageQuality);h(Fn)},Et.src=zt})},c}(),O=function(){},be=function(){function c(o){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(c.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(c.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(c.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),c.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},c.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)},c.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 Ee("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ee("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Ee("@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;
`))},c.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},c}(),Ee=function(c,o){this.selector=c,this.style=o},re=function(c,o){this.localName=c,this.style=o},_e=function(){function c(o,a,u,m,h){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=o,this.displayMode=a,this.markerItems=u,this.uiStyleSettings=m,this.styles=h,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return c.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(h){var K=document.createElement("div");K.className=""+a.toolbarButtonStyleClass.name,K.setAttribute("data-type-name",h.typeName),K.innerHTML=h.icon,K.addEventListener("click",function(){a.markerToolbarButtonClicked(K,h)}),a.buttons.push(K),a.markerButtons.push(K)}),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 m=document.createElement("div");m.className=this.toolbarBlockStyleClass.name,m.style.whiteSpace="nowrap",m.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(m),this.addActionButton(m,'<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(m,'<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()},c.prototype.addButtonClickListener=function(o){this.buttonClickListeners.push(o)},c.prototype.removeButtonClickListener=function(o){this.buttonClickListeners.indexOf(o)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(o),1)},c.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},c.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]))}},c.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")},c.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)})},c.prototype.addActionButton=function(o,a,u){var m=this,h=document.createElement("div");switch(h.className=""+this.toolbarButtonStyleClass.name,h.innerHTML=a,h.setAttribute("data-action",u),h.addEventListener("click",function(){m.actionToolbarButtonClicked(h,u)}),u){case"select":h.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":h.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":h.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":h.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":h.style.fill=this.uiStyleSettings.closeButtonColor}o.appendChild(h),this.buttons.push(h)},c.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 Ee("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Ee("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},c.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"},c.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])},c.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)},c.prototype.setActiveMarkerButton=function(o){var a=this.markerButtons.find(function(u){return u.getAttribute("data-type-name")===o});a&&this.setActiveButton(a)},c.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")})},c}(),Ue=function(){function c(o,a,u,m){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=a,this.uiStyleSettings=u,this.styles=m,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return c.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 Ee("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ee("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},c.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)},c.prototype.setPanelButtons=function(o){var a,u,m=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(h){var K;h.uiStyleSettings=m.uiStyleSettings;var Ne=document.createElement("div");Ne.className=m.toolboxButtonStyleClass.name+" "+((K=m.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&K!==void 0?K:m.toolboxButtonStyleColorsClass.name),Ne.innerHTML=h.icon,Ne.title=h.title,Ne.addEventListener("click",function(){m.panelButtonClick(h)}),m.panelButtons.push(Ne),m.buttonRow.appendChild(Ne)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},c.prototype.panelButtonClick=function(o){var a=this,u=-1;if(o!==this.activePanel){u=this.panels.indexOf(o),this.panelRow.innerHTML="";var m=o.getUi();m.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(m),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(h,K){var Ne,pe;h.className=a.toolboxButtonStyleClass.name+" "+(K===u?""+((Ne=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ne!==void 0?Ne:a.toolboxActiveButtonStyleColorsClass.name):""+((pe=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&pe!==void 0?pe:a.toolboxButtonStyleColorsClass.name))})},c}(),Ke=function(c,o){this.title=c,this.icon=o},He=function(c){function o(a,u,m,h){var K=c.call(this,a,h||'<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 K.colors=[],K.addTransparent=!1,K.colorBoxes=[],K.colors=u,K.currentColor=m,K.setCurrentColor=K.setCurrentColor.bind(K),K.getColorBox=K.getColorBox.bind(K),K}return ve(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.whiteSpace="nowrap",this.colors.forEach(function(m){var h=a.getColorBox(m);u.appendChild(h),a.colorBoxes.push(h)}),u},o.prototype.getColorBox=function(a){var u=this,m=this.uiStyleSettings.toolbarHeight/4,h=this.uiStyleSettings.toolbarHeight-m,K=document.createElement("div");K.style.display="inline-block",K.style.boxSizing="content-box",K.style.width=h-2+"px",K.style.height=h-2+"px",K.style.padding="1px",K.style.marginRight="2px",K.style.marginBottom="2px",K.style.borderWidth="2px",K.style.borderStyle="solid",K.style.borderRadius=(h+2)/2+"px",K.style.borderColor=a===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",K.addEventListener("click",function(){u.setCurrentColor(a,K)});var Ne=document.createElement("div");return Ne.style.display="inline-block",Ne.style.width=h-2+"px",Ne.style.height=h-2+"px",Ne.style.backgroundColor=a,Ne.style.borderRadius=h/2+"px",a==="transparent"&&(Ne.style.fill=this.uiStyleSettings.toolboxAccentColor,Ne.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>`),K.appendChild(Ne),K},o.prototype.setCurrentColor=function(a,u){var m=this;this.currentColor=a,this.colorBoxes.forEach(function(h){h.style.borderColor=h===u?m.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(a)},o}(Ke),je=function(){function c(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(c.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),c.prototype.ownsTarget=function(o){return!1},Object.defineProperty(c.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),c.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},c.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},c.prototype.pointerDown=function(o,a){},c.prototype.dblClick=function(o,a){},c.prototype.manipulate=function(o){},c.prototype.pointerUp=function(o){this.stateChanged()},c.prototype.dispose=function(){},c.prototype.addMarkerVisualToContainer=function(o){this.container.childNodes.length>0?this.container.insertBefore(o,this.container.childNodes[0]):this.container.appendChild(o)},c.prototype.getState=function(){return{typeName:c.typeName,state:this.state,notes:this.notes}},c.prototype.restoreState=function(o){this._state=o.state,this.notes=o.notes},c.prototype.scale=function(o,a){},c.prototype.colorChanged=function(o){this.onColorChanged&&this.onColorChanged(o),this.stateChanged()},c.prototype.fillColorChanged=function(o){this.onFillColorChanged&&this.onFillColorChanged(o),this.stateChanged()},c.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)}},c.typeName="MarkerBase",c}(),Xe=function(){function c(){this.findGripByVisual=this.findGripByVisual.bind(this)}return c.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},c}(),mt=function(){function c(){this.GRIP_SIZE=10,this.visual=G.createGroup(),this.visual.appendChild(G.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(G.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return c.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},c}(),tt=function(){function c(){}return c.toITransformMatrix=function(o){return{a:o.a,b:o.b,c:o.c,d:o.d,e:o.e,f:o.f}},c.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},c}(),it=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||this;return h.left=0,h.top=0,h.width=0,h.height=0,h.defaultSize={x:50,y:20},h.offsetX=0,h.offsetY=0,h.rotationAngle=0,h.CB_DISTANCE=10,h._suppressMarkerCreateEvent=!1,h.container.transform.baseVal.appendItem(G.createTransform()),h.setupControlBox(),h}return ve(o,c),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=G.createTransform();this._visual.transform.baseVal.appendItem(u)},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!!c.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){c.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 m=this.unrotatePoint(a);if(this.manipulationStartX=m.x,this.manipulationStartY=m.y,this.offsetX=m.x-this.left,this.offsetY=m.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 h=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=h.x-this.width/2,this.top=h.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var K=this.container.transform.baseVal.getItem(0);K.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(K,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},o.prototype.pointerUp=function(a){var u=this.state;c.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,m=this.manipulationStartWidth,h=this.manipulationStartTop,K=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:u=this.manipulationStartLeft+a.x-this.manipulationStartX,m=this.manipulationStartWidth+this.manipulationStartLeft-u;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:m=this.manipulationStartWidth+a.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:h=this.manipulationStartTop+a.y-this.manipulationStartY,K=this.manipulationStartHeight+this.manipulationStartTop-h;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:K=this.manipulationStartHeight+a.y-this.manipulationStartY}m>=0?(this.left=u,this.width=m):(this.left=u+m,this.width=-m),K>=0?(this.top=h,this.height=K):(this.top=h+K,this.height=-K),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(),m=G.createPoint(a.x,a.y);return{x:(m=m.matrixTransform(u)).x,y:m.y}},o.prototype.unrotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM();u=u.inverse();var m=G.createPoint(a.x,a.y);return{x:(m=m.matrixTransform(u)).x,y:m.y}},o.prototype.select=function(){c.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){c.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=G.createGroup();var a=G.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=G.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=G.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 Xe,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 mt;return a.visual.transform.baseVal.appendItem(G.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.controlGrips.topLeft.GRIP_SIZE,u=-a/2,m=u,h=(this.width+this.CB_DISTANCE)/2-a/2,K=(this.height+this.CB_DISTANCE)/2-a/2,Ne=this.height+this.CB_DISTANCE-a/2,pe=this.width+this.CB_DISTANCE-a/2;this.positionGrip(this.controlGrips.topLeft.visual,u,m),this.positionGrip(this.controlGrips.topCenter.visual,h,m),this.positionGrip(this.controlGrips.topRight.visual,pe,m),this.positionGrip(this.controlGrips.centerLeft.visual,u,K),this.positionGrip(this.controlGrips.centerRight.visual,pe,K),this.positionGrip(this.controlGrips.bottomLeft.visual,u,Ne),this.positionGrip(this.controlGrips.bottomCenter.visual,h,Ne),this.positionGrip(this.controlGrips.bottomRight.visual,pe,Ne),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,h,m-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(a,u,m){var h=a.transform.baseVal.getItem(0);h.setTranslate(u,m),a.transform.baseVal.replaceItem(h,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:tt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:tt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},c.prototype.getState.call(this))},o.prototype.restoreState=function(a){c.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(tt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(tt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u);var m=this.rotatePoint({x:this.left,y:this.top}),h=this.unrotatePoint({x:m.x*a,y:m.y*u});this.left=h.x,this.top=h.y,this.width=this.width*a,this.height=this.height*u,this.adjustControlBox()},o}(je),et=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||this;return h.fillColor="transparent",h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.opacity=1,h.setStrokeColor=h.setStrokeColor.bind(h),h.setFillColor=h.setFillColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.createVisual=h.createVisual.bind(h),h}return ve(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=G.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){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){c.prototype.setSize.call(this),G.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){c.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&G.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&G.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&G.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&G.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},c.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(),c.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.setSize()},o.title="Rectangle marker",o}(it),gt=function(c){function o(a,u,m,h){var K=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return K.widths=[],K.widthBoxes=[],K.widths=u,K.currentWidth=m,K.setCurrentWidth=K.setCurrentWidth.bind(K),K}return ve(o,c),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(m){var h=document.createElement("div");h.style.display="flex",h.style.flexGrow="2",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.borderColor=m===a.currentWidth?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentWidth(m,h)}),u.appendChild(h);var K=document.createElement("div");K.innerText=m.toString(),K.style.marginRight="5px",h.appendChild(K);var Ne=document.createElement("div");Ne.style.minHeight="20px",Ne.style.flexGrow="2",Ne.style.display="flex",Ne.style.alignItems="center";var pe=document.createElement("hr");pe.style.minWidth="20px",pe.style.border="0px",pe.style.borderTop=m+"px solid "+a.uiStyleSettings.toolboxColor,pe.style.flexGrow="2",Ne.appendChild(pe),h.appendChild(Ne),a.widthBoxes.push(h)}),u},o.prototype.setCurrentWidth=function(a,u){var m=this;this.currentWidth=a,this.widthBoxes.forEach(function(h){h.style.borderColor=h===u?m.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(Ke),lt=function(c){function o(a,u,m,h){var K=c.call(this,a,h||'<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 K.styles=[],K.styleBoxes=[],K.styles=u,K.currentStyle=m,K.setCurrentStyle=K.setCurrentStyle.bind(K),K}return ve(o,c),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(m){var h=document.createElement("div");h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.overflow="hidden",h.style.maxWidth=100/a.styles.length-5+"%",h.style.borderColor=m===a.currentStyle?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentStyle(m,h)}),u.appendChild(h);var K=document.createElement("div");K.style.minHeight="20px",K.style.flexGrow="2",K.style.overflow="hidden";var Ne=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+a.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(m!==""?'stroke-dasharray="'+m+'"':"")+` />
</svg>`;K.innerHTML=Ne,h.appendChild(K),a.styleBoxes.push(h)}),u},o.prototype.setCurrentStyle=function(a,u){var m=this;this.currentStyle=a,this.styleBoxes.forEach(function(h){h.style.borderColor=h===u?m.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(Ke),at=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||this;return h.strokeColor=m.defaultColor,h.strokeWidth=m.defaultStrokeWidth,h.strokeDasharray=m.defaultStrokeDasharray,h.strokePanel=new He("Line color",m.defaultColorSet,m.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new gt("Line width",m.defaultStrokeWidths,m.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new lt("Line style",m.defaultStrokeDasharrays,m.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return ve(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.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}(et),Le=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},vt=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||this;return h.x1=0,h.y1=0,h.x2=0,h.y2=0,h.defaultLength=50,h.manipulationStartX=0,h.manipulationStartY=0,h.manipulationStartX1=0,h.manipulationStartY1=0,h.manipulationStartX2=0,h.manipulationStartY2=0,h.setupControlBox(),h}return ve(o,c),o.prototype.ownsTarget=function(a){return!!c.prototype.ownsTarget.call(this,a)||!(!this.grip1.ownsTarget(a)&&!this.grip2.ownsTarget(a))},o.prototype.pointerDown=function(a,u){c.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;c.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(){c.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){c.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=G.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 mt;return a.visual.transform.baseVal.appendItem(G.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,m){var h=a.transform.baseVal.getItem(0);h.setTranslate(u,m),a.transform.baseVal.replaceItem(h,0)},o.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},c.prototype.getState.call(this))},o.prototype.restoreState=function(a){c.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){c.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}(je),rt=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||this;return h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.setStrokeColor=h.setStrokeColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.strokeColor=m.defaultColor,h.strokeWidth=m.defaultStrokeWidth,h.strokeDasharray=m.defaultStrokeDasharray,h.strokePanel=new He("Line color",m.defaultColorSet,m.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new gt("Line width",m.defaultStrokeWidths,m.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new lt("Line style",m.defaultStrokeDasharrays,m.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return ve(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorLine&&a!==this.visibleLine)},o.prototype.createVisual=function(){this.visual=G.createGroup(),this.selectorLine=G.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=G.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){c.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()),G.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),G.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),G.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},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.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}(vt),Oe=function(c){function o(a,u,m,h){var K=c.call(this,a,h||'<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 K.fonts=[],K.fontBoxes=[],K.fonts=u,K.currentFont=m,K.setCurrentFont=K.setCurrentFont.bind(K),K}return ve(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.flexGrow="2",this.fonts.forEach(function(m){var h=document.createElement("div");h.style.display="inline-block",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.overflow="hidden",h.style.maxWidth=100/a.fonts.length-5+"%",h.style.borderColor=m===a.currentFont?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentFont(m,h)}),u.appendChild(h);var K=document.createElement("div");K.style.display="flex",K.style.minHeight="20px",K.style.flexGrow="2",K.style.fontFamily=m,K.style.overflow="hidden";var Ne=document.createElement("div");Ne.style.whiteSpace="nowrap",Ne.style.overflow="hidden",Ne.style.textOverflow="ellipsis",Ne.innerHTML="The quick brown fox jumps over the lazy dog",K.appendChild(Ne),h.appendChild(K),a.fontBoxes.push(h)}),u},o.prototype.setCurrentFont=function(a,u){var m=this;this.currentFont=a,this.fontBoxes.forEach(function(h){h.style.borderColor=h===u?m.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(Ke),ze=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||this;return h.color="transparent",h.padding=5,h.DEFAULT_TEXT="your text here",h.text=h.DEFAULT_TEXT,h.isMoved=!1,h.color=m.defaultColor,h.fontFamily=m.defaultFontFamily,h.defaultSize={x:100,y:30},h.setColor=h.setColor.bind(h),h.setFont=h.setFont.bind(h),h.renderText=h.renderText.bind(h),h.sizeText=h.sizeText.bind(h),h.textEditDivClicked=h.textEditDivClicked.bind(h),h.showTextEditor=h.showTextEditor.bind(h),h.setSize=h.setSize.bind(h),h.positionTextEditor=h.positionTextEditor.bind(h),h.colorPanel=new He("Color",m.defaultColorSet,m.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.fontFamilyPanel=new Oe("Font",m.defaultFontFamilies,m.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h}return ve(o,c),o.prototype.ownsTarget=function(a){if(c.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(m){m===a&&(u=!0)}),u},o.prototype.createVisual=function(){this.visual=G.createGroup(),this.bgRectangle=G.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=G.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(G.createTransform()),this.textElement.transform.baseVal.appendItem(G.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},o.prototype.pointerDown=function(a,u){c.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(G.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 m=(1*this.width-this.width*this.padding*2/100)/a.width,h=(1*this.height-this.height*this.padding*2/100)/a.height;u=Math.min(m,h)}return u},o.prototype.getTextPosition=function(a){var u=this.textElement.getBBox(),m=0,h=0;return u.width>0&&u.height>0&&(m=(this.width-u.width*a)/2,h=this.height/2-u.height*a/2),{x:m,y:h}},o.prototype.sizeText=function(){var a=this.textElement.getBBox(),u=this.getTextScale(),m=this.getTextPosition(u);m.y-=a.y*u,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+m.x+"px, "+m.y+"px) scale("+u+", "+u+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(m.x,m.y),this.textElement.transform.baseVal.getItem(1).setScale(u,u))},o.prototype.manipulate=function(a){c.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){c.prototype.resize.call(this,a),this.isMoved=!0,this.setSize(),this.sizeText()},o.prototype.setSize=function(){c.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(G.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),G.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),c.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 m=u.clipboardData.getData("text"),h=window.getSelection();if(!h.rangeCount)return!1;h.deleteFromDocument(),h.getRangeAt(0).insertNode(document.createTextNode(m)),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}),m=this.textElement.getBBox(),h={x:m.width*a,y:m.height*a};u.x-=h.x/2,u.y-=h.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(){c.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},o.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),c.prototype.deselect.call(this)},o.prototype.dblClick=function(a,u){c.prototype.dblClick.call(this,a,u),this.showTextEditor()},o.prototype.setColor=function(a){this.textElement&&G.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&&G.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},c.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(),c.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){c.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}(it),ee=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||this;return h.color="transparent",h.lineWidth=3,h.drawing=!1,h.pixelRatio=1,h.color=m.defaultColor,h.lineWidth=m.defaultStrokeWidth,h.pixelRatio=m.freehandPixelRatio,h.setColor=h.setColor.bind(h),h.addCanvas=h.addCanvas.bind(h),h.finishCreation=h.finishCreation.bind(h),h.setLineWidth=h.setLineWidth.bind(h),h.colorPanel=new He("Color",m.defaultColorSet,m.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.lineWidthPanel=new gt("Line width",m.defaultStrokeWidths,m.defaultStrokeWidth),h.lineWidthPanel.onWidthChanged=h.setLineWidth,h}return ve(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.drawingImage)},o.prototype.createVisual=function(){this.visual=G.createGroup(),this.drawingImage=G.createImage(),this.visual.appendChild(this.drawingImage);var a=G.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):c.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()):c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),G.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),G.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()):c.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(),c.prototype.select.call(this)},o.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),c.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],m=u[0],h=u[1],K=u[2],Ne=u[3],pe=!1,ht=0;ht<this.canvasElement.height;ht++)for(var Be=0;Be<this.canvasElement.width;Be++)a.data[ht*this.canvasElement.width*4+4*Be+3]>0&&(pe=!0,ht<h&&(h=ht),Be<m&&(m=Be),ht>Ne&&(Ne=ht),Be>K&&(K=Be));if(pe){this.left=m/this.pixelRatio,this.top=h/this.pixelRatio,this.width=(K-m)/this.pixelRatio,this.height=(Ne-h)/this.pixelRatio;var Et=document.createElement("canvas");Et.width=K-m,Et.height=Ne-h,Et.getContext("2d").putImageData(this.canvasContext.getImageData(m,h,K-m,Ne-h),0,0),this.drawingImgUrl=Et.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){G.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),G.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},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){this.createVisual(),c.prototype.restoreState.call(this,a),this.drawingImgUrl=a.drawingImgUrl,this.setDrawingImage()},o.prototype.scale=function(a,u){c.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}(it),Y=function(c){function o(a,u,m){var h=c.call(this,a,m||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return h.typeBoxes=[],h.currentType=u,h.setCurrentType=h.setCurrentType.bind(h),h}return ve(o,c),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 m=function(Ne){var pe="both";switch(Ne){case 0:pe="both";break;case 1:pe="start";break;case 2:pe="end";break;case 3:pe="none"}var ht=document.createElement("div");if(ht.style.display="flex",ht.style.flexGrow="2",ht.style.alignItems="center",ht.style.justifyContent="space-between",ht.style.padding="5px",ht.style.borderWidth="2px",ht.style.borderStyle="solid",ht.style.borderColor=pe===h.currentType?h.uiStyleSettings.toolboxAccentColor:"transparent",ht.addEventListener("click",function(){a.setCurrentType(pe,ht)}),u.appendChild(ht),pe==="both"||pe==="start"){var Be=document.createElement("div");Be.style.display="flex",Be.style.alignItems="center",Be.style.minHeight="20px",Be.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="`+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Be.style.marginLeft="5px",ht.appendChild(Be)}var Et=document.createElement("div");Et.style.display="flex",Et.style.alignItems="center",Et.style.minHeight="20px",Et.style.flexGrow="2";var It=document.createElement("hr");if(It.style.minWidth="20px",It.style.border="0px",It.style.borderTop="3px solid "+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee"),It.style.flexGrow="2",Et.appendChild(It),ht.appendChild(Et),pe==="both"||pe==="end"){var zt=document.createElement("div");zt.style.display="flex",zt.style.alignItems="center",zt.style.minHeight="20px",zt.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="`+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,zt.style.marginRight="5px",ht.appendChild(zt)}h.typeBoxes.push(ht)},h=this,K=0;K<4;K++)m(K);return u},o.prototype.setCurrentType=function(a,u){var m=this;this.currentType=a,this.typeBoxes.forEach(function(h){h.style.borderColor=h===u?m.uiStyleSettings!==void 0?m.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(Ke),$=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||this;return h.arrowType="end",h.arrowBaseHeight=10,h.arrowBaseWidth=10,h.getArrowPoints=h.getArrowPoints.bind(h),h.setArrowType=h.setArrowType.bind(h),h.arrowTypePanel=new Y("Arrow type","end"),h.arrowTypePanel.onArrowTypeChanged=h.setArrowType,h}return ve(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.arrow1&&a!==this.arrow2)},o.prototype.getArrowPoints=function(a,u){var m=this.arrowBaseWidth+2*this.strokeWidth,h=this.arrowBaseHeight+2*this.strokeWidth;return a-m/2+","+(u+h/2)+" "+a+","+(u-h/2)+" "+(a+m/2)+","+(u+h/2)},o.prototype.createTips=function(){this.arrow1=G.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(G.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=G.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(G.createTransform()),this.visual.appendChild(this.arrow2)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(c.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",G.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),G.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 m=this.arrow2.transform.baseVal.getItem(0);m.setRotate(a+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(m,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},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.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}(rt),y=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||this;return h.fillColor=m.defaultFillColor,h.strokeWidth=0,h.fillPanel=new He("Color",m.defaultColorSet,m.defaultFillColor),h.fillPanel.onColorChanged=h.setFillColor,h}return ve(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.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}(et),x=function(c){function o(a,u,m,h){var K=c.call(this,a,h||'<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 K.opacities=[],K.opacityBoxes=[],K.opacities=u,K.currentOpacity=m,K.setCurrentOpacity=K.setCurrentOpacity.bind(K),K}return ve(o,c),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(m){var h=document.createElement("div");h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="center",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.borderColor=m===a.currentOpacity?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentOpacity(m,h)}),u.appendChild(h);var K=document.createElement("div");K.innerText=100*m+"%",h.appendChild(K),a.opacityBoxes.push(h)}),u},o.prototype.setCurrentOpacity=function(a,u){var m=this;this.currentOpacity=a,this.opacityBoxes.forEach(function(h){h.style.borderColor=h===u?m.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(Ke),A=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||this;return h.setOpacity=h.setOpacity.bind(h),h.fillColor=m.defaultHighlightColor,h.strokeWidth=0,h.opacity=m.defaultHighlightOpacity,h.fillPanel=new He("Color",m.defaultColorSet,h.fillColor),h.fillPanel.onColorChanged=h.setFillColor,h.opacityPanel=new x("Opacity",m.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return ve(o,c),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&G.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=c.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}(y),N='<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>',le=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||this;return h.bgColor="transparent",h.tipPosition={x:0,y:0},h.tipBase1Position={x:0,y:0},h.tipBase2Position={x:0,y:0},h.tipMoving=!1,h.color=m.defaultStrokeColor,h.bgColor=m.defaultFillColor,h.fontFamily=m.defaultFontFamily,h.defaultSize={x:100,y:30},h.setBgColor=h.setBgColor.bind(h),h.getTipPoints=h.getTipPoints.bind(h),h.positionTip=h.positionTip.bind(h),h.setTipPoints=h.setTipPoints.bind(h),h.colorPanel=new He("Text color",m.defaultColorSet,h.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>'),h.colorPanel.onColorChanged=h.setColor,h.bgColorPanel=new He("Fill color",m.defaultColorSet,h.bgColor,N),h.bgColorPanel.onColorChanged=h.setBgColor,h.fontFamilyPanel=new Oe("Font",m.defaultFontFamilies,m.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h.tipGrip=new mt,h.tipGrip.visual.transform.baseVal.appendItem(G.createTransform()),h.controlBox.appendChild(h.tipGrip.visual),h}return ve(o,c),o.prototype.ownsTarget=function(a){return c.prototype.ownsTarget.call(this,a)||this.tipGrip.ownsTarget(a)||this.tip===a},o.prototype.createTip=function(){G.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=G.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},o.prototype.pointerDown=function(a,u){this.state==="new"&&c.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):c.prototype.pointerDown.call(this,a,u)},o.prototype.pointerUp=function(a){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,c.prototype.pointerUp.call(this,a);else{var u=this.state==="creating";c.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 c.prototype.manipulate.call(this,a)},o.prototype.setBgColor=function(a){this.bgRectangle&&this.tip&&(G.setAttributes(this.bgRectangle,[["fill",a]]),G.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),m=this.height/5;a&&(this.tipPosition={x:u+m/2,y:this.height+20});var h=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?h<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(m=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:0},this.tipBase2Position={x:u+m,y:0}):(this.tipBase1Position={x:0,y:u},this.tipBase2Position={x:0,y:u+m}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?h<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(m=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-m,y:0},this.tipBase2Position={x:this.width-u,y:0}):(this.tipBase1Position={x:this.width,y:u},this.tipBase2Position={x:this.width,y:u+m}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?h<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(m=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-m,y:this.height},this.tipBase2Position={x:this.width-u,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-u-m},this.tipBase2Position={x:this.width,y:this.height-u}):h<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(m=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:this.height},this.tipBase2Position={x:u+m,y:this.height}):(this.tipBase1Position={x:0,y:this.height-u},this.tipBase2Position={x:0,y:this.height-u-m})},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.positionTip()},o.prototype.positionTip=function(){G.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(),c.prototype.select.call(this)},o.prototype.getState=function(){var a=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},c.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,c.prototype.restoreState.call(this,a),this.createTip(),this.setTipPoints()},o.prototype.scale=function(a,u){c.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}(ze),Ce=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||this;return h.fillColor="transparent",h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.opacity=1,h.strokeColor=m.defaultColor,h.strokeWidth=m.defaultStrokeWidth,h.strokeDasharray=m.defaultStrokeDasharray,h.fillColor=m.defaultFillColor,h.setStrokeColor=h.setStrokeColor.bind(h),h.setFillColor=h.setFillColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.setOpacity=h.setOpacity.bind(h),h.createVisual=h.createVisual.bind(h),h.strokePanel=new He("Line color",q(m.defaultColorSet,["transparent"]),m.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.fillPanel=new He("Fill color",q(m.defaultColorSet,["transparent"]),h.fillColor,N),h.fillPanel.onColorChanged=h.setFillColor,h.strokeWidthPanel=new gt("Line width",m.defaultStrokeWidths,m.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new lt("Line style",m.defaultStrokeDasharrays,m.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h.opacityPanel=new x("Opacity",m.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return ve(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=G.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){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){c.prototype.setSize.call(this),G.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){c.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&G.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&G.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(a),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&G.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&G.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&G.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},c.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(),c.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){c.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}(it),Ge=function(c){function o(a,u,m){return c.call(this,a,u,m)||this}return ve(o,c),Object.defineProperty(o.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.tip1&&a!==this.tip2)},o.prototype.createTips=function(){this.tip1=G.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(G.createTransform()),this.visual.appendChild(this.tip1),this.tip2=G.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(G.createTransform()),this.visual.appendChild(this.tip2)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(c.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(G.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()]]),G.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 m=this.tip2.transform.baseVal.getItem(0);m.setRotate(a+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(m,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=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.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}(rt),st=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||this;return h.strokePanel.colors=m.defaultColorSet,h.fillColor="transparent",h}return ve(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.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}(Ce),Ct=function(){function c(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(c.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),c.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))},c.prototype.replaceLastUndoStep=function(o){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=o)},c.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},c.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}},c.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},c}(),Ae=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||this;return h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.curveX=0,h.curveY=0,h.manipulationStartCurveX=0,h.manipulationStartCurveY=0,h.setStrokeColor=h.setStrokeColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.positionGrips=h.positionGrips.bind(h),h.addControlGrips=h.addControlGrips.bind(h),h.adjustVisual=h.adjustVisual.bind(h),h.setupControlBox=h.setupControlBox.bind(h),h.resize=h.resize.bind(h),h.strokeColor=m.defaultColor,h.strokeWidth=m.defaultStrokeWidth,h.strokeDasharray=m.defaultStrokeDasharray,h.strokePanel=new He("Line color",m.defaultColorSet,m.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new gt("Line width",m.defaultStrokeWidths,m.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new lt("Line style",m.defaultStrokeDasharrays,m.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return ve(o,c),o.prototype.ownsTarget=function(a){return!(!c.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=G.createGroup(),this.selectorCurve=G.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=G.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){c.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()),G.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),G.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),G.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){c.prototype.setupControlBox.call(this),this.curveControlLine1=G.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=G.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,c.prototype.addControlGrips.call(this)},o.prototype.positionGrips=function(){c.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),c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){this.activeGrip===this.curveGrip&&(this.curveX=a.x,this.curveY=a.y),c.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,c.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},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.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}(vt),bt=function(){function c(o,a){a===void 0&&(a=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=o,this.cancelable=a}return Object.defineProperty(c.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),c.prototype.preventDefault=function(){this._defaultPrevented=!0},c}(),dt=function(c){function o(a,u,m){var h=c.call(this,a,!1)||this;return h.dataUrl=u,h.state=m,h}return ve(o,c),o}(bt),qe=function(c){function o(a,u,m){m===void 0&&(m=!1);var h=c.call(this,a,m)||this;return h.marker=u,h}return ve(o,c),o}(bt),Lt=function(){function c(){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 c.prototype.addEventListener=function(o,a){this[o].push(a)},c.prototype.removeEventListener=function(o,a){var u=this[o].indexOf(a);u>-1&&this[o].splice(u,1)},c}(),Rt=function(){function c(o){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Le,this._isOpen=!1,this.undoRedoManager=new Ct,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 Lt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=c.instanceCounter++,this.styles=new be(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(c.prototype,"ALL_MARKER_TYPES",{get:function(){return[at,ee,$,ze,st,Ce,A,le,Ge,y,rt,Ae]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[at,ee,$,ze,Ce,A,le]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"BASIC_MARKER_TYPES",{get:function(){return[at,ee,$,ze,A]},enumerable:!1,configurable:!0}),Object.defineProperty(c.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 m=a.ALL_MARKER_TYPES.find(function(h){return h.typeName===u});m!==void 0&&a._availableMarkerTypes.push(m)}else a._availableMarkerTypes.push(u)})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.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(c.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),c.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),b.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},c.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&O.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=O.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new bt(o))})},c.prototype.render=function(){return me(this,void 0,void 0,function(){var o;return ue(this,function(a){switch(a.label){case 0:return this.setCurrentMarker(),(o=new X).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()]}})})},c.prototype.close=function(o){var a=this;if(o===void 0&&(o=!1),this.isOpen){var u=!1;o||this.eventListeners.beforeclose.forEach(function(m){var h=new bt(a,!0);m(h),h.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(m){return m(new bt(a))}),this.detachEvents(),this._isOpen=!1)}},c.prototype.addMarkersToToolbar=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];(o=this._availableMarkerTypes).push.apply(o,a)},c.prototype.addRenderEventListener=function(o){this.addEventListener("render",function(a){o(a.dataUrl,a.state)})},c.prototype.removeRenderEventListener=function(o){},c.prototype.addCloseEventListener=function(o){this.addEventListener("close",function(){o()})},c.prototype.removeCloseEventListener=function(o){},c.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))},c.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)},c.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},c.prototype.resize=function(o,a){this._isResizing=!0;var u=o/this.imageWidth,m=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,m),this._isResizing=!1},c.prototype.scaleMarkers=function(o,a){var u,m=this;this._currentMarker&&this._currentMarker instanceof ze?this._currentMarker.scale(o,a):(u=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(h){h!==m._currentMarker&&h.scale(o,a)}),u!==void 0&&this.setCurrentMarker(u)},c.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"},c.prototype.setTopLeft=function(){var o=this.editingTarget.getBoundingClientRect(),a=this.editorCanvas.getBoundingClientRect();this.left=o.left-a.left,this.top=o.top-a.top},c.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)},c.prototype.addDefs=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];this.defs=G.createDefs(),this.addDefsToImage(),(o=this.defs).append.apply(o,a)},c.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},c.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)},c.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},c.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},c.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)},c.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},c.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)},c.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()},c.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")},c.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"},c.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},c.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 _e(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 Ue(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},c.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},c.prototype.removeMarker=function(o){this.markerImage.removeChild(o.container),this.markers.indexOf(o)>-1&&this.markers.splice(this.markers.indexOf(o),1),o.dispose()},c.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())},c.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()}},c.prototype.deleteSelectedMarker=function(){var o=this;if(this._currentMarker!==void 0){var a=!1;if(this.eventListeners.markerbeforedelete.forEach(function(m){var h=new qe(o,o._currentMarker,!0);m(h),h.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(m){return m(new qe(o,u))})}}},c.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(K){var Ne=new qe(o,void 0,!0);K(Ne),Ne.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function(K){var Ne=m.markers[K];m.setCurrentMarker(m.markers[K]),m._currentMarker.dispose(),m.markerImage.removeChild(m._currentMarker.container),m.markers.splice(m.markers.indexOf(m._currentMarker),1),m.eventListeners.markerdelete.forEach(function(pe){return pe(new qe(o,Ne))})},m=this,h=this.markers.length-1;h>=0;h--)u(h);this.addUndoStep()}},Object.defineProperty(c.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),c.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))},c.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)},c.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},c.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 m=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(a),m<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(h){return h(new bt(o))})}else this.undoRedoManager.replaceLastUndoStep(a),this.eventListeners.statechange.forEach(function(h){return h(new bt(o))})}},c.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},c.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 bt(o))}))},c.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},c.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 bt(o))}))},c.prototype.stepZoom=function(){var o=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=o<this.zoomSteps.length-1?this.zoomSteps[o+1]:this.zoomSteps[0]},c.prototype.panTo=function(o){this.contentDiv.scrollBy({left:this.prevPanPoint.x-o.x,top:this.prevPanPoint.y-o.y}),this.prevPanPoint=o},c.prototype.startRenderAndClose=function(){return me(this,void 0,void 0,function(){var o,a,u=this;return ue(this,function(m){switch(m.label){case 0:return[4,this.render()];case 1:return o=m.sent(),a=this.getState(),this.eventListeners.render.forEach(function(h){return h(new dt(u,o,a))}),this.close(!0),[2]}})})},c.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},c.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 m=a._availableMarkerTypes.find(function(K){return K.typeName===u.typeName});if(m!==void 0){var h=a.addNewMarker(m);h.restoreState(u),a.markers.push(h)}}),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 bt(a))})},c.prototype.addNewMarker=function(o){var a=G.createGroup();return this.markerImage.appendChild(a),new o(a,this.overlayContainer,this.settings)},c.prototype.createNewMarker=function(o){var a,u=this;(a=typeof o=="string"?this._availableMarkerTypes.find(function(m){return m.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(m){return m(new qe(u,u._currentMarker))}))},c.prototype.markerCreated=function(o){var a=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(o),this.setCurrentMarker(o),o instanceof ee&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(ee):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(u){return u(new qe(a,a._currentMarker))})},c.prototype.colorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=o,this.settings.defaultStrokeColor=o)},c.prototype.fillColorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=o)},c.prototype.markerStateChanged=function(o){var a=this;this.eventListeners.markerchange.forEach(function(u){return u(new qe(a,o))})},c.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 qe(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 qe(a,a._currentMarker))}))},c.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))},c.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()}},c.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}))},c.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()},c.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},c.prototype.onKeyUp=function(o){this._currentMarker===void 0||this.notesArea!==void 0||o.key!=="Delete"&&o.key!=="Backspace"||this.deleteSelectedMarker()},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.markerImage.getBoundingClientRect();return{x:(o-u.left)/this.zoomLevel,y:(a-u.top)/this.zoomLevel}},c.prototype.onWindowResize=function(){this.positionUI()},c.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()},c.prototype.addLicenseKey=function(o){b.addKey(o)},c.prototype.addEventListener=function(o,a){this.eventListeners.addEventListener(o,a)},c.prototype.removeEventListener=function(o,a){this.eventListeners.removeEventListener(o,a)},c.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(c.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),c.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 bt(o))}))},c.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 bt(o))}))},c.instanceCounter=0,c}();/* **********************************
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 At=function(c,o){return(At=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var m in u)Object.prototype.hasOwnProperty.call(u,m)&&(a[m]=u[m])})(c,o)};function Mt(c,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=c}At(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function Tt(c,o,a,u){return new(a||(a=Promise))(function(m,h){function K(ht){try{pe(u.next(ht))}catch(Be){h(Be)}}function Ne(ht){try{pe(u.throw(ht))}catch(Be){h(Be)}}function pe(ht){var Be;ht.done?m(ht.value):(Be=ht.value,Be instanceof a?Be:new a(function(Et){Et(Be)})).then(K,Ne)}pe((u=u.apply(c,o||[])).next())})}function qt(c,o){var a,u,m,h,K={label:0,sent:function(){if(1&m[0])throw m[1];return m[1]},trys:[],ops:[]};return h={next:Ne(0),throw:Ne(1),return:Ne(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function Ne(pe){return function(ht){return function(Be){if(a)throw new TypeError("Generator is already executing.");for(;K;)try{if(a=1,u&&(m=2&Be[0]?u.return:Be[0]?u.throw||((m=u.return)&&m.call(u),0):u.next)&&!(m=m.call(u,Be[1])).done)return m;switch(u=0,m&&(Be=[2&Be[0],m.value]),Be[0]){case 0:case 1:m=Be;break;case 4:return K.label++,{value:Be[1],done:!1};case 5:K.label++,u=Be[1],Be=[0];continue;case 7:Be=K.ops.pop(),K.trys.pop();continue;default:if(!(m=K.trys,(m=m.length>0&&m[m.length-1])||Be[0]!==6&&Be[0]!==2)){K=0;continue}if(Be[0]===3&&(!m||Be[1]>m[0]&&Be[1]<m[3])){K.label=Be[1];break}if(Be[0]===6&&K.label<m[1]){K.label=m[1],m=Be;break}if(m&&K.label<m[2]){K.label=m[2],K.ops.push(Be);break}m[2]&&K.ops.pop(),K.trys.pop();continue}Be=o.call(c,K)}catch(Et){Be=[6,Et],u=0}finally{a=m=0}if(5&Be[0])throw Be[1];return{value:Be[0]?Be[1]:void 0,done:!0}}([pe,ht])}}}var ln=function(){function c(){}return c.addKey=function(o){c.key=o},Object.defineProperty(c,"isLicensed",{get:function(){return!!c.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(c.key)},enumerable:!1,configurable:!0}),c}(),pt=function(){function c(){}return c.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},c.setAttributes=function(o,a){for(var u=0,m=a;u<m.length;u++){var h=m[u],K=h[0],Ne=h[1];o.setAttribute(K,Ne)}},c.createRect=function(o,a,u){var m=document.createElementNS("http://www.w3.org/2000/svg","rect");return m.setAttribute("width",o.toString()),m.setAttribute("height",a.toString()),u&&c.setAttributes(m,u),m},c.createLine=function(o,a,u,m,h){var K=document.createElementNS("http://www.w3.org/2000/svg","line");return K.setAttribute("x1",o.toString()),K.setAttribute("y1",a.toString()),K.setAttribute("x2",u.toString()),K.setAttribute("y2",m.toString()),h&&c.setAttributes(K,h),K},c.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&c.setAttributes(u,a),u},c.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&&c.setAttributes(u,a),u},c.createEllipse=function(o,a,u){var m=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return m.setAttribute("cx",(o/2).toString()),m.setAttribute("cy",(a/2).toString()),m.setAttribute("rx",(o/2).toString()),m.setAttribute("ry",(a/2).toString()),u&&c.setAttributes(m,u),m},c.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&c.setAttributes(a,o),a},c.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},c.createMarker=function(o,a,u,m,h,K,Ne){var pe=document.createElementNS("http://www.w3.org/2000/svg","marker");return c.setAttributes(pe,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",m.toString()],["refX",h.toString()],["refY",K.toString()]]),pe.appendChild(Ne),pe},c.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&c.setAttributes(a,o),a},c.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&c.setAttributes(u,a),u},c.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&c.setAttributes(a,o),a},c.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},c.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&c.setAttributes(u,a),u},c.createElement=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg",o);return a&&c.setAttributes(u,a),u},c.getHollowRectanglePath=function(o,a,u,m,h,K,Ne,pe){return"M"+o+","+a+"V"+(a+m)+"H"+(o+u)+"V"+a+"H"+h+"V"+K+"H"+(h+Ne)+"V"+(K+pe)+"H"+h+"V"+a+"Z"},c}(),Sn=function(){function c(o){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(c.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(c.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(c.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),c.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},c.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)},c.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 un("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new un("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new un("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new mn("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new mn("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},c.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},c}(),un=function(c,o){this.selector=c,this.style=o},mn=function(c,o){this.localName=c,this.style=o},Tn=function(){function c(){this.blocks=[],this.display=""}return c.prototype.addButtonBlock=function(o){o.className=this.blockClassName,o.buttonClassName=this.buttonClassName,o.buttonColorsClassName=this.buttonColorsClassName,o.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(o)},c.prototype.addElementBlock=function(o){o.className===void 0&&(o.className=this.blockClassName),this.blocks.push(o)},c.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},c}(),li=function(){function c(){}return c.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},c}(),Xn=function(c){function o(){var a=c!==null&&c.apply(this,arguments)||this;return a.buttons=[],a}return Mt(o,c),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=c.prototype.getUI.call(this);return this.buttons.forEach(function(u){return a.appendChild(u.getUI())}),a},o}(li),jt=function(){function c(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(c.prototype,"icon",{get:function(){return this._icon},set:function(o){this._icon=o,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isActive",{get:function(){return this._isActive},set:function(o){this._isActive=o,this.adjustClassName()},enumerable:!1,configurable:!0}),c.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},c.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,"")))},c.prototype.hide=function(){this._isHidden=!0},c}(),ct=function(c){function o(){var a=c!==null&&c.apply(this,arguments)||this;return a.elements=[],a}return Mt(o,c),o.prototype.addElement=function(a){this.elements.push(a)},o.prototype.getUI=function(){var a=c.prototype.getUI.call(this);return this.elements.forEach(function(u){return a.appendChild(u)}),a},o}(li),Hn=function(){function c(o,a){this.horizontal=o,this.vertical=a}return Object.defineProperty(c.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),c.prototype.getVerticalLength=function(o){return o/this.ratio},c.prototype.getHorizontalLength=function(o){return o*this.ratio},c}(),ui=function(){function c(){}return c.getIcon=function(o,a){if(o>0&&a>0){var u=new Hn(o,a),m=u.ratio>=1?20:u.getHorizontalLength(20),h=u.ratio<1?20:u.getVerticalLength(20),K=document.createElementNS("http://www.w3.org/2000/svg","svg");K.setAttribute("xmlns","http://www.w3.org/2000/svg"),K.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(K);var Ne=pt.createDefs();K.appendChild(Ne);var pe=pt.createElement("clipPath",[["id","text-bg-clip"]]);Ne.appendChild(pe);var ht=pt.createPath(pt.getHollowRectanglePath((24-m)/2,(24-h)/2,m,h,(24-m)/2+2,(24-h)/2+2,m-4,h-4));K.appendChild(ht);var Be=pt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Be.appendChild(pt.createTSpan(o+":"+a)),K.appendChild(Be);var Et=Be.getBBox();pt.setAttributes(Be,[["x",((24-Et.width)/2).toString()],["y",((24-Et.height)/2-Et.y).toString()]]);var It=pt.createPath(pt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Et.width))/2,(24-Math.ceil(Et.height))/2,Math.ceil(Et.width),Math.ceil(Et.height)));return pe.appendChild(It),pt.setAttributes(ht,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(K),K.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>'},c}(),An=function(c){function o(a,u,m){var h=c.call(this,a,u)||this;return h.isDropdownOpen=!1,h.onClick=h.dropdownButtonClicked,h.dropdownButtons=m,h}return Mt(o,c),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}(jt),Pt=function(){function c(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=pt.createGroup(),this.visual.appendChild(pt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(pt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return c.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},c.prototype.setCenter=function(o,a){this.visual.childNodes.forEach(function(u){return pt.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},c}(),Kn=function(){function c(o,a,u,m){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=m,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(c.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(c.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.gridContainer&&pt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(o){this._zoomFactor=o,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),c.prototype.open=function(){var o=this;this.cropShadeElement=pt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=pt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;a<this.numberOfGridLines;a++)this.horizontalGridLines.push(pt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(pt.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=pt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Pt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Pt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Pt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Pt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},c.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),pt.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(h,K){var Ne=a.y+u*(K+1);pt.setAttributes(h,[["x1",""+a.x],["y1",""+Ne],["x2",""+(a.x+a.width)],["y2",""+Ne]])});var m=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(h,K){var Ne=a.x+m*(K+1);pt.setAttributes(h,[["x1",""+Ne],["y1",""+a.y],["x2",""+Ne],["y2",""+(a.y+a.height)]])}),pt.setAttributes(this.cropShadeElement,[["d",pt.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},c.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)},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.container.getBoundingClientRect();return{x:o-u.left+this.margin,y:a-u.top+this.margin}},c.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)},c.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()},c.prototype.onPointerUp=function(o){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(o.pointerId)},c.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},c.prototype.resize=function(o){var a=Object.assign({},this.cropRect),u=o.x-this.previousPoint.x,m=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+=m,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+=m}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))},c.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),m=this.aspectRatio.getVerticalLength(this.cropRect.width);u/this.canvasWidth<m/this.canvasHeight?this.cropRect.width=u:this.cropRect.height=m,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)}},c.prototype.getRescaledRect=function(o,a,u,m,h,K){var Ne=u/o,pe=m/a;return{x:(h.x-K)*Ne+K,y:(h.y-K)*pe+K,width:h.width*Ne,height:h.height*pe}},c.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)},c}(),hi=function(){function c(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(c.prototype,"angle",{get:function(){return this._angle},set:function(o){this._angle=o,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),c.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},c.prototype.onPointerDown=function(o){this.controlContainer.setPointerCapture(o.pointerId),this.isDragging=!0,this.previousPoint={x:o.clientX,y:o.clientY}},c.prototype.onPointerMove=function(o){this.isDragging&&(this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.previousPoint.x=o.clientX)},c.prototype.onPointerUp=function(o){this.isDragging&&this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(o.pointerId)},c.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var o=this.angleLabelText.getBBox();pt.setAttributes(this.angleLabelElement,[["x",((this.width-o.width)/2).toString()],["y",(this.height/2).toString()]])}},c.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)}},c.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 m=u%5==0?this.height/3:this.height/6;a+="h4v"+-m+"h1v"+m}a+="v1H0Z",this.scaleShape=pt.createPath(a);var h=pt.createTransform();this.scaleShape.transform.baseVal.appendItem(h),o.appendChild(this.scaleShape),this.angleLabelElement=pt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=pt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var K=pt.createTSpan("");return K.innerHTML="&deg;",this.angleLabelElement.appendChild(K),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},c}(),vi=function(){function c(){this.naturalSize=!1,this.imageType="image/png"}return c.prototype.rasterize=function(o,a,u,m,h,K,Ne){var pe=this;return new Promise(function(ht){var Be=document.createElement("canvas");Be.width=o.width.baseVal.value-2*m,Be.height=o.height.baseVal.value-2*m;var Et=1,It=1;pe.naturalSize===!0?(Et=a.naturalWidth/(o.width.baseVal.value-2*m)/K,It=a.naturalHeight/(o.height.baseVal.value-2*m)/Ne,Be.width=a.naturalWidth/K,Be.height=a.naturalHeight/Ne):pe.width!==void 0&&pe.height!==void 0&&(Et=pe.width/u.width,It=pe.height/u.height,Be.width*=Et,Be.height*=It);var zt=Be.getContext("2d");zt.translate(Be.width/2,Be.height/2),zt.rotate(h*Math.PI/180),zt.scale(K,Ne),zt.translate(-Be.width/2,-Be.height/2),zt.drawImage(a,0,0,Be.width,Be.height);var Fn=document.createElement("canvas");Fn.width=u.width*Et,Fn.height=u.height*It,Fn.getContext("2d").putImageData(zt.getImageData((u.x-m)*Et,(u.y-m)*It,u.width*Et,u.height*It),0,0),ht(Fn.toDataURL(pe.imageType,pe.imageQuality))})},c}(),We=function(){function c(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=c.instanceCounter++,this.styles=new Sn(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(c.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(o){this._zoomToCropEnabled=o,o?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(c.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(c.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(c.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(c.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(c.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}),c.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},c.prototype.show=function(){this.showUI(),this.open()},c.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)},c.prototype.addRenderEventListener=function(o){this.renderEventListeners.push(o)},c.prototype.removeRenderEventListener=function(o){this.renderEventListeners.indexOf(o)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(o),1)},c.prototype.addCloseEventListener=function(o){this.closeEventListeners.push(o)},c.prototype.removeCloseEventListener=function(o){this.closeEventListeners.indexOf(o)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(o),1)},c.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))},c.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)}},c.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},c.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",pt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},c.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()},c.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();pt.setAttributes(this.editingTarget,[["href",a]]),this.setEditingTargetSize()},c.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},c.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=pt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=pt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=pt.createGroup(),this.editingTargetRotationScaleContainer=pt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=pt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var a=pt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(a),this.editingTargetContainer=pt.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)},c.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},c.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=pt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Kn(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()},c.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)}},c.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)},c.prototype.cropRectChanged=function(o){this.cropRect=o,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},c.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},c.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"},c.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},c.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},c.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},c.prototype.addTopToolbar=function(){var o=this;this.topToolbar=new Tn,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 Xn;a.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(a);var u=[];this.aspectRatios.forEach(function(It){var zt=new jt(ui.getIcon(It.horizontal,It.vertical),It.horizontal===0&&It.vertical===0?"FREE":It.horizontal+":"+It.vertical);zt.onClick=function(){return o.ratioButtonClicked(It)},u.push(zt)}),this.aspectRatioButton=new An(ui.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 m=new jt('<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");m.isActive=this.isGridVisible,m.onClick=function(){o.isGridVisible=!o.isGridVisible,m.isActive=o.isGridVisible},a.addButton(m);var h=new jt('<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(h.isActive=this.zoomToCropEnabled,h.onClick=function(){o.zoomToCropEnabled=!o.zoomToCropEnabled,h.isActive=o.zoomToCropEnabled},a.addButton(h),!ln.isLicensed){var K=new ct;this.topToolbar.addElementBlock(K);var Ne=document.createElement("div");Ne.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var pe=document.createElement("a");pe.style.color="currentColor",pe.href="https://markerjs.com/products/cropro",pe.target="_blank",pe.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>',Ne.appendChild(pe),K.addElement(Ne)}var ht=new Xn;ht.minWidth=3*this.toolbarHeight+"px",ht.contentAlign="end",this.topToolbar.addButtonBlock(ht);var Be=new jt('<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");Be.onClick=this.startRenderAndClose,ht.addButton(Be),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Be.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Et=new jt('<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");Et.onClick=this.close,ht.addButton(Et),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Et.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},c.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new Tn,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 Xn;a.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(a);var u=new jt('<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 m=new jt('<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");m.onClick=this.rotateRightButtonClicked,a.addButton(m);var h=new ct;h.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(h),this.straightener=new hi("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(ht){o.rotateBy(ht),o.straightener.angle=o.rotationAngle},h.addElement(this.straightener.getUI());var K=new Xn;K.minWidth=2*this.toolbarHeight+"px",K.contentAlign="end",this.bottomToolbar.addButtonBlock(K);var Ne=new jt('<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");Ne.onClick=this.flipHorizontallyButtonClicked,K.addButton(Ne);var pe=new jt('<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");pe.onClick=this.flipVerticallyButtonClicked,K.addButton(pe)},c.prototype.ratioButtonClicked=function(o){this.aspectRatio=o,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},c.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ui.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},c.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Hn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},c.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},c.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},c.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()}},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.cropImage.getBoundingClientRect();return{x:o-u.left,y:a-u.top}},c.prototype.onWindowResize=function(){this.positionUI()},c.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()},c.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)},c.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)},c.prototype.rotateTo=function(o){o=(o=o>180?o-360:o)<=-180?o+360:o,this.rotationAngle=o,this.applyRotation()},c.prototype.rotateBy=function(o){this.rotateTo((this.rotationAngle+o)%360)},c.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},c.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},c.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},c.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},c.prototype.startRenderAndClose=function(){return Tt(this,void 0,void 0,function(){var o,a;return qt(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(m){return m(o,a)}),this.close(!0),[2]}})})},c.prototype.render=function(){return Tt(this,void 0,void 0,function(){var o;return qt(this,function(a){switch(a.label){case 0:return(o=new vi).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.width=this.renderWidth,o.height=this.renderHeight,this.unzoomFromCrop(),pt.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()]}})})},c.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new mn("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 mn("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new mn("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new mn("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 mn("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new mn("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new un("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new un("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new mn("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 mn("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new mn("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 mn("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 mn("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},c.instanceCounter=0,c}(),St=k("8hTe"),ti=k.n(St),ci=/<pre[^>]*>/g;function di(c){var o=document.createElement("div");return o.innerHTML=c,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var Ri=Qe.a=function(c){var o=c.value,a=o===void 0?"":o,u=c.edit,m=u===void 0?!1:u,h=c.className,K=c.showTextOnly,Ne=c.showLines,pe=c.replaces,ht=c.zoomImg,Be=c.hasMask,Et=c.style,It=Et===void 0?{}:Et,zt=c.stylesPrev,Fn=zt===void 0?{}:zt,zn=String(a),hn=Object(_.useRef)(),Yn=Object(_.useRef)(),Xi=Object(_.useState)(""),_n=Object(T.a)(Xi,2),Ln=_n[0],ni=_n[1],yi=Object(_.useState)("office"),Jn=Object(T.a)(yi,2),ii=Jn[0],Wn=Jn[1],fr=function(){var Ut=new We(Yn.current);Ut.displayMode="popup",Ut.addRenderEventListener(function(){var vn=Object(z.a)(B.a.mark(function Ht(yn){var Kt;return B.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return hn.current.style.display="none",on.next=3,Object(Me.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:yn}});case 3:Kt=on.sent,Kt!=null&&Kt.id&&pe(Yn.current.getAttribute("src").replace(F.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 5:case"end":return on.stop()}},Ht)}));return function(Ht){return vn.apply(this,arguments)}}()),Ut.show()},Ki=function(){var Ut=new Rt(Yn.current);Ut.settings.displayMode="popup",Ut.addEventListener("render",function(){var vn=Object(z.a)(B.a.mark(function Ht(yn){var Kt;return B.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:if(hn.current.style.display="none",!Yn.current){on.next=6;break}return on.next=4,Object(Me.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:yn.dataUrl}});case 4:Kt=on.sent,Kt!=null&&Kt.id&&pe(Yn.current.getAttribute("src").replace(F.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 6:case"end":return on.stop()}},Ht)}));return function(Ht){return vn.apply(this,arguments)}}()),Ut.show(),window.markerArea=Ut},Nn=Object(_.useMemo)(function(){try{var en=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ut=/\"\/api\/attachments\/|\"\/attachments\/download\//g,vn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;zn=zn.replace(en,"("+F.a.API_SERVER+"/api/attachments/").replace(Ut,'"'+F.a.API_SERVER+"/api/attachments/").replace(vn,'"'+F.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,`
`),zn=zn.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
`)}catch(bi){}var Ht=D(zn),yn=de();if(zn.match(/\[TOC\]/)&&(Ht=Ht.replace("<p>[TOC]</p>",Ve()),$e()),Ht=Ht.replace(/(__special_katext_id_\d+__)/g,function(bi,on){var an=yn[on],ri=an.type,xi=an.expression;return Object(J.renderToString)(di(xi)||"",{displayMode:ri==="block",throwOnError:!1,output:"html"})}),Ht=Ht.replace(/▁/g,"\u2581\u2581\u2581"),ie(),K){var Kt=document.createElement("div");return Kt.innerHTML=Ht,Kt.innerText}return setTimeout(function(){return Di()},500),Ht},[zn]),In=Object(_.useRef)();Se.WebkitLineClamp=Ne,Ne&&(It=Object(fe.a)(Object(fe.a)({},It),Se));function Oi(en){var Ut=en.target;if(Ut.tagName.toUpperCase()==="IMG"){if(ht){var vn=Ut.getAttribute("src");ni(vn),Wn("image")}}else if(Ut.tagName.toUpperCase()==="A"){var Ht=Ut.getAttribute("href");if(Ht.indexOf("office")>-1)en.preventDefault(),ni(Ht),Wn("office");else if(Ht.indexOf("application/pdf")>-1)en.preventDefault(),ni(Ht),Wn("pdf");else if(Ht.indexOf("type=text")>-1)en.preventDefault(),ni(Ht),Wn("html");else if(Ht.startsWith("#")){en.preventDefault();var yn=document.getElementById(Ht.replace("#",""));yn&&yn.scrollIntoView(!0)}}}var Di=function(){var Ut,vn=(Ut=In.current)===null||Ut===void 0?void 0:Ut.querySelectorAll("video");vn==null||vn.forEach(function(Ht){if(Ht.oncontextmenu=function(){return!1},Ht.src.indexOf(".m3u8")>-1&&!Ht.canPlayType("application/vnd.apple.mpegurl")){if(C.a.isSupported()){var yn=new C.a;yn.loadSource(Ht.src),yn.attachMedia(Ht)}}})};Object(_.useEffect)(function(){if(In.current&&Nn&&(Nn.match(ci)&&window.PR.prettyPrint()),In.current)return In.current.addEventListener("click",Oi),function(){In.current.removeEventListener("click",Oi),ie(),$e()}},[Nn,In.current,Oi]);var Pi=function(Ut){if(!m)return;Ut.target.nodeName==="IMG"?(hn.current.style.display="flex",hn.current.style.width=Ut.target.clientWidth+"px",hn.current.style.height=Ut.target.clientHeight+"px",hn.current.style.top=Ut.target.offsetTop+"px",hn.current.style.left=Ut.target.offsetLeft+"px",Yn.current.src=Ut.target.getAttribute("src")):hn.current.style.display="none"};return L.a.createElement("div",{style:{position:"relative"}},L.a.createElement("div",{ref:In,style:Object(fe.a)({},It),className:"".concat(h||""," markdown-body ").concat(ti.a.mdBody),onMouseOver:Pi,dangerouslySetInnerHTML:{__html:Nn}}),L.a.createElement("div",{ref:hn,className:ti.a.button},L.a.createElement(se.a,null,L.a.createElement(we.a,{onClick:function(){return fr()}},"\u88C1\u526A"),L.a.createElement(we.a,{onClick:function(){return Ki()}},"\u7F16\u8F91"))),L.a.createElement("img",{ref:Yn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),L.a.createElement(xe.a,{close:!0,data:Ln,hasMask:Be,type:Ln!=null&&Ln.length?ii:"",style:Object(fe.a)({},Fn),onClose:function(){return ni("")}}))}},"9VGf":function(ot,Qe,k){"use strict";k.d(Qe,"a",function(){return ne});var H=k("q1tI"),se=k.n(H);function ne(we,fe){var z=Object(H.useRef)();Object(H.useEffect)(function(){z.current=we}),Object(H.useEffect)(function(){function T(){z.current()}if(fe!==null){var R=setInterval(T,fe);return function(){return clearInterval(R)}}},[fe])}},"9ivq":function(ot,Qe,k){},Bd2K:function(ot,Qe,k){(function(H){H(k("VrN/"),k("osHv"))})(function(H){H.defineOption("autoCloseTags",!1,function(B,_,L){if(L!=H.Init&&L&&B.removeKeyMap("autoCloseTags"),!_)return;var E={name:"autoCloseTags"};(typeof _!="object"||_.whenClosing!==!1)&&(E["'/'"]=function(te){return z(te)}),(typeof _!="object"||_.whenOpening!==!1)&&(E["'>'"]=function(te){return we(te)}),B.addKeyMap(E)});var se=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],ne=["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 we(B){if(B.getOption("disableInput"))return H.Pass;for(var _=B.listSelections(),L=[],E=B.getOption("autoCloseTags"),te=0;te<_.length;te++){if(!_[te].empty())return H.Pass;var Q=_[te].head,U=B.getTokenAt(Q),Z=H.innerMode(B.getMode(),U.state),W=Z.state,ce=Z.mode.xmlCurrentTag&&Z.mode.xmlCurrentTag(W),ae=ce&&ce.name;if(!ae)return H.Pass;var Ie=Z.mode.configuration=="html",$e=typeof E=="object"&&E.dontCloseTags||Ie&&se,Se=typeof E=="object"&&E.indentTags||Ie&&ne;U.end>Q.ch&&(ae=ae.slice(0,ae.length-U.end+Q.ch));var De=ae.toLowerCase();if(!ae||U.type=="string"&&(U.end!=Q.ch||!/[\"\']/.test(U.string.charAt(U.string.length-1))||U.string.length==1)||U.type=="tag"&&ce.close||U.string.indexOf("/")==Q.ch-U.start-1||$e&&T($e,De)>-1||R(B,Z.mode.xmlCurrentContext&&Z.mode.xmlCurrentContext(W)||[],ae,Q,!0))return H.Pass;var Ve=typeof E=="object"&&E.emptyTags;if(Ve&&T(Ve,ae)>-1){L[te]={text:"/>",newPos:H.Pos(Q.line,Q.ch+2)};continue}var ke=Se&&T(Se,De)>-1;L[te]={indent:ke,text:">"+(ke?`
`:"")+"</"+ae+">",newPos:ke?H.Pos(Q.line+1,0):H.Pos(Q.line,Q.ch+1)}}for(var Te=typeof E=="object"&&E.dontIndentOnAutoClose,te=_.length-1;te>=0;te--){var Pe=L[te];B.replaceRange(Pe.text,_[te].head,_[te].anchor,"+insert");var ye=B.listSelections().slice(0);ye[te]={head:Pe.newPos,anchor:Pe.newPos},B.setSelections(ye),!Te&&Pe.indent&&(B.indentLine(Pe.newPos.line,null,!0),B.indentLine(Pe.newPos.line+1,null,!0))}}function fe(B,_){for(var L=B.listSelections(),E=[],te=_?"/":"</",Q=B.getOption("autoCloseTags"),U=typeof Q=="object"&&Q.dontIndentOnSlash,Z=0;Z<L.length;Z++){if(!L[Z].empty())return H.Pass;var W=L[Z].head,ce=B.getTokenAt(W),ae=H.innerMode(B.getMode(),ce.state),Ie=ae.state;if(_&&(ce.type=="string"||ce.string.charAt(0)!="<"||ce.start!=W.ch-1))return H.Pass;var $e,Se=ae.mode.name!="xml"&&B.getMode().name=="htmlmixed";if(Se&&ae.mode.name=="javascript")$e=te+"script";else if(Se&&ae.mode.name=="css")$e=te+"style";else{var De=ae.mode.xmlCurrentContext&&ae.mode.xmlCurrentContext(Ie);if(!De||De.length&&R(B,De,De[De.length-1],W))return H.Pass;$e=te+De[De.length-1]}B.getLine(W.line).charAt(ce.end)!=">"&&($e+=">"),E[Z]=$e}if(B.replaceSelections(E),L=B.listSelections(),!U)for(var Z=0;Z<L.length;Z++)(Z==L.length-1||L[Z].head.line<L[Z+1].head.line)&&B.indentLine(L[Z].head.line)}function z(B){return B.getOption("disableInput")?H.Pass:fe(B,!0)}H.commands.closeTag=function(B){return fe(B)};function T(B,_){if(B.indexOf)return B.indexOf(_);for(var L=0,E=B.length;L<E;++L)if(B[L]==_)return L;return-1}function R(B,_,L,E,te){if(!H.scanForClosingTag)return!1;var Q=Math.min(B.lastLine()+1,E.line+500),U=H.scanForClosingTag(B,E,null,Q);if(!U||U.tag!=L)return!1;for(var Z=te?1:0,W=_.length-1;W>=0&&_[W]==L;W--)++Z;E=U.to;for(var W=1;W<Z;W++){var ce=H.scanForClosingTag(B,E,null,Q);if(!ce||ce.tag!=L)return!1;E=ce.to}return!0}})},BjJ7:function(ot,Qe,k){"use strict";k.d(Qe,"d",function(){return se}),k.d(Qe,"c",function(){return ne}),k.d(Qe,"e",function(){return we}),k.d(Qe,"b",function(){return fe}),k.d(Qe,"a",function(){return T});var H=k("m3rI");function se(R){var B=!0;if(R.length>0){for(var _=0;_<R.length;_++)if(R[_].compile_success==0||!R[_].compile_success){B=!1;break}}else B=!1;return B}function ne(R){for(var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",_=[],L=0;L<R.length;L++){var E=R[L],te=B?"".concat(B,"/").concat(E.name):"".concat(E.name);_.push({title:E.name,isLeaf:!(E.type==="tree"),key:te})}return _}function we(R,B,_){for(var L=0;L<R.length;L++){var E=R[L];if(E.key===B){E.children=_;break}E.children&&we(E.children,B,_)}return R}function fe(R,B,_){var L;return function(){var E=this,te=arguments,Q=function(){L=null,_||R.apply(E,te)},U=_&&!L;clearTimeout(L),L=setTimeout(Q,B),U&&R.apply(E,te)}}var z=!0,T=H.a.API_SERVER},"C+DQ":function(ot,Qe,k){},D1Df:function(ot,Qe,k){"use strict";function H(w){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?H=function(P){return typeof P}:H=function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},H(w)}function se(){return se=Object.assign||function(w){for(var j=1;j<arguments.length;j++){var P=arguments[j];for(var S in P)Object.prototype.hasOwnProperty.call(P,S)&&(w[S]=P[S])}return w},se.apply(this,arguments)}function ne(w,j){var P=Object.keys(w);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(w);j&&(S=S.filter(function(D){return Object.getOwnPropertyDescriptor(w,D).enumerable})),P.push.apply(P,S)}return P}function we(w){for(var j=1;j<arguments.length;j++){var P=arguments[j]!=null?arguments[j]:{};j%2?ne(P,!0).forEach(function(S){U(w,S,P[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(P)):ne(P).forEach(function(S){Object.defineProperty(w,S,Object.getOwnPropertyDescriptor(P,S))})}return w}function fe(w,j){if(w==null)return{};var P=z(w,j),S,D;if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(w);for(D=0;D<p.length;D++){if(S=p[D],j.indexOf(S)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(w,S))continue;P[S]=w[S]}}return P}function z(w,j){if(w==null)return{};var P={},S=Object.keys(w),D,p;for(p=0;p<S.length;p++){if(D=S[p],j.indexOf(D)>=0)continue;P[D]=w[D]}return P}function T(w,j){if(!(w instanceof j))throw new TypeError("Cannot call a class as a function")}function R(w,j){for(var P=0;P<j.length;P++){var S=j[P];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(w,S.key,S)}}function B(w,j,P){return j&&R(w.prototype,j),P&&R(w,P),w}function _(w,j){return j&&(H(j)==="object"||typeof j=="function")?j:E(w)}function L(w){return L=Object.setPrototypeOf?Object.getPrototypeOf:function(P){return P.__proto__||Object.getPrototypeOf(P)},L(w)}function E(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w}function te(w,j){if(typeof j!="function"&&j!==null)throw new TypeError("Super expression must either be null or a function");w.prototype=Object.create(j&&j.prototype,{constructor:{value:w,writable:!0,configurable:!0}}),j&&Q(w,j)}function Q(w,j){return Q=Object.setPrototypeOf||function(S,D){return S.__proto__=D,S},Q(w,j)}function U(w,j,P){return j in w?Object.defineProperty(w,j,{value:P,enumerable:!0,configurable:!0,writable:!0}):w[j]=P,w}var Z=k("q1tI"),W=k("17x9"),ce=k("H38U"),ae=k("aRTE");function Ie(w){for(var j="",P=0;P<w.length;P++){var S=w.charCodeAt(P);S<128?j+=String.fromCharCode(S):S<2048?(j+=String.fromCharCode(192|S>>6),j+=String.fromCharCode(128|S&63)):S<55296||S>=57344?(j+=String.fromCharCode(224|S>>12),j+=String.fromCharCode(128|S>>6&63),j+=String.fromCharCode(128|S&63)):(P++,S=65536+((S&1023)<<10|w.charCodeAt(P)&1023),j+=String.fromCharCode(240|S>>18),j+=String.fromCharCode(128|S>>12&63),j+=String.fromCharCode(128|S>>6&63),j+=String.fromCharCode(128|S&63))}return j}var $e={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},Se={},De=4,Ve=.1;function ke(w){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,P=[];return w.forEach(function(S,D){var p=null;S.forEach(function(d,C){if(!d&&p!==null){P.push("M".concat(p+j," ").concat(D+j,"h").concat(C-p,"v1H").concat(p+j,"z")),p=null;return}if(C===S.length-1){if(!d)return;p===null?P.push("M".concat(C+j,",").concat(D+j," h1v1H").concat(C+j,"z")):P.push("M".concat(p+j,",").concat(D+j," h").concat(C+1-p,"v1H").concat(p+j,"z"));return}d&&p===null&&(p=C)})}),P.join("")}function Te(w,j){return w.slice().map(function(P,S){return S<j.y||S>=j.y+j.h?P:P.map(function(D,p){return p<j.x||p>=j.x+j.w?D:!1})})}function Pe(w,j){var P=w.imageSettings,S=w.size,D=w.includeMargin;if(P==null)return null;var p=D?De:0,d=j.length+p*2,C=Math.floor(S*Ve),F=d/S,J=(P.width||C)*F,xe=(P.height||C)*F,Me=P.x==null?j.length/2-J/2:P.x*F,ge=P.y==null?j.length/2-xe/2:P.y*F,ve=null;if(P.excavate){var me=Math.floor(Me),ue=Math.floor(ge),q=Math.ceil(J+Me-me),G=Math.ceil(xe+ge-ue);ve={x:me,y:ue,w:q,h:G}}return{x:Me,y:ge,h:xe,w:J,excavation:ve}}var ye=function(){try{new Path2D().addPath(new Path2D)}catch(w){return!1}return!0}(),M=function(w){te(j,w);function j(){var P,S;T(this,j);for(var D=arguments.length,p=new Array(D),d=0;d<D;d++)p[d]=arguments[d];return S=_(this,(P=L(j)).call.apply(P,[this].concat(p))),U(E(S),"_canvas",void 0),U(E(S),"_image",void 0),U(E(S),"state",{imgLoaded:!1}),U(E(S),"handleImageLoad",function(){S.setState({imgLoaded:!0})}),S}return B(j,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var S=this.props,D=S.value,p=S.size,d=S.level,C=S.bgColor,F=S.fgColor,J=S.includeMargin,xe=S.imageSettings,Me=new ce(-1,ae[d]);if(Me.addData(Ie(D)),Me.make(),this._canvas!=null){var ge=this._canvas,ve=ge.getContext("2d");if(!ve)return;var me=Me.modules;if(me===null)return;var ue=J?De:0,q=me.length+ue*2,G=Pe(this.props,me);xe!=null&&G!=null&&(G.excavation!=null&&(me=Te(me,G.excavation)));var b=window.devicePixelRatio||1;ge.height=ge.width=p*b;var X=p/q*b;ve.scale(X,X),ve.fillStyle=C,ve.fillRect(0,0,q,q),ve.fillStyle=F,ye?ve.fill(new Path2D(ke(me,ue))):me.forEach(function(O,be){O.forEach(function(Ee,re){Ee&&ve.fillRect(re+ue,be+ue,1,1)})}),this.state.imgLoaded&&this._image&&G!=null&&ve.drawImage(this._image,G.x+ue,G.y+ue,G.w,G.h)}}},{key:"render",value:function(){var S=this,D=this.props,p=D.value,d=D.size,C=D.level,F=D.bgColor,J=D.fgColor,xe=D.style,Me=D.includeMargin,ge=D.imageSettings,ve=fe(D,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),me=we({height:d,width:d},xe),ue=null,q=ge&&ge.src;return ge!=null&&q!=null&&(ue=Z.createElement("img",{src:q,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(b){return S._image=b}})),Z.createElement(Z.Fragment,null,Z.createElement("canvas",se({style:me,height:d,width:d,ref:function(b){return S._canvas=b}},ve)),ue)}}]),j}(Z.PureComponent);U(M,"defaultProps",$e);var de=function(w){te(j,w);function j(){return T(this,j),_(this,L(j).apply(this,arguments))}return B(j,[{key:"render",value:function(){var S=this.props,D=S.value,p=S.size,d=S.level,C=S.bgColor,F=S.fgColor,J=S.includeMargin,xe=S.imageSettings,Me=fe(S,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),ge=new ce(-1,ae[d]);ge.addData(Ie(D)),ge.make();var ve=ge.modules;if(ve===null)return null;var me=J?De:0,ue=ve.length+me*2,q=Pe(this.props,ve),G=null;xe!=null&&q!=null&&(q.excavation!=null&&(ve=Te(ve,q.excavation)),G=Z.createElement("image",{xlinkHref:xe.src,height:q.h,width:q.w,x:q.x+me,y:q.y+me,preserveAspectRatio:"none"}));var b=ke(ve,me);return Z.createElement("svg",se({shapeRendering:"crispEdges",height:p,width:p,viewBox:"0 0 ".concat(ue," ").concat(ue)},Me),Z.createElement("path",{fill:C,d:"M0,0 h".concat(ue,"v").concat(ue,"H0z")}),Z.createElement("path",{fill:F,d:b}),G)}}]),j}(Z.PureComponent);U(de,"defaultProps",$e);var ie=function(j){var P=j.renderAs,S=fe(j,["renderAs"]),D=P==="svg"?de:M;return Z.createElement(D,S)};ie.defaultProps=we({renderAs:"canvas"},$e),ot.exports=ie},DlQD:function(ot,Qe,k){(function(H,se){ot.exports=se()})(this,function(){"use strict";function H(ee,Y){for(var $=0;$<Y.length;$++){var y=Y[$];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(ee,y.key,y)}}function se(ee,Y,$){return Y&&H(ee.prototype,Y),$&&H(ee,$),ee}function ne(ee,Y){if(!ee)return;if(typeof ee=="string")return we(ee,Y);var $=Object.prototype.toString.call(ee).slice(8,-1);if($==="Object"&&ee.constructor&&($=ee.constructor.name),$==="Map"||$==="Set")return Array.from(ee);if($==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test($))return we(ee,Y)}function we(ee,Y){(Y==null||Y>ee.length)&&(Y=ee.length);for(var $=0,y=new Array(Y);$<Y;$++)y[$]=ee[$];return y}function fe(ee,Y){var $;if(typeof Symbol=="undefined"||ee[Symbol.iterator]==null){if(Array.isArray(ee)||($=ne(ee))||Y&&ee&&typeof ee.length=="number"){$&&(ee=$);var y=0;return function(){return y>=ee.length?{done:!0}:{done:!1,value:ee[y++]}}}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 $=ee[Symbol.iterator](),$.next.bind($)}function z(ee,Y){return Y={exports:{}},ee(Y,Y.exports),Y.exports}var T=z(function(ee){function Y(){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 $(y){ee.exports.defaults=y}ee.exports={defaults:Y(),getDefaults:Y,changeDefaults:$}}),R=T.defaults,B=T.getDefaults,_=T.changeDefaults,L=/[&<>"']/,E=/[&<>"']/g,te=/[<>"']|&(?!#?\w+;)/,Q=/[<>"']|&(?!#?\w+;)/g,U={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Z=function(Y){return U[Y]};function W(ee,Y){if(Y){if(L.test(ee))return ee.replace(E,Z)}else if(te.test(ee))return ee.replace(Q,Z);return ee}var ce=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ae(ee){return ee.replace(ce,function(Y,$){return $=$.toLowerCase(),$==="colon"?":":$.charAt(0)==="#"?$.charAt(1)==="x"?String.fromCharCode(parseInt($.substring(2),16)):String.fromCharCode(+$.substring(1)):""})}var Ie=/(^|[^\[])\^/g;function $e(ee,Y){ee=ee.source||ee,Y=Y||"";var $={replace:function(x,A){return A=A.source||A,A=A.replace(Ie,"$1"),ee=ee.replace(x,A),$},getRegex:function(){return new RegExp(ee,Y)}};return $}var Se=/[^\w:]/g,De=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Ve(ee,Y,$){if(ee){var y;try{y=decodeURIComponent(ae($)).replace(Se,"").toLowerCase()}catch(x){return null}if(y.indexOf("javascript:")===0||y.indexOf("vbscript:")===0||y.indexOf("data:")===0)return null}Y&&!De.test($)&&($=M(Y,$));try{$=encodeURI($).replace(/%25/g,"%")}catch(x){return null}return $}var ke={},Te=/^[^:]+:\/*[^/]*$/,Pe=/^([^:]+:)[\s\S]*$/,ye=/^([^:]+:\/*[^/]*)[\s\S]*$/;function M(ee,Y){ke[" "+ee]||(Te.test(ee)?ke[" "+ee]=ee+"/":ke[" "+ee]=j(ee,"/",!0)),ee=ke[" "+ee];var $=ee.indexOf(":")===-1;return Y.substring(0,2)==="//"?$?Y:ee.replace(Pe,"$1")+Y:Y.charAt(0)==="/"?$?Y:ee.replace(ye,"$1")+Y:ee+Y}var de={exec:function(){}};function ie(ee){for(var Y=1,$,y;Y<arguments.length;Y++){$=arguments[Y];for(y in $)Object.prototype.hasOwnProperty.call($,y)&&(ee[y]=$[y])}return ee}function w(ee,Y){var $=ee.replace(/\|/g,function(A,N,le){for(var Ce=!1,Ge=N;--Ge>=0&&le[Ge]==="\\";)Ce=!Ce;return Ce?"|":" |"}),y=$.split(/ \|/),x=0;if(y.length>Y)y.splice(Y);else for(;y.length<Y;)y.push("");for(;x<y.length;x++)y[x]=y[x].trim().replace(/\\\|/g,"|");return y}function j(ee,Y,$){var y=ee.length;if(y===0)return"";for(var x=0;x<y;){var A=ee.charAt(y-x-1);if(A===Y&&!$)x++;else if(A!==Y&&$)x++;else break}return ee.substr(0,y-x)}function P(ee,Y){if(ee.indexOf(Y[1])===-1)return-1;for(var $=ee.length,y=0,x=0;x<$;x++)if(ee[x]==="\\")x++;else if(ee[x]===Y[0])y++;else if(ee[x]===Y[1]&&(y--,y<0))return x;return-1}function S(ee){ee&&ee.sanitize&&!ee.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 D={escape:W,unescape:ae,edit:$e,cleanUrl:Ve,resolveUrl:M,noopTest:de,merge:ie,splitCells:w,rtrim:j,findClosingBracket:P,checkSanitizeDeprecation:S},p=T.defaults,d=D.rtrim,C=D.splitCells,F=D.escape,J=D.findClosingBracket;function xe(ee,Y,$){var y=Y.href,x=Y.title?F(Y.title):null,A=ee[1].replace(/\\([\[\]])/g,"$1");return ee[0].charAt(0)!=="!"?{type:"link",raw:$,href:y,title:x,text:A}:{type:"image",raw:$,href:y,title:x,text:F(A)}}function Me(ee,Y){var $=ee.match(/^(\s+)(?:```)/);if($===null)return Y;var y=$[1];return Y.split(`
`).map(function(x){var A=x.match(/^\s+/);if(A===null)return x;var N=A[0];return N.length>=y.length?x.slice(y.length):x}).join(`
`)}var ge=function(){function ee($){this.options=$||p}var Y=ee.prototype;return Y.space=function(y){var x=this.rules.block.newline.exec(y);if(x)return x[0].length>1?{type:"space",raw:x[0]}:{raw:`
`}},Y.code=function(y,x){var A=this.rules.block.code.exec(y);if(A){var N=x[x.length-1];if(N&&N.type==="paragraph")return{raw:A[0],text:A[0].trimRight()};var le=A[0].replace(/^ {4}/gm,"");return{type:"code",raw:A[0],codeBlockStyle:"indented",text:this.options.pedantic?le:d(le,`
`)}}},Y.fences=function(y){var x=this.rules.block.fences.exec(y);if(x){var A=x[0],N=Me(A,x[3]||"");return{type:"code",raw:A,lang:x[2]?x[2].trim():x[2],text:N}}},Y.heading=function(y){var x=this.rules.block.heading.exec(y);if(x)return{type:"heading",raw:x[0],depth:x[1].length,text:x[2]}},Y.nptable=function(y){var x=this.rules.block.nptable.exec(y);if(x){var A={type:"table",header:C(x[1].replace(/^ *| *\| *$/g,"")),align:x[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:x[3]?x[3].replace(/\n$/,"").split(`
`):[],raw:x[0]};if(A.header.length===A.align.length){var N=A.align.length,le;for(le=0;le<N;le++)/^ *-+: *$/.test(A.align[le])?A.align[le]="right":/^ *:-+: *$/.test(A.align[le])?A.align[le]="center":/^ *:-+ *$/.test(A.align[le])?A.align[le]="left":A.align[le]=null;for(N=A.cells.length,le=0;le<N;le++)A.cells[le]=C(A.cells[le],A.header.length);return A}}},Y.hr=function(y){var x=this.rules.block.hr.exec(y);if(x)return{type:"hr",raw:x[0]}},Y.blockquote=function(y){var x=this.rules.block.blockquote.exec(y);if(x){var A=x[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:x[0],text:A}}},Y.list=function(y){var x=this.rules.block.list.exec(y);if(x){for(var A=x[0],N=x[2],le=N.length>1,Ce=N[N.length-1]===")",Ge={type:"list",raw:A,ordered:le,start:le?+N.slice(0,-1):"",loose:!1,items:[]},st=x[0].match(this.rules.block.item),Ct=!1,Ae,bt,dt,qe,Lt,Rt,At,Mt=st.length,Tt=0;Tt<Mt;Tt++)Ae=st[Tt],A=Ae,bt=Ae.length,Ae=Ae.replace(/^ *([*+-]|\d+[.)]) */,""),~Ae.indexOf(`
`)&&(bt-=Ae.length,Ae=this.options.pedantic?Ae.replace(/^ {1,4}/gm,""):Ae.replace(new RegExp("^ {1,"+bt+"}","gm"),"")),Tt!==Mt-1&&(dt=this.rules.block.bullet.exec(st[Tt+1])[0],(le?dt.length===1||!Ce&&dt[dt.length-1]===")":dt.length>1||this.options.smartLists&&dt!==N)&&(qe=st.slice(Tt+1).join(`
`),Ge.raw=Ge.raw.substring(0,Ge.raw.length-qe.length),Tt=Mt-1)),Lt=Ct||/\n\n(?!\s*$)/.test(Ae),Tt!==Mt-1&&(Ct=Ae.charAt(Ae.length-1)===`
`,Lt||(Lt=Ct)),Lt&&(Ge.loose=!0),Rt=/^\[[ xX]\] /.test(Ae),At=void 0,Rt&&(At=Ae[1]!==" ",Ae=Ae.replace(/^\[[ xX]\] +/,"")),Ge.items.push({type:"list_item",raw:A,task:Rt,checked:At,loose:Lt,text:Ae});return Ge}},Y.html=function(y){var x=this.rules.block.html.exec(y);if(x)return{type:this.options.sanitize?"paragraph":"html",raw:x[0],pre:!this.options.sanitizer&&(x[1]==="pre"||x[1]==="script"||x[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(x[0]):F(x[0]):x[0]}},Y.def=function(y){var x=this.rules.block.def.exec(y);if(x){x[3]&&(x[3]=x[3].substring(1,x[3].length-1));var A=x[1].toLowerCase().replace(/\s+/g," ");return{tag:A,raw:x[0],href:x[2],title:x[3]}}},Y.table=function(y){var x=this.rules.block.table.exec(y);if(x){var A={type:"table",header:C(x[1].replace(/^ *| *\| *$/g,"")),align:x[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:x[3]?x[3].replace(/\n$/,"").split(`
`):[]};if(A.header.length===A.align.length){A.raw=x[0];var N=A.align.length,le;for(le=0;le<N;le++)/^ *-+: *$/.test(A.align[le])?A.align[le]="right":/^ *:-+: *$/.test(A.align[le])?A.align[le]="center":/^ *:-+ *$/.test(A.align[le])?A.align[le]="left":A.align[le]=null;for(N=A.cells.length,le=0;le<N;le++)A.cells[le]=C(A.cells[le].replace(/^ *\| *| *\| *$/g,""),A.header.length);return A}}},Y.lheading=function(y){var x=this.rules.block.lheading.exec(y);if(x)return{type:"heading",raw:x[0],depth:x[2].charAt(0)==="="?1:2,text:x[1]}},Y.paragraph=function(y){var x=this.rules.block.paragraph.exec(y);if(x)return{type:"paragraph",raw:x[0],text:x[1].charAt(x[1].length-1)===`
`?x[1].slice(0,-1):x[1]}},Y.text=function(y,x){var A=this.rules.block.text.exec(y);if(A){var N=x[x.length-1];return N&&N.type==="text"?{raw:A[0],text:A[0]}:{type:"text",raw:A[0],text:A[0]}}},Y.escape=function(y){var x=this.rules.inline.escape.exec(y);if(x)return{type:"escape",raw:x[0],text:F(x[1])}},Y.tag=function(y,x,A){var N=this.rules.inline.tag.exec(y);if(N)return!x&&/^<a /i.test(N[0])?x=!0:x&&/^<\/a>/i.test(N[0])&&(x=!1),!A&&/^<(pre|code|kbd|script)(\s|>)/i.test(N[0])?A=!0:A&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(N[0])&&(A=!1),{type:this.options.sanitize?"text":"html",raw:N[0],inLink:x,inRawBlock:A,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(N[0]):F(N[0]):N[0]}},Y.link=function(y){var x=this.rules.inline.link.exec(y);if(x){var A=J(x[2],"()");if(A>-1){var N=x[0].indexOf("!")===0?5:4,le=N+x[1].length+A;x[2]=x[2].substring(0,A),x[0]=x[0].substring(0,le).trim(),x[3]=""}var Ce=x[2],Ge="";if(this.options.pedantic){var st=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ce);st?(Ce=st[1],Ge=st[3]):Ge=""}else Ge=x[3]?x[3].slice(1,-1):"";Ce=Ce.trim().replace(/^<([\s\S]*)>$/,"$1");var Ct=xe(x,{href:Ce&&Ce.replace(this.rules.inline._escapes,"$1"),title:Ge&&Ge.replace(this.rules.inline._escapes,"$1")},x[0]);return Ct}},Y.reflink=function(y,x){var A;if((A=this.rules.inline.reflink.exec(y))||(A=this.rules.inline.nolink.exec(y))){var N=(A[2]||A[1]).replace(/\s+/g," ");if(N=x[N.toLowerCase()],!N||!N.href){var le=A[0].charAt(0);return{type:"text",raw:le,text:le}}var Ce=xe(A,N,A[0]);return Ce}},Y.strong=function(y,x,A){A===void 0&&(A="");var N=this.rules.inline.strong.start.exec(y);if(N&&(!N[1]||N[1]&&(A===""||this.rules.inline.punctuation.exec(A)))){x=x.slice(-1*y.length);var le=N[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;le.lastIndex=0;for(var Ce;(N=le.exec(x))!=null;)if(Ce=this.rules.inline.strong.middle.exec(x.slice(0,N.index+3)),Ce)return{type:"strong",raw:y.slice(0,Ce[0].length),text:y.slice(2,Ce[0].length-2)}}},Y.em=function(y,x,A){A===void 0&&(A="");var N=this.rules.inline.em.start.exec(y);if(N&&(!N[1]||N[1]&&(A===""||this.rules.inline.punctuation.exec(A)))){x=x.slice(-1*y.length);var le=N[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;le.lastIndex=0;for(var Ce;(N=le.exec(x))!=null;)if(Ce=this.rules.inline.em.middle.exec(x.slice(0,N.index+2)),Ce)return{type:"em",raw:y.slice(0,Ce[0].length),text:y.slice(1,Ce[0].length-1)}}},Y.codespan=function(y){var x=this.rules.inline.code.exec(y);if(x){var A=x[2].replace(/\n/g," "),N=/[^ ]/.test(A),le=A.startsWith(" ")&&A.endsWith(" ");return N&&le&&(A=A.substring(1,A.length-1)),A=F(A,!0),{type:"codespan",raw:x[0],text:A}}},Y.br=function(y){var x=this.rules.inline.br.exec(y);if(x)return{type:"br",raw:x[0]}},Y.del=function(y){var x=this.rules.inline.del.exec(y);if(x)return{type:"del",raw:x[0],text:x[1]}},Y.autolink=function(y,x){var A=this.rules.inline.autolink.exec(y);if(A){var N,le;return A[2]==="@"?(N=F(this.options.mangle?x(A[1]):A[1]),le="mailto:"+N):(N=F(A[1]),le=N),{type:"link",raw:A[0],text:N,href:le,tokens:[{type:"text",raw:N,text:N}]}}},Y.url=function(y,x){var A;if(A=this.rules.inline.url.exec(y)){var N,le;if(A[2]==="@")N=F(this.options.mangle?x(A[0]):A[0]),le="mailto:"+N;else{var Ce;do Ce=A[0],A[0]=this.rules.inline._backpedal.exec(A[0])[0];while(Ce!==A[0]);N=F(A[0]),A[1]==="www."?le="http://"+N:le=N}return{type:"link",raw:A[0],text:N,href:le,tokens:[{type:"text",raw:N,text:N}]}}},Y.inlineText=function(y,x,A){var N=this.rules.inline.text.exec(y);if(N){var le;return x?le=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(N[0]):F(N[0]):N[0]:le=F(this.options.smartypants?A(N[0]):N[0]),{type:"text",raw:N[0],text:le}}},ee}(),ve=D.noopTest,me=D.edit,ue=D.merge,q={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:ve,table:ve,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};q._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,q._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,q.def=me(q.def).replace("label",q._label).replace("title",q._title).getRegex(),q.bullet=/(?:[*+-]|\d{1,9}[.)])/,q.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,q.item=me(q.item,"gm").replace(/bull/g,q.bullet).getRegex(),q.list=me(q.list).replace(/bull/g,q.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+q.def.source+")").getRegex(),q._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",q._comment=/<!--(?!-?>)[\s\S]*?-->/,q.html=me(q.html,"i").replace("comment",q._comment).replace("tag",q._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),q.paragraph=me(q._paragraph).replace("hr",q.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",q._tag).getRegex(),q.blockquote=me(q.blockquote).replace("paragraph",q.paragraph).getRegex(),q.normal=ue({},q),q.gfm=ue({},q.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*|$)"}),q.gfm.nptable=me(q.gfm.nptable).replace("hr",q.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",q._tag).getRegex(),q.gfm.table=me(q.gfm.table).replace("hr",q.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",q._tag).getRegex(),q.pedantic=ue({},q.normal,{html:me(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",q._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:ve,paragraph:me(q.normal._paragraph).replace("hr",q.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",q.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var G={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ve,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:ve,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};G._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",G.punctuation=me(G.punctuation).replace(/punctuation/g,G._punctuation).getRegex(),G._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",G._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",G.em.start=me(G.em.start).replace(/punctuation/g,G._punctuation).getRegex(),G.em.middle=me(G.em.middle).replace(/punctuation/g,G._punctuation).replace(/overlapSkip/g,G._overlapSkip).getRegex(),G.em.endAst=me(G.em.endAst,"g").replace(/punctuation/g,G._punctuation).getRegex(),G.em.endUnd=me(G.em.endUnd,"g").replace(/punctuation/g,G._punctuation).getRegex(),G.strong.start=me(G.strong.start).replace(/punctuation/g,G._punctuation).getRegex(),G.strong.middle=me(G.strong.middle).replace(/punctuation/g,G._punctuation).replace(/blockSkip/g,G._blockSkip).getRegex(),G.strong.endAst=me(G.strong.endAst,"g").replace(/punctuation/g,G._punctuation).getRegex(),G.strong.endUnd=me(G.strong.endUnd,"g").replace(/punctuation/g,G._punctuation).getRegex(),G.blockSkip=me(G._blockSkip,"g").getRegex(),G.overlapSkip=me(G._overlapSkip,"g").getRegex(),G._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,G._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,G._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])?)+(?![-_])/,G.autolink=me(G.autolink).replace("scheme",G._scheme).replace("email",G._email).getRegex(),G._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,G.tag=me(G.tag).replace("comment",q._comment).replace("attribute",G._attribute).getRegex(),G._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,G._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,G._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,G.link=me(G.link).replace("label",G._label).replace("href",G._href).replace("title",G._title).getRegex(),G.reflink=me(G.reflink).replace("label",G._label).getRegex(),G.reflinkSearch=me(G.reflinkSearch,"g").replace("reflink",G.reflink).replace("nolink",G.nolink).getRegex(),G.normal=ue({},G),G.pedantic=ue({},G.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:me(/^!?\[(label)\]\((.*?)\)/).replace("label",G._label).getRegex(),reflink:me(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",G._label).getRegex()}),G.gfm=ue({},G.normal,{escape:me(G.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),G.gfm.url=me(G.gfm.url,"i").replace("email",G.gfm._extended_email).getRegex(),G.breaks=ue({},G.gfm,{br:me(G.br).replace("{2,}","*").getRegex(),text:me(G.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var b={block:q,inline:G},X=T.defaults,O=b.block,be=b.inline;function Ee(ee){return ee.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(ee){var Y="",$,y,x=ee.length;for($=0;$<x;$++)y=ee.charCodeAt($),Math.random()>.5&&(y="x"+y.toString(16)),Y+="&#"+y+";";return Y}var _e=function(){function ee($){this.tokens=[],this.tokens.links=Object.create(null),this.options=$||X,this.options.tokenizer=this.options.tokenizer||new ge,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var y={block:O.normal,inline:be.normal};this.options.pedantic?(y.block=O.pedantic,y.inline=be.pedantic):this.options.gfm&&(y.block=O.gfm,this.options.breaks?y.inline=be.breaks:y.inline=be.gfm),this.tokenizer.rules=y}ee.lex=function(y,x){var A=new ee(x);return A.lex(y)};var Y=ee.prototype;return Y.lex=function(y){return y=y.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(y,this.tokens,!0),this.inline(this.tokens),this.tokens},Y.blockTokens=function(y,x,A){x===void 0&&(x=[]),A===void 0&&(A=!0),y=y.replace(/^ +$/gm,"");for(var N,le,Ce,Ge;y;){if(N=this.tokenizer.space(y)){y=y.substring(N.raw.length),N.type&&x.push(N);continue}if(N=this.tokenizer.code(y,x)){y=y.substring(N.raw.length),N.type?x.push(N):(Ge=x[x.length-1],Ge.raw+=`
`+N.raw,Ge.text+=`
`+N.text);continue}if(N=this.tokenizer.fences(y)){y=y.substring(N.raw.length),x.push(N);continue}if(N=this.tokenizer.heading(y)){y=y.substring(N.raw.length),x.push(N);continue}if(N=this.tokenizer.nptable(y)){y=y.substring(N.raw.length),x.push(N);continue}if(N=this.tokenizer.hr(y)){y=y.substring(N.raw.length),x.push(N);continue}if(N=this.tokenizer.blockquote(y)){y=y.substring(N.raw.length),N.tokens=this.blockTokens(N.text,[],A),x.push(N);continue}if(N=this.tokenizer.list(y)){for(y=y.substring(N.raw.length),Ce=N.items.length,le=0;le<Ce;le++)N.items[le].tokens=this.blockTokens(N.items[le].text,[],!1);x.push(N);continue}if(N=this.tokenizer.html(y)){y=y.substring(N.raw.length),x.push(N);continue}if(A&&(N=this.tokenizer.def(y))){y=y.substring(N.raw.length),this.tokens.links[N.tag]||(this.tokens.links[N.tag]={href:N.href,title:N.title});continue}if(N=this.tokenizer.table(y)){y=y.substring(N.raw.length),x.push(N);continue}if(N=this.tokenizer.lheading(y)){y=y.substring(N.raw.length),x.push(N);continue}if(A&&(N=this.tokenizer.paragraph(y))){y=y.substring(N.raw.length),x.push(N);continue}if(N=this.tokenizer.text(y,x)){y=y.substring(N.raw.length),N.type?x.push(N):(Ge=x[x.length-1],Ge.raw+=`
`+N.raw,Ge.text+=`
`+N.text);continue}if(y){var st="Infinite loop on byte: "+y.charCodeAt(0);if(this.options.silent){console.error(st);break}else throw new Error(st)}}return x},Y.inline=function(y){var x,A,N,le,Ce,Ge,st=y.length;for(x=0;x<st;x++){Ge=y[x];switch(Ge.type){case"paragraph":case"text":case"heading":{Ge.tokens=[],this.inlineTokens(Ge.text,Ge.tokens);break}case"table":{for(Ge.tokens={header:[],cells:[]},le=Ge.header.length,A=0;A<le;A++)Ge.tokens.header[A]=[],this.inlineTokens(Ge.header[A],Ge.tokens.header[A]);for(le=Ge.cells.length,A=0;A<le;A++)for(Ce=Ge.cells[A],Ge.tokens.cells[A]=[],N=0;N<Ce.length;N++)Ge.tokens.cells[A][N]=[],this.inlineTokens(Ce[N],Ge.tokens.cells[A][N]);break}case"blockquote":{this.inline(Ge.tokens);break}case"list":{for(le=Ge.items.length,A=0;A<le;A++)this.inline(Ge.items[A].tokens);break}}}return y},Y.inlineTokens=function(y,x,A,N,le){x===void 0&&(x=[]),A===void 0&&(A=!1),N===void 0&&(N=!1),le===void 0&&(le="");var Ce,Ge=y,st;if(this.tokens.links){var Ct=Object.keys(this.tokens.links);if(Ct.length>0)for(;(st=this.tokenizer.rules.inline.reflinkSearch.exec(Ge))!=null;)Ct.includes(st[0].slice(st[0].lastIndexOf("[")+1,-1))&&(Ge=Ge.slice(0,st.index)+"["+"a".repeat(st[0].length-2)+"]"+Ge.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(st=this.tokenizer.rules.inline.blockSkip.exec(Ge))!=null;)Ge=Ge.slice(0,st.index)+"["+"a".repeat(st[0].length-2)+"]"+Ge.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;y;){if(Ce=this.tokenizer.escape(y)){y=y.substring(Ce.raw.length),x.push(Ce);continue}if(Ce=this.tokenizer.tag(y,A,N)){y=y.substring(Ce.raw.length),A=Ce.inLink,N=Ce.inRawBlock,x.push(Ce);continue}if(Ce=this.tokenizer.link(y)){y=y.substring(Ce.raw.length),Ce.type==="link"&&(Ce.tokens=this.inlineTokens(Ce.text,[],!0,N)),x.push(Ce);continue}if(Ce=this.tokenizer.reflink(y,this.tokens.links)){y=y.substring(Ce.raw.length),Ce.type==="link"&&(Ce.tokens=this.inlineTokens(Ce.text,[],!0,N)),x.push(Ce);continue}if(Ce=this.tokenizer.strong(y,Ge,le)){y=y.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],A,N),x.push(Ce);continue}if(Ce=this.tokenizer.em(y,Ge,le)){y=y.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],A,N),x.push(Ce);continue}if(Ce=this.tokenizer.codespan(y)){y=y.substring(Ce.raw.length),x.push(Ce);continue}if(Ce=this.tokenizer.br(y)){y=y.substring(Ce.raw.length),x.push(Ce);continue}if(Ce=this.tokenizer.del(y)){y=y.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],A,N),x.push(Ce);continue}if(Ce=this.tokenizer.autolink(y,re)){y=y.substring(Ce.raw.length),x.push(Ce);continue}if(!A&&(Ce=this.tokenizer.url(y,re))){y=y.substring(Ce.raw.length),x.push(Ce);continue}if(Ce=this.tokenizer.inlineText(y,N,Ee)){y=y.substring(Ce.raw.length),le=Ce.raw.slice(-1),x.push(Ce);continue}if(y){var Ae="Infinite loop on byte: "+y.charCodeAt(0);if(this.options.silent){console.error(Ae);break}else throw new Error(Ae)}}return x},se(ee,null,[{key:"rules",get:function(){return{block:O,inline:be}}}]),ee}(),Ue=T.defaults,Ke=D.cleanUrl,He=D.escape,je=function(){function ee($){this.options=$||Ue}var Y=ee.prototype;return Y.code=function(y,x,A){var N=(x||"").match(/\S*/)[0];if(this.options.highlight){var le=this.options.highlight(y,N);le!=null&&le!==y&&(A=!0,y=le)}return N?'<pre><code class="'+this.options.langPrefix+He(N,!0)+'">'+(A?y:He(y,!0))+`</code></pre>
`:"<pre><code>"+(A?y:He(y,!0))+`</code></pre>
`},Y.blockquote=function(y){return`<blockquote>
`+y+`</blockquote>
`},Y.html=function(y){return y},Y.heading=function(y,x,A,N){return this.options.headerIds?"<h"+x+' id="'+this.options.headerPrefix+N.slug(A)+'">'+y+"</h"+x+`>
`:"<h"+x+">"+y+"</h"+x+`>
`},Y.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},Y.list=function(y,x,A){var N=x?"ol":"ul",le=x&&A!==1?' start="'+A+'"':"";return"<"+N+le+`>
`+y+"</"+N+`>
`},Y.listitem=function(y){return"<li>"+y+`</li>
`},Y.checkbox=function(y){return"<input "+(y?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Y.paragraph=function(y){return"<p>"+y+`</p>
`},Y.table=function(y,x){return x&&(x="<tbody>"+x+"</tbody>"),`<table>
<thead>
`+y+`</thead>
`+x+`</table>
`},Y.tablerow=function(y){return`<tr>
`+y+`</tr>
`},Y.tablecell=function(y,x){var A=x.header?"th":"td",N=x.align?"<"+A+' align="'+x.align+'">':"<"+A+">";return N+y+"</"+A+`>
`},Y.strong=function(y){return"<strong>"+y+"</strong>"},Y.em=function(y){return"<em>"+y+"</em>"},Y.codespan=function(y){return"<code>"+y+"</code>"},Y.br=function(){return this.options.xhtml?"<br/>":"<br>"},Y.del=function(y){return"<del>"+y+"</del>"},Y.link=function(y,x,A){if(y=Ke(this.options.sanitize,this.options.baseUrl,y),y===null)return A;var N='<a href="'+He(y)+'"';return x&&(N+=' title="'+x+'"'),N+=">"+A+"</a>",N},Y.image=function(y,x,A){if(y=Ke(this.options.sanitize,this.options.baseUrl,y),y===null)return A;var N='<img src="'+y+'" alt="'+A+'"';return x&&(N+=' title="'+x+'"'),N+=this.options.xhtml?"/>":">",N},Y.text=function(y){return y},ee}(),Xe=function(){function ee(){}var Y=ee.prototype;return Y.strong=function(y){return y},Y.em=function(y){return y},Y.codespan=function(y){return y},Y.del=function(y){return y},Y.html=function(y){return y},Y.text=function(y){return y},Y.link=function(y,x,A){return""+A},Y.image=function(y,x,A){return""+A},Y.br=function(){return""},ee}(),mt=function(){function ee(){this.seen={}}var Y=ee.prototype;return Y.slug=function(y){var x=y.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(x)){var A=x;do this.seen[A]++,x=A+"-"+this.seen[A];while(this.seen.hasOwnProperty(x))}return this.seen[x]=0,x},ee}(),tt=T.defaults,it=D.unescape,et=function(){function ee($){this.options=$||tt,this.options.renderer=this.options.renderer||new je,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Xe,this.slugger=new mt}ee.parse=function(y,x){var A=new ee(x);return A.parse(y)};var Y=ee.prototype;return Y.parse=function(y,x){x===void 0&&(x=!0);var A="",N,le,Ce,Ge,st,Ct,Ae,bt,dt,qe,Lt,Rt,At,Mt,Tt,qt,ln,pt,Sn=y.length;for(N=0;N<Sn;N++){qe=y[N];switch(qe.type){case"space":continue;case"hr":{A+=this.renderer.hr();continue}case"heading":{A+=this.renderer.heading(this.parseInline(qe.tokens),qe.depth,it(this.parseInline(qe.tokens,this.textRenderer)),this.slugger);continue}case"code":{A+=this.renderer.code(qe.text,qe.lang,qe.escaped);continue}case"table":{for(bt="",Ae="",Ge=qe.header.length,le=0;le<Ge;le++)Ae+=this.renderer.tablecell(this.parseInline(qe.tokens.header[le]),{header:!0,align:qe.align[le]});for(bt+=this.renderer.tablerow(Ae),dt="",Ge=qe.cells.length,le=0;le<Ge;le++){for(Ct=qe.tokens.cells[le],Ae="",st=Ct.length,Ce=0;Ce<st;Ce++)Ae+=this.renderer.tablecell(this.parseInline(Ct[Ce]),{header:!1,align:qe.align[Ce]});dt+=this.renderer.tablerow(Ae)}A+=this.renderer.table(bt,dt);continue}case"blockquote":{dt=this.parse(qe.tokens),A+=this.renderer.blockquote(dt);continue}case"list":{for(Lt=qe.ordered,Rt=qe.start,At=qe.loose,Ge=qe.items.length,dt="",le=0;le<Ge;le++)Tt=qe.items[le],qt=Tt.checked,ln=Tt.task,Mt="",Tt.task&&(pt=this.renderer.checkbox(qt),At?Tt.tokens.length>0&&Tt.tokens[0].type==="text"?(Tt.tokens[0].text=pt+" "+Tt.tokens[0].text,Tt.tokens[0].tokens&&Tt.tokens[0].tokens.length>0&&Tt.tokens[0].tokens[0].type==="text"&&(Tt.tokens[0].tokens[0].text=pt+" "+Tt.tokens[0].tokens[0].text)):Tt.tokens.unshift({type:"text",text:pt}):Mt+=pt),Mt+=this.parse(Tt.tokens,At),dt+=this.renderer.listitem(Mt,ln,qt);A+=this.renderer.list(dt,Lt,Rt);continue}case"html":{A+=this.renderer.html(qe.text);continue}case"paragraph":{A+=this.renderer.paragraph(this.parseInline(qe.tokens));continue}case"text":{for(dt=qe.tokens?this.parseInline(qe.tokens):qe.text;N+1<Sn&&y[N+1].type==="text";)qe=y[++N],dt+=`
`+(qe.tokens?this.parseInline(qe.tokens):qe.text);A+=x?this.renderer.paragraph(dt):dt;continue}default:{var un='Token with "'+qe.type+'" type was not found.';if(this.options.silent){console.error(un);return}else throw new Error(un)}}}return A},Y.parseInline=function(y,x){x=x||this.renderer;var A="",N,le,Ce=y.length;for(N=0;N<Ce;N++){le=y[N];switch(le.type){case"escape":{A+=x.text(le.text);break}case"html":{A+=x.html(le.text);break}case"link":{A+=x.link(le.href,le.title,this.parseInline(le.tokens,x));break}case"image":{A+=x.image(le.href,le.title,le.text);break}case"strong":{A+=x.strong(this.parseInline(le.tokens,x));break}case"em":{A+=x.em(this.parseInline(le.tokens,x));break}case"codespan":{A+=x.codespan(le.text);break}case"br":{A+=x.br();break}case"del":{A+=x.del(this.parseInline(le.tokens,x));break}case"text":{A+=x.text(le.text);break}default:{var Ge='Token with "'+le.type+'" type was not found.';if(this.options.silent){console.error(Ge);return}else throw new Error(Ge)}}}return A},ee}(),gt=D.merge,lt=D.checkSanitizeDeprecation,at=D.escape,Le=T.getDefaults,vt=T.changeDefaults,rt=T.defaults;function Oe(ee,Y,$){if(typeof ee=="undefined"||ee===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ee!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ee)+", string expected");if(typeof Y=="function"&&($=Y,Y=null),Y=gt({},Oe.defaults,Y||{}),lt(Y),$){var y=Y.highlight,x;try{x=_e.lex(ee,Y)}catch(Ce){return $(Ce)}var A=function(Ge){var st;if(!Ge)try{st=et.parse(x,Y)}catch(Ct){Ge=Ct}return Y.highlight=y,Ge?$(Ge):$(null,st)};if(!y||y.length<3)return A();if(delete Y.highlight,!x.length)return A();var N=0;Oe.walkTokens(x,function(Ce){Ce.type==="code"&&(N++,setTimeout(function(){y(Ce.text,Ce.lang,function(Ge,st){if(Ge)return A(Ge);st!=null&&st!==Ce.text&&(Ce.text=st,Ce.escaped=!0),N--,N===0&&A()})},0))}),N===0&&A();return}try{var le=_e.lex(ee,Y);return Y.walkTokens&&Oe.walkTokens(le,Y.walkTokens),et.parse(le,Y)}catch(Ce){if(Ce.message+=`
Please report this to https://github.com/markedjs/marked.`,Y.silent)return"<p>An error occurred:</p><pre>"+at(Ce.message+"",!0)+"</pre>";throw Ce}}Oe.options=Oe.setOptions=function(ee){return gt(Oe.defaults,ee),vt(Oe.defaults),Oe},Oe.getDefaults=Le,Oe.defaults=rt,Oe.use=function(ee){var Y=gt({},ee);if(ee.renderer&&function(){var y=Oe.defaults.renderer||new je,x=function(le){var Ce=y[le];y[le]=function(){for(var Ge=arguments.length,st=new Array(Ge),Ct=0;Ct<Ge;Ct++)st[Ct]=arguments[Ct];var Ae=ee.renderer[le].apply(y,st);return Ae===!1&&(Ae=Ce.apply(y,st)),Ae}};for(var A in ee.renderer)x(A);Y.renderer=y}(),ee.tokenizer&&function(){var y=Oe.defaults.tokenizer||new ge,x=function(le){var Ce=y[le];y[le]=function(){for(var Ge=arguments.length,st=new Array(Ge),Ct=0;Ct<Ge;Ct++)st[Ct]=arguments[Ct];var Ae=ee.tokenizer[le].apply(y,st);return Ae===!1&&(Ae=Ce.apply(y,st)),Ae}};for(var A in ee.tokenizer)x(A);Y.tokenizer=y}(),ee.walkTokens){var $=Oe.defaults.walkTokens;Y.walkTokens=function(y){ee.walkTokens(y),$&&$(y)}}Oe.setOptions(Y)},Oe.walkTokens=function(ee,Y){for(var $=fe(ee),y;!(y=$()).done;){var x=y.value;Y(x);switch(x.type){case"table":{for(var A=fe(x.tokens.header),N;!(N=A()).done;){var le=N.value;Oe.walkTokens(le,Y)}for(var Ce=fe(x.tokens.cells),Ge;!(Ge=Ce()).done;)for(var st=Ge.value,Ct=fe(st),Ae;!(Ae=Ct()).done;){var bt=Ae.value;Oe.walkTokens(bt,Y)}break}case"list":{Oe.walkTokens(x.items,Y);break}default:x.tokens&&Oe.walkTokens(x.tokens,Y)}}},Oe.Parser=et,Oe.parser=et.parse,Oe.Renderer=je,Oe.TextRenderer=Xe,Oe.Lexer=_e,Oe.lexer=_e.lex,Oe.Tokenizer=ge,Oe.Slugger=mt,Oe.parse=Oe;var ze=Oe;return ze})},ELLl:function(ot,Qe,k){(function(H){H(k("VrN/"))})(function(H){var se={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},ne=H.Pos;H.defineOption("autoCloseBrackets",!1,function(U,Z,W){W&&W!=H.Init&&(U.removeKeyMap(fe),U.state.closeBrackets=null),Z&&(z(we(Z,"pairs")),U.state.closeBrackets=Z,U.addKeyMap(fe))});function we(U,Z){return Z=="pairs"&&typeof U=="string"?U:typeof U=="object"&&U[Z]!=null?U[Z]:se[Z]}var fe={Backspace:B,Enter:_};function z(U){for(var Z=0;Z<U.length;Z++){var W=U.charAt(Z),ce="'"+W+"'";fe[ce]||(fe[ce]=T(W))}}z(se.pairs+"`");function T(U){return function(Z){return E(Z,U)}}function R(U){var Z=U.state.closeBrackets;if(!Z||Z.override)return Z;var W=U.getModeAt(U.getCursor());return W.closeBrackets||Z}function B(U){var Z=R(U);if(!Z||U.getOption("disableInput"))return H.Pass;for(var W=we(Z,"pairs"),ce=U.listSelections(),ae=0;ae<ce.length;ae++){if(!ce[ae].empty())return H.Pass;var Ie=te(U,ce[ae].head);if(!Ie||W.indexOf(Ie)%2!=0)return H.Pass}for(var ae=ce.length-1;ae>=0;ae--){var $e=ce[ae].head;U.replaceRange("",ne($e.line,$e.ch-1),ne($e.line,$e.ch+1),"+delete")}}function _(U){var Z=R(U),W=Z&&we(Z,"explode");if(!W||U.getOption("disableInput"))return H.Pass;for(var ce=U.listSelections(),ae=0;ae<ce.length;ae++){if(!ce[ae].empty())return H.Pass;var Ie=te(U,ce[ae].head);if(!Ie||W.indexOf(Ie)%2!=0)return H.Pass}U.operation(function(){var $e=U.lineSeparator()||`
`;U.replaceSelection($e+$e,null),U.execCommand("goCharLeft"),ce=U.listSelections();for(var Se=0;Se<ce.length;Se++){var De=ce[Se].head.line;U.indentLine(De,null,!0),U.indentLine(De+1,null,!0)}})}function L(U){var Z=H.cmpPos(U.anchor,U.head)>0;return{anchor:new ne(U.anchor.line,U.anchor.ch+(Z?-1:1)),head:new ne(U.head.line,U.head.ch+(Z?1:-1))}}function E(U,Z){var W=R(U);if(!W||U.getOption("disableInput"))return H.Pass;var ce=we(W,"pairs"),ae=ce.indexOf(Z);if(ae==-1)return H.Pass;for(var Ie=we(W,"closeBefore"),$e=we(W,"triples"),Se=ce.charAt(ae+1)==Z,De=U.listSelections(),Ve=ae%2==0,ke,Te=0;Te<De.length;Te++){var Pe=De[Te],ye=Pe.head,M,de=U.getRange(ye,ne(ye.line,ye.ch+1));if(Ve&&!Pe.empty())M="surround";else if((Se||!Ve)&&de==Z)Se&&Q(U,ye)?M="both":$e.indexOf(Z)>=0&&U.getRange(ye,ne(ye.line,ye.ch+3))==Z+Z+Z?M="skipThree":M="skip";else if(Se&&ye.ch>1&&$e.indexOf(Z)>=0&&U.getRange(ne(ye.line,ye.ch-2),ye)==Z+Z){if(ye.ch>2&&/\bstring/.test(U.getTokenTypeAt(ne(ye.line,ye.ch-2))))return H.Pass;M="addFour"}else if(Se){var ie=ye.ch==0?" ":U.getRange(ne(ye.line,ye.ch-1),ye);if(!H.isWordChar(de)&&ie!=Z&&!H.isWordChar(ie))M="both";else return H.Pass}else if(Ve&&(de.length===0||/\s/.test(de)||Ie.indexOf(de)>-1))M="both";else return H.Pass;if(!ke)ke=M;else if(ke!=M)return H.Pass}var w=ae%2?ce.charAt(ae-1):Z,j=ae%2?Z:ce.charAt(ae+1);U.operation(function(){if(ke=="skip")U.execCommand("goCharRight");else if(ke=="skipThree")for(var P=0;P<3;P++)U.execCommand("goCharRight");else if(ke=="surround"){for(var S=U.getSelections(),P=0;P<S.length;P++)S[P]=w+S[P]+j;U.replaceSelections(S,"around"),S=U.listSelections().slice();for(var P=0;P<S.length;P++)S[P]=L(S[P]);U.setSelections(S)}else ke=="both"?(U.replaceSelection(w+j,null),U.triggerElectric(w+j),U.execCommand("goCharLeft")):ke=="addFour"&&(U.replaceSelection(w+w+w+w,"before"),U.execCommand("goCharRight"))})}function te(U,Z){var W=U.getRange(ne(Z.line,Z.ch-1),ne(Z.line,Z.ch+1));return W.length==2?W:null}function Q(U,Z){var W=U.getTokenAt(ne(Z.line,Z.ch+1));return/\bstring/.test(W.type)&&W.start==Z.ch&&(Z.ch==0||!/\bstring/.test(U.getTokenTypeAt(Z)))}})},GfqC:function(ot,Qe,k){"use strict";var H=k("q1tI"),se=k.n(H),ne=k("TSYQ"),we=k.n(ne);function fe(D,p){var d="cannot "+D.method+" "+D.action+" "+p.status+"'",C=new Error(d);return C.status=p.status,C.method=D.method,C.url=D.action,C}function z(D){var p=D.responseText||D.response;if(!p)return p;try{return JSON.parse(p)}catch(d){return p}}function T(D){var p=new XMLHttpRequest;D.onProgress&&p.upload&&(p.upload.onprogress=function(J){J.total>0&&(J.percent=J.loaded/J.total*100),D.onProgress(J)});var d=new FormData;D.data&&Object.keys(D.data).forEach(function(F){var J=D.data[F];if(Array.isArray(J)){J.forEach(function(xe){d.append(F+"[]",xe)});return}d.append(F,D.data[F])}),D.file instanceof Blob?d.append(D.filename,D.file,D.file.name):d.append(D.filename,D.file),p.onerror=function(J){D.onError(J)},p.onload=function(){return p.status<200||p.status>=300?D.onError(fe(D,p),z(p)):D.onSuccess(z(p),p)},p.open(D.method,D.action,!0),D.withCredentials&&"withCredentials"in p&&(p.withCredentials=!0);var C=D.headers||{};return C["X-Requested-With"]!==null&&p.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(C).forEach(function(F){C[F]!==null&&p.setRequestHeader(F,C[F])}),p.send(d),{abort:function(){p.abort()}}}var R=+new Date,B=0;function _(){return"rc-upload-"+R+"-"+ ++B}function L(D,p){return D.indexOf(p,D.length-p.length)!==-1}var E=function(D,p){if(D&&p){var d=Array.isArray(p)?p:p.split(","),C=D.name||"",F=D.type||"",J=F.replace(/\/.*$/,"");return d.some(function(xe){var Me=xe.trim();return Me.charAt(0)==="."?L(C.toLowerCase(),Me.toLowerCase()):/\/\*$/.test(Me)?J===Me.replace(/\/.*$/,""):F===Me})}return!0};function te(D,p){var d=D.createReader(),C=[];function F(){d.readEntries(function(J){var xe=Array.prototype.slice.apply(J);C=C.concat(xe);var Me=!xe.length;Me?p(C):F()})}F()}var Q=function(p,d,C){var F=function J(xe,Me){Me=Me||"",xe.isFile?xe.file(function(ge){C(ge)&&(xe.fullPath&&!ge.webkitRelativePath&&(Object.defineProperties(ge,{webkitRelativePath:{writable:!0}}),ge.webkitRelativePath=xe.fullPath.replace(/^\//,""),Object.defineProperties(ge,{webkitRelativePath:{writable:!1}})),d([ge]))}):xe.isDirectory&&te(xe,function(ge){ge.forEach(function(ve){J(ve,""+Me+xe.name+"/")})})};p.forEach(function(J){F(J.webkitGetAsEntry())})},U=Q,Z=Object.assign||function(D){for(var p=1;p<arguments.length;p++){var d=arguments[p];for(var C in d)Object.prototype.hasOwnProperty.call(d,C)&&(D[C]=d[C])}return D},W=function(){function D(p,d){var C=[],F=!0,J=!1,xe=void 0;try{for(var Me=p[Symbol.iterator](),ge;!(F=(ge=Me.next()).done)&&!(C.push(ge.value),d&&C.length===d);F=!0);}catch(ve){J=!0,xe=ve}finally{try{!F&&Me.return&&Me.return()}finally{if(J)throw xe}}return C}return function(p,d){if(Array.isArray(p))return p;if(Symbol.iterator in Object(p))return D(p,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),ce=function(){function D(p,d){for(var C=0;C<d.length;C++){var F=d[C];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(p,F.key,F)}}return function(p,d,C){return d&&D(p.prototype,d),C&&D(p,C),p}}();function ae(D,p,d){return p in D?Object.defineProperty(D,p,{value:d,enumerable:!0,configurable:!0,writable:!0}):D[p]=d,D}function Ie(D,p){var d={};for(var C in D){if(p.indexOf(C)>=0)continue;if(!Object.prototype.hasOwnProperty.call(D,C))continue;d[C]=D[C]}return d}function $e(D,p){if(!(D instanceof p))throw new TypeError("Cannot call a class as a function")}function Se(D,p){if(!D)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:D}function De(D,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);D.prototype=Object.create(p&&p.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(D,p):D.__proto__=p)}var Ve=function(p){return Object.keys(p).reduce(function(d,C){return(C.substr(0,5)==="data-"||C.substr(0,5)==="aria-"||C==="role")&&(d[C]=p[C]),d},{})},ke=function(D){De(p,D);function p(){var d,C,F,J;$e(this,p);for(var xe=arguments.length,Me=Array(xe),ge=0;ge<xe;ge++)Me[ge]=arguments[ge];return J=(C=(F=Se(this,(d=p.__proto__||Object.getPrototypeOf(p)).call.apply(d,[this].concat(Me))),F),F.state={uid:_()},F.reqs={},F.onChange=function(ve){var me=ve.target.files;F.uploadFiles(me),F.reset()},F.onClick=function(ve){var me=F.fileInput;if(!me)return;var ue=F.props,q=ue.children,G=ue.onClick;q&&q.type==="button"&&(me.parentNode.focus(),me.parentNode.querySelector("button").blur()),me.click(),G&&G(ve)},F.onKeyDown=function(ve){ve.key==="Enter"&&F.onClick()},F.onFileDrop=function(ve){var me=F.props.multiple;if(ve.preventDefault(),ve.type==="dragover")return;if(F.props.directory)U(Array.prototype.slice.call(ve.dataTransfer.items),F.uploadFiles,function(q){return E(q,F.props.accept)});else{var ue=Array.prototype.slice.call(ve.dataTransfer.files).filter(function(q){return E(q,F.props.accept)});me===!1&&(ue=ue.slice(0,1)),F.uploadFiles(ue)}},F.uploadFiles=function(ve){var me=Array.prototype.slice.call(ve);me.map(function(ue){return ue.uid=_(),ue}).forEach(function(ue){F.upload(ue,me)})},F.saveFileInput=function(ve){F.fileInput=ve},C),Se(F,J)}return ce(p,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(C,F){var J=this,xe=this.props;if(!xe.beforeUpload)return setTimeout(function(){return J.post(C)},0);var Me=xe.beforeUpload(C,F);Me&&Me.then?Me.then(function(ge){var ve=Object.prototype.toString.call(ge);return ve==="[object File]"||ve==="[object Blob]"?J.post(ge):J.post(C)}).catch(function(ge){console.log(ge)}):Me!==!1&&setTimeout(function(){return J.post(C)},0);return}},{key:"post",value:function(C){var F=this;if(!this._isMounted)return;var J=this.props,xe=J.onStart,Me=J.onProgress,ge=J.transformFile,ve=ge===void 0?function(me){return me}:ge;new Promise(function(me){var ue=J.action;return typeof ue=="function"&&(ue=ue(C)),me(ue)}).then(function(me){var ue=C.uid,q=J.customRequest||T,G=Promise.resolve(ve(C)).then(function(b){var X=J.data;return typeof X=="function"&&(X=X(b)),Promise.all([b,X])}).catch(function(b){console.error(b)});G.then(function(b){var X=W(b,2),O=X[0],be=X[1],Ee={action:me,filename:J.name,data:be,file:O,headers:J.headers,withCredentials:J.withCredentials,method:J.method||"post",onProgress:Me?function(re){Me(re,C)}:null,onSuccess:function(_e,Ue){delete F.reqs[ue],J.onSuccess(_e,C,Ue)},onError:function(_e,Ue){delete F.reqs[ue],J.onError(_e,Ue,C)}};xe(C),F.reqs[ue]=q(Ee)})})}},{key:"reset",value:function(){this.setState({uid:_()})}},{key:"abort",value:function(C){var F=this.reqs;if(C){var J=C;C&&C.uid&&(J=C.uid),F[J]&&F[J].abort&&F[J].abort(),delete F[J]}else Object.keys(F).forEach(function(xe){F[xe]&&F[xe].abort&&F[xe].abort(),delete F[xe]})}},{key:"render",value:function(){var C,F=this.props,J=F.component,xe=F.prefixCls,Me=F.className,ge=F.disabled,ve=F.id,me=F.style,ue=F.multiple,q=F.accept,G=F.children,b=F.directory,X=F.openFileDialogOnClick,O=F.onMouseEnter,be=F.onMouseLeave,Ee=Ie(F,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),re=we()((C={},ae(C,xe,!0),ae(C,xe+"-disabled",ge),ae(C,Me,Me),C)),_e=ge?{}:{onClick:X?this.onClick:function(){},onKeyDown:X?this.onKeyDown:function(){},onMouseEnter:O,onMouseLeave:be,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return se.a.createElement(J,Z({},_e,{className:re,role:"button",style:me}),se.a.createElement("input",Z({},Ve(Ee),{id:ve,type:"file",ref:this.saveFileInput,onClick:function(Ke){return Ke.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:q,directory:b?"directory":null,webkitdirectory:b?"webkitdirectory":null,multiple:ue,onChange:this.onChange})),G)}}]),p}(H.Component),Te=ke,Pe=Object.assign||function(D){for(var p=1;p<arguments.length;p++){var d=arguments[p];for(var C in d)Object.prototype.hasOwnProperty.call(d,C)&&(D[C]=d[C])}return D},ye=function(){function D(p,d){for(var C=0;C<d.length;C++){var F=d[C];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(p,F.key,F)}}return function(p,d,C){return d&&D(p.prototype,d),C&&D(p,C),p}}();function M(D,p){if(!(D instanceof p))throw new TypeError("Cannot call a class as a function")}function de(D,p){if(!D)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:D}function ie(D,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);D.prototype=Object.create(p&&p.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(D,p):D.__proto__=p)}function w(){}var j=function(D){ie(p,D);function p(){var d,C,F,J;M(this,p);for(var xe=arguments.length,Me=Array(xe),ge=0;ge<xe;ge++)Me[ge]=arguments[ge];return J=(C=(F=de(this,(d=p.__proto__||Object.getPrototypeOf(p)).call.apply(d,[this].concat(Me))),F),F.saveUploader=function(ve){F.uploader=ve},C),de(F,J)}return ye(p,[{key:"abort",value:function(C){this.uploader.abort(C)}},{key:"render",value:function(){return se.a.createElement(Te,Pe({},this.props,{ref:this.saveUploader}))}}]),p}(H.Component);j.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:w,onError:w,onSuccess:w,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var P=j,S=Qe.a=P},Gytx:function(ot,Qe){ot.exports=function(H,se,ne,we){var fe=ne?ne.call(we,H,se):void 0;if(fe!==void 0)return!!fe;if(H===se)return!0;if(typeof H!="object"||!H||typeof se!="object"||!se)return!1;var z=Object.keys(H),T=Object.keys(se);if(z.length!==T.length)return!1;for(var R=Object.prototype.hasOwnProperty.bind(se),B=0;B<z.length;B++){var _=z[B];if(!R(_))return!1;var L=H[_],E=se[_];if(fe=ne?ne.call(we,L,E,_):void 0,fe===!1||fe===void 0&&L!==E)return!1}return!0}},H38U:function(ot,Qe,k){var H=k("f4xo"),se=k("rcnY"),ne=k("wU8J"),we=k("Iq15"),fe=k("dWSS");function z(R,B){this.typeNumber=R,this.errorCorrectLevel=B,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var T=z.prototype;T.addData=function(R){var B=new H(R);this.dataList.push(B),this.dataCache=null},T.isDark=function(R,B){if(R<0||this.moduleCount<=R||B<0||this.moduleCount<=B)throw new Error(R+","+B);return this.modules[R][B]},T.getModuleCount=function(){return this.moduleCount},T.make=function(){if(this.typeNumber<1){var R=1;for(R=1;R<40;R++){for(var B=se.getRSBlocks(R,this.errorCorrectLevel),_=new ne,L=0,E=0;E<B.length;E++)L+=B[E].dataCount;for(var E=0;E<this.dataList.length;E++){var te=this.dataList[E];_.put(te.mode,4),_.put(te.getLength(),we.getLengthInBits(te.mode,R)),te.write(_)}if(_.getLengthInBits()<=L*8)break}this.typeNumber=R}this.makeImpl(!1,this.getBestMaskPattern())},T.makeImpl=function(R,B){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var _=0;_<this.moduleCount;_++){this.modules[_]=new Array(this.moduleCount);for(var L=0;L<this.moduleCount;L++)this.modules[_][L]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(R,B),this.typeNumber>=7&&this.setupTypeNumber(R),this.dataCache==null&&(this.dataCache=z.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,B)},T.setupPositionProbePattern=function(R,B){for(var _=-1;_<=7;_++){if(R+_<=-1||this.moduleCount<=R+_)continue;for(var L=-1;L<=7;L++){if(B+L<=-1||this.moduleCount<=B+L)continue;0<=_&&_<=6&&(L==0||L==6)||0<=L&&L<=6&&(_==0||_==6)||2<=_&&_<=4&&2<=L&&L<=4?this.modules[R+_][B+L]=!0:this.modules[R+_][B+L]=!1}}},T.getBestMaskPattern=function(){for(var R=0,B=0,_=0;_<8;_++){this.makeImpl(!0,_);var L=we.getLostPoint(this);(_==0||R>L)&&(R=L,B=_)}return B},T.createMovieClip=function(R,B,_){var L=R.createEmptyMovieClip(B,_),E=1;this.make();for(var te=0;te<this.modules.length;te++)for(var Q=te*E,U=0;U<this.modules[te].length;U++){var Z=U*E,W=this.modules[te][U];W&&(L.beginFill(0,100),L.moveTo(Z,Q),L.lineTo(Z+E,Q),L.lineTo(Z+E,Q+E),L.lineTo(Z,Q+E),L.endFill())}return L},T.setupTimingPattern=function(){for(var R=8;R<this.moduleCount-8;R++){if(this.modules[R][6]!=null)continue;this.modules[R][6]=R%2==0}for(var B=8;B<this.moduleCount-8;B++){if(this.modules[6][B]!=null)continue;this.modules[6][B]=B%2==0}},T.setupPositionAdjustPattern=function(){for(var R=we.getPatternPosition(this.typeNumber),B=0;B<R.length;B++)for(var _=0;_<R.length;_++){var L=R[B],E=R[_];if(this.modules[L][E]!=null)continue;for(var te=-2;te<=2;te++)for(var Q=-2;Q<=2;Q++)te==-2||te==2||Q==-2||Q==2||te==0&&Q==0?this.modules[L+te][E+Q]=!0:this.modules[L+te][E+Q]=!1}},T.setupTypeNumber=function(R){for(var B=we.getBCHTypeNumber(this.typeNumber),_=0;_<18;_++){var L=!R&&(B>>_&1)==1;this.modules[Math.floor(_/3)][_%3+this.moduleCount-8-3]=L}for(var _=0;_<18;_++){var L=!R&&(B>>_&1)==1;this.modules[_%3+this.moduleCount-8-3][Math.floor(_/3)]=L}},T.setupTypeInfo=function(R,B){for(var _=this.errorCorrectLevel<<3|B,L=we.getBCHTypeInfo(_),E=0;E<15;E++){var te=!R&&(L>>E&1)==1;E<6?this.modules[E][8]=te:E<8?this.modules[E+1][8]=te:this.modules[this.moduleCount-15+E][8]=te}for(var E=0;E<15;E++){var te=!R&&(L>>E&1)==1;E<8?this.modules[8][this.moduleCount-E-1]=te:E<9?this.modules[8][15-E-1+1]=te:this.modules[8][15-E-1]=te}this.modules[this.moduleCount-8][8]=!R},T.mapData=function(R,B){for(var _=-1,L=this.moduleCount-1,E=7,te=0,Q=this.moduleCount-1;Q>0;Q-=2)for(Q==6&&Q--;;){for(var U=0;U<2;U++)if(this.modules[L][Q-U]==null){var Z=!1;te<R.length&&(Z=(R[te]>>>E&1)==1);var W=we.getMask(B,L,Q-U);W&&(Z=!Z),this.modules[L][Q-U]=Z,E--,E==-1&&(te++,E=7)}if(L+=_,L<0||this.moduleCount<=L){L-=_,_=-_;break}}},z.PAD0=236,z.PAD1=17,z.createData=function(R,B,_){for(var L=se.getRSBlocks(R,B),E=new ne,te=0;te<_.length;te++){var Q=_[te];E.put(Q.mode,4),E.put(Q.getLength(),we.getLengthInBits(Q.mode,R)),Q.write(E)}for(var U=0,te=0;te<L.length;te++)U+=L[te].dataCount;if(E.getLengthInBits()>U*8)throw new Error("code length overflow. ("+E.getLengthInBits()+">"+U*8+")");for(E.getLengthInBits()+4<=U*8&&E.put(0,4);E.getLengthInBits()%8!=0;)E.putBit(!1);for(;!(E.getLengthInBits()>=U*8);){if(E.put(z.PAD0,8),E.getLengthInBits()>=U*8)break;E.put(z.PAD1,8)}return z.createBytes(E,L)},z.createBytes=function(R,B){for(var _=0,L=0,E=0,te=new Array(B.length),Q=new Array(B.length),U=0;U<B.length;U++){var Z=B[U].dataCount,W=B[U].totalCount-Z;L=Math.max(L,Z),E=Math.max(E,W),te[U]=new Array(Z);for(var ce=0;ce<te[U].length;ce++)te[U][ce]=255&R.buffer[ce+_];_+=Z;var ae=we.getErrorCorrectPolynomial(W),Ie=new fe(te[U],ae.getLength()-1),$e=Ie.mod(ae);Q[U]=new Array(ae.getLength()-1);for(var ce=0;ce<Q[U].length;ce++){var Se=ce+$e.getLength()-Q[U].length;Q[U][ce]=Se>=0?$e.get(Se):0}}for(var De=0,ce=0;ce<B.length;ce++)De+=B[ce].totalCount;for(var Ve=new Array(De),ke=0,ce=0;ce<L;ce++)for(var U=0;U<B.length;U++)ce<te[U].length&&(Ve[ke++]=te[U][ce]);for(var ce=0;ce<E;ce++)for(var U=0;U<B.length;U++)ce<Q[U].length&&(Ve[ke++]=Q[U][ce]);return Ve},ot.exports=z},HmJG:function(ot,Qe,k){},Iq15:function(ot,Qe,k){var H=k("nVVt"),se=k("dWSS"),ne=k("dQei"),we={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},fe={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(z){for(var T=z<<10;fe.getBCHDigit(T)-fe.getBCHDigit(fe.G15)>=0;)T^=fe.G15<<fe.getBCHDigit(T)-fe.getBCHDigit(fe.G15);return(z<<10|T)^fe.G15_MASK},getBCHTypeNumber:function(z){for(var T=z<<12;fe.getBCHDigit(T)-fe.getBCHDigit(fe.G18)>=0;)T^=fe.G18<<fe.getBCHDigit(T)-fe.getBCHDigit(fe.G18);return z<<12|T},getBCHDigit:function(z){for(var T=0;z!=0;)T++,z>>>=1;return T},getPatternPosition:function(z){return fe.PATTERN_POSITION_TABLE[z-1]},getMask:function(z,T,R){switch(z){case we.PATTERN000:return(T+R)%2==0;case we.PATTERN001:return T%2==0;case we.PATTERN010:return R%3==0;case we.PATTERN011:return(T+R)%3==0;case we.PATTERN100:return(Math.floor(T/2)+Math.floor(R/3))%2==0;case we.PATTERN101:return T*R%2+T*R%3==0;case we.PATTERN110:return(T*R%2+T*R%3)%2==0;case we.PATTERN111:return(T*R%3+(T+R)%2)%2==0;default:throw new Error("bad maskPattern:"+z)}},getErrorCorrectPolynomial:function(z){for(var T=new se([1],0),R=0;R<z;R++)T=T.multiply(new se([1,ne.gexp(R)],0));return T},getLengthInBits:function(z,T){if(1<=T&&T<10)switch(z){case H.MODE_NUMBER:return 10;case H.MODE_ALPHA_NUM:return 9;case H.MODE_8BIT_BYTE:return 8;case H.MODE_KANJI:return 8;default:throw new Error("mode:"+z)}else if(T<27)switch(z){case H.MODE_NUMBER:return 12;case H.MODE_ALPHA_NUM:return 11;case H.MODE_8BIT_BYTE:return 16;case H.MODE_KANJI:return 10;default:throw new Error("mode:"+z)}else if(T<41)switch(z){case H.MODE_NUMBER:return 14;case H.MODE_ALPHA_NUM:return 13;case H.MODE_8BIT_BYTE:return 16;case H.MODE_KANJI:return 12;default:throw new Error("mode:"+z)}else throw new Error("type:"+T)},getLostPoint:function(z){for(var T=z.getModuleCount(),R=0,B=0;B<T;B++)for(var _=0;_<T;_++){for(var L=0,E=z.isDark(B,_),te=-1;te<=1;te++){if(B+te<0||T<=B+te)continue;for(var Q=-1;Q<=1;Q++){if(_+Q<0||T<=_+Q)continue;if(te==0&&Q==0)continue;E==z.isDark(B+te,_+Q)&&L++}}L>5&&(R+=3+L-5)}for(var B=0;B<T-1;B++)for(var _=0;_<T-1;_++){var U=0;z.isDark(B,_)&&U++,z.isDark(B+1,_)&&U++,z.isDark(B,_+1)&&U++,z.isDark(B+1,_+1)&&U++,(U==0||U==4)&&(R+=3)}for(var B=0;B<T;B++)for(var _=0;_<T-6;_++)z.isDark(B,_)&&!z.isDark(B,_+1)&&z.isDark(B,_+2)&&z.isDark(B,_+3)&&z.isDark(B,_+4)&&!z.isDark(B,_+5)&&z.isDark(B,_+6)&&(R+=40);for(var _=0;_<T;_++)for(var B=0;B<T-6;B++)z.isDark(B,_)&&!z.isDark(B+1,_)&&z.isDark(B+2,_)&&z.isDark(B+3,_)&&z.isDark(B+4,_)&&!z.isDark(B+5,_)&&z.isDark(B+6,_)&&(R+=40);for(var Z=0,_=0;_<T;_++)for(var B=0;B<T;B++)z.isDark(B,_)&&Z++;var W=Math.abs(100*Z/T/T-50)/5;return R+=W*10,R}};ot.exports=fe},LdHM:function(ot,Qe,k){"use strict";k.d(Qe,"b",function(){return Ie}),k.d(Qe,"a",function(){return Se});var H=k("1OyB"),se=k("vuIU"),ne=k("Ji7U"),we=k("LK+K"),fe=k("q1tI"),z=k("rePB"),T=k("Ff2n"),R=k("ODXe"),B=k("4IlW"),_=k("bX4T"),L=k("YrtM"),E=k("TSYQ"),te=k.n(E),Q=k("+nKL"),U=k("8OUc"),Z=function(C,F){var J=C.prefixCls,xe=C.id,Me=C.flattenOptions,ge=C.childrenAsData,ve=C.values,me=C.searchValue,ue=C.multiple,q=C.defaultActiveFirstOption,G=C.height,b=C.itemHeight,X=C.notFoundContent,O=C.open,be=C.menuItemSelectedIcon,Ee=C.virtual,re=C.onSelect,_e=C.onToggleOpen,Ue=C.onActiveValue,Ke=C.onScroll,He=C.onMouseEnter,je="".concat(J,"-item"),Xe=Object(L.a)(function(){return Me},[O,Me],function(ze,ee){return ee[0]&&ze[1]!==ee[1]}),mt=fe.useRef(null),tt=function(ee){ee.preventDefault()},it=function(ee){mt.current&&mt.current.scrollTo({index:ee})},et=function(ee){for(var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,$=Xe.length,y=0;y<$;y+=1){var x=(ee+y*Y+$)%$,A=Xe[x],N=A.group,le=A.data;if(!N&&!le.disabled)return x}return-1},gt=fe.useState(function(){return et(0)}),lt=Object(R.a)(gt,2),at=lt[0],Le=lt[1],vt=function(ee){Le(ee);var Y=Xe[ee];if(!Y){Ue(null,-1);return}Ue(Y.data.value,ee)};fe.useEffect(function(){vt(q!==!1?et(0):-1)},[Xe.length,me]),fe.useEffect(function(){var ze=setTimeout(function(){if(!ue&&O&&ve.size===1){var ee=Array.from(ve)[0],Y=Xe.findIndex(function($){var y=$.data;return y.value===ee});vt(Y),it(Y)}});return function(){return clearTimeout(ze)}},[O]);var rt=function(ee){ee!==void 0&&re(ee,{selected:!ve.has(ee)}),ue||_e(!1)};if(fe.useImperativeHandle(F,function(){return{onKeyDown:function(ee){var Y=ee.which;switch(Y){case B.a.UP:case B.a.DOWN:{var $=0;if(Y===B.a.UP?$=-1:Y===B.a.DOWN&&($=1),$!==0){var y=et(at+$,$);it(y),vt(y)}break}case B.a.ENTER:{var x=Xe[at];x&&!x.data.disabled?rt(x.data.value):rt(void 0),O&&ee.preventDefault();break}case B.a.ESC:_e(!1)}},onKeyUp:function(){},scrollTo:function(ee){it(ee)}}}),Xe.length===0)return fe.createElement("div",{role:"listbox",id:"".concat(xe,"_list"),className:"".concat(je,"-empty"),onMouseDown:tt},X);function Oe(ze){var ee=Xe[ze];if(!ee)return null;var Y=ee.data||{},$=Y.value,y=Y.label,x=Y.children,A=Object(_.a)(Y,!0),N=ge?x:y;return ee?fe.createElement("div",Object.assign({"aria-label":typeof N=="string"?N:null},A,{key:ze,role:"option",id:"".concat(xe,"_list_").concat(ze),"aria-selected":ve.has($)}),$):null}return fe.createElement(fe.Fragment,null,fe.createElement("div",{role:"listbox",id:"".concat(xe,"_list"),style:{height:0,width:0,overflow:"hidden"}},Oe(at-1),Oe(at),Oe(at+1)),fe.createElement(Q.a,{itemKey:"key",ref:mt,data:Xe,height:G,itemHeight:b,fullHeight:!1,onMouseDown:tt,onScroll:Ke,virtual:Ee,onMouseEnter:He},function(ze,ee){var Y,$=ze.group,y=ze.groupOption,x=ze.data,A=x.label,N=x.key;if($)return fe.createElement("div",{className:te()(je,"".concat(je,"-group"))},A!==void 0?A:N);var le=x.disabled,Ce=x.value,Ge=x.title,st=x.children,Ct=x.style,Ae=x.className,bt=Object(T.a)(x,["disabled","value","title","children","style","className"]),dt=ve.has(Ce),qe="".concat(je,"-option"),Lt=te()(je,qe,Ae,(Y={},Object(z.a)(Y,"".concat(qe,"-grouped"),y),Object(z.a)(Y,"".concat(qe,"-active"),at===ee&&!le),Object(z.a)(Y,"".concat(qe,"-disabled"),le),Object(z.a)(Y,"".concat(qe,"-selected"),dt),Y)),Rt=ge?st:A,At=!be||typeof be=="function"||dt;return fe.createElement("div",Object.assign({},bt,{"aria-selected":dt,className:Lt,title:Ge,onMouseMove:function(){if(at===ee||le)return;vt(ee)},onClick:function(){le||rt(Ce)},style:Ct}),fe.createElement("div",{className:"".concat(qe,"-content")},Rt||Ce),fe.isValidElement(be)||dt,At&&fe.createElement(U.a,{className:"".concat(je,"-option-state"),customizeIcon:be,customizeIconProps:{isSelected:dt}},dt?"\u2713":null))}))},W=fe.forwardRef(Z);W.displayName="OptionList";var ce=W,ae=function(){return null};ae.isSelectOption=!0;var Ie=ae,$e=function(){return null};$e.isSelectOptGroup=!0;var Se=$e,De=k("VTBJ"),Ve=k("Zm9Q");function ke(d){var C=d.key,F=d.props,J=F.children,xe=F.value,Me=Object(T.a)(F,["children","value"]);return Object(De.a)({key:C,value:xe!==void 0?xe:C,children:J},Me)}function Te(d){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(Ve.a)(d).map(function(F,J){if(!fe.isValidElement(F)||!F.type)return null;var xe=F.type.isSelectOptGroup,Me=F.key,ge=F.props,ve=ge.children,me=Object(T.a)(ge,["children"]);return C||!xe?ke(F):Object(De.a)(Object(De.a)({key:"__RC_SELECT_GRP__".concat(Me===null?J:Me,"__"),label:Me},me),{},{options:Te(ve)})}).filter(function(F){return F})}var Pe=k("2Qr1"),ye=k("qNPg"),M=k("U8pU"),de=k("Kwbf"),ie=k("WKfj");function w(d){var C=d.mode,F=d.options,J=d.children,xe=d.backfill,Me=d.allowClear,ge=d.placeholder,ve=d.getInputElement,me=d.showSearch,ue=d.onSearch,q=d.defaultOpen,G=d.autoFocus,b=d.labelInValue,X=d.value,O=d.inputValue,be=d.optionLabelProp,Ee=C==="multiple"||C==="tags",re=me!==void 0?me:Ee||C==="combobox",_e=F||Te(J);if(Object(de.a)(C!=="tags"||_e.every(function(je){return!je.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),C==="tags"||C==="combobox"){var Ue=_e.some(function(je){return je.options?je.options.some(function(Xe){return typeof("value"in Xe?Xe.value:Xe.key)=="number"}):typeof("value"in je?je.value:je.key)=="number"});Object(de.a)(!Ue,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(de.a)(C!=="combobox"||!be,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(de.a)(C==="combobox"||!xe,"`backfill` only works with `combobox` mode."),Object(de.a)(C==="combobox"||!ve,"`getInputElement` only work with `combobox` mode."),Object(de.b)(C!=="combobox"||!ve||!Me||!ge,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ue&&!re&&C!=="combobox"&&C!=="tags"&&Object(de.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(de.b)(!q||G,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),X!=null){var Ke=Object(ie.d)(X);Object(de.a)(!b||Ke.every(function(je){return Object(M.a)(je)==="object"&&("key"in je||"value"in je)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(de.a)(!Ee||Array.isArray(X),"`value` should be array when `mode` is `multiple` or `tags`")}if(J){var He=null;Object(Ve.a)(J).some(function(je){if(!fe.isValidElement(je)||!je.type)return!1;var Xe=je.type;if(Xe.isSelectOption)return!1;if(Xe.isSelectOptGroup){var mt=Object(Ve.a)(je.props.children).every(function(tt){return!fe.isValidElement(tt)||!je.type||tt.type.isSelectOption?!0:(He=tt.type,!1)});return!mt}return He=Xe,!0}),He&&Object(de.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(He.displayName||He.name||He,"`.")),Object(de.a)(O===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var j=w,P=Object(ye.a)({prefixCls:"rc-select",components:{optionList:ce},convertChildrenToData:Te,flattenOptions:Pe.d,getLabeledValue:Pe.e,filterOptions:Pe.b,isValueDisabled:Pe.g,findValueOption:Pe.c,warningProps:j,fillOptionsWithMissingValue:Pe.a}),S=function(d){Object(ne.a)(F,d);var C=Object(we.a)(F);function F(){var J;return Object(H.a)(this,F),J=C.apply(this,arguments),J.selectRef=fe.createRef(),J.focus=function(){J.selectRef.current.focus()},J.blur=function(){J.selectRef.current.blur()},J}return Object(se.a)(F,[{key:"render",value:function(){return fe.createElement(P,Object.assign({ref:this.selectRef},this.props))}}]),F}(fe.Component);S.Option=Ie,S.OptGroup=Se;var D=S,p=Qe.c=D},M8RZ:function(ot,Qe,k){"use strict";k.d(Qe,"a",function(){return B});var H=k("fWQN"),se=k("mtLc"),ne=k("yKVA"),we=k("879j"),fe=k("q1tI"),z=k.n(fe),T=k("i8i4"),R=k.n(T),B=function(_){Object(ne.a)(E,_);var L=Object(we.a)(E);function E(te){var Q;Object(H.a)(this,E),Q=L.call(this,te);var U=window.document;return Q.node=U.createElement("div"),U.body.appendChild(Q.node),Q}return Object(se.a)(E,[{key:"render",value:function(){var Q=this.props.children;return Object(T.createPortal)(Q,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),E}(z.a.Component)},OLES:function(ot,Qe,k){"use strict";var H=k("U8pU"),se=k("VTBJ"),ne=k("Ff2n"),we=k("q1tI"),fe=k("uciX"),z=k("7ixt"),T=function(te){var Q=te.overlay,U=te.prefixCls,Z=te.id,W=te.overlayInnerStyle;return we.createElement("div",{className:"".concat(U,"-inner"),id:Z,role:"tooltip",style:W},typeof Q=="function"?Q():Q)},R=T,B=function(te,Q){var U=te.overlayClassName,Z=te.trigger,W=Z===void 0?["hover"]:Z,ce=te.mouseEnterDelay,ae=ce===void 0?0:ce,Ie=te.mouseLeaveDelay,$e=Ie===void 0?.1:Ie,Se=te.overlayStyle,De=te.prefixCls,Ve=De===void 0?"rc-tooltip":De,ke=te.children,Te=te.onVisibleChange,Pe=te.afterVisibleChange,ye=te.transitionName,M=te.animation,de=te.placement,ie=de===void 0?"right":de,w=te.align,j=w===void 0?{}:w,P=te.destroyTooltipOnHide,S=P===void 0?!1:P,D=te.defaultVisible,p=te.getTooltipContainer,d=te.overlayInnerStyle,C=Object(ne.a)(te,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),F=Object(we.useRef)(null);Object(we.useImperativeHandle)(Q,function(){return F.current});var J=Object(se.a)({},C);"visible"in te&&(J.popupVisible=te.visible);var xe=function(){var ue=te.arrowContent,q=ue===void 0?null:ue,G=te.overlay,b=te.id;return[we.createElement("div",{className:"".concat(Ve,"-arrow"),key:"arrow"},q),we.createElement(R,{key:"content",prefixCls:Ve,id:b,overlay:G,overlayInnerStyle:d})]},Me=!1,ge=!1;if(typeof S=="boolean")Me=S;else if(S&&Object(H.a)(S)==="object"){var ve=S.keepParent;Me=ve===!0,ge=ve===!1}return we.createElement(fe.a,Object.assign({popupClassName:U,prefixCls:Ve,popup:xe,action:W,builtinPlacements:z.a,popupPlacement:ie,ref:F,popupAlign:j,getPopupContainer:p,onPopupVisibleChange:Te,afterPopupVisibleChange:Pe,popupTransitionName:ye,popupAnimation:M,defaultPopupVisible:D,destroyPopupOnHide:Me,autoDestroy:ge,mouseLeaveDelay:$e,popupStyle:Se,mouseEnterDelay:ae},J),ke)},_=Object(we.forwardRef)(B),L=Qe.a=_},Ot1p:function(ot,Qe,k){"use strict";var H=k("2qtc"),se=k("kLXV"),ne=k("rAM+"),we=k("miYZ"),fe=k("tsqr"),z=k("9og8"),T=k("tJVT"),R=k("jrin"),B=k("WmNS"),_=k.n(B),L=k("q1tI"),E=k.n(L),te=k("VrN/"),Q=k.n(te),U=k("bdgK"),Z=k("p77/"),W=k("Bd2K"),ce=k("ELLl"),ae=k("19Vz"),Ie=k("lZu9"),$e=k("+NIl"),Se=k("kSUc"),De=k("9Bee"),Ve=function(Ae){var bt=Ae.value,dt=bt===void 0?"":bt,qe=Ae.className,Lt=Ae.showTextOnly,Rt=Ae.showLines,At=Ae.style,Mt=At===void 0?{}:At,Tt=Object(L.useMemo)(function(){return""},[dt]);return E.a.createElement(E.a.Fragment,null,E.a.createElement("div",{dangerouslySetInnerHTML:{__html:Tt}}))},ke=k("Q9mQ"),Te=k("diRs"),Pe=k("0Owb"),ye=k("dejd"),M=k("C+DQ"),de=k("D1Df"),ie=k.n(de),w=k("1vsH"),j=k("m3rI"),P=[{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 S(Ae){var bt=Ae.onActionCallback,dt=Ae.title,qe=Ae.icon,Lt=Ae.actionName,Rt=Ae.className,At=Rt===void 0?"":Rt,Mt=Ae.children;function Tt(){bt(Lt)}return E.a.createElement("a",{title:dt,className:At,onClick:Tt},E.a.createElement("i",{className:"md-iconfont ".concat(qe)}),Mt)}var D=function(Ae){var bt=Ae.watch,dt=Ae.showNullButton,qe=Ae.onActionCallback,Lt=Ae.fullScreen,Rt=Ae.insertTemp,At=Ae.hidetoolBar,Mt=Ae.uuid,Tt=Ae.setOpenPhones,qt=Object(w.E)("_educoder_session_login"),ln=Object(w.E)("_educoder_session"),pt=[].concat(P,[{title:"".concat(bt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(bt?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return E.a.createElement("ul",{className:"markdown-toolbar-container"},!At&&pt.map(function(Sn,un){return E.a.createElement("li",{key:un},Sn.actionName?E.a.createElement(S,Object(Pe.a)({},Sn,{onActionCallback:qe})):E.a.createElement("span",{className:"v-line"}))}),dt?E.a.createElement("li",null,E.a.createElement(S,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:qe},E.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Rt&&E.a.createElement("li",null,E.a.createElement(S,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Rt),onActionCallback:qe},E.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),E.a.createElement("li",null,E.a.createElement(Te.a,{title:"\u6253\u5F00\u624B\u673A\u626B\u4E00\u626B",content:E.a.createElement("div",null,E.a.createElement("span",{style:{display:"none"}},"test----",location.origin+"/upload.html?_educoder_session_login="+qt+"&_educoder_session="+ln+"&key="+Mt+"&api="+encodeURIComponent(j.a.API_SERVER)),E.a.createElement(ie.a,{size:150,fgColor:"#000",value:location.origin+"/upload.html?_educoder_session_login="+qt+"&_educoder_session="+ln+"&key="+Mt+"&api="+encodeURIComponent(j.a.API_SERVER)}))},E.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return Tt(!0)}},"\u624B\u673A\u4E0A\u4F20\u6587\u4EF6"))),E.a.createElement("li",{className:"btn-full-screen"},E.a.createElement(S,{icon:"".concat(Lt?"icon-shrink":"icon-enlarge"),title:Lt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:qe})))},p=k("M8RZ"),d=k("+L6B"),C=k("2/Rp"),F=k("y8nQ"),J=k("Vl3Y"),xe=k("5NDa"),Me=k("5rEg"),ge={labelCol:{span:4},wrapperCol:{span:20}},ve=function(Ae){var bt=Ae.callback,dt=Ae.onCancel;function qe(Lt){bt(Lt)}return E.a.createElement(J.a,Object(Pe.a)({},ge,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:qe}),E.a.createElement(J.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},E.a.createElement(Me.a,null)),E.a.createElement(J.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},E.a.createElement(Me.a,null)),E.a.createElement("div",{className:"flex-container flex-end"},E.a.createElement(C.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),E.a.createElement(C.a,{type:"ghost",onClick:dt},"\u53D6\u6D88")))},me=k("7ahc"),ue=k("k1fw"),q=k("HmJG"),G=k("BjJ7"),b=J.a.useForm,X={width:280,marginRight:10},O={labelCol:{span:5},wrapperCol:{span:19}},be=function(Ae){var bt=Ae.callback,dt=Ae.onCancel,qe=b(),Lt=Object(T.a)(qe,1),Rt=Lt[0],At=Object(L.useRef)();function Mt(ln){bt(Object(ue.a)(Object(ue.a)({},ln),{},{name:At.current}))}function Tt(ln,pt){Rt.setFieldsValue({src:"/api/attachments/".concat(ln.id,"?type=").concat(ln.content_type),type:pt.type})}function qt(ln){var pt=ln.target.files[0];At.current=pt.name,re(pt,Tt)}return E.a.createElement(J.a,Object(Pe.a)({form:Rt},O,{className:"upload-image-panel",onFinish:Mt}),E.a.createElement(J.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},E.a.createElement("div",{className:"flex-container"},E.a.createElement(J.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},E.a.createElement(Me.a,{style:X})),E.a.createElement(Ee,{onFileChange:qt}))),E.a.createElement(J.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},E.a.createElement(Me.a,{style:{width:264}})),E.a.createElement(J.a.Item,{style:{textAlign:"right"}},E.a.createElement(C.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),E.a.createElement(C.a,{type:"ghost",onClick:dt},"\u53D6\u6D88")))};function Ee(Ae){var bt=Ae.onFileChange;return E.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",E.a.createElement("input",{type:"file",onChange:bt}))}function re(Ae,bt){if(!Ae)throw new String("\u6CA1\u6709\u6587\u4EF6");var dt=new FormData;dt.append("editormd-image-file",Ae),dt.append("file_param_name","editormd-image-file"),dt.append("byxhr","true");var qe=new window.XMLHttpRequest;qe.withCredentials=!0,qe.addEventListener("load",function(Lt){bt(JSON.parse(Lt.target.responseText),Ae)},!1),qe.addEventListener("error",function(Lt){console.error(Lt)},!1),qe.open("POST","".concat(G.a,"/api/attachments.json")),qe.send(dt)}var _e=k("giR+"),Ue=k("fyUT"),Ke=k("7Kak"),He=k("9yH6"),je=He.a.Group,Xe={margin:"0 8px"},mt=function(Ae){var bt=Ae.callback,dt=Ae.onCancel;function qe(Lt){bt(Lt)}return E.a.createElement(J.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:qe},E.a.createElement("div",{className:"flex-container"},E.a.createElement("span",{style:Xe},"\u5355\u5143\u683C\u6570\uFF1A"),E.a.createElement("span",{style:Xe},"\u884C\u6570"),E.a.createElement(J.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},E.a.createElement(Ue.a,null)),E.a.createElement("span",{style:Xe},"\u5217\u6570"),E.a.createElement(J.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},E.a.createElement(Ue.a,null))),E.a.createElement("div",{className:"flex-container",style:{marginTop:12}},E.a.createElement("span",{style:Xe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),E.a.createElement(J.a.Item,{name:"align"},E.a.createElement(je,null,E.a.createElement(He.a,{value:"default"},E.a.createElement("i",{className:"fa fa-align-justify"})),E.a.createElement(He.a,{value:"left"},E.a.createElement("i",{className:"fa fa-align-left"})),E.a.createElement(He.a,{value:"center"},E.a.createElement("i",{className:"fa fa-align-center"})),E.a.createElement(He.a,{value:"right"},E.a.createElement("i",{className:"fa fa-align-right"}))))),E.a.createElement("div",{className:"flex-container flex-end"},E.a.createElement(C.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),E.a.createElement(C.a,{type:"ghost",onClick:dt},"\u53D6\u6D88")))},tt=k("ErOA"),it=k("7Cbv"),et="link",gt="upload-image",lt="code-block",at="add-table",Le="------------",vt={default:Le,left:":".concat(Le),center:":".concat(Le,":"),right:"".concat(Le,":")},rt=k("9VGf"),Oe,ze;function ee(){}var Y=0,$=1e4,y="\u2581",x=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function A(Ae){return/^\d+$/.test(Ae)?"".concat(Ae,"px"):Ae}var N=navigator.platform.toUpperCase().indexOf("MAC")>=0,le=N?"Cmd":"Ctrl",Ce=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],Ge=(Oe={},Object(R.a)(Oe,le+"-B","bold"),Object(R.a)(Oe,le+"-I","italic"),Oe),st=(ze={},Object(R.a)(ze,et,"\u6DFB\u52A0\u94FE\u63A5"),Object(R.a)(ze,lt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(R.a)(ze,gt,"\u6DFB\u52A0\u6587\u4EF6"),Object(R.a)(ze,at,"\u6DFB\u52A0\u8868\u683C"),ze),Ct=Qe.a=function(Ae){var bt=Ae.defaultValue,dt=bt===void 0?"":bt,qe=Ae.onChange,Lt=Ae.width,Rt=Lt===void 0?"100%":Lt,At=Ae.height,Mt=At===void 0?400:At,Tt=Ae.miniToolbar,qt=Tt===void 0?!1:Tt,ln=Ae.isFocus,pt=ln===void 0?!1:ln,Sn=Ae.watch,un=Ae.insertTemp,mn=Ae.mode,Tn=mn===void 0?"markdown":mn,li=Ae.id,Xn=li===void 0?"markdown-editor-id":li,jt=Ae.showResizeBar,ct=jt===void 0?!1:jt,Hn=Ae.noStorage,ui=Hn===void 0?!1:Hn,An=Ae.showNullButton,Pt=An===void 0?!1:An,Kn=Ae.hidetoolBar,hi=Kn===void 0?!1:Kn,vi=Ae.fullScreen,We=vi===void 0?!1:vi,St=Ae.onBlur,ti=Ae.onCMBeforeChange,ci=Ae.onFullScreen,di=Ae.className,Ri=di===void 0?"":di,c=Ae.disablePaste,o=c===void 0?!1:c,a=Ae.placeholder,u=a===void 0?"":a,m=Ae.values,h=m===void 0?"":m,K=Object(L.useState)(null),Ne=Object(T.a)(K,2),pe=Ne[0],ht=Ne[1],Be=Object(L.useState)(dt),Et=Object(T.a)(Be,2),It=Et[0],zt=Et[1],Fn=Object(L.useState)(Sn),zn=Object(T.a)(Fn,2),hn=zn[0],Yn=zn[1],Xi=Object(L.useState)(We),_n=Object(T.a)(Xi,2),Ln=_n[0],ni=_n[1],yi=Object(L.useState)(""),Jn=Object(T.a)(yi,2),ii=Jn[0],Wn=Jn[1],fr=Object(L.useState)(0),Ki=Object(T.a)(fr,2),Nn=Ki[0],In=Ki[1],Oi=Object(L.useState)(Mt),Di=Object(T.a)(Oi,2),Pi=Di[0],en=Di[1],Ut=Object(L.useState)(!1),vn=Object(T.a)(Ut,2),Ht=vn[0],yn=vn[1],Kt=Object(L.useRef)(Object(it.a)()),bi=Object(L.useRef)(!1),on=Object(L.useRef)(),an=Object(L.useRef)(),ri=Object(L.useRef)(),xi=Object(L.useRef)(),wi=Object(L.useRef)(),Ur=function(){var ft=Object(z.a)(_.a.mark(function kt(){var xt,Ot;return _.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return Wt.next=2,Object(tt.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Kt.current}});case 2:Ot=Wt.sent,Ot!=null&&(xt=Ot.attachments)!==null&&xt!==void 0&&xt.length&&(console.log("cm:",pe,an),Ot.attachments.map(function(Nt){Nt.content_type.indexOf("image")>-1?pe.replaceSelection("![,](/api/attachments/".concat(Nt.id,"?type=").concat(Nt.content_type,")")):Nt.content_type.indexOf("video")>-1?pe.replaceSelection('<video width="100%" controls src="'.concat(j.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Nt.content_type.indexOf("pdf")>-1?pe.replaceSelection('<a href="'.concat(j.a.API_SERVER,"/api/attachments/").concat(Nt.id,"?type=").concat(Nt.content_type,'&disposition=inline" target="_blank">').concat(Nt.name,"</a>")):pe.replaceSelection("[".concat(Nt.name,"](").concat(j.a.API_SERVER,"/api/attachments/").concat(Nt.id,"?type=").concat(Nt.content_type,")"))}));case 4:case"end":return Wt.stop()}},kt)}));return function(){return ft.apply(this,arguments)}}();Object(L.useEffect)(function(){zt(h),pe==null||pe.setValue(h)},[h]),Object(L.useEffect)(function(){ci==null||ci(Ln)},[Ln]),Object(L.useEffect)(function(){if(an.current){var ft=Q.a.fromTextArea(an.current,{mode:Tn,lineNumbers:!qt,lineWrapping:!0,value:dt,autoCloseTags:!0,autoCloseBrackets:!0});pt&&ft.focus();function kt(xt,Ot){if(o){Ot.preventDefault();return}var Bt=Ot.clipboardData;if(Bt){var Wt=Bt.types.toString(),Nt=Bt.items;if(Wt==="Files"||Bt.types.indexOf("Files")>-1){if(Ot.preventDefault(),Tn=="stex")return;try{var Jt,cn=Nt[1];((Jt=Nt[0])===null||Jt===void 0?void 0:Jt.kind)==="file"&&(cn=Nt[0]);var Dt=cn.getAsFile(),Ni=Dt.name.split(".").pop();re(Dt,function(Gt){if(Gt.id){var bn,Xt,$n;(Dt==null||((bn=Dt.type)===null||bn===void 0)?void 0:bn.indexOf("image"))>-1?ft.replaceSelection("![,](/api/attachments/".concat(Gt.id,"?type=").concat(Gt.content_type,")")):(Dt==null||((Xt=Dt.type)===null||Xt===void 0)?void 0:Xt.indexOf("video"))>-1?ft.replaceSelection('<video width="100%" controls src="'.concat(j.a.API_SERVER,"/api/attachments/").concat(Gt.id,'"></video>')):(Dt==null||(($n=Dt.type)===null||$n===void 0)?void 0:$n.indexOf("pdf"))>-1?ft.replaceSelection('<a href="'.concat(j.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Dt.type,'&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):Ce.includes(Ni)?ft.replaceSelection('<a href="'.concat(j.a.API_SERVER,"/api/attachments/").concat(Gt.id,'?type=office&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):ft.replaceSelection("[".concat(Dt.name,"](").concat(j.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Gt.content_type,")"))}else(Gt==null?void 0:Gt.status)===401&&(document.location.href="/user/login")})}catch(Gt){fe.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return ft.on("paste",kt),ft.on("dragleave",function(xt,Ot){ri.current.classList.remove("mouse-hover-md")}),ft.on("dragover",function(xt,Ot){ri.current.classList.add("mouse-hover-md")}),ft.on("drop",function(xt,Ot){ri.current.classList.add("mouse-hover-md");var Bt;if(Bt=Ot.dataTransfer.files,Bt.length>0){Ot.preventDefault(),Ot.stopPropagation();for(var Wt=function(cn){var Dt=Bt[cn],Ni=Dt.name.split(".").pop();re(Dt,function(Gt){if(Gt.id){var bn,Xt,$n;(Dt==null||((bn=Dt.type)===null||bn===void 0)?void 0:bn.indexOf("image"))>-1?ft.replaceSelection("![,](/api/attachments/".concat(Gt.id,"?type=").concat(Gt.content_type,")")):(Dt==null||((Xt=Dt.type)===null||Xt===void 0)?void 0:Xt.indexOf("video"))>-1?ft.replaceSelection('<video width="100%" controls src="'.concat(j.a.API_SERVER,"/api/attachments/").concat(Gt.id,'"></video>')):(Dt==null||(($n=Dt.type)===null||$n===void 0)?void 0:$n.indexOf("pdf"))>-1?ft.replaceSelection('<a href="'.concat(j.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Dt.type,'&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):Ce.includes(Ni)?ft.replaceSelection('<a href="'.concat(j.a.API_SERVER,"/api/attachments/").concat(Gt.id,'?type=office&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):ft.replaceSelection("[".concat(Dt.name,"](").concat(j.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Gt.content_type,")"))}else(Gt==null?void 0:Gt.status)===401&&(document.location.href="/user/login")})},Nt=0;Nt<Bt.length;Nt++)Wt(Nt)}}),ht(ft),function(){ft.off("paste",kt)}}},[]);var Zn=Object(L.useCallback)(function(){if(ri.current)try{}catch(ft){console.log(ft,"---- to set md editor body height")}},[Pi,ri,Ln]);Object(L.useEffect)(function(){function ft(){var xt=new U.default(function(Ot){var Bt=Object(ne.a)(Ot),Wt;try{for(Bt.s();!(Wt=Bt.n()).done;){var Nt=Wt.value;(Nt.target.offsetHeight>0||Nt.target.offsetWidth>0)&&(Zn(),pe.setSize("100%","100%"),pe.refresh())}}catch(Jt){Bt.e(Jt)}finally{Bt.f()}});return xt.observe(an.current.parentElement),xt}if(pe){var kt=ft();return function(){kt.unobserve(an.current.parentElement)}}},[pe,Zn]),Object(L.useEffect)(function(){if(pe){for(var ft=[],kt=function(){var Nt=Ot[xt];Bt=Object(T.a)(Nt,2);var Jt=Bt[0],cn=Bt[1],Dt=Object(R.a)({},Jt,function(){Yi(cn)});ft.push(Dt),pe.addKeyMap(Dt)},xt=0,Ot=Object.entries(Ge);xt<Ot.length;xt++){var Bt;kt()}return on.current=setInterval(function(){bi.current&&Ur()},4e3),function(){clearInterval(on.current);var Wt=Object(ne.a)(ft),Nt;try{for(Wt.s();!(Nt=Wt.n()).done;){var Jt=Nt.value;pe.removeKeyMap(Jt)}}catch(cn){Wt.e(cn)}finally{Wt.f()}}}},[pe]),Object(L.useEffect)(function(){We!==Ln&&ni(We)},[We]),Object(rt.a)(function(){if(!ui&&Nn>0){var ft=new Date().getTime(),kt=window.sessionStorage.getItem(Xn);ft>=Nn+$&&(!kt||kt!==It)&&(window.sessionStorage.setItem(Xn,It),yn(!0))}},$),Object(L.useEffect)(function(){Yn(Sn)},[pe,Sn]),Object(L.useEffect)(function(){pe&&(pt&&pe.focus())},[pe,pt]),Object(L.useEffect)(function(){if(hn&&pe){var ft=pe.getScrollerElement();function kt(xt){var Ot=xt.target;if(wi.current){var Bt=Ot.scrollTop/Ot.scrollHeight;wi.current.scrollTop=wi.current.scrollHeight*Bt}}return ft.addEventListener("scroll",kt),function(){ft.removeEventListener("scroll",kt)}}},[pe,hn]),Object(L.useEffect)(function(){if(pe&&ti){function ft(kt,xt){ti(kt,xt)}return pe.on("beforeChange",ft),function(){pe.off("beforeChange",ft)}}},[pe,ti]),Object(L.useEffect)(function(){if(pe&&St){function ft(){St(pe.getValue())}return pe.on("blur",ft),function(){pe.off("blur",ft)}}},[pe,St]),Object(L.useEffect)(function(){if(pe){function ft(kt){var xt=kt.getValue();zt(xt),In(new Date().getTime()),kt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),qe&&qe(xt)}return pe.on("change",ft),function(){pe.off("change",ft)}}},[pe,qe]),Object(L.useEffect)(function(){pe&&(dt==null?(pe.setValue(""),zt("")):dt!==pe.getValue()&&(pe.setValue(dt),zt(dt),pe.setCursor(pe.lineCount(),0)))},[pe,dt]);var Yi=Object(L.useCallback)(function(ft){var kt=pe.getCursor(),xt=pe.getSelection(),Ot=xt.split(`
`);switch(ft){case"bold":return pe.replaceSelection("**"+xt+"**"),xt===""&&pe.setCursor(kt.line,kt.ch+2),pe.focus();case"italic":return pe.replaceSelection("*"+xt+"*"),xt===""&&pe.setCursor(kt.line,kt.ch+1),pe.focus();case"code":return pe.replaceSelection("`"+xt+"`"),xt===""&&pe.setCursor(kt.line,kt.ch+1),pe.focus();case"inline-latex":return pe.replaceSelection("`$$"+xt+"$$`"),xt===""&&pe.setCursor(kt.line,kt.ch+3),pe.focus();case"latex":return pe.replaceSelection("```latex\n"+xt+"\n```"),pe.setCursor(kt.line+1,xt.length+1),pe.focus();case"line-break":return pe.replaceSelection(`<br/>
`),pe.focus();case"list-ul":return xt===""?pe.replaceSelection("- "+xt):pe.replaceSelection(Ot.map(function(Bt){return Bt===""?"":"- ".concat(Bt)}).join(`
`)),pe.focus();case"list-ol":return xt===""?pe.replaceSelection("1. "+xt):pe.replaceSelection(Ot.map(function(Bt,Wt){return Bt===""?"":"".concat(Wt+1,". ").concat(Bt)}).join(`
`)),pe.focus();case"add-null-ch":return xt===""&&pe.setCursor(kt.line,kt.ch+1),pe.replaceSelection(y),pe.focus();case"inster-template-1":return xt===""&&pe.setCursor(kt.line,kt.ch),pe.replaceSelection(x),pe.focus();case"eraser":return pe.setValue(""),pe.focus();case"trigger-watch":return Yn(!hn),pe.focus();case"trigger-full-screen":return ni(!Ln),pe.focus();case et:Wn(et);return;case lt:Wn(lt);return;case gt:Wn(gt);return;case at:Wn(at);return;default:throw new Error}},[pe,hn,Ln]),jn=Object(L.useCallback)(function(ft){Wn("");switch(ii){case et:var kt=ft.title,xt=ft.link;return pe.replaceSelection("[".concat(kt,"](").concat(xt,")")),pe.focus();case lt:var Ot=ft.language,Bt=ft.content;return pe.replaceSelection(["```"+Ot,Bt,"```"].join(`
`)),pe.focus();case gt:var Wt=ft.src,Nt=ft.alt,Jt=ft.name;return Wt.indexOf("type=image")>-1?pe.replaceSelection("![ ".concat(Nt||""," ]( ").concat(Wt,' "').concat(Nt||"",'" )')):Wt.indexOf("type=application/pdf")>-1?pe.replaceSelection('<a href="'.concat(Wt,'&disposition=inline" target="_blank">').concat(Jt,"</a>")):pe.replaceSelection('<a href="'.concat(Wt,'" target="_blank">').concat(Jt,"</a>")),pe.focus();case at:for(var cn=ft.row,Dt=ft.col,Ni=ft.align,Gt=`
`,bn=0;bn<cn;bn++){for(var Xt=[],$n=[],pr=0;pr<Dt;pr++)bn===1&&$n.push(vt[Ni]),Xt.push(" ");bn===1&&(Gt+="| ".concat($n.join(" | "),` |
`)),Gt+="| ".concat(Xt.join(Dt===1?"":" | "),` |
`)}return pe.replaceSelection(Gt+`
`),pe.focus();default:throw new Error}},[pe,ii]),$i=Object(L.useMemo)(function(){switch(ii){case et:return E.a.createElement(ve,{callback:jn,onCancel:fi});case lt:return E.a.createElement(me.b,{callback:jn,onCancel:fi});case gt:return E.a.createElement(be,{callback:jn,onCancel:fi});case at:return E.a.createElement(mt,{callback:jn,onCancel:fi});default:return null}},[ii]);function fi(){Wn("")}Object(L.useEffect)(function(){if(xi.current){var ft=xi.current,kt=!1,xt=0;function Ot(Nt){kt=!0,xt=Nt.pageY}function Bt(){kt=!1}function Wt(Nt){if(kt){var Jt=Nt.pageY-xt;Jt<0&&(Jt=0),Jt>300&&(Jt=300);var cn=Mt+Jt+"px";en(cn)}}return ft.addEventListener("mousedown",Ot),document.addEventListener("mousemove",Wt),document.addEventListener("mouseup",Bt),function(){ft.removeEventListener("mousedown",Ot),document.removeEventListener("mousemove",Wt),document.removeEventListener("mouseup",Bt)}}},[pe,xi]),Object(L.useEffect)(function(){en(Mt)},[Mt]);var Ci=A(Rt),uo=A(Pi),ho={width:Ci,height:uo},Zo=Object(L.useMemo)(function(){if(Nn){var ft=new Date(Nn),kt=ft.getHours(),xt=ft.getMinutes(),Ot=ft.getSeconds();return kt=kt<10?"0"+kt:kt,xt=xt<10?"0"+xt:xt,Ot=Ot<10?"0"+Ot:Ot,"".concat(kt,":").concat(xt,":").concat(Ot)}return 0},[Nn]);function Qo(){window.sessionStorage.removeItem(Xn),yn(!1),In(0)}function co(){yn(!1),In(0),pe.setValue(window.sessionStorage.getItem(Xn))}function Hr(ft,kt){var xt=pe.getValue();xt=xt.replace(ft,kt),zt(xt),pe==null||pe.setValue(xt)}return E.a.createElement(L.Fragment,null,E.a.createElement("div",{className:"markdown-editor-wrapper",ref:ri},E.a.createElement("div",{className:"markdown-editor-container ".concat(Ri," ").concat(hn?"on-preview":""," ").concat(qt?"mini":""," ").concat(Ln?"full-screen":""),style:ho},E.a.createElement(D,{insertTemp:un,watch:hn,fullScreen:Ln,showNullButton:Pt,onActionCallback:Yi,hidetoolBar:hi,uuid:Kt.current,setOpenPhones:function(){bi.current=!0}}),E.a.createElement("div",{className:"markdown-editor-body"},E.a.createElement("div",{className:"codemirror-container"},E.a.createElement("textarea",{ref:an,placeholder:u})),hn?E.a.createElement("div",{ref:wi,className:"preview-container"},Tn==="stex"&&E.a.createElement(Ve,{value:It}),Tn!=="stex"&&E.a.createElement(De.a,{edit:!0,value:It,replaces:Hr})):null))),ct?E.a.createElement("a",{ref:xi,className:"editor-resize"}):null,E.a.createElement(p.a,null,st[ii]?E.a.createElement(se.a,{centered:!0,title:st[ii],visible:!0,onCancel:fi,footer:null},$i):null))}},SJMd:function(ot,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 k,H,se,ne=!1,we,fe;window.PR_SHOULD_USE_CONTINUATION=!0;var z,T;(function(){var R=window,B=["break,continue,do,else,for,if,return,while"],_=[B,"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"],L=[_,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],E=[L,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],te=[L,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],Q=[L,"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"],U="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",Z=[L,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],W="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",ce=[B,"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"],ae=[B,"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"],Ie=[B,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],$e=[E,Q,te,Z,W,ce,ae,Ie],Se=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,De="str",Ve="kwd",ke="com",Te="typ",Pe="lit",ye="pun",M="pln",de="tag",ie="dec",w="src",j="atn",P="atv",S="nocode",D="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function p(re){for(var _e=0,Ue=!1,Ke=!1,He=0,je=re.length;He<je;++He){var Xe=re[He];if(Xe.ignoreCase)Ke=!0;else if(/[a-z]/i.test(Xe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ue=!0,Ke=!1;break}}var mt={b:8,t:9,n:10,v:11,f:12,r:13};function tt(at){var Le=at.charCodeAt(0);if(Le!==92)return Le;var vt=at.charAt(1);return Le=mt[vt],Le||("0"<=vt&&vt<="7"?parseInt(at.substring(1),8):vt==="u"||vt==="x"?parseInt(at.substring(2),16):at.charCodeAt(1))}function it(at){if(at<32)return(at<16?"\\x0":"\\x")+at.toString(16);var Le=String.fromCharCode(at);return Le==="\\"||Le==="-"||Le==="]"||Le==="^"?"\\"+Le:Le}function et(at){var Le=at.substring(1,at.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")),vt=[],rt=Le[0]==="^",Oe=["["];rt&&Oe.push("^");for(var ze=rt?1:0,ee=Le.length;ze<ee;++ze){var Y=Le[ze];if(/\\[bdsw]/i.test(Y))Oe.push(Y);else{var $=tt(Y),y;ze+2<ee&&Le[ze+1]==="-"?(y=tt(Le[ze+2]),ze+=2):y=$,vt.push([$,y]),y<65||$>122||(y<65||$>90||vt.push([Math.max(65,$)|32,Math.min(y,90)|32]),y<97||$>122||vt.push([Math.max(97,$)&~32,Math.min(y,122)&~32]))}}vt.sort(function(le,Ce){return le[0]-Ce[0]||Ce[1]-le[1]});for(var x=[],A=[],ze=0;ze<vt.length;++ze){var N=vt[ze];N[0]<=A[1]+1?A[1]=Math.max(A[1],N[1]):x.push(A=N)}for(var ze=0;ze<x.length;++ze){var N=x[ze];Oe.push(it(N[0])),N[1]>N[0]&&(N[1]+1>N[0]&&Oe.push("-"),Oe.push(it(N[1])))}return Oe.push("]"),Oe.join("")}function gt(at){for(var Le=at.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")),vt=Le.length,rt=[],Oe=0,ze=0;Oe<vt;++Oe){var ee=Le[Oe];if(ee==="(")++ze;else if(ee.charAt(0)==="\\"){var Y=+ee.substring(1);Y&&(Y<=ze?rt[Y]=-1:Le[Oe]=it(Y))}}for(var Oe=1;Oe<rt.length;++Oe)rt[Oe]===-1&&(rt[Oe]=++_e);for(var Oe=0,ze=0;Oe<vt;++Oe){var ee=Le[Oe];if(ee==="(")++ze,rt[ze]||(Le[Oe]="(?:");else if(ee.charAt(0)==="\\"){var Y=+ee.substring(1);Y&&Y<=ze&&(Le[Oe]="\\"+rt[Y])}}for(var Oe=0;Oe<vt;++Oe)Le[Oe]==="^"&&Le[Oe+1]!=="^"&&(Le[Oe]="");if(at.ignoreCase&&Ue)for(var Oe=0;Oe<vt;++Oe){var ee=Le[Oe],$=ee.charAt(0);ee.length>=2&&$==="["?Le[Oe]=et(ee):$!=="\\"&&(Le[Oe]=ee.replace(/[a-zA-Z]/g,function(A){var N=A.charCodeAt(0);return"["+String.fromCharCode(N&~32,N|32)+"]"}))}return Le.join("")}for(var lt=[],He=0,je=re.length;He<je;++He){var Xe=re[He];if(Xe.global||Xe.multiline)throw new Error(""+Xe);lt.push("(?:"+gt(Xe)+")")}return new RegExp(lt.join("|"),Ke?"gi":"g")}function d(re,_e){var Ue=/(?:^|\s)nocode(?:\s|$)/,Ke=[],He=0,je=[],Xe=0;function mt(tt){var it=tt.nodeType;if(it==1){if(Ue.test(tt.className))return;for(var et=tt.firstChild;et;et=et.nextSibling)mt(et);var gt=tt.nodeName.toLowerCase();(gt==="br"||gt==="li")&&(Ke[Xe]=`
`,je[Xe<<1]=He++,je[Xe++<<1|1]=tt)}else if(it==3||it==4){var lt=tt.nodeValue;lt.length&&(_e?lt=lt.replace(/\r\n?/g,`
`):lt=lt.replace(/[ \t\r\n]+/g," "),Ke[Xe]=lt,je[Xe<<1]=He,He+=lt.length,je[Xe++<<1|1]=tt)}}return mt(re),{sourceCode:Ke.join("").replace(/\n$/,""),spans:je}}function C(re,_e,Ue,Ke,He){if(!Ue)return;var je={sourceNode:re,pre:1,langExtension:null,numberLines:null,sourceCode:Ue,spans:null,basePos:_e,decorations:null};Ke(je),He.push.apply(He,je.decorations)}var F=/\S/;function J(re){for(var _e=void 0,Ue=re.firstChild;Ue;Ue=Ue.nextSibling){var Ke=Ue.nodeType;_e=Ke===1?_e?re:Ue:Ke===3&&F.test(Ue.nodeValue)?re:_e}return _e===re?void 0:_e}function xe(re,_e){var Ue={},Ke;(function(){for(var Xe=re.concat(_e),mt=[],tt={},it=0,et=Xe.length;it<et;++it){var gt=Xe[it],lt=gt[3];if(lt)for(var at=lt.length;--at>=0;)Ue[lt.charAt(at)]=gt;var Le=gt[1],vt=""+Le;tt.hasOwnProperty(vt)||(mt.push(Le),tt[vt]=null)}mt.push(/[\0-\uffff]/),Ke=p(mt)})();var He=_e.length,je=function(Xe){for(var mt=Xe.sourceCode,tt=Xe.basePos,it=Xe.sourceNode,et=[tt,M],gt=0,lt=mt.match(Ke)||[],at={},Le=0,vt=lt.length;Le<vt;++Le){var rt=lt[Le],Oe=at[rt],ze=void 0,ee;if(typeof Oe=="string")ee=!1;else{var Y=Ue[rt.charAt(0)];if(Y)ze=rt.match(Y[1]),Oe=Y[0];else{for(var $=0;$<He;++$)if(Y=_e[$],ze=rt.match(Y[1]),ze){Oe=Y[0];break}ze||(Oe=M)}ee=Oe.length>=5&&Oe.substring(0,5)==="lang-",ee&&!(ze&&typeof ze[1]=="string")&&(ee=!1,Oe=w),ee||(at[rt]=Oe)}var y=gt;if(gt+=rt.length,!ee)et.push(tt+y,Oe);else{var x=ze[1],A=rt.indexOf(x),N=A+x.length;ze[2]&&(N=rt.length-ze[2].length,A=N-x.length);var le=Oe.substring(5);C(it,tt+y,rt.substring(0,A),je,et),C(it,tt+y+A,x,G(le,x),et),C(it,tt+y+N,rt.substring(N),je,et)}}Xe.decorations=et};return je}function Me(re){var _e=[],Ue=[];re.tripleQuotedStrings?_e.push([De,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):re.multiLineStrings?_e.push([De,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):_e.push([De,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),re.verbatimStrings&&Ue.push([De,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ke=re.hashComments;Ke&&(re.cStyleComments?(Ke>1?_e.push([ke,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):_e.push([ke,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ue.push([De,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):_e.push([ke,/^#[^\r\n]*/,null,"#"])),re.cStyleComments&&(Ue.push([ke,/^\/\/[^\r\n]*/,null]),Ue.push([ke,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var He=re.regexLiterals;if(He){var je=He>1?"":`
\r`,Xe=je?".":"[\\S\\s]",mt="/(?=[^/*"+je+"])(?:[^/\\x5B\\x5C"+je+"]|\\x5C"+Xe+"|\\x5B(?:[^\\x5C\\x5D"+je+"]|\\x5C"+Xe+")*(?:\\x5D|$))+/";Ue.push(["lang-regex",RegExp("^"+D+"("+mt+")")])}var tt=re.types;tt&&Ue.push([Te,tt]);var it=(""+re.keywords).replace(/^ | $/g,"");it.length&&Ue.push([Ve,new RegExp("^(?:"+it.replace(/[\s,]+/g,"|")+")\\b"),null]),_e.push([M,/^\s+/,null,` \r
\xA0`]);var et="^.[^\\s\\w.$@'\"`/\\\\]*";return re.regexLiterals&&(et+="(?!s*/)"),Ue.push([Pe,/^@[a-z_$][a-z_$@0-9]*/i,null],[Te,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[M,/^[a-z_$][a-z_$@0-9]*/i,null],[Pe,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[M,/^\\[\s\S]?/,null],[ye,new RegExp(et),null]),xe(_e,Ue)}var ge=Me({keywords:$e,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ve(re,_e,Ue){for(var Ke=/(?:^|\s)nocode(?:\s|$)/,He=/\r\n?|\n/,je=re.ownerDocument,Xe=je.createElement("li");re.firstChild;)Xe.appendChild(re.firstChild);var mt=[Xe];function tt(Le){var vt=Le.nodeType;if(vt==1&&!Ke.test(Le.className))if(Le.nodeName==="br")it(Le),Le.parentNode&&Le.parentNode.removeChild(Le);else for(var rt=Le.firstChild;rt;rt=rt.nextSibling)tt(rt);else if((vt==3||vt==4)&&Ue){var Oe=Le.nodeValue,ze=Oe.match(He);if(ze){var ee=Oe.substring(0,ze.index);Le.nodeValue=ee;var Y=Oe.substring(ze.index+ze[0].length);if(Y){var $=Le.parentNode;$.insertBefore(je.createTextNode(Y),Le.nextSibling)}it(Le),ee||Le.parentNode.removeChild(Le)}}}function it(Le){for(;!Le.nextSibling;)if(Le=Le.parentNode,!Le)return;function vt(ze,ee){var Y=ee?ze.cloneNode(!1):ze,$=ze.parentNode;if($){var y=vt($,1),x=ze.nextSibling;y.appendChild(Y);for(var A=x;A;A=x)x=A.nextSibling,y.appendChild(A)}return Y}for(var rt=vt(Le.nextSibling,0),Oe;(Oe=rt.parentNode)&&Oe.nodeType===1;)rt=Oe;mt.push(rt)}for(var et=0;et<mt.length;++et)tt(mt[et]);_e===(_e|0)&&mt[0].setAttribute("value",_e);var gt=je.createElement("ol");gt.className="linenums";for(var lt=Math.max(0,_e-1|0)||0,et=0,at=mt.length;et<at;++et)Xe=mt[et],Xe.className="L"+(et+lt)%10,Xe.firstChild||Xe.appendChild(je.createTextNode("\xA0")),gt.appendChild(Xe);re.appendChild(gt)}function me(re){var _e=/\bMSIE\s(\d+)/.exec(navigator.userAgent);_e=_e&&+_e[1]<=8;var Ue=/\n/g,Ke=re.sourceCode,He=Ke.length,je=0,Xe=re.spans,mt=Xe.length,tt=0,it=re.decorations,et=it.length,gt=0;it[et]=He;var lt,at;for(at=lt=0;at<et;)it[at]!==it[at+2]?(it[lt++]=it[at++],it[lt++]=it[at++]):at+=2;for(et=lt,at=lt=0;at<et;){for(var Le=it[at],vt=it[at+1],rt=at+2;rt+2<=et&&it[rt+1]===vt;)rt+=2;it[lt++]=Le,it[lt++]=vt,at=rt}et=it.length=lt;var Oe=re.sourceNode,ze="";Oe&&(ze=Oe.style.display,Oe.style.display="none");try{for(var ee=null;tt<mt;){var Y=Xe[tt],$=Xe[tt+2]||He,y=it[gt+2]||He,rt=Math.min($,y),x=Xe[tt+1],A;if(x.nodeType!==1&&(A=Ke.substring(je,rt))){_e&&(A=A.replace(Ue,"\r")),x.nodeValue=A;var N=x.ownerDocument,le=N.createElement("span");le.className=it[gt+1];var Ce=x.parentNode;Ce.replaceChild(le,x),le.appendChild(x),je<$&&(Xe[tt+1]=x=N.createTextNode(Ke.substring(rt,$)),Ce.insertBefore(x,le.nextSibling))}je=rt,je>=$&&(tt+=2),je>=y&&(gt+=2)}}finally{Oe&&(Oe.style.display=ze)}}var ue={};function q(re,_e){for(var Ue=_e.length;--Ue>=0;){var Ke=_e[Ue];ue.hasOwnProperty(Ke)?R.console&&console.warn("cannot override language handler %s",Ke):ue[Ke]=re}}function G(re,_e){return re&&ue.hasOwnProperty(re)||(re=/^\s*</.test(_e)?"default-markup":"default-code"),ue[re]}q(ge,["default-code"]),q(xe([],[[M,/^[^<?]+/],[ie,/^<!\w[^>]*(?:>|$)/],[ke,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[ye,/^(?:<[%?]|[%?]>)/],["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"]),q(xe([[M,/^[\s]+/,null,` \r
`],[P,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[de,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[j,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[ye,/^[=<>\/]+/],["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"]),q(xe([],[[P,/^[\s\S]+/]]),["uq.val"]),q(Me({keywords:E,hashComments:!0,cStyleComments:!0,types:Se}),["c","cc","cpp","cxx","cyc","m"]),q(Me({keywords:"null,true,false"}),["json"]),q(Me({keywords:Q,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:Se}),["cs"]),q(Me({keywords:te,cStyleComments:!0}),["java"]),q(Me({keywords:Ie,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),q(Me({keywords:ce,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),q(Me({keywords:W,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),q(Me({keywords:ae,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),q(Me({keywords:Z,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),q(Me({keywords:U,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),q(xe([],[[De,/^[\s\S]+/]]),["regex"]);function b(re){var _e=re.langExtension;try{var Ue=d(re.sourceNode,re.pre),Ke=Ue.sourceCode;re.sourceCode=Ke,re.spans=Ue.spans,re.basePos=0,G(_e,Ke)(re),me(re)}catch(He){R.console&&console.log(He&&He.stack||He)}}function X(re,_e,Ue){var Ke=Ue||!1,He=_e||null,je=document.createElement("div");je.innerHTML="<pre>"+re+"</pre>",je=je.firstChild,Ke&&ve(je,Ke,!0);var Xe={langExtension:He,numberLines:Ke,sourceNode:je,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return b(Xe),je.innerHTML}function O(re,_e){var Ue=_e||document.body,Ke=Ue.ownerDocument||document;function He(Y){return Ue.getElementsByTagName(Y)}for(var je=[He("pre"),He("code"),He("xmp")],Xe=[],mt=0;mt<je.length;++mt)for(var tt=0,it=je[mt].length;tt<it;++tt)Xe.push(je[mt][tt]);je=null;var et=Date;et.now||(et={now:function(){return+new Date}});var gt=0,lt=/\blang(?:uage)?-([\w.]+)(?!\S)/,at=/\bprettyprint\b/,Le=/\bprettyprinted\b/,vt=/pre|xmp/i,rt=/^code$/i,Oe=/^(?:pre|code|xmp)$/i,ze={};function ee(){for(var Y=R.PR_SHOULD_USE_CONTINUATION?et.now()+250:Infinity;gt<Xe.length&&et.now()<Y;gt++){for(var $=Xe[gt],y=ze,x=$;x=x.previousSibling;){var A=x.nodeType,N=(A===7||A===8)&&x.nodeValue;if(N?!/^\??prettify\b/.test(N):A!==3||/\S/.test(x.nodeValue))break;if(N){y={},N.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Mt,Tt,qt){y[Tt]=qt});break}}var le=$.className;if((y!==ze||at.test(le))&&!Le.test(le)){for(var Ce=!1,Ge=$.parentNode;Ge;Ge=Ge.parentNode){var st=Ge.tagName;if(Oe.test(st)&&Ge.className&&at.test(Ge.className)){Ce=!0;break}}if(!Ce){$.className+=" prettyprinted";var Ct=y.lang;if(!Ct){Ct=le.match(lt);var Ae;!Ct&&(Ae=J($))&&rt.test(Ae.tagName)&&(Ct=Ae.className.match(lt)),Ct&&(Ct=Ct[1])}var bt;if(vt.test($.tagName))bt=1;else{var dt=$.currentStyle,qe=Ke.defaultView,Lt=dt?dt.whiteSpace:qe&&qe.getComputedStyle?qe.getComputedStyle($,null).getPropertyValue("white-space"):0;bt=Lt&&Lt.substring(0,3)==="pre"}var Rt=y.linenums;(Rt=Rt==="true"||+Rt)||(Rt=le.match(/\blinenums\b(?::(\d+))?/),Rt=Rt?Rt[1]&&Rt[1].length?+Rt[1]:!0:!1),Rt&&ve($,Rt,bt);var At={langExtension:Ct,sourceNode:$,numberLines:Rt,pre:bt,sourceCode:null,basePos:null,spans:null,decorations:null};b(At)}}}gt<Xe.length?R.setTimeout(ee,250):typeof re=="function"&&re()}ee()}var be=R.PR={createSimpleLexer:xe,registerLangHandler:q,sourceDecorator:Me,PR_ATTRIB_NAME:j,PR_ATTRIB_VALUE:P,PR_COMMENT:ke,PR_DECLARATION:ie,PR_KEYWORD:Ve,PR_LITERAL:Pe,PR_NOCODE:S,PR_PLAIN:M,PR_PUNCTUATION:ye,PR_SOURCE:w,PR_STRING:De,PR_TAG:de,PR_TYPE:Te,prettyPrintOne:ne?R.prettyPrintOne=X:z=X,prettyPrint:T=ne?R.prettyPrint=O:T=O},Ee=R.define;typeof Ee=="function"&&Ee.amd&&Ee("google-code-prettify",[],function(){return be})})()},"VrN/":function(ot,Qe,k){(function(H,se){ot.exports=se()})(this,function(){"use strict";var H=navigator.userAgent,se=navigator.platform,ne=/gecko\/\d/i.test(H),we=/MSIE \d/.test(H),fe=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(H),z=/Edge\/(\d+)/.exec(H),T=we||fe||z,R=T&&(we?document.documentMode||6:+(z||fe)[1]),B=!z&&/WebKit\//.test(H),_=B&&/Qt\/\d+\.\d+/.test(H),L=!z&&/Chrome\//.test(H),E=/Opera\//.test(H),te=/Apple Computer/.test(navigator.vendor),Q=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(H),U=/PhantomJS/.test(H),Z=!z&&/AppleWebKit/.test(H)&&/Mobile\/\w+/.test(H),W=/Android/.test(H),ce=Z||W||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(H),ae=Z||/Mac/.test(se),Ie=/\bCrOS\b/.test(H),$e=/win/i.test(se),Se=E&&H.match(/Version\/(\d*\.\d*)/);Se&&(Se=Number(Se[1])),Se&&Se>=15&&(E=!1,B=!0);var De=ae&&(_||E&&(Se==null||Se<12.11)),Ve=ne||T&&R>=9;function ke(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Te=function(e,t){var i=e.className,n=ke(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 Pe(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function ye(e,t){return Pe(e).appendChild(t)}function M(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 de(e,t,i,n){var r=M(e,t,i,n);return r.setAttribute("role","presentation"),r}var ie;document.createRange?ie=function(e,t,i,n){var r=document.createRange();return r.setEnd(n||e,i),r.setStart(e,t),r}:ie=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 w(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 j(){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 P(e,t){var i=e.className;ke(t).test(i)||(e.className+=(i?" ":"")+t)}function S(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!ke(i[n]).test(t)&&(t+=" "+i[n]);return t}var D=function(e){e.select()};Z?D=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:T&&(D=function(e){try{e.select()}catch(t){}});function p(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function d(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 C(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 f=e.indexOf(" ",s);if(f<0||f>=t)return l+(t-s);l+=f-s,l+=i-l%i,s=f+1}}var F=function(){this.id=null,this.f=null,this.time=0,this.handler=p(this.onTimeout,this)};F.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},F.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 J(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var xe=50,Me={toString:function(){return"CodeMirror.Pass"}},ge={scroll:!1},ve={origin:"*mouse"},me={origin:"+move"};function ue(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 q=[""];function G(e){for(;q.length<=e;)q.push(b(q)+" ");return q[e]}function b(e){return e[e.length-1]}function X(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function O(e,t,i){for(var n=0,r=i(t);n<e.length&&i(e[n])<=r;)n++;e.splice(n,0,t)}function be(){}function Ee(e,t){var i;return Object.create?i=Object.create(e):(be.prototype=e,i=new be),t&&d(t,i),i}var re=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function _e(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||re.test(e))}function Ue(e,t){return t?t.source.indexOf("\\w")>-1&&_e(e)?!0:t.test(e):_e(e)}function Ke(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var He=/[\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 je(e){return e.charCodeAt(0)>=768&&He.test(e)}function Xe(e,t,i){for(;(i<0?t>0:t<e.length)&&je(e.charAt(t));)t+=i;return t}function mt(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 tt(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 it=null;function et(e,t,i){var n;it=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:it=r),s.from==t&&(s.from!=s.to&&i!="before"?n=r:it=r)}return n!=null?n:it}var gt=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]/,f=/[1n]/;function g(v,I,V){this.level=v,this.from=I,this.to=V}return function(v,I){var V=I=="ltr"?"L":"R";if(v.length==0||I=="ltr"&&!n.test(v))return!1;for(var he=v.length,oe=[],Re=0;Re<he;++Re)oe.push(i(v.charCodeAt(Re)));for(var Fe=0,Ye=V;Fe<he;++Fe){var Je=oe[Fe];Je=="m"?oe[Fe]=Ye:Ye=Je}for(var nt=0,Ze=V;nt<he;++nt){var ut=oe[nt];ut=="1"&&Ze=="r"?oe[nt]="n":s.test(ut)&&(Ze=ut,ut=="r"&&(oe[nt]="R"))}for(var wt=1,yt=oe[0];wt<he-1;++wt){var _t=oe[wt];_t=="+"&&yt=="1"&&oe[wt+1]=="1"?oe[wt]="1":_t==","&&yt==oe[wt+1]&&(yt=="1"||yt=="n")&&(oe[wt]=yt),yt=_t}for(var Yt=0;Yt<he;++Yt){var pn=oe[Yt];if(pn==",")oe[Yt]="N";else if(pn=="%"){var Zt=void 0;for(Zt=Yt+1;Zt<he&&oe[Zt]=="%";++Zt);for(var Un=Yt&&oe[Yt-1]=="!"||Zt<he&&oe[Zt]=="1"?"1":"N",On=Yt;On<Zt;++On)oe[On]=Un;Yt=Zt-1}}for(var nn=0,Dn=V;nn<he;++nn){var xn=oe[nn];Dn=="L"&&xn=="1"?oe[nn]="L":s.test(xn)&&(Dn=xn)}for(var sn=0;sn<he;++sn)if(r.test(oe[sn])){var rn=void 0;for(rn=sn+1;rn<he&&r.test(oe[rn]);++rn);for(var Qt=(sn?oe[sn-1]:V)=="L",Pn=(rn<he?oe[rn]:V)=="L",cr=Qt==Pn?Qt?"L":"R":V,Mi=sn;Mi<rn;++Mi)oe[Mi]=cr;sn=rn-1}for(var Cn=[],si,gn=0;gn<he;)if(l.test(oe[gn])){var $o=gn;for(++gn;gn<he&&l.test(oe[gn]);++gn);Cn.push(new g(0,$o,gn))}else{var mi=gn,Gi=Cn.length,Vi=I=="rtl"?1:0;for(++gn;gn<he&&oe[gn]!="L";++gn);for(var kn=mi;kn<gn;)if(f.test(oe[kn])){mi<kn&&(Cn.splice(Gi,0,new g(1,mi,kn)),Gi+=Vi);var dr=kn;for(++kn;kn<gn&&f.test(oe[kn]);++kn);Cn.splice(Gi,0,new g(2,dr,kn)),Gi+=Vi,mi=kn}else++kn;mi<gn&&Cn.splice(Gi,0,new g(1,mi,gn))}return I=="ltr"&&(Cn[0].level==1&&(si=v.match(/^\s+/))&&(Cn[0].from=si[0].length,Cn.unshift(new g(0,0,si[0].length))),b(Cn).level==1&&(si=v.match(/\s+$/))&&(b(Cn).to-=si[0].length,Cn.push(new g(0,he-si[0].length,he)))),I=="rtl"?Cn.reverse():Cn}}();function lt(e,t){var i=e.order;return i==null&&(i=e.order=gt(e.text,t)),i}var at=[],Le=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||at).concat(i)}};function vt(e,t){return e._handlers&&e._handlers[t]||at}function rt(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers,r=n&&n[t];if(r){var s=J(r,i);s>-1&&(n[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function Oe(e,t){var i=vt(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 ze(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Oe(e,i||t.type,e,t),A(t)||t.codemirrorIgnore}function ee(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)J(i,t[n])==-1&&i.push(t[n])}function Y(e,t){return vt(e,t).length>0}function $(e){e.prototype.on=function(t,i){Le(this,t,i)},e.prototype.off=function(t,i){rt(this,t,i)}}function y(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function x(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function A(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function N(e){y(e),x(e)}function le(e){return e.target||e.srcElement}function Ce(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),ae&&e.ctrlKey&&t==1&&(t=3),t}var Ge=function(){if(T&&R<9)return!1;var e=M("div");return"draggable"in e||"dragDrop"in e}(),st;function Ct(e){if(st==null){var t=M("span","\u200B");ye(e,M("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(st=t.offsetWidth<=1&&t.offsetHeight>2&&!(T&&R<8))}var i=st?M("span","\u200B"):M("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Ae;function bt(e){if(Ae!=null)return Ae;var t=ye(e,document.createTextNode("A\u062EA")),i=ie(t,0,1).getBoundingClientRect(),n=ie(t,1,2).getBoundingClientRect();return Pe(e),!i||i.left==i.right?!1:Ae=n.right-i.right<3}var dt=`
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/)},qe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Lt=function(){var e=M("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Rt=null;function At(e){if(Rt!=null)return Rt;var t=ye(e,M("span","x")),i=t.getBoundingClientRect(),n=ie(t,0,1).getBoundingClientRect();return Rt=Math.abs(i.left-n.left)>1}var Mt={},Tt={};function qt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Mt[e]=t}function ln(e,t){Tt[e]=t}function pt(e){if(typeof e=="string"&&Tt.hasOwnProperty(e))e=Tt[e];else if(e&&typeof e.name=="string"&&Tt.hasOwnProperty(e.name)){var t=Tt[e.name];typeof t=="string"&&(t={name:t}),e=Ee(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return pt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return pt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Sn(e,t){t=pt(t);var i=Mt[t.name];if(!i)return Sn(e,"text/plain");var n=i(e,t);if(un.hasOwnProperty(t.name)){var r=un[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 un={};function mn(e,t){var i=un.hasOwnProperty(e)?un[e]:un[e]={};d(t,i)}function Tn(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 li(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 Xn(e,t,i){return e.startState?e.startState(t,i):!0}var jt=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};jt.prototype.eol=function(){return this.pos>=this.string.length},jt.prototype.sol=function(){return this.pos==this.lineStart},jt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},jt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},jt.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},jt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},jt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},jt.prototype.skipToEnd=function(){this.pos=this.string.length},jt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},jt.prototype.backUp=function(e){this.pos-=e},jt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=C(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?C(this.string,this.lineStart,this.tabSize):0)},jt.prototype.indentation=function(){return C(this.string,null,this.tabSize)-(this.lineStart?C(this.string,this.lineStart,this.tabSize):0)},jt.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)}},jt.prototype.current=function(){return this.string.slice(this.start,this.pos)},jt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},jt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},jt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ct(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var n=0;;++n){var r=i.children[n],s=r.chunkSize();if(t<s){i=r;break}t-=s}return i.lines[t]}function Hn(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 ui(e,t,i){var n=[];return e.iter(t,i,function(r){n.push(r.text)}),n}function An(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function Pt(e){if(e.parent==null)return null;for(var t=e.parent,i=J(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 Kn(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 f=e.lines[l],g=f.height;if(t<g)break;t-=g}return i+l}function hi(e,t){return t>=e.first&&t<e.first+e.size}function vi(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function We(e,t,i){if(i===void 0&&(i=null),!(this instanceof We))return new We(e,t,i);this.line=e,this.ch=t,this.sticky=i}function St(e,t){return e.line-t.line||e.ch-t.ch}function ti(e,t){return e.sticky==t.sticky&&St(e,t)==0}function ci(e){return We(e.line,e.ch)}function di(e,t){return St(e,t)<0?t:e}function Ri(e,t){return St(e,t)<0?e:t}function c(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 We(e.first,0);var i=e.first+e.size-1;return t.line>i?We(i,ct(e,i).text.length):a(t,ct(e,t.line).text.length)}function a(e,t){var i=e.ch;return i==null||i>t?We(e.line,t):i<0?We(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 m=function(e,t){this.state=e,this.lookAhead=t},h=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};h.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},h.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}},h.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},h.fromSaved=function(e,t,i){return t instanceof m?new h(e,Tn(e.mode,t.state),i,t.lookAhead):new h(e,Tn(e.mode,t),i)},h.prototype.save=function(e){var t=e!==!1?Tn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new m(t,this.maxLookAhead):t};function K(e,t,i,n){var r=[e.state.modeGen],s={};zn(e,t.text,e.doc.mode,i,function(v,I){return r.push(v,I)},s,n);for(var l=i.state,f=function(v){i.baseTokens=r;var I=e.state.overlays[v],V=1,he=0;i.state=!0,zn(e,t.text,I.mode,i,function(oe,Re){for(var Fe=V;he<oe;){var Ye=r[V];Ye>oe&&r.splice(V,1,oe,r[V+1],Ye),V+=2,he=Math.min(oe,Ye)}if(!Re)return;if(I.opaque)r.splice(Fe,V-Fe,oe,"overlay "+Re),V=Fe+2;else for(;Fe<V;Fe+=2){var Je=r[Fe+1];r[Fe+1]=(Je?Je+" ":"")+"overlay "+Re}},s),i.state=l,i.baseTokens=null,i.baseTokenPos=1},g=0;g<e.state.overlays.length;++g)f(g);return{styles:r,classes:s.bgClass||s.textClass?s:null}}function Ne(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=pe(e,Pt(t)),r=t.text.length>e.options.maxHighlightLength&&Tn(e.doc.mode,n.state),s=K(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 pe(e,t,i){var n=e.doc,r=e.display;if(!n.mode.startState)return new h(n,!0,t);var s=hn(e,t,i),l=s>n.first&&ct(n,s-1).stateAfter,f=l?h.fromSaved(n,l,s):new h(n,Xn(n.mode),s);return n.iter(s,t,function(g){ht(e,g.text,f);var v=f.line;g.stateAfter=v==t-1||v%5==0||v>=r.viewFrom&&v<r.viewTo?f.save():null,f.nextLine()}),i&&(n.modeFrontier=f.line),f}function ht(e,t,i,n){var r=e.doc.mode,s=new jt(t,e.options.tabSize,i);for(s.start=s.pos=n||0,t==""&&Be(r,i.state);!s.eol();)Et(r,s,i.state),s.start=s.pos}function Be(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=li(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function Et(e,t,i,n){for(var r=0;r<10;r++){n&&(n[0]=li(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 It=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function zt(e,t,i,n){var r=e.doc,s=r.mode,l;t=o(r,t);var f=ct(r,t.line),g=pe(e,t.line,i),v=new jt(f.text,e.options.tabSize,g),I;for(n&&(I=[]);(n||v.pos<t.ch)&&!v.eol();)v.start=v.pos,l=Et(s,v,g.state),n&&I.push(new It(v,l,Tn(r.mode,g.state)));return n?I:new It(v,l,g.state)}function Fn(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 zn(e,t,i,n,r,s,l){var f=i.flattenSpans;f==null&&(f=e.options.flattenSpans);var g=0,v=null,I=new jt(t,e.options.tabSize,n),V,he=e.options.addModeClass&&[null];for(t==""&&Fn(Be(i,n.state),s);!I.eol();){if(I.pos>e.options.maxHighlightLength?(f=!1,l&&ht(e,t,n,I.pos),I.pos=t.length,V=null):V=Fn(Et(i,I,n.state,he),s),he){var oe=he[0].name;oe&&(V="m-"+(V?oe+" "+V:oe))}if(!f||v!=V){for(;g<I.start;)g=Math.min(I.start,g+5e3),r(g,v);v=V}I.start=I.pos}for(;g<I.pos;){var Re=Math.min(I.pos,g+5e3);r(Re,v),g=Re}}function hn(e,t,i){for(var n,r,s=e.doc,l=i?-1:t-(e.doc.mode.innerMode?1e3:100),f=t;f>l;--f){if(f<=s.first)return s.first;var g=ct(s,f-1),v=g.stateAfter;if(v&&(!i||f+(v instanceof m?v.lookAhead:0)<=s.modeFrontier))return f;var I=C(g.text,null,e.options.tabSize);(r==null||n>I)&&(r=f-1,n=I)}return r}function Yn(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=ct(e,n).stateAfter;if(r&&(!(r instanceof m)||n+r.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Xi=!1,_n=!1;function Ln(){Xi=!0}function ni(){_n=!0}function yi(e,t,i){this.marker=e,this.from=t,this.to=i}function Jn(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function ii(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function Wn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function fr(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,f=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);if(f||s.from==t&&l.type=="bookmark"&&(!i||!s.marker.insertLeft)){var g=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);(n||(n=[])).push(new yi(l,s.from,g?null:s.to))}}return n}function Ki(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,f=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);if(f||s.from==t&&l.type=="bookmark"&&(!i||s.marker.insertLeft)){var g=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);(n||(n=[])).push(new yi(l,g?null:s.from-t,s.to==null?null:s.to-t))}}return n}function Nn(e,t){if(t.full)return null;var i=hi(e,t.from.line)&&ct(e,t.from.line).markedSpans,n=hi(e,t.to.line)&&ct(e,t.to.line).markedSpans;if(!i&&!n)return null;var r=t.from.ch,s=t.to.ch,l=St(t.from,t.to)==0,f=fr(i,r,l),g=Ki(n,s,l),v=t.text.length==1,I=b(t.text).length+(v?r:0);if(f)for(var V=0;V<f.length;++V){var he=f[V];if(he.to==null){var oe=Jn(g,he.marker);oe?v&&(he.to=oe.to==null?null:oe.to+I):he.to=r}}if(g)for(var Re=0;Re<g.length;++Re){var Fe=g[Re];if(Fe.to!=null&&(Fe.to+=I),Fe.from==null){var Ye=Jn(f,Fe.marker);Ye||(Fe.from=I,v&&(f||(f=[])).push(Fe))}else Fe.from+=I,v&&(f||(f=[])).push(Fe)}f&&(f=In(f)),g&&g!=f&&(g=In(g));var Je=[f];if(!v){var nt=t.text.length-2,Ze;if(nt>0&&f)for(var ut=0;ut<f.length;++ut)f[ut].to==null&&(Ze||(Ze=[])).push(new yi(f[ut].marker,null,null));for(var wt=0;wt<nt;++wt)Je.push(Ze);Je.push(g)}return Je}function In(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 Oi(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(oe){if(oe.markedSpans)for(var Re=0;Re<oe.markedSpans.length;++Re){var Fe=oe.markedSpans[Re].marker;Fe.readOnly&&(!n||J(n,Fe)==-1)&&(n||(n=[])).push(Fe)}}),!n)return null;for(var r=[{from:t,to:i}],s=0;s<n.length;++s)for(var l=n[s],f=l.find(0),g=0;g<r.length;++g){var v=r[g];if(St(v.to,f.from)<0||St(v.from,f.to)>0)continue;var I=[g,1],V=St(v.from,f.from),he=St(v.to,f.to);(V<0||!l.inclusiveLeft&&!V)&&I.push({from:v.from,to:f.from}),(he>0||!l.inclusiveRight&&!he)&&I.push({from:f.to,to:v.to}),r.splice.apply(r,I),g+=I.length-3}return r}function Di(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 Pi(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function en(e){return e.inclusiveLeft?-1:0}function Ut(e){return e.inclusiveRight?1:0}function vn(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),r=t.find(),s=St(n.from,r.from)||en(e)-en(t);if(s)return-s;var l=St(n.to,r.to)||Ut(e)-Ut(t);return l||t.id-e.id}function Ht(e,t){var i=_n&&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||vn(n,r.marker)<0)&&(n=r.marker);return n}function yn(e){return Ht(e,!0)}function Kt(e){return Ht(e,!1)}function bi(e,t){var i=_n&&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||vn(n,s.marker)<0)&&(n=s.marker)}return n}function on(e,t,i,n,r){var s=ct(e,t),l=_n&&s.markedSpans;if(l)for(var f=0;f<l.length;++f){var g=l[f];if(!g.marker.collapsed)continue;var v=g.marker.find(0),I=St(v.from,i)||en(g.marker)-en(r),V=St(v.to,n)||Ut(g.marker)-Ut(r);if(I>=0&&V<=0||I<=0&&V>=0)continue;if(I<=0&&(g.marker.inclusiveRight&&r.inclusiveLeft?St(v.to,i)>=0:St(v.to,i)>0)||I>=0&&(g.marker.inclusiveRight&&r.inclusiveLeft?St(v.from,n)<=0:St(v.from,n)<0))return!0}}function an(e){for(var t;t=yn(e);)e=t.find(-1,!0).line;return e}function ri(e){for(var t;t=Kt(e);)e=t.find(1,!0).line;return e}function xi(e){for(var t,i;t=Kt(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function wi(e,t){var i=ct(e,t),n=an(i);return i==n?t:Pt(n)}function Ur(e,t){if(t>e.lastLine())return t;var i=ct(e,t),n;if(!Zn(e,i))return t;for(;n=Kt(i);)i=n.find(1,!0).line;return Pt(i)+1}function Zn(e,t){var i=_n&&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,Jn(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 jn(e){e=an(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 f=s.children[l];if(f==i)break;t+=f.height}return t}function $i(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=yn(n);){var r=i.find(0,!0);n=r.from.line,t+=r.from.ch-r.to.ch}for(n=e;i=Kt(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 fi(e){var t=e.display,i=e.doc;t.maxLine=ct(i,i.first),t.maxLineLength=$i(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var r=$i(n);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=n)})}var Ci=function(e,t,i){this.text=e,Pi(this,t),this.height=i?i(this):1};Ci.prototype.lineNo=function(){return Pt(this)},$(Ci);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),Di(e),Pi(e,i);var r=n?n(e):1;r!=e.height&&An(e,r)}function ho(e){e.parent=null,Di(e)}var Zo={},Qo={};function co(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Qo:Zo;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Hr(e,t){var i=de("span",null,null,B?"padding-right: .1px":null),n={pre:de("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=kt,bt(e.display.measure)&&(l=lt(s,e.doc.direction))&&(n.addToken=Ot(n.addToken,l)),n.map=[];var f=t!=e.display.externalMeasured&&Pt(s);Wt(s,n,Ne(e,s,f)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=S(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=S(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(Ct(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(B){var g=n.content.lastChild;(/\bcm-tab\b/.test(g.className)||g.querySelector&&g.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Oe(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=S(n.pre.className,n.textClass||"")),n}function ft(e){var t=M("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function kt(e,t,i,n,r,s,l){if(!t)return;var f=e.splitSpaces?xt(t,e.trailingSpace):t,g=e.cm.state.specialChars,v=!1,I;if(!g.test(t))e.col+=t.length,I=document.createTextNode(f),e.map.push(e.pos,e.pos+t.length,I),T&&R<9&&(v=!0),e.pos+=t.length;else{I=document.createDocumentFragment();for(var V=0;;){g.lastIndex=V;var he=g.exec(t),oe=he?he.index-V:t.length-V;if(oe){var Re=document.createTextNode(f.slice(V,V+oe));T&&R<9?I.appendChild(M("span",[Re])):I.appendChild(Re),e.map.push(e.pos,e.pos+oe,Re),e.col+=oe,e.pos+=oe}if(!he)break;V+=oe+1;var Fe=void 0;if(he[0]==" "){var Ye=e.cm.options.tabSize,Je=Ye-e.col%Ye;Fe=I.appendChild(M("span",G(Je),"cm-tab")),Fe.setAttribute("role","presentation"),Fe.setAttribute("cm-text"," "),e.col+=Je}else he[0]=="\r"||he[0]==`
`?(Fe=I.appendChild(M("span",he[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Fe.setAttribute("cm-text",he[0]),e.col+=1):(Fe=e.cm.options.specialCharPlaceholder(he[0]),Fe.setAttribute("cm-text",he[0]),T&&R<9?I.appendChild(M("span",[Fe])):I.appendChild(Fe),e.col+=1);e.map.push(e.pos,e.pos+1,Fe),e.pos++}}if(e.trailingSpace=f.charCodeAt(t.length-1)==32,i||n||r||v||s||l){var nt=i||"";n&&(nt+=n),r&&(nt+=r);var Ze=M("span",[I],nt,s);if(l)for(var ut in l)l.hasOwnProperty(ut)&&ut!="style"&&ut!="class"&&Ze.setAttribute(ut,l[ut]);return e.content.appendChild(Ze)}e.content.appendChild(I)}function xt(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 Ot(e,t){return function(i,n,r,s,l,f,g){r=r?r+" cm-force-border":"cm-force-border";for(var v=i.pos,I=v+n.length;;){for(var V=void 0,he=0;he<t.length&&!(V=t[he],V.to>v&&V.from<=v);he++);if(V.to>=I)return e(i,n,r,s,l,f,g);e(i,n.slice(0,V.to-v),r,s,null,f,g),s=null,n=n.slice(V.to-v),v=V.to}}}function Bt(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 Wt(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]),co(i[l+1],t.cm.options));return}for(var f=r.length,g=0,v=1,I="",V,he,oe=0,Re,Fe,Ye,Je,nt;;){if(oe==g){Re=Fe=Ye=he="",nt=null,Je=null,oe=Infinity;for(var Ze=[],ut=void 0,wt=0;wt<n.length;++wt){var yt=n[wt],_t=yt.marker;if(_t.type=="bookmark"&&yt.from==g&&_t.widgetNode)Ze.push(_t);else if(yt.from<=g&&(yt.to==null||yt.to>g||_t.collapsed&&yt.to==g&&yt.from==g)){if(yt.to!=null&&yt.to!=g&&oe>yt.to&&(oe=yt.to,Fe=""),_t.className&&(Re+=" "+_t.className),_t.css&&(he=(he?he+";":"")+_t.css),_t.startStyle&&yt.from==g&&(Ye+=" "+_t.startStyle),_t.endStyle&&yt.to==oe&&(ut||(ut=[])).push(_t.endStyle,yt.to),_t.title&&((nt||(nt={})).title=_t.title),_t.attributes)for(var Yt in _t.attributes)(nt||(nt={}))[Yt]=_t.attributes[Yt];_t.collapsed&&(!Je||vn(Je.marker,_t)<0)&&(Je=yt)}else yt.from>g&&oe>yt.from&&(oe=yt.from)}if(ut)for(var pn=0;pn<ut.length;pn+=2)ut[pn+1]==oe&&(Fe+=" "+ut[pn]);if(!Je||Je.from==g)for(var Zt=0;Zt<Ze.length;++Zt)Bt(t,0,Ze[Zt]);if(Je&&(Je.from||0)==g){if(Bt(t,(Je.to==null?f+1:Je.to)-g,Je.marker,Je.from==null),Je.to==null)return;Je.to==g&&(Je=!1)}}if(g>=f)break;for(var Un=Math.min(f,oe);;){if(I){var On=g+I.length;if(!Je){var nn=On>Un?I.slice(0,Un-g):I;t.addToken(t,nn,V?V+Re:Re,Ye,g+nn.length==oe?Fe:"",he,nt)}if(On>=Un){I=I.slice(Un-g),g=Un;break}g=On,Ye=""}I=r.slice(s,s=i[v++]),V=co(i[v++],t.cm.options)}}}function Nt(e,t,i){this.line=t,this.rest=xi(t),this.size=this.rest?Pt(b(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Zn(e,t)}function Jt(e,t,i){for(var n=[],r,s=t;s<i;s=r){var l=new Nt(e.doc,ct(e.doc,s),s);r=s+l.size,n.push(l)}return n}var cn=null;function Dt(e){cn?cn.ops.push(e):e.ownsGroup=cn={ops:[e],delayedCallbacks:[]}}function Ni(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 Gt(e,t){var i=e.ownsGroup;if(!i)return;try{Ni(i)}finally{cn=null,t(i)}}var bn=null;function Xt(e,t){var i=vt(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),r;cn?r=cn.delayedCallbacks:bn?r=bn:(r=bn=[],setTimeout($n,0));for(var s=function(f){r.push(function(){return i[f].apply(null,n)})},l=0;l<i.length;++l)s(l)}function $n(){var e=bn;bn=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"?Ps(e,t):s=="gutter"?ea(e,t,i,n):s=="class"?fo(e,t):s=="widget"&&Ns(e,t,n)}t.changes=null}function gr(e){return e.node==e.text&&(e.node=M("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),T&&R<8&&(e.node.style.zIndex=2)),e.node}function Ds(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=gr(t);t.background=n.insertBefore(M("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function qo(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Hr(e,t)}function Ps(e,t){var i=t.text.className,n=qo(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){Ds(e,t),t.line.wrapClass?gr(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=gr(t);t.gutterBackground=M("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=gr(t),f=t.gutter=M("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(f),l.insertBefore(f,t.text),t.line.gutterClass&&(f.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!s||!s["CodeMirror-linenumbers"])&&(t.lineNumber=f.appendChild(M("div",vi(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var g=0;g<e.display.gutterSpecs.length;++g){var v=e.display.gutterSpecs[g].className,I=s.hasOwnProperty(v)&&s[v];I&&f.appendChild(M("div",[I],"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=ke("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=qo(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=gr(i),l=0,f=t.widgets;l<f.length;++l){var g=f[l],v=M("div",[g.node],"CodeMirror-linewidget"+(g.className?" "+g.className:""));g.handleMouseEvents||v.setAttribute("cm-ignore-events","true"),js(g,v,i,n),e.display.input.setUneditable(v),r&&g.above?s.insertBefore(v,i.gutter||i.text):s.appendChild(v),Xt(g,"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 mr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!w(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;"),ye(t.display.measure,M("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function pi(e,t){for(var i=le(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 Fr(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=ye(e.measure,M("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 oi(e){return xe-e.display.nativeBarWidth}function Ii(e){return e.display.scroller.clientWidth-oi(e)-e.display.barWidth}function go(e){return e.display.scroller.clientHeight-oi(e)-e.display.barHeight}function Bs(e,t,i){var n=e.options.lineWrapping,r=n&&Ii(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(),f=0;f<l.length-1;f++){var g=l[f],v=l[f+1];Math.abs(g.bottom-v.bottom)>2&&s.push((g.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(Pt(e.rest[r])>i)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Us(e,t){t=an(t);var i=Pt(t),n=e.display.externalMeasured=new Nt(e.doc,t,i);n.lineN=i;var r=n.built=Hr(e,n);return n.text=r.pre,ye(e.display.lineMeasure,r.pre),n}function oa(e,t,i,n){return ai(e,Ji(e,t),i,n)}function mo(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ui(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Ji(e,t){var i=Pt(t),n=mo(e,i);n&&!n.text?n=null:n&&n.changes&&(pr(e,n,i,Co(e)),e.curOp.forceUpdate=!0),n||(n=Us(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 ai(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||(Bs(e,t.view,t.rect),t.hasHeights=!0),l=Fs(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,f,g,v=0;v<e.length;v+=3)if(f=e[v],g=e[v+1],t<f?(r=0,s=1,l="left"):t<g?(r=t-f,s=r+1):(v==e.length-3||t==g&&e[v+3]>t)&&(s=g-f,r=s-1,t>=g&&(l="right")),r!=null){if(n=e[v+2],f==g&&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==g-f)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:f,coverEnd:g}}function Hs(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 Fs(e,t,i,n){var r=sa(t.map,i,n),s=r.node,l=r.start,f=r.end,g=r.collapse,v;if(s.nodeType==3){for(var I=0;I<4;I++){for(;l&&je(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+f<r.coverEnd&&je(t.line.text.charAt(r.coverStart+f));)++f;if(T&&R<9&&l==0&&f==r.coverEnd-r.coverStart?v=s.parentNode.getBoundingClientRect():v=Hs(ie(s,l,f).getClientRects(),n),v.left||v.right||l==0)break;f=l,l=l-1,g="right"}T&&R<11&&(v=zs(e.display.measure,v))}else{l>0&&(g=n="right");var V;e.options.lineWrapping&&(V=s.getClientRects()).length>1?v=V[n=="right"?V.length-1:0]:v=s.getBoundingClientRect()}if(T&&R<9&&!l&&(!v||!v.left&&!v.right)){var he=s.parentNode.getClientRects()[0];he?v={left:he.left,right:he.left+Qi(e.display),top:he.top,bottom:he.bottom}:v=aa}for(var oe=v.top-t.rect.top,Re=v.bottom-t.rect.top,Fe=(oe+Re)/2,Ye=t.view.measure.heights,Je=0;Je<Ye.length-1&&!(Fe<Ye[Je]);Je++);var nt=Je?Ye[Je-1]:0,Ze=Ye[Je],ut={left:(g=="right"?v.right:v.left)-t.rect.left,right:(g=="left"?v.left:v.right)-t.rect.left,top:nt,bottom:Ze};return!v.left&&!v.right&&(ut.bogus=!0),e.options.singleCursorHeightPerLine||(ut.rtop=oe,ut.rbottom=Re),ut}function zs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!At(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,Pe(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 ha(){return L&&W?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ca(){return L&&W?-(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+=mr(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=jn(t);if(n=="local"?l+=Fr(e.display):l-=e.display.viewOffset,n=="page"||n=="window"){var f=e.display.lineSpace.getBoundingClientRect();l+=f.top+(n=="window"?0:ca());var g=f.left+(n=="window"?0:ha());i.left+=g,i.right+=g}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-=ha(),r-=ca();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=ct(e.doc,t.line)),zr(e,n,oa(e,n,t.ch,r),i)}function Qn(e,t,i,n,r,s){n=n||ct(e.doc,t.line),r||(r=Ji(e,n));function l(Re,Fe){var Ye=ai(e,r,Re,Fe?"right":"left",s);return Fe?Ye.left=Ye.right:Ye.right=Ye.left,zr(e,n,Ye,i)}var f=lt(n,e.doc.direction),g=t.ch,v=t.sticky;if(g>=n.text.length?(g=n.text.length,v="before"):g<=0&&(g=0,v="after"),!f)return l(v=="before"?g-1:g,v=="before");function I(Re,Fe,Ye){var Je=f[Fe],nt=Je.level==1;return l(Ye?Re-1:Re,nt!=Ye)}var V=et(f,g,v),he=it,oe=I(g,V,v=="before");return he!=null&&(oe.other=I(g,he,v!="before")),oe}function fa(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=Qi(e.display)*t.ch);var n=ct(e.doc,t.line),r=jn(n)+Fr(e.display);return{left:i,right:i,top:r,bottom:r+n.height}}function bo(e,t,i,n,r){var s=We(e,t,i);return s.xRel=r,n&&(s.outside=n),s}function xo(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return bo(n.first,0,null,-1,-1);var r=Kn(n,i),s=n.first+n.size-1;if(r>s)return bo(n.first+n.size-1,ct(n,s).text.length,null,1,1);t<0&&(t=0);for(var l=ct(n,r);;){var f=Ws(e,l,r,t,i),g=bi(l,f.ch+(f.xRel>0||f.outside>0?1:0));if(!g)return f;var v=g.find(1);if(v.line==r)return v;l=ct(n,r=v.line)}}function pa(e,t,i,n){n-=vo(t);var r=t.text.length,s=mt(function(l){return ai(e,i,l-1).bottom<=n},r,0);return r=mt(function(l){return ai(e,i,l).top>n},s,r),{begin:s,end:r}}function ga(e,t,i,n){i||(i=Ji(e,t));var r=zr(e,t,ai(e,i,n),"line").top;return pa(e,t,i,r)}function wo(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function Ws(e,t,i,n,r){r-=jn(t);var s=Ji(e,t),l=vo(t),f=0,g=t.text.length,v=!0,I=lt(t,e.doc.direction);if(I){var V=(e.options.lineWrapping?Vs:Gs)(e,t,i,s,I,n,r);v=V.level!=1,f=v?V.from:V.to-1,g=v?V.to:V.from-1}var he=null,oe=null,Re=mt(function(wt){var yt=ai(e,s,wt);return yt.top+=l,yt.bottom+=l,wo(yt,n,r,!1)?(yt.top<=r&&yt.left<=n&&(he=wt,oe=yt),!0):!1},f,g),Fe,Ye,Je=!1;if(oe){var nt=n-oe.left<oe.right-n,Ze=nt==v;Re=he+(Ze?0:1),Ye=Ze?"after":"before",Fe=nt?oe.left:oe.right}else{!v&&(Re==g||Re==f)&&Re++,Ye=Re==0?"after":Re==t.text.length?"before":ai(e,s,Re-(v?1:0)).bottom+l<=r==v?"after":"before";var ut=Qn(e,We(i,Re,Ye),"line",t,s);Fe=ut.left,Je=r<ut.top?-1:r>=ut.bottom?1:0}return Re=Xe(t.text,Re,1),bo(i,Re,Ye,Je,n-Fe)}function Gs(e,t,i,n,r,s,l){var f=mt(function(V){var he=r[V],oe=he.level!=1;return wo(Qn(e,We(i,oe?he.to:he.from,oe?"before":"after"),"line",t,n),s,l,!0)},0,r.length-1),g=r[f];if(f>0){var v=g.level!=1,I=Qn(e,We(i,v?g.from:g.to,v?"after":"before"),"line",t,n);wo(I,s,l,!0)&&I.top>l&&(g=r[f-1])}return g}function Vs(e,t,i,n,r,s,l){var f=pa(e,t,n,l),g=f.begin,v=f.end;/\s/.test(t.text.charAt(v-1))&&v--;for(var I=null,V=null,he=0;he<r.length;he++){var oe=r[he];if(oe.from>=v||oe.to<=g)continue;var Re=oe.level!=1,Fe=ai(e,n,Re?Math.min(v,oe.to)-1:Math.max(g,oe.from)).right,Ye=Fe<s?s-Fe+1e9:Fe-s;(!I||V>Ye)&&(I=oe,V=Ye)}return I||(I=r[r.length-1]),I.from<g&&(I={from:g,to:I.to,level:I.level}),I.to>v&&(I={from:I.from,to:v,level:I.level}),I}var ji;function Zi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ji==null){ji=M("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ji.appendChild(document.createTextNode("x")),ji.appendChild(M("br"));ji.appendChild(document.createTextNode("x"))}ye(e.measure,ji);var i=ji.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),Pe(e.measure),i||1}function Qi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=M("span","xxxxxxxxxx"),i=M("pre",[t],"CodeMirror-line-like");ye(e.measure,i);var n=t.getBoundingClientRect(),r=(n.right-n.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function Co(e){for(var t=e.display,i={},n={},r=t.gutters.clientLeft,s=t.gutters.firstChild,l=0;s;s=s.nextSibling,++l){var f=e.display.gutterSpecs[l].className;i[f]=s.offsetLeft+s.clientLeft+r,n[f]=s.clientWidth}return{fixedPos:So(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function So(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ma(e){var t=Zi(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/Qi(e.display)-3);return function(r){if(Zn(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 Eo(e){var t=e.doc,i=ma(e);t.iter(function(n){var r=i(n);r!=n.height&&An(n,r)})}function Bi(e,t,i,n){var r=e.display;if(!i&&le(t).getAttribute("cm-not-content")=="true")return null;var s,l,f=r.lineSpace.getBoundingClientRect();try{s=t.clientX-f.left,l=t.clientY-f.top}catch(V){return null}var g=xo(e,s,l),v;if(n&&g.xRel>0&&(v=ct(e.doc,g.line).text).length==g.ch){var I=C(v,v.length,e.options.tabSize)-v.length;g=We(g.line,Math.max(0,Math.round((s-ia(e.display).left)/Qi(e.display))-I))}return g}function Ui(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 Mn(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)_n&&wi(e.doc,t)<r.viewTo&&Ei(e);else if(i<=r.viewFrom)_n&&Ur(e.doc,i+n)>r.viewFrom?Ei(e):(r.viewFrom+=n,r.viewTo+=n);else if(t<=r.viewFrom&&i>=r.viewTo)Ei(e);else if(t<=r.viewFrom){var s=Wr(e,i,i+n,1);s?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=n):Ei(e)}else if(i>=r.viewTo){var l=Wr(e,t,t,-1);l?(r.view=r.view.slice(0,l.index),r.viewTo=l.lineN):Ei(e)}else{var f=Wr(e,t,t,-1),g=Wr(e,i,i+n,1);f&&g?(r.view=r.view.slice(0,f.index).concat(Jt(e,f.lineN,g.lineN)).concat(r.view.slice(g.index)),r.viewTo+=n):Ei(e)}var v=r.externalMeasured;v&&(i<v.lineN?v.lineN+=n:t<v.lineN+v.size&&(r.externalMeasured=null))}function Si(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[Ui(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);J(l,i)==-1&&l.push(i)}function Ei(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Wr(e,t,i,n){var r=Ui(e,t),s,l=e.display.view;if(!_n||i==e.doc.first+e.doc.size)return{index:r,lineN:i};for(var f=e.display.viewFrom,g=0;g<r;g++)f+=l[g].size;if(f!=t){if(n>0){if(r==l.length-1)return null;s=f+l[r].size-t,r++}else s=f-t;t+=s,i+=s}for(;wi(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=Jt(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=Jt(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Ui(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(Jt(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,Ui(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 f=i.sel.ranges[l];if(f.from().line>=e.display.viewTo||f.to().line<e.display.viewFrom)continue;var g=f.empty();(g||e.options.showCursorWhenSelecting)&&ba(e,f.head,r),g||Ks(e,f,s)}return n}function ba(e,t,i){var n=Qn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=i.appendChild(M("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(M("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),f=l.left,g=Math.max(n.sizerWidth,Ii(e)-n.sizer.offsetLeft)-l.right,v=r.direction=="ltr";function I(Ze,ut,wt,yt){ut<0&&(ut=0),ut=Math.round(ut),yt=Math.round(yt),s.appendChild(M("div",null,"CodeMirror-selected","position: absolute; left: "+Ze+`px;
top: `+ut+"px; width: "+(wt==null?g-Ze:wt)+`px;
height: `+(yt-ut)+"px"))}function V(Ze,ut,wt){var yt=ct(r,Ze),_t=yt.text.length,Yt,pn;function Zt(nn,Dn){return yo(e,We(Ze,nn),"div",yt,Dn)}function Un(nn,Dn,xn){var sn=ga(e,yt,null,nn),rn=Dn=="ltr"==(xn=="after")?"left":"right",Qt=xn=="after"?sn.begin:sn.end-(/\s/.test(yt.text.charAt(sn.end-1))?2:1);return Zt(Qt,rn)[rn]}var On=lt(yt,r.direction);return tt(On,ut||0,wt==null?_t:wt,function(nn,Dn,xn,sn){var rn=xn=="ltr",Qt=Zt(nn,rn?"left":"right"),Pn=Zt(Dn-1,rn?"right":"left"),cr=ut==null&&nn==0,Mi=wt==null&&Dn==_t,Cn=sn==0,si=!On||sn==On.length-1;if(Pn.top-Qt.top<=3){var gn=(v?cr:Mi)&&Cn,$o=(v?Mi:cr)&&si,mi=gn?f:(rn?Qt:Pn).left,Gi=$o?g:(rn?Pn:Qt).right;I(mi,Qt.top,Gi-mi,Qt.bottom)}else{var Vi,kn,dr,Jo;rn?(Vi=v&&cr&&Cn?f:Qt.left,kn=v?g:Un(nn,xn,"before"),dr=v?f:Un(Dn,xn,"after"),Jo=v&&Mi&&si?g:Pn.right):(Vi=v?Un(nn,xn,"before"):f,kn=!v&&cr&&Cn?g:Qt.right,dr=!v&&Mi&&si?f:Pn.left,Jo=v?Un(Dn,xn,"after"):g),I(Vi,Qt.top,kn-Vi,Qt.bottom),Qt.bottom<Pn.top&&I(f,Qt.bottom,null,Pn.top),I(dr,Pn.top,Jo-dr,Pn.bottom)}(!Yt||Gr(Qt,Yt)<0)&&(Yt=Qt),Gr(Pn,Yt)<0&&(Yt=Pn),(!pn||Gr(Qt,pn)<0)&&(pn=Qt),Gr(Pn,pn)<0&&(pn=Pn)}),{start:Yt,end:pn}}var he=t.from(),oe=t.to();if(he.line==oe.line)V(he.line,he.ch,oe.ch);else{var Re=ct(r,he.line),Fe=ct(r,oe.line),Ye=an(Re)==an(Fe),Je=V(he.line,he.ch,Ye?Re.text.length+1:null).end,nt=V(oe.line,Ye?0:null,oe.ch).start;Ye&&(Je.top<nt.top-2?(I(Je.right,Je.top,null,Je.bottom),I(f,nt.top,nt.left,nt.bottom)):I(Je.right,Je.top,nt.left-Je.right,Je.bottom)),Je.bottom<nt.top&&I(f,Je.bottom,null,nt.top)}i.appendChild(s)}function ko(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()||qi(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function xa(e){e.state.focused||(e.display.input.focus(),To(e))}function wa(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,qi(e))},100)}function To(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Oe(e,"focus",e,t),e.state.focused=!0,P(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),B&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ko(e)}function qi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Oe(e,"blur",e,t),e.state.focused=!1,Te(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,f=0;if(r.hidden)continue;if(T&&R<8){var g=r.node.offsetTop+r.node.offsetHeight;l=g-i,i=g}else{var v=r.node.getBoundingClientRect();l=v.bottom-v.top,!s&&r.text.firstChild&&(f=r.text.firstChild.getBoundingClientRect().right-v.left-1)}var I=r.line.height-l;if((I>.005||I<-.005)&&(An(r.line,l),Ca(r.line),r.rest))for(var V=0;V<r.rest.length;V++)Ca(r.rest[V]);if(f>e.display.sizerWidth){var he=Math.ceil(f/Qi(e.display));he>e.display.maxLineLength&&(e.display.maxLineLength=he,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function Ca(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-Fr(e));var r=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,s=Kn(t,n),l=Kn(t,r);if(i&&i.ensure){var f=i.ensure.from.line,g=i.ensure.to.line;f<s?(s=f,l=Kn(t,jn(ct(t,f))+e.wrapper.clientHeight)):Math.min(g,t.lastLine())>=l&&(s=Kn(t,jn(ct(t,g))-e.wrapper.clientHeight),l=g)}return{from:s,to:Math.max(l,s+1)}}function Ys(e,t){if(ze(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&&!U){var s=M("div","\u200B",null,`position: absolute;
top: `+(t.top-i.viewOffset-Fr(e.display))+`px;
height: `+(t.bottom-t.top+oi(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 $s(e,t,i,n){n==null&&(n=0);var r;!e.options.lineWrapping&&t==i&&(t=t.ch?We(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?We(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,f=Qn(e,t),g=!i||i==t?f:Qn(e,i);r={left:Math.min(f.left,g.left),top:Math.min(f.top,g.top)-n,right:Math.max(f.left,g.left),bottom:Math.max(f.bottom,g.bottom)+n};var v=Ao(e,r),I=e.doc.scrollTop,V=e.doc.scrollLeft;if(v.scrollTop!=null&&(xr(e,v.scrollTop),Math.abs(e.doc.scrollTop-I)>1&&(l=!0)),v.scrollLeft!=null&&(Hi(e,v.scrollLeft),Math.abs(e.doc.scrollLeft-V)>1&&(l=!0)),!l)break}return r}function Js(e,t){var i=Ao(e,t);i.scrollTop!=null&&xr(e,i.scrollTop),i.scrollLeft!=null&&Hi(e,i.scrollLeft)}function Ao(e,t){var i=e.display,n=Zi(e.display);t.top<0&&(t.top=0);var r=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,s=go(e),l={};t.bottom-t.top>s&&(t.bottom=t.top+s);var f=e.doc.height+po(i),g=t.top<n,v=t.bottom>f-n;if(t.top<r)l.scrollTop=g?0:t.top;else if(t.bottom>r+s){var I=Math.min(t.top,(v?f:t.bottom)-s);I!=r&&(l.scrollTop=I)}var V=e.options.fixedGutter?0:i.gutters.offsetWidth,he=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-V,oe=Ii(e)-i.gutters.offsetWidth,Re=t.right-t.left>oe;return Re&&(t.right=t.left+oe),t.left<10?l.scrollLeft=0:t.left<he?l.scrollLeft=Math.max(0,t.left+V-(Re?0:10)):t.right>oe+he-3&&(l.scrollLeft=t.right+(Re?0:10)-oe),l}function _o(e,t){if(t==null)return;Kr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function er(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 Zs(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);Sa(e,i,n,t.margin)}}function Sa(e,t,i,n){var r=Ao(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 xr(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;ne||Mo(e,{top:t}),Ea(e,t,!0),ne&&Mo(e),Sr(e,100)}function Ea(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,La(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function wr(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+oi(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Fi=function(e,t,i){this.cm=i;var n=this.vert=M("div",[M("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=M("div",[M("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=r.tabIndex=-1,e(n),e(r),Le(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Le(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,T&&R<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Fi.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}},Fi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Fi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Fi.prototype.zeroWidthHack=function(){var e=ae&&!Q?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new F,this.disableVert=new F},Fi.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)},Fi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Cr=function(){};Cr.prototype.update=function(){return{bottom:0,right:0}},Cr.prototype.setScrollLeft=function(){},Cr.prototype.setScrollTop=function(){},Cr.prototype.clear=function(){};function tr(e,t){t||(t=wr(e));var i=e.display.barWidth,n=e.display.barHeight;ka(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),ka(e,wr(e)),i=e.display.barWidth,n=e.display.barHeight}function ka(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 Ta={native:Fi,null:Cr};function Aa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Te(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ta[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Le(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?Hi(e,t):xr(e,t)},e),e.display.scrollbars.addClass&&P(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function zi(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},Dt(e.curOp)}function Wi(e){var t=e.curOp;t&&Gt(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;qs(i)})}function qs(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var n=0;n<t.length;n++)tl(t[n]);for(var 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&&fi(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 Yr(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Lo(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Vr(t),e.barMeasure=wr(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+oi(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Ii(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==j();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&tr(t,e.barMeasure),e.updatedDisplay&&Oo(t,e.barMeasure),e.selectionChanged&&ko(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&xa(e.cm)}function rl(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&_a(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&Ea(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Hi(t,e.scrollLeft,!0,!0),e.scrollToPos){var r=$s(t,o(n,e.scrollToPos.from),o(n,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,r)}var s=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(s)for(var f=0;f<s.length;++f)s[f].lines.length||Oe(s[f],"hide");if(l)for(var g=0;g<l.length;++g)l[g].lines.length&&Oe(l[g],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Oe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Bn(e,t){if(e.curOp)return t();zi(e);try{return t()}finally{Wi(e)}}function dn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);zi(e);try{return t.apply(e,arguments)}finally{Wi(e)}}}function En(e){return function(){if(this.curOp)return e.apply(this,arguments);zi(this);try{return e.apply(this,arguments)}finally{Wi(this)}}}function fn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);zi(t);try{return e.apply(this,arguments)}finally{Wi(t)}}}function Sr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,p(ol,e))}function ol(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=pe(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,f=s.text.length>e.options.maxHighlightLength?Tn(t.mode,n.state):null,g=K(e,s,n,!0);f&&(n.state=f),s.styles=g.styles;var v=s.styleClasses,I=g.classes;I?s.styleClasses=I:v&&(s.styleClasses=null);for(var V=!l||l.length!=s.styles.length||v!=I&&(!v||!I||v.bgClass!=I.bgClass||v.textClass!=I.textClass),he=0;!V&&he<l.length;++he)V=l[he]!=s.styles[he];V&&r.push(n.line),s.stateAfter=n.save(),n.nextLine()}else s.text.length<=e.options.maxHighlightLength&&ht(e,s.text,n),s.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return Sr(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),r.length&&Bn(e,function(){for(var s=0;s<r.length;s++)Si(e,r[s],"text")})}var Yr=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=Ii(e),this.force=i,this.dims=Co(e),this.events=[]};Yr.prototype.signal=function(e,t){Y(e,t)&&this.events.push(arguments)},Yr.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Oe.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=oi(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=oi(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=j();if(!t||!w(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&w(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==j())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&w(document.body,e.anchorNode)&&w(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 Lo(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return Ei(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;Ma(e)&&(Ei(e),t.dims=Co(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)),_n&&(s=wi(e.doc,s),l=Ur(e.doc,l));var f=s!=i.viewFrom||l!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Xs(e,s,l),i.viewOffset=jn(ct(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var g=va(e);if(!f&&g==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var v=sl(e);return g>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),g>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(v),Pe(i.cursorDiv),Pe(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,f&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Sr(e,400)),i.updateLineNumbers=null,!0}function _a(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Ii(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+po(e.display)-go(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(!Lo(e,t))break;Vr(e);var r=wr(e);yr(e),tr(e,r),Oo(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 Mo(e,t){var i=new Yr(e,t);if(Lo(e,i)){Vr(e),_a(e,i);var n=wr(e);yr(e),tr(e,n),Oo(e,n),i.finish()}}function ul(e,t,i){var n=e.display,r=e.options.lineNumbers,s=n.lineDiv,l=s.firstChild;function f(Re){var Fe=Re.nextSibling;return B&&ae&&e.display.currentWheelTarget==Re?Re.style.display="none":Re.parentNode.removeChild(Re),Fe}for(var g=n.view,v=n.viewFrom,I=0;I<g.length;I++){var V=g[I];if(!V.hidden)if(!V.node||V.node.parentNode!=s){var he=Is(e,V,v,i);s.insertBefore(he,l)}else{for(;l!=V.node;)l=f(l);var oe=r&&t!=null&&t<=v&&V.lineNumber;V.changes&&(J(V.changes,"gutter")>-1&&(oe=!1),pr(e,V,v,i)),oe&&(Pe(V.lineNumber),V.lineNumber.appendChild(document.createTextNode(vi(e.options,v)))),l=V.node.nextSibling}v+=V.size}for(;l;)l=f(l)}function Ro(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Oo(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+oi(e)+"px"}function La(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=So(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 f=i[l].alignable;if(f)for(var g=0;g<f.length;g++)f[g].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=n+r+"px")}function Ma(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=vi(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var r=n.measure.appendChild(M("div",[M("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",Ro(e.display),!0}return!1}function Do(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 Ra(e){var t=e.gutters,i=e.gutterSpecs;Pe(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var r=i[n],s=r.className,l=r.style,f=t.appendChild(M("div",null,"CodeMirror-gutter "+s));l&&(f.style.cssText=l),s=="CodeMirror-linenumbers"&&(e.lineGutter=f,f.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Ro(e)}function Er(e){Ra(e.display),Mn(e),La(e)}function hl(e,t,i,n){var r=this;this.input=i,r.scrollbarFiller=M("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=M("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=de("div",null,"CodeMirror-code"),r.selectionDiv=M("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=M("div",null,"CodeMirror-cursors"),r.measure=M("div",null,"CodeMirror-measure"),r.lineMeasure=M("div",null,"CodeMirror-measure"),r.lineSpace=de("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var s=de("div",[r.lineSpace],"CodeMirror-lines");r.mover=M("div",[s],null,"position: relative"),r.sizer=M("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=M("div",null,null,"position: absolute; height: "+xe+"px; width: 1px;"),r.gutters=M("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=M("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=M("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),T&&R<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),!B&&!(ne&&ce)&&(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=Do(n.gutters,n.lineNumbers),Ra(r),i.init(r)}var $r=0,Gn=null;T?Gn=-.53:ne?Gn=15:L?Gn=-.7:te&&(Gn=-1/3);function Oa(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 cl(e){var t=Oa(e);return t.x*=Gn,t.y*=Gn,t}function Da(e,t){var i=Oa(t),n=i.x,r=i.y,s=e.display,l=s.scroller,f=l.scrollWidth>l.clientWidth,g=l.scrollHeight>l.clientHeight;if(!(n&&f||r&&g))return;if(r&&ae&&B){e:for(var v=t.target,I=s.view;v!=l;v=v.parentNode)for(var V=0;V<I.length;V++)if(I[V].node==v){e.display.currentWheelTarget=v;break e}}if(n&&!ne&&!E&&Gn!=null){r&&g&&xr(e,Math.max(0,l.scrollTop+r*Gn)),Hi(e,Math.max(0,l.scrollLeft+n*Gn)),(!r||r&&g)&&y(t),s.wheelStartX=null;return}if(r&&Gn!=null){var he=r*Gn,oe=e.doc.scrollTop,Re=oe+s.wrapper.clientHeight;he<0?oe=Math.max(0,oe+he-50):Re=Math.min(e.doc.height,Re+he+50),Mo(e,{top:oe,bottom:Re})}$r<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 Fe=l.scrollLeft-s.wheelStartX,Ye=l.scrollTop-s.wheelStartY,Je=Ye&&s.wheelDY&&Ye/s.wheelDY||Fe&&s.wheelDX&&Fe/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!Je)return;Gn=(Gn*$r+Je)/($r+1),++$r},200)):(s.wheelDX+=n,s.wheelDY+=r))}var Vn=function(e,t){this.ranges=e,this.primIndex=t};Vn.prototype.primary=function(){return this.ranges[this.primIndex]},Vn.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(!ti(i.anchor,n.anchor)||!ti(i.head,n.head))return!1}return!0},Vn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ft(ci(this.ranges[t].anchor),ci(this.ranges[t].head));return new Vn(e,this.primIndex)},Vn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Vn.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(St(t,n.from())>=0&&St(e,n.to())<=0)return i}return-1};var Ft=function(e,t){this.anchor=e,this.head=t};Ft.prototype.from=function(){return Ri(this.anchor,this.head)},Ft.prototype.to=function(){return di(this.anchor,this.head)},Ft.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function qn(e,t,i){var n=e&&e.options.selectionsMayTouch,r=t[i];t.sort(function(he,oe){return St(he.from(),oe.from())}),i=J(t,r);for(var s=1;s<t.length;s++){var l=t[s],f=t[s-1],g=St(f.to(),l.from());if(n&&!l.empty()?g>0:g>=0){var v=Ri(f.from(),l.from()),I=di(f.to(),l.to()),V=f.empty()?l.from()==l.head:f.from()==f.head;s<=i&&--i,t.splice(--s,2,new Ft(V?I:v,V?v:I))}}return new Vn(t,i)}function ki(e,t){return new Vn([new Ft(e,t||e)],0)}function Ti(e){return e.text?We(e.from.line+e.text.length-1,b(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Pa(e,t){if(St(e,t.from)<0)return e;if(St(e,t.to)<=0)return Ti(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+=Ti(t).ch-t.to.ch),We(i,n)}function Po(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var r=e.sel.ranges[n];i.push(new Ft(Pa(r.anchor,t),Pa(r.head,t)))}return qn(e.cm,i,e.sel.primIndex)}function Na(e,t,i){return e.line==t.line?We(i.line,e.ch-t.ch+i.ch):We(i.line+(e.line-t.line),e.ch)}function dl(e,t,i){for(var n=[],r=We(e.first,0),s=r,l=0;l<t.length;l++){var f=t[l],g=Na(f.from,r,s),v=Na(Ti(f),r,s);if(r=f.to,s=v,i=="around"){var I=e.sel.ranges[l],V=St(I.head,I.anchor)<0;n[l]=new Ft(V?v:g,V?g:v)}else n[l]=new Ft(g,g)}return new Vn(n,e.sel.primIndex)}function No(e){e.doc.mode=Sn(e.options,e.doc.modeOption),kr(e)}function kr(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,Sr(e,100),e.state.modeGen++,e.curOp&&Mn(e)}function Ia(e,t){return t.from.ch==0&&t.to.ch==0&&b(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Io(e,t,i,n){function r(nt){return i?i[nt]:null}function s(nt,Ze,ut){uo(nt,Ze,ut,n),Xt(nt,"change",nt,t)}function l(nt,Ze){for(var ut=[],wt=nt;wt<Ze;++wt)ut.push(new Ci(v[wt],r(wt),n));return ut}var f=t.from,g=t.to,v=t.text,I=ct(e,f.line),V=ct(e,g.line),he=b(v),oe=r(v.length-1),Re=g.line-f.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 Fe=l(0,v.length-1);s(V,V.text,oe),Re&&e.remove(f.line,Re),Fe.length&&e.insert(f.line,Fe)}else if(I==V)if(v.length==1)s(I,I.text.slice(0,f.ch)+he+I.text.slice(g.ch),oe);else{var Ye=l(1,v.length-1);Ye.push(new Ci(he+I.text.slice(g.ch),oe,n)),s(I,I.text.slice(0,f.ch)+v[0],r(0)),e.insert(f.line+1,Ye)}else if(v.length==1)s(I,I.text.slice(0,f.ch)+v[0]+V.text.slice(g.ch),r(0)),e.remove(f.line+1,Re);else{s(I,I.text.slice(0,f.ch)+v[0],r(0)),s(V,he+V.text.slice(g.ch),oe);var Je=l(1,v.length-1);Re>1&&e.remove(f.line+1,Re-1),e.insert(f.line+1,Je)}Xt(e,"change",e,t)}function Ai(e,t,i){function n(r,s,l){if(r.linked)for(var f=0;f<r.linked.length;++f){var g=r.linked[f];if(g.doc==s)continue;var v=l&&g.sharedHist;if(i&&!v)continue;t(g.doc,v),n(g.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,Eo(e),No(e),Ba(e),e.options.lineWrapping||fi(e),e.options.mode=t.modeOption,Mn(e)}function Ba(e){(e.doc.direction=="rtl"?P:Te)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Bn(e,function(){Ba(e),Mn(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:ci(t.from),to:Ti(t),text:Hn(e,t.from,t.to)};return Fa(e,i,t.from.line,t.to.line+1),Ai(e,function(n){return Fa(n,i,t.from.line,t.to.line+1)},!0),i}function Ua(e){for(;e.length;){var t=b(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ua(e.done),b(e.done);if(e.done.length&&!b(e.done).ranges)return b(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),b(e.done)}function Ha(e,t,i,n){var r=e.history;r.undone.length=0;var s=+new Date,l,f;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)))f=b(l.changes),St(t.from,t.to)==0&&St(t.from,f.to)==0?f.to=Ti(t):l.changes.push(jo(e,t));else{var g=b(r.done);for((!g||!g.ranges)&&Zr(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,f||Oe(e,"historyAdded")}function gl(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 ml(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||gl(e,s,b(r.done),t))?r.done[r.done.length-1]=t:Zr(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=s,r.lastSelOp=i,n&&n.clearRedo!==!1&&Ua(r.undone)}function Zr(e,t){var i=b(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Fa(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=Nn(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 f=0;f<l.length;++f){for(var g=l[f],v=0;v<s.length;++v)if(s[v].marker==g.marker)continue e;s.push(g)}}else l&&(i[r]=l)}return i}function nr(e,t,i){for(var n=[],r=0;r<e.length;++r){var s=e[r];if(s.ranges){n.push(i?Vn.prototype.deepCopy.call(s):s);continue}var l=s.changes,f=[];n.push({changes:f});for(var g=0;g<l.length;++g){var v=l[g],I=void 0;if(f.push({from:v.from,to:v.to,text:v.text}),t)for(var V in v)(I=V.match(/^spans_(\d+)$/))&&(J(t,Number(I[1]))>-1&&(b(f)[V]=v[V],delete v[V]))}}return n}function Bo(e,t,i,n){if(n){var r=e.anchor;if(i){var s=St(t,r)<0;s!=St(i,r)<0?(r=t,t=i):s!=St(t,i)<0&&(t=i)}return new Ft(r,t)}else return new Ft(i||t,t)}function Qr(e,t,i,n,r){r==null&&(r=e.cm&&(e.cm.display.shift||e.extend)),wn(e,new Vn([Bo(e.sel.primary(),t,i,r)],0),n)}function Wa(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]=Bo(e.sel.ranges[s],t[s],null,r);var l=qn(e.cm,n,e.sel.primIndex);wn(e,l,i)}function Uo(e,t,i,n){var r=e.sel.ranges.slice(0);r[t]=i,wn(e,qn(e.cm,r,e.sel.primIndex),n)}function Ga(e,t,i,n){wn(e,ki(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 Ft(o(e,r[s].anchor),o(e,r[s].head))},origin:i&&i.origin};return Oe(e,"beforeSelectionChange",e,n),e.cm&&Oe(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?qn(e.cm,n.ranges,n.ranges.length-1):t}function Va(e,t,i){var n=e.history.done,r=b(n);r&&r.ranges?(n[n.length-1]=t,qr(e,t,i)):wn(e,t,i)}function wn(e,t,i){qr(e,t,i),ml(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function qr(e,t,i){(Y(e,"beforeSelectionChange")||e.cm&&Y(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(St(t.primary().head,e.sel.primary().head)<0?-1:1);Xa(e,Ya(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&er(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,ee(e.cm)),Xt(e,"cursorActivity",e)}function Ka(e){Xa(e,Ya(e,e.sel,null,!1))}function Ya(e,t,i,n){for(var r,s=0;s<t.ranges.length;s++){var l=t.ranges[s],f=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[s],g=eo(e,l.anchor,f&&f.anchor,i,n),v=eo(e,l.head,f&&f.head,i,n);(r||g!=l.anchor||v!=l.head)&&(r||(r=t.ranges.slice(0,s)),r[s]=new Ft(g,v))}return r?qn(e.cm,r,t.primIndex):t}function ir(e,t,i,n,r){var s=ct(e,t.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var f=s.markedSpans[l],g=f.marker,v="selectLeft"in g?!g.selectLeft:g.inclusiveLeft,I="selectRight"in g?!g.selectRight:g.inclusiveRight;if((f.from==null||(v?f.from<=t.ch:f.from<t.ch))&&(f.to==null||(I?f.to>=t.ch:f.to>t.ch))){if(r&&(Oe(g,"beforeCursorEnter"),g.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!g.atomic)continue;if(i){var V=g.find(n<0?1:-1),he=void 0;if((n<0?I:v)&&(V=$a(e,V,-n,V&&V.line==t.line?s:null)),V&&V.line==t.line&&(he=St(V,i))&&(n<0?he<0:he>0))return ir(e,V,t,n,r)}var oe=g.find(n<0?-1:1);return(n<0?v:I)&&(oe=$a(e,oe,n,oe.line==t.line?s:null)),oe?ir(e,oe,t,n,r):null}}return t}function eo(e,t,i,n,r){var s=n||1,l=ir(e,t,i,s,r)||!r&&ir(e,t,i,s,!0)||ir(e,t,i,-s,r)||!r&&ir(e,t,i,-s,!0);return l||(e.cantEdit=!0,We(e.first,0))}function $a(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,We(t.line-1)):null:i>0&&t.ch==(n||ct(e,t.line)).text.length?t.line<e.first+e.size-1?We(t.line+1,0):null:new We(t.line,t.ch+i)}function Ja(e){e.setSelection(We(e.firstLine(),0),We(e.lastLine()),ge)}function Za(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,f){r&&(n.from=o(e,r)),s&&(n.to=o(e,s)),l&&(n.text=l),f!==void 0&&(n.origin=f)}),Oe(e,"beforeChange",e,n),e.cm&&Oe(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 rr(e,t,i){if(e.cm){if(!e.cm.curOp)return dn(e.cm,rr)(e,t,i);if(e.cm.state.suppressEdits)return}if((Y(e,"beforeChange")||e.cm&&Y(e.cm,"beforeChange"))&&(t=Za(e,t,!0),!t))return;var n=Xi&&!i&&Oi(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]==""&&St(t.from,t.to)==0)return;var i=Po(e,t);Ha(e,t,i,e.cm?e.cm.curOp.id:NaN),Tr(e,t,i,Nn(e,t));var n=[];Ai(e,function(r,s){!s&&J(n,r.history)==-1&&(ns(r.history,t),n.push(r.history)),Tr(r,t,null,Nn(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,f=t=="undo"?r.done:r.undone,g=t=="undo"?r.undone:r.done,v=0;v<f.length&&!(s=f[v],i?s.ranges&&!s.equals(e.sel):!s.ranges);v++);if(v==f.length)return;for(r.lastOrigin=r.lastSelOrigin=null;;)if(s=f.pop(),s.ranges){if(Zr(s,g),i&&!s.equals(e.sel)){wn(e,s,{clearRedo:!1});return}l=s}else if(n){f.push(s);return}else break;var I=[];Zr(l,g),g.push({changes:I,generation:r.generation}),r.generation=s.generation||++r.maxGeneration;for(var V=Y(e,"beforeChange")||e.cm&&Y(e.cm,"beforeChange"),he=function(Fe){var Ye=s.changes[Fe];if(Ye.origin=t,V&&!Za(e,Ye,!1))return f.length=0,{};I.push(jo(e,Ye));var Je=Fe?Po(e,Ye):b(f);Tr(e,Ye,Je,za(e,Ye)),!Fe&&e.cm&&e.cm.scrollIntoView({from:Ye.from,to:Ti(Ye)});var nt=[];Ai(e,function(Ze,ut){!ut&&J(nt,Ze.history)==-1&&(ns(Ze.history,Ye),nt.push(Ze.history)),Tr(Ze,Ye,null,za(Ze,Ye))})},oe=s.changes.length-1;oe>=0;--oe){var Re=he(oe);if(Re)return Re.v}}function qa(e,t){if(t==0)return;if(e.first+=t,e.sel=new Vn(X(e.sel.ranges,function(r){return new Ft(We(r.anchor.line+t,r.anchor.ch),We(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){Mn(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)Si(e.cm,n,"gutter")}}function Tr(e,t,i,n){if(e.cm&&!e.cm.curOp)return dn(e.cm,Tr)(e,t,i,n);if(t.to.line<e.first){qa(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);qa(e,r),t={from:We(e.first,0),to:We(t.to.line+r,t.to.ch),text:[b(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:We(s,ct(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Hn(e,t.from,t.to),i||(i=Po(e,t)),e.cm?xl(e.cm,t,n):Io(e,t,n),qr(e,i,ge),e.cantEdit&&eo(e,We(e.firstLine(),0))&&(e.cantEdit=!1)}function xl(e,t,i){var n=e.doc,r=e.display,s=t.from,l=t.to,f=!1,g=s.line;e.options.lineWrapping||(g=Pt(an(ct(n,s.line))),n.iter(g,l.line+1,function(oe){if(oe==r.maxLine)return f=!0,!0})),n.sel.contains(t.from,t.to)>-1&&ee(e),Io(n,t,i,ma(e)),e.options.lineWrapping||(n.iter(g,s.line+t.text.length,function(oe){var Re=$i(oe);Re>r.maxLineLength&&(r.maxLine=oe,r.maxLineLength=Re,r.maxLineChanged=!0,f=!1)}),f&&(e.curOp.updateMaxLine=!0)),Yn(n,s.line),Sr(e,400);var v=t.text.length-(l.line-s.line)-1;t.full?Mn(e):s.line==l.line&&t.text.length==1&&!Ia(e.doc,t)?Si(e,s.line,"text"):Mn(e,s.line,l.line+1,v);var I=Y(e,"changes"),V=Y(e,"change");if(V||I){var he={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};V&&Xt(e,"change",e,he),I&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(he)}e.display.selForContextMenu=null}function or(e,t,i,n,r){var s;n||(n=i),St(n,i)<0&&(s=[n,i],i=s[0],n=s[1]),typeof t=="string"&&(t=e.splitLines(t)),rr(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 f=0;f<s.ranges.length;f++)es(s.ranges[f].anchor,t,i,n),es(s.ranges[f].head,t,i,n);continue}for(var g=0;g<s.changes.length;++g){var v=s.changes[g];if(i<v.from.line)v.from=We(v.from.line+n,v.from.ch),v.to=We(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 Ar(e,t,i,n){var r=t,s=t;return typeof t=="number"?s=ct(e,c(e,t)):r=Pt(t),r==null?null:(n(s,r)&&e.cm&&Si(e.cm,r,i),s)}function _r(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}_r.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,ho(r),Xt(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 Lr(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}Lr.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 _r))){var f=[];this.collapse(f),this.children=[new _r(f)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var 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,f=l;f<r.lines.length;){var g=new _r(r.lines.slice(f,f+=25));r.height-=g.height,this.children.splice(++n,0,g),g.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 Lr(t);if(e.parent){e.size-=i.size,e.height-=i.height;var r=J(e.parent.children,e);e.parent.children.splice(r+1,0,i)}else{var n=new Lr(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 Mr=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};Mr.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=Pt(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=mr(this);An(i,Math.max(0,i.height-s)),e&&(Bn(e,function(){is(e,i,-s),Si(e,n,"widget")}),Xt(e,"lineWidgetCleared",e,this,n))},Mr.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var r=mr(this)-t;if(!r)return;Zn(this.doc,n)||An(n,n.height+r),i&&Bn(i,function(){i.curOp.forceUpdate=!0,is(i,n,r),Xt(i,"lineWidgetChanged",i,e,Pt(n))})},$(Mr);function is(e,t,i){jn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&_o(e,i)}function wl(e,t,i,n){var r=new Mr(e,i,n),s=e.cm;return s&&r.noHScroll&&(s.display.alignWidgets=!0),Ar(e,t,"widget",function(l){var f=l.widgets||(l.widgets=[]);if(r.insertAt==null?f.push(r):f.splice(Math.min(f.length-1,Math.max(0,r.insertAt)),0,r),r.line=l,s&&!Zn(e,l)){var g=jn(l)<e.scrollTop;An(l,l.height+mr(r)),g&&_o(s,r.height),s.curOp.forceUpdate=!0}return!0}),s&&Xt(s,"lineWidgetAdded",s,r,typeof t=="number"?t:Pt(t)),r}var rs=0,_i=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++rs};_i.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&zi(e),Y(this,"clear")){var i=this.find();i&&Xt(this,"clear",i.from,i.to)}for(var n=null,r=null,s=0;s<this.lines.length;++s){var l=this.lines[s],f=Jn(l.markedSpans,this);e&&!this.collapsed?Si(e,Pt(l),"text"):e&&(f.to!=null&&(r=Pt(l)),f.from!=null&&(n=Pt(l))),l.markedSpans=ii(l.markedSpans,f),f.from==null&&this.collapsed&&!Zn(this.doc,l)&&e&&An(l,Zi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var g=0;g<this.lines.length;++g){var v=an(this.lines[g]),I=$i(v);I>e.display.maxLineLength&&(e.display.maxLine=v,e.display.maxLineLength=I,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Mn(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&&Xt(e,"markerCleared",e,this,n,r),t&&Wi(e),this.parent&&this.parent.clear()},_i.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=Jn(s.markedSpans,this);if(l.from!=null&&(i=We(t?s:Pt(s),l.from),e==-1))return i;if(l.to!=null&&(n=We(t?s:Pt(s),l.to),e==1))return n}return i&&{from:i,to:n}},_i.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;Bn(n,function(){var r=t.line,s=Pt(t.line),l=mo(n,s);if(l&&(la(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Zn(i.doc,r)&&i.height!=null){var f=i.height;i.height=null;var g=mr(i)-f;g&&An(r,r.height+g)}Xt(n,"markerChanged",n,e)})},_i.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||J(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},_i.prototype.detachLine=function(e){if(this.lines.splice(J(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},$(_i);function ar(e,t,i,n,r){if(n&&n.shared)return Cl(e,t,i,n,r);if(e.cm&&!e.cm.curOp)return dn(e.cm,ar)(e,t,i,n,r);var s=new _i(e,r),l=St(t,i);if(n&&d(n,s,!1),l>0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=de("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(on(e,t.line,t,i,s)||t.line!=i.line&&on(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");ni()}s.addToHistory&&Ha(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var f=t.line,g=e.cm,v;if(e.iter(f,i.line+1,function(V){g&&s.collapsed&&!g.options.lineWrapping&&an(V)==g.display.maxLine&&(v=!0),s.collapsed&&f!=t.line&&An(V,0),Wn(V,new yi(s,f==t.line?t.ch:null,f==i.line?i.ch:null)),++f}),s.collapsed&&e.iter(t.line,i.line+1,function(V){Zn(e,V)&&An(V,0)}),s.clearOnEnter&&Le(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(Ln(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++rs,s.atomic=!0),g){if(v&&(g.curOp.updateMaxLine=!0),s.collapsed)Mn(g,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var I=t.line;I<=i.line;I++)Si(g,I,"text");s.atomic&&Ka(g.doc),Xt(g,"markerAdded",g,s)}return s}var Rr=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Rr.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Xt(this,"clear")},Rr.prototype.find=function(e,t){return this.primary.find(e,t)},$(Rr);function Cl(e,t,i,n,r){n=d(n),n.shared=!1;var s=[ar(e,t,i,n,r)],l=s[0],f=n.widgetNode;return Ai(e,function(g){f&&(n.widgetNode=f.cloneNode(!0)),s.push(ar(g,o(g,t),o(g,i),n,r));for(var v=0;v<g.linked.length;++v)if(g.linked[v].isParent)return;l=b(s)}),new Rr(s,l)}function os(e){return e.findMarks(We(e.first,0),e.clipPos(We(e.lastLine())),function(t){return t.parent})}function Sl(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(St(s,l)){var f=ar(e,s,l,n.primary,n.primary.type);n.markers.push(f),f.parent=n}}}function El(e){for(var t=function(n){var r=e[n],s=[r.primary.doc];Ai(r.primary.doc,function(g){return s.push(g)});for(var l=0;l<r.markers.length;l++){var f=r.markers[l];J(s,f.doc)==-1&&(f.parent=null,r.markers.splice(l--,1))}},i=0;i<e.length;i++)t(i)}var kl=0,Rn=function(e,t,i,n,r){if(!(this instanceof Rn))return new Rn(e,t,i,n,r);i==null&&(i=0),Lr.call(this,[new _r([new Ci("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var s=We(i,0);this.sel=ki(s),this.history=new Jr(null),this.id=++kl,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}),wn(this,ki(s),ge)};Rn.prototype=Ee(Lr.prototype,{constructor:Rn,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=ui(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:fn(function(e){var t=We(this.first,0),i=this.first+this.size-1;rr(this,{from:t,to:We(i,ct(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&br(this.cm,0,0),wn(this,ki(t),ge)}),replaceRange:function(e,t,i,n){t=o(this,t),i=i?o(this,i):t,or(this,e,t,i,n)},getRange:function(e,t,i){var n=Hn(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(hi(this,e))return ct(this,e)},getLineNumber:function(e){return Pt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ct(this,e)),an(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:fn(function(e,t,i){Ga(this,o(this,typeof e=="number"?We(e,t||0):e),null,i)}),setSelection:fn(function(e,t,i){Ga(this,o(this,e),o(this,t||e),i)}),extendSelection:fn(function(e,t,i){Qr(this,o(this,e),t&&o(this,t),i)}),extendSelections:fn(function(e,t){Wa(this,u(this,e),t)}),extendSelectionsBy:fn(function(e,t){var i=X(this.sel.ranges,e);Wa(this,u(this,i),t)}),setSelections:fn(function(e,t,i){if(!e.length)return;for(var n=[],r=0;r<e.length;r++)n[r]=new Ft(o(this,e[r].anchor),o(this,e[r].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),wn(this,qn(this.cm,n,t),i)}),addSelection:fn(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Ft(o(this,e),o(this,t||e))),wn(this,qn(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=Hn(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=Hn(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:fn(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 f=t&&t!="end"&&dl(this,n,t),g=n.length-1;g>=0;g--)rr(this,n[g]);f?Va(this,f):this.cm&&er(this.cm)}),undo:fn(function(){to(this,"undo")}),redo:fn(function(){to(this,"redo")}),undoSelection:fn(function(){to(this,"undo",!0)}),redoSelection:fn(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),Ai(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:nr(this.history.done),undone:nr(this.history.undone)}},setHistory:function(e){var t=this.history=new Jr(this.history.maxGeneration);t.done=nr(e.done.slice(0),null,!0),t.undone=nr(e.undone.slice(0),null,!0)},setGutterMarker:fn(function(e,t,i){return Ar(this,e,"gutter",function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&Ke(r)&&(n.gutterMarkers=null),!0})}),clearGutter:fn(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&Ar(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Ke(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!hi(this,e))return null;if(t=e,e=ct(this,e),!e)return null}else if(t=Pt(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:fn(function(e,t,i){return Ar(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(ke(i).test(n[r]))return!1;n[r]+=" "+i}return!0})}),removeLineClass:fn(function(e,t,i){return Ar(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(ke(i));if(!l)return!1;var f=l.index+l[0].length;n[r]=s.slice(0,l.index)+(!l.index||f==s.length?"":" ")+s.slice(f)||null}else return!1;return!0})}),addLineWidget:fn(function(e,t,i){return wl(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return ar(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),ar(this,e,e,i,"bookmark")},findMarksAt:function(e){e=o(this,e);var t=[],i=ct(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var 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 f=0;f<l.length;f++){var g=l[f];!(g.to!=null&&r==e.line&&e.ch>=g.to||g.from==null&&r!=e.line||g.from!=null&&r==t.line&&g.from>=t.ch)&&(!i||i(g.marker))&&n.push(g.marker.parent||g.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,We(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 Rn(ui(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 Rn(ui(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}],Sl(n,os(this)),n},unlinkDoc:function(e){if(e instanceof $t&&(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),El(os(this));break}if(e.history==this.history){var n=[e.id];Ai(e,function(r){return n.push(r.id)},!0),e.history=new Jr(null),e.history.done=nr(this.history.done,n),e.history.undone=nr(this.history.undone,n)}},iterLinkedDocs:function(e){Ai(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):dt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:fn(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)})}),Rn.prototype.eachLine=Rn.prototype.iter;var as=0;function Tl(e){var t=this;if(ss(t),ze(t,e)||pi(t.display,e))return;y(e),T&&(as=+new Date);var i=Bi(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,f=function(){++l==r&&dn(t,function(){i=o(t.doc,i);var oe={from:i,to:i,text:t.doc.splitLines(s.filter(function(Re){return Re!=null}).join(t.doc.lineSeparator())),origin:"paste"};rr(t.doc,oe),Va(t.doc,ki(o(t.doc,i),o(t.doc,Ti(oe))))})()},g=function(oe,Re){if(t.options.allowDropFileTypes&&J(t.options.allowDropFileTypes,oe.type)==-1){f();return}var Fe=new FileReader;Fe.onerror=function(){return f()},Fe.onload=function(){var Ye=Fe.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ye)){f();return}s[Re]=Ye,f()},Fe.readAsText(oe)},v=0;v<n.length;v++)g(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 I=e.dataTransfer.getData("Text");if(I){var V;if(t.state.draggingText&&!t.state.draggingText.copy&&(V=t.listSelections()),qr(t.doc,ki(i,i)),V)for(var he=0;he<V.length;++he)or(t.doc,"",V[he].anchor,V[he].head,"drag");t.replaceSelection(I,"around","paste"),t.display.input.focus()}}catch(oe){}}}function Al(e,t){if(T&&(!e.state.draggingText||+new Date-as<100)){N(t);return}if(ze(e,t)||pi(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!te){var i=M("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",E&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),E&&i.parentNode.removeChild(i)}}function _l(e,t){var i=Bi(e,t);if(!i)return;var n=document.createDocumentFragment();ba(e,i,n),e.display.dragCursor||(e.display.dragCursor=M("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),ye(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 Ll(){if(us)return;Ml(),us=!0}function Ml(){var e;Le(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ls(Rl)},100))}),Le(window,"blur",function(){return ls(qi)})}function Rl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Li={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"},Or=0;Or<10;Or++)Li[Or+48]=Li[Or+96]=String(Or);for(var no=65;no<=90;no++)Li[no]=String.fromCharCode(no);for(var Dr=1;Dr<=12;Dr++)Li[Dr+111]=Li[Dr+63235]="F"+Dr;var gi={};gi.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"},gi.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"},gi.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"},gi.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"]},gi.default=ae?gi.macDefault:gi.pcDefault;function Ol(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,r,s,l=0;l<t.length-1;l++){var f=t[l];if(/^(cmd|meta|m)$/i.test(f))s=!0;else if(/^a(lt)?$/i.test(f))i=!0;else if(/^(c|ctrl|control)$/i.test(f))n=!0;else if(/^s(hift)?$/i.test(f))r=!0;else throw new Error("Unrecognized modifier name: "+f)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),s&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Dl(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=X(i.split(" "),Ol),s=0;s<r.length;s++){var l=void 0,f=void 0;s==r.length-1?(f=r.join(" "),l=n):(f=r.slice(0,s+1).join(" "),l="...");var g=t[f];if(!g)t[f]=l;else if(g!=l)throw new Error("Inconsistent bindings for "+f)}delete e[i]}for(var v in t)e[v]=t[v];return e}function sr(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 sr(e,t.fallthrough,i,n);for(var s=0;s<t.fallthrough.length;s++){var l=sr(e,t.fallthrough[s],i,n);if(l)return l}}}function hs(e){var t=typeof e=="string"?e:Li[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function cs(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(De?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(De?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function ds(e,t){if(E&&e.keyCode==34&&e.char)return!1;var i=Li[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),cs(i,e,t))}function io(e){return typeof e=="string"?gi[e]:e}function lr(e,t){for(var i=e.doc.sel.ranges,n=[],r=0;r<i.length;r++){for(var s=t(i[r]);n.length&&St(s.from,b(n).to)<=0;){var l=n.pop();if(St(l.from,s.from)<0){s.from=l.from;break}}n.push(s)}Bn(e,function(){for(var f=n.length-1;f>=0;f--)or(e.doc,"",n[f].from,n[f].to,"+delete");er(e)})}function Ho(e,t,i){var n=Xe(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Fo(e,t,i){var n=Ho(e,t.ch,i);return n==null?null:new We(t.line,n,i<0?"after":"before")}function zo(e,t,i,n,r){if(e){t.doc.direction=="rtl"&&(r=-r);var s=lt(i,t.doc.direction);if(s){var l=r<0?b(s):s[0],f=r<0==(l.level==1),g=f?"after":"before",v;if(l.level>0||t.doc.direction=="rtl"){var I=Ji(t,i);v=r<0?i.text.length-1:0;var V=ai(t,I,v).top;v=mt(function(he){return ai(t,I,he).top==V},r<0==(l.level==1)?l.from:l.to-1,v),g=="before"&&(v=Ho(i,v,1))}else v=r<0?l.to:l.from;return new We(n,v,g)}}return new We(n,r<0?i.text.length:0,r<0?"before":"after")}function Pl(e,t,i,n){var r=lt(t,e.doc.direction);if(!r)return Fo(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=et(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 Fo(t,i,n);var f=function(Je,nt){return Ho(t,Je instanceof We?Je.ch:Je,nt)},g,v=function(Je){return e.options.lineWrapping?(g=g||Ji(e,t),ga(e,t,g,Je)):{begin:0,end:t.text.length}},I=v(i.sticky=="before"?f(i,-1):i.ch);if(e.doc.direction=="rtl"||l.level==1){var V=l.level==1==n<0,he=f(i,V?1:-1);if(he!=null&&(V?he<=l.to&&he<=I.end:he>=l.from&&he>=I.begin)){var oe=V?"before":"after";return new We(i.line,he,oe)}}var Re=function(Je,nt,Ze){for(var ut=function(Yt,pn){return pn?new We(i.line,f(Yt,1),"before"):new We(i.line,Yt,"after")};Je>=0&&Je<r.length;Je+=nt){var wt=r[Je],yt=nt>0==(wt.level!=1),_t=yt?Ze.begin:f(Ze.end,-1);if(wt.from<=_t&&_t<wt.to)return ut(_t,yt);if(_t=yt?wt.from:f(wt.to,-1),Ze.begin<=_t&&_t<Ze.end)return ut(_t,yt)}},Fe=Re(s+n,n,I);if(Fe)return Fe;var Ye=n>0?I.end:f(I.begin,-1);return Ye!=null&&!(n>0&&Ye==t.text.length)&&(Fe=Re(n>0?0:r.length-1,n,v(Ye)),Fe)?Fe:null}var Pr={selectAll:Ja,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ge)},killLine:function(e){return lr(e,function(t){if(t.empty()){var i=ct(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:We(t.head.line+1,0)}:{from:t.head,to:We(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return lr(e,function(t){return{from:We(t.from().line,0),to:o(e.doc,We(t.to().line+1,0))}})},delLineLeft:function(e){return lr(e,function(t){return{from:We(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return lr(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 lr(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(We(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(We(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")},me)},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")},me)},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},me)},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=C(e.getLine(s.line),s.ch,n);t.push(G(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Bn(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=ct(e.doc,r.line).text;if(s){if(r.ch==s.length&&(r=new We(r.line,r.ch-1)),r.ch>0)r=new We(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),We(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var l=ct(e.doc,r.line-1).text;l&&(r=new We(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),We(r.line-1,l.length-1),r,"+transpose"))}}i.push(new Ft(r,r))}e.setSelections(i)})},newlineAndIndent:function(e){return Bn(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);er(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function fs(e,t){var i=ct(e.doc,t),n=an(i);return n!=i&&(t=Pt(n)),zo(!0,e,n,t,1)}function Nl(e,t){var i=ct(e.doc,t),n=ri(i);return n!=i&&(t=Pt(n)),zo(!0,e,i,t,-1)}function ps(e,t){var i=fs(e,t.line),n=ct(e.doc,i.line),r=lt(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 We(i.line,l?0:s,i.sticky)}return i}function ro(e,t,i){if(typeof t=="string"&&(t=Pr[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)!=Me}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=sr(t,e.state.keyMaps[n],i,e);if(r)return r}return e.options.extraKeys&&sr(t,e.options.extraKeys,i,e)||sr(t,e.options.keyMap,i,e)}var jl=new F;function Nr(e,t,i,n){var r=e.state.keySeq;if(r){if(hs(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())}),gs(e,r+" "+t,i,n))return!0}return gs(e,t,i,n)}function gs(e,t,i,n){var r=Il(e,t,n);return r=="multi"&&(e.state.keySeq=t),r=="handled"&&Xt(e,"keyHandled",e,t,i),(r=="handled"||r=="multi")&&(y(i),ko(e)),!!r}function ms(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 Bl(e,t,i){return Nr(e,"'"+i+"'",t,function(n){return ro(e,n,!0)})}var Wo=null;function vs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=j(),ze(t,e))return;T&&R<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=ms(t,e);E&&(Wo=n?i:null,!n&&i==88&&!Lt&&(ae?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),ne&&!ae&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Ul(t)}function Ul(e){var t=e.display.lineDiv;P(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(Te(t,"CodeMirror-crosshair"),rt(document,"keyup",i),rt(document,"mouseover",i))}Le(document,"keyup",i),Le(document,"mouseover",i)}function ys(e){e.keyCode==16&&(this.doc.sel.shift=!1),ze(this,e)}function bs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(pi(t.display,e)||ze(t,e)||e.ctrlKey&&!e.altKey||ae&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(E&&i==Wo){Wo=null,y(e);return}if(E&&(!e.which||e.which<10)&&ms(t,e))return;var r=String.fromCharCode(n==null?i:n);if(r=="\b")return;if(Bl(t,e,r))return;t.display.input.onKeyPress(e)}var Hl=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+Hl>e&&St(t,this.pos)==0&&i==this.button};var Ir,jr;function Fl(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 xs(e){var t=this,i=t.display;if(ze(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,pi(i,e)){B||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Vo(t,e))return;var n=Bi(t,e),r=Ce(e),s=n?Fl(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):le(e)==i.scroller&&y(e):r==2?(n&&Qr(t.doc,n),setTimeout(function(){return i.input.focus()},20)):r==3&&(Ve?t.display.input.onContextMenu(e):wa(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,cs(s,r),r,function(l){if(typeof l=="string"&&(l=Pr[l]),!l)return!1;var f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),f=l(e,i)!=Me}finally{e.state.suppressEdits=!1}return f})}function Wl(e,t,i){var n=e.getOption("configureMouse"),r=n?n(e,t,i):{};if(r.unit==null){var s=Ie?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=ae?i.metaKey:i.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(ae?i.altKey:i.ctrlKey)),r}function Gl(e,t,i,n){T?setTimeout(p(xa,e),0):e.curOp.focus=j();var r=Wl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&Ge&&!e.isReadOnly()&&i=="single"&&(l=s.contains(t))>-1&&(St((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(St(l.to(),t)>0||t.xRel<0)?Vl(e,n,t,r):Xl(e,n,t,r)}function Vl(e,t,i,n){var r=e.display,s=!1,l=dn(e,function(v){B&&(r.scroller.draggable=!1),e.state.draggingText=!1,rt(r.wrapper.ownerDocument,"mouseup",l),rt(r.wrapper.ownerDocument,"mousemove",f),rt(r.scroller,"dragstart",g),rt(r.scroller,"drop",l),s||(y(v),n.addNew||Qr(e.doc,i,null,null,n.extend),B&&!te||T&&R==9?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),f=function(v){s=s||Math.abs(t.clientX-v.clientX)+Math.abs(t.clientY-v.clientY)>=10},g=function(){return s=!0};B&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),Le(r.wrapper.ownerDocument,"mouseup",l),Le(r.wrapper.ownerDocument,"mousemove",f),Le(r.scroller,"dragstart",g),Le(r.scroller,"drop",l),wa(e),setTimeout(function(){return r.input.focus()},20)}function ws(e,t,i){if(i=="char")return new Ft(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Ft(We(t.line,0),o(e.doc,We(t.line+1,0)));var n=i(e,t);return new Ft(n.from,n.to)}function Xl(e,t,i,n){var r=e.display,s=e.doc;y(t);var l,f,g=s.sel,v=g.ranges;if(n.addNew&&!n.extend?(f=s.sel.contains(i),f>-1?l=v[f]:l=new Ft(i,i)):(l=s.sel.primary(),f=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new Ft(i,i)),i=Bi(e,t,!0,!0),f=-1;else{var I=ws(e,i,n.unit);n.extend?l=Bo(l,I.anchor,I.head,n.extend):l=I}n.addNew?f==-1?(f=v.length,wn(s,qn(e,v.concat([l]),f),{scroll:!1,origin:"*mouse"})):v.length>1&&v[f].empty()&&n.unit=="char"&&!n.extend?(wn(s,qn(e,v.slice(0,f).concat(v.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),g=s.sel):Uo(s,f,l,ve):(f=0,wn(s,new Vn([l],0),ve),g=s.sel);var V=i;function he(Ze){if(St(V,Ze)==0)return;if(V=Ze,n.unit=="rectangle"){for(var ut=[],wt=e.options.tabSize,yt=C(ct(s,i.line).text,i.ch,wt),_t=C(ct(s,Ze.line).text,Ze.ch,wt),Yt=Math.min(yt,_t),pn=Math.max(yt,_t),Zt=Math.min(i.line,Ze.line),Un=Math.min(e.lastLine(),Math.max(i.line,Ze.line));Zt<=Un;Zt++){var On=ct(s,Zt).text,nn=ue(On,Yt,wt);Yt==pn?ut.push(new Ft(We(Zt,nn),We(Zt,nn))):On.length>nn&&ut.push(new Ft(We(Zt,nn),We(Zt,ue(On,pn,wt))))}ut.length||ut.push(new Ft(i,i)),wn(s,qn(e,g.ranges.slice(0,f).concat(ut),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Ze)}else{var Dn=l,xn=ws(e,Ze,n.unit),sn=Dn.anchor,rn;St(xn.anchor,sn)>0?(rn=xn.head,sn=Ri(Dn.from(),xn.anchor)):(rn=xn.anchor,sn=di(Dn.to(),xn.head));var Qt=g.ranges.slice(0);Qt[f]=Kl(e,new Ft(o(s,sn),rn)),wn(s,qn(e,Qt,f),ve)}}var oe=r.wrapper.getBoundingClientRect(),Re=0;function Fe(Ze){var ut=++Re,wt=Bi(e,Ze,!0,n.unit=="rectangle");if(!wt)return;if(St(wt,V)!=0){e.curOp.focus=j(),he(wt);var yt=Xr(r,s);(wt.line>=yt.to||wt.line<yt.from)&&setTimeout(dn(e,function(){Re==ut&&Fe(Ze)}),150)}else{var _t=Ze.clientY<oe.top?-20:Ze.clientY>oe.bottom?20:0;_t&&setTimeout(dn(e,function(){if(Re!=ut)return;r.scroller.scrollTop+=_t,Fe(Ze)}),50)}}function Ye(Ze){e.state.selectingText=!1,Re=Infinity,Ze&&(y(Ze),r.input.focus()),rt(r.wrapper.ownerDocument,"mousemove",Je),rt(r.wrapper.ownerDocument,"mouseup",nt),s.history.lastSelOrigin=null}var Je=dn(e,function(Ze){Ze.buttons===0||!Ce(Ze)?Ye(Ze):Fe(Ze)}),nt=dn(e,Ye);e.state.selectingText=nt,Le(r.wrapper.ownerDocument,"mousemove",Je),Le(r.wrapper.ownerDocument,"mouseup",nt)}function Kl(e,t){var i=t.anchor,n=t.head,r=ct(e.doc,i.line);if(St(i,n)==0&&i.sticky==n.sticky)return t;var s=lt(r);if(!s)return t;var l=et(s,i.ch,i.sticky),f=s[l];if(f.from!=i.ch&&f.to!=i.ch)return t;var g=l+(f.from==i.ch==(f.level!=1)?0:1);if(g==0||g==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 I=et(s,n.ch,n.sticky),V=I-l||(n.ch-i.ch)*(f.level==1?-1:1);I==g-1||I==g?v=V<0:v=V>0}var he=s[g+(v?-1:0)],oe=v==(he.level==1),Re=oe?he.from:he.to,Fe=oe?"after":"before";return i.ch==Re&&i.sticky==Fe?t:new Ft(new We(i.line,Re,Fe),n)}function Cs(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(he){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&y(t);var l=e.display,f=l.lineDiv.getBoundingClientRect();if(s>f.bottom||!Y(e,i))return A(t);s-=f.top-l.viewOffset;for(var g=0;g<e.display.gutterSpecs.length;++g){var v=l.gutters.childNodes[g];if(v&&v.getBoundingClientRect().right>=r){var I=Kn(e.doc,s),V=e.display.gutterSpecs[g];return Oe(e,i,e,I,V.className,t),A(t)}}}function Vo(e,t){return Cs(e,t,"gutterClick",!0)}function Ss(e,t){if(pi(e.display,t)||Yl(e,t))return;if(ze(e,t,"contextmenu"))return;Ve||e.display.input.onContextMenu(t)}function Yl(e,t){return Y(e,"gutterContextMenu")?Cs(e,t,"gutterContextMenu",!1):!1}function Es(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 ur={toString:function(){return"CodeMirror.Init"}},ks={},oo={};function $l(e){var t=e.optionHandlers;function i(n,r,s,l){e.defaults[n]=r,s&&(t[n]=l?function(f,g,v){v!=ur&&s(f,g,v)}:s)}e.defineOption=i,e.Init=ur,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){kr(n),vr(n),Mn(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(g){for(var v=0;;){var I=g.text.indexOf(r,v);if(I==-1)break;v=I+r.length,s.push(We(l,I))}l++});for(var f=s.length-1;f>=0;f--)or(n.doc,r,s[f],We(s[f].line,s[f].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!=ur&&n.refresh()}),i("specialCharPlaceholder",ft,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",ce?"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",!$e),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Es(n),Er(n)},!0),i("keyMap","default",function(n,r,s){var l=io(r),f=s!=ur&&io(s);f&&f.detach&&f.detach(n,l),l.attach&&l.attach(n,f||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(n,r){n.display.gutterSpecs=Do(r,n.options.lineNumbers),Er(n)},!0),i("fixedGutter",!0,function(n,r){n.display.gutters.style.left=r?So(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return tr(n)},!0),i("scrollbarStyle","native",function(n){Aa(n),tr(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=Do(n.options.gutters,r),Er(n)},!0),i("firstLineNumber",1,Er,!0),i("lineNumberFormatter",function(n){return n},Er,!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"&&(qi(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,kr,!0),i("addModeClass",!1,kr,!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,kr,!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!=ur;if(!t!=!n){var r=e.display.dragFunctions,s=t?Le:rt;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 Zl(e){e.options.lineWrapping?(P(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Te(e.display.wrapper,"CodeMirror-wrap"),fi(e)),Eo(e),Mn(e),vr(e),setTimeout(function(){return tr(e)},100)}function $t(e,t){var i=this;if(!(this instanceof $t))return new $t(e,t);this.options=t=t?d(t):{},d(ks,t,!1);var n=t.value;typeof n=="string"?n=new Rn(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var r=new $t.inputStyles[t.inputStyle](this),s=this.display=new hl(e,n,r,t);s.wrapper.CodeMirror=this,Es(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Aa(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 F,keySeq:null,specialChars:null},t.autofocus&&!ce&&s.input.focus(),T&&R<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Ll(),zi(this),this.curOp.forceUpdate=!0,ja(this,n),t.autofocus&&!ce||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&To(i)},20):qi(this);for(var l in oo)oo.hasOwnProperty(l)&&oo[l](this,t[l],ur);Ma(this),t.finishInit&&t.finishInit(this);for(var f=0;f<Xo.length;++f)Xo[f](this);Wi(this),B&&t.lineWrapping&&getComputedStyle(s.lineDiv).textRendering=="optimizelegibility"&&(s.lineDiv.style.textRendering="auto")}$t.defaults=ks,$t.optionHandlers=oo;function Ql(e){var t=e.display;Le(t.scroller,"mousedown",dn(e,xs)),T&&R<11?Le(t.scroller,"dblclick",dn(e,function(g){if(ze(e,g))return;var v=Bi(e,g);if(!v||Vo(e,g)||pi(e.display,g))return;y(g);var I=e.findWordAt(v);Qr(e.doc,I.anchor,I.head)})):Le(t.scroller,"dblclick",function(g){return ze(e,g)||y(g)}),Le(t.scroller,"contextmenu",function(g){return Ss(e,g)}),Le(t.input.getField(),"contextmenu",function(g){t.scroller.contains(g.target)||Ss(e,g)});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(g){if(g.touches.length!=1)return!1;var v=g.touches[0];return v.radiusX<=1&&v.radiusY<=1}function l(g,v){if(v.left==null)return!0;var I=v.left-g.left,V=v.top-g.top;return I*I+V*V>20*20}Le(t.scroller,"touchstart",function(g){if(!ze(e,g)&&!s(g)&&!Vo(e,g)){t.input.ensurePolled(),clearTimeout(i);var v=+new Date;t.activeTouch={start:v,moved:!1,prev:v-n.end<=300?n:null},g.touches.length==1&&(t.activeTouch.left=g.touches[0].pageX,t.activeTouch.top=g.touches[0].pageY)}}),Le(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Le(t.scroller,"touchend",function(g){var v=t.activeTouch;if(v&&!pi(t,g)&&v.left!=null&&!v.moved&&new Date-v.start<300){var I=e.coordsChar(t.activeTouch,"page"),V;!v.prev||l(v,v.prev)?V=new Ft(I,I):!v.prev.prev||l(v,v.prev.prev)?V=e.findWordAt(I):V=new Ft(We(I.line,0),o(e.doc,We(I.line+1,0))),e.setSelection(V.anchor,V.head),e.focus(),y(g)}r()}),Le(t.scroller,"touchcancel",r),Le(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xr(e,t.scroller.scrollTop),Hi(e,t.scroller.scrollLeft,!0),Oe(e,"scroll",e))}),Le(t.scroller,"mousewheel",function(g){return Da(e,g)}),Le(t.scroller,"DOMMouseScroll",function(g){return Da(e,g)}),Le(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(g){ze(e,g)||N(g)},over:function(g){ze(e,g)||(_l(e,g),N(g))},start:function(g){return Al(e,g)},drop:dn(e,Tl),leave:function(g){ze(e,g)||ss(e)}};var f=t.input.getField();Le(f,"keyup",function(g){return ys.call(e,g)}),Le(f,"keydown",dn(e,vs)),Le(f,"keypress",dn(e,bs)),Le(f,"focus",function(g){return To(e,g)}),Le(f,"blur",function(g){return qi(e,g)})}var Xo=[];$t.defineInitHook=function(e){return Xo.push(e)};function Br(e,t,i,n){var r=e.doc,s;i==null&&(i="add"),i=="smart"&&(r.mode.indent?s=pe(e,t).state:i="prev");var l=e.options.tabSize,f=ct(r,t),g=C(f.text,null,l);f.stateAfter&&(f.stateAfter=null);var v=f.text.match(/^\s*/)[0],I;if(!n&&!/\S/.test(f.text))I=0,i="not";else if(i=="smart"&&(I=r.mode.indent(s,f.text.slice(v.length),f.text),I==Me||I>150)){if(!n)return;i="prev"}i=="prev"?t>r.first?I=C(ct(r,t-1).text,null,l):I=0:i=="add"?I=g+e.options.indentUnit:i=="subtract"?I=g-e.options.indentUnit:typeof i=="number"&&(I=g+i),I=Math.max(0,I);var V="",he=0;if(e.options.indentWithTabs)for(var oe=Math.floor(I/l);oe;--oe)he+=l,V+=" ";if(he<I&&(V+=G(I-he)),V!=v)return or(r,V,We(t,0),We(t,v.length),"+input"),f.stateAfter=null,!0;for(var Re=0;Re<r.sel.ranges.length;Re++){var Fe=r.sel.ranges[Re];if(Fe.head.line==t&&Fe.head.ch<v.length){var Ye=We(t,v.length);Uo(r,Re,new Ft(Ye,Ye));break}}}var ei=null;function ao(e){ei=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,f=r=="paste"||e.state.pasteIncoming>l,g=dt(t),v=null;if(f&&n.ranges.length>1)if(ei&&ei.text.join(`
`)==t){if(n.ranges.length%ei.text.length==0){v=[];for(var I=0;I<ei.text.length;I++)v.push(s.splitLines(ei.text[I]))}}else g.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(v=X(g,function(Je){return[Je]}));for(var V=e.curOp.updateInput,he=n.ranges.length-1;he>=0;he--){var oe=n.ranges[he],Re=oe.from(),Fe=oe.to();oe.empty()&&(i&&i>0?Re=We(Re.line,Re.ch-i):e.state.overwrite&&!f?Fe=We(Fe.line,Math.min(ct(s,Fe.line).text.length,Fe.ch+b(g).length)):f&&ei&&ei.lineWise&&ei.text.join(`
`)==g.join(`
`)&&(Re=Fe=We(Re.line,0)));var Ye={from:Re,to:Fe,text:v?v[he%v.length]:g,origin:r||(f?"paste":e.state.cutIncoming>l?"cut":"+input")};rr(e.doc,Ye),Xt(e,"inputRead",e,Ye)}t&&!f&&As(e,t),er(e),e.curOp.updateInput<2&&(e.curOp.updateInput=V),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ts(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Bn(t,function(){return Ko(t,i,0,null,"paste")}),!0}function As(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 f=0;f<s.electricChars.length;f++)if(t.indexOf(s.electricChars.charAt(f))>-1){l=Br(e,r.head.line,"smart");break}}else s.electricInput&&(s.electricInput.test(ct(e.doc,r.head.line).text.slice(0,r.head.ch))&&(l=Br(e,r.head.line,"smart")));l&&Xt(e,"electricInput",e,r.head.line)}}function _s(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:We(r,0),head:We(r+1,0)};i.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:i}}function Ls(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ms(){var e=M("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=M("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return B?e.style.width="1000px":e.setAttribute("wrap","off"),Z&&(e.style.border="1px solid black"),Ls(e),t}function ql(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,r){var s=this.options,l=s[n];if(s[n]==r&&n!="mode")return;s[n]=r,t.hasOwnProperty(n)&&dn(this,t[n])(this,r,l),Oe(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:En(function(n,r){var s=n.token?n:e.getMode(this.options,n);if(s.startState)throw new Error("Overlays may not be stateful.");O(this.state.overlays,{mode:s,modeSpec:n,opaque:r&&r.opaque,priority:r&&r.priority||0},function(l){return l.priority}),this.state.modeGen++,Mn(this)}),removeOverlay:En(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++,Mn(this);return}}}),indentLine:En(function(n,r,s){typeof r!="string"&&typeof r!="number"&&(r==null?r=this.options.smartIndent?"smart":"prev":r=r?"add":"subtract"),hi(this.doc,n)&&Br(this,n,r,s)}),indentSelection:En(function(n){for(var r=this.doc.sel.ranges,s=-1,l=0;l<r.length;l++){var f=r[l];if(f.empty())f.head.line>s&&(Br(this,f.head.line,n,!0),s=f.head.line,l==this.doc.sel.primIndex&&er(this));else{var g=f.from(),v=f.to(),I=Math.max(s,g.line);s=Math.min(this.lastLine(),v.line-(v.ch?0:1))+1;for(var V=I;V<s;++V)Br(this,V,n);var he=this.doc.sel.ranges;g.ch==0&&r.length==he.length&&he[l].from().ch>0&&Uo(this.doc,l,new Ft(g,he[l].to()),ge)}}}),getTokenAt:function(n,r){return zt(this,n,r)},getLineTokens:function(n,r){return zt(this,We(n),r,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var r=Ne(this,ct(this.doc,n.line)),s=0,l=(r.length-1)/2,f=n.ch,g;if(f==0)g=r[2];else for(;;){var v=s+l>>1;if((v?r[v*2-1]:0)>=f)l=v;else if(r[v*2+1]<f)s=v+1;else{g=r[v*2+2];break}}var I=g?g.indexOf("overlay "):-1;return I<0?g:I==0?null:g.slice(0,I-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],f=this.getModeAt(n);if(typeof f[r]=="string")l[f[r]]&&s.push(l[f[r]]);else if(f[r])for(var g=0;g<f[r].length;g++){var v=l[f[r][g]];v&&s.push(v)}else f.helperType&&l[f.helperType]?s.push(l[f.helperType]):l[f.name]&&s.push(l[f.name]);for(var I=0;I<l._global.length;I++){var V=l._global[I];V.pred(f,this)&&J(s,V.val)==-1&&s.push(V.val)}return s},getStateAfter:function(n,r){var s=this.doc;return n=c(s,n==null?s.first+s.size-1:n),pe(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(),Qn(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"),xo(this,n.left,n.top)},lineAtHeight:function(n,r){return n=da(this,{top:n,left:0},r||"page").top,Kn(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,r,s){var l=!1,f;if(typeof n=="number"){var g=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>g&&(n=g,l=!0),f=ct(this.doc,n)}else f=n;return zr(this,f,{top:0,left:0},r||"page",s||l).top+(l?this.doc.height-jn(f):0)},defaultTextHeight:function(){return Zi(this.display)},defaultCharWidth:function(){return Qi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,r,s,l,f){var g=this.display;n=Qn(this,o(this.doc,n));var v=n.bottom,I=n.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),g.sizer.appendChild(r),l=="over")v=n.top;else if(l=="above"||l=="near"){var V=Math.max(g.wrapper.clientHeight,this.doc.height),he=Math.max(g.sizer.clientWidth,g.lineSpace.clientWidth);(l=="above"||n.bottom+r.offsetHeight>V)&&n.top>r.offsetHeight?v=n.top-r.offsetHeight:n.bottom+r.offsetHeight<=V&&(v=n.bottom),I+r.offsetWidth>he&&(I=he-r.offsetWidth)}r.style.top=v+"px",r.style.left=r.style.right="",f=="right"?(I=g.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(f=="left"?I=0:f=="middle"&&(I=(g.sizer.clientWidth-r.offsetWidth)/2),r.style.left=I+"px"),s&&Js(this,{left:I,top:v,right:I+r.offsetWidth,bottom:v+r.offsetHeight})},triggerOnKeyDown:En(vs),triggerOnKeyPress:En(bs),triggerOnKeyUp:ys,triggerOnMouseDown:En(xs),execCommand:function(n){if(Pr.hasOwnProperty(n))return Pr[n].call(null,this)},triggerElectric:En(function(n){As(this,n)}),findPosH:function(n,r,s,l){var f=1;r<0&&(f=-1,r=-r);for(var g=o(this.doc,n),v=0;v<r&&!(g=Yo(this.doc,g,f,s,l),g.hitSide);++v);return g},moveH:En(function(n,r){var s=this;this.extendSelectionsBy(function(l){return s.display.shift||s.doc.extend||l.empty()?Yo(s.doc,l.head,n,r,s.options.rtlMoveVisually):n<0?l.from():l.to()},me)}),deleteH:En(function(n,r){var s=this.doc.sel,l=this.doc;s.somethingSelected()?l.replaceSelection("",null,"+delete"):lr(this,function(f){var g=Yo(l,f.head,n,r,!1);return n<0?{from:g,to:f.head}:{from:f.head,to:g}})}),findPosV:function(n,r,s,l){var f=1,g=l;r<0&&(f=-1,r=-r);for(var v=o(this.doc,n),I=0;I<r;++I){var V=Qn(this,v,"div");if(g==null?g=V.left:V.left=g,v=Rs(this,V,f,s),v.hitSide)break}return v},moveV:En(function(n,r){var s=this,l=this.doc,f=[],g=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(I){if(g)return n<0?I.from():I.to();var V=Qn(s,I.head,"div");I.goalColumn!=null&&(V.left=I.goalColumn),f.push(V.left);var he=Rs(s,V,n,r);return r=="page"&&I==l.sel.primary()&&_o(s,yo(s,he,"div").top-V.top),he},me),f.length)for(var v=0;v<l.sel.ranges.length;v++)l.sel.ranges[v].goalColumn=f[v]}),findWordAt:function(n){var r=this.doc,s=ct(r,n.line).text,l=n.ch,f=n.ch;if(s){var g=this.getHelper(n,"wordChars");(n.sticky=="before"||f==s.length)&&l?--l:++f;for(var v=s.charAt(l),I=Ue(v,g)?function(V){return Ue(V,g)}:/\s/.test(v)?function(V){return/\s/.test(V)}:function(V){return!/\s/.test(V)&&!Ue(V)};l>0&&I(s.charAt(l-1));)--l;for(;f<s.length&&I(s.charAt(f));)++f}return new Ft(We(n.line,l),We(n.line,f))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?P(this.display.cursorDiv,"CodeMirror-overwrite"):Te(this.display.cursorDiv,"CodeMirror-overwrite"),Oe(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==j()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:En(function(n,r){br(this,n,r)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-oi(this)-this.display.barHeight,width:n.scrollWidth-oi(this)-this.display.barWidth,clientHeight:go(this),clientWidth:Ii(this)}},scrollIntoView:En(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:We(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?Zs(this,n):Sa(this,n.from,n.to,n.margin)}),setSize:En(function(n,r){var s=this,l=function(g){return typeof g=="number"||/^\d+$/.test(String(g))?g+"px":g};n!=null&&(this.display.wrapper.style.width=l(n)),r!=null&&(this.display.wrapper.style.height=l(r)),this.options.lineWrapping&&ua(this);var f=this.display.viewFrom;this.doc.iter(f,this.display.viewTo,function(g){if(g.widgets){for(var v=0;v<g.widgets.length;v++)if(g.widgets[v].noHScroll){Si(s,f,"widget");break}}++f}),this.curOp.forceUpdate=!0,Oe(this,"refresh",this)}),operation:function(n){return Bn(this,n)},startOperation:function(){return zi(this)},endOperation:function(){return Wi(this)},refresh:En(function(){var n=this.display.cachedTextHeight;Mn(this),this.curOp.forceUpdate=!0,vr(this),br(this,this.doc.scrollLeft,this.doc.scrollTop),Ro(this.display),(n==null||Math.abs(n-Zi(this.display))>.5||this.options.lineWrapping)&&Eo(this),Oe(this,"refresh",this)}),swapDoc:En(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,Xt(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}},$(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 Yo(e,t,i,n,r){var s=t,l=i,f=ct(e,t.line),g=r&&e.direction=="rtl"?-i:i;function v(){var nt=t.line+g;return nt<e.first||nt>=e.first+e.size?!1:(t=new We(nt,t.ch,t.sticky),f=ct(e,nt))}function I(nt){var Ze;if(n=="codepoint"){var ut=f.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(ut)?Ze=null:Ze=new We(t.line,Math.max(0,Math.min(f.text.length,t.ch+i*(ut>=55296&&ut<56320?2:1))),-i)}else r?Ze=Pl(e.cm,f,t,i):Ze=Fo(f,t,i);if(Ze==null)if(!nt&&v())t=zo(r,e.cm,f,t.line,g);else return!1;else t=Ze;return!0}if(n=="char"||n=="codepoint")I();else if(n=="column")I(!0);else if(n=="word"||n=="group")for(var V=null,he=n=="group",oe=e.cm&&e.cm.getHelper(t,"wordChars"),Re=!0;!(i<0&&!I(!Re));Re=!1){var Fe=f.text.charAt(t.ch)||`
`,Ye=Ue(Fe,oe)?"w":he&&Fe==`
`?"n":!he||/\s/.test(Fe)?null:"p";if(he&&!Re&&!Ye&&(Ye="s"),V&&V!=Ye){i<0&&(i=1,I(),t.sticky="after");break}if(Ye&&(V=Ye),i>0&&!I(!Re))break}var Je=eo(e,t,s,l,!0);return ti(s,Je)&&(Je.hitSide=!0),Je}function Rs(e,t,i,n){var r=e.doc,s=t.left,l;if(n=="page"){var f=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),g=Math.max(f-.5*Zi(e.display),3);l=(i>0?t.bottom:t.top)+i*g}else n=="line"&&(l=i>0?t.bottom+3:t.top-3);for(var v;!(v=xo(e,s,l),!v.outside);){if(i<0?l<=0:l>=r.height){v.hitSide=!0;break}l+=i*5}return v}var Vt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new F,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Vt.prototype.init=function(e){var t=this,i=this,n=i.cm,r=i.div=e.lineDiv;Ls(r,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function s(f){for(var g=f.target;g;g=g.parentNode){if(g==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(g.className))break}return!1}Le(r,"paste",function(f){if(!s(f)||ze(n,f)||Ts(f,n))return;R<=11&&setTimeout(dn(n,function(){return t.updateFromDOM()}),20)}),Le(r,"compositionstart",function(f){t.composing={data:f.data,done:!1}}),Le(r,"compositionupdate",function(f){t.composing||(t.composing={data:f.data,done:!1})}),Le(r,"compositionend",function(f){t.composing&&(f.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Le(r,"touchstart",function(){return i.forceCompositionEnd()}),Le(r,"input",function(){t.composing||t.readFromDOMSoon()});function l(f){if(!s(f)||ze(n,f))return;if(n.somethingSelected())ao({lineWise:!1,text:n.getSelections()}),f.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var g=_s(n);ao({lineWise:!0,text:g.text}),f.type=="cut"&&n.operation(function(){n.setSelections(g.ranges,0,ge),n.replaceSelection("",null,"cut")})}else return;if(f.clipboardData){f.clipboardData.clearData();var v=ei.text.join(`
`);if(f.clipboardData.setData("Text",v),f.clipboardData.getData("Text")==v){f.preventDefault();return}}var I=Ms(),V=I.firstChild;n.display.lineSpace.insertBefore(I,n.display.lineSpace.firstChild),V.value=ei.text.join(`
`);var he=document.activeElement;D(V),setTimeout(function(){n.display.lineSpace.removeChild(I),he.focus(),he==r&&i.showPrimarySelection()},50)}Le(r,"copy",l),Le(r,"cut",l)},Vt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Vt.prototype.prepareSelection=function(){var e=ya(this.cm,!1);return e.focus=document.activeElement==this.div,e},Vt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Vt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Vt.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&&St(Ri(s,l),n)==0&&St(di(s,l),r)==0)return;var f=t.display.view,g=n.line>=t.display.viewFrom&&Os(t,n)||{node:f[0].measure.map[2],offset:0},v=r.line<t.display.viewTo&&Os(t,r);if(!v){var I=f[f.length-1].measure,V=I.maps?I.maps[I.maps.length-1]:I.map;v={node:V[V.length-1],offset:V[V.length-2]-V[V.length-3]}}if(!g||!v){e.removeAllRanges();return}var he=e.rangeCount&&e.getRangeAt(0),oe;try{oe=ie(g.node,g.offset,v.offset,v.node)}catch(Re){}oe&&(!ne&&t.state.focused?(e.collapse(g.node,g.offset),oe.collapsed||(e.removeAllRanges(),e.addRange(oe))):(e.removeAllRanges(),e.addRange(oe)),he&&e.anchorNode==null?e.addRange(he):ne&&this.startGracePeriod()),this.rememberSelection()},Vt.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)},Vt.prototype.showMultipleSelections=function(e){ye(this.cm.display.cursorDiv,e.cursors),ye(this.cm.display.selectionDiv,e.selection)},Vt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Vt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return w(this.div,t)},Vt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Vt.prototype.blur=function(){this.div.blur()},Vt.prototype.getField=function(){return this.div},Vt.prototype.supportsTouch=function(){return!0},Vt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Bn(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)},Vt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Vt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(W&&L&&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&&Bn(t,function(){wn(t.doc,ki(i,n),ge),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},Vt.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=We(n.line-1,ct(e.doc,n.line-1).length)),r.ch==ct(e.doc,r.line).text.length&&r.line<e.lastLine()&&(r=We(r.line+1,0)),n.line<t.viewFrom||r.line>t.viewTo-1)return!1;var s,l,f;n.line==t.viewFrom||(s=Ui(e,n.line))==0?(l=Pt(t.view[0].line),f=t.view[0].node):(l=Pt(t.view[s].line),f=t.view[s-1].node.nextSibling);var g=Ui(e,r.line),v,I;if(g==t.view.length-1?(v=t.viewTo-1,I=t.lineDiv.lastChild):(v=Pt(t.view[g+1].line)-1,I=t.view[g+1].node.previousSibling),!f)return!1;for(var V=e.doc.splitLines(tu(e,f,I,l,v)),he=Hn(e.doc,We(l,0),We(v,ct(e.doc,v).text.length));V.length>1&&he.length>1;)if(b(V)==b(he))V.pop(),he.pop(),v--;else if(V[0]==he[0])V.shift(),he.shift(),l++;else break;for(var oe=0,Re=0,Fe=V[0],Ye=he[0],Je=Math.min(Fe.length,Ye.length);oe<Je&&Fe.charCodeAt(oe)==Ye.charCodeAt(oe);)++oe;for(var nt=b(V),Ze=b(he),ut=Math.min(nt.length-(V.length==1?oe:0),Ze.length-(he.length==1?oe:0));Re<ut&&nt.charCodeAt(nt.length-Re-1)==Ze.charCodeAt(Ze.length-Re-1);)++Re;if(V.length==1&&he.length==1&&l==n.line)for(;oe&&oe>n.ch&&nt.charCodeAt(nt.length-Re-1)==Ze.charCodeAt(Ze.length-Re-1);)oe--,Re++;V[V.length-1]=nt.slice(0,nt.length-Re).replace(/^\u200b+/,""),V[0]=V[0].slice(oe).replace(/\u200b+$/,"");var wt=We(l,oe),yt=We(v,he.length?b(he).length-Re:0);if(V.length>1||V[0]||St(wt,yt))return or(e.doc,V,wt,yt,"+input"),!0},Vt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Vt.prototype.reset=function(){this.forceCompositionEnd()},Vt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Vt.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)},Vt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Bn(this.cm,function(){return Mn(e.cm)})},Vt.prototype.setUneditable=function(e){e.contentEditable="false"},Vt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||dn(this.cm,Ko)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Vt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Vt.prototype.onContextMenu=function(){},Vt.prototype.resetPosition=function(){},Vt.prototype.needsContentAttribute=!0;function Os(e,t){var i=mo(e,t.line);if(!i||i.hidden)return null;var n=ct(e.doc,t.line),r=ra(i,n,t.line),s=lt(n,e.doc.direction),l="left";if(s){var f=et(s,t.ch);l=f%2?"right":"left"}var g=sa(r.map,t.ch,l);return g.offset=g.collapse=="right"?g.end:g.start,g}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,f=e.doc.lineSeparator(),g=!1;function v(oe){return function(Re){return Re.id==oe}}function I(){l&&(s+=f,g&&(s+=f),l=g=!1)}function V(oe){oe&&(I(),s+=oe)}function he(oe){if(oe.nodeType==1){var Re=oe.getAttribute("cm-text");if(Re){V(Re);return}var Fe=oe.getAttribute("cm-marker"),Ye;if(Fe){var Je=e.findMarks(We(n,0),We(r+1,0),v(+Fe));Je.length&&(Ye=Je[0].find(0))&&V(Hn(e.doc,Ye.from,Ye.to).join(f));return}if(oe.getAttribute("contenteditable")=="false")return;var nt=/^(pre|div|p|li|table|br)$/i.test(oe.nodeName);if(!/^br$/i.test(oe.nodeName)&&oe.textContent.length==0)return;nt&&I();for(var Ze=0;Ze<oe.childNodes.length;Ze++)he(oe.childNodes[Ze]);/^(pre|p)$/i.test(oe.nodeName)&&(g=!0),nt&&(l=!0)}else oe.nodeType==3&&V(oe.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(he(t),t==i);)t=t.nextSibling,g=!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(We(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||!w(n,t))return hr(We(Pt(e.line),0),!0);if(t==n&&(r=!0,t=n.childNodes[i],i=0,!t)){var s=e.rest?b(e.rest):e.line;return hr(We(Pt(s),s.text.length),r)}var l=t.nodeType==3?t:null,f=t;for(!l&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(l=t.firstChild,i&&(i=l.nodeValue.length));f.parentNode!=n;)f=f.parentNode;var g=e.measure,v=g.maps;function I(Ye,Je,nt){for(var Ze=-1;Ze<(v?v.length:0);Ze++)for(var ut=Ze<0?g.map:v[Ze],wt=0;wt<ut.length;wt+=3){var yt=ut[wt+2];if(yt==Ye||yt==Je){var _t=Pt(Ze<0?e.line:e.rest[Ze]),Yt=ut[wt]+nt;return(nt<0||yt!=Ye)&&(Yt=ut[wt+(nt?1:0)]),We(_t,Yt)}}}var V=I(l,f,i);if(V)return hr(V,r);for(var he=f.nextSibling,oe=l?l.nodeValue.length-i:0;he;he=he.nextSibling){if(V=I(he,he.firstChild,0),V)return hr(We(V.line,V.ch-oe),r);oe+=he.textContent.length}for(var Re=f.previousSibling,Fe=i;Re;Re=Re.previousSibling){if(V=I(Re,Re.firstChild,-1),V)return hr(We(V.line,V.ch+Fe),r);Fe+=Re.textContent.length}}var tn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new F,this.hasSelection=!1,this.composing=null};tn.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),Z&&(r.style.width="0px"),Le(r,"input",function(){T&&R>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Le(r,"paste",function(l){if(ze(n,l)||Ts(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if(ze(n,l))return;if(n.somethingSelected())ao({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var f=_s(n);ao({lineWise:!0,text:f.text}),l.type=="cut"?n.setSelections(f.ranges,null,ge):(i.prevInput="",r.value=f.text.join(`
`),D(r))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}Le(r,"cut",s),Le(r,"copy",s),Le(e.scroller,"paste",function(l){if(pi(e,l)||ze(n,l))return;if(!r.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var f=new Event("paste");f.clipboardData=l.clipboardData,r.dispatchEvent(f)}),Le(e.lineSpace,"selectstart",function(l){pi(e,l)||y(l)}),Le(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"})}}),Le(r,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},tn.prototype.createField=function(e){this.wrapper=Ms(),this.textarea=this.wrapper.firstChild},tn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},tn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=ya(e);if(e.options.moveInputWithCursor){var r=Qn(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},tn.prototype.showSelection=function(e){var t=this.cm,i=t.display;ye(i.cursorDiv,e.cursors),ye(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},tn.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&&D(this.textarea),T&&R>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",T&&R>=9&&(this.hasSelection=null))},tn.prototype.getField=function(){return this.textarea},tn.prototype.supportsTouch=function(){return!1},tn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!ce||j()!=this.textarea))try{this.textarea.focus()}catch(e){}},tn.prototype.blur=function(){this.textarea.blur()},tn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},tn.prototype.receivedFocus=function(){this.slowPoll()},tn.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()})},tn.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)},tn.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||qe(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var r=i.value;if(r==n&&!t.somethingSelected())return!1;if(T&&R>=9&&this.hasSelection===r||ae&&/[\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,f=Math.min(n.length,r.length);l<f&&n.charCodeAt(l)==r.charCodeAt(l);)++l;return Bn(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},tn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},tn.prototype.onKeyPress=function(){T&&R>=9&&(this.hasSelection=null),this.fastPoll()},tn.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=Bi(i,e),l=n.scroller.scrollTop;if(!s||E)return;var f=i.options.resetSelectionOnContextMenu;f&&i.doc.sel.contains(s)==-1&&dn(i,wn)(i.doc,ki(s),ge);var g=r.style.cssText,v=t.wrapper.style.cssText,I=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-I.top-5)+"px; left: "+(e.clientX-I.left-5)+`px;
z-index: 1000; background: `+(T?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var V;B&&(V=window.scrollY),n.input.focus(),B&&window.scrollTo(null,V),n.input.reset(),i.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=oe,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function he(){if(r.selectionStart!=null){var Fe=i.somethingSelected(),Ye="\u200B"+(Fe?r.value:"");r.value="\u21DA",r.value=Ye,t.prevInput=Fe?"":"\u200B",r.selectionStart=1,r.selectionEnd=Ye.length,n.selForContextMenu=i.doc.sel}}function oe(){if(t.contextMenuPending!=oe)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=v,r.style.cssText=g,T&&R<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),r.selectionStart!=null){(!T||T&&R<9)&&he();var Fe=0,Ye=function(){n.selForContextMenu==i.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?dn(i,Ja)(i):Fe++<10?n.detectingSelectAll=setTimeout(Ye,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(Ye,200)}}if(T&&R>=9&&he(),Ve){N(e);var Re=function(){rt(window,"mouseup",Re),setTimeout(oe,20)};Le(window,"mouseup",Re)}else setTimeout(oe,50)},tn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},tn.prototype.setUneditable=function(){},tn.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?d(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=j();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=f.getValue()}var r;if(e.form&&(Le(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(g){}}t.finishInit=function(g){g.save=n,g.getTextArea=function(){return e},g.toTextArea=function(){g.toTextArea=isNaN,n(),e.parentNode.removeChild(g.getWrapperElement()),e.style.display="",e.form&&(rt(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var f=$t(function(g){return e.parentNode.insertBefore(g,e.nextSibling)},t);return f}function ru(e){e.off=rt,e.on=Le,e.wheelEventPixels=cl,e.Doc=Rn,e.splitLines=dt,e.countColumn=C,e.findColumn=ue,e.isWordChar=_e,e.Pass=Me,e.signal=Oe,e.Line=Ci,e.changeEnd=Ti,e.scrollbarModel=Ta,e.Pos=We,e.cmpPos=St,e.modes=Mt,e.mimeModes=Tt,e.resolveMode=pt,e.getMode=Sn,e.modeExtensions=un,e.extendMode=mn,e.copyState=Tn,e.startState=Xn,e.innerMode=li,e.commands=Pr,e.keyMap=gi,e.keyName=ds,e.isModifierKey=hs,e.lookupKey=sr,e.normalizeKeyMap=Dl,e.StringStream=jt,e.SharedTextMarker=Rr,e.TextMarker=_i,e.LineWidget=Mr,e.e_preventDefault=y,e.e_stopPropagation=x,e.e_stop=N,e.addClass=P,e.contains=w,e.rmClass=Te,e.keyNames=Li}$l($t),ql($t);var ou="iter insert remove copy getEditor constructor".split(" ");for(var lo in Rn.prototype)Rn.prototype.hasOwnProperty(lo)&&J(ou,lo)<0&&($t.prototype[lo]=function(e){return function(){return e.apply(this.doc,arguments)}}(Rn.prototype[lo]));return $(Rn),$t.inputStyles={textarea:tn,contenteditable:Vt},$t.defineMode=function(e){!$t.defaults.mode&&e!="null"&&($t.defaults.mode=e),qt.apply(this,arguments)},$t.defineMIME=ln,$t.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),$t.defineMIME("text/plain","null"),$t.defineExtension=function(e,t){$t.prototype[e]=t},$t.defineDocExtension=function(e,t){Rn.prototype[e]=t},$t.fromTextArea=iu,ru($t),$t.version="5.58.2",$t})},Y1PL:function(ot,Qe,k){"use strict";k.r(Qe),k.d(Qe,"ResizableTextArea",function(){return J});var H=k("wx14"),se=k("1OyB"),ne=k("vuIU"),we=k("Ji7U"),fe=k("LK+K"),z=k("q1tI"),T=k("VTBJ"),R=k("rePB"),B=k("Zm9Q"),_=k("Kwbf"),L=k("c+Xe"),E=k("m+aA"),te=k("bdgK"),Q=new Map;function U(ge){ge.forEach(function(ve){var me,ue=ve.target;(me=Q.get(ue))===null||me===void 0||me.forEach(function(q){return q(ue)})})}var Z=new te.default(U),W=null,ce=null;function ae(ge,ve){Q.has(ge)||(Q.set(ge,new Set),Z.observe(ge)),Q.get(ge).add(ve)}function Ie(ge,ve){Q.has(ge)&&(Q.get(ge).delete(ve),Q.get(ge).size||(Z.unobserve(ge),Q.delete(ge)))}var $e=function(ge){Object(we.a)(me,ge);var ve=Object(fe.a)(me);function me(){return Object(se.a)(this,me),ve.apply(this,arguments)}return Object(ne.a)(me,[{key:"render",value:function(){return this.props.children}}]),me}(z.Component),Se=z.createContext(null);function De(ge){var ve=ge.children,me=ge.onBatchResize,ue=z.useRef(0),q=z.useRef([]),G=z.useContext(Se),b=z.useCallback(function(X,O,be){ue.current+=1;var Ee=ue.current;q.current.push({size:X,element:O,data:be}),Promise.resolve().then(function(){Ee===ue.current&&(me==null||me(q.current),q.current=[])}),G==null||G(X,O,be)},[me,G]);return z.createElement(Se.Provider,{value:b},ve)}function Ve(ge){var ve=ge.children,me=ge.disabled,ue=z.useRef(null),q=z.useRef(null),G=z.useContext(Se),b=z.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),X=z.isValidElement(ve)&&Object(L.c)(ve),O=X?ve.ref:null,be=z.useMemo(function(){return Object(L.a)(O,ue)},[O,ue]),Ee=z.useRef(ge);Ee.current=ge;var re=z.useCallback(function(_e){var Ue=Ee.current,Ke=Ue.onResize,He=Ue.data,je=_e.getBoundingClientRect(),Xe=je.width,mt=je.height,tt=_e.offsetWidth,it=_e.offsetHeight,et=Math.floor(Xe),gt=Math.floor(mt);if(b.current.width!==et||b.current.height!==gt||b.current.offsetWidth!==tt||b.current.offsetHeight!==it){var lt={width:et,height:gt,offsetWidth:tt,offsetHeight:it};b.current=lt;var at=tt===Math.round(Xe)?Xe:tt,Le=it===Math.round(mt)?mt:it,vt=Object(T.a)(Object(T.a)({},lt),{},{offsetWidth:at,offsetHeight:Le});G==null||G(vt,_e,He),Ke&&Promise.resolve().then(function(){Ke(vt,_e)})}},[]);return z.useEffect(function(){var _e=Object(E.a)(ue.current)||Object(E.a)(q.current);return _e&&!me&&ae(_e,re),function(){return Ie(_e,re)}},[ue.current,me]),z.createElement($e,{ref:q},X?z.cloneElement(ve,{ref:be}):ve)}var ke="rc-observer-key";function Te(ge){var ve=ge.children,me=Object(B.a)(ve);return me.map(function(ue,q){var G=(ue==null?void 0:ue.key)||"".concat(ke,"-").concat(q);return z.createElement(Ve,Object(H.a)({},ge,{key:G}),ue)})}Te.Collection=De;var Pe=Te,ye=k("bT9E"),M=k("TSYQ"),de=k.n(M),ie=`
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
`,w=["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"],j={},P;function S(ge){var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,me=ge.getAttribute("id")||ge.getAttribute("data-reactid")||ge.getAttribute("name");if(ve&&j[me])return j[me];var ue=window.getComputedStyle(ge),q=ue.getPropertyValue("box-sizing")||ue.getPropertyValue("-moz-box-sizing")||ue.getPropertyValue("-webkit-box-sizing"),G=parseFloat(ue.getPropertyValue("padding-bottom"))+parseFloat(ue.getPropertyValue("padding-top")),b=parseFloat(ue.getPropertyValue("border-bottom-width"))+parseFloat(ue.getPropertyValue("border-top-width")),X=w.map(function(be){return"".concat(be,":").concat(ue.getPropertyValue(be))}).join(";"),O={sizingStyle:X,paddingSize:G,borderSize:b,boxSizing:q};return ve&&me&&(j[me]=O),O}function D(ge){var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ue=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;P||(P=document.createElement("textarea"),P.setAttribute("tab-index","-1"),P.setAttribute("aria-hidden","true"),document.body.appendChild(P)),ge.getAttribute("wrap")?P.setAttribute("wrap",ge.getAttribute("wrap")):P.removeAttribute("wrap");var q=S(ge,ve),G=q.paddingSize,b=q.borderSize,X=q.boxSizing,O=q.sizingStyle;P.setAttribute("style","".concat(O,";").concat(ie)),P.value=ge.value||ge.placeholder||"";var be=Number.MIN_SAFE_INTEGER,Ee=Number.MAX_SAFE_INTEGER,re=P.scrollHeight,_e;if(X==="border-box"?re+=b:X==="content-box"&&(re-=G),me!==null||ue!==null){P.value=" ";var Ue=P.scrollHeight-G;me!==null&&(be=Ue*me,X==="border-box"&&(be=be+G+b),re=Math.max(be,re)),ue!==null&&(Ee=Ue*ue,X==="border-box"&&(Ee=Ee+G+b),_e=re>Ee?"":"hidden",re=Math.min(Ee,re))}return{height:re,minHeight:be,maxHeight:Ee,overflowY:_e,resize:"none"}}var p=k("Gytx"),d=k.n(p),C;(function(ge){ge[ge.NONE=0]="NONE",ge[ge.RESIZING=1]="RESIZING",ge[ge.RESIZED=2]="RESIZED"})(C||(C={}));var F=function(ge){Object(we.a)(me,ge);var ve=Object(fe.a)(me);function me(ue){var q;return Object(se.a)(this,me),q=ve.call(this,ue),q.nextFrameActionId=void 0,q.resizeFrameId=void 0,q.textArea=void 0,q.saveTextArea=function(G){q.textArea=G},q.handleResize=function(G){var b=q.state.resizeStatus,X=q.props,O=X.autoSize,be=X.onResize;if(b!==C.NONE)return;typeof be=="function"&&be(G),O&&q.resizeOnNextFrame()},q.resizeOnNextFrame=function(){cancelAnimationFrame(q.nextFrameActionId),q.nextFrameActionId=requestAnimationFrame(q.resizeTextarea)},q.resizeTextarea=function(){var G=q.props.autoSize;if(!G||!q.textArea)return;var b=G.minRows,X=G.maxRows,O=D(q.textArea,!1,b,X);q.setState({textareaStyles:O,resizeStatus:C.RESIZING},function(){cancelAnimationFrame(q.resizeFrameId),q.resizeFrameId=requestAnimationFrame(function(){q.setState({resizeStatus:C.RESIZED},function(){q.resizeFrameId=requestAnimationFrame(function(){q.setState({resizeStatus:C.NONE}),q.fixFirefoxAutoScroll()})})})})},q.renderTextArea=function(){var G=q.props,b=G.prefixCls,X=b===void 0?"rc-textarea":b,O=G.autoSize,be=G.onResize,Ee=G.className,re=G.disabled,_e=q.state,Ue=_e.textareaStyles,Ke=_e.resizeStatus,He=Object(ye.a)(q.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),je=de()(X,Ee,Object(R.a)({},"".concat(X,"-disabled"),re));"value"in He&&(He.value=He.value||"");var Xe=Object(T.a)(Object(T.a)(Object(T.a)({},q.props.style),Ue),Ke===C.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return z.createElement(Pe,{onResize:q.handleResize,disabled:!(O||be)},z.createElement("textarea",Object(H.a)({},He,{className:je,style:Xe,ref:q.saveTextArea})))},q.state={textareaStyles:{},resizeStatus:C.NONE},q}return Object(ne.a)(me,[{key:"componentDidUpdate",value:function(q){(q.value!==this.props.value||!d()(q.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 q=this.textArea.selectionStart,G=this.textArea.selectionEnd;this.textArea.setSelectionRange(q,G)}}catch(b){}}},{key:"render",value:function(){return this.renderTextArea()}}]),me}(z.Component),J=F,xe=function(ge){Object(we.a)(me,ge);var ve=Object(fe.a)(me);function me(ue){var q;Object(se.a)(this,me),q=ve.call(this,ue),q.resizableTextArea=void 0,q.focus=function(){q.resizableTextArea.textArea.focus()},q.saveTextArea=function(b){q.resizableTextArea=b},q.handleChange=function(b){var X=q.props.onChange;q.setValue(b.target.value,function(){q.resizableTextArea.resizeTextarea()}),X&&X(b)},q.handleKeyDown=function(b){var X=q.props,O=X.onPressEnter,be=X.onKeyDown;b.keyCode===13&&O&&O(b),be&&be(b)};var G=typeof ue.value=="undefined"||ue.value===null?ue.defaultValue:ue.value;return q.state={value:G},q}return Object(ne.a)(me,[{key:"setValue",value:function(q,G){"value"in this.props||this.setState({value:q},G)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return z.createElement(J,Object(H.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(q){return"value"in q?{value:q.value}:null}}]),me}(z.Component),Me=Qe.default=xe},ZW9T:function(ot,Qe,k){"use strict";k.d(Qe,"a",function(){return $e});var H=k("k1fw"),se=k("miYZ"),ne=k("tsqr"),we=k("rAM+"),fe=k("tJVT"),z=k("PpiC"),T=k("q1tI"),R=k.n(T),B=k("bdgK");function _(Se,De,Ve,ke,Te){var Pe=De.getWordUntilPosition(Ve),ye={startLineNumber:Ve.lineNumber,endLineNumber:Ve.lineNumber,startColumn:Pe.startColumn,endColumn:Pe.endColumn},M=ke.map(function(de){return{label:de,kind:Se.languages.CompletionItemKind.Keyword,insertText:de,insertTextRules:Se.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ye}});return Te.map(function(de){M.push(Object(H.a)(Object(H.a)({},de),{},{range:ye}))}),M}var L=function(Se){var De={label:"ifelse",kind:Se.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`),insertTextRules:Se.languages.CompletionItemInsertTextRule.InsertAsSnippet},Ve=["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"];Se.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(ye,M){var de=_(Se,ye,M,Ve,[De]);return{suggestions:de}}});var ke=["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"];Se.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(ye,M){var de=[{label:"print",kind:Se.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
`),insertTextRules:Se.languages.CompletionItemInsertTextRule.InsertAsSnippet}],ie=_(Se,ye,M,ke,de);return{suggestions:ie}}});var Te=["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"];Se.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(ye,M){var de=[De,{label:"main",kind:Se.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
`),insertTextRules:Se.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:Se.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
`),insertTextRules:Se.languages.CompletionItemInsertTextRule.InsertAsSnippet}],ie=_(Se,ye,M,Te,de);return{suggestions:ie}}})},E="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",te=k("LvDl");function Q(Se){return/^\d+$/.test(Se)?"".concat(Se,"px"):Se}function U(){}var Z=!1,W={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function ce(){var Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],De=Se;if(Array.isArray(Se)){for(var Ve=0;Ve<Se.length;Ve++){var ke=W[Se[Ve]];if(ke)return ke}return De[0]}return W[De]||De}var ae=null,Ie=Qe.b=function(Se){var De=Se.width,Ve=De===void 0?"100%":De,ke=Se.height,Te=ke===void 0?"100%":ke,Pe=Se.value,ye=Se.language,M=ye===void 0?"javascript":ye,de=Se.style,ie=de===void 0?{}:de,w=Se.options,j=w===void 0?{}:w,P=Se.overrideServices,S=P===void 0?{}:P,D=Se.theme,p=D===void 0?"vs-dark":D,d=Se.onEditBlur,C=Se.onSave,F=Se.autoHeight,J=F===void 0?!1:F,xe=Se.forbidCopy,Me=xe===void 0?!1:xe,ge=Se.onChange,ve=ge===void 0?U:ge,me=Se.editorDidMount,ue=me===void 0?U:me,q=Se.onFocus,G=q===void 0?U:q,b=Se.filename,X=b===void 0?"educoder.txt":b,O=Object(z.a)(Se,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),be=Object(T.useRef)(),Ee=Object(T.useRef)({}),re=Object(T.useRef)(),_e=Object(T.useRef)(!1),Ue=Object(T.useRef)(),Ke=Object(T.useState)(!1),He=Object(fe.a)(Ke,2),je=He[0],Xe=He[1];function mt(){var A;return be.current&&(A=new B.default(function(N){var le=Object(we.a)(N),Ce;try{for(le.s();!(Ce=le.n()).done;){var Ge=Ce.value;(Ge.target.offsetHeight>0||Ge.target.offsetWidth>0)&&Ee.current.instance.layout()}}catch(st){le.e(st)}finally{le.f()}}),A.observe(be.current)),A}function tt(){ne.b.warn(decodeURIComponent(E))}var it=function(){var N=Ee.current.instance;if(Pe!=null&&N&&je){var le=N.getModel();le&&Pe!==le.getValue()&&(Z=!0,le.setValue(Pe),N.layout(),Z=!1)}};Object(T.useEffect)(function(){re.current&&clearTimeout(re.current),re.current=setTimeout(function(){it()},500)},[Pe,je,Ee.current]);function et(){var A=Ee.current.instance;if(A){var N=A.getSelection(),le=Ee.current.pastePos||{},Ce=new ae.Range(le.startLineNumber||N.endLineNumber,le.startColumn||N.endColumn,le.endLineNumber||N.endLineNumber,le.endColumn||N.endColumn);setTimeout(function(){A.executeEdits("",[{range:Ce,text:""}])},300)}}function gt(A){(window.navigator.platform.match("Mac")?A.metaKey:A.ctrlKey)&&A.keyCode==83&&(A.preventDefault(),C())}var lt=function(){if(J&&Ee.current.instance){var N=Ee.current.instance.getContentHeight();y(N<Te?Te:N)}else y(Te)};function at(A){var N=document.createEvent("MouseEvents");N.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),A.dispatchEvent(N)}function Le(A,N){var le=window.URL||window.webkitURL||window,Ce=new Blob([N]),Ge=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ge.href=le.createObjectURL(Ce),Ge.download=A,at(Ge)}Object(T.useEffect)(function(){lt()},[lt]),Object(T.useEffect)(function(){be.current&&!je&&k.e(27).then(k.t.bind(null,"M/lh",7)).then(function(A){try{ae=A,Ee.current.instance=ae.editor.create(be.current,{value:Pe,language:ce(M),theme:p,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},S);var N=Ee.current.instance;if(ue(N,ae),setTimeout(function(){lt(),Ee.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Le(X||"educoder.txt",N.getValue())}})},500),Ee.current.subscription=N.onDidChangeModelContent(function(Ce){_e.current?clearTimeout(Ue.current):(lt(),ve(N.getValue(),Ce)),Ue.current=setTimeout(function(){_e.current=!1},500)}),window.Monaco||L(ae),Me&&(N.addCommand(ae.KeyMod.CtrlCmd|ae.KeyMod.Shift|ae.KeyCode.KEY_V,function(){return tt(),null}),N.addCommand(ae.KeyMod.CtrlCmd|ae.KeyCode.KEY_C,function(){return tt(),null})),window.Monaco=ae,d&&N.onDidBlurEditorWidget(function(){d(N.getValue())}),G&&N.onDidFocusEditorText(function(){G(N.getValue())}),Me){N.addCommand(ae.KeyMod.CtrlCmd|ae.KeyCode.KEY_V,function(){return tt(),null}),N.onDidPaste(function(Ce){Ee.current.pastePos=Ce});try{window.addEventListener("paste",et)}catch(Ce){}}var le=mt();return Xe(!0),function(){var Ce=Ee.current.instance;Ce.dispose();var Ge=Ce.getModel();Ge&&Ge.dispose(),Ee.current.subscription&&Ee.current.subscription.dispose(),Me&&window.removeEventListener("paste",et),le.unobserve(be.current)}}catch(Ce){}})},[]),Object(T.useEffect)(function(){var A=Ee.current.instance;if(A&&je)return document.addEventListener("keydown",gt,!1),function(){document.removeEventListener("keydown",gt)}},[C,je]),Object(T.useEffect)(function(){var A=Ee.current.instance;if(A&&je){var N=ce(M);ae.editor.setModelLanguage(A.getModel(),N),console.log("language:",M,A.getModel(),N)}},[M,je]),Object(T.useEffect)(function(){var A=Ee.current.instance;A&&je&&ae.editor.setTheme(p)},[p,je]),Object(T.useEffect)(function(){var A=Ee.current.instance;A&&je&&(A.updateOptions(Object(H.a)({},j)),setTimeout(function(){A.getModel().updateOptions(Object(H.a)({},j))},200))},[JSON.stringify(j),je]),Object(T.useEffect)(function(){var A=Ee.current.instance;A&&je&&A.layout()},[Ve,Te,je]);var vt=Object(T.useState)(Q(Ve)),rt=Object(fe.a)(vt,2),Oe=rt[0],ze=rt[1],ee=Object(T.useState)(Q(Te)),Y=Object(fe.a)(ee,2),$=Y[0],y=Y[1],x=Object(H.a)(Object(H.a)({},ie),{},{width:Oe,height:$});return R.a.createElement("div",{className:"my-monaco-editor",ref:be,style:x})};function $e(Se){var De=Se.width,Ve=De===void 0?"100%":De,ke=Se.height,Te=ke===void 0?"100%":ke,Pe=Se.original,ye=Se.modified,M=Se.language,de=Se.options,ie=de===void 0?{}:de,w=Object(T.useRef)(),j=Object(T.useState)(null),P=Object(fe.a)(j,2),S=P[0],D=P[1];function p(J){var xe;return w.current&&(xe=new B.default(function(Me){var ge=Object(we.a)(Me),ve;try{for(ge.s();!(ve=ge.n()).done;){var me=ve.value;(me.target.offsetHeight>0||me.target.offsetWidth>0)&&J.layout()}}catch(ue){ge.e(ue)}finally{ge.f()}}),xe.observe(w.current)),xe}Object(T.useEffect)(function(){w.current&&k.e(27).then(k.t.bind(null,"M/lh",7)).then(function(J){ae=J;var xe=ae.editor.createDiffEditor(w.current,Object(H.a)(Object(H.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},ie),{},{wordWrap:!0}));D(xe);var Me=p(xe);return function(){xe.dispose();var ge=xe.getModel();ge&&ge.dispose(),Me.unobserve(w.current)}})},[]),Object(T.useEffect)(function(){S&&S.setModel({original:ae.editor.createModel(Pe,M),modified:ae.editor.createModel(ye,M)})},[Pe,ye,M,S]);var d=Q(Ve),C=Q(Te),F={width:d,height:C};return R.a.createElement("div",{className:"my-diff-editor",ref:w,style:F})}},ZpRC:function(ot,Qe,k){"use strict";function H(L){return typeof L=="object"&&L!=null&&L.nodeType===1}function se(L,E){return(!E||L!=="hidden")&&L!=="visible"&&L!=="clip"}function ne(L,E){if(L.clientHeight<L.scrollHeight||L.clientWidth<L.scrollWidth){var te=getComputedStyle(L,null);return se(te.overflowY,E)||se(te.overflowX,E)||function(Q){var U=function(Z){if(!Z.ownerDocument||!Z.ownerDocument.defaultView)return null;try{return Z.ownerDocument.defaultView.frameElement}catch(W){return null}}(Q);return!!U&&(U.clientHeight<Q.scrollHeight||U.clientWidth<Q.scrollWidth)}(L)}return!1}function we(L,E,te,Q,U,Z,W,ce){return Z<L&&W>E||Z>L&&W<E?0:Z<=L&&ce<=te||W>=E&&ce>=te?Z-L-Q:W>E&&ce<te||Z<L&&ce>te?W-E+U:0}var fe=function(L,E){var te=window,Q=E.scrollMode,U=E.block,Z=E.inline,W=E.boundary,ce=E.skipOverflowHiddenElements,ae=typeof W=="function"?W:function(Ue){return Ue!==W};if(!H(L))throw new TypeError("Invalid target");for(var Ie=document.scrollingElement||document.documentElement,$e=[],Se=L;H(Se)&&ae(Se);){if((Se=Se.parentElement)===Ie){$e.push(Se);break}Se!=null&&Se===document.body&&ne(Se)&&!ne(document.documentElement)||Se!=null&&ne(Se,ce)&&$e.push(Se)}for(var De=te.visualViewport?te.visualViewport.width:innerWidth,Ve=te.visualViewport?te.visualViewport.height:innerHeight,ke=window.scrollX||pageXOffset,Te=window.scrollY||pageYOffset,Pe=L.getBoundingClientRect(),ye=Pe.height,M=Pe.width,de=Pe.top,ie=Pe.right,w=Pe.bottom,j=Pe.left,P=U==="start"||U==="nearest"?de:U==="end"?w:de+ye/2,S=Z==="center"?j+M/2:Z==="end"?ie:j,D=[],p=0;p<$e.length;p++){var d=$e[p],C=d.getBoundingClientRect(),F=C.height,J=C.width,xe=C.top,Me=C.right,ge=C.bottom,ve=C.left;if(Q==="if-needed"&&de>=0&&j>=0&&w<=Ve&&ie<=De&&de>=xe&&w<=ge&&j>=ve&&ie<=Me)return D;var me=getComputedStyle(d),ue=parseInt(me.borderLeftWidth,10),q=parseInt(me.borderTopWidth,10),G=parseInt(me.borderRightWidth,10),b=parseInt(me.borderBottomWidth,10),X=0,O=0,be="offsetWidth"in d?d.offsetWidth-d.clientWidth-ue-G:0,Ee="offsetHeight"in d?d.offsetHeight-d.clientHeight-q-b:0;if(Ie===d)X=U==="start"?P:U==="end"?P-Ve:U==="nearest"?we(Te,Te+Ve,Ve,q,b,Te+P,Te+P+ye,ye):P-Ve/2,O=Z==="start"?S:Z==="center"?S-De/2:Z==="end"?S-De:we(ke,ke+De,De,ue,G,ke+S,ke+S+M,M),X=Math.max(0,X+Te),O=Math.max(0,O+ke);else{X=U==="start"?P-xe-q:U==="end"?P-ge+b+Ee:U==="nearest"?we(xe,ge,F,q,b+Ee,P,P+ye,ye):P-(xe+F/2)+Ee/2,O=Z==="start"?S-ve-ue:Z==="center"?S-(ve+J/2)+be/2:Z==="end"?S-Me+G+be:we(ve,Me,J,ue,G+be,S,S+M,M);var re=d.scrollLeft,_e=d.scrollTop;P+=_e-(X=Math.max(0,Math.min(_e+X,d.scrollHeight-F+Ee))),S+=re-(O=Math.max(0,Math.min(re+O,d.scrollWidth-J+be)))}D.push({el:d,top:X,left:O})}return D};function z(L){return L===Object(L)&&Object.keys(L).length!==0}function T(L,E){E===void 0&&(E="auto");var te="scrollBehavior"in document.body.style;L.forEach(function(Q){var U=Q.el,Z=Q.top,W=Q.left;U.scroll&&te?U.scroll({top:Z,left:W,behavior:E}):(U.scrollTop=Z,U.scrollLeft=W)})}function R(L){return L===!1?{block:"end",inline:"nearest"}:z(L)?L:{block:"start",inline:"nearest"}}function B(L,E){var te=!L.ownerDocument.documentElement.contains(L);if(z(E)&&typeof E.behavior=="function")return E.behavior(te?[]:fe(L,E));if(te)return;var Q=R(E);return T(fe(L,Q),Q.behavior)}var _=Qe.a=B},Zss7:function(ot,Qe,k){var H;(function(se){var ne=/^\s+/,we=/\s+$/,fe=0,z=se.round,T=se.min,R=se.max,B=se.random;function _(b,X){if(b=b||"",X=X||{},b instanceof _)return b;if(!(this instanceof _))return new _(b,X);var O=L(b);this._originalInput=b,this._r=O.r,this._g=O.g,this._b=O.b,this._a=O.a,this._roundA=z(100*this._a)/100,this._format=X.format||O.format,this._gradientType=X.gradientType,this._r<1&&(this._r=z(this._r)),this._g<1&&(this._g=z(this._g)),this._b<1&&(this._b=z(this._b)),this._ok=O.ok,this._tc_id=fe++}_.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var b=this.toRgb();return(b.r*299+b.g*587+b.b*114)/1e3},getLuminance:function(){var b=this.toRgb(),X,O,be,Ee,re,_e;return X=b.r/255,O=b.g/255,be=b.b/255,X<=.03928?Ee=X/12.92:Ee=se.pow((X+.055)/1.055,2.4),O<=.03928?re=O/12.92:re=se.pow((O+.055)/1.055,2.4),be<=.03928?_e=be/12.92:_e=se.pow((be+.055)/1.055,2.4),.2126*Ee+.7152*re+.0722*_e},setAlpha:function(b){return this._a=D(b),this._roundA=z(100*this._a)/100,this},toHsv:function(){var b=U(this._r,this._g,this._b);return{h:b.h*360,s:b.s,v:b.v,a:this._a}},toHsvString:function(){var b=U(this._r,this._g,this._b),X=z(b.h*360),O=z(b.s*100),be=z(b.v*100);return this._a==1?"hsv("+X+", "+O+"%, "+be+"%)":"hsva("+X+", "+O+"%, "+be+"%, "+this._roundA+")"},toHsl:function(){var b=te(this._r,this._g,this._b);return{h:b.h*360,s:b.s,l:b.l,a:this._a}},toHslString:function(){var b=te(this._r,this._g,this._b),X=z(b.h*360),O=z(b.s*100),be=z(b.l*100);return this._a==1?"hsl("+X+", "+O+"%, "+be+"%)":"hsla("+X+", "+O+"%, "+be+"%, "+this._roundA+")"},toHex:function(b){return W(this._r,this._g,this._b,b)},toHexString:function(b){return"#"+this.toHex(b)},toHex8:function(b){return ce(this._r,this._g,this._b,this._a,b)},toHex8String:function(b){return"#"+this.toHex8(b)},toRgb:function(){return{r:z(this._r),g:z(this._g),b:z(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+z(this._r)+", "+z(this._g)+", "+z(this._b)+")":"rgba("+z(this._r)+", "+z(this._g)+", "+z(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:z(p(this._r,255)*100)+"%",g:z(p(this._g,255)*100)+"%",b:z(p(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+z(p(this._r,255)*100)+"%, "+z(p(this._g,255)*100)+"%, "+z(p(this._b,255)*100)+"%)":"rgba("+z(p(this._r,255)*100)+"%, "+z(p(this._g,255)*100)+"%, "+z(p(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:P[W(this._r,this._g,this._b,!0)]||!1},toFilter:function(b){var X="#"+ae(this._r,this._g,this._b,this._a),O=X,be=this._gradientType?"GradientType = 1, ":"";if(b){var Ee=_(b);O="#"+ae(Ee._r,Ee._g,Ee._b,Ee._a)}return"progid:DXImageTransform.Microsoft.gradient("+be+"startColorstr="+X+",endColorstr="+O+")"},toString:function(b){var X=!!b;b=b||this._format;var O=!1,be=this._a<1&&this._a>=0,Ee=!X&&be&&(b==="hex"||b==="hex6"||b==="hex3"||b==="hex4"||b==="hex8"||b==="name");return Ee?b==="name"&&this._a===0?this.toName():this.toRgbString():(b==="rgb"&&(O=this.toRgbString()),b==="prgb"&&(O=this.toPercentageRgbString()),(b==="hex"||b==="hex6")&&(O=this.toHexString()),b==="hex3"&&(O=this.toHexString(!0)),b==="hex4"&&(O=this.toHex8String(!0)),b==="hex8"&&(O=this.toHex8String()),b==="name"&&(O=this.toName()),b==="hsl"&&(O=this.toHslString()),b==="hsv"&&(O=this.toHsvString()),O||this.toHexString())},clone:function(){return _(this.toString())},_applyModification:function(b,X){var O=b.apply(null,[this].concat([].slice.call(X)));return this._r=O._r,this._g=O._g,this._b=O._b,this.setAlpha(O._a),this},lighten:function(){return this._applyModification(De,arguments)},brighten:function(){return this._applyModification(Ve,arguments)},darken:function(){return this._applyModification(ke,arguments)},desaturate:function(){return this._applyModification(Ie,arguments)},saturate:function(){return this._applyModification($e,arguments)},greyscale:function(){return this._applyModification(Se,arguments)},spin:function(){return this._applyModification(Te,arguments)},_applyCombination:function(b,X){return b.apply(null,[this].concat([].slice.call(X)))},analogous:function(){return this._applyCombination(ie,arguments)},complement:function(){return this._applyCombination(Pe,arguments)},monochromatic:function(){return this._applyCombination(w,arguments)},splitcomplement:function(){return this._applyCombination(de,arguments)},triad:function(){return this._applyCombination(ye,arguments)},tetrad:function(){return this._applyCombination(M,arguments)}},_.fromRatio=function(b,X){if(typeof b=="object"){var O={};for(var be in b)b.hasOwnProperty(be)&&(be==="a"?O[be]=b[be]:O[be]=Me(b[be]));b=O}return _(b,X)};function L(b){var X={r:0,g:0,b:0},O=1,be=null,Ee=null,re=null,_e=!1,Ue=!1;return typeof b=="string"&&(b=q(b)),typeof b=="object"&&(ue(b.r)&&ue(b.g)&&ue(b.b)?(X=E(b.r,b.g,b.b),_e=!0,Ue=String(b.r).substr(-1)==="%"?"prgb":"rgb"):ue(b.h)&&ue(b.s)&&ue(b.v)?(be=Me(b.s),Ee=Me(b.v),X=Z(b.h,be,Ee),_e=!0,Ue="hsv"):ue(b.h)&&ue(b.s)&&ue(b.l)&&(be=Me(b.s),re=Me(b.l),X=Q(b.h,be,re),_e=!0,Ue="hsl"),b.hasOwnProperty("a")&&(O=b.a)),O=D(O),{ok:_e,format:b.format||Ue,r:T(255,R(X.r,0)),g:T(255,R(X.g,0)),b:T(255,R(X.b,0)),a:O}}function E(b,X,O){return{r:p(b,255)*255,g:p(X,255)*255,b:p(O,255)*255}}function te(b,X,O){b=p(b,255),X=p(X,255),O=p(O,255);var be=R(b,X,O),Ee=T(b,X,O),re,_e,Ue=(be+Ee)/2;if(be==Ee)re=_e=0;else{var Ke=be-Ee;_e=Ue>.5?Ke/(2-be-Ee):Ke/(be+Ee);switch(be){case b:re=(X-O)/Ke+(X<O?6:0);break;case X:re=(O-b)/Ke+2;break;case O:re=(b-X)/Ke+4;break}re/=6}return{h:re,s:_e,l:Ue}}function Q(b,X,O){var be,Ee,re;b=p(b,360),X=p(X,100),O=p(O,100);function _e(He,je,Xe){return Xe<0&&(Xe+=1),Xe>1&&(Xe-=1),Xe<1/6?He+(je-He)*6*Xe:Xe<1/2?je:Xe<2/3?He+(je-He)*(2/3-Xe)*6:He}if(X===0)be=Ee=re=O;else{var Ue=O<.5?O*(1+X):O+X-O*X,Ke=2*O-Ue;be=_e(Ke,Ue,b+1/3),Ee=_e(Ke,Ue,b),re=_e(Ke,Ue,b-1/3)}return{r:be*255,g:Ee*255,b:re*255}}function U(b,X,O){b=p(b,255),X=p(X,255),O=p(O,255);var be=R(b,X,O),Ee=T(b,X,O),re,_e,Ue=be,Ke=be-Ee;if(_e=be===0?0:Ke/be,be==Ee)re=0;else{switch(be){case b:re=(X-O)/Ke+(X<O?6:0);break;case X:re=(O-b)/Ke+2;break;case O:re=(b-X)/Ke+4;break}re/=6}return{h:re,s:_e,v:Ue}}function Z(b,X,O){b=p(b,360)*6,X=p(X,100),O=p(O,100);var be=se.floor(b),Ee=b-be,re=O*(1-X),_e=O*(1-Ee*X),Ue=O*(1-(1-Ee)*X),Ke=be%6,He=[O,_e,re,re,Ue,O][Ke],je=[Ue,O,O,_e,re,re][Ke],Xe=[re,re,Ue,O,O,_e][Ke];return{r:He*255,g:je*255,b:Xe*255}}function W(b,X,O,be){var Ee=[xe(z(b).toString(16)),xe(z(X).toString(16)),xe(z(O).toString(16))];return be&&Ee[0].charAt(0)==Ee[0].charAt(1)&&Ee[1].charAt(0)==Ee[1].charAt(1)&&Ee[2].charAt(0)==Ee[2].charAt(1)?Ee[0].charAt(0)+Ee[1].charAt(0)+Ee[2].charAt(0):Ee.join("")}function ce(b,X,O,be,Ee){var re=[xe(z(b).toString(16)),xe(z(X).toString(16)),xe(z(O).toString(16)),xe(ge(be))];return Ee&&re[0].charAt(0)==re[0].charAt(1)&&re[1].charAt(0)==re[1].charAt(1)&&re[2].charAt(0)==re[2].charAt(1)&&re[3].charAt(0)==re[3].charAt(1)?re[0].charAt(0)+re[1].charAt(0)+re[2].charAt(0)+re[3].charAt(0):re.join("")}function ae(b,X,O,be){var Ee=[xe(ge(be)),xe(z(b).toString(16)),xe(z(X).toString(16)),xe(z(O).toString(16))];return Ee.join("")}_.equals=function(b,X){return!b||!X?!1:_(b).toRgbString()==_(X).toRgbString()},_.random=function(){return _.fromRatio({r:B(),g:B(),b:B()})};function Ie(b,X){X=X===0?0:X||10;var O=_(b).toHsl();return O.s-=X/100,O.s=d(O.s),_(O)}function $e(b,X){X=X===0?0:X||10;var O=_(b).toHsl();return O.s+=X/100,O.s=d(O.s),_(O)}function Se(b){return _(b).desaturate(100)}function De(b,X){X=X===0?0:X||10;var O=_(b).toHsl();return O.l+=X/100,O.l=d(O.l),_(O)}function Ve(b,X){X=X===0?0:X||10;var O=_(b).toRgb();return O.r=R(0,T(255,O.r-z(255*-(X/100)))),O.g=R(0,T(255,O.g-z(255*-(X/100)))),O.b=R(0,T(255,O.b-z(255*-(X/100)))),_(O)}function ke(b,X){X=X===0?0:X||10;var O=_(b).toHsl();return O.l-=X/100,O.l=d(O.l),_(O)}function Te(b,X){var O=_(b).toHsl(),be=(O.h+X)%360;return O.h=be<0?360+be:be,_(O)}function Pe(b){var X=_(b).toHsl();return X.h=(X.h+180)%360,_(X)}function ye(b){var X=_(b).toHsl(),O=X.h;return[_(b),_({h:(O+120)%360,s:X.s,l:X.l}),_({h:(O+240)%360,s:X.s,l:X.l})]}function M(b){var X=_(b).toHsl(),O=X.h;return[_(b),_({h:(O+90)%360,s:X.s,l:X.l}),_({h:(O+180)%360,s:X.s,l:X.l}),_({h:(O+270)%360,s:X.s,l:X.l})]}function de(b){var X=_(b).toHsl(),O=X.h;return[_(b),_({h:(O+72)%360,s:X.s,l:X.l}),_({h:(O+216)%360,s:X.s,l:X.l})]}function ie(b,X,O){X=X||6,O=O||30;var be=_(b).toHsl(),Ee=360/O,re=[_(b)];for(be.h=(be.h-(Ee*X>>1)+720)%360;--X;)be.h=(be.h+Ee)%360,re.push(_(be));return re}function w(b,X){X=X||6;for(var O=_(b).toHsv(),be=O.h,Ee=O.s,re=O.v,_e=[],Ue=1/X;X--;)_e.push(_({h:be,s:Ee,v:re})),re=(re+Ue)%1;return _e}_.mix=function(b,X,O){O=O===0?0:O||50;var be=_(b).toRgb(),Ee=_(X).toRgb(),re=O/100,_e={r:(Ee.r-be.r)*re+be.r,g:(Ee.g-be.g)*re+be.g,b:(Ee.b-be.b)*re+be.b,a:(Ee.a-be.a)*re+be.a};return _(_e)},_.readability=function(b,X){var O=_(b),be=_(X);return(se.max(O.getLuminance(),be.getLuminance())+.05)/(se.min(O.getLuminance(),be.getLuminance())+.05)},_.isReadable=function(b,X,O){var be=_.readability(b,X),Ee,re;re=!1,Ee=G(O);switch(Ee.level+Ee.size){case"AAsmall":case"AAAlarge":re=be>=4.5;break;case"AAlarge":re=be>=3;break;case"AAAsmall":re=be>=7;break}return re},_.mostReadable=function(b,X,O){var be=null,Ee=0,re,_e,Ue,Ke;O=O||{},_e=O.includeFallbackColors,Ue=O.level,Ke=O.size;for(var He=0;He<X.length;He++)re=_.readability(b,X[He]),re>Ee&&(Ee=re,be=_(X[He]));return _.isReadable(b,be,{level:Ue,size:Ke})||!_e?be:(O.includeFallbackColors=!1,_.mostReadable(b,["#fff","#000"],O))};var j=_.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},P=_.hexNames=S(j);function S(b){var X={};for(var O in b)b.hasOwnProperty(O)&&(X[b[O]]=O);return X}function D(b){return b=parseFloat(b),(isNaN(b)||b<0||b>1)&&(b=1),b}function p(b,X){F(b)&&(b="100%");var O=J(b);return b=T(X,R(0,parseFloat(b))),O&&(b=parseInt(b*X,10)/100),se.abs(b-X)<1e-6?1:b%X/parseFloat(X)}function d(b){return T(1,R(0,b))}function C(b){return parseInt(b,16)}function F(b){return typeof b=="string"&&b.indexOf(".")!=-1&&parseFloat(b)===1}function J(b){return typeof b=="string"&&b.indexOf("%")!=-1}function xe(b){return b.length==1?"0"+b:""+b}function Me(b){return b<=1&&(b=b*100+"%"),b}function ge(b){return se.round(parseFloat(b)*255).toString(16)}function ve(b){return C(b)/255}var me=function(){var b="[-\\+]?\\d+%?",X="[-\\+]?\\d*\\.\\d+%?",O="(?:"+X+")|(?:"+b+")",be="[\\s|\\(]+("+O+")[,|\\s]+("+O+")[,|\\s]+("+O+")\\s*\\)?",Ee="[\\s|\\(]+("+O+")[,|\\s]+("+O+")[,|\\s]+("+O+")[,|\\s]+("+O+")\\s*\\)?";return{CSS_UNIT:new RegExp(O),rgb:new RegExp("rgb"+be),rgba:new RegExp("rgba"+Ee),hsl:new RegExp("hsl"+be),hsla:new RegExp("hsla"+Ee),hsv:new RegExp("hsv"+be),hsva:new RegExp("hsva"+Ee),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function ue(b){return!!me.CSS_UNIT.exec(b)}function q(b){b=b.replace(ne,"").replace(we,"").toLowerCase();var X=!1;if(j[b])b=j[b],X=!0;else if(b=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var O;return(O=me.rgb.exec(b))?{r:O[1],g:O[2],b:O[3]}:(O=me.rgba.exec(b))?{r:O[1],g:O[2],b:O[3],a:O[4]}:(O=me.hsl.exec(b))?{h:O[1],s:O[2],l:O[3]}:(O=me.hsla.exec(b))?{h:O[1],s:O[2],l:O[3],a:O[4]}:(O=me.hsv.exec(b))?{h:O[1],s:O[2],v:O[3]}:(O=me.hsva.exec(b))?{h:O[1],s:O[2],v:O[3],a:O[4]}:(O=me.hex8.exec(b))?{r:C(O[1]),g:C(O[2]),b:C(O[3]),a:ve(O[4]),format:X?"name":"hex8"}:(O=me.hex6.exec(b))?{r:C(O[1]),g:C(O[2]),b:C(O[3]),format:X?"name":"hex"}:(O=me.hex4.exec(b))?{r:C(O[1]+""+O[1]),g:C(O[2]+""+O[2]),b:C(O[3]+""+O[3]),a:ve(O[4]+""+O[4]),format:X?"name":"hex8"}:(O=me.hex3.exec(b))?{r:C(O[1]+""+O[1]),g:C(O[2]+""+O[2]),b:C(O[3]+""+O[3]),format:X?"name":"hex"}:!1}function G(b){var X,O;return b=b||{level:"AA",size:"small"},X=(b.level||"AA").toUpperCase(),O=(b.size||"small").toLowerCase(),X!=="AA"&&X!=="AAA"&&(X="AA"),O!=="small"&&O!=="large"&&(O="small"),{level:X,size:O}}ot.exports?ot.exports=_:!(H=function(){return _}.call(Qe,k,Qe,ot),H!==void 0&&(ot.exports=H))})(Math)},aRTE:function(ot,Qe){ot.exports={L:1,M:0,Q:3,H:2}},bT9E:function(ot,Qe,k){"use strict";k.d(Qe,"a",function(){return se});var H=k("VTBJ");function se(ne,we){var fe=Object(H.a)({},ne);return Array.isArray(we)&&we.forEach(function(z){delete fe[z]}),fe}},c5Ni:function(ot,Qe,k){},dQei:function(ot,Qe){for(var k={glog:function(se){if(se<1)throw new Error("glog("+se+")");return k.LOG_TABLE[se]},gexp:function(se){for(;se<0;)se+=255;for(;se>=256;)se-=255;return k.EXP_TABLE[se]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},H=0;H<8;H++)k.EXP_TABLE[H]=1<<H;for(var H=8;H<256;H++)k.EXP_TABLE[H]=k.EXP_TABLE[H-4]^k.EXP_TABLE[H-5]^k.EXP_TABLE[H-6]^k.EXP_TABLE[H-8];for(var H=0;H<255;H++)k.LOG_TABLE[k.EXP_TABLE[H]]=H;ot.exports=k},dWSS:function(ot,Qe,k){var H=k("dQei");function se(ne,we){if(ne.length==null)throw new Error(ne.length+"/"+we);for(var fe=0;fe<ne.length&&ne[fe]==0;)fe++;this.num=new Array(ne.length-fe+we);for(var z=0;z<ne.length-fe;z++)this.num[z]=ne[z+fe]}se.prototype={get:function(ne){return this.num[ne]},getLength:function(){return this.num.length},multiply:function(ne){for(var we=new Array(this.getLength()+ne.getLength()-1),fe=0;fe<this.getLength();fe++)for(var z=0;z<ne.getLength();z++)we[fe+z]^=H.gexp(H.glog(this.get(fe))+H.glog(ne.get(z)));return new se(we,0)},mod:function(ne){if(this.getLength()-ne.getLength()<0)return this;for(var we=H.glog(this.get(0))-H.glog(ne.get(0)),fe=new Array(this.getLength()),z=0;z<this.getLength();z++)fe[z]=this.get(z);for(var z=0;z<ne.getLength();z++)fe[z]^=H.gexp(H.glog(ne.get(z))+we);return new se(fe,0).mod(ne)}},ot.exports=se},dejd:function(ot,Qe,k){},dmUQ:function(ot,Qe,k){"use strict";var H=k("Ff2n"),se=k("rePB"),ne=k("1OyB"),we=k("vuIU"),fe=k("Ji7U"),z=k("md7G"),T=k("foSv"),R=k("q1tI"),B=k.n(R),_=k("TSYQ"),L=k.n(_),E=k("4IlW");function te(ye,M){var de=Object.keys(ye);if(Object.getOwnPropertySymbols){var ie=Object.getOwnPropertySymbols(ye);M&&(ie=ie.filter(function(w){return Object.getOwnPropertyDescriptor(ye,w).enumerable})),de.push.apply(de,ie)}return de}function Q(ye){for(var M=1;M<arguments.length;M++){var de=arguments[M]!=null?arguments[M]:{};M%2?te(Object(de),!0).forEach(function(ie){Object(se.a)(ye,ie,de[ie])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ye,Object.getOwnPropertyDescriptors(de)):te(Object(de)).forEach(function(ie){Object.defineProperty(ye,ie,Object.getOwnPropertyDescriptor(de,ie))})}return ye}function U(ye){var M=Z();return function(){var ie=Object(T.a)(ye),w;if(M){var j=Object(T.a)(this).constructor;w=Reflect.construct(ie,arguments,j)}else w=ie.apply(this,arguments);return Object(z.a)(this,w)}}function Z(){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(ye){return!1}}function W(){}function ce(ye){ye.preventDefault()}var ae=function(M){return M.replace(/[^\w.-]+/g,"")},Ie=200,$e=600,Se=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,De=function(M){return M!=null},Ve=function(M,de){return de===M||typeof de=="number"&&typeof M=="number"&&isNaN(de)&&isNaN(M)},ke=function(ye){Object(fe.a)(de,ye);var M=U(de);function de(ie){var w;Object(ne.a)(this,de),w=M.call(this,ie),w.onKeyDown=function(S){var D=w.props,p=D.onKeyDown,d=D.onPressEnter;if(S.keyCode===E.a.UP){var C=w.getRatio(S);w.up(S,C,null),w.stop()}else if(S.keyCode===E.a.DOWN){var F=w.getRatio(S);w.down(S,F,null),w.stop()}else S.keyCode===E.a.ENTER&&d&&d(S);if(w.recordCursorPosition(),w.lastKeyCode=S.keyCode,p){for(var J=arguments.length,xe=new Array(J>1?J-1:0),Me=1;Me<J;Me++)xe[Me-1]=arguments[Me];p.apply(void 0,[S].concat(xe))}},w.onKeyUp=function(S){var D=w.props.onKeyUp;if(w.stop(),w.recordCursorPosition(),D){for(var p=arguments.length,d=new Array(p>1?p-1:0),C=1;C<p;C++)d[C-1]=arguments[C];D.apply(void 0,[S].concat(d))}},w.onChange=function(S){var D=w.props.onChange;w.state.focused&&(w.inputting=!0),w.rawInput=w.props.parser(w.getValueFromEvent(S)),w.setState({inputValue:w.rawInput}),D(w.toNumber(w.rawInput))},w.onMouseUp=function(){var S=w.props.onMouseUp;w.recordCursorPosition(),S&&S.apply(void 0,arguments)},w.onFocus=function(){var S;w.setState({focused:!0}),(S=w.props).onFocus.apply(S,arguments)},w.onBlur=function(){var S=w.props.onBlur;w.inputting=!1,w.setState({focused:!1});var D=w.getCurrentValidValue(w.state.inputValue),p=w.setValue(D,W);if(S){var d=w.input.value,C=w.getInputDisplayValue({focus:!1,value:p});w.input.value=C&&Number(C),S.apply(void 0,arguments),w.input.value=d}},w.getRatio=function(S){var D=1;return S.metaKey||S.ctrlKey?D=.1:S.shiftKey&&(D=10),D},w.getFullNum=function(S){return isNaN(S)?S:/e/i.test(String(S))?Number(S).toFixed(18).replace(/\.?0+$/,""):S},w.getPrecision=function(S){if(De(w.props.precision))return w.props.precision;var D=String(S);if(D.indexOf("e-")>=0)return parseInt(D.slice(D.indexOf("e-")+2),10);var p=0;return D.indexOf(".")>=0&&(p=D.length-D.indexOf(".")-1),p},w.getInputDisplayValue=function(S){var D=S||w.state,p=D.focused,d=D.inputValue,C=D.value,F;p?F=d:F=w.toPrecisionAsStep(C),F==null&&(F="");var J=w.formatWrapper(F);return De(w.props.decimalSeparator)&&(J=J.toString().replace(".",w.props.decimalSeparator)),J},w.recordCursorPosition=function(){try{w.cursorStart=w.input.selectionStart,w.cursorEnd=w.input.selectionEnd,w.currentValue=w.input.value,w.cursorBefore=w.input.value.substring(0,w.cursorStart),w.cursorAfter=w.input.value.substring(w.cursorEnd)}catch(S){}},w.restoreByAfter=function(S){if(S===void 0)return!1;var D=w.input.value,p=D.lastIndexOf(S);if(p===-1)return!1;var d=w.cursorBefore.length;return w.lastKeyCode===E.a.DELETE&&w.cursorBefore.charAt(d-1)===S[0]?(w.fixCaret(d,d),!0):p+S.length===D.length?(w.fixCaret(p,p),!0):!1},w.partRestoreByAfter=function(S){return S===void 0?!1:Array.prototype.some.call(S,function(D,p){var d=S.substring(p);return w.restoreByAfter(d)})},w.isNotCompleteNumber=function(S){return isNaN(S)||S===""||S===null||S&&S.toString().indexOf(".")===S.toString().length-1},w.stop=function(){w.autoStepTimer&&clearTimeout(w.autoStepTimer)},w.down=function(S,D,p){w.pressingUpOrDown=!0,w.step("down",S,D,p)},w.up=function(S,D,p){w.pressingUpOrDown=!0,w.step("up",S,D,p)},w.saveInput=function(S){w.input=S};var j=ie.value;j===void 0&&(j=ie.defaultValue),w.state={focused:ie.autoFocus};var P=w.getValidValue(w.toNumber(j));return w.state=Q(Q({},w.state),{},{inputValue:w.toPrecisionAsStep(P),value:P}),w}return Object(we.a)(de,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(w){var j=this.props,P=j.value,S=j.onChange,D=j.max,p=j.min,d=this.state.focused;if(w){if(!Ve(w.value,P)||!Ve(w.max,D)||!Ve(w.min,p)){var C=d?P:this.getValidValue(P),F;this.pressingUpOrDown?F=C:this.inputting?F=this.rawInput:F=this.toPrecisionAsStep(C),this.setState({value:C,inputValue:F})}var J="value"in this.props?P:this.state.value;"max"in this.props&&w.max!==D&&typeof J=="number"&&J>D&&S&&S(D),"min"in this.props&&w.min!==p&&typeof J=="number"&&J<p&&S&&S(p)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var xe=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===E.a.BACKSPACE?xe=this.cursorStart-1:this.lastKeyCode===E.a.DELETE&&(xe=this.cursorStart):xe=this.input.value.length,this.fixCaret(xe,xe)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case E.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case E.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Me){}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(w){var j=w;return j===""?j="":this.isNotCompleteNumber(parseFloat(j))?j=this.state.value:j=this.getValidValue(j),this.toNumber(j)}},{key:"getValueFromEvent",value:function(w){var j=w.target.value.trim().replace(/。/g,".");return De(this.props.decimalSeparator)&&(j=j.replace(this.props.decimalSeparator,".")),j}},{key:"getValidValue",value:function(w){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,S=parseFloat(w);return isNaN(S)?w:(S<j&&(S=j),S>P&&(S=P),S)}},{key:"setValue",value:function(w,j){var P=this.props.precision,S=this.isNotCompleteNumber(parseFloat(w))?null:parseFloat(w),D=this.state.value,p=D===void 0?null:D,d=this.state.inputValue,C=d===void 0?null:d,F=typeof S=="number"?S.toFixed(P):"".concat(S),J=S!==p||F!=="".concat(C);return"value"in this.props?(C=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:C},j)):this.setState({value:S,inputValue:this.toPrecisionAsStep(w)},j),J&&this.props.onChange(S),S}},{key:"getMaxPrecision",value:function(w){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,P=this.props,S=P.precision,D=P.step;if(De(S))return S;var p=this.getPrecision(j),d=this.getPrecision(D),C=this.getPrecision(w);return w?Math.max(C,p+d):p+d}},{key:"getPrecisionFactor",value:function(w){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,P=this.getMaxPrecision(w,j);return Math.pow(10,P)}},{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(w){return this.props.formatter?this.props.formatter(w):w}},{key:"toPrecisionAsStep",value:function(w){if(this.isNotCompleteNumber(w)||w==="")return w;var j=Math.abs(this.getMaxPrecision(w));return isNaN(j)?w.toString():Number(w).toFixed(j)}},{key:"toNumber",value:function(w){var j=this.props.precision,P=this.state.focused,S=w&&w.length>16&&P;return this.isNotCompleteNumber(w)||S?w:De(j)?Math.round(w*Math.pow(10,j))/Math.pow(10,j):Number(w)}},{key:"upStep",value:function(w,j){var P=this.props.step,S=this.getPrecisionFactor(w,j),D=Math.abs(this.getMaxPrecision(w,j)),p=((S*w+S*P*j)/S).toFixed(D);return this.toNumber(p)}},{key:"downStep",value:function(w,j){var P=this.props.step,S=this.getPrecisionFactor(w,j),D=Math.abs(this.getMaxPrecision(w,j)),p=((S*w-S*P*j)/S).toFixed(D);return this.toNumber(p)}},{key:"step",value:function(w,j){var P=this,S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,D=arguments.length>3?arguments[3]:void 0;this.stop(),j&&(j.persist(),j.preventDefault());var p=this.props;if(p.disabled)return;var d=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(d))return;var C=this["".concat(w,"Step")](d,S),F=C>p.max||C<p.min;if(C>p.max?C=p.max:C<p.min&&(C=p.min),this.setValue(C,null),this.setState({focused:!0},function(){P.pressingUpOrDown=!1}),F)return;this.autoStepTimer=setTimeout(function(){P[w](j,S,!0)},D?Ie:$e)}},{key:"fixCaret",value:function(w,j){if(w===void 0||j===void 0||!this.input||!this.input.value)return;try{var P=this.input.selectionStart,S=this.input.selectionEnd;(w!==P||j!==S)&&this.input.setSelectionRange(w,j)}catch(D){}}},{key:"render",value:function(){var w,j=this.props,P=j.prefixCls,S=j.disabled,D=j.readOnly,p=j.useTouch,d=j.autoComplete,C=j.upHandler,F=j.downHandler,J=j.className,xe=j.max,Me=j.min,ge=j.style,ve=j.title,me=j.onMouseEnter,ue=j.onMouseLeave,q=j.onMouseOver,G=j.onMouseOut,b=j.required,X=j.onClick,O=j.tabIndex,be=j.type,Ee=j.placeholder,re=j.id,_e=j.inputMode,Ue=j.pattern,Ke=j.step,He=j.maxLength,je=j.autoFocus,Xe=j.name,mt=j.onPaste,tt=j.onInput,it=Object(H.a)(j,["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"]),et=this.state,gt=et.value,lt=et.focused,at=L()(P,(w={},Object(se.a)(w,J,!!J),Object(se.a)(w,"".concat(P,"-disabled"),S),Object(se.a)(w,"".concat(P,"-focused"),lt),w)),Le={};Object.keys(it).forEach(function(N){(N.substr(0,5)==="data-"||N.substr(0,5)==="aria-"||N==="role")&&(Le[N]=it[N])});var vt=!D&&!S,rt=this.getInputDisplayValue(null),Oe=(gt||gt===0)&&(isNaN(gt)||Number(gt)>=xe),ze=(gt||gt===0)&&(isNaN(gt)||Number(gt)<=Me),ee=Oe||S||D,Y=ze||S||D,$=L()("".concat(P,"-handler"),"".concat(P,"-handler-up"),Object(se.a)({},"".concat(P,"-handler-up-disabled"),ee)),y=L()("".concat(P,"-handler"),"".concat(P,"-handler-down"),Object(se.a)({},"".concat(P,"-handler-down-disabled"),Y)),x=p?{onTouchStart:ee?W:this.up,onTouchEnd:this.stop}:{onMouseDown:ee?W:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},A=p?{onTouchStart:Y?W:this.down,onTouchEnd:this.stop}:{onMouseDown:Y?W:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return B.a.createElement("div",{className:at,style:ge,title:ve,onMouseEnter:me,onMouseLeave:ue,onMouseOver:q,onMouseOut:G,onFocus:function(){return null},onBlur:function(){return null}},B.a.createElement("div",{className:"".concat(P,"-handler-wrap")},B.a.createElement("span",Object.assign({unselectable:"on"},x,{role:"button","aria-label":"Increase Value","aria-disabled":ee,className:$}),C||B.a.createElement("span",{unselectable:"on",className:"".concat(P,"-handler-up-inner"),onClick:ce})),B.a.createElement("span",Object.assign({unselectable:"on"},A,{role:"button","aria-label":"Decrease Value","aria-disabled":Y,className:y}),F||B.a.createElement("span",{unselectable:"on",className:"".concat(P,"-handler-down-inner"),onClick:ce}))),B.a.createElement("div",{className:"".concat(P,"-input-wrap")},B.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Me,"aria-valuemax":xe,"aria-valuenow":gt,required:b,type:be,placeholder:Ee,onPaste:mt,onClick:X,onMouseUp:this.onMouseUp,className:"".concat(P,"-input"),tabIndex:O,autoComplete:d,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:vt?this.onKeyDown:W,onKeyUp:vt?this.onKeyUp:W,autoFocus:je,maxLength:He,readOnly:D,disabled:S,max:xe,min:Me,step:Ke,name:Xe,title:ve,id:re,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(rt),pattern:Ue,inputMode:_e,onInput:tt},Le))))}}]),de}(B.a.Component);ke.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:Se,min:-Se,step:1,style:{},onChange:W,onKeyDown:W,onPressEnter:W,onFocus:W,onBlur:W,parser:ae,required:!1,autoComplete:"off"};var Te=ke,Pe=Qe.a=Te},f4xo:function(ot,Qe,k){var H=k("nVVt");function se(ne){this.mode=H.MODE_8BIT_BYTE,this.data=ne}se.prototype={getLength:function(ne){return this.data.length},write:function(ne){for(var we=0;we<this.data.length;we++)ne.put(this.data.charCodeAt(we),8)}},ot.exports=se},gkVt:function(ot,Qe,k){"use strict";k.r(Qe);var H=k("DZo9"),se=k("8z0m"),ne=k("+L6B"),we=k("2/Rp"),fe=k("miYZ"),z=k("tsqr"),T=k("9og8"),R=k("tJVT"),B=k("WmNS"),_=k.n(B),L=k("q1tI"),E=k.n(L),te=k("5NDa"),Q=k("5rEg"),U=k("Ot1p"),Z=k("ErOA");function W(ye){var M=ye.setIscreate,de=ye.init,ie=ye.UpdateItem,w=Object(L.useState)(""),j=Object(R.a)(w,2),P=j[0],S=j[1],D=Object(L.useState)(""),p=Object(R.a)(D,2),d=p[0],C=p[1];Object(L.useEffect)(function(){if(!ie)return;S(ie&&ie.name),C(ie&&ie.description)},[ie]);function F(){return J.apply(this,arguments)}function J(){return J=Object(T.a)(_.a.mark(function ge(){var ve;return _.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:if(P){ue.next=3;break}return z.b.info("\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A"),ue.abrupt("return");case 3:if(d){ue.next=6;break}return z.b.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A"),ue.abrupt("return");case 6:if(!ie){ue.next=9;break}return xe(),ue.abrupt("return");case 9:return ue.next=11,Object(Z.a)("/api/hpc_courses.json",{method:"post",body:{name:P,description:d,container_type:window.location.pathname.split("/")[1]}});case 11:ve=ue.sent,ve&&(z.b.info("\u521B\u5EFA\u6210\u529F"),M(!1),de("add"));case 13:case"end":return ue.stop()}},ge)})),J.apply(this,arguments)}function xe(){return Me.apply(this,arguments)}function Me(){return Me=Object(T.a)(_.a.mark(function ge(){var ve;return _.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return ue.next=2,Object(Z.a)("/api/hpc_courses/".concat(ie.id,".json"),{method:"put",body:{name:P,description:d,container_type:window.location.pathname.split("/")[1]}});case 2:ve=ue.sent,ve&&(z.b.info("\u7F16\u8F91\u6210\u529F"),M(!1),de(""));case 4:case"end":return ue.stop()}},ge)})),Me.apply(this,arguments)}return E.a.createElement("div",null,E.a.createElement(Q.a,{style:{marginBottom:"20px"},placeholder:"\u8BF7\u8F93\u5165\u6807\u9898",value:P,maxLength:60,addonAfter:String(P.length)+"/60",onChange:function(ve){return S(ve.target.value)}}),E.a.createElement(U.a,{id:"courseContentMD",defaultValue:d,onChange:function(ve){return C(ve)}}),E.a.createElement("div",{className:"clearfix mt30 mb30"},E.a.createElement(we.a,{type:"primary",onClick:function(){return F()},className:"defalutSubmitbtn fl mr20"},"\u63D0\u4EA4"),E.a.createElement("a",{className:"defalutCancelbtn fl",onClick:function(){return M(!1)}},"\u53D6\u6D88")))}var ce=W,ae=k("9Bee");function Ie(ye){var M=ye.CourseItem,de=ye.userId,ie=ye.init,w=ye.ItemUpdate,j=ye.setSee,P=ye.UserInfo;function S(){return D.apply(this,arguments)}function D(){return D=Object(T.a)(_.a.mark(function d(){var C;return _.a.wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,Object(Z.a)("/api/hpc_courses/".concat(M.id,".json"),{method:"delete"});case 2:C=J.sent,C&&(z.b.info("\u5220\u9664\u6210\u529F"),ie("delete"),j(!1));case 4:case"end":return J.stop()}},d)})),D.apply(this,arguments)}function p(){w(M)}return E.a.createElement("div",null,de===299635||de===301458||P!=null&&P.admin||P!=null&&P.business?E.a.createElement("div",{style:{textAlign:"right"}},E.a.createElement(we.a,{onClick:function(){return p()}},"\u7F16\u8F91"),E.a.createElement(we.a,{onClick:function(){return S()},style:{marginLeft:"30px"}},"\u5220\u9664")):null,E.a.createElement("h1",null,M==null?void 0:M.name),E.a.createElement(ae.a,{value:M==null?void 0:M.description}))}var $e=Ie,Se=k("9ivq"),De=k("m3rI"),Ve=k("Ty5D"),ke=k("9kvl");function Te(ye){var M,de,ie,w,j,P,S,D,p,d=ye.user,C=ye.dispatch,F=Object(L.useState)(1),J=Object(R.a)(F,2),xe=J[0],Me=J[1],ge=Object(L.useState)(100),ve=Object(R.a)(ge,2),me=ve[0],ue=ve[1],q=Object(L.useState)([]),G=Object(R.a)(q,2),b=G[0],X=G[1],O=Object(L.useState)(!1),be=Object(R.a)(O,2),Ee=be[0],re=be[1],_e=Object(L.useState)(!1),Ue=Object(R.a)(_e,2),Ke=Ue[0],He=Ue[1],je=Object(L.useState)(""),Xe=Object(R.a)(je,2),mt=Xe[0],tt=Xe[1],it=Object(L.useState)(""),et=Object(R.a)(it,2),gt=et[0],lt=et[1],at=Object(L.useState)(""),Le=Object(R.a)(at,2),vt=Le[0],rt=Le[1],Oe=Object(Ve.i)(),ze=Oe.itemname,ee=Object(L.useState)(""),Y=Object(R.a)(ee,2),$=Y[0],y=Y[1];Object(L.useEffect)(function(){C({type:"globalSetting/headerToggle",payload:!1}),xe&&x("")},[xe]);function x(st){return A.apply(this,arguments)}function A(){return A=Object(T.a)(_.a.mark(function st(Ct){var Ae,bt,dt,qe,Lt;return _.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:return At.next=2,Object(Z.a)("/api/hpc_courses.json",{method:"get",params:{page:xe,per_page:me,container_type:window.location.pathname.split("/")[1]}});case 2:if(Ae=At.sent,!Ae){At.next=24;break}if(bt=Ae.data.hpc_courses.length,X(Ae.data.hpc_courses),rt(Ae.data.file_url),lt(""),bt){At.next=10;break}return At.abrupt("return");case 10:if($){At.next=14;break}ze?(Lt=0,Ae==null||((dt=Ae.data)===null||dt===void 0||((qe=dt.hpc_courses)===null||qe===void 0))||qe.map(function(Mt,Tt){var qt;(ze==null?void 0:ze.toLocaleLowerCase())===(Mt==null||((qt=Mt.name)===null||qt===void 0)?void 0:qt.toLocaleLowerCase())&&(Lt=Tt)}),tt(Ae.data.hpc_courses[Lt]),He(!0),y(Ae.data.hpc_courses[Lt].id),(ze==null?void 0:ze.toLocaleLowerCase())==="resources"&&(tt(Ae.data.hpc_courses.filter(function(Mt){return Mt.id===15})[0]),He(!0),y(15))):(tt(Ae.data.hpc_courses[0]),He(!0),y(Ae.data.hpc_courses[0].id)),At.next=24;break;case 14:if(!(Ct==="delete")){At.next=23;break}if(!(bt===0)){At.next=18;break}return He(!1),At.abrupt("return");case 18:tt(Ae.data.hpc_courses[0]),He(!0),y(Ae.data.hpc_courses[0].id),At.next=24;break;case 23:Ct==="add"?(tt(Ae.data.hpc_courses[bt-1]),He(!0),y(Ae.data.hpc_courses[bt-1].id)):(tt(Ae.data.hpc_courses.filter(function(Mt){return Mt.id===$})[0]),He(!0),y($));case 24:case"end":return At.stop()}},st)})),A.apply(this,arguments)}function N(st){re(!1),He(!0),tt(st),y(st.id)}function le(st){lt(st),re(!0),He(!1)}function Ce(){lt(""),re(!0),He(!1)}var Ge={name:"file",multiple:!0,action:"https://www.educoder.net/api/hpc_courses/upload_file.json",data:{container_type:window.location.pathname.split("/")[1]},onChange:function(Ct){var Ae=Ct.file.status;Ae!=="uploading",Ae==="done"?(z.b.success("".concat(Ct.file.name," \u6587\u4EF6\u4E0A\u4F20\u6210\u529F")),x("")):Ae==="error"&&z.b.error("".concat(Ct.file.name," \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25"))},beforeUpload:function(Ct){var Ae=Ct.size/1024/1024<150;return Ae||z.b.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E150MB"),Ae}};return E.a.createElement("div",{style:{marginBottom:"40px"}},E.a.createElement("div",{className:"bannterdiv",style:{background:"url(".concat(De.a.IMG_SERVER+"/".concat(vt),")")}}),E.a.createElement("img",{style:{width:"100%"},src:De.a.IMG_SERVER+"/".concat(vt)}),E.a.createElement("div",{className:"edu-container minH500",style:{display:"flex",width:"1200px"}},E.a.createElement("div",{style:{flex:"1",marginTop:"17px"}},b&&b.map(function(st,Ct){return E.a.createElement("p",{key:Ct,onClick:function(){return N(st)},className:$===st.id?"menuitemselect":"menuitem task-hide"},st.name)}),(d==null||((M=d.userInfo)===null||M===void 0)?void 0:M.user_id)===299635||(d==null||((de=d.userInfo)===null||de===void 0)?void 0:de.user_id)===301458||d!=null&&(ie=d.userInfo)!==null&&ie!==void 0&&ie.admin||d!=null&&(w=d.userInfo)!==null&&w!==void 0&&w.business?E.a.createElement("p",{onClick:function(){return Ce()},className:"menuadd",style:{fontSize:"24px",paddingLeft:"10px"}},E.a.createElement("span",{style:{fontSize:"16px",marginLeft:"5px"}},"Last updated")):null),E.a.createElement("div",{className:"rightcount",style:{flex:"6",background:"#ffffff",padding:"20px",marginLeft:"30px",marginTop:"24px"}},Ee?E.a.createElement(ce,{UpdateItem:gt,setIscreate:re,init:x}):null,Ke?E.a.createElement($e,{UserInfo:d==null?void 0:d.userInfo,setSee:He,userId:d==null||((j=d.userInfo)===null||j===void 0)?void 0:j.user_id,ItemUpdate:le,CourseItem:mt,init:x}):null)),(d==null||((P=d.userInfo)===null||P===void 0)?void 0:P.user_id)===299635||(d==null||((S=d.userInfo)===null||S===void 0)?void 0:S.user_id)===301458||d!=null&&(D=d.userInfo)!==null&&D!==void 0&&D.admin||d!=null&&(p=d.userInfo)!==null&&p!==void 0&&p.business?E.a.createElement(se.a,Ge,E.a.createElement(we.a,{className:"menuadd",style:{paddingLeft:"10px",marginLeft:"20px"}},"\u4E0A\u4F20\u9996\u9875\u56FE\u7247")):null)}var Pe=Qe.default=Object(ke.a)(function(ye){var M=ye.user;return{user:M}})(Te)},h78n:function(ot,Qe,k){"use strict";k.d(Qe,"a",function(){return w});var H=k("q1tI"),se=k.n(H),ne=k("TSYQ"),we=k.n(ne),fe={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},z=function(S){var D=S.map(function(){return Object(H.useRef)()}),p=Object(H.useRef)();return Object(H.useEffect)(function(){var d=Date.now(),C=!1;Object.keys(D).forEach(function(F){var J=D[F].current;if(!J)return;C=!0;var xe=J.style;xe.transitionDuration=".3s, .3s, .3s, .06s",p.current&&d-p.current<100&&(xe.transitionDuration="0s, 0s")}),C&&(p.current=Date.now())}),[D]};function T(){return T=Object.assign||function(P){for(var S=1;S<arguments.length;S++){var D=arguments[S];for(var p in D)Object.prototype.hasOwnProperty.call(D,p)&&(P[p]=D[p])}return P},T.apply(this,arguments)}function R(P,S){return te(P)||E(P,S)||_(P,S)||B()}function B(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _(P,S){if(!P)return;if(typeof P=="string")return L(P,S);var D=Object.prototype.toString.call(P).slice(8,-1);if(D==="Object"&&P.constructor&&(D=P.constructor.name),D==="Map"||D==="Set")return Array.from(P);if(D==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(D))return L(P,S)}function L(P,S){(S==null||S>P.length)&&(S=P.length);for(var D=0,p=new Array(S);D<S;D++)p[D]=P[D];return p}function E(P,S){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(P)))return;var D=[],p=!0,d=!1,C=void 0;try{for(var F=P[Symbol.iterator](),J;!(p=(J=F.next()).done)&&!(D.push(J.value),S&&D.length===S);p=!0);}catch(xe){d=!0,C=xe}finally{try{!p&&F.return!=null&&F.return()}finally{if(d)throw C}}return D}function te(P){if(Array.isArray(P))return P}function Q(P,S){if(P==null)return{};var D=U(P,S),p,d;if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(P);for(d=0;d<C.length;d++){if(p=C[d],S.indexOf(p)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(P,p))continue;D[p]=P[p]}}return D}function U(P,S){if(P==null)return{};var D={},p=Object.keys(P),d,C;for(C=0;C<p.length;C++){if(d=p[C],S.indexOf(d)>=0)continue;D[d]=P[d]}return D}var Z=function(S){var D=S.className,p=S.percent,d=S.prefixCls,C=S.strokeColor,F=S.strokeLinecap,J=S.strokeWidth,xe=S.style,Me=S.trailColor,ge=S.trailWidth,ve=S.transition,me=Q(S,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete me.gapPosition;var ue=Array.isArray(p)?p:[p],q=Array.isArray(C)?C:[C],G=z(ue),b=R(G,1),X=b[0],O=J/2,be=100-J/2,Ee="M ".concat(F==="round"?O:0,",").concat(O,`
L `).concat(F==="round"?be:100,",").concat(O),re="0 0 100 ".concat(J),_e=0;return se.a.createElement("svg",T({className:we()("".concat(d,"-line"),D),viewBox:re,preserveAspectRatio:"none",style:xe},me),se.a.createElement("path",{className:"".concat(d,"-line-trail"),d:Ee,strokeLinecap:F,stroke:Me,strokeWidth:ge||J,fillOpacity:"0"}),ue.map(function(Ue,Ke){var He={strokeDasharray:"".concat(Ue,"px, 100px"),strokeDashoffset:"-".concat(_e,"px"),transition:ve||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},je=q[Ke]||q[q.length-1];return _e+=Ue,se.a.createElement("path",{key:Ke,className:"".concat(d,"-line-path"),d:Ee,strokeLinecap:F,stroke:je,strokeWidth:J,fillOpacity:"0",ref:X[Ke],style:He})}))};Z.defaultProps=fe;var W=Z;function ce(){return ce=Object.assign||function(P){for(var S=1;S<arguments.length;S++){var D=arguments[S];for(var p in D)Object.prototype.hasOwnProperty.call(D,p)&&(P[p]=D[p])}return P},ce.apply(this,arguments)}function ae(P,S){return Ve(P)||De(P,S)||$e(P,S)||Ie()}function Ie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $e(P,S){if(!P)return;if(typeof P=="string")return Se(P,S);var D=Object.prototype.toString.call(P).slice(8,-1);if(D==="Object"&&P.constructor&&(D=P.constructor.name),D==="Map"||D==="Set")return Array.from(P);if(D==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(D))return Se(P,S)}function Se(P,S){(S==null||S>P.length)&&(S=P.length);for(var D=0,p=new Array(S);D<S;D++)p[D]=P[D];return p}function De(P,S){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(P)))return;var D=[],p=!0,d=!1,C=void 0;try{for(var F=P[Symbol.iterator](),J;!(p=(J=F.next()).done)&&!(D.push(J.value),S&&D.length===S);p=!0);}catch(xe){d=!0,C=xe}finally{try{!p&&F.return!=null&&F.return()}finally{if(d)throw C}}return D}function Ve(P){if(Array.isArray(P))return P}function ke(P,S){if(P==null)return{};var D=Te(P,S),p,d;if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(P);for(d=0;d<C.length;d++){if(p=C[d],S.indexOf(p)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(P,p))continue;D[p]=P[p]}}return D}function Te(P,S){if(P==null)return{};var D={},p=Object.keys(P),d,C;for(C=0;C<p.length;C++){if(d=p[C],S.indexOf(d)>=0)continue;D[d]=P[d]}return D}var Pe=0;function ye(P){return+P.replace("%","")}function M(P){return Array.isArray(P)?P:[P]}function de(P,S,D,p){var d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,C=arguments.length>5?arguments[5]:void 0,F=50-p/2,J=0,xe=-F,Me=0,ge=-2*F;switch(C){case"left":J=-F,xe=0,Me=2*F,ge=0;break;case"right":J=F,xe=0,Me=-2*F,ge=0;break;case"bottom":xe=F,ge=2*F;break;default:}var ve="M 50,50 m ".concat(J,",").concat(xe,`
a `).concat(F,",").concat(F," 0 1 1 ").concat(Me,",").concat(-ge,`
a `).concat(F,",").concat(F," 0 1 1 ").concat(-Me,",").concat(ge),me=Math.PI*2*F,ue={stroke:D,strokeDasharray:"".concat(S/100*(me-d),"px ").concat(me,"px"),strokeDashoffset:"-".concat(d/2+P/100*(me-d),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:ve,pathStyle:ue}}var ie=function(S){var D=S.prefixCls,p=S.strokeWidth,d=S.trailWidth,C=S.gapDegree,F=S.gapPosition,J=S.trailColor,xe=S.strokeLinecap,Me=S.style,ge=S.className,ve=S.strokeColor,me=S.percent,ue=ke(S,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),q=Object(H.useMemo)(function(){return Pe+=1,Pe},[]),G=de(0,100,J,p,C,F),b=G.pathString,X=G.pathStyle,O=M(me),be=M(ve),Ee=be.find(function(He){return Object.prototype.toString.call(He)==="[object Object]"}),re=z(O),_e=ae(re,1),Ue=_e[0],Ke=function(){var je=0;return O.map(function(Xe,mt){var tt=be[mt]||be[be.length-1],it=Object.prototype.toString.call(tt)==="[object Object]"?"url(#".concat(D,"-gradient-").concat(q,")"):"",et=de(je,Xe,tt,p,C,F);return je+=Xe,se.a.createElement("path",{key:mt,className:"".concat(D,"-circle-path"),d:et.pathString,stroke:it,strokeLinecap:xe,strokeWidth:p,opacity:Xe===0?0:1,fillOpacity:"0",style:et.pathStyle,ref:Ue[mt]})})};return se.a.createElement("svg",ce({className:we()("".concat(D,"-circle"),ge),viewBox:"0 0 100 100",style:Me},ue),Ee&&se.a.createElement("defs",null,se.a.createElement("linearGradient",{id:"".concat(D,"-gradient-").concat(q),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Ee).sort(function(He,je){return ye(He)-ye(je)}).map(function(He,je){return se.a.createElement("stop",{key:je,offset:He,stopColor:Ee[He]})}))),se.a.createElement("path",{className:"".concat(D,"-circle-trail"),d:b,stroke:J,strokeLinecap:xe,strokeWidth:d||p,fillOpacity:"0",style:X}),Ke().reverse())};ie.defaultProps=fe;var w=ie,j={Line:W,Circle:w}},kSUc:function(ot,Qe,k){},lZu9:function(ot,Qe,k){(function(H){H(k("VrN/"),k("1eCo"),k("8EBN"))})(function(H){"use strict";H.defineMode("markdown",function(se,ne){var we=H.getMode(se,"text/html"),fe=we.name=="null";function z(p){if(H.findModeByName){var d=H.findModeByName(p);d&&(p=d.mime||d.mimes[0])}var C=H.getMode(se,p);return C.name=="null"?null:C}ne.highlightFormatting===void 0&&(ne.highlightFormatting=!1),ne.maxBlockquoteDepth===void 0&&(ne.maxBlockquoteDepth=0),ne.taskLists===void 0&&(ne.taskLists=!1),ne.strikethrough===void 0&&(ne.strikethrough=!1),ne.emoji===void 0&&(ne.emoji=!1),ne.fencedCodeBlockHighlighting===void 0&&(ne.fencedCodeBlockHighlighting=!0),ne.fencedCodeBlockDefaultMode===void 0&&(ne.fencedCodeBlockDefaultMode="text/plain"),ne.xml===void 0&&(ne.xml=!0),ne.tokenTypeOverrides===void 0&&(ne.tokenTypeOverrides={});var T={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 R in T)T.hasOwnProperty(R)&&ne.tokenTypeOverrides[R]&&(T[R]=ne.tokenTypeOverrides[R]);var B=/^([*\-_])(?:\s*\1){2,}\s*$/,_=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,L=/^\[(x| )\](?=\s)/i,E=ne.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,te=/^ {0,3}(?:\={1,}|-{2,})\s*$/,Q=/^[^#!\[\]*_\\<>` "'(~:]+/,U=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,Z=/^\s*\[[^\]]+?\]:.*$/,W=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,ce=" ";function ae(p,d,C){return d.f=d.inline=C,C(p,d)}function Ie(p,d,C){return d.f=d.block=C,C(p,d)}function $e(p){return!p||!/\S/.test(p.string)}function Se(p){if(p.linkTitle=!1,p.linkHref=!1,p.linkText=!1,p.em=!1,p.strong=!1,p.strikethrough=!1,p.quote=0,p.indentedCode=!1,p.f==Ve){var d=fe;if(!d){var C=H.innerMode(we,p.htmlState);d=C.mode.name=="xml"&&C.state.tagStart===null&&!C.state.context&&C.state.tokenize.isInText}d&&(p.f=ye,p.block=De,p.htmlState=null)}return p.trailingSpace=0,p.trailingSpaceNewLine=!1,p.prevLine=p.thisLine,p.thisLine={stream:null},null}function De(p,d){var C=p.column()===d.indentation,F=$e(d.prevLine.stream),J=d.indentedCode,xe=d.prevLine.hr,Me=d.list!==!1,ge=(d.listStack[d.listStack.length-1]||0)+3;d.indentedCode=!1;var ve=d.indentation;if(d.indentationDiff===null&&(d.indentationDiff=d.indentation,Me)){for(d.list=null;ve<d.listStack[d.listStack.length-1];)d.listStack.pop(),d.listStack.length?d.indentation=d.listStack[d.listStack.length-1]:d.list=!1;d.list!==!1&&(d.indentationDiff=ve-d.listStack[d.listStack.length-1])}var me=!F&&!xe&&!d.prevLine.header&&(!Me||!J)&&!d.prevLine.fencedCodeEnd,ue=(d.list===!1||xe||F)&&d.indentation<=ge&&p.match(B),q=null;if(d.indentationDiff>=4&&(J||d.prevLine.fencedCodeEnd||d.prevLine.header||F))return p.skipToEnd(),d.indentedCode=!0,T.code;if(p.eatSpace())return null;if(C&&d.indentation<=ge&&(q=p.match(E))&&q[1].length<=6)return d.quote=0,d.header=q[1].length,d.thisLine.header=!0,ne.highlightFormatting&&(d.formatting="header"),d.f=d.inline,Te(d);if(d.indentation<=ge&&p.eat(">"))return d.quote=C?1:d.quote+1,ne.highlightFormatting&&(d.formatting="quote"),p.eatSpace(),Te(d);if(!ue&&!d.setext&&C&&d.indentation<=ge&&(q=p.match(_))){var G=q[1]?"ol":"ul";return d.indentation=ve+p.current().length,d.list=!0,d.quote=0,d.listStack.push(d.indentation),d.em=!1,d.strong=!1,d.code=!1,d.strikethrough=!1,ne.taskLists&&p.match(L,!1)&&(d.taskList=!0),d.f=d.inline,ne.highlightFormatting&&(d.formatting=["list","list-"+G]),Te(d)}else{if(C&&d.indentation<=ge&&(q=p.match(U,!0)))return d.quote=0,d.fencedEndRE=new RegExp(q[1]+"+ *$"),d.localMode=ne.fencedCodeBlockHighlighting&&z(q[2]||ne.fencedCodeBlockDefaultMode),d.localMode&&(d.localState=H.startState(d.localMode)),d.f=d.block=ke,ne.highlightFormatting&&(d.formatting="code-block"),d.code=-1,Te(d);if(d.setext||(!me||!Me)&&!d.quote&&d.list===!1&&!d.code&&!ue&&!Z.test(p.string)&&(q=p.lookAhead(1))&&(q=q.match(te)))return d.setext?(d.header=d.setext,d.setext=0,p.skipToEnd(),ne.highlightFormatting&&(d.formatting="header")):(d.header=q[0].charAt(0)=="="?1:2,d.setext=d.header),d.thisLine.header=!0,d.f=d.inline,Te(d);if(ue)return p.skipToEnd(),d.hr=!0,d.thisLine.hr=!0,T.hr;if(p.peek()==="[")return ae(p,d,j)}return ae(p,d,d.inline)}function Ve(p,d){var C=we.token(p,d.htmlState);if(!fe){var F=H.innerMode(we,d.htmlState);(F.mode.name=="xml"&&F.state.tagStart===null&&!F.state.context&&F.state.tokenize.isInText||d.md_inside&&p.current().indexOf(">")>-1)&&(d.f=ye,d.block=De,d.htmlState=null)}return C}function ke(p,d){var C=d.listStack[d.listStack.length-1]||0,F=d.indentation<C,J=C+3;if(d.fencedEndRE&&d.indentation<=J&&(F||p.match(d.fencedEndRE))){ne.highlightFormatting&&(d.formatting="code-block");var xe;return F||(xe=Te(d)),d.localMode=d.localState=null,d.block=De,d.f=ye,d.fencedEndRE=null,d.code=0,d.thisLine.fencedCodeEnd=!0,F?Ie(p,d,d.block):xe}else return d.localMode?d.localMode.token(p,d.localState):(p.skipToEnd(),T.code)}function Te(p){var d=[];if(p.formatting){d.push(T.formatting),typeof p.formatting=="string"&&(p.formatting=[p.formatting]);for(var C=0;C<p.formatting.length;C++)d.push(T.formatting+"-"+p.formatting[C]),p.formatting[C]==="header"&&d.push(T.formatting+"-"+p.formatting[C]+"-"+p.header),p.formatting[C]==="quote"&&(!ne.maxBlockquoteDepth||ne.maxBlockquoteDepth>=p.quote?d.push(T.formatting+"-"+p.formatting[C]+"-"+p.quote):d.push("error"))}if(p.taskOpen)return d.push("meta"),d.length?d.join(" "):null;if(p.taskClosed)return d.push("property"),d.length?d.join(" "):null;if(p.linkHref?d.push(T.linkHref,"url"):(p.strong&&d.push(T.strong),p.em&&d.push(T.em),p.strikethrough&&d.push(T.strikethrough),p.emoji&&d.push(T.emoji),p.linkText&&d.push(T.linkText),p.code&&d.push(T.code),p.image&&d.push(T.image),p.imageAltText&&d.push(T.imageAltText,"link"),p.imageMarker&&d.push(T.imageMarker)),p.header&&d.push(T.header,T.header+"-"+p.header),p.quote&&(d.push(T.quote),!ne.maxBlockquoteDepth||ne.maxBlockquoteDepth>=p.quote?d.push(T.quote+"-"+p.quote):d.push(T.quote+"-"+ne.maxBlockquoteDepth)),p.list!==!1){var F=(p.listStack.length-1)%3;F?F===1?d.push(T.list2):d.push(T.list3):d.push(T.list1)}return p.trailingSpaceNewLine?d.push("trailing-space-new-line"):p.trailingSpace&&d.push("trailing-space-"+(p.trailingSpace%2?"a":"b")),d.length?d.join(" "):null}function Pe(p,d){return p.match(Q,!0)?Te(d):void 0}function ye(p,d){var C=d.text(p,d);if(typeof C!="undefined")return C;if(d.list)return d.list=null,Te(d);if(d.taskList){var F=p.match(L,!0)[1]===" ";return F?d.taskOpen=!0:d.taskClosed=!0,ne.highlightFormatting&&(d.formatting="task"),d.taskList=!1,Te(d)}if(d.taskOpen=!1,d.taskClosed=!1,d.header&&p.match(/^#+$/,!0))return ne.highlightFormatting&&(d.formatting="header"),Te(d);var J=p.next();if(d.linkTitle){d.linkTitle=!1;var xe=J;J==="("&&(xe=")"),xe=(xe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Me="^\\s*(?:[^"+xe+"\\\\]+|\\\\\\\\|\\\\.)"+xe;if(p.match(new RegExp(Me),!0))return T.linkHref}if(J==="`"){var ge=d.formatting;ne.highlightFormatting&&(d.formatting="code"),p.eatWhile("`");var ve=p.current().length;if(d.code==0&&(!d.quote||ve==1))return d.code=ve,Te(d);if(ve==d.code){var me=Te(d);return d.code=0,me}else return d.formatting=ge,Te(d)}else if(d.code)return Te(d);if(J==="\\"&&(p.next(),ne.highlightFormatting)){var ue=Te(d),q=T.formatting+"-escape";return ue?ue+" "+q:q}if(J==="!"&&p.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return d.imageMarker=!0,d.image=!0,ne.highlightFormatting&&(d.formatting="image"),Te(d);if(J==="["&&d.imageMarker&&p.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return d.imageMarker=!1,d.imageAltText=!0,ne.highlightFormatting&&(d.formatting="image"),Te(d);if(J==="]"&&d.imageAltText){ne.highlightFormatting&&(d.formatting="image");var ue=Te(d);return d.imageAltText=!1,d.image=!1,d.inline=d.f=de,ue}if(J==="["&&!d.image)return d.linkText&&p.match(/^.*?\]/)||(d.linkText=!0,ne.highlightFormatting&&(d.formatting="link")),Te(d);if(J==="]"&&d.linkText){ne.highlightFormatting&&(d.formatting="link");var ue=Te(d);return d.linkText=!1,d.inline=d.f=p.match(/\(.*?\)| ?\[.*?\]/,!1)?de:ye,ue}if(J==="<"&&p.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=M,ne.highlightFormatting&&(d.formatting="link");var ue=Te(d);return ue?ue+=" ":ue="",ue+T.linkInline}if(J==="<"&&p.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=M,ne.highlightFormatting&&(d.formatting="link");var ue=Te(d);return ue?ue+=" ":ue="",ue+T.linkEmail}if(ne.xml&&J==="<"&&p.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var G=p.string.indexOf(">",p.pos);if(G!=-1){var b=p.string.substring(p.start,G);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(d.md_inside=!0)}return p.backUp(1),d.htmlState=H.startState(we),Ie(p,d,Ve)}if(ne.xml&&J==="<"&&p.match(/^\/\w*?>/))return d.md_inside=!1,"tag";if(J==="*"||J==="_"){for(var X=1,O=p.pos==1?" ":p.string.charAt(p.pos-2);X<3&&p.eat(J);)X++;var be=p.peek()||" ",Ee=!/\s/.test(be)&&(!W.test(be)||/\s/.test(O)||W.test(O)),re=!/\s/.test(O)&&(!W.test(O)||/\s/.test(be)||W.test(be)),_e=null,Ue=null;if(X%2&&(!d.em&&Ee&&(J==="*"||!re||W.test(O))?_e=!0:d.em==J&&re&&(J==="*"||!Ee||W.test(be))&&(_e=!1)),X>1&&(!d.strong&&Ee&&(J==="*"||!re||W.test(O))?Ue=!0:d.strong==J&&re&&(J==="*"||!Ee||W.test(be))&&(Ue=!1)),Ue!=null||_e!=null){ne.highlightFormatting&&(d.formatting=_e==null?"strong":Ue==null?"em":"strong em"),_e===!0&&(d.em=J),Ue===!0&&(d.strong=J);var me=Te(d);return _e===!1&&(d.em=!1),Ue===!1&&(d.strong=!1),me}}else if(J===" "&&(p.eat("*")||p.eat("_"))){if(p.peek()===" ")return Te(d);p.backUp(1)}if(ne.strikethrough){if(J==="~"&&p.eatWhile(J)){if(d.strikethrough){ne.highlightFormatting&&(d.formatting="strikethrough");var me=Te(d);return d.strikethrough=!1,me}else if(p.match(/^[^\s]/,!1))return d.strikethrough=!0,ne.highlightFormatting&&(d.formatting="strikethrough"),Te(d)}else if(J===" "&&p.match(/^~~/,!0)){if(p.peek()===" ")return Te(d);p.backUp(2)}}if(ne.emoji&&J===":"&&p.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){d.emoji=!0,ne.highlightFormatting&&(d.formatting="emoji");var Ke=Te(d);return d.emoji=!1,Ke}return J===" "&&(p.match(/^ +$/,!1)?d.trailingSpace++:d.trailingSpace&&(d.trailingSpaceNewLine=!0)),Te(d)}function M(p,d){var C=p.next();if(C===">"){d.f=d.inline=ye,ne.highlightFormatting&&(d.formatting="link");var F=Te(d);return F?F+=" ":F="",F+T.linkInline}return p.match(/^[^>]+/,!0),T.linkInline}function de(p,d){if(p.eatSpace())return null;var C=p.next();return C==="("||C==="["?(d.f=d.inline=w(C==="("?")":"]"),ne.highlightFormatting&&(d.formatting="link-string"),d.linkHref=!0,Te(d)):"error"}var ie={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function w(p){return function(d,C){var F=d.next();if(F===p){C.f=C.inline=ye,ne.highlightFormatting&&(C.formatting="link-string");var J=Te(C);return C.linkHref=!1,J}return d.match(ie[p]),C.linkHref=!0,Te(C)}}function j(p,d){return p.match(/^([^\]\\]|\\.)*\]:/,!1)?(d.f=P,p.next(),ne.highlightFormatting&&(d.formatting="link"),d.linkText=!0,Te(d)):ae(p,d,ye)}function P(p,d){if(p.match(/^\]:/,!0)){d.f=d.inline=S,ne.highlightFormatting&&(d.formatting="link");var C=Te(d);return d.linkText=!1,C}return p.match(/^([^\]\\]|\\.)+/,!0),T.linkText}function S(p,d){return p.eatSpace()?null:(p.match(/^[^\s]+/,!0),p.peek()===void 0?d.linkTitle=!0:p.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),d.f=d.inline=ye,T.linkHref+" url")}var D={startState:function(){return{f:De,prevLine:{stream:null},thisLine:{stream:null},block:De,htmlState:null,indentation:0,inline:ye,text:Pe,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(p){return{f:p.f,prevLine:p.prevLine,thisLine:p.thisLine,block:p.block,htmlState:p.htmlState&&H.copyState(we,p.htmlState),indentation:p.indentation,localMode:p.localMode,localState:p.localMode?H.copyState(p.localMode,p.localState):null,inline:p.inline,text:p.text,formatting:!1,linkText:p.linkText,linkTitle:p.linkTitle,linkHref:p.linkHref,code:p.code,em:p.em,strong:p.strong,strikethrough:p.strikethrough,emoji:p.emoji,header:p.header,setext:p.setext,hr:p.hr,taskList:p.taskList,list:p.list,listStack:p.listStack.slice(0),quote:p.quote,indentedCode:p.indentedCode,trailingSpace:p.trailingSpace,trailingSpaceNewLine:p.trailingSpaceNewLine,md_inside:p.md_inside,fencedEndRE:p.fencedEndRE}},token:function(p,d){if(d.formatting=!1,p!=d.thisLine.stream){if(d.header=0,d.hr=!1,p.match(/^\s*$/,!0))return Se(d),null;if(d.prevLine=d.thisLine,d.thisLine={stream:p},d.taskList=!1,d.trailingSpace=0,d.trailingSpaceNewLine=!1,!d.localState&&(d.f=d.block,d.f!=Ve)){var C=p.match(/^\s*/,!0)[0].replace(/\t/g,ce).length;if(d.indentation=C,d.indentationDiff=null,C>0)return null}}return d.f(p,d)},innerMode:function(p){return p.block==Ve?{state:p.htmlState,mode:we}:p.localState?{state:p.localState,mode:p.localMode}:{state:p,mode:D}},indent:function(p,d,C){return p.block==Ve&&we.indent?we.indent(p.htmlState,d,C):p.localState&&p.localMode.indent?p.localMode.indent(p.localState,d,C):H.Pass},blankLine:Se,getType:Te,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return D},"xml"),H.defineMIME("text/markdown","markdown"),H.defineMIME("text/x-markdown","markdown")})},nVVt:function(ot,Qe){ot.exports={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3}},osHv:function(ot,Qe,k){(function(H){H(k("VrN/"))})(function(H){"use strict";var se=H.Pos;function ne(W,ce){return W.line-ce.line||W.ch-ce.ch}var we="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",fe=we+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",z=new RegExp("<(/?)(["+we+"]["+fe+"]*)","g");function T(W,ce,ae,Ie){this.line=ce,this.ch=ae,this.cm=W,this.text=W.getLine(ce),this.min=Ie?Math.max(Ie.from,W.firstLine()):W.firstLine(),this.max=Ie?Math.min(Ie.to-1,W.lastLine()):W.lastLine()}function R(W,ce){var ae=W.cm.getTokenTypeAt(se(W.line,ce));return ae&&/\btag\b/.test(ae)}function B(W){return W.line>=W.max?void 0:(W.ch=0,W.text=W.cm.getLine(++W.line),!0)}function _(W){return W.line<=W.min?void 0:(W.text=W.cm.getLine(--W.line),W.ch=W.text.length,!0)}function L(W){for(;;){var ce=W.text.indexOf(">",W.ch);if(ce==-1){if(B(W))continue;return}if(!R(W,ce+1)){W.ch=ce+1;continue}var ae=W.text.lastIndexOf("/",ce),Ie=ae>-1&&!/\S/.test(W.text.slice(ae+1,ce));return W.ch=ce+1,Ie?"selfClose":"regular"}}function E(W){for(;;){var ce=W.ch?W.text.lastIndexOf("<",W.ch-1):-1;if(ce==-1){if(_(W))continue;return}if(!R(W,ce+1)){W.ch=ce;continue}z.lastIndex=ce,W.ch=ce;var ae=z.exec(W.text);if(ae&&ae.index==ce)return ae}}function te(W){for(;;){z.lastIndex=W.ch;var ce=z.exec(W.text);if(!ce){if(B(W))continue;return}if(!R(W,ce.index+1)){W.ch=ce.index+1;continue}return W.ch=ce.index+ce[0].length,ce}}function Q(W){for(;;){var ce=W.ch?W.text.lastIndexOf(">",W.ch-1):-1;if(ce==-1){if(_(W))continue;return}if(!R(W,ce+1)){W.ch=ce;continue}var ae=W.text.lastIndexOf("/",ce),Ie=ae>-1&&!/\S/.test(W.text.slice(ae+1,ce));return W.ch=ce+1,Ie?"selfClose":"regular"}}function U(W,ce){for(var ae=[];;){var Ie=te(W),$e,Se=W.line,De=W.ch-(Ie?Ie[0].length:0);if(!Ie||!($e=L(W)))return;if($e=="selfClose")continue;if(Ie[1]){for(var Ve=ae.length-1;Ve>=0;--Ve)if(ae[Ve]==Ie[2]){ae.length=Ve;break}if(Ve<0&&(!ce||ce==Ie[2]))return{tag:Ie[2],from:se(Se,De),to:se(W.line,W.ch)}}else ae.push(Ie[2])}}function Z(W,ce){for(var ae=[];;){var Ie=Q(W);if(!Ie)return;if(Ie=="selfClose"){E(W);continue}var $e=W.line,Se=W.ch,De=E(W);if(!De)return;if(De[1])ae.push(De[2]);else{for(var Ve=ae.length-1;Ve>=0;--Ve)if(ae[Ve]==De[2]){ae.length=Ve;break}if(Ve<0&&(!ce||ce==De[2]))return{tag:De[2],from:se(W.line,W.ch),to:se($e,Se)}}}}H.registerHelper("fold","xml",function(W,ce){for(var ae=new T(W,ce.line,0);;){var Ie=te(ae);if(!Ie||ae.line!=ce.line)return;var $e=L(ae);if(!$e)return;if(!Ie[1]&&$e!="selfClose"){var Se=se(ae.line,ae.ch),De=U(ae,Ie[2]);return De&&ne(De.from,Se)>0?{from:Se,to:De.from}:null}}}),H.findMatchingTag=function(W,ce,ae){var Ie=new T(W,ce.line,ce.ch,ae);if(Ie.text.indexOf(">")==-1&&Ie.text.indexOf("<")==-1)return;var $e=L(Ie),Se=$e&&se(Ie.line,Ie.ch),De=$e&&E(Ie);if(!$e||!De||ne(Ie,ce)>0)return;var Ve={from:se(Ie.line,Ie.ch),to:Se,tag:De[2]};return $e=="selfClose"?{open:Ve,close:null,at:"open"}:De[1]?{open:Z(Ie,De[2]),close:Ve,at:"close"}:(Ie=new T(W,Se.line,Se.ch,ae),{open:Ve,close:U(Ie,De[2]),at:"open"})},H.findEnclosingTag=function(W,ce,ae,Ie){for(var $e=new T(W,ce.line,ce.ch,ae);;){var Se=Z($e,Ie);if(!Se)break;var De=new T(W,ce.line,ce.ch,ae),Ve=U(De,Se.tag);if(Ve)return{open:Se,close:Ve}}},H.scanForClosingTag=function(W,ce,ae,Ie){var $e=new T(W,ce.line,ce.ch,Ie?{from:0,to:Ie}:null);return U($e,ae)}})},p5ED:function(ot,Qe,k){"use strict";var H=k("+L6B"),se=k("2/Rp"),ne=k("5Dmo"),we=k("3S7+"),fe=k("k1fw"),z=k("tJVT"),T=k("q1tI"),R=k.n(T),B=k("vHTk"),_=k.n(B),L=k("yEEn"),E=k("ZW9T"),te=k("1vsH"),Q=k("m3rI");Qe.a=function(U){var Z=U.name,W=U.data,ce=U.theme,ae=U.type,Ie=U.filename,$e=U.monacoEditor,Se=U.className,De=U.style,Ve=U.close,ke=U.onClose,Te=U.hasMask,Pe=U.otherData,ye=Object(T.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),M=Object(z.a)(ye,2),de=M[0],ie=M[1],w=Object(T.useState)(""),j=Object(z.a)(w,2),P=j[0],S=j[1],D,p=1024*1024,d=10*p,C=Object(T.useRef)();ae==="office"&&(D=Object(te.R)(W).filesize,D>d&&(ae="other")),Ie&&($e.filename=Ie),Object(T.useEffect)(function(){var xe,Me,ge=(xe=document.cookie)===null||xe===void 0||((Me=xe.replace(/\s/g,""))===null||Me===void 0)?void 0:Me.split(";");ge==null||ge.map(function(ve){var me=ve.split("=");me[0]==="_educoder_session"&&S(me[1])})},[]);var F=function(){if(W.startsWith("http")||W.startsWith("blob:")){J();return}Object(te.x)(Ie||"educoder",W,Ie)},J=function(){Object(te.v)(Ie||"educoder",decodeURIComponent(W))};return R.a.createElement("div",{style:Object(fe.a)({},De||{}),className:"".concat(Te&&_.a.bgBlack," ").concat(ae?_.a.wrp:"hide")},Ve&&R.a.createElement("div",{className:_.a.close,ref:C},R.a.createElement(we.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return C.current}},R.a.createElement("span",{onClick:J},R.a.createElement("i",{className:"icon-quxiaozhiding"}))),R.a.createElement(we.a,{title:"\u5173\u95ED",getPopupContainer:function(){return C.current}},R.a.createElement("span",{className:"",onClick:ke},R.a.createElement("i",{className:"icon-guanbi1"})))),R.a.createElement("div",{className:"".concat(_.a[Se]," ").concat(Se," ").concat(_.a.monaco," ").concat(ae==="txt"?"show":"hide")},ae==="txt"&&R.a.createElement(E.b,$e)),ae==="audio"&&R.a.createElement("audio",{src:"".concat((W==null?void 0:W.indexOf("http://"))>-1||(W==null?void 0:W.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(W),autoPlay:!0}),ae==="video"&&R.a.createElement(R.a.Fragment,null,(W==null?void 0:W.indexOf("http"))>-1?R.a.createElement("video",{controls:!0,src:"".concat(W),autoPlay:!0}):R.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(W),autoPlay:!0})),ae==="office"&&R.a.createElement("iframe",{src:"https://view.officeapps.live.com/op/embed.aspx?src=".concat(W,"?").concat(encodeURIComponent("disposition=office&token=".concat(P)))}),(ae==="xlsx"||ae==="doc"||ae==="pptx"||ae==="docx")&&R.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(Pe.key,"&url=").concat(Q.a.API_SERVER+Pe.url,"&callbackUrl=").concat(Q.a.API_SERVER+Pe.callbackUrl,"&fileType=").concat(Pe.fileType,"&title=").concat(Pe.title,"&model=").concat(Pe.model)}),ae==="html"&&R.a.createElement("iframe",{src:W+"&disposition=inline"}),ae==="pdf"&&R.a.createElement("embed",{className:_.a.embed,src:W,type:"application/pdf"}),ae==="image"&&R.a.createElement("img",{src:"".concat((W==null?void 0:W.indexOf("http://"))>-1||(W==null?void 0:W.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(W)}),ae==="other"&&R.a.createElement("div",null,R.a.createElement(se.a,{type:"primary",size:"large",onClick:F},R.a.createElement(L.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),ae==="download"&&R.a.createElement(se.a,{type:"primary",size:"large",onClick:F},R.a.createElement(L.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(ot,Qe,k){},"rAM+":function(ot,Qe,k){"use strict";k.d(Qe,"a",function(){return se});var H=k("Qw5x");function se(ne,we){var fe;if(typeof Symbol=="undefined"||ne[Symbol.iterator]==null){if(Array.isArray(ne)||(fe=Object(H.a)(ne))||we&&ne&&typeof ne.length=="number"){fe&&(ne=fe);var z=0,T=function(){};return{s:T,n:function(){return z>=ne.length?{done:!0}:{done:!1,value:ne[z++]}},e:function(E){throw E},f:T}}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 R=!0,B=!1,_;return{s:function(){fe=ne[Symbol.iterator]()},n:function(){var E=fe.next();return R=E.done,E},e:function(E){B=!0,_=E},f:function(){try{!R&&fe.return!=null&&fe.return()}finally{if(B)throw _}}}}},rUJ1:function(ot,Qe){const k=/[&<>"']/,H=/[&<>"']/g,se=/[<>"']|&(?!#?\w+;)/,ne=/[<>"']|&(?!#?\w+;)/g,we={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},fe=ke=>we[ke];function z(ke,Te){if(Te){if(k.test(ke))return ke.replace(H,fe)}else if(se.test(ke))return ke.replace(ne,fe);return ke}const T=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function R(ke){return ke.replace(T,(Te,Pe)=>(Pe=Pe.toLowerCase(),Pe==="colon"?":":Pe.charAt(0)==="#"?Pe.charAt(1)==="x"?String.fromCharCode(parseInt(Pe.substring(2),16)):String.fromCharCode(+Pe.substring(1)):""))}const B=/(^|[^\[])\^/g;function _(ke,Te){ke=ke.source||ke,Te=Te||"";const Pe={replace:(ye,M)=>(M=M.source||M,M=M.replace(B,"$1"),ke=ke.replace(ye,M),Pe),getRegex:()=>new RegExp(ke,Te)};return Pe}const L=/[^\w:]/g,E=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function te(ke,Te,Pe){if(ke){let ye;try{ye=decodeURIComponent(R(Pe)).replace(L,"").toLowerCase()}catch(M){return null}if(ye.indexOf("javascript:")===0||ye.indexOf("vbscript:")===0||ye.indexOf("data:")===0)return null}Te&&!E.test(Pe)&&(Pe=ce(Te,Pe));try{Pe=encodeURI(Pe).replace(/%25/g,"%")}catch(ye){return null}return Pe}const Q={},U=/^[^:]+:\/*[^/]*$/,Z=/^([^:]+:)[\s\S]*$/,W=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ce(ke,Te){Q[" "+ke]||(U.test(ke)?Q[" "+ke]=ke+"/":Q[" "+ke]=Se(ke,"/",!0)),ke=Q[" "+ke];const Pe=ke.indexOf(":")===-1;return Te.substring(0,2)==="//"?Pe?Te:ke.replace(Z,"$1")+Te:Te.charAt(0)==="/"?Pe?Te:ke.replace(W,"$1")+Te:ke+Te}const ae={exec:function(){}};function Ie(ke){let Te=1,Pe,ye;for(;Te<arguments.length;Te++){Pe=arguments[Te];for(ye in Pe)Object.prototype.hasOwnProperty.call(Pe,ye)&&(ke[ye]=Pe[ye])}return ke}function $e(ke,Te){const Pe=ke.replace(/\|/g,(de,ie,w)=>{let j=!1,P=ie;for(;--P>=0&&w[P]==="\\";)j=!j;return j?"|":" |"}),ye=Pe.split(/ \|/);let M=0;if(ye.length>Te)ye.splice(Te);else for(;ye.length<Te;)ye.push("");for(;M<ye.length;M++)ye[M]=ye[M].trim().replace(/\\\|/g,"|");return ye}function Se(ke,Te,Pe){const ye=ke.length;if(ye===0)return"";let M=0;for(;M<ye;){const de=ke.charAt(ye-M-1);if(de===Te&&!Pe)M++;else if(de!==Te&&Pe)M++;else break}return ke.substr(0,ye-M)}function De(ke,Te){if(ke.indexOf(Te[1])===-1)return-1;const Pe=ke.length;let ye=0,M=0;for(;M<Pe;M++)if(ke[M]==="\\")M++;else if(ke[M]===Te[0])ye++;else if(ke[M]===Te[1]&&(ye--,ye<0))return M;return-1}function Ve(ke){ke&&ke.sanitize&&!ke.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")}ot.exports={escape:z,unescape:R,edit:_,cleanUrl:te,resolveUrl:ce,noopTest:ae,merge:Ie,splitCells:$e,rtrim:Se,findClosingBracket:De,checkSanitizeDeprecation:Ve}},rcnY:function(ot,Qe,k){var H=k("aRTE");function se(ne,we){this.totalCount=ne,this.dataCount=we}se.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]],se.getRSBlocks=function(ne,we){var fe=se.getRsBlockTable(ne,we);if(fe==null)throw new Error("bad rs block @ typeNumber:"+ne+"/errorCorrectLevel:"+we);for(var z=fe.length/3,T=new Array,R=0;R<z;R++)for(var B=fe[R*3+0],_=fe[R*3+1],L=fe[R*3+2],E=0;E<B;E++)T.push(new se(_,L));return T},se.getRsBlockTable=function(ne,we){switch(we){case H.L:return se.RS_BLOCK_TABLE[(ne-1)*4+0];case H.M:return se.RS_BLOCK_TABLE[(ne-1)*4+1];case H.Q:return se.RS_BLOCK_TABLE[(ne-1)*4+2];case H.H:return se.RS_BLOCK_TABLE[(ne-1)*4+3];default:return}},ot.exports=se},vHTk:function(ot,Qe,k){ot.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wU8J:function(ot,Qe){function k(){this.buffer=new Array,this.length=0}k.prototype={get:function(H){var se=Math.floor(H/8);return(this.buffer[se]>>>7-H%8&1)==1},put:function(H,se){for(var ne=0;ne<se;ne++)this.putBit((H>>>se-ne-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(H){var se=Math.floor(this.length/8);this.buffer.length<=se&&this.buffer.push(0),H&&(this.buffer[se]|=128>>>this.length%8),this.length++}},ot.exports=k}}]);