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.
350 lines
641 KiB
350 lines
641 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[237,6,7,17],{"+NIl":function(et,Ze,v){(function(H){H(v("VrN/"))})(function(H){"use strict";H.defineMode("stex",function(se,re){"use strict";function ue(Z,B){Z.cmdState.push(B)}function D(Z){return Z.cmdState.length>0?Z.cmdState[Z.cmdState.length-1]:null}function z(Z){var B=Z.cmdState.pop();B&&B.closeBracket()}function k(Z){for(var B=Z.cmdState,J=B.length-1;J>=0;J--){var F=B[J];if(F.name=="DEFAULT")continue;return F}return{styleIdentifier:function(){return null}}}function E(Z,B,J){return function(){this.name=Z,this.bracketNo=0,this.style=B,this.styles=J,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var I={};I.importmodule=E("importmodule","tag",["string","builtin"]),I.documentclass=E("documentclass","tag",["","atom"]),I.usepackage=E("usepackage","tag",["atom"]),I.begin=E("begin","tag",["atom"]),I.end=E("end","tag",["atom"]),I.label=E("label","tag",["atom"]),I.ref=E("ref","tag",["atom"]),I.eqref=E("eqref","tag",["atom"]),I.cite=E("cite","tag",["atom"]),I.bibitem=E("bibitem","tag",["atom"]),I.Bibitem=E("Bibitem","tag",["atom"]),I.RBibitem=E("RBibitem","tag",["atom"]),I.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function T(Z,B){Z.f=B}function R(Z,B){var J;if(Z.match(/^\\[a-zA-Z@]+/)){var F=Z.current().slice(1);return J=I.hasOwnProperty(F)?I[F]:I.DEFAULT,J=new J,ue(B,J),T(B,te),J.style}if(Z.match(/^\\[$&%#{}_]/))return"tag";if(Z.match(/^\\[,;!\/\\]/))return"tag";if(Z.match("\\["))return T(B,function(ne,Pe){return C(ne,Pe,"\\]")}),"keyword";if(Z.match("\\("))return T(B,function(ne,Pe){return C(ne,Pe,"\\)")}),"keyword";if(Z.match("$$"))return T(B,function(ne,Pe){return C(ne,Pe,"$$")}),"keyword";if(Z.match("$"))return T(B,function(ne,Pe){return C(ne,Pe,"$")}),"keyword";var ce=Z.next();if(ce=="%")return Z.skipToEnd(),"comment";if(ce=="}"||ce=="]"){if(J=D(B),J)J.closeBracket(ce),T(B,te);else return"error";return"bracket"}else return ce=="{"||ce=="["?(J=I.DEFAULT,J=new J,ue(B,J),"bracket"):/\d/.test(ce)?(Z.eatWhile(/[\w.%]/),"atom"):(Z.eatWhile(/[\w\-_]/),J=k(B),J.name=="begin"&&(J.argument=Z.current()),J.styleIdentifier())}function C(Z,B,J){if(Z.eatSpace())return null;if(J&&Z.match(J))return T(B,R),"keyword";if(Z.match(/^\\[a-zA-Z@]+/))return"tag";if(Z.match(/^[a-zA-Z]+/))return"variable-2";if(Z.match(/^\\[$&%#{}_]/))return"tag";if(Z.match(/^\\[,;!\/]/))return"tag";if(Z.match(/^[\^_&]/))return"tag";if(Z.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(Z.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var F=Z.next();return F=="{"||F=="}"||F=="["||F=="]"||F=="("||F==")"?"bracket":F=="%"?(Z.skipToEnd(),"comment"):"error"}function te(Z,B){var J=Z.peek(),F;return J=="{"||J=="["?(F=D(B),F.openBracket(J),Z.eat(J),T(B,R),"bracket"):/[ \t\r]/.test(J)?(Z.eat(J),null):(T(B,R),z(B),R(Z,B))}return{startState:function(){var Z=re.inMathMode?function(B,J){return C(B,J)}:R;return{cmdState:[],f:Z}},copyState:function(Z){return{cmdState:Z.cmdState.slice(),f:Z.f}},token:function(Z,B){return B.f(Z,B)},blankLine:function(Z){Z.f=R,Z.cmdState.length=0},lineComment:"%"}}),H.defineMIME("text/x-stex","stex"),H.defineMIME("text/x-latex","stex")})},"19Vz":function(et,Ze,v){(function(H){H(v("VrN/"))})(function(H){H.defineOption("placeholder","",function(E,I,T){var R=T&&T!=H.Init;if(I&&!R)E.on("blur",D),E.on("change",z),E.on("swapDoc",z),H.on(E.getInputField(),"compositionupdate",E.state.placeholderCompose=function(){ue(E)}),z(E);else if(!I&&R){E.off("blur",D),E.off("change",z),E.off("swapDoc",z),H.off(E.getInputField(),"compositionupdate",E.state.placeholderCompose),se(E);var C=E.getWrapperElement();C.className=C.className.replace(" CodeMirror-empty","")}I&&!E.hasFocus()&&D(E)});function se(E){E.state.placeholder&&(E.state.placeholder.parentNode.removeChild(E.state.placeholder),E.state.placeholder=null)}function re(E){se(E);var I=E.state.placeholder=document.createElement("pre");I.style.cssText="height: 0; overflow: visible",I.style.direction=E.getOption("direction"),I.className="CodeMirror-placeholder CodeMirror-line-like";var T=E.getOption("placeholder");typeof T=="string"&&(T=document.createTextNode(T)),I.appendChild(T),E.display.lineSpace.insertBefore(I,E.display.lineSpace.firstChild)}function ue(E){setTimeout(function(){var I=!1,T=E.getInputField();T.nodeName=="TEXTAREA"?I=!T.value:E.lineCount()==1&&(I=!/[^\u200b]/.test(T.querySelector(".CodeMirror-line").textContent)),I?re(E):se(E)},20)}function D(E){k(E)&&re(E)}function z(E){var I=E.getWrapperElement(),T=k(E);I.className=I.className.replace(" CodeMirror-empty","")+(T?" CodeMirror-empty":""),T?re(E):se(E)}function k(E){return E.lineCount()===1&&E.getLine(0)===""}})},"1eCo":function(et,Ze,v){(function(H){H(v("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},re={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};H.defineMode("xml",function(ue,D){var z=ue.indentUnit,k={},E=D.htmlMode?se:re;for(var I in E)k[I]=E[I];for(var I in D)k[I]=D[I];var T,R;function C(O,de){function Q(j){return de.tokenize=j,j(O,de)}var _=O.next();if(_=="<")return O.eat("!")?O.eat("[")?O.match("CDATA[")?Q(B("atom","]]>")):null:O.match("--")?Q(B("comment","-->")):O.match("DOCTYPE",!0,!0)?(O.eatWhile(/[\w\._\-]/),Q(J(1))):null:O.eat("?")?(O.eatWhile(/[\w\._\-]/),de.tokenize=B("meta","?>"),"meta"):(T=O.eat("/")?"closeTag":"openTag",de.tokenize=te,"tag bracket");if(_=="&"){var W;return O.eat("#")?O.eat("x")?W=O.eatWhile(/[a-fA-F\d]/)&&O.eat(";"):W=O.eatWhile(/[\d]/)&&O.eat(";"):W=O.eatWhile(/[\w\.\-:]/)&&O.eat(";"),W?"atom":"error"}else return O.eatWhile(/[^&<]/),null}C.isInText=!0;function te(O,de){var Q=O.next();if(Q==">"||Q=="/"&&O.eat(">"))return de.tokenize=C,T=Q==">"?"endTag":"selfcloseTag","tag bracket";if(Q=="=")return T="equals",null;if(Q=="<"){de.tokenize=C,de.state=Pe,de.tagName=de.tagStart=null;var _=de.tokenize(O,de);return _?_+" tag error":"tag error"}else return/[\'\"]/.test(Q)?(de.tokenize=Z(Q),de.stringStartCol=O.column(),de.tokenize(O,de)):(O.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Z(O){var de=function(Q,_){for(;!Q.eol();)if(Q.next()==O){_.tokenize=te;break}return"string"};return de.isInAttribute=!0,de}function B(O,de){return function(Q,_){for(;!Q.eol();){if(Q.match(de)){_.tokenize=C;break}Q.next()}return O}}function J(O){return function(de,Q){for(var _;(_=de.next())!=null;){if(_=="<")return Q.tokenize=J(O+1),Q.tokenize(de,Q);if(_==">")if(O==1){Q.tokenize=C;break}else return Q.tokenize=J(O-1),Q.tokenize(de,Q)}return"meta"}}function F(O,de,Q){this.prev=O.context,this.tagName=de,this.indent=O.indented,this.startOfLine=Q,(k.doNotIndent.hasOwnProperty(de)||O.context&&O.context.noIndent)&&(this.noIndent=!0)}function ce(O){O.context&&(O.context=O.context.prev)}function ne(O,de){for(var Q;;){if(!O.context)return;if(Q=O.context.tagName,!k.contextGrabbers.hasOwnProperty(Q)||!k.contextGrabbers[Q].hasOwnProperty(de))return;ce(O)}}function Pe(O,de,Q){return O=="openTag"?(Q.tagStart=de.column(),$e):O=="closeTag"?ye:Pe}function $e(O,de,Q){return O=="word"?(Q.tagName=de.current(),R="tag",xe):k.allowMissingTagName&&O=="endTag"?(R="tag bracket",xe(O,de,Q)):(R="error",$e)}function ye(O,de,Q){if(O=="word"){var _=de.current();return Q.context&&Q.context.tagName!=_&&k.implicitlyClosed.hasOwnProperty(Q.context.tagName)&&ce(Q),Q.context&&Q.context.tagName==_||k.matchClosing===!1?(R="tag",Le):(R="tag error",Fe)}else return k.allowMissingTagName&&O=="endTag"?(R="tag bracket",Le(O,de,Q)):(R="error",Fe)}function Le(O,de,Q){return O!="endTag"?(R="error",Le):(ce(Q),Pe)}function Fe(O,de,Q){return R="error",Le(O,de,Q)}function xe(O,de,Q){if(O=="word")return R="attribute",Se;if(O=="endTag"||O=="selfcloseTag"){var _=Q.tagName,W=Q.tagStart;return Q.tagName=Q.tagStart=null,O=="selfcloseTag"||k.autoSelfClosers.hasOwnProperty(_)?ne(Q,_):(ne(Q,_),Q.context=new F(Q,_,W==Q.indented)),Pe}return R="error",xe}function Se(O,de,Q){return O=="equals"?Oe:(k.allowMissing||(R="error"),xe(O,de,Q))}function Oe(O,de,Q){return O=="string"?Ee:O=="word"&&k.allowUnquoted?(R="string",xe):(R="error",xe(O,de,Q))}function Ee(O,de,Q){return O=="string"?Ee:xe(O,de,Q)}return{startState:function(O){var de={tokenize:C,state:Pe,indented:O||0,tagName:null,tagStart:null,context:null};return O!=null&&(de.baseIndent=O),de},token:function(O,de){if(!de.tagName&&O.sol()&&(de.indented=O.indentation()),O.eatSpace())return null;T=null;var Q=de.tokenize(O,de);return(Q||T)&&Q!="comment"&&(R=null,de.state=de.state(T||Q,O,de),R&&(Q=R=="error"?Q+" error":R)),Q},indent:function(O,de,Q){var _=O.context;if(O.tokenize.isInAttribute)return O.tagStart==O.indented?O.stringStartCol+1:O.indented+z;if(_&&_.noIndent)return H.Pass;if(O.tokenize!=te&&O.tokenize!=C)return Q?Q.match(/^(\s*)/)[0].length:0;if(O.tagName)return k.multilineTagIndentPastTag!==!1?O.tagStart+O.tagName.length+2:O.tagStart+z*(k.multilineTagIndentFactor||1);if(k.alignCDATA&&/<!\[CDATA\[/.test(de))return 0;var W=de&&/^<(\/)?([\w_:\.-]*)/.exec(de);if(W&&W[1])for(;_;)if(_.tagName==W[2]){_=_.prev;break}else if(k.implicitlyClosed.hasOwnProperty(_.tagName))_=_.prev;else break;else if(W)for(;_;){var j=k.contextGrabbers[_.tagName];if(j&&j.hasOwnProperty(W[2]))_=_.prev;else break}for(;_&&_.prev&&!_.startOfLine;)_=_.prev;return _?_.indent+z:O.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:k.htmlMode?"html":"xml",helperType:k.htmlMode?"html":"xml",skipAttribute:function(O){O.state==Oe&&(O.state=xe)},xmlCurrentTag:function(O){return O.tagName?{name:O.tagName,close:O.type=="closeTag"}:null},xmlCurrentContext:function(O){for(var de=[],Q=O.context;Q;Q=Q.prev)Q.tagName&&de.push(Q.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})})},"6f40":function(et,Ze,v){et.exports={practicalTraining:"practicalTraining___14zoU",titleWrap:"titleWrap___2awze",title:"title___3BF26",line:"line___wXl6Y",dec:"dec___ZXNkn"}},"7Cbv":function(et,Ze,v){"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 re(){if(!H)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return H(se)}var ue=/^(?:[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 D(te){return typeof te=="string"&&ue.test(te)}for(var z=D,k=[],E=0;E<256;++E)k.push((E+256).toString(16).substr(1));function I(te){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,B=(k[te[Z+0]]+k[te[Z+1]]+k[te[Z+2]]+k[te[Z+3]]+"-"+k[te[Z+4]]+k[te[Z+5]]+"-"+k[te[Z+6]]+k[te[Z+7]]+"-"+k[te[Z+8]]+k[te[Z+9]]+"-"+k[te[Z+10]]+k[te[Z+11]]+k[te[Z+12]]+k[te[Z+13]]+k[te[Z+14]]+k[te[Z+15]]).toLowerCase();if(!z(B))throw TypeError("Stringified UUID is invalid");return B}var T=I;function R(te,Z,B){te=te||{};var J=te.random||(te.rng||re)();if(J[6]=J[6]&15|64,J[8]=J[8]&63|128,Z){B=B||0;for(var F=0;F<16;++F)Z[B+F]=J[F];return Z}return T(J)}var C=Ze.a=R},"7ahc":function(et,Ze,v){"use strict";v.d(Ze,"a",function(){return $e});var H=v("k1fw"),se=v("0Owb"),re=v("+L6B"),ue=v("2/Rp"),D=v("y8nQ"),z=v("Vl3Y"),k=v("tJVT"),E=v("OaEy"),I=v("2fM7"),T=v("q1tI"),R=v.n(T),C=v("VrN/"),te=v.n(C),Z=v("p77/"),B=v.n(Z),J=v("c5Ni"),F=v.n(J),ce=I.a.Option,ne={labelCol:{span:4},wrapperCol:{span:20}},Pe={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"]};Ze.b=function(ye){var Le=ye.callback,Fe=ye.onCancel,xe=Object(T.useState)("python"),Se=Object(k.a)(xe,2),Oe=Se[0],Ee=Se[1];function O(Q){Ee(Pe[Q][1])}function de(Q){Le(Q)}return R.a.createElement(z.a,Object(se.a)({},ne,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:de}),R.a.createElement(z.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},R.a.createElement(I.a,{onChange:O},Object.keys(Pe).map(function(Q){return R.a.createElement(ce,{key:Q,value:Q},Pe[Q][0])}))),R.a.createElement(z.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},R.a.createElement($e,{mode:Oe})),R.a.createElement("div",{className:"flex-container flex-end"},R.a.createElement(ue.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),R.a.createElement(ue.a,{type:"ghost",onClick:Fe},"\u53D6\u6D88")))};function $e(ye){var Le=ye.value,Fe=ye.onChange,xe=ye.mode,Se=ye.options,Oe=Se===void 0?{}:Se,Ee=Object(T.useRef)(),O=Object(T.useState)(),de=Object(k.a)(O,2),Q=de[0],_=de[1];return Object(T.useEffect)(function(){if(Q){function W(j){var A=j.getValue();Fe&&Fe(A)}return Q.on("change",W),function(){Q.off("change",W)}}},[Q,Fe]),Object(T.useEffect)(function(){Q&&Q.setOption("mode",xe)},[Q,xe]),Object(T.useEffect)(function(){Q&&((Le!==Q.getValue()||Le==="")&&setTimeout(function(){Q.setValue(Le||" ")},300))},[Q,Le]),Object(T.useEffect)(function(){if(Ee.current&&!Q){var W=te.a.fromTextArea(Ee.current,Object(H.a)({mode:xe,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Oe));_(W)}},[Ee.current,Q]),R.a.createElement("div",{className:"my-codemirror-container"},R.a.createElement("textarea",{ref:Ee}))}},"7ixt":function(et,Ze,v){"use strict";v.d(Ze,"a",function(){return re});var H={adjustX:1,adjustY:1},se=[0,0],re={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}},ue=re},"8EBN":function(et,Ze,v){(function(H){H(v("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 re=H.modeInfo[se];re.mimes&&(re.mime=re.mimes[0])}H.findModeByMIME=function(ue){ue=ue.toLowerCase();for(var D=0;D<H.modeInfo.length;D++){var z=H.modeInfo[D];if(z.mime==ue)return z;if(z.mimes){for(var k=0;k<z.mimes.length;k++)if(z.mimes[k]==ue)return z}}if(/\+xml$/.test(ue))return H.findModeByMIME("application/xml");if(/\+json$/.test(ue))return H.findModeByMIME("application/json")},H.findModeByExtension=function(ue){ue=ue.toLowerCase();for(var D=0;D<H.modeInfo.length;D++){var z=H.modeInfo[D];if(z.ext){for(var k=0;k<z.ext.length;k++)if(z.ext[k]==ue)return z}}},H.findModeByFileName=function(ue){for(var D=0;D<H.modeInfo.length;D++){var z=H.modeInfo[D];if(z.file&&z.file.test(ue))return z}var k=ue.lastIndexOf("."),E=k>-1&&ue.substring(k+1,ue.length);if(E)return H.findModeByExtension(E)},H.findModeByName=function(ue){ue=ue.toLowerCase();for(var D=0;D<H.modeInfo.length;D++){var z=H.modeInfo[D];if(z.name.toLowerCase()==ue)return z;if(z.alias){for(var k=0;k<z.alias.length;k++)if(z.alias[k].toLowerCase()==ue)return z}}}})},"8hTe":function(et,Ze,v){et.exports={button:"button___1wy9m"}},"9Bee":function(et,Ze,v){"use strict";var H=v("DYRE"),se=v("zeV3"),re=v("+L6B"),ue=v("2/Rp"),D=v("k1fw"),z=v("9og8"),k=v("tJVT"),E=v("WmNS"),I=v.n(E),T=v("q1tI"),R=v.n(T),C=v("vg9a"),te=v("DlQD"),Z=v.n(te),B=v("rUJ1");function J(h,o){var a=h.match(/^(\s+)(?:```)/);if(a===null)return o;var u=a[1];return o.split(`
|
|
`).map(function(g){var c=g.match(/^\s+/);if(c===null)return g;var $=Object(k.a)(c,1),Ue=$[0];return Ue.length>=u.length?g.slice(u.length):g}).join(`
|
|
`)}var F=[],ce=["<ul>"],ne=new Z.a.Renderer,Pe=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function $e(){F.length=0,ce=["<ul>"]}var ye={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function Le(h,o,a,u){if(o>=h.length||h[o].level<=a)return o;var g=h[o];u.push("<li><a href='#"+g.anchor+"'>"+g.text+"</a>"),o++;var c=[];return o=Le(h,o,g.level,c),c.length>0&&(u.push("<ul>"),c.forEach(function($){u.push($)}),u.push("</ul>")),u.push("</li>"),o=Le(h,o,a,u),o}function Fe(){return Le(F,0,0,ce),ce.push("</ul>"),ce.join("")}var xe={heading:function(o){var a=Pe.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],g=J(u,a[3]||""),c=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(c)>=0){var $=Ee(),Ue=g;g=$,O[$]={type:"block",expression:Ue}}return{type:"code",raw:u,lang:c,text:g}}}},Se=/(?:\${2})([^\n`]+?)(?:\${2})/gi,Oe=0,Ee=function(){return"__special_katext_id_".concat(Oe++,"__")},O={};function de(){return O}function Q(){Oe=0,O={}}function _(h){return h=h.replace(Se,function(o,a){var u=Ee();return O[u]={type:"inline",expression:a},u}),h}var W=ne.listitem;ne.listitem=function(h){return W(_(h))};var j=ne.paragraph;ne.paragraph=function(h){return j(_(h))};var A=ne.tablecell;ne.tablecell=function(h,o){return A(_(h),o)},ne.code=function(h,o,a){var u=(o||"").match(/\S*/)[0];return u?["latex","katex","math"].indexOf(u)>=0?"<p class='editormd-tex'>".concat(h,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(o,'">').concat(a?h:Object(B.escape)(h,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(a?h:Object(B.escape)(h,!0))+"</code></pre>"},ne.heading=function(h,o,a){var u=this.options.headerPrefix+a.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return F.push({anchor:u,level:o,text:h}),"<h"+o+' id="'+u+'">'+h+"</h"+o+">"},Z.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),Z.a.use({tokenizer:xe,renderer:ne});var P=Z.a,p=v("SJMd"),d=v("ulZh"),S=v.n(d),G=v("m3rI"),oe=v("Oy/b"),Ce=v("p5ED"),Me=v("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 me=function(h,o){return(me=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var g in u)Object.prototype.hasOwnProperty.call(u,g)&&(a[g]=u[g])})(h,o)};function _e(h,o){function a(){this.constructor=h}me(h,o),h.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function ge(h,o,a,u){return new(a||(a=Promise))(function(g,c){function $(mt){try{ve(u.next(mt))}catch(ze){c(ze)}}function Ue(mt){try{ve(u.throw(mt))}catch(ze){c(ze)}}function ve(mt){var ze;mt.done?g(mt.value):(ze=mt.value,ze instanceof a?ze:new a(function(At){At(ze)})).then($,Ue)}ve((u=u.apply(h,o||[])).next())})}function le(h,o){var a,u,g,c,$={label:0,sent:function(){if(1&g[0])throw g[1];return g[1]},trys:[],ops:[]};return c={next:Ue(0),throw:Ue(1),return:Ue(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function Ue(ve){return function(mt){return function(ze){if(a)throw new TypeError("Generator is already executing.");for(;$;)try{if(a=1,u&&(g=2&ze[0]?u.return:ze[0]?u.throw||((g=u.return)&&g.call(u),0):u.next)&&!(g=g.call(u,ze[1])).done)return g;switch(u=0,g&&(ze=[2&ze[0],g.value]),ze[0]){case 0:case 1:g=ze;break;case 4:return $.label++,{value:ze[1],done:!1};case 5:$.label++,u=ze[1],ze=[0];continue;case 7:ze=$.ops.pop(),$.trys.pop();continue;default:if(!(g=$.trys,(g=g.length>0&&g[g.length-1])||ze[0]!==6&&ze[0]!==2)){$=0;continue}if(ze[0]===3&&(!g||ze[1]>g[0]&&ze[1]<g[3])){$.label=ze[1];break}if(ze[0]===6&&$.label<g[1]){$.label=g[1],g=ze;break}if(g&&$.label<g[2]){$.label=g[2],$.ops.push(ze);break}g[2]&&$.ops.pop(),$.trys.pop();continue}ze=o.call(h,$)}catch(At){ze=[6,At],u=0}finally{a=g=0}if(5&ze[0])throw ze[1];return{value:ze[0]?ze[1]:void 0,done:!0}}([ve,mt])}}}function ee(){for(var h=0,o=0,a=arguments.length;o<a;o++)h+=arguments[o].length;var u=Array(h),g=0;for(o=0;o<a;o++)for(var c=arguments[o],$=0,Ue=c.length;$<Ue;$++,g++)u[g]=c[$];return u}var V=function(){function h(){}return h.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},h.setAttributes=function(o,a){for(var u=0,g=a;u<g.length;u++){var c=g[u],$=c[0],Ue=c[1];o.setAttribute($,Ue)}},h.createRect=function(o,a,u){var g=document.createElementNS("http://www.w3.org/2000/svg","rect");return g.setAttribute("width",o.toString()),g.setAttribute("height",a.toString()),u&&h.setAttributes(g,u),g},h.createLine=function(o,a,u,g,c){var $=document.createElementNS("http://www.w3.org/2000/svg","line");return $.setAttribute("x1",o.toString()),$.setAttribute("y1",a.toString()),$.setAttribute("x2",u.toString()),$.setAttribute("y2",g.toString()),c&&h.setAttributes($,c),$},h.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&h.setAttributes(u,a),u},h.createCircle=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","circle");return u.setAttribute("cx",(o/2).toString()),u.setAttribute("cy",(o/2).toString()),u.setAttribute("r",o.toString()),a&&h.setAttributes(u,a),u},h.createEllipse=function(o,a,u){var g=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return g.setAttribute("cx",(o/2).toString()),g.setAttribute("cy",(a/2).toString()),g.setAttribute("rx",(o/2).toString()),g.setAttribute("ry",(a/2).toString()),u&&h.setAttributes(g,u),g},h.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&h.setAttributes(a,o),a},h.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},h.createMarker=function(o,a,u,g,c,$,Ue){var ve=document.createElementNS("http://www.w3.org/2000/svg","marker");return h.setAttributes(ve,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",g.toString()],["refX",c.toString()],["refY",$.toString()]]),ve.appendChild(Ue),ve},h.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&h.setAttributes(a,o),a},h.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&h.setAttributes(u,a),u},h.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&h.setAttributes(a,o),a},h.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},h.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&h.setAttributes(u,a),u},h}(),b=function(){function h(){}return h.addKey=function(o){h.key=o},Object.defineProperty(h,"isLicensed",{get:function(){return!!h.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(h.key)},enumerable:!1,configurable:!0}),h}(),X=function(){function h(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return h.prototype.rasterize=function(o,a,u){var g=this;return new Promise(function(c){var $=u!==void 0?u:document.createElement("canvas");o===null&&(g.markersOnly=!0,g.naturalSize=!1);var Ue=document.createElementNS("http://www.w3.org/2000/svg","svg");Ue.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ue.setAttribute("width",a.width.baseVal.valueAsString),Ue.setAttribute("height",a.height.baseVal.valueAsString),Ue.setAttribute("viewBox","0 0 "+a.viewBox.baseVal.width.toString()+" "+a.viewBox.baseVal.height.toString()),Ue.innerHTML=a.innerHTML,g.naturalSize===!0?(Ue.width.baseVal.value=o.naturalWidth,Ue.height.baseVal.value=o.naturalHeight):g.width!==void 0&&g.height!==void 0&&(Ue.width.baseVal.value=g.width,Ue.height.baseVal.value=g.height),$.width=Ue.width.baseVal.value,$.height=Ue.height.baseVal.value;var ve=Ue.outerHTML,mt=$.getContext("2d");g.markersOnly!==!0&&mt.drawImage(o,0,0,$.width,$.height);var ze=window.URL,At=new Image($.width,$.height);At.setAttribute("crossOrigin","anonymous");var jt=new Blob([ve],{type:"image/svg+xml"}),zt=ze.createObjectURL(jt);At.onload=function(){mt.drawImage(At,0,0),ze.revokeObjectURL(zt);var Vn=$.toDataURL(g.imageType,g.imageQuality);c(Vn)},At.src=zt})},h}(),M=function(){},be=function(){function h(o){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(h.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),h.prototype.addClass=function(o){return this.styleSheet===void 0&&this.addStyleSheet(),o.name=""+this.classNamePrefix+o.localName,this.classes.push(o),this.styleSheet.sheet.insertRule("."+o.name+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length),o},h.prototype.addRule=function(o){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(o),this.styleSheet.sheet.insertRule(o.selector+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length)},h.prototype.addStyleSheet=function(){var o;this.styleSheet=document.createElement("style"),((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).appendChild(this.styleSheet),this.addRule(new Ae("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ae("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Ae("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new ae("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new ae("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},h.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},h}(),Ae=function(h,o){this.selector=h,this.style=o},ae=function(h,o){this.localName=h,this.style=o},Te=function(){function h(o,a,u,g,c){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=o,this.displayMode=a,this.markerItems=u,this.uiStyleSettings=g,this.styles=c,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return h.prototype.show=function(o){var a=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var u=document.createElement("div");u.className=this.toolbarBlockStyleClass.name,u.style.whiteSpace="nowrap",this.uiContainer.appendChild(u),this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(c){var $=document.createElement("div");$.className=""+a.toolbarButtonStyleClass.name,$.setAttribute("data-type-name",c.typeName),$.innerHTML=c.icon,$.addEventListener("click",function(){a.markerToolbarButtonClicked($,c)}),a.buttons.push($),a.markerButtons.push($)}),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 g=document.createElement("div");g.className=this.toolbarBlockStyleClass.name,g.style.whiteSpace="nowrap",g.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(g),this.addActionButton(g,'<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(g,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},h.prototype.addButtonClickListener=function(o){this.buttonClickListeners.push(o)},h.prototype.removeButtonClickListener=function(o){this.buttonClickListeners.indexOf(o)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(o),1)},h.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},h.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var o=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var a=0;a<this.markerButtons.length;a++)a<o||a===o&&this.markerButtons.length-1===o?this.markerButtonBlock.appendChild(this.markerButtons[a]):(a===o&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[a]))}},h.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},h.prototype.resetButtonStyles=function(){var o=this;this.buttons.forEach(function(a){a.className=a.className.replace(o.uiStyleSettings.toolbarButtonStyleColorsClassName?o.uiStyleSettings.toolbarButtonStyleColorsClassName:o.toolbarButtonStyleColorsClass.name,"").trim(),a.className=a.className.replace(o.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?o.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:o.toolbarActiveButtonStyleColorsClass.name,"").trim(),a.className+=" "+(o.uiStyleSettings.toolbarButtonStyleColorsClassName?o.uiStyleSettings.toolbarButtonStyleColorsClassName:o.toolbarButtonStyleColorsClass.name)})},h.prototype.addActionButton=function(o,a,u){var g=this,c=document.createElement("div");switch(c.className=""+this.toolbarButtonStyleClass.name,c.innerHTML=a,c.setAttribute("data-action",u),c.addEventListener("click",function(){g.actionToolbarButtonClicked(c,u)}),u){case"select":c.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":c.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":c.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":c.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":c.style.fill=this.uiStyleSettings.closeButtonColor}o.appendChild(c),this.buttons.push(c)},h.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ae("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 ae("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ae("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ae("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 ae("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var o=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ae("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 ae("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ae("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ae("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Ae("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},h.prototype.markerToolbarButtonClicked=function(o,a){this.setActiveButton(o),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("marker",a)}),this.markerButtonOverflowBlock.style.display="none"},h.prototype.actionToolbarButtonClicked=function(o,a){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("action",a)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},h.prototype.setActiveButton=function(o){this.resetButtonStyles(),o.className=o.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),o.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},h.prototype.setActiveMarkerButton=function(o){var a=this.markerButtons.find(function(u){return u.getAttribute("data-type-name")===o});a&&this.setActiveButton(a)},h.prototype.setCurrentMarker=function(o){var a=this;this.currentMarker=o,this.buttons.filter(function(u){return/delete|notes/.test(u.getAttribute("data-action"))}).forEach(function(u){a.currentMarker===void 0?(u.style.fillOpacity="0.4",u.style.pointerEvents="none"):(u.style.fillOpacity="1",u.style.pointerEvents="all")})},h}(),je=function(){function h(o,a,u,g){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=a,this.uiStyleSettings=u,this.styles=g,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return h.prototype.addStyles=function(){var o;this.toolboxStyleClass=this.styles.addClass(new ae("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 ae("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var a=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ae("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ae("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ae("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 ae("toolbox-panel-row_colors",`
|
|
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ae("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 ae("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ae("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Ae("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ae("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},h.prototype.show=function(o){var a;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolboxStyleClass.name+" "+((a=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&a!==void 0?a:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},h.prototype.setPanelButtons=function(o){var a,u,g=this;this.panels=o,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((a=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&a!==void 0?a:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((u=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&u!==void 0?u:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(c){var $;c.uiStyleSettings=g.uiStyleSettings;var Ue=document.createElement("div");Ue.className=g.toolboxButtonStyleClass.name+" "+(($=g.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&$!==void 0?$:g.toolboxButtonStyleColorsClass.name),Ue.innerHTML=c.icon,Ue.title=c.title,Ue.addEventListener("click",function(){g.panelButtonClick(c)}),g.panelButtons.push(Ue),g.buttonRow.appendChild(Ue)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},h.prototype.panelButtonClick=function(o){var a=this,u=-1;if(o!==this.activePanel){u=this.panels.indexOf(o),this.panelRow.innerHTML="";var g=o.getUi();g.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(g),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=o}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){a.displayMode==="inline"?a.panelRow.style.display="none":a.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(c,$){var Ue,ve;c.className=a.toolboxButtonStyleClass.name+" "+($===u?""+((Ue=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ue!==void 0?Ue:a.toolboxActiveButtonStyleColorsClass.name):""+((ve=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ve!==void 0?ve:a.toolboxButtonStyleColorsClass.name))})},h}(),Xe=function(h,o){this.title=h,this.icon=o},Ie=function(h){function o(a,u,g,c){var $=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return $.colors=[],$.addTransparent=!1,$.colorBoxes=[],$.colors=u,$.currentColor=g,$.setCurrentColor=$.setCurrentColor.bind($),$.getColorBox=$.getColorBox.bind($),$}return _e(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.whiteSpace="nowrap",this.colors.forEach(function(g){var c=a.getColorBox(g);u.appendChild(c),a.colorBoxes.push(c)}),u},o.prototype.getColorBox=function(a){var u=this,g=this.uiStyleSettings.toolbarHeight/4,c=this.uiStyleSettings.toolbarHeight-g,$=document.createElement("div");$.style.display="inline-block",$.style.boxSizing="content-box",$.style.width=c-2+"px",$.style.height=c-2+"px",$.style.padding="1px",$.style.marginRight="2px",$.style.marginBottom="2px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.borderRadius=(c+2)/2+"px",$.style.borderColor=a===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){u.setCurrentColor(a,$)});var Ue=document.createElement("div");return Ue.style.display="inline-block",Ue.style.width=c-2+"px",Ue.style.height=c-2+"px",Ue.style.backgroundColor=a,Ue.style.borderRadius=c/2+"px",a==="transparent"&&(Ue.style.fill=this.uiStyleSettings.toolboxAccentColor,Ue.innerHTML=`<svg viewBox="0 0 24 24">
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
</svg>`),$.appendChild(Ue),$},o.prototype.setCurrentColor=function(a,u){var g=this;this.currentColor=a,this.colorBoxes.forEach(function(c){c.style.borderColor=c===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(a)},o}(Xe),Ne=function(){function h(o,a,u){this._state="new",this._isSelected=!1,this._container=o,this._overlayContainer=a,this.globalSettings=u,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(h.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),h.prototype.ownsTarget=function(o){return!1},Object.defineProperty(h.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),h.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},h.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},h.prototype.pointerDown=function(o,a){},h.prototype.dblClick=function(o,a){},h.prototype.manipulate=function(o){},h.prototype.pointerUp=function(o){this.stateChanged()},h.prototype.dispose=function(){},h.prototype.addMarkerVisualToContainer=function(o){this.container.childNodes.length>0?this.container.insertBefore(o,this.container.childNodes[0]):this.container.appendChild(o)},h.prototype.getState=function(){return{typeName:h.typeName,state:this.state,notes:this.notes}},h.prototype.restoreState=function(o){this._state=o.state,this.notes=o.notes},h.prototype.scale=function(o,a){},h.prototype.colorChanged=function(o){this.onColorChanged&&this.onColorChanged(o),this.stateChanged()},h.prototype.fillColorChanged=function(o){this.onFillColorChanged&&this.onFillColorChanged(o),this.stateChanged()},h.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var o=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),o.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(o)&&this.onStateChanged(this)}},h.typeName="MarkerBase",h}(),Be=function(){function h(){this.findGripByVisual=this.findGripByVisual.bind(this)}return h.prototype.findGripByVisual=function(o){return this.topLeft.ownsTarget(o)?this.topLeft:this.topCenter.ownsTarget(o)?this.topCenter:this.topRight.ownsTarget(o)?this.topRight:this.centerLeft.ownsTarget(o)?this.centerLeft:this.centerRight.ownsTarget(o)?this.centerRight:this.bottomLeft.ownsTarget(o)?this.bottomLeft:this.bottomCenter.ownsTarget(o)?this.bottomCenter:this.bottomRight.ownsTarget(o)?this.bottomRight:void 0},h}(),ft=function(){function h(){this.GRIP_SIZE=10,this.visual=V.createGroup(),this.visual.appendChild(V.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(V.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return h.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},h}(),ut=function(){function h(){}return h.toITransformMatrix=function(o){return{a:o.a,b:o.b,c:o.c,d:o.d,e:o.e,f:o.f}},h.toSVGMatrix=function(o,a){return o.a=a.a,o.b=a.b,o.c=a.c,o.d=a.d,o.e=a.e,o.f=a.f,o},h}(),st=function(h){function o(a,u,g){var c=h.call(this,a,u,g)||this;return c.left=0,c.top=0,c.width=0,c.height=0,c.defaultSize={x:50,y:20},c.offsetX=0,c.offsetY=0,c.rotationAngle=0,c.CB_DISTANCE=10,c._suppressMarkerCreateEvent=!1,c.container.transform.baseVal.appendItem(V.createTransform()),c.setupControlBox(),c}return _e(o,h),Object.defineProperty(o.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"visual",{get:function(){return this._visual},set:function(a){this._visual=a;var u=V.createTransform();this._visual.transform.baseVal.appendItem(u)},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!!h.prototype.ownsTarget.call(this,a)||!!(this.controlGrips.findGripByVisual(a)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(a))},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.left=a.x,this.top=a.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var g=this.unrotatePoint(a);if(this.manipulationStartX=g.x,this.manipulationStartY=g.y,this.offsetX=g.x-this.left,this.offsetY=g.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(u),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(u)){this.activeGrip=this.rotatorGrip;var c=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=c.x-this.width/2,this.top=c.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var $=this.container.transform.baseVal.getItem(0);$.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem($,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},o.prototype.pointerUp=function(a){var u=this.state;h.prototype.pointerUp.call(this,a),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},o.prototype.moveVisual=function(a){this.visual.style.transform="translate("+a.x+"px, "+a.y+"px)"},o.prototype.manipulate=function(a){var u=this.unrotatePoint(a);this.state==="creating"?this.resize(a):this.state==="move"?(this.left=this.manipulationStartLeft+(u.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(u.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(u):this.state==="rotate"&&this.rotate(a)},o.prototype.resize=function(a){var u=this.manipulationStartLeft,g=this.manipulationStartWidth,c=this.manipulationStartTop,$=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:u=this.manipulationStartLeft+a.x-this.manipulationStartX,g=this.manipulationStartWidth+this.manipulationStartLeft-u;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:g=this.manipulationStartWidth+a.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:c=this.manipulationStartTop+a.y-this.manipulationStartY,$=this.manipulationStartHeight+this.manipulationStartTop-c;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:$=this.manipulationStartHeight+a.y-this.manipulationStartY}g>=0?(this.left=u,this.width=g):(this.left=u+g,this.width=-g),$>=0?(this.top=c,this.height=$):(this.top=c+$,this.height=-$),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(),g=V.createPoint(a.x,a.y);return{x:(g=g.matrixTransform(u)).x,y:g.y}},o.prototype.unrotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM();u=u.inverse();var g=V.createPoint(a.x,a.y);return{x:(g=g.matrixTransform(u)).x,y:g.y}},o.prototype.select=function(){h.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){h.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=V.createGroup();var a=V.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=V.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=V.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 Be,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 ft;return a.visual.transform.baseVal.appendItem(V.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.controlGrips.topLeft.GRIP_SIZE,u=-a/2,g=u,c=(this.width+this.CB_DISTANCE)/2-a/2,$=(this.height+this.CB_DISTANCE)/2-a/2,Ue=this.height+this.CB_DISTANCE-a/2,ve=this.width+this.CB_DISTANCE-a/2;this.positionGrip(this.controlGrips.topLeft.visual,u,g),this.positionGrip(this.controlGrips.topCenter.visual,c,g),this.positionGrip(this.controlGrips.topRight.visual,ve,g),this.positionGrip(this.controlGrips.centerLeft.visual,u,$),this.positionGrip(this.controlGrips.centerRight.visual,ve,$),this.positionGrip(this.controlGrips.bottomLeft.visual,u,Ue),this.positionGrip(this.controlGrips.bottomCenter.visual,c,Ue),this.positionGrip(this.controlGrips.bottomRight.visual,ve,Ue),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,c,g-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(a,u,g){var c=a.transform.baseVal.getItem(0);c.setTranslate(u,g),a.transform.baseVal.replaceItem(c,0)},o.prototype.hideControlBox=function(){this.controlBox.style.display="none"},o.prototype.showControlBox=function(){this.controlBox.style.display=""},o.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:ut.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:ut.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},h.prototype.getState.call(this))},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;this.left=u.left,this.top=u.top,this.width=u.width,this.height=u.height,this.rotationAngle=u.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(ut.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(ut.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u);var g=this.rotatePoint({x:this.left,y:this.top}),c=this.unrotatePoint({x:g.x*a,y:g.y*u});this.left=c.x,this.top=c.y,this.width=this.width*a,this.height=this.height*u,this.adjustControlBox()},o}(Ne),nt=function(h){function o(a,u,g){var c=h.call(this,a,u,g)||this;return c.fillColor="transparent",c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.opacity=1,c.setStrokeColor=c.setStrokeColor.bind(c),c.setFillColor=c.setFillColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.createVisual=c.createVisual.bind(c),c}return _e(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=V.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){h.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){h.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){h.prototype.setSize.call(this),V.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){h.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&V.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&V.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&V.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&V.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},h.prototype.getState.call(this))},o.prototype.restoreState=function(a){var u=a;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),h.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.setSize()},o.title="Rectangle marker",o}(st),Qe=function(h){function o(a,u,g,c){var $=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return $.widths=[],$.widthBoxes=[],$.widths=u,$.currentWidth=g,$.setCurrentWidth=$.setCurrentWidth.bind($),$}return _e(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.widths.forEach(function(g){var c=document.createElement("div");c.style.display="flex",c.style.flexGrow="2",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.borderColor=g===a.currentWidth?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentWidth(g,c)}),u.appendChild(c);var $=document.createElement("div");$.innerText=g.toString(),$.style.marginRight="5px",c.appendChild($);var Ue=document.createElement("div");Ue.style.minHeight="20px",Ue.style.flexGrow="2",Ue.style.display="flex",Ue.style.alignItems="center";var ve=document.createElement("hr");ve.style.minWidth="20px",ve.style.border="0px",ve.style.borderTop=g+"px solid "+a.uiStyleSettings.toolboxColor,ve.style.flexGrow="2",Ue.appendChild(ve),c.appendChild(Ue),a.widthBoxes.push(c)}),u},o.prototype.setCurrentWidth=function(a,u){var g=this;this.currentWidth=a,this.widthBoxes.forEach(function(c){c.style.borderColor=c===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(Xe),Ve=function(h){function o(a,u,g,c){var $=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return $.styles=[],$.styleBoxes=[],$.styles=u,$.currentStyle=g,$.setCurrentStyle=$.setCurrentStyle.bind($),$}return _e(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.styles.forEach(function(g){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.overflow="hidden",c.style.maxWidth=100/a.styles.length-5+"%",c.style.borderColor=g===a.currentStyle?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentStyle(g,c)}),u.appendChild(c);var $=document.createElement("div");$.style.minHeight="20px",$.style.flexGrow="2",$.style.overflow="hidden";var Ue=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+a.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(g!==""?'stroke-dasharray="'+g+'"':"")+` />
|
|
</svg>`;$.innerHTML=Ue,c.appendChild($),a.styleBoxes.push(c)}),u},o.prototype.setCurrentStyle=function(a,u){var g=this;this.currentStyle=a,this.styleBoxes.forEach(function(c){c.style.borderColor=c===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(Xe),Ke=function(h){function o(a,u,g){var c=h.call(this,a,u,g)||this;return c.strokeColor=g.defaultColor,c.strokeWidth=g.defaultStrokeWidth,c.strokeDasharray=g.defaultStrokeDasharray,c.strokePanel=new Ie("Line color",g.defaultColorSet,g.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Qe("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new Ve("Line style",g.defaultStrokeDasharrays,g.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return _e(o,h),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="FrameMarker",o.title="Frame marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',o}(nt),we=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},lt=function(h){function o(a,u,g){var c=h.call(this,a,u,g)||this;return c.x1=0,c.y1=0,c.x2=0,c.y2=0,c.defaultLength=50,c.manipulationStartX=0,c.manipulationStartY=0,c.manipulationStartX1=0,c.manipulationStartY1=0,c.manipulationStartX2=0,c.manipulationStartY2=0,c.setupControlBox(),c}return _e(o,h),o.prototype.ownsTarget=function(a){return!!h.prototype.ownsTarget.call(this,a)||!(!this.grip1.ownsTarget(a)&&!this.grip2.ownsTarget(a))},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.manipulationStartX=a.x,this.manipulationStartY=a.y,this.state==="new"&&(this.x1=a.x,this.y1=a.y,this.x2=a.x,this.y2=a.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(u)?this.activeGrip=this.grip1:this.grip2.ownsTarget(u)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},o.prototype.pointerUp=function(a){var u=this.state;h.prototype.pointerUp.call(this,a),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},o.prototype.adjustVisual=function(){},o.prototype.manipulate=function(a){this.state==="creating"?this.resize(a):this.state==="move"?(this.x1=this.manipulationStartX1+a.x-this.manipulationStartX,this.y1=this.manipulationStartY1+a.y-this.manipulationStartY,this.x2=this.manipulationStartX2+a.x-this.manipulationStartX,this.y2=this.manipulationStartY2+a.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(a)},o.prototype.resize=function(a){switch(this.activeGrip){case this.grip1:this.x1=a.x,this.y1=a.y;break;case this.grip2:case void 0:this.x2=a.x,this.y2=a.y}this.adjustVisual(),this.adjustControlBox()},o.prototype.select=function(){h.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){h.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=V.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 ft;return a.visual.transform.baseVal.appendItem(V.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,g){var c=a.transform.baseVal.getItem(0);c.setTranslate(u,g),a.transform.baseVal.replaceItem(c,0)},o.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},h.prototype.getState.call(this))},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;this.x1=u.x1,this.y1=u.y1,this.x2=u.x2,this.y2=u.y2},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.x1=this.x1*a,this.y1=this.y1*u,this.x2=this.x2*a,this.y2=this.y2*u,this.adjustVisual(),this.adjustControlBox()},o}(Ne),tt=function(h){function o(a,u,g){var c=h.call(this,a,u,g)||this;return c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.setStrokeColor=c.setStrokeColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.strokeColor=g.defaultColor,c.strokeWidth=g.defaultStrokeWidth,c.strokeDasharray=g.defaultStrokeDasharray,c.strokePanel=new Ie("Line color",g.defaultColorSet,g.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Qe("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new Ve("Line style",g.defaultStrokeDasharrays,g.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return _e(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorLine&&a!==this.visibleLine)},o.prototype.createVisual=function(){this.visual=V.createGroup(),this.selectorLine=V.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=V.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},o.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),V.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),V.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),V.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.createVisual(),this.adjustVisual()},o.typeName="LineMarker",o.title="Line marker",o.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',o}(lt),Re=function(h){function o(a,u,g,c){var $=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return $.fonts=[],$.fontBoxes=[],$.fonts=u,$.currentFont=g,$.setCurrentFont=$.setCurrentFont.bind($),$}return _e(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.flexGrow="2",this.fonts.forEach(function(g){var c=document.createElement("div");c.style.display="inline-block",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.overflow="hidden",c.style.maxWidth=100/a.fonts.length-5+"%",c.style.borderColor=g===a.currentFont?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentFont(g,c)}),u.appendChild(c);var $=document.createElement("div");$.style.display="flex",$.style.minHeight="20px",$.style.flexGrow="2",$.style.fontFamily=g,$.style.overflow="hidden";var Ue=document.createElement("div");Ue.style.whiteSpace="nowrap",Ue.style.overflow="hidden",Ue.style.textOverflow="ellipsis",Ue.innerHTML="The quick brown fox jumps over the lazy dog",$.appendChild(Ue),c.appendChild($),a.fontBoxes.push(c)}),u},o.prototype.setCurrentFont=function(a,u){var g=this;this.currentFont=a,this.fontBoxes.forEach(function(c){c.style.borderColor=c===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(Xe),He=function(h){function o(a,u,g){var c=h.call(this,a,u,g)||this;return c.color="transparent",c.padding=5,c.DEFAULT_TEXT="your text here",c.text=c.DEFAULT_TEXT,c.isMoved=!1,c.color=g.defaultColor,c.fontFamily=g.defaultFontFamily,c.defaultSize={x:100,y:30},c.setColor=c.setColor.bind(c),c.setFont=c.setFont.bind(c),c.renderText=c.renderText.bind(c),c.sizeText=c.sizeText.bind(c),c.textEditDivClicked=c.textEditDivClicked.bind(c),c.showTextEditor=c.showTextEditor.bind(c),c.setSize=c.setSize.bind(c),c.positionTextEditor=c.positionTextEditor.bind(c),c.colorPanel=new Ie("Color",g.defaultColorSet,g.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.fontFamilyPanel=new Re("Font",g.defaultFontFamilies,g.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c}return _e(o,h),o.prototype.ownsTarget=function(a){if(h.prototype.ownsTarget.call(this,a)||a===this.visual||a===this.textElement||a===this.bgRectangle)return!0;var u=!1;return this.textElement.childNodes.forEach(function(g){g===a&&(u=!0)}),u},o.prototype.createVisual=function(){this.visual=V.createGroup(),this.bgRectangle=V.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=V.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(V.createTransform()),this.textElement.transform.baseVal.appendItem(V.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.isMoved=!1,this.pointerDownPoint=a,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.renderText=function(){var a=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(u){a.textElement.appendChild(V.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 g=(1*this.width-this.width*this.padding*2/100)/a.width,c=(1*this.height-this.height*this.padding*2/100)/a.height;u=Math.min(g,c)}return u},o.prototype.getTextPosition=function(a){var u=this.textElement.getBBox(),g=0,c=0;return u.width>0&&u.height>0&&(g=(this.width-u.width*a)/2,c=this.height/2-u.height*a/2),{x:g,y:c}},o.prototype.sizeText=function(){var a=this.textElement.getBBox(),u=this.getTextScale(),g=this.getTextPosition(u);g.y-=a.y*u,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+g.x+"px, "+g.y+"px) scale("+u+", "+u+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(g.x,g.y),this.textElement.transform.baseVal.getItem(1).setScale(u,u))},o.prototype.manipulate=function(a){h.prototype.manipulate.call(this,a),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(a.x-this.pointerDownPoint.x)>5||Math.abs(a.y-this.pointerDownPoint.y)>5)},o.prototype.resize=function(a){h.prototype.resize.call(this,a),this.isMoved=!0,this.setSize(),this.sizeText()},o.prototype.setSize=function(){h.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(V.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),V.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},o.prototype.pointerUp=function(a){var u=this.state;u==="creating"&&(this._suppressMarkerCreateEvent=!0),h.prototype.pointerUp.call(this,a),this.setSize(),(u==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},o.prototype.showTextEditor=function(){var a=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(u){u.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var u=Number.parseFloat(a.textEditor.style.fontSize);a.textEditor.clientWidth>=Number.parseInt(a.textEditor.style.maxWidth)&&u>.9;)u-=.1,a.textEditor.style.fontSize=Math.max(u,.9)+"em"}),this.textEditor.addEventListener("keyup",function(u){u.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(u){if(u.clipboardData){var g=u.clipboardData.getData("text"),c=window.getSelection();if(!c.rangeCount)return!1;c.deleteFromDocument(),c.getRangeAt(0).insertNode(document.createTextNode(g)),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}),g=this.textElement.getBBox(),c={x:g.width*a,y:g.height*a};u.x-=c.x/2,u.y-=c.y/2,this.textEditor.style.top=u.y+"px",this.textEditor.style.left=u.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-u.x+"px",this.textEditor.style.fontSize=Math.max(16*a,12)+"px",this.textElement.style.display="none"}},o.prototype.textEditDivClicked=function(a){this.text=a.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},o.prototype.select=function(){h.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},o.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),h.prototype.deselect.call(this)},o.prototype.dblClick=function(a,u){h.prototype.dblClick.call(this,a,u),this.showTextEditor()},o.prototype.setColor=function(a){this.textElement&&V.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&&V.setAttributes(this.textElement,[["font-family",a]]),this.fontFamily=a,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},o.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},o.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.color=u.color,this.fontFamily=u.fontFamily,this.padding=u.padding,this.text=u.text,this.createVisual(),h.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.setSize(),this.sizeText(),this.positionTextEditor()},o.typeName="TextMarker",o.title="Text marker",o.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',o}(st),q=function(h){function o(a,u,g){var c=h.call(this,a,u,g)||this;return c.color="transparent",c.lineWidth=3,c.drawing=!1,c.pixelRatio=1,c.color=g.defaultColor,c.lineWidth=g.defaultStrokeWidth,c.pixelRatio=g.freehandPixelRatio,c.setColor=c.setColor.bind(c),c.addCanvas=c.addCanvas.bind(c),c.finishCreation=c.finishCreation.bind(c),c.setLineWidth=c.setLineWidth.bind(c),c.colorPanel=new Ie("Color",g.defaultColorSet,g.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.lineWidthPanel=new Qe("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),c.lineWidthPanel.onWidthChanged=c.setLineWidth,c}return _e(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.drawingImage)},o.prototype.createVisual=function(){this.visual=V.createGroup(),this.drawingImage=V.createImage(),this.visual.appendChild(this.drawingImage);var a=V.createTransform();this.visual.transform.baseVal.appendItem(a),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(a.x,a.y),this.drawing=!0):h.prototype.pointerDown.call(this,a,u)},o.prototype.manipulate=function(a){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(a.x,a.y),this.canvasContext.stroke()):h.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){h.prototype.resize.call(this,a),V.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),V.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):h.prototype.pointerUp.call(this,a)},o.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},o.prototype.select=function(){this.state==="creating"&&this.finishCreation(),h.prototype.select.call(this)},o.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),h.prototype.deselect.call(this)},o.prototype.finishCreation=function(){for(var a=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),u=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],g=u[0],c=u[1],$=u[2],Ue=u[3],ve=!1,mt=0;mt<this.canvasElement.height;mt++)for(var ze=0;ze<this.canvasElement.width;ze++)a.data[mt*this.canvasElement.width*4+4*ze+3]>0&&(ve=!0,mt<c&&(c=mt),ze<g&&(g=ze),mt>Ue&&(Ue=mt),ze>$&&($=ze));if(ve){this.left=g/this.pixelRatio,this.top=c/this.pixelRatio,this.width=($-g)/this.pixelRatio,this.height=(Ue-c)/this.pixelRatio;var At=document.createElement("canvas");At.width=$-g,At.height=Ue-c,At.getContext("2d").putImageData(this.canvasContext.getImageData(g,c,$-g,Ue-c),0,0),this.drawingImgUrl=At.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){V.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),V.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},o.prototype.setColor=function(a){this.color=a,this.colorChanged(a)},o.prototype.setLineWidth=function(a){this.lineWidth=a},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({drawingImgUrl:this.drawingImgUrl},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){this.createVisual(),h.prototype.restoreState.call(this,a),this.drawingImgUrl=a.drawingImgUrl,this.setDrawingImage()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.setDrawingImage()},o.typeName="FreehandMarker",o.title="Freehand marker",o.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',o}(st),Y=function(h){function o(a,u,g){var c=h.call(this,a,g||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return c.typeBoxes=[],c.currentType=u,c.setCurrentType=c.setCurrentType.bind(c),c}return _e(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2";for(var g=function(Ue){var ve="both";switch(Ue){case 0:ve="both";break;case 1:ve="start";break;case 2:ve="end";break;case 3:ve="none"}var mt=document.createElement("div");if(mt.style.display="flex",mt.style.flexGrow="2",mt.style.alignItems="center",mt.style.justifyContent="space-between",mt.style.padding="5px",mt.style.borderWidth="2px",mt.style.borderStyle="solid",mt.style.borderColor=ve===c.currentType?c.uiStyleSettings.toolboxAccentColor:"transparent",mt.addEventListener("click",function(){a.setCurrentType(ve,mt)}),u.appendChild(mt),ve==="both"||ve==="start"){var ze=document.createElement("div");ze.style.display="flex",ze.style.alignItems="center",ze.style.minHeight="20px",ze.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,5 10,0 10,10" fill="`+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,ze.style.marginLeft="5px",mt.appendChild(ze)}var At=document.createElement("div");At.style.display="flex",At.style.alignItems="center",At.style.minHeight="20px",At.style.flexGrow="2";var jt=document.createElement("hr");if(jt.style.minWidth="20px",jt.style.border="0px",jt.style.borderTop="3px solid "+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee"),jt.style.flexGrow="2",At.appendChild(jt),mt.appendChild(At),ve==="both"||ve==="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="`+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,zt.style.marginRight="5px",mt.appendChild(zt)}c.typeBoxes.push(mt)},c=this,$=0;$<4;$++)g($);return u},o.prototype.setCurrentType=function(a,u){var g=this;this.currentType=a,this.typeBoxes.forEach(function(c){c.style.borderColor=c===u?g.uiStyleSettings!==void 0?g.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(Xe),ie=function(h){function o(a,u,g){var c=h.call(this,a,u,g)||this;return c.arrowType="end",c.arrowBaseHeight=10,c.arrowBaseWidth=10,c.getArrowPoints=c.getArrowPoints.bind(c),c.setArrowType=c.setArrowType.bind(c),c.arrowTypePanel=new Y("Arrow type","end"),c.arrowTypePanel.onArrowTypeChanged=c.setArrowType,c}return _e(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.arrow1&&a!==this.arrow2)},o.prototype.getArrowPoints=function(a,u){var g=this.arrowBaseWidth+2*this.strokeWidth,c=this.arrowBaseHeight+2*this.strokeWidth;return a-g/2+","+(u+c/2)+" "+a+","+(u-c/2)+" "+(a+g/2)+","+(u+c/2)},o.prototype.createTips=function(){this.arrow1=V.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(V.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=V.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(V.createTransform()),this.visual.appendChild(this.arrow2)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(h.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",V.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),V.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 g=this.arrow2.transform.baseVal.getItem(0);g.setRotate(a+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(g,0)}},o.prototype.setArrowType=function(a){this.arrowType=a,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({arrowType:this.arrowType},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;this.arrowType=u.arrowType,this.createTips(),this.adjustVisual()},o.typeName="ArrowMarker",o.title="Arrow marker",o.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',o}(tt),x=function(h){function o(a,u,g){var c=h.call(this,a,u,g)||this;return c.fillColor=g.defaultFillColor,c.strokeWidth=0,c.fillPanel=new Ie("Color",g.defaultColorSet,g.defaultFillColor),c.fillPanel.onColorChanged=c.setFillColor,c}return _e(o,h),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="CoverMarker",o.title="Cover marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',o}(nt),w=function(h){function o(a,u,g,c){var $=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return $.opacities=[],$.opacityBoxes=[],$.opacities=u,$.currentOpacity=g,$.setCurrentOpacity=$.setCurrentOpacity.bind($),$}return _e(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",u.style.justifyContent="space-between",this.opacities.forEach(function(g){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="center",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.borderColor=g===a.currentOpacity?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentOpacity(g,c)}),u.appendChild(c);var $=document.createElement("div");$.innerText=100*g+"%",c.appendChild($),a.opacityBoxes.push(c)}),u},o.prototype.setCurrentOpacity=function(a,u){var g=this;this.currentOpacity=a,this.opacityBoxes.forEach(function(c){c.style.borderColor=c===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(Xe),L=function(h){function o(a,u,g){var c=h.call(this,a,u,g)||this;return c.setOpacity=c.setOpacity.bind(c),c.fillColor=g.defaultHighlightColor,c.strokeWidth=0,c.opacity=g.defaultHighlightOpacity,c.fillPanel=new Ie("Color",g.defaultColorSet,c.fillColor),c.fillPanel.onColorChanged=c.setFillColor,c.opacityPanel=new w("Opacity",g.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return _e(o,h),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&V.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="HighlightMarker",o.title="Highlight marker",o.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',o}(x),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>',fe=function(h){function o(a,u,g){var c=h.call(this,a,u,g)||this;return c.bgColor="transparent",c.tipPosition={x:0,y:0},c.tipBase1Position={x:0,y:0},c.tipBase2Position={x:0,y:0},c.tipMoving=!1,c.color=g.defaultStrokeColor,c.bgColor=g.defaultFillColor,c.fontFamily=g.defaultFontFamily,c.defaultSize={x:100,y:30},c.setBgColor=c.setBgColor.bind(c),c.getTipPoints=c.getTipPoints.bind(c),c.positionTip=c.positionTip.bind(c),c.setTipPoints=c.setTipPoints.bind(c),c.colorPanel=new Ie("Text color",g.defaultColorSet,c.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),c.colorPanel.onColorChanged=c.setColor,c.bgColorPanel=new Ie("Fill color",g.defaultColorSet,c.bgColor,N),c.bgColorPanel.onColorChanged=c.setBgColor,c.fontFamilyPanel=new Re("Font",g.defaultFontFamilies,g.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c.tipGrip=new ft,c.tipGrip.visual.transform.baseVal.appendItem(V.createTransform()),c.controlBox.appendChild(c.tipGrip.visual),c}return _e(o,h),o.prototype.ownsTarget=function(a){return h.prototype.ownsTarget.call(this,a)||this.tipGrip.ownsTarget(a)||this.tip===a},o.prototype.createTip=function(){V.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=V.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},o.prototype.pointerDown=function(a,u){this.state==="new"&&h.prototype.pointerDown.call(this,a,u),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(u)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):h.prototype.pointerDown.call(this,a,u)},o.prototype.pointerUp=function(a){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,h.prototype.pointerUp.call(this,a);else{var u=this.state==="creating";h.prototype.pointerUp.call(this,a),this.setTipPoints(u),this.positionTip()}},o.prototype.manipulate=function(a){if(this.tipMoving){var u=this.unrotatePoint(a);this.tipPosition={x:u.x-this.manipulationStartLeft,y:u.y-this.manipulationStartTop},this.positionTip()}else h.prototype.manipulate.call(this,a)},o.prototype.setBgColor=function(a){this.bgRectangle&&this.tip&&(V.setAttributes(this.bgRectangle,[["fill",a]]),V.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),g=this.height/5;a&&(this.tipPosition={x:u+g/2,y:this.height+20});var c=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?c<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(g=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:0},this.tipBase2Position={x:u+g,y:0}):(this.tipBase1Position={x:0,y:u},this.tipBase2Position={x:0,y:u+g}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?c<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(g=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-g,y:0},this.tipBase2Position={x:this.width-u,y:0}):(this.tipBase1Position={x:this.width,y:u},this.tipBase2Position={x:this.width,y:u+g}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?c<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(g=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-g,y:this.height},this.tipBase2Position={x:this.width-u,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-u-g},this.tipBase2Position={x:this.width,y:this.height-u}):c<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(g=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:this.height},this.tipBase2Position={x:u+g,y:this.height}):(this.tipBase1Position={x:0,y:this.height-u},this.tipBase2Position={x:0,y:this.height-u-g})},o.prototype.resize=function(a){h.prototype.resize.call(this,a),this.positionTip()},o.prototype.positionTip=function(){V.setAttributes(this.tip,[["points",this.getTipPoints()]]);var a=this.tipGrip.visual.transform.baseVal.getItem(0);a.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(a,0)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),o.prototype.select=function(){this.positionTip(),h.prototype.select.call(this)},o.prototype.getState=function(){var a=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.bgColor=u.bgColor,this.tipPosition=u.tipPosition,h.prototype.restoreState.call(this,a),this.createTip(),this.setTipPoints()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.tipPosition={x:this.tipPosition.x*a,y:this.tipPosition.y*u},this.positionTip()},o.typeName="CalloutMarker",o.title="Callout marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',o}(He),ke=function(h){function o(a,u,g){var c=h.call(this,a,u,g)||this;return c.fillColor="transparent",c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.opacity=1,c.strokeColor=g.defaultColor,c.strokeWidth=g.defaultStrokeWidth,c.strokeDasharray=g.defaultStrokeDasharray,c.fillColor=g.defaultFillColor,c.setStrokeColor=c.setStrokeColor.bind(c),c.setFillColor=c.setFillColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.setOpacity=c.setOpacity.bind(c),c.createVisual=c.createVisual.bind(c),c.strokePanel=new Ie("Line color",ee(g.defaultColorSet,["transparent"]),g.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.fillPanel=new Ie("Fill color",ee(g.defaultColorSet,["transparent"]),c.fillColor,N),c.fillPanel.onColorChanged=c.setFillColor,c.strokeWidthPanel=new Qe("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new Ve("Line style",g.defaultStrokeDasharrays,g.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c.opacityPanel=new w("Opacity",g.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return _e(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=V.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){h.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){h.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){h.prototype.setSize.call(this),V.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},o.prototype.pointerUp=function(a){h.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&V.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&V.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(a),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&V.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&V.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&V.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),h.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.setSize()},o.typeName="EllipseMarker",o.title="Ellipse marker",o.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',o}(st),Ye=function(h){function o(a,u,g){return h.call(this,a,u,g)||this}return _e(o,h),Object.defineProperty(o.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.tip1&&a!==this.tip2)},o.prototype.createTips=function(){this.tip1=V.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(V.createTransform()),this.visual.appendChild(this.tip1),this.tip2=V.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(V.createTransform()),this.visual.appendChild(this.tip2)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(h.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(V.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()]]),V.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 g=this.tip2.transform.baseVal.getItem(0);g.setRotate(a+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(g,0)}},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.prototype.getState.call(this);return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a),this.createTips(),this.adjustVisual()},o.typeName="MeasurementMarker",o.title="Measurement marker",o.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',o}(tt),bt=function(h){function o(a,u,g){var c=h.call(this,a,u,g)||this;return c.strokePanel.colors=g.defaultColorSet,c.fillColor="transparent",c}return _e(o,h),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="EllipseFrameMarker",o.title="Ellipse frame marker",o.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',o}(ke),Rt=function(){function h(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(h.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),h.prototype.addUndoStep=function(o){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(o)||(this.undoStack.push(o),JSON.stringify(this.lastRedoStep)!==JSON.stringify(o)&&this.redoStack.splice(0,this.redoStack.length))},h.prototype.replaceLastUndoStep=function(o){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=o)},h.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},h.prototype.undo=function(){if(this.undoStack.length>1){var o=this.undoStack.pop();return o!==void 0&&this.redoStack.push(o),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},h.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},h}(),We=function(h){function o(a,u,g){var c=h.call(this,a,u,g)||this;return c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.curveX=0,c.curveY=0,c.manipulationStartCurveX=0,c.manipulationStartCurveY=0,c.setStrokeColor=c.setStrokeColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.positionGrips=c.positionGrips.bind(c),c.addControlGrips=c.addControlGrips.bind(c),c.adjustVisual=c.adjustVisual.bind(c),c.setupControlBox=c.setupControlBox.bind(c),c.resize=c.resize.bind(c),c.strokeColor=g.defaultColor,c.strokeWidth=g.defaultStrokeWidth,c.strokeDasharray=g.defaultStrokeDasharray,c.strokePanel=new Ie("Line color",g.defaultColorSet,g.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Qe("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new Ve("Line style",g.defaultStrokeDasharrays,g.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return _e(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorCurve&&a!==this.visibleCurve&&!this.curveGrip.ownsTarget(a))},o.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},o.prototype.createVisual=function(){this.visual=V.createGroup(),this.selectorCurve=V.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=V.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=a.x,this.curveY=a.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(u)&&(this.activeGrip=this.curveGrip,this._state="resize")},o.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),V.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),V.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),V.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){h.prototype.setupControlBox.call(this),this.curveControlLine1=V.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=V.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},o.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,h.prototype.addControlGrips.call(this)},o.prototype.positionGrips=function(){h.prototype.positionGrips.call(this);var a=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-a/2,this.curveY-a/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},o.prototype.manipulate=function(a){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+a.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+a.y-this.manipulationStartY),h.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){this.activeGrip===this.curveGrip&&(this.curveX=a.x,this.curveY=a.y),h.prototype.resize.call(this,a),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.adjustVisual()},o.prototype.scale=function(a,u){this.curveX=this.curveX*a,this.curveY=this.curveY*u,h.prototype.scale.call(this,a,u)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.curveX=u.curveX,this.curveY=u.curveY,this.createVisual(),this.adjustVisual()},o.typeName="CurveMarker",o.title="Curve marker",o.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',o}(lt),Ct=function(){function h(o,a){a===void 0&&(a=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=o,this.cancelable=a}return Object.defineProperty(h.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),h.prototype.preventDefault=function(){this._defaultPrevented=!0},h}(),gt=function(h){function o(a,u,g){var c=h.call(this,a,!1)||this;return c.dataUrl=u,c.state=g,c}return _e(o,h),o}(Ct),ot=function(h){function o(a,u,g){g===void 0&&(g=!1);var c=h.call(this,a,g)||this;return c.marker=u,c}return _e(o,h),o}(Ct),vt=function(){function h(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return h.prototype.addEventListener=function(o,a){this[o].push(a)},h.prototype.removeEventListener=function(o,a){var u=this[o].indexOf(a);u>-1&&this[o].splice(u,1)},h}(),_t=function(){function h(o){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new we,this._isOpen=!1,this.undoRedoManager=new Rt,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 vt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=h.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(h.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ke,q,ie,He,bt,ke,L,fe,Ye,x,tt,We]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ke,q,ie,He,ke,L,fe]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ke,q,ie,He,L]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(o){var a=this;this._availableMarkerTypes.splice(0),o.forEach(function(u){if(typeof u=="string"){var g=a.ALL_MARKER_TYPES.find(function(c){return c.typeName===u});g!==void 0&&a._availableMarkerTypes.push(g)}else a._availableMarkerTypes.push(u)})},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(o){this._zoomLevel=o,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),h.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),b.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},h.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&M.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=M.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new Ct(o))})},h.prototype.render=function(){return ge(this,void 0,void 0,function(){var o;return le(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()]}})})},h.prototype.close=function(o){var a=this;if(o===void 0&&(o=!1),this.isOpen){var u=!1;o||this.eventListeners.beforeclose.forEach(function(g){var c=new Ct(a,!0);g(c),c.defaultPrevented&&(u=!0)}),u||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(g){return g(new Ct(a))}),this.detachEvents(),this._isOpen=!1)}},h.prototype.addMarkersToToolbar=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];(o=this._availableMarkerTypes).push.apply(o,a)},h.prototype.addRenderEventListener=function(o){this.addEventListener("render",function(a){o(a.dataUrl,a.state)})},h.prototype.removeRenderEventListener=function(o){},h.prototype.addCloseEventListener=function(o){this.addEventListener("close",function(){o()})},h.prototype.removeCloseEventListener=function(o){},h.prototype.setupResizeObserver=function(){var o=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){o.resize(o.target.clientWidth,o.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return o.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},h.prototype.onPopupTargetResize=function(){var o=1*this.target.clientWidth/this.target.clientHeight,a=this.editorCanvas.clientWidth/o>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*o:this.editorCanvas.clientWidth,u=a<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/o;this.resize(a,u)},h.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},h.prototype.resize=function(o,a){this._isResizing=!0;var u=o/this.imageWidth,g=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,g),this._isResizing=!1},h.prototype.scaleMarkers=function(o,a){var u,g=this;this._currentMarker&&this._currentMarker instanceof He?this._currentMarker.scale(o,a):(u=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(c){c!==g._currentMarker&&c.scale(o,a)}),u!==void 0&&this.setCurrentMarker(u)},h.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},h.prototype.setTopLeft=function(){var o=this.editingTarget.getBoundingClientRect(),a=this.editorCanvas.getBoundingClientRect();this.left=o.left-a.left,this.top=o.top-a.top},h.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},h.prototype.addDefs=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];this.defs=V.createDefs(),this.addDefsToImage(),(o=this.defs).append.apply(o,a)},h.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},h.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},h.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},h.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},h.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},h.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},h.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},h.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var o=document.createElement("a");o.href="https://markerjs.com/",o.target="_blank",o.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',o.title="Powered by marker.js",o.style.display="grid",o.style.alignItems="center",o.style.justifyItems="center",o.style.padding="3px",o.style.width="20px",o.style.height="20px",this.logoUI.appendChild(o),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},h.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},h.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},h.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},h.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Te(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 je(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},h.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},h.prototype.removeMarker=function(o){this.markerImage.removeChild(o.container),this.markers.indexOf(o)>-1&&this.markers.splice(this.markers.indexOf(o),1),o.dispose()},h.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},h.prototype.toolbarButtonClicked=function(o,a){if(o==="marker"&&a!==void 0)this.createNewMarker(a);else if(o==="action")switch(a){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},h.prototype.deleteSelectedMarker=function(){var o=this;if(this._currentMarker!==void 0){var a=!1;if(this.eventListeners.markerbeforedelete.forEach(function(g){var c=new ot(o,o._currentMarker,!0);g(c),c.defaultPrevented&&(a=!0)}),!a){var u=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(g){return g(new ot(o,u))})}}},h.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function($){var Ue=new ot(o,void 0,!0);$(Ue),Ue.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function($){var Ue=g.markers[$];g.setCurrentMarker(g.markers[$]),g._currentMarker.dispose(),g.markerImage.removeChild(g._currentMarker.container),g.markers.splice(g.markers.indexOf(g._currentMarker),1),g.eventListeners.markerdelete.forEach(function(ve){return ve(new ot(o,Ue))})},g=this,c=this.markers.length-1;c>=0;c--)u(c);this.addUndoStep()}},Object.defineProperty(h.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),h.prototype.showNotesEditor=function(){var o;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(o=this._currentMarker.notes)!==null&&o!==void 0?o:"",this.overlayContainer.appendChild(this.notesArea))},h.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},h.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},h.prototype.addUndoStep=function(){var o=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var a=this.getState(),u=this.undoRedoManager.getLastUndoStep();if(!u||u.width===a.width&&u.height===a.height){var g=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(a),g<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(c){return c(new Ct(o))})}else this.undoRedoManager.replaceLastUndoStep(a),this.eventListeners.statechange.forEach(function(c){return c(new Ct(o))})}},h.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},h.prototype.undoStep=function(){var o=this,a=this.undoRedoManager.undo();a!==void 0&&(this.restoreState(a),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(u){return u(new Ct(o))}))},h.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},h.prototype.redoStep=function(){var o=this,a=this.undoRedoManager.redo();a!==void 0&&(this.restoreState(a),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(u){return u(new Ct(o))}))},h.prototype.stepZoom=function(){var o=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=o<this.zoomSteps.length-1?this.zoomSteps[o+1]:this.zoomSteps[0]},h.prototype.panTo=function(o){this.contentDiv.scrollBy({left:this.prevPanPoint.x-o.x,top:this.prevPanPoint.y-o.y}),this.prevPanPoint=o},h.prototype.startRenderAndClose=function(){return ge(this,void 0,void 0,function(){var o,a,u=this;return le(this,function(g){switch(g.label){case 0:return[4,this.render()];case 1:return o=g.sent(),a=this.getState(),this.eventListeners.render.forEach(function(c){return c(new gt(u,o,a))}),this.close(!0),[2]}})})},h.prototype.getState=function(o){o===!0&&this.setCurrentMarker();var a={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(u){return a.markers.push(u.getState())}),a},h.prototype.restoreState=function(o){var a=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);o.markers.forEach(function(u){var g=a._availableMarkerTypes.find(function($){return $.typeName===u.typeName});if(g!==void 0){var c=a.addNewMarker(g);c.restoreState(u),a.markers.push(c)}}),o.width&&o.height&&(o.width!==this.imageWidth||o.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/o.width,this.imageHeight/o.height),this.eventListeners.restorestate.forEach(function(u){return u(new Ct(a))})},h.prototype.addNewMarker=function(o){var a=V.createGroup();return this.markerImage.appendChild(a),new o(a,this.overlayContainer,this.settings)},h.prototype.createNewMarker=function(o){var a,u=this;(a=typeof o=="string"?this._availableMarkerTypes.find(function(g){return g.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(g){return g(new ot(u,u._currentMarker))}))},h.prototype.markerCreated=function(o){var a=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(o),this.setCurrentMarker(o),o instanceof q&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(q):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(u){return u(new ot(a,a._currentMarker))})},h.prototype.colorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=o,this.settings.defaultStrokeColor=o)},h.prototype.fillColorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=o)},h.prototype.markerStateChanged=function(o){var a=this;this.eventListeners.markerchange.forEach(function(u){return u(new ot(a,o))})},h.prototype.setCurrentMarker=function(o){var a=this;this._currentMarker!==o&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(u){return u(new ot(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 ot(a,a._currentMarker))}))},h.prototype.onPointerDown=function(o){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||o.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var a=this.markers.find(function(u){return u.ownsTarget(o.target)});a!==void 0?(this.setCurrentMarker(a),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(o.clientX,o.clientY),o.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:o.clientX,y:o.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(o.clientX,o.clientY))},h.prototype.onDblClick=function(o){if(this._isFocused||this.focus(),this.mode==="select"){var a=this.markers.find(function(u){return u.ownsTarget(o.target)});a!==void 0&&a!==this._currentMarker&&this.setCurrentMarker(a),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(o.clientX,o.clientY),o.target):this.setCurrentMarker()}},h.prototype.onPointerMove=function(o){this.touchPoints!==1&&o.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||o.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(o.clientX,o.clientY)):this.zoomLevel>1&&this.panTo({x:o.clientX,y:o.clientY}))},h.prototype.onPointerUp=function(o){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(o.clientX,o.clientY)),this.isDragging=!1,this.addUndoStep()},h.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},h.prototype.onKeyUp=function(o){this._currentMarker===void 0||this.notesArea!==void 0||o.key!=="Delete"&&o.key!=="Backspace"||this.deleteSelectedMarker()},h.prototype.clientToLocalCoordinates=function(o,a){var u=this.markerImage.getBoundingClientRect();return{x:(o-u.left)/this.zoomLevel,y:(a-u.top)/this.zoomLevel}},h.prototype.onWindowResize=function(){this.positionUI()},h.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},h.prototype.addLicenseKey=function(o){b.addKey(o)},h.prototype.addEventListener=function(o,a){this.eventListeners.addEventListener(o,a)},h.prototype.removeEventListener=function(o,a){this.eventListeners.removeEventListener(o,a)},h.prototype.renderState=function(o){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(o),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(h.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),h.prototype.focus=function(){var o=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(a){return a(new Ct(o))}))},h.prototype.blur=function(){var o=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(a){return a(new Ct(o))}))},h.instanceCounter=0,h}();/* **********************************
|
|
cropro version 1.2.0
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
copyright Alan Mendelevich
|
|
see README and LICENSE for details
|
|
********************************** *//*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var Mt=function(h,o){return(Mt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var g in u)Object.prototype.hasOwnProperty.call(u,g)&&(a[g]=u[g])})(h,o)};function Lt(h,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function a(){this.constructor=h}Mt(h,o),h.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function wt(h,o,a,u){return new(a||(a=Promise))(function(g,c){function $(mt){try{ve(u.next(mt))}catch(ze){c(ze)}}function Ue(mt){try{ve(u.throw(mt))}catch(ze){c(ze)}}function ve(mt){var ze;mt.done?g(mt.value):(ze=mt.value,ze instanceof a?ze:new a(function(At){At(ze)})).then($,Ue)}ve((u=u.apply(h,o||[])).next())})}function en(h,o){var a,u,g,c,$={label:0,sent:function(){if(1&g[0])throw g[1];return g[1]},trys:[],ops:[]};return c={next:Ue(0),throw:Ue(1),return:Ue(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function Ue(ve){return function(mt){return function(ze){if(a)throw new TypeError("Generator is already executing.");for(;$;)try{if(a=1,u&&(g=2&ze[0]?u.return:ze[0]?u.throw||((g=u.return)&&g.call(u),0):u.next)&&!(g=g.call(u,ze[1])).done)return g;switch(u=0,g&&(ze=[2&ze[0],g.value]),ze[0]){case 0:case 1:g=ze;break;case 4:return $.label++,{value:ze[1],done:!1};case 5:$.label++,u=ze[1],ze=[0];continue;case 7:ze=$.ops.pop(),$.trys.pop();continue;default:if(!(g=$.trys,(g=g.length>0&&g[g.length-1])||ze[0]!==6&&ze[0]!==2)){$=0;continue}if(ze[0]===3&&(!g||ze[1]>g[0]&&ze[1]<g[3])){$.label=ze[1];break}if(ze[0]===6&&$.label<g[1]){$.label=g[1],g=ze;break}if(g&&$.label<g[2]){$.label=g[2],$.ops.push(ze);break}g[2]&&$.ops.pop(),$.trys.pop();continue}ze=o.call(h,$)}catch(At){ze=[6,At],u=0}finally{a=g=0}if(5&ze[0])throw ze[1];return{value:ze[0]?ze[1]:void 0,done:!0}}([ve,mt])}}}var Ut=function(){function h(){}return h.addKey=function(o){h.key=o},Object.defineProperty(h,"isLicensed",{get:function(){return!!h.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(h.key)},enumerable:!1,configurable:!0}),h}(),ht=function(){function h(){}return h.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},h.setAttributes=function(o,a){for(var u=0,g=a;u<g.length;u++){var c=g[u],$=c[0],Ue=c[1];o.setAttribute($,Ue)}},h.createRect=function(o,a,u){var g=document.createElementNS("http://www.w3.org/2000/svg","rect");return g.setAttribute("width",o.toString()),g.setAttribute("height",a.toString()),u&&h.setAttributes(g,u),g},h.createLine=function(o,a,u,g,c){var $=document.createElementNS("http://www.w3.org/2000/svg","line");return $.setAttribute("x1",o.toString()),$.setAttribute("y1",a.toString()),$.setAttribute("x2",u.toString()),$.setAttribute("y2",g.toString()),c&&h.setAttributes($,c),$},h.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&h.setAttributes(u,a),u},h.createCircle=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","circle");return u.setAttribute("cx",(o/2).toString()),u.setAttribute("cy",(o/2).toString()),u.setAttribute("r",o.toString()),a&&h.setAttributes(u,a),u},h.createEllipse=function(o,a,u){var g=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return g.setAttribute("cx",(o/2).toString()),g.setAttribute("cy",(a/2).toString()),g.setAttribute("rx",(o/2).toString()),g.setAttribute("ry",(a/2).toString()),u&&h.setAttributes(g,u),g},h.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&h.setAttributes(a,o),a},h.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},h.createMarker=function(o,a,u,g,c,$,Ue){var ve=document.createElementNS("http://www.w3.org/2000/svg","marker");return h.setAttributes(ve,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",g.toString()],["refX",c.toString()],["refY",$.toString()]]),ve.appendChild(Ue),ve},h.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&h.setAttributes(a,o),a},h.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&h.setAttributes(u,a),u},h.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&h.setAttributes(a,o),a},h.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},h.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&h.setAttributes(u,a),u},h.createElement=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg",o);return a&&h.setAttributes(u,a),u},h.getHollowRectanglePath=function(o,a,u,g,c,$,Ue,ve){return"M"+o+","+a+"V"+(a+g)+"H"+(o+u)+"V"+a+"H"+c+"V"+$+"H"+(c+Ue)+"V"+($+ve)+"H"+c+"V"+a+"Z"},h}(),Vt=function(){function h(o){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(h.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),h.prototype.addClass=function(o){return this.styleSheet===void 0&&this.addStyleSheet(),o.name=""+this.classNamePrefix+o.localName,this.classes.push(o),this.styleSheet.sheet.insertRule("."+o.name+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length),o},h.prototype.addRule=function(o){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(o),this.styleSheet.sheet.insertRule(o.selector+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length)},h.prototype.addStyleSheet=function(){var o;this.styleSheet=document.createElement("style"),((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).appendChild(this.styleSheet),this.addRule(new Xt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Xt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Xt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new nn("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new nn("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},h.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},h}(),Xt=function(h,o){this.selector=h,this.style=o},nn=function(h,o){this.localName=h,this.style=o},cn=function(){function h(){this.blocks=[],this.display=""}return h.prototype.addButtonBlock=function(o){o.className=this.blockClassName,o.buttonClassName=this.buttonClassName,o.buttonColorsClassName=this.buttonColorsClassName,o.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(o)},h.prototype.addElementBlock=function(o){o.className===void 0&&(o.className=this.blockClassName),this.blocks.push(o)},h.prototype.getUI=function(){var o=document.createElement("div");return o.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,o.style.display=this.display,this.blocks.forEach(function(a){return o.appendChild(a.getUI())}),o},h}(),Jn=function(){function h(){}return h.prototype.getUI=function(){var o=document.createElement("div");if(o.className=this.className,this.minWidth!==void 0&&(o.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":o.style.justifyContent="flex-start";break;case"center":o.style.justifyContent="center";break;case"end":o.style.justifyContent="flex-end"}return o.style.whiteSpace="nowrap",o},h}(),an=function(h){function o(){var a=h!==null&&h.apply(this,arguments)||this;return a.buttons=[],a}return Lt(o,h),o.prototype.addButton=function(a){a.className=this.buttonClassName,a.colorsClassName=this.buttonColorsClassName,a.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(a)},o.prototype.getUI=function(){var a=h.prototype.getUI.call(this);return this.buttons.forEach(function(u){return a.appendChild(u.getUI())}),a},o}(Jn),pt=function(){function h(o,a){this._isActive=!1,this._isHidden=!1,this._icon=o,this.title=a,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(h.prototype,"icon",{get:function(){return this._icon},set:function(o){this._icon=o,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isActive",{get:function(){return this._isActive},set:function(o){this._isActive=o,this.adjustClassName()},enumerable:!1,configurable:!0}),h.prototype.getUI=function(){var o=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return o.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},h.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},h.prototype.hide=function(){this._isHidden=!0},h}(),at=function(h){function o(){var a=h!==null&&h.apply(this,arguments)||this;return a.elements=[],a}return Lt(o,h),o.prototype.addElement=function(a){this.elements.push(a)},o.prototype.getUI=function(){var a=h.prototype.getUI.call(this);return this.elements.forEach(function(u){return a.appendChild(u)}),a},o}(Jn),Zt=function(){function h(o,a){this.horizontal=o,this.vertical=a}return Object.defineProperty(h.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),h.prototype.getVerticalLength=function(o){return o/this.ratio},h.prototype.getHorizontalLength=function(o){return o*this.ratio},h}(),hn=function(){function h(){}return h.getIcon=function(o,a){if(o>0&&a>0){var u=new Zt(o,a),g=u.ratio>=1?20:u.getHorizontalLength(20),c=u.ratio<1?20:u.getVerticalLength(20),$=document.createElementNS("http://www.w3.org/2000/svg","svg");$.setAttribute("xmlns","http://www.w3.org/2000/svg"),$.setAttribute("viewBox","0 0 24 24"),document.body.appendChild($);var Ue=ht.createDefs();$.appendChild(Ue);var ve=ht.createElement("clipPath",[["id","text-bg-clip"]]);Ue.appendChild(ve);var mt=ht.createPath(ht.getHollowRectanglePath((24-g)/2,(24-c)/2,g,c,(24-g)/2+2,(24-c)/2+2,g-4,c-4));$.appendChild(mt);var ze=ht.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ze.appendChild(ht.createTSpan(o+":"+a)),$.appendChild(ze);var At=ze.getBBox();ht.setAttributes(ze,[["x",((24-At.width)/2).toString()],["y",((24-At.height)/2-At.y).toString()]]);var jt=ht.createPath(ht.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(At.width))/2,(24-Math.ceil(At.height))/2,Math.ceil(At.width),Math.ceil(At.height)));return ve.appendChild(jt),ht.setAttributes(mt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild($),$.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},h}(),Kt=function(h){function o(a,u,g){var c=h.call(this,a,u)||this;return c.isDropdownOpen=!1,c.onClick=c.dropdownButtonClicked,c.dropdownButtons=g,c}return Lt(o,h),o.prototype.setupDropdown=function(){var a=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(u){u.className=a.className,u.colorsClassName=a.colorsClassName,a.dropdownBlock.appendChild(u.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},o.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},o.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},o.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},o.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},o.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},o}(pt),Tt=function(){function h(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=ht.createGroup(),this.visual.appendChild(ht.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ht.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return h.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},h.prototype.setCenter=function(o,a){this.visual.childNodes.forEach(function(u){return ht.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},h}(),Mn=function(){function h(o,a,u,g){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=g,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(h.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(o){this._aspectRatio=o,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.gridContainer&&ht.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(o){this._zoomFactor=o,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),h.prototype.open=function(){var o=this;this.cropShadeElement=ht.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=ht.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;a<this.numberOfGridLines;a++)this.horizontalGridLines.push(ht.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(ht.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=ht.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Tt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Tt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Tt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Tt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},h.prototype.setCropRectangle=function(o){this.cropRect=o;var a=Object.assign({},this.cropRect);this.zoomFactor!==1&&(a.width=this.cropRect.width*this.zoomFactor,a.height=this.cropRect.height*this.zoomFactor,a.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-a.width/2,a.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-a.height/2),ht.setAttributes(this.cropRectElement,[["x",a.x.toString()],["y",a.y.toString()],["width",a.width.toString()],["height",a.height.toString()]]);var u=a.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(c,$){var Ue=a.y+u*($+1);ht.setAttributes(c,[["x1",""+a.x],["y1",""+Ue],["x2",""+(a.x+a.width)],["y2",""+Ue]])});var g=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(c,$){var Ue=a.x+g*($+1);ht.setAttributes(c,[["x1",""+Ue],["y1",""+a.y],["x2",""+Ue],["y2",""+(a.y+a.height)]])}),ht.setAttributes(this.cropShadeElement,[["d",ht.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,a.x,a.y,a.width,a.height)]]),this.topLeftGrip.setCenter(a.x,a.y),this.topRightGrip.setCenter(a.x+a.width,a.y),this.bottomLeftGrip.setCenter(a.x,a.y+a.height),this.bottomRightGrip.setCenter(a.x+a.width,a.y+a.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},h.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},h.prototype.clientToLocalCoordinates=function(o,a){var u=this.container.getBoundingClientRect();return{x:o-u.left+this.margin,y:a-u.top+this.margin}},h.prototype.onPointerDown=function(o){this.container.setPointerCapture(o.pointerId),this.previousPoint=this.clientToLocalCoordinates(o.clientX,o.clientY),this.cropRectElement===o.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(o.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(o.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(o.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(o.target)&&(this.activeGrip=this.bottomRightGrip)},h.prototype.onPointerMove=function(o){if(this.isMoving)this.move(this.clientToLocalCoordinates(o.clientX,o.clientY));else if(this.activeGrip){var a=this.clientToLocalCoordinates(o.clientX,o.clientY);this.resize(a)}o.preventDefault()},h.prototype.onPointerUp=function(o){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(o.pointerId)},h.prototype.move=function(o){var a=o.x-this.previousPoint.x,u=o.y-this.previousPoint.y;this.zoomFactor!==1&&(a=-a/this.zoomFactor,u=-u/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+a),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+u),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=o},h.prototype.resize=function(o){var a=Object.assign({},this.cropRect),u=o.x-this.previousPoint.x,g=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+=g,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+=g}a.width<10&&(a.x=this.cropRect.x,a.width=10),a.height<10&&(a.y=this.cropRect.y,a.height=10),this.previousPoint=o,a.x>=this.margin&&a.y>=this.margin&&a.x-this.margin+a.width<=this.canvasWidth&&a.y-this.margin+a.height<=this.canvasHeight&&(this.cropRect=a,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},h.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var o=this.cropRect.x+this.cropRect.width/2,a=this.cropRect.y+this.cropRect.height/2,u=this.aspectRatio.getHorizontalLength(this.cropRect.height),g=this.aspectRatio.getVerticalLength(this.cropRect.width);u/this.canvasWidth<g/this.canvasHeight?this.cropRect.width=u:this.cropRect.height=g,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=o-this.cropRect.width/2,this.cropRect.y=a-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},h.prototype.getRescaledRect=function(o,a,u,g,c,$){var Ue=u/o,ve=g/a;return{x:(c.x-$)*Ue+$,y:(c.y-$)*ve+$,width:c.width*Ue,height:c.height*ve}},h.prototype.scaleCanvas=function(o,a){var u=this.getRescaledRect(this.canvasWidth,this.canvasHeight,o,a,this.cropRect,this.margin);this.canvasWidth=o,this.canvasHeight=a,this.onCropChange&&this.onCropChange(u),this.setCropRectangle(u)},h}(),An=function(){function h(o){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=o,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(h.prototype,"angle",{get:function(){return this._angle},set:function(o){this._angle=o,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),h.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},h.prototype.onPointerDown=function(o){this.controlContainer.setPointerCapture(o.pointerId),this.isDragging=!0,this.previousPoint={x:o.clientX,y:o.clientY}},h.prototype.onPointerMove=function(o){this.isDragging&&(this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.previousPoint.x=o.clientX)},h.prototype.onPointerUp=function(o){this.isDragging&&this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(o.pointerId)},h.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var o=this.angleLabelText.getBBox();ht.setAttributes(this.angleLabelElement,[["x",((this.width-o.width)/2).toString()],["y",(this.height/2).toString()]])}},h.prototype.positionScaleShape=function(){if(this.scaleShape){var o=this.scaleShape.transform.baseVal.getItem(0);o.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(o,0)}},h.prototype.getVisual=function(){var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("width",this.width+"px"),o.setAttribute("height",this.height+"px"),o.setAttribute("viewBox","0 0 "+this.width+" "+this.height),o.style.flexShrink="0",document.body.appendChild(o);for(var a="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,u=1;u<=this.width/5+10;u++){var g=u%5==0?this.height/3:this.height/6;a+="h4v"+-g+"h1v"+g}a+="v1H0Z",this.scaleShape=ht.createPath(a);var c=ht.createTransform();this.scaleShape.transform.baseVal.appendItem(c),o.appendChild(this.scaleShape),this.angleLabelElement=ht.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=ht.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var $=ht.createTSpan("");return $.innerHTML="°",this.angleLabelElement.appendChild($),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},h}(),vi=function(){function h(){this.naturalSize=!1,this.imageType="image/png"}return h.prototype.rasterize=function(o,a,u,g,c,$,Ue){var ve=this;return new Promise(function(mt){var ze=document.createElement("canvas");ze.width=o.width.baseVal.value-2*g,ze.height=o.height.baseVal.value-2*g;var At=1,jt=1;ve.naturalSize===!0?(At=a.naturalWidth/(o.width.baseVal.value-2*g)/$,jt=a.naturalHeight/(o.height.baseVal.value-2*g)/Ue,ze.width=a.naturalWidth/$,ze.height=a.naturalHeight/Ue):ve.width!==void 0&&ve.height!==void 0&&(At=ve.width/u.width,jt=ve.height/u.height,ze.width*=At,ze.height*=jt);var zt=ze.getContext("2d");zt.translate(ze.width/2,ze.height/2),zt.rotate(c*Math.PI/180),zt.scale($,Ue),zt.translate(-ze.width/2,-ze.height/2),zt.drawImage(a,0,0,ze.width,ze.height);var Vn=document.createElement("canvas");Vn.width=u.width*At,Vn.height=u.height*jt,Vn.getContext("2d").putImageData(zt.getImageData((u.x-g)*At,(u.y-g)*jt,u.width*At,u.height*jt),0,0),mt(Vn.toDataURL(ve.imageType,ve.imageQuality))})},h}(),Je=function(){function h(o){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=h.instanceCounter++,this.styles=new Vt(this.instanceNo),this.target=o,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(h.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(o){this._zoomToCropEnabled=o,o?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"gridLines",{get:function(){return this._gridLines},set:function(o){this._gridLines=o,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(o){this._rotationAngle=o,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"aspectRatio",{get:function(){var o;return(o=this._aspectRatio)!==null&&o!==void 0?o:this.aspectRatios[0]},set:function(o){this._aspectRatio=o},enumerable:!1,configurable:!0}),h.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},h.prototype.show=function(){this.showUI(),this.open()},h.prototype.close=function(o){o===void 0&&(o=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),o||this.closeEventListeners.forEach(function(a){return a()}),this._isOpen=!1)},h.prototype.addRenderEventListener=function(o){this.renderEventListeners.push(o)},h.prototype.removeRenderEventListener=function(o){this.renderEventListeners.indexOf(o)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(o),1)},h.prototype.addCloseEventListener=function(o){this.closeEventListeners.push(o)},h.prototype.removeCloseEventListener=function(o){this.closeEventListeners.indexOf(o)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(o),1)},h.prototype.setupResizeObserver=function(){var o=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){o.resize(o.target.clientWidth,o.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},h.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var o=1*this.target.clientWidth/this.target.clientHeight,a=this.contentDiv.clientWidth/o>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*o:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,u=a+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/o;this.resize(a,u)}},h.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},h.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",ht.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},h.prototype.resize=function(o,a){this.imageWidth=Math.round(o),this.imageHeight=Math.round(a),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},h.prototype.setEditingTarget=function(){var o=document.createElement("canvas");o.width=this.target.naturalWidth,o.height=this.target.naturalHeight,o.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var a=o.toDataURL();ht.setAttributes(this.editingTarget,[["href",a]]),this.setEditingTargetSize()},h.prototype.setTopLeft=function(){var o=this.target.getBoundingClientRect(),a=this.editorCanvas.getBoundingClientRect();this.left=o.left-a.left-this.CANVAS_MARGIN,this.top=o.top-a.top-this.CANVAS_MARGIN},h.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=ht.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=ht.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=ht.createGroup(),this.editingTargetRotationScaleContainer=ht.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=ht.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var a=ht.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(a),this.editingTargetContainer=ht.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},h.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},h.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=ht.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Mn(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},h.prototype.zoomToCrop=function(){if(this.cropRect){var o=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,a=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=o+"px "+a+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-o+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-a+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},h.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},h.prototype.cropRectChanged=function(o){this.cropRect=o,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},h.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},h.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},h.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},h.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var o=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,a=this.target.offsetTop>o+this.CANVAS_MARGIN?this.target.offsetTop-(o+this.CANVAS_MARGIN):0;this.coverDiv.style.top=a+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},h.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},h.prototype.addTopToolbar=function(){var o=this;this.topToolbar=new cn,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 an;a.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(a);var u=[];this.aspectRatios.forEach(function(jt){var zt=new pt(hn.getIcon(jt.horizontal,jt.vertical),jt.horizontal===0&&jt.vertical===0?"FREE":jt.horizontal+":"+jt.vertical);zt.onClick=function(){return o.ratioButtonClicked(jt)},u.push(zt)}),this.aspectRatioButton=new Kt(hn.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 g=new pt('<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");g.isActive=this.isGridVisible,g.onClick=function(){o.isGridVisible=!o.isGridVisible,g.isActive=o.isGridVisible},a.addButton(g);var c=new pt('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(c.isActive=this.zoomToCropEnabled,c.onClick=function(){o.zoomToCropEnabled=!o.zoomToCropEnabled,c.isActive=o.zoomToCropEnabled},a.addButton(c),!Ut.isLicensed){var $=new at;this.topToolbar.addElementBlock($);var Ue=document.createElement("div");Ue.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var ve=document.createElement("a");ve.style.color="currentColor",ve.href="https://markerjs.com/products/cropro",ve.target="_blank",ve.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',Ue.appendChild(ve),$.addElement(Ue)}var mt=new an;mt.minWidth=3*this.toolbarHeight+"px",mt.contentAlign="end",this.topToolbar.addButtonBlock(mt);var ze=new pt('<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");ze.onClick=this.startRenderAndClose,mt.addButton(ze),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ze.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var At=new pt('<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");At.onClick=this.close,mt.addButton(At),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(At.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},h.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new cn,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 an;a.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(a);var u=new pt('<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 g=new pt('<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");g.onClick=this.rotateRightButtonClicked,a.addButton(g);var c=new at;c.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(c),this.straightener=new An("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(mt){o.rotateBy(mt),o.straightener.angle=o.rotationAngle},c.addElement(this.straightener.getUI());var $=new an;$.minWidth=2*this.toolbarHeight+"px",$.contentAlign="end",this.bottomToolbar.addButtonBlock($);var Ue=new pt('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");Ue.onClick=this.flipHorizontallyButtonClicked,$.addButton(Ue);var ve=new pt('<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");ve.onClick=this.flipVerticallyButtonClicked,$.addButton(ve)},h.prototype.ratioButtonClicked=function(o){this.aspectRatio=o,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},h.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=hn.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},h.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Zt(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},h.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},h.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},h.prototype.restoreState=function(o){if(o){var a=this.cropLayer.getRescaledRect(o.width,o.height,this.imageWidth,this.imageHeight,o.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(a),this.cropRectChanged(a),this.flippedHorizontally=o.flippedHorizontally,this.flippedVertically=o.flippedVertically,this.applyFlip(),this.rotationAngle=o.rotationAngle,this.applyRotation()}},h.prototype.clientToLocalCoordinates=function(o,a){var u=this.cropImage.getBoundingClientRect();return{x:o-u.left,y:a-u.top}},h.prototype.onWindowResize=function(){this.positionUI()},h.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var o=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},h.prototype.rotateLeftButtonClicked=function(){var o=this.rotationAngle-90;this.rotationAngle%90!=0&&(o+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(o)},h.prototype.rotateRightButtonClicked=function(){var o=this.rotationAngle+90;this.rotationAngle%90!=0&&(o-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(o)},h.prototype.rotateTo=function(o){o=(o=o>180?o-360:o)<=-180?o+360:o,this.rotationAngle=o,this.applyRotation()},h.prototype.rotateBy=function(o){this.rotateTo((this.rotationAngle+o)%360)},h.prototype.applyRotation=function(){var o=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var a=this.editingTargetRotationContainer.transform.baseVal.getItem(0);a.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(a,0);var u=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/u.width,this.imageHeight/u.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=o},h.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},h.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},h.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},h.prototype.startRenderAndClose=function(){return wt(this,void 0,void 0,function(){var o,a;return en(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(g){return g(o,a)}),this.close(!0),[2]}})})},h.prototype.render=function(){return wt(this,void 0,void 0,function(){var o;return en(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(),ht.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,o.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return a.sent(),[4,o.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,a.sent()]}})})},h.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new nn("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 nn("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new nn("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new nn("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 nn("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new nn("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new Xt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Xt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new nn("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 nn("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new nn("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 nn("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 nn("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},h.instanceCounter=0,h}(),kt=v("8hTe"),ri=v.n(kt),hi=/<pre[^>]*>/g;function di(h){var o=document.createElement("div");return o.innerHTML=h,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var Li=Ze.a=function(h){var o=h.value,a=o===void 0?"":o,u=h.edit,g=u===void 0?!1:u,c=h.className,$=h.showTextOnly,Ue=h.showLines,ve=h.replaces,mt=h.zoomImg,ze=h.hasMask,At=h.style,jt=At===void 0?{}:At,zt=h.stylesPrev,Vn=zt===void 0?{}:zt,Xn=String(a),vn=Object(T.useRef)(),Zn=Object(T.useRef)(),Xi=Object(T.useState)(""),Pn=Object(k.a)(Xi,2),Dn=Pn[0],oi=Pn[1],yi=Object(T.useState)("office"),qn=Object(k.a)(yi,2),ai=qn[0],Kn=qn[1],fr=function(){var Ft=new Je(Zn.current);Ft.displayMode="popup",Ft.addRenderEventListener(function(){var En=Object(z.a)(I.a.mark(function Wt(_n){var Qt;return I.a.wrap(function(pn){for(;;)switch(pn.prev=pn.next){case 0:return vn.current.style.display="none",pn.next=3,Object(Me.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:_n}});case 3:Qt=pn.sent,Qt!=null&&Qt.id&&ve(Zn.current.getAttribute("src").replace(G.a.API_SERVER,""),"/api/attachments/".concat(Qt==null?void 0:Qt.id,"?type=").concat(Qt.content_type));case 5:case"end":return pn.stop()}},Wt)}));return function(Wt){return En.apply(this,arguments)}}()),Ft.show()},Ki=function(){var Ft=new _t(Zn.current);Ft.settings.displayMode="popup",Ft.addEventListener("render",function(){var En=Object(z.a)(I.a.mark(function Wt(_n){var Qt;return I.a.wrap(function(pn){for(;;)switch(pn.prev=pn.next){case 0:if(vn.current.style.display="none",!Zn.current){pn.next=6;break}return pn.next=4,Object(Me.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:_n.dataUrl}});case 4:Qt=pn.sent,Qt!=null&&Qt.id&&ve(Zn.current.getAttribute("src").replace(G.a.API_SERVER,""),"/api/attachments/".concat(Qt==null?void 0:Qt.id,"?type=").concat(Qt.content_type));case 6:case"end":return pn.stop()}},Wt)}));return function(Wt){return En.apply(this,arguments)}}()),Ft.show(),window.markerArea=Ft},Fn=Object(T.useMemo)(function(){try{var ln=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ft=/\"\/api\/attachments\/|\"\/attachments\/download\//g,En=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Xn=Xn.replace(ln,"("+G.a.API_SERVER+"/api/attachments/").replace(Ft,'"'+G.a.API_SERVER+"/api/attachments/").replace(En,'"'+G.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,`
|
|
`),Xn=Xn.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
|
|
`)}catch(bi){}var Wt=P(Xn),_n=de();if(Xn.match(/\[TOC\]/)&&(Wt=Wt.replace("<p>[TOC]</p>",Fe()),$e()),Wt=Wt.replace(/(__special_katext_id_\d+__)/g,function(bi,pn){var mn=_n[pn],si=mn.type,xi=mn.expression;return Object(oe.renderToString)(di(xi)||"",{displayMode:si==="block",throwOnError:!1,output:"html"})}),Wt=Wt.replace(/▁/g,"\u2581\u2581\u2581"),Q(),$){var Qt=document.createElement("div");return Qt.innerHTML=Wt,Qt.innerText}return setTimeout(function(){return Pi()},500),Wt},[Xn]),Wn=Object(T.useRef)();ye.WebkitLineClamp=Ue,Ue&&(jt=Object(D.a)(Object(D.a)({},jt),ye));function Oi(ln){var Ft=ln.target;if(Ft.tagName.toUpperCase()==="IMG"){if(mt){var En=Ft.getAttribute("src");oi(En),Kn("image")}}else if(Ft.tagName.toUpperCase()==="A"){var Wt=Ft.getAttribute("href");if(Wt.indexOf("office")>-1)ln.preventDefault(),oi(Wt),Kn("office");else if(Wt.indexOf("application/pdf")>-1)ln.preventDefault(),oi(Wt),Kn("pdf");else if(Wt.indexOf("type=text")>-1)ln.preventDefault(),oi(Wt),Kn("html");else if(Wt.startsWith("#")){ln.preventDefault();var _n=document.getElementById(Wt.replace("#",""));_n&&_n.scrollIntoView(!0)}}}var Pi=function(){var Ft,En=(Ft=Wn.current)===null||Ft===void 0?void 0:Ft.querySelectorAll("video");En==null||En.forEach(function(Wt){if(Wt.oncontextmenu=function(){return!1},Wt.src.indexOf(".m3u8")>-1&&!Wt.canPlayType("application/vnd.apple.mpegurl")){if(S.a.isSupported()){var _n=new S.a;_n.loadSource(Wt.src),_n.attachMedia(Wt)}}})};Object(T.useEffect)(function(){if(Wn.current&&Fn&&(Fn.match(hi)&&window.PR.prettyPrint()),Wn.current)return Wn.current.addEventListener("click",Oi),function(){Wn.current.removeEventListener("click",Oi),Q(),$e()}},[Fn,Wn.current,Oi]);var Di=function(Ft){if(!g)return;Ft.target.nodeName==="IMG"?(vn.current.style.display="flex",vn.current.style.width=Ft.target.clientWidth+"px",vn.current.style.height=Ft.target.clientHeight+"px",vn.current.style.top=Ft.target.offsetTop+"px",vn.current.style.left=Ft.target.offsetLeft+"px",Zn.current.src=Ft.target.getAttribute("src")):vn.current.style.display="none"};return R.a.createElement("div",{style:{position:"relative"}},R.a.createElement("div",{ref:Wn,style:Object(D.a)({},jt),className:"".concat(c||""," markdown-body ").concat(ri.a.mdBody),onMouseOver:Di,dangerouslySetInnerHTML:{__html:Fn}}),R.a.createElement("div",{ref:vn,className:ri.a.button},R.a.createElement(se.a,null,R.a.createElement(ue.a,{onClick:function(){return fr()}},"\u88C1\u526A"),R.a.createElement(ue.a,{onClick:function(){return Ki()}},"\u7F16\u8F91"))),R.a.createElement("img",{ref:Zn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),R.a.createElement(Ce.a,{close:!0,data:Dn,hasMask:ze,type:Dn!=null&&Dn.length?ai:"",style:Object(D.a)({},Vn),onClose:function(){return oi("")}}))}},"9VGf":function(et,Ze,v){"use strict";v.d(Ze,"a",function(){return re});var H=v("q1tI"),se=v.n(H);function re(ue,D){var z=Object(H.useRef)();Object(H.useEffect)(function(){z.current=ue}),Object(H.useEffect)(function(){function k(){z.current()}if(D!==null){var E=setInterval(k,D);return function(){return clearInterval(E)}}},[D])}},Ag4I:function(et,Ze,v){et.exports={btn:"btn___29MAz",s1:"s1___zqpou",s2:"s2___20rMI"}},Bd2K:function(et,Ze,v){(function(H){H(v("VrN/"),v("osHv"))})(function(H){H.defineOption("autoCloseTags",!1,function(I,T,R){if(R!=H.Init&&R&&I.removeKeyMap("autoCloseTags"),!T)return;var C={name:"autoCloseTags"};(typeof T!="object"||T.whenClosing!==!1)&&(C["'/'"]=function(te){return z(te)}),(typeof T!="object"||T.whenOpening!==!1)&&(C["'>'"]=function(te){return ue(te)}),I.addKeyMap(C)});var se=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],re=["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 ue(I){if(I.getOption("disableInput"))return H.Pass;for(var T=I.listSelections(),R=[],C=I.getOption("autoCloseTags"),te=0;te<T.length;te++){if(!T[te].empty())return H.Pass;var Z=T[te].head,B=I.getTokenAt(Z),J=H.innerMode(I.getMode(),B.state),F=J.state,ce=J.mode.xmlCurrentTag&&J.mode.xmlCurrentTag(F),ne=ce&&ce.name;if(!ne)return H.Pass;var Pe=J.mode.configuration=="html",$e=typeof C=="object"&&C.dontCloseTags||Pe&&se,ye=typeof C=="object"&&C.indentTags||Pe&&re;B.end>Z.ch&&(ne=ne.slice(0,ne.length-B.end+Z.ch));var Le=ne.toLowerCase();if(!ne||B.type=="string"&&(B.end!=Z.ch||!/[\"\']/.test(B.string.charAt(B.string.length-1))||B.string.length==1)||B.type=="tag"&&ce.close||B.string.indexOf("/")==Z.ch-B.start-1||$e&&k($e,Le)>-1||E(I,J.mode.xmlCurrentContext&&J.mode.xmlCurrentContext(F)||[],ne,Z,!0))return H.Pass;var Fe=typeof C=="object"&&C.emptyTags;if(Fe&&k(Fe,ne)>-1){R[te]={text:"/>",newPos:H.Pos(Z.line,Z.ch+2)};continue}var xe=ye&&k(ye,Le)>-1;R[te]={indent:xe,text:">"+(xe?`
|
|
|
|
`:"")+"</"+ne+">",newPos:xe?H.Pos(Z.line+1,0):H.Pos(Z.line,Z.ch+1)}}for(var Se=typeof C=="object"&&C.dontIndentOnAutoClose,te=T.length-1;te>=0;te--){var Oe=R[te];I.replaceRange(Oe.text,T[te].head,T[te].anchor,"+insert");var Ee=I.listSelections().slice(0);Ee[te]={head:Oe.newPos,anchor:Oe.newPos},I.setSelections(Ee),!Se&&Oe.indent&&(I.indentLine(Oe.newPos.line,null,!0),I.indentLine(Oe.newPos.line+1,null,!0))}}function D(I,T){for(var R=I.listSelections(),C=[],te=T?"/":"</",Z=I.getOption("autoCloseTags"),B=typeof Z=="object"&&Z.dontIndentOnSlash,J=0;J<R.length;J++){if(!R[J].empty())return H.Pass;var F=R[J].head,ce=I.getTokenAt(F),ne=H.innerMode(I.getMode(),ce.state),Pe=ne.state;if(T&&(ce.type=="string"||ce.string.charAt(0)!="<"||ce.start!=F.ch-1))return H.Pass;var $e,ye=ne.mode.name!="xml"&&I.getMode().name=="htmlmixed";if(ye&&ne.mode.name=="javascript")$e=te+"script";else if(ye&&ne.mode.name=="css")$e=te+"style";else{var Le=ne.mode.xmlCurrentContext&&ne.mode.xmlCurrentContext(Pe);if(!Le||Le.length&&E(I,Le,Le[Le.length-1],F))return H.Pass;$e=te+Le[Le.length-1]}I.getLine(F.line).charAt(ce.end)!=">"&&($e+=">"),C[J]=$e}if(I.replaceSelections(C),R=I.listSelections(),!B)for(var J=0;J<R.length;J++)(J==R.length-1||R[J].head.line<R[J+1].head.line)&&I.indentLine(R[J].head.line)}function z(I){return I.getOption("disableInput")?H.Pass:D(I,!0)}H.commands.closeTag=function(I){return D(I)};function k(I,T){if(I.indexOf)return I.indexOf(T);for(var R=0,C=I.length;R<C;++R)if(I[R]==T)return R;return-1}function E(I,T,R,C,te){if(!H.scanForClosingTag)return!1;var Z=Math.min(I.lastLine()+1,C.line+500),B=H.scanForClosingTag(I,C,null,Z);if(!B||B.tag!=R)return!1;for(var J=te?1:0,F=T.length-1;F>=0&&T[F]==R;F--)++J;C=B.to;for(var F=1;F<J;F++){var ce=H.scanForClosingTag(I,C,null,Z);if(!ce||ce.tag!=R)return!1;C=ce.to}return!0}})},BjJ7:function(et,Ze,v){"use strict";v.d(Ze,"d",function(){return se}),v.d(Ze,"c",function(){return re}),v.d(Ze,"e",function(){return ue}),v.d(Ze,"b",function(){return D}),v.d(Ze,"a",function(){return k});var H=v("m3rI");function se(E){var I=!0;if(E.length>0){for(var T=0;T<E.length;T++)if(E[T].compile_success==0||!E[T].compile_success){I=!1;break}}else I=!1;return I}function re(E){for(var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",T=[],R=0;R<E.length;R++){var C=E[R],te=I?"".concat(I,"/").concat(C.name):"".concat(C.name);T.push({title:C.name,isLeaf:!(C.type==="tree"),key:te})}return T}function ue(E,I,T){for(var R=0;R<E.length;R++){var C=E[R];if(C.key===I){C.children=T;break}C.children&&ue(C.children,I,T)}return E}function D(E,I,T){var R;return function(){var C=this,te=arguments,Z=function(){R=null,T||E.apply(C,te)},B=T&&!R;clearTimeout(R),R=setTimeout(Z,I),B&&E.apply(C,te)}}var z=!0,k=H.a.API_SERVER},"C+DQ":function(et,Ze,v){},D1Df:function(et,Ze,v){"use strict";function H(_){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?H=function(j){return typeof j}:H=function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},H(_)}function se(){return se=Object.assign||function(_){for(var W=1;W<arguments.length;W++){var j=arguments[W];for(var A in j)Object.prototype.hasOwnProperty.call(j,A)&&(_[A]=j[A])}return _},se.apply(this,arguments)}function re(_,W){var j=Object.keys(_);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(_);W&&(A=A.filter(function(P){return Object.getOwnPropertyDescriptor(_,P).enumerable})),j.push.apply(j,A)}return j}function ue(_){for(var W=1;W<arguments.length;W++){var j=arguments[W]!=null?arguments[W]:{};W%2?re(j,!0).forEach(function(A){B(_,A,j[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(_,Object.getOwnPropertyDescriptors(j)):re(j).forEach(function(A){Object.defineProperty(_,A,Object.getOwnPropertyDescriptor(j,A))})}return _}function D(_,W){if(_==null)return{};var j=z(_,W),A,P;if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(_);for(P=0;P<p.length;P++){if(A=p[P],W.indexOf(A)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(_,A))continue;j[A]=_[A]}}return j}function z(_,W){if(_==null)return{};var j={},A=Object.keys(_),P,p;for(p=0;p<A.length;p++){if(P=A[p],W.indexOf(P)>=0)continue;j[P]=_[P]}return j}function k(_,W){if(!(_ instanceof W))throw new TypeError("Cannot call a class as a function")}function E(_,W){for(var j=0;j<W.length;j++){var A=W[j];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(_,A.key,A)}}function I(_,W,j){return W&&E(_.prototype,W),j&&E(_,j),_}function T(_,W){return W&&(H(W)==="object"||typeof W=="function")?W:C(_)}function R(_){return R=Object.setPrototypeOf?Object.getPrototypeOf:function(j){return j.__proto__||Object.getPrototypeOf(j)},R(_)}function C(_){if(_===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _}function te(_,W){if(typeof W!="function"&&W!==null)throw new TypeError("Super expression must either be null or a function");_.prototype=Object.create(W&&W.prototype,{constructor:{value:_,writable:!0,configurable:!0}}),W&&Z(_,W)}function Z(_,W){return Z=Object.setPrototypeOf||function(A,P){return A.__proto__=P,A},Z(_,W)}function B(_,W,j){return W in _?Object.defineProperty(_,W,{value:j,enumerable:!0,configurable:!0,writable:!0}):_[W]=j,_}var J=v("q1tI"),F=v("17x9"),ce=v("H38U"),ne=v("aRTE");function Pe(_){for(var W="",j=0;j<_.length;j++){var A=_.charCodeAt(j);A<128?W+=String.fromCharCode(A):A<2048?(W+=String.fromCharCode(192|A>>6),W+=String.fromCharCode(128|A&63)):A<55296||A>=57344?(W+=String.fromCharCode(224|A>>12),W+=String.fromCharCode(128|A>>6&63),W+=String.fromCharCode(128|A&63)):(j++,A=65536+((A&1023)<<10|_.charCodeAt(j)&1023),W+=String.fromCharCode(240|A>>18),W+=String.fromCharCode(128|A>>12&63),W+=String.fromCharCode(128|A>>6&63),W+=String.fromCharCode(128|A&63))}return W}var $e={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},ye={},Le=4,Fe=.1;function xe(_){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,j=[];return _.forEach(function(A,P){var p=null;A.forEach(function(d,S){if(!d&&p!==null){j.push("M".concat(p+W," ").concat(P+W,"h").concat(S-p,"v1H").concat(p+W,"z")),p=null;return}if(S===A.length-1){if(!d)return;p===null?j.push("M".concat(S+W,",").concat(P+W," h1v1H").concat(S+W,"z")):j.push("M".concat(p+W,",").concat(P+W," h").concat(S+1-p,"v1H").concat(p+W,"z"));return}d&&p===null&&(p=S)})}),j.join("")}function Se(_,W){return _.slice().map(function(j,A){return A<W.y||A>=W.y+W.h?j:j.map(function(P,p){return p<W.x||p>=W.x+W.w?P:!1})})}function Oe(_,W){var j=_.imageSettings,A=_.size,P=_.includeMargin;if(j==null)return null;var p=P?Le:0,d=W.length+p*2,S=Math.floor(A*Fe),G=d/A,oe=(j.width||S)*G,Ce=(j.height||S)*G,Me=j.x==null?W.length/2-oe/2:j.x*G,me=j.y==null?W.length/2-Ce/2:j.y*G,_e=null;if(j.excavate){var ge=Math.floor(Me),le=Math.floor(me),ee=Math.ceil(oe+Me-ge),V=Math.ceil(Ce+me-le);_e={x:ge,y:le,w:ee,h:V}}return{x:Me,y:me,h:Ce,w:oe,excavation:_e}}var Ee=function(){try{new Path2D().addPath(new Path2D)}catch(_){return!1}return!0}(),O=function(_){te(W,_);function W(){var j,A;k(this,W);for(var P=arguments.length,p=new Array(P),d=0;d<P;d++)p[d]=arguments[d];return A=T(this,(j=R(W)).call.apply(j,[this].concat(p))),B(C(A),"_canvas",void 0),B(C(A),"_image",void 0),B(C(A),"state",{imgLoaded:!1}),B(C(A),"handleImageLoad",function(){A.setState({imgLoaded:!0})}),A}return I(W,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var A=this.props,P=A.value,p=A.size,d=A.level,S=A.bgColor,G=A.fgColor,oe=A.includeMargin,Ce=A.imageSettings,Me=new ce(-1,ne[d]);if(Me.addData(Pe(P)),Me.make(),this._canvas!=null){var me=this._canvas,_e=me.getContext("2d");if(!_e)return;var ge=Me.modules;if(ge===null)return;var le=oe?Le:0,ee=ge.length+le*2,V=Oe(this.props,ge);Ce!=null&&V!=null&&(V.excavation!=null&&(ge=Se(ge,V.excavation)));var b=window.devicePixelRatio||1;me.height=me.width=p*b;var X=p/ee*b;_e.scale(X,X),_e.fillStyle=S,_e.fillRect(0,0,ee,ee),_e.fillStyle=G,Ee?_e.fill(new Path2D(xe(ge,le))):ge.forEach(function(M,be){M.forEach(function(Ae,ae){Ae&&_e.fillRect(ae+le,be+le,1,1)})}),this.state.imgLoaded&&this._image&&V!=null&&_e.drawImage(this._image,V.x+le,V.y+le,V.w,V.h)}}},{key:"render",value:function(){var A=this,P=this.props,p=P.value,d=P.size,S=P.level,G=P.bgColor,oe=P.fgColor,Ce=P.style,Me=P.includeMargin,me=P.imageSettings,_e=D(P,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),ge=ue({height:d,width:d},Ce),le=null,ee=me&&me.src;return me!=null&&ee!=null&&(le=J.createElement("img",{src:ee,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(b){return A._image=b}})),J.createElement(J.Fragment,null,J.createElement("canvas",se({style:ge,height:d,width:d,ref:function(b){return A._canvas=b}},_e)),le)}}]),W}(J.PureComponent);B(O,"defaultProps",$e);var de=function(_){te(W,_);function W(){return k(this,W),T(this,R(W).apply(this,arguments))}return I(W,[{key:"render",value:function(){var A=this.props,P=A.value,p=A.size,d=A.level,S=A.bgColor,G=A.fgColor,oe=A.includeMargin,Ce=A.imageSettings,Me=D(A,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),me=new ce(-1,ne[d]);me.addData(Pe(P)),me.make();var _e=me.modules;if(_e===null)return null;var ge=oe?Le:0,le=_e.length+ge*2,ee=Oe(this.props,_e),V=null;Ce!=null&&ee!=null&&(ee.excavation!=null&&(_e=Se(_e,ee.excavation)),V=J.createElement("image",{xlinkHref:Ce.src,height:ee.h,width:ee.w,x:ee.x+ge,y:ee.y+ge,preserveAspectRatio:"none"}));var b=xe(_e,ge);return J.createElement("svg",se({shapeRendering:"crispEdges",height:p,width:p,viewBox:"0 0 ".concat(le," ").concat(le)},Me),J.createElement("path",{fill:S,d:"M0,0 h".concat(le,"v").concat(le,"H0z")}),J.createElement("path",{fill:G,d:b}),V)}}]),W}(J.PureComponent);B(de,"defaultProps",$e);var Q=function(W){var j=W.renderAs,A=D(W,["renderAs"]),P=j==="svg"?de:O;return J.createElement(P,A)};Q.defaultProps=ue({renderAs:"canvas"},$e),et.exports=Q},DlQD:function(et,Ze,v){(function(H,se){et.exports=se()})(this,function(){"use strict";function H(q,Y){for(var ie=0;ie<Y.length;ie++){var x=Y[ie];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(q,x.key,x)}}function se(q,Y,ie){return Y&&H(q.prototype,Y),ie&&H(q,ie),q}function re(q,Y){if(!q)return;if(typeof q=="string")return ue(q,Y);var ie=Object.prototype.toString.call(q).slice(8,-1);if(ie==="Object"&&q.constructor&&(ie=q.constructor.name),ie==="Map"||ie==="Set")return Array.from(q);if(ie==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ie))return ue(q,Y)}function ue(q,Y){(Y==null||Y>q.length)&&(Y=q.length);for(var ie=0,x=new Array(Y);ie<Y;ie++)x[ie]=q[ie];return x}function D(q,Y){var ie;if(typeof Symbol=="undefined"||q[Symbol.iterator]==null){if(Array.isArray(q)||(ie=re(q))||Y&&q&&typeof q.length=="number"){ie&&(q=ie);var x=0;return function(){return x>=q.length?{done:!0}:{done:!1,value:q[x++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return ie=q[Symbol.iterator](),ie.next.bind(ie)}function z(q,Y){return Y={exports:{}},q(Y,Y.exports),Y.exports}var k=z(function(q){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 ie(x){q.exports.defaults=x}q.exports={defaults:Y(),getDefaults:Y,changeDefaults:ie}}),E=k.defaults,I=k.getDefaults,T=k.changeDefaults,R=/[&<>"']/,C=/[&<>"']/g,te=/[<>"']|&(?!#?\w+;)/,Z=/[<>"']|&(?!#?\w+;)/g,B={"&":"&","<":"<",">":">",'"':""","'":"'"},J=function(Y){return B[Y]};function F(q,Y){if(Y){if(R.test(q))return q.replace(C,J)}else if(te.test(q))return q.replace(Z,J);return q}var ce=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ne(q){return q.replace(ce,function(Y,ie){return ie=ie.toLowerCase(),ie==="colon"?":":ie.charAt(0)==="#"?ie.charAt(1)==="x"?String.fromCharCode(parseInt(ie.substring(2),16)):String.fromCharCode(+ie.substring(1)):""})}var Pe=/(^|[^\[])\^/g;function $e(q,Y){q=q.source||q,Y=Y||"";var ie={replace:function(w,L){return L=L.source||L,L=L.replace(Pe,"$1"),q=q.replace(w,L),ie},getRegex:function(){return new RegExp(q,Y)}};return ie}var ye=/[^\w:]/g,Le=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Fe(q,Y,ie){if(q){var x;try{x=decodeURIComponent(ne(ie)).replace(ye,"").toLowerCase()}catch(w){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}Y&&!Le.test(ie)&&(ie=O(Y,ie));try{ie=encodeURI(ie).replace(/%25/g,"%")}catch(w){return null}return ie}var xe={},Se=/^[^:]+:\/*[^/]*$/,Oe=/^([^:]+:)[\s\S]*$/,Ee=/^([^:]+:\/*[^/]*)[\s\S]*$/;function O(q,Y){xe[" "+q]||(Se.test(q)?xe[" "+q]=q+"/":xe[" "+q]=W(q,"/",!0)),q=xe[" "+q];var ie=q.indexOf(":")===-1;return Y.substring(0,2)==="//"?ie?Y:q.replace(Oe,"$1")+Y:Y.charAt(0)==="/"?ie?Y:q.replace(Ee,"$1")+Y:q+Y}var de={exec:function(){}};function Q(q){for(var Y=1,ie,x;Y<arguments.length;Y++){ie=arguments[Y];for(x in ie)Object.prototype.hasOwnProperty.call(ie,x)&&(q[x]=ie[x])}return q}function _(q,Y){var ie=q.replace(/\|/g,function(L,N,fe){for(var ke=!1,Ye=N;--Ye>=0&&fe[Ye]==="\\";)ke=!ke;return ke?"|":" |"}),x=ie.split(/ \|/),w=0;if(x.length>Y)x.splice(Y);else for(;x.length<Y;)x.push("");for(;w<x.length;w++)x[w]=x[w].trim().replace(/\\\|/g,"|");return x}function W(q,Y,ie){var x=q.length;if(x===0)return"";for(var w=0;w<x;){var L=q.charAt(x-w-1);if(L===Y&&!ie)w++;else if(L!==Y&&ie)w++;else break}return q.substr(0,x-w)}function j(q,Y){if(q.indexOf(Y[1])===-1)return-1;for(var ie=q.length,x=0,w=0;w<ie;w++)if(q[w]==="\\")w++;else if(q[w]===Y[0])x++;else if(q[w]===Y[1]&&(x--,x<0))return w;return-1}function A(q){q&&q.sanitize&&!q.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 P={escape:F,unescape:ne,edit:$e,cleanUrl:Fe,resolveUrl:O,noopTest:de,merge:Q,splitCells:_,rtrim:W,findClosingBracket:j,checkSanitizeDeprecation:A},p=k.defaults,d=P.rtrim,S=P.splitCells,G=P.escape,oe=P.findClosingBracket;function Ce(q,Y,ie){var x=Y.href,w=Y.title?G(Y.title):null,L=q[1].replace(/\\([\[\]])/g,"$1");return q[0].charAt(0)!=="!"?{type:"link",raw:ie,href:x,title:w,text:L}:{type:"image",raw:ie,href:x,title:w,text:G(L)}}function Me(q,Y){var ie=q.match(/^(\s+)(?:```)/);if(ie===null)return Y;var x=ie[1];return Y.split(`
|
|
`).map(function(w){var L=w.match(/^\s+/);if(L===null)return w;var N=L[0];return N.length>=x.length?w.slice(x.length):w}).join(`
|
|
`)}var me=function(){function q(ie){this.options=ie||p}var Y=q.prototype;return Y.space=function(x){var w=this.rules.block.newline.exec(x);if(w)return w[0].length>1?{type:"space",raw:w[0]}:{raw:`
|
|
`}},Y.code=function(x,w){var L=this.rules.block.code.exec(x);if(L){var N=w[w.length-1];if(N&&N.type==="paragraph")return{raw:L[0],text:L[0].trimRight()};var fe=L[0].replace(/^ {4}/gm,"");return{type:"code",raw:L[0],codeBlockStyle:"indented",text:this.options.pedantic?fe:d(fe,`
|
|
`)}}},Y.fences=function(x){var w=this.rules.block.fences.exec(x);if(w){var L=w[0],N=Me(L,w[3]||"");return{type:"code",raw:L,lang:w[2]?w[2].trim():w[2],text:N}}},Y.heading=function(x){var w=this.rules.block.heading.exec(x);if(w)return{type:"heading",raw:w[0],depth:w[1].length,text:w[2]}},Y.nptable=function(x){var w=this.rules.block.nptable.exec(x);if(w){var L={type:"table",header:S(w[1].replace(/^ *| *\| *$/g,"")),align:w[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:w[3]?w[3].replace(/\n$/,"").split(`
|
|
`):[],raw:w[0]};if(L.header.length===L.align.length){var N=L.align.length,fe;for(fe=0;fe<N;fe++)/^ *-+: *$/.test(L.align[fe])?L.align[fe]="right":/^ *:-+: *$/.test(L.align[fe])?L.align[fe]="center":/^ *:-+ *$/.test(L.align[fe])?L.align[fe]="left":L.align[fe]=null;for(N=L.cells.length,fe=0;fe<N;fe++)L.cells[fe]=S(L.cells[fe],L.header.length);return L}}},Y.hr=function(x){var w=this.rules.block.hr.exec(x);if(w)return{type:"hr",raw:w[0]}},Y.blockquote=function(x){var w=this.rules.block.blockquote.exec(x);if(w){var L=w[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:w[0],text:L}}},Y.list=function(x){var w=this.rules.block.list.exec(x);if(w){for(var L=w[0],N=w[2],fe=N.length>1,ke=N[N.length-1]===")",Ye={type:"list",raw:L,ordered:fe,start:fe?+N.slice(0,-1):"",loose:!1,items:[]},bt=w[0].match(this.rules.block.item),Rt=!1,We,Ct,gt,ot,vt,_t,Mt,Lt=bt.length,wt=0;wt<Lt;wt++)We=bt[wt],L=We,Ct=We.length,We=We.replace(/^ *([*+-]|\d+[.)]) */,""),~We.indexOf(`
|
|
`)&&(Ct-=We.length,We=this.options.pedantic?We.replace(/^ {1,4}/gm,""):We.replace(new RegExp("^ {1,"+Ct+"}","gm"),"")),wt!==Lt-1&&(gt=this.rules.block.bullet.exec(bt[wt+1])[0],(fe?gt.length===1||!ke&>[gt.length-1]===")":gt.length>1||this.options.smartLists&>!==N)&&(ot=bt.slice(wt+1).join(`
|
|
`),Ye.raw=Ye.raw.substring(0,Ye.raw.length-ot.length),wt=Lt-1)),vt=Rt||/\n\n(?!\s*$)/.test(We),wt!==Lt-1&&(Rt=We.charAt(We.length-1)===`
|
|
`,vt||(vt=Rt)),vt&&(Ye.loose=!0),_t=/^\[[ xX]\] /.test(We),Mt=void 0,_t&&(Mt=We[1]!==" ",We=We.replace(/^\[[ xX]\] +/,"")),Ye.items.push({type:"list_item",raw:L,task:_t,checked:Mt,loose:vt,text:We});return Ye}},Y.html=function(x){var w=this.rules.block.html.exec(x);if(w)return{type:this.options.sanitize?"paragraph":"html",raw:w[0],pre:!this.options.sanitizer&&(w[1]==="pre"||w[1]==="script"||w[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(w[0]):G(w[0]):w[0]}},Y.def=function(x){var w=this.rules.block.def.exec(x);if(w){w[3]&&(w[3]=w[3].substring(1,w[3].length-1));var L=w[1].toLowerCase().replace(/\s+/g," ");return{tag:L,raw:w[0],href:w[2],title:w[3]}}},Y.table=function(x){var w=this.rules.block.table.exec(x);if(w){var L={type:"table",header:S(w[1].replace(/^ *| *\| *$/g,"")),align:w[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:w[3]?w[3].replace(/\n$/,"").split(`
|
|
`):[]};if(L.header.length===L.align.length){L.raw=w[0];var N=L.align.length,fe;for(fe=0;fe<N;fe++)/^ *-+: *$/.test(L.align[fe])?L.align[fe]="right":/^ *:-+: *$/.test(L.align[fe])?L.align[fe]="center":/^ *:-+ *$/.test(L.align[fe])?L.align[fe]="left":L.align[fe]=null;for(N=L.cells.length,fe=0;fe<N;fe++)L.cells[fe]=S(L.cells[fe].replace(/^ *\| *| *\| *$/g,""),L.header.length);return L}}},Y.lheading=function(x){var w=this.rules.block.lheading.exec(x);if(w)return{type:"heading",raw:w[0],depth:w[2].charAt(0)==="="?1:2,text:w[1]}},Y.paragraph=function(x){var w=this.rules.block.paragraph.exec(x);if(w)return{type:"paragraph",raw:w[0],text:w[1].charAt(w[1].length-1)===`
|
|
`?w[1].slice(0,-1):w[1]}},Y.text=function(x,w){var L=this.rules.block.text.exec(x);if(L){var N=w[w.length-1];return N&&N.type==="text"?{raw:L[0],text:L[0]}:{type:"text",raw:L[0],text:L[0]}}},Y.escape=function(x){var w=this.rules.inline.escape.exec(x);if(w)return{type:"escape",raw:w[0],text:G(w[1])}},Y.tag=function(x,w,L){var N=this.rules.inline.tag.exec(x);if(N)return!w&&/^<a /i.test(N[0])?w=!0:w&&/^<\/a>/i.test(N[0])&&(w=!1),!L&&/^<(pre|code|kbd|script)(\s|>)/i.test(N[0])?L=!0:L&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(N[0])&&(L=!1),{type:this.options.sanitize?"text":"html",raw:N[0],inLink:w,inRawBlock:L,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(N[0]):G(N[0]):N[0]}},Y.link=function(x){var w=this.rules.inline.link.exec(x);if(w){var L=oe(w[2],"()");if(L>-1){var N=w[0].indexOf("!")===0?5:4,fe=N+w[1].length+L;w[2]=w[2].substring(0,L),w[0]=w[0].substring(0,fe).trim(),w[3]=""}var ke=w[2],Ye="";if(this.options.pedantic){var bt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ke);bt?(ke=bt[1],Ye=bt[3]):Ye=""}else Ye=w[3]?w[3].slice(1,-1):"";ke=ke.trim().replace(/^<([\s\S]*)>$/,"$1");var Rt=Ce(w,{href:ke&&ke.replace(this.rules.inline._escapes,"$1"),title:Ye&&Ye.replace(this.rules.inline._escapes,"$1")},w[0]);return Rt}},Y.reflink=function(x,w){var L;if((L=this.rules.inline.reflink.exec(x))||(L=this.rules.inline.nolink.exec(x))){var N=(L[2]||L[1]).replace(/\s+/g," ");if(N=w[N.toLowerCase()],!N||!N.href){var fe=L[0].charAt(0);return{type:"text",raw:fe,text:fe}}var ke=Ce(L,N,L[0]);return ke}},Y.strong=function(x,w,L){L===void 0&&(L="");var N=this.rules.inline.strong.start.exec(x);if(N&&(!N[1]||N[1]&&(L===""||this.rules.inline.punctuation.exec(L)))){w=w.slice(-1*x.length);var fe=N[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;fe.lastIndex=0;for(var ke;(N=fe.exec(w))!=null;)if(ke=this.rules.inline.strong.middle.exec(w.slice(0,N.index+3)),ke)return{type:"strong",raw:x.slice(0,ke[0].length),text:x.slice(2,ke[0].length-2)}}},Y.em=function(x,w,L){L===void 0&&(L="");var N=this.rules.inline.em.start.exec(x);if(N&&(!N[1]||N[1]&&(L===""||this.rules.inline.punctuation.exec(L)))){w=w.slice(-1*x.length);var fe=N[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;fe.lastIndex=0;for(var ke;(N=fe.exec(w))!=null;)if(ke=this.rules.inline.em.middle.exec(w.slice(0,N.index+2)),ke)return{type:"em",raw:x.slice(0,ke[0].length),text:x.slice(1,ke[0].length-1)}}},Y.codespan=function(x){var w=this.rules.inline.code.exec(x);if(w){var L=w[2].replace(/\n/g," "),N=/[^ ]/.test(L),fe=L.startsWith(" ")&&L.endsWith(" ");return N&&fe&&(L=L.substring(1,L.length-1)),L=G(L,!0),{type:"codespan",raw:w[0],text:L}}},Y.br=function(x){var w=this.rules.inline.br.exec(x);if(w)return{type:"br",raw:w[0]}},Y.del=function(x){var w=this.rules.inline.del.exec(x);if(w)return{type:"del",raw:w[0],text:w[1]}},Y.autolink=function(x,w){var L=this.rules.inline.autolink.exec(x);if(L){var N,fe;return L[2]==="@"?(N=G(this.options.mangle?w(L[1]):L[1]),fe="mailto:"+N):(N=G(L[1]),fe=N),{type:"link",raw:L[0],text:N,href:fe,tokens:[{type:"text",raw:N,text:N}]}}},Y.url=function(x,w){var L;if(L=this.rules.inline.url.exec(x)){var N,fe;if(L[2]==="@")N=G(this.options.mangle?w(L[0]):L[0]),fe="mailto:"+N;else{var ke;do ke=L[0],L[0]=this.rules.inline._backpedal.exec(L[0])[0];while(ke!==L[0]);N=G(L[0]),L[1]==="www."?fe="http://"+N:fe=N}return{type:"link",raw:L[0],text:N,href:fe,tokens:[{type:"text",raw:N,text:N}]}}},Y.inlineText=function(x,w,L){var N=this.rules.inline.text.exec(x);if(N){var fe;return w?fe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(N[0]):G(N[0]):N[0]:fe=G(this.options.smartypants?L(N[0]):N[0]),{type:"text",raw:N[0],text:fe}}},q}(),_e=P.noopTest,ge=P.edit,le=P.merge,ee={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:_e,table:_e,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ee._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ee._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ee.def=ge(ee.def).replace("label",ee._label).replace("title",ee._title).getRegex(),ee.bullet=/(?:[*+-]|\d{1,9}[.)])/,ee.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ee.item=ge(ee.item,"gm").replace(/bull/g,ee.bullet).getRegex(),ee.list=ge(ee.list).replace(/bull/g,ee.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ee.def.source+")").getRegex(),ee._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",ee._comment=/<!--(?!-?>)[\s\S]*?-->/,ee.html=ge(ee.html,"i").replace("comment",ee._comment).replace("tag",ee._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ee.paragraph=ge(ee._paragraph).replace("hr",ee.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",ee._tag).getRegex(),ee.blockquote=ge(ee.blockquote).replace("paragraph",ee.paragraph).getRegex(),ee.normal=le({},ee),ee.gfm=le({},ee.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*|$)"}),ee.gfm.nptable=ge(ee.gfm.nptable).replace("hr",ee.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",ee._tag).getRegex(),ee.gfm.table=ge(ee.gfm.table).replace("hr",ee.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",ee._tag).getRegex(),ee.pedantic=le({},ee.normal,{html:ge(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ee._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:_e,paragraph:ge(ee.normal._paragraph).replace("hr",ee.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ee.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var V={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:_e,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:_e,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};V._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",V.punctuation=ge(V.punctuation).replace(/punctuation/g,V._punctuation).getRegex(),V._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",V._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",V.em.start=ge(V.em.start).replace(/punctuation/g,V._punctuation).getRegex(),V.em.middle=ge(V.em.middle).replace(/punctuation/g,V._punctuation).replace(/overlapSkip/g,V._overlapSkip).getRegex(),V.em.endAst=ge(V.em.endAst,"g").replace(/punctuation/g,V._punctuation).getRegex(),V.em.endUnd=ge(V.em.endUnd,"g").replace(/punctuation/g,V._punctuation).getRegex(),V.strong.start=ge(V.strong.start).replace(/punctuation/g,V._punctuation).getRegex(),V.strong.middle=ge(V.strong.middle).replace(/punctuation/g,V._punctuation).replace(/blockSkip/g,V._blockSkip).getRegex(),V.strong.endAst=ge(V.strong.endAst,"g").replace(/punctuation/g,V._punctuation).getRegex(),V.strong.endUnd=ge(V.strong.endUnd,"g").replace(/punctuation/g,V._punctuation).getRegex(),V.blockSkip=ge(V._blockSkip,"g").getRegex(),V.overlapSkip=ge(V._overlapSkip,"g").getRegex(),V._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,V._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,V._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])?)+(?![-_])/,V.autolink=ge(V.autolink).replace("scheme",V._scheme).replace("email",V._email).getRegex(),V._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,V.tag=ge(V.tag).replace("comment",ee._comment).replace("attribute",V._attribute).getRegex(),V._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,V._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,V._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,V.link=ge(V.link).replace("label",V._label).replace("href",V._href).replace("title",V._title).getRegex(),V.reflink=ge(V.reflink).replace("label",V._label).getRegex(),V.reflinkSearch=ge(V.reflinkSearch,"g").replace("reflink",V.reflink).replace("nolink",V.nolink).getRegex(),V.normal=le({},V),V.pedantic=le({},V.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:ge(/^!?\[(label)\]\((.*?)\)/).replace("label",V._label).getRegex(),reflink:ge(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",V._label).getRegex()}),V.gfm=le({},V.normal,{escape:ge(V.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),V.gfm.url=ge(V.gfm.url,"i").replace("email",V.gfm._extended_email).getRegex(),V.breaks=le({},V.gfm,{br:ge(V.br).replace("{2,}","*").getRegex(),text:ge(V.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var b={block:ee,inline:V},X=k.defaults,M=b.block,be=b.inline;function Ae(q){return q.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 ae(q){var Y="",ie,x,w=q.length;for(ie=0;ie<w;ie++)x=q.charCodeAt(ie),Math.random()>.5&&(x="x"+x.toString(16)),Y+="&#"+x+";";return Y}var Te=function(){function q(ie){this.tokens=[],this.tokens.links=Object.create(null),this.options=ie||X,this.options.tokenizer=this.options.tokenizer||new me,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var x={block:M.normal,inline:be.normal};this.options.pedantic?(x.block=M.pedantic,x.inline=be.pedantic):this.options.gfm&&(x.block=M.gfm,this.options.breaks?x.inline=be.breaks:x.inline=be.gfm),this.tokenizer.rules=x}q.lex=function(x,w){var L=new q(w);return L.lex(x)};var Y=q.prototype;return Y.lex=function(x){return x=x.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(x,this.tokens,!0),this.inline(this.tokens),this.tokens},Y.blockTokens=function(x,w,L){w===void 0&&(w=[]),L===void 0&&(L=!0),x=x.replace(/^ +$/gm,"");for(var N,fe,ke,Ye;x;){if(N=this.tokenizer.space(x)){x=x.substring(N.raw.length),N.type&&w.push(N);continue}if(N=this.tokenizer.code(x,w)){x=x.substring(N.raw.length),N.type?w.push(N):(Ye=w[w.length-1],Ye.raw+=`
|
|
`+N.raw,Ye.text+=`
|
|
`+N.text);continue}if(N=this.tokenizer.fences(x)){x=x.substring(N.raw.length),w.push(N);continue}if(N=this.tokenizer.heading(x)){x=x.substring(N.raw.length),w.push(N);continue}if(N=this.tokenizer.nptable(x)){x=x.substring(N.raw.length),w.push(N);continue}if(N=this.tokenizer.hr(x)){x=x.substring(N.raw.length),w.push(N);continue}if(N=this.tokenizer.blockquote(x)){x=x.substring(N.raw.length),N.tokens=this.blockTokens(N.text,[],L),w.push(N);continue}if(N=this.tokenizer.list(x)){for(x=x.substring(N.raw.length),ke=N.items.length,fe=0;fe<ke;fe++)N.items[fe].tokens=this.blockTokens(N.items[fe].text,[],!1);w.push(N);continue}if(N=this.tokenizer.html(x)){x=x.substring(N.raw.length),w.push(N);continue}if(L&&(N=this.tokenizer.def(x))){x=x.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(x)){x=x.substring(N.raw.length),w.push(N);continue}if(N=this.tokenizer.lheading(x)){x=x.substring(N.raw.length),w.push(N);continue}if(L&&(N=this.tokenizer.paragraph(x))){x=x.substring(N.raw.length),w.push(N);continue}if(N=this.tokenizer.text(x,w)){x=x.substring(N.raw.length),N.type?w.push(N):(Ye=w[w.length-1],Ye.raw+=`
|
|
`+N.raw,Ye.text+=`
|
|
`+N.text);continue}if(x){var bt="Infinite loop on byte: "+x.charCodeAt(0);if(this.options.silent){console.error(bt);break}else throw new Error(bt)}}return w},Y.inline=function(x){var w,L,N,fe,ke,Ye,bt=x.length;for(w=0;w<bt;w++){Ye=x[w];switch(Ye.type){case"paragraph":case"text":case"heading":{Ye.tokens=[],this.inlineTokens(Ye.text,Ye.tokens);break}case"table":{for(Ye.tokens={header:[],cells:[]},fe=Ye.header.length,L=0;L<fe;L++)Ye.tokens.header[L]=[],this.inlineTokens(Ye.header[L],Ye.tokens.header[L]);for(fe=Ye.cells.length,L=0;L<fe;L++)for(ke=Ye.cells[L],Ye.tokens.cells[L]=[],N=0;N<ke.length;N++)Ye.tokens.cells[L][N]=[],this.inlineTokens(ke[N],Ye.tokens.cells[L][N]);break}case"blockquote":{this.inline(Ye.tokens);break}case"list":{for(fe=Ye.items.length,L=0;L<fe;L++)this.inline(Ye.items[L].tokens);break}}}return x},Y.inlineTokens=function(x,w,L,N,fe){w===void 0&&(w=[]),L===void 0&&(L=!1),N===void 0&&(N=!1),fe===void 0&&(fe="");var ke,Ye=x,bt;if(this.tokens.links){var Rt=Object.keys(this.tokens.links);if(Rt.length>0)for(;(bt=this.tokenizer.rules.inline.reflinkSearch.exec(Ye))!=null;)Rt.includes(bt[0].slice(bt[0].lastIndexOf("[")+1,-1))&&(Ye=Ye.slice(0,bt.index)+"["+"a".repeat(bt[0].length-2)+"]"+Ye.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(bt=this.tokenizer.rules.inline.blockSkip.exec(Ye))!=null;)Ye=Ye.slice(0,bt.index)+"["+"a".repeat(bt[0].length-2)+"]"+Ye.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;x;){if(ke=this.tokenizer.escape(x)){x=x.substring(ke.raw.length),w.push(ke);continue}if(ke=this.tokenizer.tag(x,L,N)){x=x.substring(ke.raw.length),L=ke.inLink,N=ke.inRawBlock,w.push(ke);continue}if(ke=this.tokenizer.link(x)){x=x.substring(ke.raw.length),ke.type==="link"&&(ke.tokens=this.inlineTokens(ke.text,[],!0,N)),w.push(ke);continue}if(ke=this.tokenizer.reflink(x,this.tokens.links)){x=x.substring(ke.raw.length),ke.type==="link"&&(ke.tokens=this.inlineTokens(ke.text,[],!0,N)),w.push(ke);continue}if(ke=this.tokenizer.strong(x,Ye,fe)){x=x.substring(ke.raw.length),ke.tokens=this.inlineTokens(ke.text,[],L,N),w.push(ke);continue}if(ke=this.tokenizer.em(x,Ye,fe)){x=x.substring(ke.raw.length),ke.tokens=this.inlineTokens(ke.text,[],L,N),w.push(ke);continue}if(ke=this.tokenizer.codespan(x)){x=x.substring(ke.raw.length),w.push(ke);continue}if(ke=this.tokenizer.br(x)){x=x.substring(ke.raw.length),w.push(ke);continue}if(ke=this.tokenizer.del(x)){x=x.substring(ke.raw.length),ke.tokens=this.inlineTokens(ke.text,[],L,N),w.push(ke);continue}if(ke=this.tokenizer.autolink(x,ae)){x=x.substring(ke.raw.length),w.push(ke);continue}if(!L&&(ke=this.tokenizer.url(x,ae))){x=x.substring(ke.raw.length),w.push(ke);continue}if(ke=this.tokenizer.inlineText(x,N,Ae)){x=x.substring(ke.raw.length),fe=ke.raw.slice(-1),w.push(ke);continue}if(x){var We="Infinite loop on byte: "+x.charCodeAt(0);if(this.options.silent){console.error(We);break}else throw new Error(We)}}return w},se(q,null,[{key:"rules",get:function(){return{block:M,inline:be}}}]),q}(),je=k.defaults,Xe=P.cleanUrl,Ie=P.escape,Ne=function(){function q(ie){this.options=ie||je}var Y=q.prototype;return Y.code=function(x,w,L){var N=(w||"").match(/\S*/)[0];if(this.options.highlight){var fe=this.options.highlight(x,N);fe!=null&&fe!==x&&(L=!0,x=fe)}return N?'<pre><code class="'+this.options.langPrefix+Ie(N,!0)+'">'+(L?x:Ie(x,!0))+`</code></pre>
|
|
`:"<pre><code>"+(L?x:Ie(x,!0))+`</code></pre>
|
|
`},Y.blockquote=function(x){return`<blockquote>
|
|
`+x+`</blockquote>
|
|
`},Y.html=function(x){return x},Y.heading=function(x,w,L,N){return this.options.headerIds?"<h"+w+' id="'+this.options.headerPrefix+N.slug(L)+'">'+x+"</h"+w+`>
|
|
`:"<h"+w+">"+x+"</h"+w+`>
|
|
`},Y.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},Y.list=function(x,w,L){var N=w?"ol":"ul",fe=w&&L!==1?' start="'+L+'"':"";return"<"+N+fe+`>
|
|
`+x+"</"+N+`>
|
|
`},Y.listitem=function(x){return"<li>"+x+`</li>
|
|
`},Y.checkbox=function(x){return"<input "+(x?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Y.paragraph=function(x){return"<p>"+x+`</p>
|
|
`},Y.table=function(x,w){return w&&(w="<tbody>"+w+"</tbody>"),`<table>
|
|
<thead>
|
|
`+x+`</thead>
|
|
`+w+`</table>
|
|
`},Y.tablerow=function(x){return`<tr>
|
|
`+x+`</tr>
|
|
`},Y.tablecell=function(x,w){var L=w.header?"th":"td",N=w.align?"<"+L+' align="'+w.align+'">':"<"+L+">";return N+x+"</"+L+`>
|
|
`},Y.strong=function(x){return"<strong>"+x+"</strong>"},Y.em=function(x){return"<em>"+x+"</em>"},Y.codespan=function(x){return"<code>"+x+"</code>"},Y.br=function(){return this.options.xhtml?"<br/>":"<br>"},Y.del=function(x){return"<del>"+x+"</del>"},Y.link=function(x,w,L){if(x=Xe(this.options.sanitize,this.options.baseUrl,x),x===null)return L;var N='<a href="'+Ie(x)+'"';return w&&(N+=' title="'+w+'"'),N+=">"+L+"</a>",N},Y.image=function(x,w,L){if(x=Xe(this.options.sanitize,this.options.baseUrl,x),x===null)return L;var N='<img src="'+x+'" alt="'+L+'"';return w&&(N+=' title="'+w+'"'),N+=this.options.xhtml?"/>":">",N},Y.text=function(x){return x},q}(),Be=function(){function q(){}var Y=q.prototype;return Y.strong=function(x){return x},Y.em=function(x){return x},Y.codespan=function(x){return x},Y.del=function(x){return x},Y.html=function(x){return x},Y.text=function(x){return x},Y.link=function(x,w,L){return""+L},Y.image=function(x,w,L){return""+L},Y.br=function(){return""},q}(),ft=function(){function q(){this.seen={}}var Y=q.prototype;return Y.slug=function(x){var w=x.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(w)){var L=w;do this.seen[L]++,w=L+"-"+this.seen[L];while(this.seen.hasOwnProperty(w))}return this.seen[w]=0,w},q}(),ut=k.defaults,st=P.unescape,nt=function(){function q(ie){this.options=ie||ut,this.options.renderer=this.options.renderer||new Ne,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Be,this.slugger=new ft}q.parse=function(x,w){var L=new q(w);return L.parse(x)};var Y=q.prototype;return Y.parse=function(x,w){w===void 0&&(w=!0);var L="",N,fe,ke,Ye,bt,Rt,We,Ct,gt,ot,vt,_t,Mt,Lt,wt,en,Ut,ht,Vt=x.length;for(N=0;N<Vt;N++){ot=x[N];switch(ot.type){case"space":continue;case"hr":{L+=this.renderer.hr();continue}case"heading":{L+=this.renderer.heading(this.parseInline(ot.tokens),ot.depth,st(this.parseInline(ot.tokens,this.textRenderer)),this.slugger);continue}case"code":{L+=this.renderer.code(ot.text,ot.lang,ot.escaped);continue}case"table":{for(Ct="",We="",Ye=ot.header.length,fe=0;fe<Ye;fe++)We+=this.renderer.tablecell(this.parseInline(ot.tokens.header[fe]),{header:!0,align:ot.align[fe]});for(Ct+=this.renderer.tablerow(We),gt="",Ye=ot.cells.length,fe=0;fe<Ye;fe++){for(Rt=ot.tokens.cells[fe],We="",bt=Rt.length,ke=0;ke<bt;ke++)We+=this.renderer.tablecell(this.parseInline(Rt[ke]),{header:!1,align:ot.align[ke]});gt+=this.renderer.tablerow(We)}L+=this.renderer.table(Ct,gt);continue}case"blockquote":{gt=this.parse(ot.tokens),L+=this.renderer.blockquote(gt);continue}case"list":{for(vt=ot.ordered,_t=ot.start,Mt=ot.loose,Ye=ot.items.length,gt="",fe=0;fe<Ye;fe++)wt=ot.items[fe],en=wt.checked,Ut=wt.task,Lt="",wt.task&&(ht=this.renderer.checkbox(en),Mt?wt.tokens.length>0&&wt.tokens[0].type==="text"?(wt.tokens[0].text=ht+" "+wt.tokens[0].text,wt.tokens[0].tokens&&wt.tokens[0].tokens.length>0&&wt.tokens[0].tokens[0].type==="text"&&(wt.tokens[0].tokens[0].text=ht+" "+wt.tokens[0].tokens[0].text)):wt.tokens.unshift({type:"text",text:ht}):Lt+=ht),Lt+=this.parse(wt.tokens,Mt),gt+=this.renderer.listitem(Lt,Ut,en);L+=this.renderer.list(gt,vt,_t);continue}case"html":{L+=this.renderer.html(ot.text);continue}case"paragraph":{L+=this.renderer.paragraph(this.parseInline(ot.tokens));continue}case"text":{for(gt=ot.tokens?this.parseInline(ot.tokens):ot.text;N+1<Vt&&x[N+1].type==="text";)ot=x[++N],gt+=`
|
|
`+(ot.tokens?this.parseInline(ot.tokens):ot.text);L+=w?this.renderer.paragraph(gt):gt;continue}default:{var Xt='Token with "'+ot.type+'" type was not found.';if(this.options.silent){console.error(Xt);return}else throw new Error(Xt)}}}return L},Y.parseInline=function(x,w){w=w||this.renderer;var L="",N,fe,ke=x.length;for(N=0;N<ke;N++){fe=x[N];switch(fe.type){case"escape":{L+=w.text(fe.text);break}case"html":{L+=w.html(fe.text);break}case"link":{L+=w.link(fe.href,fe.title,this.parseInline(fe.tokens,w));break}case"image":{L+=w.image(fe.href,fe.title,fe.text);break}case"strong":{L+=w.strong(this.parseInline(fe.tokens,w));break}case"em":{L+=w.em(this.parseInline(fe.tokens,w));break}case"codespan":{L+=w.codespan(fe.text);break}case"br":{L+=w.br();break}case"del":{L+=w.del(this.parseInline(fe.tokens,w));break}case"text":{L+=w.text(fe.text);break}default:{var Ye='Token with "'+fe.type+'" type was not found.';if(this.options.silent){console.error(Ye);return}else throw new Error(Ye)}}}return L},q}(),Qe=P.merge,Ve=P.checkSanitizeDeprecation,Ke=P.escape,we=k.getDefaults,lt=k.changeDefaults,tt=k.defaults;function Re(q,Y,ie){if(typeof q=="undefined"||q===null)throw new Error("marked(): input parameter is undefined or null");if(typeof q!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(q)+", string expected");if(typeof Y=="function"&&(ie=Y,Y=null),Y=Qe({},Re.defaults,Y||{}),Ve(Y),ie){var x=Y.highlight,w;try{w=Te.lex(q,Y)}catch(ke){return ie(ke)}var L=function(Ye){var bt;if(!Ye)try{bt=nt.parse(w,Y)}catch(Rt){Ye=Rt}return Y.highlight=x,Ye?ie(Ye):ie(null,bt)};if(!x||x.length<3)return L();if(delete Y.highlight,!w.length)return L();var N=0;Re.walkTokens(w,function(ke){ke.type==="code"&&(N++,setTimeout(function(){x(ke.text,ke.lang,function(Ye,bt){if(Ye)return L(Ye);bt!=null&&bt!==ke.text&&(ke.text=bt,ke.escaped=!0),N--,N===0&&L()})},0))}),N===0&&L();return}try{var fe=Te.lex(q,Y);return Y.walkTokens&&Re.walkTokens(fe,Y.walkTokens),nt.parse(fe,Y)}catch(ke){if(ke.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,Y.silent)return"<p>An error occurred:</p><pre>"+Ke(ke.message+"",!0)+"</pre>";throw ke}}Re.options=Re.setOptions=function(q){return Qe(Re.defaults,q),lt(Re.defaults),Re},Re.getDefaults=we,Re.defaults=tt,Re.use=function(q){var Y=Qe({},q);if(q.renderer&&function(){var x=Re.defaults.renderer||new Ne,w=function(fe){var ke=x[fe];x[fe]=function(){for(var Ye=arguments.length,bt=new Array(Ye),Rt=0;Rt<Ye;Rt++)bt[Rt]=arguments[Rt];var We=q.renderer[fe].apply(x,bt);return We===!1&&(We=ke.apply(x,bt)),We}};for(var L in q.renderer)w(L);Y.renderer=x}(),q.tokenizer&&function(){var x=Re.defaults.tokenizer||new me,w=function(fe){var ke=x[fe];x[fe]=function(){for(var Ye=arguments.length,bt=new Array(Ye),Rt=0;Rt<Ye;Rt++)bt[Rt]=arguments[Rt];var We=q.tokenizer[fe].apply(x,bt);return We===!1&&(We=ke.apply(x,bt)),We}};for(var L in q.tokenizer)w(L);Y.tokenizer=x}(),q.walkTokens){var ie=Re.defaults.walkTokens;Y.walkTokens=function(x){q.walkTokens(x),ie&&ie(x)}}Re.setOptions(Y)},Re.walkTokens=function(q,Y){for(var ie=D(q),x;!(x=ie()).done;){var w=x.value;Y(w);switch(w.type){case"table":{for(var L=D(w.tokens.header),N;!(N=L()).done;){var fe=N.value;Re.walkTokens(fe,Y)}for(var ke=D(w.tokens.cells),Ye;!(Ye=ke()).done;)for(var bt=Ye.value,Rt=D(bt),We;!(We=Rt()).done;){var Ct=We.value;Re.walkTokens(Ct,Y)}break}case"list":{Re.walkTokens(w.items,Y);break}default:w.tokens&&Re.walkTokens(w.tokens,Y)}}},Re.Parser=nt,Re.parser=nt.parse,Re.Renderer=Ne,Re.TextRenderer=Be,Re.Lexer=Te,Re.lexer=Te.lex,Re.Tokenizer=me,Re.Slugger=ft,Re.parse=Re;var He=Re;return He})},EGTK:function(et,Ze,v){"use strict";var H=v("T2oS"),se=v("W9HT"),re=v("5NDa"),ue=v("5rEg"),D=v("k1fw"),z=v("tJVT"),k=v("q1tI"),E=v.n(k),I=v("TSYQ"),T=v.n(I),R=v("dGDm"),C=v.n(R),te=function(J){var F=J.className,ce=J.dispatch,ne=J.skin,Pe=ne===void 0?"white":ne,$e=J.value,ye=$e===void 0?null:$e,Le=J.loading,Fe=Le===void 0?!1:Le,xe=J.data,Se=xe===void 0?[]:xe,Oe=J.otherData,Ee=Oe===void 0?[]:Oe,O=J.tags,de=O===void 0?[]:O,Q=J.onChange,_=Q===void 0?function(){}:Q,W=Object(k.useState)(""),j=Object(z.a)(W,2),A=j[0],P=j[1],p=Object(k.useState)(!1),d=Object(z.a)(p,2),S=d[0],G=d[1],oe=Object(k.useState)([]),Ce=Object(z.a)(oe,2),Me=Ce[0],me=Ce[1],_e=Object(k.useState)(0),ge=Object(z.a)(_e,2),le=ge[0],ee=ge[1],V=Object(k.useRef)(null),b=Object(k.useRef)(String(Math.floor(Math.random()*1e6))).current,X=Object(k.useRef)();Object(k.useEffect)(function(){return window.addEventListener("keydown",M),function(){window.removeEventListener("keydown",M)}},[A,S,Me]);var M=function(Ve){if(!S||Ve.keyCode!==40&&Ve.keyCode!==38)return;var Ke=0;Ve.keyCode===40&&S&&(le<Me.length-1?Ke=le+1:Ke=0,console.log("\u4E0B"),Te(Ke,"down")),Ve.keyCode===38&&S&&(le===0?Ke=Me.length-1:Ke=le-1,Te(Ke,"up")),ee(Ke),Ae(A,Ke)},be=function(Ve,Ke){var we=function(Re){var He=/[\^\.\\\|\(\)\*\+\-\$\[\]\?]/g,q={};return q["^"]="\\^",q["."]="\\.",q["\\"]="\\\\",q["|"]="\\|",q["("]="\\(",q[")"]="\\)",q["*"]="\\*",q["+"]="\\+",q["-"]="\\-",q.$="$",q["["]="\\[",q["]"]="\\]",q["?"]="\\?",Re=Re.replace(He,function(Y){return q[Y]}),Re},lt=new RegExp(we(Ke),"gi");return Ve=Ve.replace(lt,function(tt){return"<span style='color:#0152d9;'>"+tt+"</span>"}),Ve},Ae=function(Ve,Ke){if(Ve===""){me([]);return}var we=[];Se.forEach(function(tt){tt.image.length&&tt.image.forEach(function(Re){we.push(Re)})});var lt=we.concat(Ee).filter(function(tt){var Re;return(Re=tt.name)===null||Re===void 0?void 0:Re.toLocaleLowerCase().includes(Ve==null?void 0:Ve.toLocaleLowerCase())}).map(function(tt,Re){var He=tt.id,q=tt.name,Y=Object(D.a)(Object(D.a)({},tt),{},{label:E.a.createElement("ul",{id:"search-".concat(b,"-").concat(Re),onClick:function(){return Ie(He,Y)},className:Re===Ke?C.a.searchListActive:C.a.searchList},E.a.createElement("li",{className:C.a.name,dangerouslySetInnerHTML:{__html:be(q,Ve)}}),tt.private&&E.a.createElement("li",{className:C.a.tag},"\u79C1\u6709"),tt.shixun_limit&&E.a.createElement("li",{className:"".concat(C.a.tag," ").concat(C.a.limitTag)},"\u9650\u5B9A\u5B9E\u8BAD"))});return Y});me(lt)},ae=function(Ve){var Ke=document.getElementById("scroll-".concat(b,"-").concat(Ve));if(!Ke)return;var we=document.getElementById("scroll-".concat(b));we.scrollTo(0,Ke.offsetTop)},Te=function(Ve,Ke){var we=document.getElementById("search-".concat(b,"-").concat(Ve));if(!we)return;var lt=document.getElementById("search-".concat(b)),tt=we.offsetTop-lt.scrollTop>0&&we.offsetTop-lt.scrollTop<lt.clientHeight;if(tt)return;Ke==="down"?lt.scrollTo(0,we.offsetTop-lt.clientHeight+we.clientHeight):lt.scrollTo(0,we.offsetTop)},je=function(Ve){Ae(Ve,0),P(Ve)},Xe=function(Ve){var Ke,we;if(!Me.length)return;var lt=Me==null||((Ke=Me[le])===null||Ke===void 0)?void 0:Ke.id;_(lt),me([]),ee(0),P(Me==null||((we=Me[le])===null||we===void 0)?void 0:we.name),ae(lt),X.current.blur()},Ie=function(Ve,Ke){_(Ve),me([]),ee(0),P(Ke==null?void 0:Ke.name),ae(Ve)},Ne=function(){me([]),P("")},Be=function(Ve){_(Ve),me([]),P("")},ft=function(){return A===""?E.a.createElement("i",{style:{pointerEvents:"none"},className:"iconfont icon-sousuo2 c-grey-c"}):E.a.createElement("i",{onClick:Ne,className:"iconfont icon-shanchu4 c-grey-c"})},ut=function(){ce({type:"newShixuns/setActionTabs",payload:{key:"NewShixuns-Apply"}})},st=function(){ce({type:"newShixuns/setActionTabs",payload:{key:"Create-Environment"}})},nt=function(){V.current=setTimeout(function(){G(!1),ee(0)},200)};return E.a.createElement("div",{className:T()(Pe==="night"?C.a.darklySelectEnvironment:C.a.selectEnvironment,F)},E.a.createElement("div",{className:C.a.search},E.a.createElement(ue.a,{suffix:ft(),bordered:!1,ref:X,value:A,onKeyDown:function(Ve){(Ve.keyCode===40||Ve.keyCode===38)&&Ve.preventDefault()},size:"large",onFocus:function(){clearTimeout(V.current),je(A),G(!0)},onBlur:nt,onChange:function(Ve){return je(Ve.target.value)},placeholder:"\u641C\u7D22\u60A8\u9700\u8981\u7684\u5B9E\u9A8C\u73AF\u5883",onPressEnter:Xe}),S&&E.a.createElement("div",{id:"search-".concat(b),className:C.a.searchListWrap},Me.map(function(Qe,Ve){return E.a.createElement(E.a.Fragment,{key:Ve}," ",Qe.label)}))),Fe?E.a.createElement(se.a,{className:C.a.spin}):E.a.createElement(E.a.Fragment,null,!!de.length&&E.a.createElement("aside",{className:C.a.common},E.a.createElement("div",{className:C.a.title},"\u63A8\u8350\u73AF\u5883:"),E.a.createElement("ul",{className:C.a.tags},de.map(function(Qe,Ve){return E.a.createElement("li",{key:Ve,onClick:function(){return Be(Qe.id)},className:ye===Qe.id?"".concat(C.a.tag," ").concat(C.a.tagActive):C.a.tag},Qe.name)}))),E.a.createElement("aside",{className:C.a.wrap,id:"scroll-".concat(b)},Se.map(function(Qe,Ve){var Ke;return Qe!=null&&(Ke=Qe.image)!==null&&Ke!==void 0&&Ke.length?E.a.createElement(Z,{key:Ve,data:Qe,id:ye,handleClick:function(lt){return Be(lt)}}):null}),E.a.createElement("ul",{className:C.a.allList},Ee.map(function(Qe){return E.a.createElement("li",{key:"key-".concat(Qe.id),id:"scroll-".concat(b,"-").concat(Qe.id),className:Qe.id===ye?"".concat(C.a.item," ").concat(C.a.itemActive):C.a.item,onClick:function(){return _(Qe.id)}},E.a.createElement("div",{className:C.a.name},Qe.name),Qe.private&&E.a.createElement("div",{className:C.a.tag},"\u79C1\u6709"),Qe.shixun_limit&&E.a.createElement("div",{className:"".concat(C.a.tag," ").concat(C.a.limitTag)},"\u9650\u5B9A\u5B9E\u8BAD"))})))),E.a.createElement("div",{className:C.a.apply},E.a.createElement("span",{className:C.a.p1},"\u6CA1\u6709\u5B9E\u9A8C\u73AF\u5883\uFF1F"),E.a.createElement("span",{className:C.a.p2,onClick:ut}," \u7533\u8BF7\u65B0\u5EFA"),E.a.createElement("span",{className:C.a.p2,onClick:st}," \u5728\u7EBF\u521B\u5EFA")))},Z=function(J){var F=J.data,ce=J.id,ne=J.handleClick,Pe=Object(k.useState)(!0),$e=Object(z.a)(Pe,2),ye=$e[0],Le=$e[1],Fe=F.name,xe=F.image;return E.a.createElement("div",{className:C.a.list},E.a.createElement("header",{onClick:function(){return Le(!ye)}},E.a.createElement("div",{className:C.a.title},Fe),E.a.createElement("i",{style:{transition:"0.5s",transform:ye?"rotate(0deg)":"rotate(180deg)"},className:"iconfont icon-shangjiantou c-grey-999"})),E.a.createElement("ul",{className:C.a.items,style:{height:ye?"auto":0}},xe.map(function(Se){return E.a.createElement("li",{key:Se.id,className:Se.id===ce?"".concat(C.a.item," ").concat(C.a.itemActive):C.a.item,onClick:function(){return ne(Se.id)}},E.a.createElement("div",{className:C.a.name},Se.name),Se.private&&E.a.createElement("div",{className:C.a.tag},"\u79C1\u6709"),Se.shixun_limit&&E.a.createElement("div",{className:"".concat(C.a.tag," ").concat(C.a.limitTag)},"\u9650\u5B9A\u5B9E\u8BAD"))}),E.a.createElement("li",{className:C.a.line})))};Ze.a=te},ELLl:function(et,Ze,v){(function(H){H(v("VrN/"))})(function(H){var se={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},re=H.Pos;H.defineOption("autoCloseBrackets",!1,function(B,J,F){F&&F!=H.Init&&(B.removeKeyMap(D),B.state.closeBrackets=null),J&&(z(ue(J,"pairs")),B.state.closeBrackets=J,B.addKeyMap(D))});function ue(B,J){return J=="pairs"&&typeof B=="string"?B:typeof B=="object"&&B[J]!=null?B[J]:se[J]}var D={Backspace:I,Enter:T};function z(B){for(var J=0;J<B.length;J++){var F=B.charAt(J),ce="'"+F+"'";D[ce]||(D[ce]=k(F))}}z(se.pairs+"`");function k(B){return function(J){return C(J,B)}}function E(B){var J=B.state.closeBrackets;if(!J||J.override)return J;var F=B.getModeAt(B.getCursor());return F.closeBrackets||J}function I(B){var J=E(B);if(!J||B.getOption("disableInput"))return H.Pass;for(var F=ue(J,"pairs"),ce=B.listSelections(),ne=0;ne<ce.length;ne++){if(!ce[ne].empty())return H.Pass;var Pe=te(B,ce[ne].head);if(!Pe||F.indexOf(Pe)%2!=0)return H.Pass}for(var ne=ce.length-1;ne>=0;ne--){var $e=ce[ne].head;B.replaceRange("",re($e.line,$e.ch-1),re($e.line,$e.ch+1),"+delete")}}function T(B){var J=E(B),F=J&&ue(J,"explode");if(!F||B.getOption("disableInput"))return H.Pass;for(var ce=B.listSelections(),ne=0;ne<ce.length;ne++){if(!ce[ne].empty())return H.Pass;var Pe=te(B,ce[ne].head);if(!Pe||F.indexOf(Pe)%2!=0)return H.Pass}B.operation(function(){var $e=B.lineSeparator()||`
|
|
`;B.replaceSelection($e+$e,null),B.execCommand("goCharLeft"),ce=B.listSelections();for(var ye=0;ye<ce.length;ye++){var Le=ce[ye].head.line;B.indentLine(Le,null,!0),B.indentLine(Le+1,null,!0)}})}function R(B){var J=H.cmpPos(B.anchor,B.head)>0;return{anchor:new re(B.anchor.line,B.anchor.ch+(J?-1:1)),head:new re(B.head.line,B.head.ch+(J?1:-1))}}function C(B,J){var F=E(B);if(!F||B.getOption("disableInput"))return H.Pass;var ce=ue(F,"pairs"),ne=ce.indexOf(J);if(ne==-1)return H.Pass;for(var Pe=ue(F,"closeBefore"),$e=ue(F,"triples"),ye=ce.charAt(ne+1)==J,Le=B.listSelections(),Fe=ne%2==0,xe,Se=0;Se<Le.length;Se++){var Oe=Le[Se],Ee=Oe.head,O,de=B.getRange(Ee,re(Ee.line,Ee.ch+1));if(Fe&&!Oe.empty())O="surround";else if((ye||!Fe)&&de==J)ye&&Z(B,Ee)?O="both":$e.indexOf(J)>=0&&B.getRange(Ee,re(Ee.line,Ee.ch+3))==J+J+J?O="skipThree":O="skip";else if(ye&&Ee.ch>1&&$e.indexOf(J)>=0&&B.getRange(re(Ee.line,Ee.ch-2),Ee)==J+J){if(Ee.ch>2&&/\bstring/.test(B.getTokenTypeAt(re(Ee.line,Ee.ch-2))))return H.Pass;O="addFour"}else if(ye){var Q=Ee.ch==0?" ":B.getRange(re(Ee.line,Ee.ch-1),Ee);if(!H.isWordChar(de)&&Q!=J&&!H.isWordChar(Q))O="both";else return H.Pass}else if(Fe&&(de.length===0||/\s/.test(de)||Pe.indexOf(de)>-1))O="both";else return H.Pass;if(!xe)xe=O;else if(xe!=O)return H.Pass}var _=ne%2?ce.charAt(ne-1):J,W=ne%2?J:ce.charAt(ne+1);B.operation(function(){if(xe=="skip")B.execCommand("goCharRight");else if(xe=="skipThree")for(var j=0;j<3;j++)B.execCommand("goCharRight");else if(xe=="surround"){for(var A=B.getSelections(),j=0;j<A.length;j++)A[j]=_+A[j]+W;B.replaceSelections(A,"around"),A=B.listSelections().slice();for(var j=0;j<A.length;j++)A[j]=R(A[j]);B.setSelections(A)}else xe=="both"?(B.replaceSelection(_+W,null),B.triggerElectric(_+W),B.execCommand("goCharLeft")):xe=="addFour"&&(B.replaceSelection(_+_+_+_,"before"),B.execCommand("goCharRight"))})}function te(B,J){var F=B.getRange(re(J.line,J.ch-1),re(J.line,J.ch+1));return F.length==2?F:null}function Z(B,J){var F=B.getTokenAt(re(J.line,J.ch+1));return/\bstring/.test(F.type)&&F.start==J.ch&&(J.ch==0||!/\bstring/.test(B.getTokenTypeAt(J)))}})},FPkq:function(et,Ze,v){et.exports=v.p+"static/qrCode.dd0fe9b2.png"},FTkQ:function(et,Ze){et.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABjUlEQVQ4T61VsUoDQRB9s+eVYifkUlqIWCW3sbBMqYUR0cbfUPETxPgZ2giigpZaCnKXpBK1sMydpIx25+7ISu5ILhsjclvuzLx5M292lmA57PtuF2gIYIMBSYBn3BiICAg1cF0GrqjVSvLhlL+IqtVNEDUZWLAlS+8IeAPzvtduXw77ZYAMiEjKI2LeY2AskQ2cAGaiEy8MDwnQxicL7Ep5bDL+xmqijahZDsODDHBQ5sVfmVn6xmDeMuWTESAGnqf1bBpz09MSsESx729r4DwfIIA6hPjUSt2AaP7Hztwj5nXHdd0vpR7yMQzsUOT7pwzsjgEKsVIKgiCu1Za1UvfGLhynXgqCp6hSkSxEYCn9jLq+/wJgcawk5l4KYECN3YBlCVLWo4GvhmGfgVlrj4ZAjX0KmBmZD8Owj4IAMQAsvGSrKKR1zet0QpsosZQrmvnRKsqksZlxnFWVJAkT3Y6MDbAmgDlFdGcdm8IH22Qp9OmltAtdDoPlWez6SpkWtmCHFTNCvQMN/scX8A1e4fnIOEHt8AAAAABJRU5ErkJggg=="},FrRK:function(et,Ze,v){"use strict";var H=v("+L6B"),se=v("2/Rp"),re=v("DZo9"),ue=v("8z0m"),D=v("miYZ"),z=v("tsqr"),k=v("9og8"),E=v("2qtc"),I=v("kLXV"),T=v("y8nQ"),R=v("Vl3Y"),C=v("tJVT"),te=v("PpiC"),Z=v("5NDa"),B=v("5rEg"),J=v("WmNS"),F=v.n(J),ce=v("q1tI"),ne=v.n(ce),Pe=v("9kvl"),$e=v("m3rI"),ye=v("FPkq"),Le=v.n(ye),Fe=v("qB8g"),xe=v.n(Fe),Se=B.a.TextArea,Oe=function(O){var de=O.newShixuns,Q=O.globalSetting,_=O.loading,W=O.dispatch,j=Object(te.a)(O,["newShixuns","globalSetting","loading","dispatch"]),A=R.a.useForm(),P=Object(C.a)(A,1),p=P[0],d=Object(ce.useState)([]),S=Object(C.a)(d,2),G=S[0],oe=S[1],Ce=function(ee){var V=["uploading","done","removed"];V.includes(ee.file.status)&&oe(ee.fileList)},Me=function(ee){if(!ee.percent||ee.percent==100){var V,b=(V=ee.response)===null||V===void 0?void 0:V.id;return I.a.confirm({centered:!0,title:"\u786E\u5B9A\u8981\u5220\u9664\u8FD9\u4E2A\u9644\u4EF6\u5417?",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var X=Object(k.a)(F.a.mark(function be(){var Ae;return F.a.wrap(function(Te){for(;;)switch(Te.prev=Te.next){case 0:return Te.next=2,W({type:"newShixuns/deleteAttachment",payload:{id:b}});case 2:Ae=Te.sent,Ae&&oe(G.filter(function(je){var Xe;return((Xe=je.response)===null||Xe===void 0?void 0:Xe.id)!==b}));case 4:case"end":return Te.stop()}},be)}));function M(){return X.apply(this,arguments)}return M}()}),!1}},me=function(ee){if(G.length)return!1;var V=ee.size/1024/1024>50;return V?(z.b.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E50MB"),!1):!0},_e=function(){var le=Object(k.a)(F.a.mark(function ee(V){var b,X,M,be,Ae,ae,Te,je;return F.a.wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:return M=V||{},be=M.language,Ae=M.env,ae=M.mode,Te=M.code,Ie.next=3,W({type:"newShixuns/applyShixunMirror",payload:{language:be,runtime:Ae,run_method:ae,attachment_id:G==null||((b=G[0])===null||b===void 0||((X=b.response)===null||X===void 0))?void 0:X.id}});case 3:je=Ie.sent,W({type:"newShixuns/setActionTabs",payload:{}}),je&&z.b.success("\u65B0\u5EFA\u7533\u8BF7\u5DF2\u63D0\u4EA4\uFF0C\u8BF7\u7B49\u5F85\u7BA1\u7406\u5458\u5BA1\u6838\u3002");case 6:case"end":return Ie.stop()}},ee)}));return function(V){return le.apply(this,arguments)}}(),ge=function(){p.resetFields(),oe([])};return ne.a.createElement(I.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:de.actionTabs.key==="NewShixuns-Apply",title:"\u7533\u8BF7\u65B0\u5EFA",width:"1000px",footer:null,afterClose:ge},ne.a.createElement("section",{className:xe.a.qrCode},ne.a.createElement("aside",{className:xe.a.a1},ne.a.createElement("div",{className:xe.a.code},ne.a.createElement("img",{width:120,height:120,src:Le.a,alt:"\u4E8C\u7EF4\u7801"})),ne.a.createElement("div",{className:xe.a.group},"\u5B9E\u9A8C\u73AF\u5883\u7533\u8BF7QQ\u7FA4"),ne.a.createElement("div",{className:xe.a.groupNumber},"\u7FA4\u53F7\uFF1A740157011")),ne.a.createElement("aside",{className:xe.a.a2},"\u5C0A\u656C\u7684\u8001\u5E08/\u540C\u5B66\u60A8\u597D\uFF0C",ne.a.createElement("br",null),"\u5982\u679C\u60A8\u60F3\u65B0\u5EFA\u5B9E\u9A8C\u73AF\u5883\uFF0C\u53EF\u4EE5\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801\u8FDB\u7FA4\uFF0C\u76F4\u63A5\u5411\u6211\u4EEC\u7684\u5DE5\u4F5C\u4EBA\u5458\u7533\u8BF7\u54E6~ \u4E5F\u53EF\u4EE5\u63D0\u4EA4\u4E0B\u9762\u7684\u8868\u5355\u7533\u8BF7\uFF0C\u6211\u4EEC\u7684\u5DE5\u4F5C\u4EBA\u5458\u6536\u5230\u7533\u8BF7\u4FE1\u606F\u5C06\u4F1A\u7B2C\u4E00\u65F6\u95F4\u8054\u7CFB\u60A8\uFF01")),ne.a.createElement(R.a,{className:xe.a.formWrap,form:p,labelCol:{span:4},wrapperCol:{span:20},onFinish:_e},ne.a.createElement(R.a.Item,{label:"\u8BED\u8A00\uFF1A",name:"language",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u8BED\u8A00"}]},ne.a.createElement(Se,{placeholder:"\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u662F\u57FA\u4E8E\u4EC0\u4E48\u8BED\u8A00\uFF1A\u793A\u4F8B\uFF1APython",rows:4})),ne.a.createElement(R.a.Item,{label:"\u7CFB\u7EDF\u73AF\u5883\uFF1A",name:"env",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u8BED\u8A00\u7CFB\u7EDF\u73AF\u5883"}]},ne.a.createElement(Se,{placeholder:"\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u662F\u57FA\u4E8E\u4EC0\u4E48linux\u7CFB\u7EDF\u73AF\u5883,\u4EE3\u7801\u8FD0\u884C\u73AF\u5883",rows:4})),ne.a.createElement(R.a.Item,{label:"\u6D4B\u8BD5\u4EE3\u7801\u8FD0\u884C\u65B9\u5F0F\uFF1A",name:"mode",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u6D4B\u8BD5\u4EE3\u7801\u8FD0\u884C\u65B9\u5F0F"}]},ne.a.createElement(Se,{placeholder:"\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u4E2D\u6D4B\u8BD5\u4EE3\u7801\u8FD0\u884C\u65B9\u5F0F",rows:4})),ne.a.createElement(R.a.Item,{label:"\u6D4B\u8BD5\u4EE3\u7801\uFF1A",name:"code",rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u9644\u4EF6"}]},ne.a.createElement("div",{className:xe.a.upload},ne.a.createElement(ue.a,{fileList:G,action:"".concat($e.a.API_SERVER,"/api/attachments.json?client_key=6d57f8c3dd186c5ada392546ace9620a"),onChange:Ce,onRemove:Me,beforeUpload:me,withCredentials:!0},ne.a.createElement("span",{className:"".concat(xe.a.color0152d9," current")},"\u4E0A\u4F20\u9644\u4EF6"),ne.a.createElement("span",{className:"".concat(xe.a.colorCCC," ml10")},"(\u5355\u4E2A\u6587\u4EF650M\u4EE5\u5185)")))),ne.a.createElement("div",{className:xe.a.footerWrap},ne.a.createElement(R.a.Item,null,ne.a.createElement(se.a,{className:"mr5",size:"large",onClick:function(){W({type:"newShixuns/setActionTabs",payload:{}})}},"\u53D6\u6D88"),ne.a.createElement(se.a,{size:"large",type:"primary",htmlType:"submit",loading:_["newShixuns/applyShixunMirror"]},"\u4FDD\u5B58")))))};Ze.a=Object(Pe.a)(function(Ee){var O=Ee.newShixuns,de=Ee.loading,Q=Ee.globalSetting;return{newShixuns:O,globalSetting:Q,loading:de.effects}})(Oe)},GfqC:function(et,Ze,v){"use strict";var H=v("q1tI"),se=v.n(H),re=v("TSYQ"),ue=v.n(re);function D(P,p){var d="cannot "+P.method+" "+P.action+" "+p.status+"'",S=new Error(d);return S.status=p.status,S.method=P.method,S.url=P.action,S}function z(P){var p=P.responseText||P.response;if(!p)return p;try{return JSON.parse(p)}catch(d){return p}}function k(P){var p=new XMLHttpRequest;P.onProgress&&p.upload&&(p.upload.onprogress=function(oe){oe.total>0&&(oe.percent=oe.loaded/oe.total*100),P.onProgress(oe)});var d=new FormData;P.data&&Object.keys(P.data).forEach(function(G){var oe=P.data[G];if(Array.isArray(oe)){oe.forEach(function(Ce){d.append(G+"[]",Ce)});return}d.append(G,P.data[G])}),P.file instanceof Blob?d.append(P.filename,P.file,P.file.name):d.append(P.filename,P.file),p.onerror=function(oe){P.onError(oe)},p.onload=function(){return p.status<200||p.status>=300?P.onError(D(P,p),z(p)):P.onSuccess(z(p),p)},p.open(P.method,P.action,!0),P.withCredentials&&"withCredentials"in p&&(p.withCredentials=!0);var S=P.headers||{};return S["X-Requested-With"]!==null&&p.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(S).forEach(function(G){S[G]!==null&&p.setRequestHeader(G,S[G])}),p.send(d),{abort:function(){p.abort()}}}var E=+new Date,I=0;function T(){return"rc-upload-"+E+"-"+ ++I}function R(P,p){return P.indexOf(p,P.length-p.length)!==-1}var C=function(P,p){if(P&&p){var d=Array.isArray(p)?p:p.split(","),S=P.name||"",G=P.type||"",oe=G.replace(/\/.*$/,"");return d.some(function(Ce){var Me=Ce.trim();return Me.charAt(0)==="."?R(S.toLowerCase(),Me.toLowerCase()):/\/\*$/.test(Me)?oe===Me.replace(/\/.*$/,""):G===Me})}return!0};function te(P,p){var d=P.createReader(),S=[];function G(){d.readEntries(function(oe){var Ce=Array.prototype.slice.apply(oe);S=S.concat(Ce);var Me=!Ce.length;Me?p(S):G()})}G()}var Z=function(p,d,S){var G=function oe(Ce,Me){Me=Me||"",Ce.isFile?Ce.file(function(me){S(me)&&(Ce.fullPath&&!me.webkitRelativePath&&(Object.defineProperties(me,{webkitRelativePath:{writable:!0}}),me.webkitRelativePath=Ce.fullPath.replace(/^\//,""),Object.defineProperties(me,{webkitRelativePath:{writable:!1}})),d([me]))}):Ce.isDirectory&&te(Ce,function(me){me.forEach(function(_e){oe(_e,""+Me+Ce.name+"/")})})};p.forEach(function(oe){G(oe.webkitGetAsEntry())})},B=Z,J=Object.assign||function(P){for(var p=1;p<arguments.length;p++){var d=arguments[p];for(var S in d)Object.prototype.hasOwnProperty.call(d,S)&&(P[S]=d[S])}return P},F=function(){function P(p,d){var S=[],G=!0,oe=!1,Ce=void 0;try{for(var Me=p[Symbol.iterator](),me;!(G=(me=Me.next()).done)&&!(S.push(me.value),d&&S.length===d);G=!0);}catch(_e){oe=!0,Ce=_e}finally{try{!G&&Me.return&&Me.return()}finally{if(oe)throw Ce}}return S}return function(p,d){if(Array.isArray(p))return p;if(Symbol.iterator in Object(p))return P(p,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),ce=function(){function P(p,d){for(var S=0;S<d.length;S++){var G=d[S];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(p,G.key,G)}}return function(p,d,S){return d&&P(p.prototype,d),S&&P(p,S),p}}();function ne(P,p,d){return p in P?Object.defineProperty(P,p,{value:d,enumerable:!0,configurable:!0,writable:!0}):P[p]=d,P}function Pe(P,p){var d={};for(var S in P){if(p.indexOf(S)>=0)continue;if(!Object.prototype.hasOwnProperty.call(P,S))continue;d[S]=P[S]}return d}function $e(P,p){if(!(P instanceof p))throw new TypeError("Cannot call a class as a function")}function ye(P,p){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:P}function Le(P,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);P.prototype=Object.create(p&&p.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(P,p):P.__proto__=p)}var Fe=function(p){return Object.keys(p).reduce(function(d,S){return(S.substr(0,5)==="data-"||S.substr(0,5)==="aria-"||S==="role")&&(d[S]=p[S]),d},{})},xe=function(P){Le(p,P);function p(){var d,S,G,oe;$e(this,p);for(var Ce=arguments.length,Me=Array(Ce),me=0;me<Ce;me++)Me[me]=arguments[me];return oe=(S=(G=ye(this,(d=p.__proto__||Object.getPrototypeOf(p)).call.apply(d,[this].concat(Me))),G),G.state={uid:T()},G.reqs={},G.onChange=function(_e){var ge=_e.target.files;G.uploadFiles(ge),G.reset()},G.onClick=function(_e){var ge=G.fileInput;if(!ge)return;var le=G.props,ee=le.children,V=le.onClick;ee&&ee.type==="button"&&(ge.parentNode.focus(),ge.parentNode.querySelector("button").blur()),ge.click(),V&&V(_e)},G.onKeyDown=function(_e){_e.key==="Enter"&&G.onClick()},G.onFileDrop=function(_e){var ge=G.props.multiple;if(_e.preventDefault(),_e.type==="dragover")return;if(G.props.directory)B(Array.prototype.slice.call(_e.dataTransfer.items),G.uploadFiles,function(ee){return C(ee,G.props.accept)});else{var le=Array.prototype.slice.call(_e.dataTransfer.files).filter(function(ee){return C(ee,G.props.accept)});ge===!1&&(le=le.slice(0,1)),G.uploadFiles(le)}},G.uploadFiles=function(_e){var ge=Array.prototype.slice.call(_e);ge.map(function(le){return le.uid=T(),le}).forEach(function(le){G.upload(le,ge)})},G.saveFileInput=function(_e){G.fileInput=_e},S),ye(G,oe)}return ce(p,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(S,G){var oe=this,Ce=this.props;if(!Ce.beforeUpload)return setTimeout(function(){return oe.post(S)},0);var Me=Ce.beforeUpload(S,G);Me&&Me.then?Me.then(function(me){var _e=Object.prototype.toString.call(me);return _e==="[object File]"||_e==="[object Blob]"?oe.post(me):oe.post(S)}).catch(function(me){console.log(me)}):Me!==!1&&setTimeout(function(){return oe.post(S)},0);return}},{key:"post",value:function(S){var G=this;if(!this._isMounted)return;var oe=this.props,Ce=oe.onStart,Me=oe.onProgress,me=oe.transformFile,_e=me===void 0?function(ge){return ge}:me;new Promise(function(ge){var le=oe.action;return typeof le=="function"&&(le=le(S)),ge(le)}).then(function(ge){var le=S.uid,ee=oe.customRequest||k,V=Promise.resolve(_e(S)).then(function(b){var X=oe.data;return typeof X=="function"&&(X=X(b)),Promise.all([b,X])}).catch(function(b){console.error(b)});V.then(function(b){var X=F(b,2),M=X[0],be=X[1],Ae={action:ge,filename:oe.name,data:be,file:M,headers:oe.headers,withCredentials:oe.withCredentials,method:oe.method||"post",onProgress:Me?function(ae){Me(ae,S)}:null,onSuccess:function(Te,je){delete G.reqs[le],oe.onSuccess(Te,S,je)},onError:function(Te,je){delete G.reqs[le],oe.onError(Te,je,S)}};Ce(S),G.reqs[le]=ee(Ae)})})}},{key:"reset",value:function(){this.setState({uid:T()})}},{key:"abort",value:function(S){var G=this.reqs;if(S){var oe=S;S&&S.uid&&(oe=S.uid),G[oe]&&G[oe].abort&&G[oe].abort(),delete G[oe]}else Object.keys(G).forEach(function(Ce){G[Ce]&&G[Ce].abort&&G[Ce].abort(),delete G[Ce]})}},{key:"render",value:function(){var S,G=this.props,oe=G.component,Ce=G.prefixCls,Me=G.className,me=G.disabled,_e=G.id,ge=G.style,le=G.multiple,ee=G.accept,V=G.children,b=G.directory,X=G.openFileDialogOnClick,M=G.onMouseEnter,be=G.onMouseLeave,Ae=Pe(G,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),ae=ue()((S={},ne(S,Ce,!0),ne(S,Ce+"-disabled",me),ne(S,Me,Me),S)),Te=me?{}:{onClick:X?this.onClick:function(){},onKeyDown:X?this.onKeyDown:function(){},onMouseEnter:M,onMouseLeave:be,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return se.a.createElement(oe,J({},Te,{className:ae,role:"button",style:ge}),se.a.createElement("input",J({},Fe(Ae),{id:_e,type:"file",ref:this.saveFileInput,onClick:function(Xe){return Xe.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:ee,directory:b?"directory":null,webkitdirectory:b?"webkitdirectory":null,multiple:le,onChange:this.onChange})),V)}}]),p}(H.Component),Se=xe,Oe=Object.assign||function(P){for(var p=1;p<arguments.length;p++){var d=arguments[p];for(var S in d)Object.prototype.hasOwnProperty.call(d,S)&&(P[S]=d[S])}return P},Ee=function(){function P(p,d){for(var S=0;S<d.length;S++){var G=d[S];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(p,G.key,G)}}return function(p,d,S){return d&&P(p.prototype,d),S&&P(p,S),p}}();function O(P,p){if(!(P instanceof p))throw new TypeError("Cannot call a class as a function")}function de(P,p){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:P}function Q(P,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);P.prototype=Object.create(p&&p.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(P,p):P.__proto__=p)}function _(){}var W=function(P){Q(p,P);function p(){var d,S,G,oe;O(this,p);for(var Ce=arguments.length,Me=Array(Ce),me=0;me<Ce;me++)Me[me]=arguments[me];return oe=(S=(G=de(this,(d=p.__proto__||Object.getPrototypeOf(p)).call.apply(d,[this].concat(Me))),G),G.saveUploader=function(_e){G.uploader=_e},S),de(G,oe)}return Ee(p,[{key:"abort",value:function(S){this.uploader.abort(S)}},{key:"render",value:function(){return se.a.createElement(Se,Oe({},this.props,{ref:this.saveUploader}))}}]),p}(H.Component);W.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:_,onError:_,onSuccess:_,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var j=W,A=Ze.a=j},Gytx:function(et,Ze){et.exports=function(H,se,re,ue){var D=re?re.call(ue,H,se):void 0;if(D!==void 0)return!!D;if(H===se)return!0;if(typeof H!="object"||!H||typeof se!="object"||!se)return!1;var z=Object.keys(H),k=Object.keys(se);if(z.length!==k.length)return!1;for(var E=Object.prototype.hasOwnProperty.bind(se),I=0;I<z.length;I++){var T=z[I];if(!E(T))return!1;var R=H[T],C=se[T];if(D=re?re.call(ue,R,C,T):void 0,D===!1||D===void 0&&R!==C)return!1}return!0}},H38U:function(et,Ze,v){var H=v("f4xo"),se=v("rcnY"),re=v("wU8J"),ue=v("Iq15"),D=v("dWSS");function z(E,I){this.typeNumber=E,this.errorCorrectLevel=I,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var k=z.prototype;k.addData=function(E){var I=new H(E);this.dataList.push(I),this.dataCache=null},k.isDark=function(E,I){if(E<0||this.moduleCount<=E||I<0||this.moduleCount<=I)throw new Error(E+","+I);return this.modules[E][I]},k.getModuleCount=function(){return this.moduleCount},k.make=function(){if(this.typeNumber<1){var E=1;for(E=1;E<40;E++){for(var I=se.getRSBlocks(E,this.errorCorrectLevel),T=new re,R=0,C=0;C<I.length;C++)R+=I[C].dataCount;for(var C=0;C<this.dataList.length;C++){var te=this.dataList[C];T.put(te.mode,4),T.put(te.getLength(),ue.getLengthInBits(te.mode,E)),te.write(T)}if(T.getLengthInBits()<=R*8)break}this.typeNumber=E}this.makeImpl(!1,this.getBestMaskPattern())},k.makeImpl=function(E,I){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var T=0;T<this.moduleCount;T++){this.modules[T]=new Array(this.moduleCount);for(var R=0;R<this.moduleCount;R++)this.modules[T][R]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(E,I),this.typeNumber>=7&&this.setupTypeNumber(E),this.dataCache==null&&(this.dataCache=z.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,I)},k.setupPositionProbePattern=function(E,I){for(var T=-1;T<=7;T++){if(E+T<=-1||this.moduleCount<=E+T)continue;for(var R=-1;R<=7;R++){if(I+R<=-1||this.moduleCount<=I+R)continue;0<=T&&T<=6&&(R==0||R==6)||0<=R&&R<=6&&(T==0||T==6)||2<=T&&T<=4&&2<=R&&R<=4?this.modules[E+T][I+R]=!0:this.modules[E+T][I+R]=!1}}},k.getBestMaskPattern=function(){for(var E=0,I=0,T=0;T<8;T++){this.makeImpl(!0,T);var R=ue.getLostPoint(this);(T==0||E>R)&&(E=R,I=T)}return I},k.createMovieClip=function(E,I,T){var R=E.createEmptyMovieClip(I,T),C=1;this.make();for(var te=0;te<this.modules.length;te++)for(var Z=te*C,B=0;B<this.modules[te].length;B++){var J=B*C,F=this.modules[te][B];F&&(R.beginFill(0,100),R.moveTo(J,Z),R.lineTo(J+C,Z),R.lineTo(J+C,Z+C),R.lineTo(J,Z+C),R.endFill())}return R},k.setupTimingPattern=function(){for(var E=8;E<this.moduleCount-8;E++){if(this.modules[E][6]!=null)continue;this.modules[E][6]=E%2==0}for(var I=8;I<this.moduleCount-8;I++){if(this.modules[6][I]!=null)continue;this.modules[6][I]=I%2==0}},k.setupPositionAdjustPattern=function(){for(var E=ue.getPatternPosition(this.typeNumber),I=0;I<E.length;I++)for(var T=0;T<E.length;T++){var R=E[I],C=E[T];if(this.modules[R][C]!=null)continue;for(var te=-2;te<=2;te++)for(var Z=-2;Z<=2;Z++)te==-2||te==2||Z==-2||Z==2||te==0&&Z==0?this.modules[R+te][C+Z]=!0:this.modules[R+te][C+Z]=!1}},k.setupTypeNumber=function(E){for(var I=ue.getBCHTypeNumber(this.typeNumber),T=0;T<18;T++){var R=!E&&(I>>T&1)==1;this.modules[Math.floor(T/3)][T%3+this.moduleCount-8-3]=R}for(var T=0;T<18;T++){var R=!E&&(I>>T&1)==1;this.modules[T%3+this.moduleCount-8-3][Math.floor(T/3)]=R}},k.setupTypeInfo=function(E,I){for(var T=this.errorCorrectLevel<<3|I,R=ue.getBCHTypeInfo(T),C=0;C<15;C++){var te=!E&&(R>>C&1)==1;C<6?this.modules[C][8]=te:C<8?this.modules[C+1][8]=te:this.modules[this.moduleCount-15+C][8]=te}for(var C=0;C<15;C++){var te=!E&&(R>>C&1)==1;C<8?this.modules[8][this.moduleCount-C-1]=te:C<9?this.modules[8][15-C-1+1]=te:this.modules[8][15-C-1]=te}this.modules[this.moduleCount-8][8]=!E},k.mapData=function(E,I){for(var T=-1,R=this.moduleCount-1,C=7,te=0,Z=this.moduleCount-1;Z>0;Z-=2)for(Z==6&&Z--;;){for(var B=0;B<2;B++)if(this.modules[R][Z-B]==null){var J=!1;te<E.length&&(J=(E[te]>>>C&1)==1);var F=ue.getMask(I,R,Z-B);F&&(J=!J),this.modules[R][Z-B]=J,C--,C==-1&&(te++,C=7)}if(R+=T,R<0||this.moduleCount<=R){R-=T,T=-T;break}}},z.PAD0=236,z.PAD1=17,z.createData=function(E,I,T){for(var R=se.getRSBlocks(E,I),C=new re,te=0;te<T.length;te++){var Z=T[te];C.put(Z.mode,4),C.put(Z.getLength(),ue.getLengthInBits(Z.mode,E)),Z.write(C)}for(var B=0,te=0;te<R.length;te++)B+=R[te].dataCount;if(C.getLengthInBits()>B*8)throw new Error("code length overflow. ("+C.getLengthInBits()+">"+B*8+")");for(C.getLengthInBits()+4<=B*8&&C.put(0,4);C.getLengthInBits()%8!=0;)C.putBit(!1);for(;!(C.getLengthInBits()>=B*8);){if(C.put(z.PAD0,8),C.getLengthInBits()>=B*8)break;C.put(z.PAD1,8)}return z.createBytes(C,R)},z.createBytes=function(E,I){for(var T=0,R=0,C=0,te=new Array(I.length),Z=new Array(I.length),B=0;B<I.length;B++){var J=I[B].dataCount,F=I[B].totalCount-J;R=Math.max(R,J),C=Math.max(C,F),te[B]=new Array(J);for(var ce=0;ce<te[B].length;ce++)te[B][ce]=255&E.buffer[ce+T];T+=J;var ne=ue.getErrorCorrectPolynomial(F),Pe=new D(te[B],ne.getLength()-1),$e=Pe.mod(ne);Z[B]=new Array(ne.getLength()-1);for(var ce=0;ce<Z[B].length;ce++){var ye=ce+$e.getLength()-Z[B].length;Z[B][ce]=ye>=0?$e.get(ye):0}}for(var Le=0,ce=0;ce<I.length;ce++)Le+=I[ce].totalCount;for(var Fe=new Array(Le),xe=0,ce=0;ce<R;ce++)for(var B=0;B<I.length;B++)ce<te[B].length&&(Fe[xe++]=te[B][ce]);for(var ce=0;ce<C;ce++)for(var B=0;B<I.length;B++)ce<Z[B].length&&(Fe[xe++]=Z[B][ce]);return Fe},et.exports=z},HmJG:function(et,Ze,v){},IH3J:function(et,Ze,v){et.exports={wrapInstallPackageStyle:"wrapInstallPackageStyle___2JdHa",installPackageStyle:"installPackageStyle___3mphi",title:"title___-Mfcd",line:"line___1qKKa",bodyHeight:"bodyHeight___3hV2N"}},Iq15:function(et,Ze,v){var H=v("nVVt"),se=v("dWSS"),re=v("dQei"),ue={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},D={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 k=z<<10;D.getBCHDigit(k)-D.getBCHDigit(D.G15)>=0;)k^=D.G15<<D.getBCHDigit(k)-D.getBCHDigit(D.G15);return(z<<10|k)^D.G15_MASK},getBCHTypeNumber:function(z){for(var k=z<<12;D.getBCHDigit(k)-D.getBCHDigit(D.G18)>=0;)k^=D.G18<<D.getBCHDigit(k)-D.getBCHDigit(D.G18);return z<<12|k},getBCHDigit:function(z){for(var k=0;z!=0;)k++,z>>>=1;return k},getPatternPosition:function(z){return D.PATTERN_POSITION_TABLE[z-1]},getMask:function(z,k,E){switch(z){case ue.PATTERN000:return(k+E)%2==0;case ue.PATTERN001:return k%2==0;case ue.PATTERN010:return E%3==0;case ue.PATTERN011:return(k+E)%3==0;case ue.PATTERN100:return(Math.floor(k/2)+Math.floor(E/3))%2==0;case ue.PATTERN101:return k*E%2+k*E%3==0;case ue.PATTERN110:return(k*E%2+k*E%3)%2==0;case ue.PATTERN111:return(k*E%3+(k+E)%2)%2==0;default:throw new Error("bad maskPattern:"+z)}},getErrorCorrectPolynomial:function(z){for(var k=new se([1],0),E=0;E<z;E++)k=k.multiply(new se([1,re.gexp(E)],0));return k},getLengthInBits:function(z,k){if(1<=k&&k<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(k<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(k<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:"+k)},getLostPoint:function(z){for(var k=z.getModuleCount(),E=0,I=0;I<k;I++)for(var T=0;T<k;T++){for(var R=0,C=z.isDark(I,T),te=-1;te<=1;te++){if(I+te<0||k<=I+te)continue;for(var Z=-1;Z<=1;Z++){if(T+Z<0||k<=T+Z)continue;if(te==0&&Z==0)continue;C==z.isDark(I+te,T+Z)&&R++}}R>5&&(E+=3+R-5)}for(var I=0;I<k-1;I++)for(var T=0;T<k-1;T++){var B=0;z.isDark(I,T)&&B++,z.isDark(I+1,T)&&B++,z.isDark(I,T+1)&&B++,z.isDark(I+1,T+1)&&B++,(B==0||B==4)&&(E+=3)}for(var I=0;I<k;I++)for(var T=0;T<k-6;T++)z.isDark(I,T)&&!z.isDark(I,T+1)&&z.isDark(I,T+2)&&z.isDark(I,T+3)&&z.isDark(I,T+4)&&!z.isDark(I,T+5)&&z.isDark(I,T+6)&&(E+=40);for(var T=0;T<k;T++)for(var I=0;I<k-6;I++)z.isDark(I,T)&&!z.isDark(I+1,T)&&z.isDark(I+2,T)&&z.isDark(I+3,T)&&z.isDark(I+4,T)&&!z.isDark(I+5,T)&&z.isDark(I+6,T)&&(E+=40);for(var J=0,T=0;T<k;T++)for(var I=0;I<k;I++)z.isDark(I,T)&&J++;var F=Math.abs(100*J/k/k-50)/5;return E+=F*10,E}};et.exports=D},Lai7:function(et,Ze,v){et.exports=v.p+"static/noEnvData.6108fa6c.png"},LdHM:function(et,Ze,v){"use strict";v.d(Ze,"b",function(){return Pe}),v.d(Ze,"a",function(){return ye});var H=v("1OyB"),se=v("vuIU"),re=v("Ji7U"),ue=v("LK+K"),D=v("q1tI"),z=v("rePB"),k=v("Ff2n"),E=v("ODXe"),I=v("4IlW"),T=v("bX4T"),R=v("YrtM"),C=v("TSYQ"),te=v.n(C),Z=v("+nKL"),B=v("8OUc"),J=function(S,G){var oe=S.prefixCls,Ce=S.id,Me=S.flattenOptions,me=S.childrenAsData,_e=S.values,ge=S.searchValue,le=S.multiple,ee=S.defaultActiveFirstOption,V=S.height,b=S.itemHeight,X=S.notFoundContent,M=S.open,be=S.menuItemSelectedIcon,Ae=S.virtual,ae=S.onSelect,Te=S.onToggleOpen,je=S.onActiveValue,Xe=S.onScroll,Ie=S.onMouseEnter,Ne="".concat(oe,"-item"),Be=Object(R.a)(function(){return Me},[M,Me],function(He,q){return q[0]&&He[1]!==q[1]}),ft=D.useRef(null),ut=function(q){q.preventDefault()},st=function(q){ft.current&&ft.current.scrollTo({index:q})},nt=function(q){for(var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ie=Be.length,x=0;x<ie;x+=1){var w=(q+x*Y+ie)%ie,L=Be[w],N=L.group,fe=L.data;if(!N&&!fe.disabled)return w}return-1},Qe=D.useState(function(){return nt(0)}),Ve=Object(E.a)(Qe,2),Ke=Ve[0],we=Ve[1],lt=function(q){we(q);var Y=Be[q];if(!Y){je(null,-1);return}je(Y.data.value,q)};D.useEffect(function(){lt(ee!==!1?nt(0):-1)},[Be.length,ge]),D.useEffect(function(){var He=setTimeout(function(){if(!le&&M&&_e.size===1){var q=Array.from(_e)[0],Y=Be.findIndex(function(ie){var x=ie.data;return x.value===q});lt(Y),st(Y)}});return function(){return clearTimeout(He)}},[M]);var tt=function(q){q!==void 0&&ae(q,{selected:!_e.has(q)}),le||Te(!1)};if(D.useImperativeHandle(G,function(){return{onKeyDown:function(q){var Y=q.which;switch(Y){case I.a.UP:case I.a.DOWN:{var ie=0;if(Y===I.a.UP?ie=-1:Y===I.a.DOWN&&(ie=1),ie!==0){var x=nt(Ke+ie,ie);st(x),lt(x)}break}case I.a.ENTER:{var w=Be[Ke];w&&!w.data.disabled?tt(w.data.value):tt(void 0),M&&q.preventDefault();break}case I.a.ESC:Te(!1)}},onKeyUp:function(){},scrollTo:function(q){st(q)}}}),Be.length===0)return D.createElement("div",{role:"listbox",id:"".concat(Ce,"_list"),className:"".concat(Ne,"-empty"),onMouseDown:ut},X);function Re(He){var q=Be[He];if(!q)return null;var Y=q.data||{},ie=Y.value,x=Y.label,w=Y.children,L=Object(T.a)(Y,!0),N=me?w:x;return q?D.createElement("div",Object.assign({"aria-label":typeof N=="string"?N:null},L,{key:He,role:"option",id:"".concat(Ce,"_list_").concat(He),"aria-selected":_e.has(ie)}),ie):null}return D.createElement(D.Fragment,null,D.createElement("div",{role:"listbox",id:"".concat(Ce,"_list"),style:{height:0,width:0,overflow:"hidden"}},Re(Ke-1),Re(Ke),Re(Ke+1)),D.createElement(Z.a,{itemKey:"key",ref:ft,data:Be,height:V,itemHeight:b,fullHeight:!1,onMouseDown:ut,onScroll:Xe,virtual:Ae,onMouseEnter:Ie},function(He,q){var Y,ie=He.group,x=He.groupOption,w=He.data,L=w.label,N=w.key;if(ie)return D.createElement("div",{className:te()(Ne,"".concat(Ne,"-group"))},L!==void 0?L:N);var fe=w.disabled,ke=w.value,Ye=w.title,bt=w.children,Rt=w.style,We=w.className,Ct=Object(k.a)(w,["disabled","value","title","children","style","className"]),gt=_e.has(ke),ot="".concat(Ne,"-option"),vt=te()(Ne,ot,We,(Y={},Object(z.a)(Y,"".concat(ot,"-grouped"),x),Object(z.a)(Y,"".concat(ot,"-active"),Ke===q&&!fe),Object(z.a)(Y,"".concat(ot,"-disabled"),fe),Object(z.a)(Y,"".concat(ot,"-selected"),gt),Y)),_t=me?bt:L,Mt=!be||typeof be=="function"||gt;return D.createElement("div",Object.assign({},Ct,{"aria-selected":gt,className:vt,title:Ye,onMouseMove:function(){if(Ke===q||fe)return;lt(q)},onClick:function(){fe||tt(ke)},style:Rt}),D.createElement("div",{className:"".concat(ot,"-content")},_t||ke),D.isValidElement(be)||gt,Mt&&D.createElement(B.a,{className:"".concat(Ne,"-option-state"),customizeIcon:be,customizeIconProps:{isSelected:gt}},gt?"\u2713":null))}))},F=D.forwardRef(J);F.displayName="OptionList";var ce=F,ne=function(){return null};ne.isSelectOption=!0;var Pe=ne,$e=function(){return null};$e.isSelectOptGroup=!0;var ye=$e,Le=v("VTBJ"),Fe=v("Zm9Q");function xe(d){var S=d.key,G=d.props,oe=G.children,Ce=G.value,Me=Object(k.a)(G,["children","value"]);return Object(Le.a)({key:S,value:Ce!==void 0?Ce:S,children:oe},Me)}function Se(d){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(Fe.a)(d).map(function(G,oe){if(!D.isValidElement(G)||!G.type)return null;var Ce=G.type.isSelectOptGroup,Me=G.key,me=G.props,_e=me.children,ge=Object(k.a)(me,["children"]);return S||!Ce?xe(G):Object(Le.a)(Object(Le.a)({key:"__RC_SELECT_GRP__".concat(Me===null?oe:Me,"__"),label:Me},ge),{},{options:Se(_e)})}).filter(function(G){return G})}var Oe=v("2Qr1"),Ee=v("qNPg"),O=v("U8pU"),de=v("Kwbf"),Q=v("WKfj");function _(d){var S=d.mode,G=d.options,oe=d.children,Ce=d.backfill,Me=d.allowClear,me=d.placeholder,_e=d.getInputElement,ge=d.showSearch,le=d.onSearch,ee=d.defaultOpen,V=d.autoFocus,b=d.labelInValue,X=d.value,M=d.inputValue,be=d.optionLabelProp,Ae=S==="multiple"||S==="tags",ae=ge!==void 0?ge:Ae||S==="combobox",Te=G||Se(oe);if(Object(de.a)(S!=="tags"||Te.every(function(Ne){return!Ne.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),S==="tags"||S==="combobox"){var je=Te.some(function(Ne){return Ne.options?Ne.options.some(function(Be){return typeof("value"in Be?Be.value:Be.key)=="number"}):typeof("value"in Ne?Ne.value:Ne.key)=="number"});Object(de.a)(!je,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(de.a)(S!=="combobox"||!be,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(de.a)(S==="combobox"||!Ce,"`backfill` only works with `combobox` mode."),Object(de.a)(S==="combobox"||!_e,"`getInputElement` only work with `combobox` mode."),Object(de.b)(S!=="combobox"||!_e||!Me||!me,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),le&&!ae&&S!=="combobox"&&S!=="tags"&&Object(de.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(de.b)(!ee||V,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),X!=null){var Xe=Object(Q.d)(X);Object(de.a)(!b||Xe.every(function(Ne){return Object(O.a)(Ne)==="object"&&("key"in Ne||"value"in Ne)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(de.a)(!Ae||Array.isArray(X),"`value` should be array when `mode` is `multiple` or `tags`")}if(oe){var Ie=null;Object(Fe.a)(oe).some(function(Ne){if(!D.isValidElement(Ne)||!Ne.type)return!1;var Be=Ne.type;if(Be.isSelectOption)return!1;if(Be.isSelectOptGroup){var ft=Object(Fe.a)(Ne.props.children).every(function(ut){return!D.isValidElement(ut)||!Ne.type||ut.type.isSelectOption?!0:(Ie=ut.type,!1)});return!ft}return Ie=Be,!0}),Ie&&Object(de.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ie.displayName||Ie.name||Ie,"`.")),Object(de.a)(M===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var W=_,j=Object(Ee.a)({prefixCls:"rc-select",components:{optionList:ce},convertChildrenToData:Se,flattenOptions:Oe.d,getLabeledValue:Oe.e,filterOptions:Oe.b,isValueDisabled:Oe.g,findValueOption:Oe.c,warningProps:W,fillOptionsWithMissingValue:Oe.a}),A=function(d){Object(re.a)(G,d);var S=Object(ue.a)(G);function G(){var oe;return Object(H.a)(this,G),oe=S.apply(this,arguments),oe.selectRef=D.createRef(),oe.focus=function(){oe.selectRef.current.focus()},oe.blur=function(){oe.selectRef.current.blur()},oe}return Object(se.a)(G,[{key:"render",value:function(){return D.createElement(j,Object.assign({ref:this.selectRef},this.props))}}]),G}(D.Component);A.Option=Pe,A.OptGroup=ye;var P=A,p=Ze.c=P},M8RZ:function(et,Ze,v){"use strict";v.d(Ze,"a",function(){return I});var H=v("fWQN"),se=v("mtLc"),re=v("yKVA"),ue=v("879j"),D=v("q1tI"),z=v.n(D),k=v("i8i4"),E=v.n(k),I=function(T){Object(re.a)(C,T);var R=Object(ue.a)(C);function C(te){var Z;Object(H.a)(this,C),Z=R.call(this,te);var B=window.document;return Z.node=B.createElement("div"),B.body.appendChild(Z.node),Z}return Object(se.a)(C,[{key:"render",value:function(){var Z=this.props.children;return Object(k.createPortal)(Z,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),C}(z.a.Component)},N3QO:function(et,Ze,v){"use strict";var H=v("2qtc"),se=v("kLXV"),re=v("tJVT"),ue=v("q1tI"),D=v.n(ue),z=v("9kvl"),k=v("FPkq"),E=v.n(k),I=function(R){var C,te=R.newShixuns,Z=R.dispatch,B=R.user,J=Object(ue.useState)(!1),F=Object(re.a)(J,2),ce=F[0],ne=F[1];Object(ue.useEffect)(function(){te.actionTabs.key==="Create-Environment"&&$e()},[te==null||((C=te.actionTabs)===null||C===void 0)?void 0:C.key]);var Pe=function(){Z({type:"newShixuns/setActionTabs",payload:{}})},$e=function(){var Le,Fe,xe;Pe(),((Le=B.userInfo)===null||Le===void 0?void 0:Le.mirror_marker_status)===0?ne(!0):((Fe=B.userInfo)===null||Fe===void 0?void 0:Fe.mirror_marker_status)===1?z.d.push("/shixuns/new/CreateImg"):((xe=B.userInfo)===null||xe===void 0?void 0:xe.mirror_marker_status)===2&&se.a.confirm({title:"\u60A8\u4ECA\u65E5\u5DF2\u8FBE\u5230\u7533\u8BF7\u4E0A\u9650\uFF0C\u662F\u5426\u8DF3\u8F6C\u81F3\u4E91\u4E3B\u673A\u5217\u8868\uFF1F",content:"\u63D0\u793A\uFF1A\u6BCF\u5929\u6700\u591A\u5141\u8BB8\u7533\u8BF7\u4E00\u53F0\u4E91\u4E3B\u673A",okText:"\u8DF3\u8F6C",cancelText:"\u53D6\u6D88",onOk:function(){var Oe;z.d.push("/users/".concat((Oe=B.userInfo)===null||Oe===void 0?void 0:Oe.login,"/experiment-img"))}})};return D.a.createElement(se.a,{title:"\u52A0\u5165qq\u7FA4\u63D0\u793A",visible:ce,footer:null,onCancel:function(){ne(!1)}},D.a.createElement("div",{style:{textAlign:"center"}},D.a.createElement("br",null),D.a.createElement("img",{width:120,height:120,style:{marginTop:"20px"},src:E.a,alt:"\u4E8C\u7EF4\u7801"})),D.a.createElement("img",null))};Ze.a=Object(z.a)(function(T){var R=T.newShixuns,C=T.user,te=T.globalSetting;return{newShixuns:R,globalSetting:te,user:C}})(I)},OLES:function(et,Ze,v){"use strict";var H=v("U8pU"),se=v("VTBJ"),re=v("Ff2n"),ue=v("q1tI"),D=v("uciX"),z=v("7ixt"),k=function(te){var Z=te.overlay,B=te.prefixCls,J=te.id,F=te.overlayInnerStyle;return ue.createElement("div",{className:"".concat(B,"-inner"),id:J,role:"tooltip",style:F},typeof Z=="function"?Z():Z)},E=k,I=function(te,Z){var B=te.overlayClassName,J=te.trigger,F=J===void 0?["hover"]:J,ce=te.mouseEnterDelay,ne=ce===void 0?0:ce,Pe=te.mouseLeaveDelay,$e=Pe===void 0?.1:Pe,ye=te.overlayStyle,Le=te.prefixCls,Fe=Le===void 0?"rc-tooltip":Le,xe=te.children,Se=te.onVisibleChange,Oe=te.afterVisibleChange,Ee=te.transitionName,O=te.animation,de=te.placement,Q=de===void 0?"right":de,_=te.align,W=_===void 0?{}:_,j=te.destroyTooltipOnHide,A=j===void 0?!1:j,P=te.defaultVisible,p=te.getTooltipContainer,d=te.overlayInnerStyle,S=Object(re.a)(te,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),G=Object(ue.useRef)(null);Object(ue.useImperativeHandle)(Z,function(){return G.current});var oe=Object(se.a)({},S);"visible"in te&&(oe.popupVisible=te.visible);var Ce=function(){var le=te.arrowContent,ee=le===void 0?null:le,V=te.overlay,b=te.id;return[ue.createElement("div",{className:"".concat(Fe,"-arrow"),key:"arrow"},ee),ue.createElement(E,{key:"content",prefixCls:Fe,id:b,overlay:V,overlayInnerStyle:d})]},Me=!1,me=!1;if(typeof A=="boolean")Me=A;else if(A&&Object(H.a)(A)==="object"){var _e=A.keepParent;Me=_e===!0,me=_e===!1}return ue.createElement(D.a,Object.assign({popupClassName:B,prefixCls:Fe,popup:Ce,action:F,builtinPlacements:z.a,popupPlacement:Q,ref:G,popupAlign:W,getPopupContainer:p,onPopupVisibleChange:Se,afterPopupVisibleChange:Oe,popupTransitionName:Ee,popupAnimation:O,defaultPopupVisible:P,destroyPopupOnHide:Me,autoDestroy:me,mouseLeaveDelay:$e,popupStyle:ye,mouseEnterDelay:ne},oe),xe)},T=Object(ue.forwardRef)(I),R=Ze.a=T},Ot1p:function(et,Ze,v){"use strict";var H=v("2qtc"),se=v("kLXV"),re=v("rAM+"),ue=v("miYZ"),D=v("tsqr"),z=v("9og8"),k=v("tJVT"),E=v("jrin"),I=v("WmNS"),T=v.n(I),R=v("q1tI"),C=v.n(R),te=v("VrN/"),Z=v.n(te),B=v("bdgK"),J=v("p77/"),F=v("Bd2K"),ce=v("ELLl"),ne=v("19Vz"),Pe=v("lZu9"),$e=v("+NIl"),ye=v("kSUc"),Le=v("9Bee"),Fe=function(We){var Ct=We.value,gt=Ct===void 0?"":Ct,ot=We.className,vt=We.showTextOnly,_t=We.showLines,Mt=We.style,Lt=Mt===void 0?{}:Mt,wt=Object(R.useMemo)(function(){return""},[gt]);return C.a.createElement(C.a.Fragment,null,C.a.createElement("div",{dangerouslySetInnerHTML:{__html:wt}}))},xe=v("Q9mQ"),Se=v("diRs"),Oe=v("0Owb"),Ee=v("dejd"),O=v("C+DQ"),de=v("D1Df"),Q=v.n(de),_=v("1vsH"),W=v("m3rI"),j=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function A(We){var Ct=We.onActionCallback,gt=We.title,ot=We.icon,vt=We.actionName,_t=We.className,Mt=_t===void 0?"":_t,Lt=We.children;function wt(){Ct(vt)}return C.a.createElement("a",{title:gt,className:Mt,onClick:wt},C.a.createElement("i",{className:"md-iconfont ".concat(ot)}),Lt)}var P=function(We){var Ct=We.watch,gt=We.showNullButton,ot=We.onActionCallback,vt=We.fullScreen,_t=We.insertTemp,Mt=We.hidetoolBar,Lt=We.uuid,wt=We.setOpenPhones,en=Object(_.E)("_educoder_session_login"),Ut=Object(_.E)("_educoder_session"),ht=[].concat(j,[{title:"".concat(Ct?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ct?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return C.a.createElement("ul",{className:"markdown-toolbar-container"},!Mt&&ht.map(function(Vt,Xt){return C.a.createElement("li",{key:Xt},Vt.actionName?C.a.createElement(A,Object(Oe.a)({},Vt,{onActionCallback:ot})):C.a.createElement("span",{className:"v-line"}))}),gt?C.a.createElement("li",null,C.a.createElement(A,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ot},C.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,_t&&C.a.createElement("li",null,C.a.createElement(A,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(_t),onActionCallback:ot},C.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),C.a.createElement("li",null,C.a.createElement(Se.a,{title:"\u6253\u5F00\u624B\u673A\u626B\u4E00\u626B",content:C.a.createElement("div",null,C.a.createElement("span",{style:{display:"none"}},"test----",location.origin+"/upload.html?_educoder_session_login="+en+"&_educoder_session="+Ut+"&key="+Lt+"&api="+encodeURIComponent(W.a.API_SERVER)),C.a.createElement(Q.a,{size:150,fgColor:"#000",value:location.origin+"/upload.html?_educoder_session_login="+en+"&_educoder_session="+Ut+"&key="+Lt+"&api="+encodeURIComponent(W.a.API_SERVER)}))},C.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return wt(!0)}},"\u624B\u673A\u4E0A\u4F20\u6587\u4EF6"))),C.a.createElement("li",{className:"btn-full-screen"},C.a.createElement(A,{icon:"".concat(vt?"icon-shrink":"icon-enlarge"),title:vt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ot})))},p=v("M8RZ"),d=v("+L6B"),S=v("2/Rp"),G=v("y8nQ"),oe=v("Vl3Y"),Ce=v("5NDa"),Me=v("5rEg"),me={labelCol:{span:4},wrapperCol:{span:20}},_e=function(We){var Ct=We.callback,gt=We.onCancel;function ot(vt){Ct(vt)}return C.a.createElement(oe.a,Object(Oe.a)({},me,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ot}),C.a.createElement(oe.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},C.a.createElement(Me.a,null)),C.a.createElement(oe.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},C.a.createElement(Me.a,null)),C.a.createElement("div",{className:"flex-container flex-end"},C.a.createElement(S.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(S.a,{type:"ghost",onClick:gt},"\u53D6\u6D88")))},ge=v("7ahc"),le=v("k1fw"),ee=v("HmJG"),V=v("BjJ7"),b=oe.a.useForm,X={width:280,marginRight:10},M={labelCol:{span:5},wrapperCol:{span:19}},be=function(We){var Ct=We.callback,gt=We.onCancel,ot=b(),vt=Object(k.a)(ot,1),_t=vt[0],Mt=Object(R.useRef)();function Lt(Ut){Ct(Object(le.a)(Object(le.a)({},Ut),{},{name:Mt.current}))}function wt(Ut,ht){_t.setFieldsValue({src:"/api/attachments/".concat(Ut.id,"?type=").concat(Ut.content_type),type:ht.type})}function en(Ut){var ht=Ut.target.files[0];Mt.current=ht.name,ae(ht,wt)}return C.a.createElement(oe.a,Object(Oe.a)({form:_t},M,{className:"upload-image-panel",onFinish:Lt}),C.a.createElement(oe.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},C.a.createElement("div",{className:"flex-container"},C.a.createElement(oe.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},C.a.createElement(Me.a,{style:X})),C.a.createElement(Ae,{onFileChange:en}))),C.a.createElement(oe.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},C.a.createElement(Me.a,{style:{width:264}})),C.a.createElement(oe.a.Item,{style:{textAlign:"right"}},C.a.createElement(S.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(S.a,{type:"ghost",onClick:gt},"\u53D6\u6D88")))};function Ae(We){var Ct=We.onFileChange;return C.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",C.a.createElement("input",{type:"file",onChange:Ct}))}function ae(We,Ct){if(!We)throw new String("\u6CA1\u6709\u6587\u4EF6");var gt=new FormData;gt.append("editormd-image-file",We),gt.append("file_param_name","editormd-image-file"),gt.append("byxhr","true");var ot=new window.XMLHttpRequest;ot.withCredentials=!0,ot.addEventListener("load",function(vt){Ct(JSON.parse(vt.target.responseText),We)},!1),ot.addEventListener("error",function(vt){console.error(vt)},!1),ot.open("POST","".concat(V.a,"/api/attachments.json")),ot.send(gt)}var Te=v("giR+"),je=v("fyUT"),Xe=v("7Kak"),Ie=v("9yH6"),Ne=Ie.a.Group,Be={margin:"0 8px"},ft=function(We){var Ct=We.callback,gt=We.onCancel;function ot(vt){Ct(vt)}return C.a.createElement(oe.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ot},C.a.createElement("div",{className:"flex-container"},C.a.createElement("span",{style:Be},"\u5355\u5143\u683C\u6570\uFF1A"),C.a.createElement("span",{style:Be},"\u884C\u6570"),C.a.createElement(oe.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},C.a.createElement(je.a,null)),C.a.createElement("span",{style:Be},"\u5217\u6570"),C.a.createElement(oe.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},C.a.createElement(je.a,null))),C.a.createElement("div",{className:"flex-container",style:{marginTop:12}},C.a.createElement("span",{style:Be},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),C.a.createElement(oe.a.Item,{name:"align"},C.a.createElement(Ne,null,C.a.createElement(Ie.a,{value:"default"},C.a.createElement("i",{className:"fa fa-align-justify"})),C.a.createElement(Ie.a,{value:"left"},C.a.createElement("i",{className:"fa fa-align-left"})),C.a.createElement(Ie.a,{value:"center"},C.a.createElement("i",{className:"fa fa-align-center"})),C.a.createElement(Ie.a,{value:"right"},C.a.createElement("i",{className:"fa fa-align-right"}))))),C.a.createElement("div",{className:"flex-container flex-end"},C.a.createElement(S.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(S.a,{type:"ghost",onClick:gt},"\u53D6\u6D88")))},ut=v("ErOA"),st=v("7Cbv"),nt="link",Qe="upload-image",Ve="code-block",Ke="add-table",we="------------",lt={default:we,left:":".concat(we),center:":".concat(we,":"),right:"".concat(we,":")},tt=v("9VGf"),Re,He;function q(){}var Y=0,ie=1e4,x="\u2581",w=`
|
|
**\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 L(We){return/^\d+$/.test(We)?"".concat(We,"px"):We}var N=navigator.platform.toUpperCase().indexOf("MAC")>=0,fe=N?"Cmd":"Ctrl",ke=["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"],Ye=(Re={},Object(E.a)(Re,fe+"-B","bold"),Object(E.a)(Re,fe+"-I","italic"),Re),bt=(He={},Object(E.a)(He,nt,"\u6DFB\u52A0\u94FE\u63A5"),Object(E.a)(He,Ve,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(E.a)(He,Qe,"\u6DFB\u52A0\u6587\u4EF6"),Object(E.a)(He,Ke,"\u6DFB\u52A0\u8868\u683C"),He),Rt=Ze.a=function(We){var Ct=We.defaultValue,gt=Ct===void 0?"":Ct,ot=We.onChange,vt=We.width,_t=vt===void 0?"100%":vt,Mt=We.height,Lt=Mt===void 0?400:Mt,wt=We.miniToolbar,en=wt===void 0?!1:wt,Ut=We.isFocus,ht=Ut===void 0?!1:Ut,Vt=We.watch,Xt=We.insertTemp,nn=We.mode,cn=nn===void 0?"markdown":nn,Jn=We.id,an=Jn===void 0?"markdown-editor-id":Jn,pt=We.showResizeBar,at=pt===void 0?!1:pt,Zt=We.noStorage,hn=Zt===void 0?!1:Zt,Kt=We.showNullButton,Tt=Kt===void 0?!1:Kt,Mn=We.hidetoolBar,An=Mn===void 0?!1:Mn,vi=We.fullScreen,Je=vi===void 0?!1:vi,kt=We.onBlur,ri=We.onCMBeforeChange,hi=We.onFullScreen,di=We.className,Li=di===void 0?"":di,h=We.disablePaste,o=h===void 0?!1:h,a=We.placeholder,u=a===void 0?"":a,g=We.values,c=g===void 0?"":g,$=Object(R.useState)(null),Ue=Object(k.a)($,2),ve=Ue[0],mt=Ue[1],ze=Object(R.useState)(gt),At=Object(k.a)(ze,2),jt=At[0],zt=At[1],Vn=Object(R.useState)(Vt),Xn=Object(k.a)(Vn,2),vn=Xn[0],Zn=Xn[1],Xi=Object(R.useState)(Je),Pn=Object(k.a)(Xi,2),Dn=Pn[0],oi=Pn[1],yi=Object(R.useState)(""),qn=Object(k.a)(yi,2),ai=qn[0],Kn=qn[1],fr=Object(R.useState)(0),Ki=Object(k.a)(fr,2),Fn=Ki[0],Wn=Ki[1],Oi=Object(R.useState)(Lt),Pi=Object(k.a)(Oi,2),Di=Pi[0],ln=Pi[1],Ft=Object(R.useState)(!1),En=Object(k.a)(Ft,2),Wt=En[0],_n=En[1],Qt=Object(R.useRef)(Object(st.a)()),bi=Object(R.useRef)(!1),pn=Object(R.useRef)(),mn=Object(R.useRef)(),si=Object(R.useRef)(),xi=Object(R.useRef)(),Ci=Object(R.useRef)(),Ur=function(){var yt=Object(z.a)(T.a.mark(function Ot(){var Et,Dt;return T.a.wrap(function(Gt){for(;;)switch(Gt.prev=Gt.next){case 0:return Gt.next=2,Object(ut.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Qt.current}});case 2:Dt=Gt.sent,Dt!=null&&(Et=Dt.attachments)!==null&&Et!==void 0&&Et.length&&(console.log("cm:",ve,mn),Dt.attachments.map(function(It){It.content_type.indexOf("image")>-1?ve.replaceSelection(".concat(It.content_type,")")):It.content_type.indexOf("video")>-1?ve.replaceSelection('<video width="100%" controls src="'.concat(W.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):It.content_type.indexOf("pdf")>-1?ve.replaceSelection('<a href="'.concat(W.a.API_SERVER,"/api/attachments/").concat(It.id,"?type=").concat(It.content_type,'&disposition=inline" target="_blank">').concat(It.name,"</a>")):ve.replaceSelection("[".concat(It.name,"](").concat(W.a.API_SERVER,"/api/attachments/").concat(It.id,"?type=").concat(It.content_type,")"))}));case 4:case"end":return Gt.stop()}},Ot)}));return function(){return yt.apply(this,arguments)}}();Object(R.useEffect)(function(){zt(c),ve==null||ve.setValue(c)},[c]),Object(R.useEffect)(function(){hi==null||hi(Dn)},[Dn]),Object(R.useEffect)(function(){if(mn.current){var yt=Z.a.fromTextArea(mn.current,{mode:cn,lineNumbers:!en,lineWrapping:!0,value:gt,autoCloseTags:!0,autoCloseBrackets:!0});ht&&yt.focus();function Ot(Et,Dt){if(o){Dt.preventDefault();return}var Bt=Dt.clipboardData;if(Bt){var Gt=Bt.types.toString(),It=Bt.items;if(Gt==="Files"||Bt.types.indexOf("Files")>-1){if(Dt.preventDefault(),cn=="stex")return;try{var rn,yn=It[1];((rn=It[0])===null||rn===void 0?void 0:rn.kind)==="file"&&(yn=It[0]);var Nt=yn.getAsFile(),Ni=Nt.name.split(".").pop();ae(Nt,function(Yt){if(Yt.id){var Sn,Jt,Qn;(Nt==null||((Sn=Nt.type)===null||Sn===void 0)?void 0:Sn.indexOf("image"))>-1?yt.replaceSelection(".concat(Yt.content_type,")")):(Nt==null||((Jt=Nt.type)===null||Jt===void 0)?void 0:Jt.indexOf("video"))>-1?yt.replaceSelection('<video width="100%" controls src="'.concat(W.a.API_SERVER,"/api/attachments/").concat(Yt.id,'"></video>')):(Nt==null||((Qn=Nt.type)===null||Qn===void 0)?void 0:Qn.indexOf("pdf"))>-1?yt.replaceSelection('<a href="'.concat(W.a.API_SERVER,"/api/attachments/").concat(Yt.id,"?type=").concat(Nt.type,'&disposition=inline" target="_blank">').concat(Nt.name,"</a>")):ke.includes(Ni)?yt.replaceSelection('<a href="'.concat(W.a.API_SERVER,"/api/attachments/").concat(Yt.id,'?type=office&disposition=inline" target="_blank">').concat(Nt.name,"</a>")):yt.replaceSelection("[".concat(Nt.name,"](").concat(W.a.API_SERVER,"/api/attachments/").concat(Yt.id,"?type=").concat(Yt.content_type,")"))}else(Yt==null?void 0:Yt.status)===401&&(document.location.href="/user/login")})}catch(Yt){D.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return yt.on("paste",Ot),yt.on("dragleave",function(Et,Dt){si.current.classList.remove("mouse-hover-md")}),yt.on("dragover",function(Et,Dt){si.current.classList.add("mouse-hover-md")}),yt.on("drop",function(Et,Dt){si.current.classList.add("mouse-hover-md");var Bt;if(Bt=Dt.dataTransfer.files,Bt.length>0){Dt.preventDefault(),Dt.stopPropagation();for(var Gt=function(yn){var Nt=Bt[yn],Ni=Nt.name.split(".").pop();ae(Nt,function(Yt){if(Yt.id){var Sn,Jt,Qn;(Nt==null||((Sn=Nt.type)===null||Sn===void 0)?void 0:Sn.indexOf("image"))>-1?yt.replaceSelection(".concat(Yt.content_type,")")):(Nt==null||((Jt=Nt.type)===null||Jt===void 0)?void 0:Jt.indexOf("video"))>-1?yt.replaceSelection('<video width="100%" controls src="'.concat(W.a.API_SERVER,"/api/attachments/").concat(Yt.id,'"></video>')):(Nt==null||((Qn=Nt.type)===null||Qn===void 0)?void 0:Qn.indexOf("pdf"))>-1?yt.replaceSelection('<a href="'.concat(W.a.API_SERVER,"/api/attachments/").concat(Yt.id,"?type=").concat(Nt.type,'&disposition=inline" target="_blank">').concat(Nt.name,"</a>")):ke.includes(Ni)?yt.replaceSelection('<a href="'.concat(W.a.API_SERVER,"/api/attachments/").concat(Yt.id,'?type=office&disposition=inline" target="_blank">').concat(Nt.name,"</a>")):yt.replaceSelection("[".concat(Nt.name,"](").concat(W.a.API_SERVER,"/api/attachments/").concat(Yt.id,"?type=").concat(Yt.content_type,")"))}else(Yt==null?void 0:Yt.status)===401&&(document.location.href="/user/login")})},It=0;It<Bt.length;It++)Gt(It)}}),mt(yt),function(){yt.off("paste",Ot)}}},[]);var ei=Object(R.useCallback)(function(){if(si.current)try{}catch(yt){console.log(yt,"---- to set md editor body height")}},[Di,si,Dn]);Object(R.useEffect)(function(){function yt(){var Et=new B.default(function(Dt){var Bt=Object(re.a)(Dt),Gt;try{for(Bt.s();!(Gt=Bt.n()).done;){var It=Gt.value;(It.target.offsetHeight>0||It.target.offsetWidth>0)&&(ei(),ve.setSize("100%","100%"),ve.refresh())}}catch(rn){Bt.e(rn)}finally{Bt.f()}});return Et.observe(mn.current.parentElement),Et}if(ve){var Ot=yt();return function(){Ot.unobserve(mn.current.parentElement)}}},[ve,ei]),Object(R.useEffect)(function(){if(ve){for(var yt=[],Ot=function(){var It=Dt[Et];Bt=Object(k.a)(It,2);var rn=Bt[0],yn=Bt[1],Nt=Object(E.a)({},rn,function(){Yi(yn)});yt.push(Nt),ve.addKeyMap(Nt)},Et=0,Dt=Object.entries(Ye);Et<Dt.length;Et++){var Bt;Ot()}return pn.current=setInterval(function(){bi.current&&Ur()},4e3),function(){clearInterval(pn.current);var Gt=Object(re.a)(yt),It;try{for(Gt.s();!(It=Gt.n()).done;){var rn=It.value;ve.removeKeyMap(rn)}}catch(yn){Gt.e(yn)}finally{Gt.f()}}}},[ve]),Object(R.useEffect)(function(){Je!==Dn&&oi(Je)},[Je]),Object(tt.a)(function(){if(!hn&&Fn>0){var yt=new Date().getTime(),Ot=window.sessionStorage.getItem(an);yt>=Fn+ie&&(!Ot||Ot!==jt)&&(window.sessionStorage.setItem(an,jt),_n(!0))}},ie),Object(R.useEffect)(function(){Zn(Vt)},[ve,Vt]),Object(R.useEffect)(function(){ve&&(ht&&ve.focus())},[ve,ht]),Object(R.useEffect)(function(){if(vn&&ve){var yt=ve.getScrollerElement();function Ot(Et){var Dt=Et.target;if(Ci.current){var Bt=Dt.scrollTop/Dt.scrollHeight;Ci.current.scrollTop=Ci.current.scrollHeight*Bt}}return yt.addEventListener("scroll",Ot),function(){yt.removeEventListener("scroll",Ot)}}},[ve,vn]),Object(R.useEffect)(function(){if(ve&&ri){function yt(Ot,Et){ri(Ot,Et)}return ve.on("beforeChange",yt),function(){ve.off("beforeChange",yt)}}},[ve,ri]),Object(R.useEffect)(function(){if(ve&&kt){function yt(){kt(ve.getValue())}return ve.on("blur",yt),function(){ve.off("blur",yt)}}},[ve,kt]),Object(R.useEffect)(function(){if(ve){function yt(Ot){var Et=Ot.getValue();zt(Et),Wn(new Date().getTime()),Ot.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ot&&ot(Et)}return ve.on("change",yt),function(){ve.off("change",yt)}}},[ve,ot]),Object(R.useEffect)(function(){ve&&(gt==null?(ve.setValue(""),zt("")):gt!==ve.getValue()&&(ve.setValue(gt),zt(gt),ve.setCursor(ve.lineCount(),0)))},[ve,gt]);var Yi=Object(R.useCallback)(function(yt){var Ot=ve.getCursor(),Et=ve.getSelection(),Dt=Et.split(`
|
|
`);switch(yt){case"bold":return ve.replaceSelection("**"+Et+"**"),Et===""&&ve.setCursor(Ot.line,Ot.ch+2),ve.focus();case"italic":return ve.replaceSelection("*"+Et+"*"),Et===""&&ve.setCursor(Ot.line,Ot.ch+1),ve.focus();case"code":return ve.replaceSelection("`"+Et+"`"),Et===""&&ve.setCursor(Ot.line,Ot.ch+1),ve.focus();case"inline-latex":return ve.replaceSelection("`$$"+Et+"$$`"),Et===""&&ve.setCursor(Ot.line,Ot.ch+3),ve.focus();case"latex":return ve.replaceSelection("```latex\n"+Et+"\n```"),ve.setCursor(Ot.line+1,Et.length+1),ve.focus();case"line-break":return ve.replaceSelection(`<br/>
|
|
`),ve.focus();case"list-ul":return Et===""?ve.replaceSelection("- "+Et):ve.replaceSelection(Dt.map(function(Bt){return Bt===""?"":"- ".concat(Bt)}).join(`
|
|
`)),ve.focus();case"list-ol":return Et===""?ve.replaceSelection("1. "+Et):ve.replaceSelection(Dt.map(function(Bt,Gt){return Bt===""?"":"".concat(Gt+1,". ").concat(Bt)}).join(`
|
|
`)),ve.focus();case"add-null-ch":return Et===""&&ve.setCursor(Ot.line,Ot.ch+1),ve.replaceSelection(x),ve.focus();case"inster-template-1":return Et===""&&ve.setCursor(Ot.line,Ot.ch),ve.replaceSelection(w),ve.focus();case"eraser":return ve.setValue(""),ve.focus();case"trigger-watch":return Zn(!vn),ve.focus();case"trigger-full-screen":return oi(!Dn),ve.focus();case nt:Kn(nt);return;case Ve:Kn(Ve);return;case Qe:Kn(Qe);return;case Ke:Kn(Ke);return;default:throw new Error}},[ve,vn,Dn]),Hn=Object(R.useCallback)(function(yt){Kn("");switch(ai){case nt:var Ot=yt.title,Et=yt.link;return ve.replaceSelection("[".concat(Ot,"](").concat(Et,")")),ve.focus();case Ve:var Dt=yt.language,Bt=yt.content;return ve.replaceSelection(["```"+Dt,Bt,"```"].join(`
|
|
`)),ve.focus();case Qe:var Gt=yt.src,It=yt.alt,rn=yt.name;return Gt.indexOf("type=image")>-1?ve.replaceSelection(".concat(Gt,' "').concat(It||"",'" )')):Gt.indexOf("type=application/pdf")>-1?ve.replaceSelection('<a href="'.concat(Gt,'&disposition=inline" target="_blank">').concat(rn,"</a>")):ve.replaceSelection('<a href="'.concat(Gt,'" target="_blank">').concat(rn,"</a>")),ve.focus();case Ke:for(var yn=yt.row,Nt=yt.col,Ni=yt.align,Yt=`
|
|
`,Sn=0;Sn<yn;Sn++){for(var Jt=[],Qn=[],pr=0;pr<Nt;pr++)Sn===1&&Qn.push(lt[Ni]),Jt.push(" ");Sn===1&&(Yt+="| ".concat(Qn.join(" | "),` |
|
|
`)),Yt+="| ".concat(Jt.join(Nt===1?"":" | "),` |
|
|
`)}return ve.replaceSelection(Yt+`
|
|
`),ve.focus();default:throw new Error}},[ve,ai]),$i=Object(R.useMemo)(function(){switch(ai){case nt:return C.a.createElement(_e,{callback:Hn,onCancel:fi});case Ve:return C.a.createElement(ge.b,{callback:Hn,onCancel:fi});case Qe:return C.a.createElement(be,{callback:Hn,onCancel:fi});case Ke:return C.a.createElement(ft,{callback:Hn,onCancel:fi});default:return null}},[ai]);function fi(){Kn("")}Object(R.useEffect)(function(){if(xi.current){var yt=xi.current,Ot=!1,Et=0;function Dt(It){Ot=!0,Et=It.pageY}function Bt(){Ot=!1}function Gt(It){if(Ot){var rn=It.pageY-Et;rn<0&&(rn=0),rn>300&&(rn=300);var yn=Lt+rn+"px";ln(yn)}}return yt.addEventListener("mousedown",Dt),document.addEventListener("mousemove",Gt),document.addEventListener("mouseup",Bt),function(){yt.removeEventListener("mousedown",Dt),document.removeEventListener("mousemove",Gt),document.removeEventListener("mouseup",Bt)}}},[ve,xi]),Object(R.useEffect)(function(){ln(Lt)},[Lt]);var wi=L(_t),uo=L(Di),co={width:wi,height:uo},Zo=Object(R.useMemo)(function(){if(Fn){var yt=new Date(Fn),Ot=yt.getHours(),Et=yt.getMinutes(),Dt=yt.getSeconds();return Ot=Ot<10?"0"+Ot:Ot,Et=Et<10?"0"+Et:Et,Dt=Dt<10?"0"+Dt:Dt,"".concat(Ot,":").concat(Et,":").concat(Dt)}return 0},[Fn]);function Qo(){window.sessionStorage.removeItem(an),_n(!1),Wn(0)}function ho(){_n(!1),Wn(0),ve.setValue(window.sessionStorage.getItem(an))}function Fr(yt,Ot){var Et=ve.getValue();Et=Et.replace(yt,Ot),zt(Et),ve==null||ve.setValue(Et)}return C.a.createElement(R.Fragment,null,C.a.createElement("div",{className:"markdown-editor-wrapper",ref:si},C.a.createElement("div",{className:"markdown-editor-container ".concat(Li," ").concat(vn?"on-preview":""," ").concat(en?"mini":""," ").concat(Dn?"full-screen":""),style:co},C.a.createElement(P,{insertTemp:Xt,watch:vn,fullScreen:Dn,showNullButton:Tt,onActionCallback:Yi,hidetoolBar:An,uuid:Qt.current,setOpenPhones:function(){bi.current=!0}}),C.a.createElement("div",{className:"markdown-editor-body"},C.a.createElement("div",{className:"codemirror-container"},C.a.createElement("textarea",{ref:mn,placeholder:u})),vn?C.a.createElement("div",{ref:Ci,className:"preview-container"},cn==="stex"&&C.a.createElement(Fe,{value:jt}),cn!=="stex"&&C.a.createElement(Le.a,{edit:!0,value:jt,replaces:Fr})):null))),at?C.a.createElement("a",{ref:xi,className:"editor-resize"}):null,C.a.createElement(p.a,null,bt[ai]?C.a.createElement(se.a,{centered:!0,title:bt[ai],visible:!0,onCancel:fi,footer:null},$i):null))}},QXZ7:function(et,Ze,v){"use strict";var H=v("2qtc"),se=v("kLXV"),re=v("q1tI"),ue=v.n(re),D=v("9Bee"),z=v("IH3J"),k=v.n(z),E=function(T){var R,C,te=T.installPackage,Z=T.visible,B=T.setVisible;return Object(re.useEffect)(function(){return Z?document.body.setAttribute("class",k.a.bodyHeight):document.body.removeAttribute("class"),function(){document.body.removeAttribute("class")}},[Z]),ue.a.createElement(se.a,{centered:!0,keyboard:!1,destroyOnClose:!0,visible:Z,title:"\u73AF\u5883\u4ECB\u7ECD",width:"1000px",wrapClassName:k.a.wrapInstallPackageStyle,footer:null,onCancel:function(){return B(!1)}},ue.a.createElement("div",{className:k.a.installPackageStyle},ue.a.createElement("div",{className:"mb30"},ue.a.createElement("div",{className:k.a.title},te.mainTypeName),ue.a.createElement("div",null,ue.a.createElement(D.a,{value:te.mainTypeDescription}))),!!(te!=null&&(R=te.smallType)!==null&&R!==void 0&&R.length)&&ue.a.createElement("div",{className:k.a.line}),ue.a.createElement("div",null,te==null||((C=te.smallType)===null||C===void 0)?void 0:C.map(function(J,F){return ue.a.createElement(ue.a.Fragment,{key:F},ue.a.createElement("div",{className:k.a.title,style:{marginBottom:14}},J.name),ue.a.createElement("div",{className:"mb30"},ue.a.createElement(D.a,{value:J.des})))}))))};Ze.a=E},SJMd:function(et,Ze){/**
|
|
* @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 v,H,se,re=!1,ue,D;window.PR_SHOULD_USE_CONTINUATION=!0;var z,k;(function(){var E=window,I=["break,continue,do,else,for,if,return,while"],T=[I,"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"],R=[T,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],C=[R,"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=[R,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],Z=[R,"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"],B="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",J=[R,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],F="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=[I,"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"],ne=[I,"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"],Pe=[I,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],$e=[C,Z,te,J,F,ce,ne,Pe],ye=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,Le="str",Fe="kwd",xe="com",Se="typ",Oe="lit",Ee="pun",O="pln",de="tag",Q="dec",_="src",W="atn",j="atv",A="nocode",P="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function p(ae){for(var Te=0,je=!1,Xe=!1,Ie=0,Ne=ae.length;Ie<Ne;++Ie){var Be=ae[Ie];if(Be.ignoreCase)Xe=!0;else if(/[a-z]/i.test(Be.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){je=!0,Xe=!1;break}}var ft={b:8,t:9,n:10,v:11,f:12,r:13};function ut(Ke){var we=Ke.charCodeAt(0);if(we!==92)return we;var lt=Ke.charAt(1);return we=ft[lt],we||("0"<=lt&<<="7"?parseInt(Ke.substring(1),8):lt==="u"||lt==="x"?parseInt(Ke.substring(2),16):Ke.charCodeAt(1))}function st(Ke){if(Ke<32)return(Ke<16?"\\x0":"\\x")+Ke.toString(16);var we=String.fromCharCode(Ke);return we==="\\"||we==="-"||we==="]"||we==="^"?"\\"+we:we}function nt(Ke){var we=Ke.substring(1,Ke.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")),lt=[],tt=we[0]==="^",Re=["["];tt&&Re.push("^");for(var He=tt?1:0,q=we.length;He<q;++He){var Y=we[He];if(/\\[bdsw]/i.test(Y))Re.push(Y);else{var ie=ut(Y),x;He+2<q&&we[He+1]==="-"?(x=ut(we[He+2]),He+=2):x=ie,lt.push([ie,x]),x<65||ie>122||(x<65||ie>90||lt.push([Math.max(65,ie)|32,Math.min(x,90)|32]),x<97||ie>122||lt.push([Math.max(97,ie)&~32,Math.min(x,122)&~32]))}}lt.sort(function(fe,ke){return fe[0]-ke[0]||ke[1]-fe[1]});for(var w=[],L=[],He=0;He<lt.length;++He){var N=lt[He];N[0]<=L[1]+1?L[1]=Math.max(L[1],N[1]):w.push(L=N)}for(var He=0;He<w.length;++He){var N=w[He];Re.push(st(N[0])),N[1]>N[0]&&(N[1]+1>N[0]&&Re.push("-"),Re.push(st(N[1])))}return Re.push("]"),Re.join("")}function Qe(Ke){for(var we=Ke.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")),lt=we.length,tt=[],Re=0,He=0;Re<lt;++Re){var q=we[Re];if(q==="(")++He;else if(q.charAt(0)==="\\"){var Y=+q.substring(1);Y&&(Y<=He?tt[Y]=-1:we[Re]=st(Y))}}for(var Re=1;Re<tt.length;++Re)tt[Re]===-1&&(tt[Re]=++Te);for(var Re=0,He=0;Re<lt;++Re){var q=we[Re];if(q==="(")++He,tt[He]||(we[Re]="(?:");else if(q.charAt(0)==="\\"){var Y=+q.substring(1);Y&&Y<=He&&(we[Re]="\\"+tt[Y])}}for(var Re=0;Re<lt;++Re)we[Re]==="^"&&we[Re+1]!=="^"&&(we[Re]="");if(Ke.ignoreCase&&je)for(var Re=0;Re<lt;++Re){var q=we[Re],ie=q.charAt(0);q.length>=2&&ie==="["?we[Re]=nt(q):ie!=="\\"&&(we[Re]=q.replace(/[a-zA-Z]/g,function(L){var N=L.charCodeAt(0);return"["+String.fromCharCode(N&~32,N|32)+"]"}))}return we.join("")}for(var Ve=[],Ie=0,Ne=ae.length;Ie<Ne;++Ie){var Be=ae[Ie];if(Be.global||Be.multiline)throw new Error(""+Be);Ve.push("(?:"+Qe(Be)+")")}return new RegExp(Ve.join("|"),Xe?"gi":"g")}function d(ae,Te){var je=/(?:^|\s)nocode(?:\s|$)/,Xe=[],Ie=0,Ne=[],Be=0;function ft(ut){var st=ut.nodeType;if(st==1){if(je.test(ut.className))return;for(var nt=ut.firstChild;nt;nt=nt.nextSibling)ft(nt);var Qe=ut.nodeName.toLowerCase();(Qe==="br"||Qe==="li")&&(Xe[Be]=`
|
|
`,Ne[Be<<1]=Ie++,Ne[Be++<<1|1]=ut)}else if(st==3||st==4){var Ve=ut.nodeValue;Ve.length&&(Te?Ve=Ve.replace(/\r\n?/g,`
|
|
`):Ve=Ve.replace(/[ \t\r\n]+/g," "),Xe[Be]=Ve,Ne[Be<<1]=Ie,Ie+=Ve.length,Ne[Be++<<1|1]=ut)}}return ft(ae),{sourceCode:Xe.join("").replace(/\n$/,""),spans:Ne}}function S(ae,Te,je,Xe,Ie){if(!je)return;var Ne={sourceNode:ae,pre:1,langExtension:null,numberLines:null,sourceCode:je,spans:null,basePos:Te,decorations:null};Xe(Ne),Ie.push.apply(Ie,Ne.decorations)}var G=/\S/;function oe(ae){for(var Te=void 0,je=ae.firstChild;je;je=je.nextSibling){var Xe=je.nodeType;Te=Xe===1?Te?ae:je:Xe===3&&G.test(je.nodeValue)?ae:Te}return Te===ae?void 0:Te}function Ce(ae,Te){var je={},Xe;(function(){for(var Be=ae.concat(Te),ft=[],ut={},st=0,nt=Be.length;st<nt;++st){var Qe=Be[st],Ve=Qe[3];if(Ve)for(var Ke=Ve.length;--Ke>=0;)je[Ve.charAt(Ke)]=Qe;var we=Qe[1],lt=""+we;ut.hasOwnProperty(lt)||(ft.push(we),ut[lt]=null)}ft.push(/[\0-\uffff]/),Xe=p(ft)})();var Ie=Te.length,Ne=function(Be){for(var ft=Be.sourceCode,ut=Be.basePos,st=Be.sourceNode,nt=[ut,O],Qe=0,Ve=ft.match(Xe)||[],Ke={},we=0,lt=Ve.length;we<lt;++we){var tt=Ve[we],Re=Ke[tt],He=void 0,q;if(typeof Re=="string")q=!1;else{var Y=je[tt.charAt(0)];if(Y)He=tt.match(Y[1]),Re=Y[0];else{for(var ie=0;ie<Ie;++ie)if(Y=Te[ie],He=tt.match(Y[1]),He){Re=Y[0];break}He||(Re=O)}q=Re.length>=5&&Re.substring(0,5)==="lang-",q&&!(He&&typeof He[1]=="string")&&(q=!1,Re=_),q||(Ke[tt]=Re)}var x=Qe;if(Qe+=tt.length,!q)nt.push(ut+x,Re);else{var w=He[1],L=tt.indexOf(w),N=L+w.length;He[2]&&(N=tt.length-He[2].length,L=N-w.length);var fe=Re.substring(5);S(st,ut+x,tt.substring(0,L),Ne,nt),S(st,ut+x+L,w,V(fe,w),nt),S(st,ut+x+N,tt.substring(N),Ne,nt)}}Be.decorations=nt};return Ne}function Me(ae){var Te=[],je=[];ae.tripleQuotedStrings?Te.push([Le,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ae.multiLineStrings?Te.push([Le,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Te.push([Le,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ae.verbatimStrings&&je.push([Le,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Xe=ae.hashComments;Xe&&(ae.cStyleComments?(Xe>1?Te.push([xe,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Te.push([xe,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),je.push([Le,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Te.push([xe,/^#[^\r\n]*/,null,"#"])),ae.cStyleComments&&(je.push([xe,/^\/\/[^\r\n]*/,null]),je.push([xe,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ie=ae.regexLiterals;if(Ie){var Ne=Ie>1?"":`
|
|
\r`,Be=Ne?".":"[\\S\\s]",ft="/(?=[^/*"+Ne+"])(?:[^/\\x5B\\x5C"+Ne+"]|\\x5C"+Be+"|\\x5B(?:[^\\x5C\\x5D"+Ne+"]|\\x5C"+Be+")*(?:\\x5D|$))+/";je.push(["lang-regex",RegExp("^"+P+"("+ft+")")])}var ut=ae.types;ut&&je.push([Se,ut]);var st=(""+ae.keywords).replace(/^ | $/g,"");st.length&&je.push([Fe,new RegExp("^(?:"+st.replace(/[\s,]+/g,"|")+")\\b"),null]),Te.push([O,/^\s+/,null,` \r
|
|
\xA0`]);var nt="^.[^\\s\\w.$@'\"`/\\\\]*";return ae.regexLiterals&&(nt+="(?!s*/)"),je.push([Oe,/^@[a-z_$][a-z_$@0-9]*/i,null],[Se,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[O,/^[a-z_$][a-z_$@0-9]*/i,null],[Oe,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[O,/^\\[\s\S]?/,null],[Ee,new RegExp(nt),null]),Ce(Te,je)}var me=Me({keywords:$e,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function _e(ae,Te,je){for(var Xe=/(?:^|\s)nocode(?:\s|$)/,Ie=/\r\n?|\n/,Ne=ae.ownerDocument,Be=Ne.createElement("li");ae.firstChild;)Be.appendChild(ae.firstChild);var ft=[Be];function ut(we){var lt=we.nodeType;if(lt==1&&!Xe.test(we.className))if(we.nodeName==="br")st(we),we.parentNode&&we.parentNode.removeChild(we);else for(var tt=we.firstChild;tt;tt=tt.nextSibling)ut(tt);else if((lt==3||lt==4)&&je){var Re=we.nodeValue,He=Re.match(Ie);if(He){var q=Re.substring(0,He.index);we.nodeValue=q;var Y=Re.substring(He.index+He[0].length);if(Y){var ie=we.parentNode;ie.insertBefore(Ne.createTextNode(Y),we.nextSibling)}st(we),q||we.parentNode.removeChild(we)}}}function st(we){for(;!we.nextSibling;)if(we=we.parentNode,!we)return;function lt(He,q){var Y=q?He.cloneNode(!1):He,ie=He.parentNode;if(ie){var x=lt(ie,1),w=He.nextSibling;x.appendChild(Y);for(var L=w;L;L=w)w=L.nextSibling,x.appendChild(L)}return Y}for(var tt=lt(we.nextSibling,0),Re;(Re=tt.parentNode)&&Re.nodeType===1;)tt=Re;ft.push(tt)}for(var nt=0;nt<ft.length;++nt)ut(ft[nt]);Te===(Te|0)&&ft[0].setAttribute("value",Te);var Qe=Ne.createElement("ol");Qe.className="linenums";for(var Ve=Math.max(0,Te-1|0)||0,nt=0,Ke=ft.length;nt<Ke;++nt)Be=ft[nt],Be.className="L"+(nt+Ve)%10,Be.firstChild||Be.appendChild(Ne.createTextNode("\xA0")),Qe.appendChild(Be);ae.appendChild(Qe)}function ge(ae){var Te=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Te=Te&&+Te[1]<=8;var je=/\n/g,Xe=ae.sourceCode,Ie=Xe.length,Ne=0,Be=ae.spans,ft=Be.length,ut=0,st=ae.decorations,nt=st.length,Qe=0;st[nt]=Ie;var Ve,Ke;for(Ke=Ve=0;Ke<nt;)st[Ke]!==st[Ke+2]?(st[Ve++]=st[Ke++],st[Ve++]=st[Ke++]):Ke+=2;for(nt=Ve,Ke=Ve=0;Ke<nt;){for(var we=st[Ke],lt=st[Ke+1],tt=Ke+2;tt+2<=nt&&st[tt+1]===lt;)tt+=2;st[Ve++]=we,st[Ve++]=lt,Ke=tt}nt=st.length=Ve;var Re=ae.sourceNode,He="";Re&&(He=Re.style.display,Re.style.display="none");try{for(var q=null;ut<ft;){var Y=Be[ut],ie=Be[ut+2]||Ie,x=st[Qe+2]||Ie,tt=Math.min(ie,x),w=Be[ut+1],L;if(w.nodeType!==1&&(L=Xe.substring(Ne,tt))){Te&&(L=L.replace(je,"\r")),w.nodeValue=L;var N=w.ownerDocument,fe=N.createElement("span");fe.className=st[Qe+1];var ke=w.parentNode;ke.replaceChild(fe,w),fe.appendChild(w),Ne<ie&&(Be[ut+1]=w=N.createTextNode(Xe.substring(tt,ie)),ke.insertBefore(w,fe.nextSibling))}Ne=tt,Ne>=ie&&(ut+=2),Ne>=x&&(Qe+=2)}}finally{Re&&(Re.style.display=He)}}var le={};function ee(ae,Te){for(var je=Te.length;--je>=0;){var Xe=Te[je];le.hasOwnProperty(Xe)?E.console&&console.warn("cannot override language handler %s",Xe):le[Xe]=ae}}function V(ae,Te){return ae&&le.hasOwnProperty(ae)||(ae=/^\s*</.test(Te)?"default-markup":"default-code"),le[ae]}ee(me,["default-code"]),ee(Ce([],[[O,/^[^<?]+/],[Q,/^<!\w[^>]*(?:>|$)/],[xe,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[Ee,/^(?:<[%?]|[%?]>)/],["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"]),ee(Ce([[O,/^[\s]+/,null,` \r
|
|
`],[j,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[de,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[W,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[Ee,/^[=<>\/]+/],["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"]),ee(Ce([],[[j,/^[\s\S]+/]]),["uq.val"]),ee(Me({keywords:C,hashComments:!0,cStyleComments:!0,types:ye}),["c","cc","cpp","cxx","cyc","m"]),ee(Me({keywords:"null,true,false"}),["json"]),ee(Me({keywords:Z,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:ye}),["cs"]),ee(Me({keywords:te,cStyleComments:!0}),["java"]),ee(Me({keywords:Pe,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ee(Me({keywords:ce,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ee(Me({keywords:F,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ee(Me({keywords:ne,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ee(Me({keywords:J,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ee(Me({keywords:B,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ee(Ce([],[[Le,/^[\s\S]+/]]),["regex"]);function b(ae){var Te=ae.langExtension;try{var je=d(ae.sourceNode,ae.pre),Xe=je.sourceCode;ae.sourceCode=Xe,ae.spans=je.spans,ae.basePos=0,V(Te,Xe)(ae),ge(ae)}catch(Ie){E.console&&console.log(Ie&&Ie.stack||Ie)}}function X(ae,Te,je){var Xe=je||!1,Ie=Te||null,Ne=document.createElement("div");Ne.innerHTML="<pre>"+ae+"</pre>",Ne=Ne.firstChild,Xe&&_e(Ne,Xe,!0);var Be={langExtension:Ie,numberLines:Xe,sourceNode:Ne,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return b(Be),Ne.innerHTML}function M(ae,Te){var je=Te||document.body,Xe=je.ownerDocument||document;function Ie(Y){return je.getElementsByTagName(Y)}for(var Ne=[Ie("pre"),Ie("code"),Ie("xmp")],Be=[],ft=0;ft<Ne.length;++ft)for(var ut=0,st=Ne[ft].length;ut<st;++ut)Be.push(Ne[ft][ut]);Ne=null;var nt=Date;nt.now||(nt={now:function(){return+new Date}});var Qe=0,Ve=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ke=/\bprettyprint\b/,we=/\bprettyprinted\b/,lt=/pre|xmp/i,tt=/^code$/i,Re=/^(?:pre|code|xmp)$/i,He={};function q(){for(var Y=E.PR_SHOULD_USE_CONTINUATION?nt.now()+250:Infinity;Qe<Be.length&&nt.now()<Y;Qe++){for(var ie=Be[Qe],x=He,w=ie;w=w.previousSibling;){var L=w.nodeType,N=(L===7||L===8)&&w.nodeValue;if(N?!/^\??prettify\b/.test(N):L!==3||/\S/.test(w.nodeValue))break;if(N){x={},N.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Lt,wt,en){x[wt]=en});break}}var fe=ie.className;if((x!==He||Ke.test(fe))&&!we.test(fe)){for(var ke=!1,Ye=ie.parentNode;Ye;Ye=Ye.parentNode){var bt=Ye.tagName;if(Re.test(bt)&&Ye.className&&Ke.test(Ye.className)){ke=!0;break}}if(!ke){ie.className+=" prettyprinted";var Rt=x.lang;if(!Rt){Rt=fe.match(Ve);var We;!Rt&&(We=oe(ie))&&tt.test(We.tagName)&&(Rt=We.className.match(Ve)),Rt&&(Rt=Rt[1])}var Ct;if(lt.test(ie.tagName))Ct=1;else{var gt=ie.currentStyle,ot=Xe.defaultView,vt=gt?gt.whiteSpace:ot&&ot.getComputedStyle?ot.getComputedStyle(ie,null).getPropertyValue("white-space"):0;Ct=vt&&vt.substring(0,3)==="pre"}var _t=x.linenums;(_t=_t==="true"||+_t)||(_t=fe.match(/\blinenums\b(?::(\d+))?/),_t=_t?_t[1]&&_t[1].length?+_t[1]:!0:!1),_t&&_e(ie,_t,Ct);var Mt={langExtension:Rt,sourceNode:ie,numberLines:_t,pre:Ct,sourceCode:null,basePos:null,spans:null,decorations:null};b(Mt)}}}Qe<Be.length?E.setTimeout(q,250):typeof ae=="function"&&ae()}q()}var be=E.PR={createSimpleLexer:Ce,registerLangHandler:ee,sourceDecorator:Me,PR_ATTRIB_NAME:W,PR_ATTRIB_VALUE:j,PR_COMMENT:xe,PR_DECLARATION:Q,PR_KEYWORD:Fe,PR_LITERAL:Oe,PR_NOCODE:A,PR_PLAIN:O,PR_PUNCTUATION:Ee,PR_SOURCE:_,PR_STRING:Le,PR_TAG:de,PR_TYPE:Se,prettyPrintOne:re?E.prettyPrintOne=X:z=X,prettyPrint:k=re?E.prettyPrint=M:k=M},Ae=E.define;typeof Ae=="function"&&Ae.amd&&Ae("google-code-prettify",[],function(){return be})})()},"VrN/":function(et,Ze,v){(function(H,se){et.exports=se()})(this,function(){"use strict";var H=navigator.userAgent,se=navigator.platform,re=/gecko\/\d/i.test(H),ue=/MSIE \d/.test(H),D=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(H),z=/Edge\/(\d+)/.exec(H),k=ue||D||z,E=k&&(ue?document.documentMode||6:+(z||D)[1]),I=!z&&/WebKit\//.test(H),T=I&&/Qt\/\d+\.\d+/.test(H),R=!z&&/Chrome\//.test(H),C=/Opera\//.test(H),te=/Apple Computer/.test(navigator.vendor),Z=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(H),B=/PhantomJS/.test(H),J=!z&&/AppleWebKit/.test(H)&&/Mobile\/\w+/.test(H),F=/Android/.test(H),ce=J||F||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(H),ne=J||/Mac/.test(se),Pe=/\bCrOS\b/.test(H),$e=/win/i.test(se),ye=C&&H.match(/Version\/(\d*\.\d*)/);ye&&(ye=Number(ye[1])),ye&&ye>=15&&(C=!1,I=!0);var Le=ne&&(T||C&&(ye==null||ye<12.11)),Fe=re||k&&E>=9;function xe(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Se=function(e,t){var i=e.className,n=xe(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 Oe(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function Ee(e,t){return Oe(e).appendChild(t)}function O(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=O(e,t,i,n);return r.setAttribute("role","presentation"),r}var Q;document.createRange?Q=function(e,t,i,n){var r=document.createRange();return r.setEnd(n||e,i),r.setStart(e,t),r}:Q=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 _(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 W(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function j(e,t){var i=e.className;xe(t).test(i)||(e.className+=(i?" ":"")+t)}function A(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!xe(i[n]).test(t)&&(t+=" "+i[n]);return t}var P=function(e){e.select()};J?P=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:k&&(P=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 S(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 G=function(){this.id=null,this.f=null,this.time=0,this.handler=p(this.onTimeout,this)};G.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},G.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 oe(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var Ce=50,Me={toString:function(){return"CodeMirror.Pass"}},me={scroll:!1},_e={origin:"*mouse"},ge={origin:"+move"};function le(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 ee=[""];function V(e){for(;ee.length<=e;)ee.push(b(ee)+" ");return ee[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 M(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 Ae(e,t){var i;return Object.create?i=Object.create(e):(be.prototype=e,i=new be),t&&d(t,i),i}var ae=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Te(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ae.test(e))}function je(e,t){return t?t.source.indexOf("\\w")>-1&&Te(e)?!0:t.test(e):Te(e)}function Xe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ie=/[\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 Ne(e){return e.charCodeAt(0)>=768&&Ie.test(e)}function Be(e,t,i){for(;(i<0?t>0:t<e.length)&&Ne(e.charAt(t));)t+=i;return t}function ft(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 ut(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var r=!1,s=0;s<e.length;++s){var l=e[s];(l.from<i&&l.to>t||t==i&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,i),l.level==1?"rtl":"ltr",s),r=!0)}r||n(t,i,"ltr")}var st=null;function nt(e,t,i){var n;st=null;for(var r=0;r<e.length;++r){var s=e[r];if(s.from<t&&s.to>t)return r;s.to==t&&(s.from!=s.to&&i=="before"?n=r:st=r),s.from==t&&(s.from!=s.to&&i!="before"?n=r:st=r)}return n!=null?n:st}var Qe=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(y){return y<=247?e.charAt(y):1424<=y&&y<=1524?"R":1536<=y&&y<=1785?t.charAt(y-1536):1774<=y&&y<=2220?"r":8192<=y&&y<=8203?"w":y==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,f=/[1n]/;function m(y,U,K){this.level=y,this.from=U,this.to=K}return function(y,U){var K=U=="ltr"?"L":"R";if(y.length==0||U=="ltr"&&!n.test(y))return!1;for(var pe=y.length,he=[],De=0;De<pe;++De)he.push(i(y.charCodeAt(De)));for(var Ge=0,qe=K;Ge<pe;++Ge){var it=he[Ge];it=="m"?he[Ge]=qe:qe=it}for(var ct=0,rt=K;ct<pe;++ct){var dt=he[ct];dt=="1"&&rt=="r"?he[ct]="n":s.test(dt)&&(rt=dt,dt=="r"&&(he[ct]="R"))}for(var St=1,xt=he[0];St<pe-1;++St){var Pt=he[St];Pt=="+"&&xt=="1"&&he[St+1]=="1"?he[St]="1":Pt==","&&xt==he[St+1]&&(xt=="1"||xt=="n")&&(he[St]=xt),xt=Pt}for(var qt=0;qt<pe;++qt){var Cn=he[qt];if(Cn==",")he[qt]="N";else if(Cn=="%"){var on=void 0;for(on=qt+1;on<pe&&he[on]=="%";++on);for(var Gn=qt&&he[qt-1]=="!"||on<pe&&he[on]=="1"?"1":"N",jn=qt;jn<on;++jn)he[jn]=Gn;qt=on-1}}for(var dn=0,Bn=K;dn<pe;++dn){var kn=he[dn];Bn=="L"&&kn=="1"?he[dn]="L":s.test(kn)&&(Bn=kn)}for(var gn=0;gn<pe;++gn)if(r.test(he[gn])){var fn=void 0;for(fn=gn+1;fn<pe&&r.test(he[fn]);++fn);for(var sn=(gn?he[gn-1]:K)=="L",Un=(fn<pe?he[fn]:K)=="L",hr=sn==Un?sn?"L":"R":K,Mi=gn;Mi<fn;++Mi)he[Mi]=hr;gn=fn-1}for(var Rn=[],ci,wn=0;wn<pe;)if(l.test(he[wn])){var $o=wn;for(++wn;wn<pe&&l.test(he[wn]);++wn);Rn.push(new m(0,$o,wn))}else{var gi=wn,Gi=Rn.length,Vi=U=="rtl"?1:0;for(++wn;wn<pe&&he[wn]!="L";++wn);for(var On=gi;On<wn;)if(f.test(he[On])){gi<On&&(Rn.splice(Gi,0,new m(1,gi,On)),Gi+=Vi);var dr=On;for(++On;On<wn&&f.test(he[On]);++On);Rn.splice(Gi,0,new m(2,dr,On)),Gi+=Vi,gi=On}else++On;gi<wn&&Rn.splice(Gi,0,new m(1,gi,wn))}return U=="ltr"&&(Rn[0].level==1&&(ci=y.match(/^\s+/))&&(Rn[0].from=ci[0].length,Rn.unshift(new m(0,0,ci[0].length))),b(Rn).level==1&&(ci=y.match(/\s+$/))&&(b(Rn).to-=ci[0].length,Rn.push(new m(0,pe-ci[0].length,pe)))),U=="rtl"?Rn.reverse():Rn}}();function Ve(e,t){var i=e.order;return i==null&&(i=e.order=Qe(e.text,t)),i}var Ke=[],we=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]||Ke).concat(i)}};function lt(e,t){return e._handlers&&e._handlers[t]||Ke}function tt(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=oe(r,i);s>-1&&(n[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function Re(e,t){var i=lt(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 He(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Re(e,i||t.type,e,t),L(t)||t.codemirrorIgnore}function q(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)oe(i,t[n])==-1&&i.push(t[n])}function Y(e,t){return lt(e,t).length>0}function ie(e){e.prototype.on=function(t,i){we(this,t,i)},e.prototype.off=function(t,i){tt(this,t,i)}}function x(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function w(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function L(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function N(e){x(e),w(e)}function fe(e){return e.target||e.srcElement}function ke(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),ne&&e.ctrlKey&&t==1&&(t=3),t}var Ye=function(){if(k&&E<9)return!1;var e=O("div");return"draggable"in e||"dragDrop"in e}(),bt;function Rt(e){if(bt==null){var t=O("span","\u200B");Ee(e,O("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(bt=t.offsetWidth<=1&&t.offsetHeight>2&&!(k&&E<8))}var i=bt?O("span","\u200B"):O("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var We;function Ct(e){if(We!=null)return We;var t=Ee(e,document.createTextNode("A\u062EA")),i=Q(t,0,1).getBoundingClientRect(),n=Q(t,1,2).getBoundingClientRect();return Oe(e),!i||i.left==i.right?!1:We=n.right-i.right<3}var gt=`
|
|
|
|
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/)},ot=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},vt=function(){var e=O("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),_t=null;function Mt(e){if(_t!=null)return _t;var t=Ee(e,O("span","x")),i=t.getBoundingClientRect(),n=Q(t,0,1).getBoundingClientRect();return _t=Math.abs(i.left-n.left)>1}var Lt={},wt={};function en(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Lt[e]=t}function Ut(e,t){wt[e]=t}function ht(e){if(typeof e=="string"&&wt.hasOwnProperty(e))e=wt[e];else if(e&&typeof e.name=="string"&&wt.hasOwnProperty(e.name)){var t=wt[e.name];typeof t=="string"&&(t={name:t}),e=Ae(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return ht("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return ht("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Vt(e,t){t=ht(t);var i=Lt[t.name];if(!i)return Vt(e,"text/plain");var n=i(e,t);if(Xt.hasOwnProperty(t.name)){var r=Xt[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 Xt={};function nn(e,t){var i=Xt.hasOwnProperty(e)?Xt[e]:Xt[e]={};d(t,i)}function cn(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 Jn(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function an(e,t,i){return e.startState?e.startState(t,i):!0}var pt=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};pt.prototype.eol=function(){return this.pos>=this.string.length},pt.prototype.sol=function(){return this.pos==this.lineStart},pt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},pt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},pt.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},pt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},pt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},pt.prototype.skipToEnd=function(){this.pos=this.string.length},pt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},pt.prototype.backUp=function(e){this.pos-=e},pt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=S(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?S(this.string,this.lineStart,this.tabSize):0)},pt.prototype.indentation=function(){return S(this.string,null,this.tabSize)-(this.lineStart?S(this.string,this.lineStart,this.tabSize):0)},pt.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)}},pt.prototype.current=function(){return this.string.slice(this.start,this.pos)},pt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},pt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},pt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function at(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 Zt(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 hn(e,t,i){var n=[];return e.iter(t,i,function(r){n.push(r.text)}),n}function Kt(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function Tt(e){if(e.parent==null)return null;for(var t=e.parent,i=oe(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 Mn(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],m=f.height;if(t<m)break;t-=m}return i+l}function An(e,t){return t>=e.first&&t<e.first+e.size}function vi(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Je(e,t,i){if(i===void 0&&(i=null),!(this instanceof Je))return new Je(e,t,i);this.line=e,this.ch=t,this.sticky=i}function kt(e,t){return e.line-t.line||e.ch-t.ch}function ri(e,t){return e.sticky==t.sticky&&kt(e,t)==0}function hi(e){return Je(e.line,e.ch)}function di(e,t){return kt(e,t)<0?t:e}function Li(e,t){return kt(e,t)<0?e:t}function h(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function o(e,t){if(t.line<e.first)return Je(e.first,0);var i=e.first+e.size-1;return t.line>i?Je(i,at(e,i).text.length):a(t,at(e,t.line).text.length)}function a(e,t){var i=e.ch;return i==null||i>t?Je(e.line,t):i<0?Je(e.line,0):e}function u(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=o(e,t[n]);return i}var g=function(e,t){this.state=e,this.lookAhead=t},c=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};c.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},c.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},c.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},c.fromSaved=function(e,t,i){return t instanceof g?new c(e,cn(e.mode,t.state),i,t.lookAhead):new c(e,cn(e.mode,t),i)},c.prototype.save=function(e){var t=e!==!1?cn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new g(t,this.maxLookAhead):t};function $(e,t,i,n){var r=[e.state.modeGen],s={};Xn(e,t.text,e.doc.mode,i,function(y,U){return r.push(y,U)},s,n);for(var l=i.state,f=function(y){i.baseTokens=r;var U=e.state.overlays[y],K=1,pe=0;i.state=!0,Xn(e,t.text,U.mode,i,function(he,De){for(var Ge=K;pe<he;){var qe=r[K];qe>he&&r.splice(K,1,he,r[K+1],qe),K+=2,pe=Math.min(he,qe)}if(!De)return;if(U.opaque)r.splice(Ge,K-Ge,he,"overlay "+De),K=Ge+2;else for(;Ge<K;Ge+=2){var it=r[Ge+1];r[Ge+1]=(it?it+" ":"")+"overlay "+De}},s),i.state=l,i.baseTokens=null,i.baseTokenPos=1},m=0;m<e.state.overlays.length;++m)f(m);return{styles:r,classes:s.bgClass||s.textClass?s:null}}function Ue(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=ve(e,Tt(t)),r=t.text.length>e.options.maxHighlightLength&&cn(e.doc.mode,n.state),s=$(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 ve(e,t,i){var n=e.doc,r=e.display;if(!n.mode.startState)return new c(n,!0,t);var s=vn(e,t,i),l=s>n.first&&at(n,s-1).stateAfter,f=l?c.fromSaved(n,l,s):new c(n,an(n.mode),s);return n.iter(s,t,function(m){mt(e,m.text,f);var y=f.line;m.stateAfter=y==t-1||y%5==0||y>=r.viewFrom&&y<r.viewTo?f.save():null,f.nextLine()}),i&&(n.modeFrontier=f.line),f}function mt(e,t,i,n){var r=e.doc.mode,s=new pt(t,e.options.tabSize,i);for(s.start=s.pos=n||0,t==""&&ze(r,i.state);!s.eol();)At(r,s,i.state),s.start=s.pos}function ze(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=Jn(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function At(e,t,i,n){for(var r=0;r<10;r++){n&&(n[0]=Jn(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 jt=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=at(r,t.line),m=ve(e,t.line,i),y=new pt(f.text,e.options.tabSize,m),U;for(n&&(U=[]);(n||y.pos<t.ch)&&!y.eol();)y.start=y.pos,l=At(s,y,m.state),n&&U.push(new jt(y,l,cn(r.mode,m.state)));return n?U:new jt(y,l,m.state)}function Vn(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 Xn(e,t,i,n,r,s,l){var f=i.flattenSpans;f==null&&(f=e.options.flattenSpans);var m=0,y=null,U=new pt(t,e.options.tabSize,n),K,pe=e.options.addModeClass&&[null];for(t==""&&Vn(ze(i,n.state),s);!U.eol();){if(U.pos>e.options.maxHighlightLength?(f=!1,l&&mt(e,t,n,U.pos),U.pos=t.length,K=null):K=Vn(At(i,U,n.state,pe),s),pe){var he=pe[0].name;he&&(K="m-"+(K?he+" "+K:he))}if(!f||y!=K){for(;m<U.start;)m=Math.min(U.start,m+5e3),r(m,y);y=K}U.start=U.pos}for(;m<U.pos;){var De=Math.min(U.pos,m+5e3);r(De,y),m=De}}function vn(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 m=at(s,f-1),y=m.stateAfter;if(y&&(!i||f+(y instanceof g?y.lookAhead:0)<=s.modeFrontier))return f;var U=S(m.text,null,e.options.tabSize);(r==null||n>U)&&(r=f-1,n=U)}return r}function Zn(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=at(e,n).stateAfter;if(r&&(!(r instanceof g)||n+r.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Xi=!1,Pn=!1;function Dn(){Xi=!0}function oi(){Pn=!0}function yi(e,t,i){this.marker=e,this.from=t,this.to=i}function qn(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function ai(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function Kn(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 m=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);(n||(n=[])).push(new yi(l,s.from,m?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 m=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);(n||(n=[])).push(new yi(l,m?null:s.from-t,s.to==null?null:s.to-t))}}return n}function Fn(e,t){if(t.full)return null;var i=An(e,t.from.line)&&at(e,t.from.line).markedSpans,n=An(e,t.to.line)&&at(e,t.to.line).markedSpans;if(!i&&!n)return null;var r=t.from.ch,s=t.to.ch,l=kt(t.from,t.to)==0,f=fr(i,r,l),m=Ki(n,s,l),y=t.text.length==1,U=b(t.text).length+(y?r:0);if(f)for(var K=0;K<f.length;++K){var pe=f[K];if(pe.to==null){var he=qn(m,pe.marker);he?y&&(pe.to=he.to==null?null:he.to+U):pe.to=r}}if(m)for(var De=0;De<m.length;++De){var Ge=m[De];if(Ge.to!=null&&(Ge.to+=U),Ge.from==null){var qe=qn(f,Ge.marker);qe||(Ge.from=U,y&&(f||(f=[])).push(Ge))}else Ge.from+=U,y&&(f||(f=[])).push(Ge)}f&&(f=Wn(f)),m&&m!=f&&(m=Wn(m));var it=[f];if(!y){var ct=t.text.length-2,rt;if(ct>0&&f)for(var dt=0;dt<f.length;++dt)f[dt].to==null&&(rt||(rt=[])).push(new yi(f[dt].marker,null,null));for(var St=0;St<ct;++St)it.push(rt);it.push(m)}return it}function Wn(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Oi(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(he){if(he.markedSpans)for(var De=0;De<he.markedSpans.length;++De){var Ge=he.markedSpans[De].marker;Ge.readOnly&&(!n||oe(n,Ge)==-1)&&(n||(n=[])).push(Ge)}}),!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),m=0;m<r.length;++m){var y=r[m];if(kt(y.to,f.from)<0||kt(y.from,f.to)>0)continue;var U=[m,1],K=kt(y.from,f.from),pe=kt(y.to,f.to);(K<0||!l.inclusiveLeft&&!K)&&U.push({from:y.from,to:f.from}),(pe>0||!l.inclusiveRight&&!pe)&&U.push({from:f.to,to:y.to}),r.splice.apply(r,U),m+=U.length-3}return r}function Pi(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 Di(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function ln(e){return e.inclusiveLeft?-1:0}function Ft(e){return e.inclusiveRight?1:0}function En(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),r=t.find(),s=kt(n.from,r.from)||ln(e)-ln(t);if(s)return-s;var l=kt(n.to,r.to)||Ft(e)-Ft(t);return l||t.id-e.id}function Wt(e,t){var i=Pn&&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||En(n,r.marker)<0)&&(n=r.marker);return n}function _n(e){return Wt(e,!0)}function Qt(e){return Wt(e,!1)}function bi(e,t){var i=Pn&&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||En(n,s.marker)<0)&&(n=s.marker)}return n}function pn(e,t,i,n,r){var s=at(e,t),l=Pn&&s.markedSpans;if(l)for(var f=0;f<l.length;++f){var m=l[f];if(!m.marker.collapsed)continue;var y=m.marker.find(0),U=kt(y.from,i)||ln(m.marker)-ln(r),K=kt(y.to,n)||Ft(m.marker)-Ft(r);if(U>=0&&K<=0||U<=0&&K>=0)continue;if(U<=0&&(m.marker.inclusiveRight&&r.inclusiveLeft?kt(y.to,i)>=0:kt(y.to,i)>0)||U>=0&&(m.marker.inclusiveRight&&r.inclusiveLeft?kt(y.from,n)<=0:kt(y.from,n)<0))return!0}}function mn(e){for(var t;t=_n(e);)e=t.find(-1,!0).line;return e}function si(e){for(var t;t=Qt(e);)e=t.find(1,!0).line;return e}function xi(e){for(var t,i;t=Qt(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function Ci(e,t){var i=at(e,t),n=mn(i);return i==n?t:Tt(n)}function Ur(e,t){if(t>e.lastLine())return t;var i=at(e,t),n;if(!ei(e,i))return t;for(;n=Qt(i);)i=n.find(1,!0).line;return Tt(i)+1}function ei(e,t){var i=Pn&&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,qn(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 Hn(e){e=mn(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=_n(n);){var r=i.find(0,!0);n=r.from.line,t+=r.from.ch-r.to.ch}for(n=e;i=Qt(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=at(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 wi=function(e,t,i){this.text=e,Di(this,t),this.height=i?i(this):1};wi.prototype.lineNo=function(){return Tt(this)},ie(wi);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),Pi(e),Di(e,i);var r=n?n(e):1;r!=e.height&&Kt(e,r)}function co(e){e.parent=null,Pi(e)}var Zo={},Qo={};function ho(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 Fr(e,t){var i=de("span",null,null,I?"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=Ot,Ct(e.display.measure)&&(l=Ve(s,e.doc.direction))&&(n.addToken=Dt(n.addToken,l)),n.map=[];var f=t!=e.display.externalMeasured&&Tt(s);Gt(s,n,Ue(e,s,f)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=A(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=A(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(Rt(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(I){var m=n.content.lastChild;(/\bcm-tab\b/.test(m.className)||m.querySelector&&m.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Re(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=A(n.pre.className,n.textClass||"")),n}function yt(e){var t=O("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Ot(e,t,i,n,r,s,l){if(!t)return;var f=e.splitSpaces?Et(t,e.trailingSpace):t,m=e.cm.state.specialChars,y=!1,U;if(!m.test(t))e.col+=t.length,U=document.createTextNode(f),e.map.push(e.pos,e.pos+t.length,U),k&&E<9&&(y=!0),e.pos+=t.length;else{U=document.createDocumentFragment();for(var K=0;;){m.lastIndex=K;var pe=m.exec(t),he=pe?pe.index-K:t.length-K;if(he){var De=document.createTextNode(f.slice(K,K+he));k&&E<9?U.appendChild(O("span",[De])):U.appendChild(De),e.map.push(e.pos,e.pos+he,De),e.col+=he,e.pos+=he}if(!pe)break;K+=he+1;var Ge=void 0;if(pe[0]==" "){var qe=e.cm.options.tabSize,it=qe-e.col%qe;Ge=U.appendChild(O("span",V(it),"cm-tab")),Ge.setAttribute("role","presentation"),Ge.setAttribute("cm-text"," "),e.col+=it}else pe[0]=="\r"||pe[0]==`
|
|
`?(Ge=U.appendChild(O("span",pe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ge.setAttribute("cm-text",pe[0]),e.col+=1):(Ge=e.cm.options.specialCharPlaceholder(pe[0]),Ge.setAttribute("cm-text",pe[0]),k&&E<9?U.appendChild(O("span",[Ge])):U.appendChild(Ge),e.col+=1);e.map.push(e.pos,e.pos+1,Ge),e.pos++}}if(e.trailingSpace=f.charCodeAt(t.length-1)==32,i||n||r||y||s||l){var ct=i||"";n&&(ct+=n),r&&(ct+=r);var rt=O("span",[U],ct,s);if(l)for(var dt in l)l.hasOwnProperty(dt)&&dt!="style"&&dt!="class"&&rt.setAttribute(dt,l[dt]);return e.content.appendChild(rt)}e.content.appendChild(U)}function Et(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 Dt(e,t){return function(i,n,r,s,l,f,m){r=r?r+" cm-force-border":"cm-force-border";for(var y=i.pos,U=y+n.length;;){for(var K=void 0,pe=0;pe<t.length&&!(K=t[pe],K.to>y&&K.from<=y);pe++);if(K.to>=U)return e(i,n,r,s,l,f,m);e(i,n.slice(0,K.to-y),r,s,null,f,m),s=null,n=n.slice(K.to-y),y=K.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 Gt(e,t,i){var n=e.markedSpans,r=e.text,s=0;if(!n){for(var l=1;l<i.length;l+=2)t.addToken(t,r.slice(s,s=i[l]),ho(i[l+1],t.cm.options));return}for(var f=r.length,m=0,y=1,U="",K,pe,he=0,De,Ge,qe,it,ct;;){if(he==m){De=Ge=qe=pe="",ct=null,it=null,he=Infinity;for(var rt=[],dt=void 0,St=0;St<n.length;++St){var xt=n[St],Pt=xt.marker;if(Pt.type=="bookmark"&&xt.from==m&&Pt.widgetNode)rt.push(Pt);else if(xt.from<=m&&(xt.to==null||xt.to>m||Pt.collapsed&&xt.to==m&&xt.from==m)){if(xt.to!=null&&xt.to!=m&&he>xt.to&&(he=xt.to,Ge=""),Pt.className&&(De+=" "+Pt.className),Pt.css&&(pe=(pe?pe+";":"")+Pt.css),Pt.startStyle&&xt.from==m&&(qe+=" "+Pt.startStyle),Pt.endStyle&&xt.to==he&&(dt||(dt=[])).push(Pt.endStyle,xt.to),Pt.title&&((ct||(ct={})).title=Pt.title),Pt.attributes)for(var qt in Pt.attributes)(ct||(ct={}))[qt]=Pt.attributes[qt];Pt.collapsed&&(!it||En(it.marker,Pt)<0)&&(it=xt)}else xt.from>m&&he>xt.from&&(he=xt.from)}if(dt)for(var Cn=0;Cn<dt.length;Cn+=2)dt[Cn+1]==he&&(Ge+=" "+dt[Cn]);if(!it||it.from==m)for(var on=0;on<rt.length;++on)Bt(t,0,rt[on]);if(it&&(it.from||0)==m){if(Bt(t,(it.to==null?f+1:it.to)-m,it.marker,it.from==null),it.to==null)return;it.to==m&&(it=!1)}}if(m>=f)break;for(var Gn=Math.min(f,he);;){if(U){var jn=m+U.length;if(!it){var dn=jn>Gn?U.slice(0,Gn-m):U;t.addToken(t,dn,K?K+De:De,qe,m+dn.length==he?Ge:"",pe,ct)}if(jn>=Gn){U=U.slice(Gn-m),m=Gn;break}m=jn,qe=""}U=r.slice(s,s=i[y++]),K=ho(i[y++],t.cm.options)}}}function It(e,t,i){this.line=t,this.rest=xi(t),this.size=this.rest?Tt(b(this.rest))-i+1:1,this.node=this.text=null,this.hidden=ei(e,t)}function rn(e,t,i){for(var n=[],r,s=t;s<i;s=r){var l=new It(e.doc,at(e.doc,s),s);r=s+l.size,n.push(l)}return n}var yn=null;function Nt(e){yn?yn.ops.push(e):e.ownsGroup=yn={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 Yt(e,t){var i=e.ownsGroup;if(!i)return;try{Ni(i)}finally{yn=null,t(i)}}var Sn=null;function Jt(e,t){var i=lt(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),r;yn?r=yn.delayedCallbacks:Sn?r=Sn:(r=Sn=[],setTimeout(Qn,0));for(var s=function(f){r.push(function(){return i[f].apply(null,n)})},l=0;l<i.length;++l)s(l)}function Qn(){var e=Sn;Sn=null;for(var t=0;t<e.length;++t)e[t]()}function pr(e,t,i,n){for(var r=0;r<t.changes.length;r++){var s=t.changes[r];s=="text"?Ds(e,t):s=="gutter"?ea(e,t,i,n):s=="class"?fo(e,t):s=="widget"&&Ns(e,t,n)}t.changes=null}function mr(e){return e.node==e.text&&(e.node=O("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),k&&E<8&&(e.node.style.zIndex=2)),e.node}function Ps(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var n=mr(t);t.background=n.insertBefore(O("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):Fr(e,t)}function Ds(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){Ps(e,t),t.line.wrapClass?mr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function ea(e,t,i,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var r=mr(t);t.gutterBackground=O("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),r.insertBefore(t.gutterBackground,t.text)}var s=t.line.gutterMarkers;if(e.options.lineNumbers||s){var l=mr(t),f=t.gutter=O("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(O("div",vi(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var m=0;m<e.display.gutterSpecs.length;++m){var y=e.display.gutterSpecs[m].className,U=s.hasOwnProperty(y)&&s[y];U&&f.appendChild(O("div",[U],"CodeMirror-gutter-elt","left: "+n.gutterLeft[y]+"px; width: "+n.gutterWidth[y]+"px"))}}}function Ns(e,t,i){t.alignable&&(t.alignable=null);for(var n=xe("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=mr(i),l=0,f=t.widgets;l<f.length;++l){var m=f[l],y=O("div",[m.node],"CodeMirror-linewidget"+(m.className?" "+m.className:""));m.handleMouseEvents||y.setAttribute("cm-ignore-events","true"),js(m,y,i,n),e.display.input.setUneditable(y),r&&m.above?s.insertBefore(y,i.gutter||i.text):s.appendChild(y),Jt(m,"redraw")}}function js(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var r=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(r-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=r+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function gr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!_(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;"),Ee(t.display.measure,O("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function pi(e,t){for(var i=fe(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Wr(e){return e.lineSpace.offsetTop}function po(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ia(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=Ee(e.measure,O("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 li(e){return Ce-e.display.nativeBarWidth}function Ii(e){return e.display.scroller.clientWidth-li(e)-e.display.barWidth}function mo(e){return e.display.scroller.clientHeight-li(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 m=l[f],y=l[f+1];Math.abs(m.bottom-y.bottom)>2&&s.push((m.bottom+y.top)/2-i.top)}}s.push(i.bottom-i.top)}}function 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(Tt(e.rest[r])>i)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Us(e,t){t=mn(t);var i=Tt(t),n=e.display.externalMeasured=new It(e.doc,t,i);n.lineN=i;var r=n.built=Fr(e,n);return n.text=r.pre,Ee(e.display.lineMeasure,r.pre),n}function oa(e,t,i,n){return ui(e,Ji(e,t),i,n)}function go(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=Tt(t),n=go(e,i);n&&!n.text?n=null:n&&n.changes&&(pr(e,n,i,wo(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 ui(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=Ws(e,t,i,n),l.bogus||(t.cache[s]=l)),{left:l.left,right:l.right,top:r?l.rtop:l.top,bottom:r?l.rbottom:l.bottom}}var aa={left:0,right:0,top:0,bottom:0};function sa(e,t,i){for(var n,r,s,l,f,m,y=0;y<e.length;y+=3)if(f=e[y],m=e[y+1],t<f?(r=0,s=1,l="left"):t<m?(r=t-f,s=r+1):(y==e.length-3||t==m&&e[y+3]>t)&&(s=m-f,r=s-1,t>=m&&(l="right")),r!=null){if(n=e[y+2],f==m&&i==(n.insertLeft?"left":"right")&&(l=i),i=="left"&&r==0)for(;y&&e[y-2]==e[y-3]&&e[y-1].insertLeft;)n=e[(y-=3)+2],l="left";if(i=="right"&&r==m-f)for(;y<e.length-3&&e[y+3]==e[y+4]&&!e[y+5].insertLeft;)n=e[(y+=3)+2],l="right";break}return{node:n,start:r,end:s,collapse:l,coverStart:f,coverEnd:m}}function Fs(e,t){var i=aa;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var r=e.length-1;r>=0&&!((i=e[r]).left!=i.right);r--);return i}function Ws(e,t,i,n){var r=sa(t.map,i,n),s=r.node,l=r.start,f=r.end,m=r.collapse,y;if(s.nodeType==3){for(var U=0;U<4;U++){for(;l&&Ne(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+f<r.coverEnd&&Ne(t.line.text.charAt(r.coverStart+f));)++f;if(k&&E<9&&l==0&&f==r.coverEnd-r.coverStart?y=s.parentNode.getBoundingClientRect():y=Fs(Q(s,l,f).getClientRects(),n),y.left||y.right||l==0)break;f=l,l=l-1,m="right"}k&&E<11&&(y=Hs(e.display.measure,y))}else{l>0&&(m=n="right");var K;e.options.lineWrapping&&(K=s.getClientRects()).length>1?y=K[n=="right"?K.length-1:0]:y=s.getBoundingClientRect()}if(k&&E<9&&!l&&(!y||!y.left&&!y.right)){var pe=s.parentNode.getClientRects()[0];pe?y={left:pe.left,right:pe.left+Qi(e.display),top:pe.top,bottom:pe.bottom}:y=aa}for(var he=y.top-t.rect.top,De=y.bottom-t.rect.top,Ge=(he+De)/2,qe=t.view.measure.heights,it=0;it<qe.length-1&&!(Ge<qe[it]);it++);var ct=it?qe[it-1]:0,rt=qe[it],dt={left:(m=="right"?y.right:y.left)-t.rect.left,right:(m=="left"?y.left:y.right)-t.rect.left,top:ct,bottom:rt};return!y.left&&!y.right&&(dt.bogus=!0),e.options.singleCursorHeightPerLine||(dt.rtop=he,dt.rbottom=De),dt}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Mt(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,Oe(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)la(e.display.view[t])}function vr(e){ua(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ca(){return R&&F?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ha(){return R&&F?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function vo(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=gr(e.widgets[i]));return t}function Hr(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=Hn(t);if(n=="local"?l+=Wr(e.display):l-=e.display.viewOffset,n=="page"||n=="window"){var f=e.display.lineSpace.getBoundingClientRect();l+=f.top+(n=="window"?0:ha());var m=f.left+(n=="window"?0:ca());i.left+=m,i.right+=m}return i.top+=l,i.bottom+=l,i}function da(e,t,i){if(i=="div")return t;var n=t.left,r=t.top;if(i=="page")n-=ca(),r-=ha();else if(i=="local"||!i){var s=e.display.sizer.getBoundingClientRect();n+=s.left,r+=s.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:r-l.top}}function yo(e,t,i,n,r){return n||(n=at(e.doc,t.line)),Hr(e,n,oa(e,n,t.ch,r),i)}function ti(e,t,i,n,r,s){n=n||at(e.doc,t.line),r||(r=Ji(e,n));function l(De,Ge){var qe=ui(e,r,De,Ge?"right":"left",s);return Ge?qe.left=qe.right:qe.right=qe.left,Hr(e,n,qe,i)}var f=Ve(n,e.doc.direction),m=t.ch,y=t.sticky;if(m>=n.text.length?(m=n.text.length,y="before"):m<=0&&(m=0,y="after"),!f)return l(y=="before"?m-1:m,y=="before");function U(De,Ge,qe){var it=f[Ge],ct=it.level==1;return l(qe?De-1:De,ct!=qe)}var K=nt(f,m,y),pe=st,he=U(m,K,y=="before");return pe!=null&&(he.other=U(m,pe,y!="before")),he}function fa(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=Qi(e.display)*t.ch);var n=at(e.doc,t.line),r=Hn(n)+Wr(e.display);return{left:i,right:i,top:r,bottom:r+n.height}}function bo(e,t,i,n,r){var s=Je(e,t,i);return s.xRel=r,n&&(s.outside=n),s}function 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=Mn(n,i),s=n.first+n.size-1;if(r>s)return bo(n.first+n.size-1,at(n,s).text.length,null,1,1);t<0&&(t=0);for(var l=at(n,r);;){var f=zs(e,l,r,t,i),m=bi(l,f.ch+(f.xRel>0||f.outside>0?1:0));if(!m)return f;var y=m.find(1);if(y.line==r)return y;l=at(n,r=y.line)}}function pa(e,t,i,n){n-=vo(t);var r=t.text.length,s=ft(function(l){return ui(e,i,l-1).bottom<=n},r,0);return r=ft(function(l){return ui(e,i,l).top>n},s,r),{begin:s,end:r}}function ma(e,t,i,n){i||(i=Ji(e,t));var r=Hr(e,t,ui(e,i,n),"line").top;return pa(e,t,i,r)}function Co(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function zs(e,t,i,n,r){r-=Hn(t);var s=Ji(e,t),l=vo(t),f=0,m=t.text.length,y=!0,U=Ve(t,e.doc.direction);if(U){var K=(e.options.lineWrapping?Vs:Gs)(e,t,i,s,U,n,r);y=K.level!=1,f=y?K.from:K.to-1,m=y?K.to:K.from-1}var pe=null,he=null,De=ft(function(St){var xt=ui(e,s,St);return xt.top+=l,xt.bottom+=l,Co(xt,n,r,!1)?(xt.top<=r&&xt.left<=n&&(pe=St,he=xt),!0):!1},f,m),Ge,qe,it=!1;if(he){var ct=n-he.left<he.right-n,rt=ct==y;De=pe+(rt?0:1),qe=rt?"after":"before",Ge=ct?he.left:he.right}else{!y&&(De==m||De==f)&&De++,qe=De==0?"after":De==t.text.length?"before":ui(e,s,De-(y?1:0)).bottom+l<=r==y?"after":"before";var dt=ti(e,Je(i,De,qe),"line",t,s);Ge=dt.left,it=r<dt.top?-1:r>=dt.bottom?1:0}return De=Be(t.text,De,1),bo(i,De,qe,it,n-Ge)}function Gs(e,t,i,n,r,s,l){var f=ft(function(K){var pe=r[K],he=pe.level!=1;return Co(ti(e,Je(i,he?pe.to:pe.from,he?"before":"after"),"line",t,n),s,l,!0)},0,r.length-1),m=r[f];if(f>0){var y=m.level!=1,U=ti(e,Je(i,y?m.from:m.to,y?"after":"before"),"line",t,n);Co(U,s,l,!0)&&U.top>l&&(m=r[f-1])}return m}function Vs(e,t,i,n,r,s,l){var f=pa(e,t,n,l),m=f.begin,y=f.end;/\s/.test(t.text.charAt(y-1))&&y--;for(var U=null,K=null,pe=0;pe<r.length;pe++){var he=r[pe];if(he.from>=y||he.to<=m)continue;var De=he.level!=1,Ge=ui(e,n,De?Math.min(y,he.to)-1:Math.max(m,he.from)).right,qe=Ge<s?s-Ge+1e9:Ge-s;(!U||K>qe)&&(U=he,K=qe)}return U||(U=r[r.length-1]),U.from<m&&(U={from:m,to:U.to,level:U.level}),U.to>y&&(U={from:U.from,to:y,level:U.level}),U}var ji;function Zi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ji==null){ji=O("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ji.appendChild(document.createTextNode("x")),ji.appendChild(O("br"));ji.appendChild(document.createTextNode("x"))}Ee(e.measure,ji);var i=ji.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),Oe(e.measure),i||1}function Qi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=O("span","xxxxxxxxxx"),i=O("pre",[t],"CodeMirror-line-like");Ee(e.measure,i);var n=t.getBoundingClientRect(),r=(n.right-n.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function wo(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:Eo(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function Eo(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ga(e){var t=Zi(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/Qi(e.display)-3);return function(r){if(ei(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 _o(e){var t=e.doc,i=ga(e);t.iter(function(n){var r=i(n);r!=n.height&&Kt(n,r)})}function Bi(e,t,i,n){var r=e.display;if(!i&&fe(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(K){return null}var m=xo(e,s,l),y;if(n&&m.xRel>0&&(y=at(e.doc,m.line).text).length==m.ch){var U=S(y,y.length,e.options.tabSize)-y.length;m=Je(m.line,Math.max(0,Math.round((s-ia(e.display).left)/Qi(e.display))-U))}return m}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 Nn(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)Pn&&Ci(e.doc,t)<r.viewTo&&_i(e);else if(i<=r.viewFrom)Pn&&Ur(e.doc,i+n)>r.viewFrom?_i(e):(r.viewFrom+=n,r.viewTo+=n);else if(t<=r.viewFrom&&i>=r.viewTo)_i(e);else if(t<=r.viewFrom){var s=zr(e,i,i+n,1);s?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=n):_i(e)}else if(i>=r.viewTo){var l=zr(e,t,t,-1);l?(r.view=r.view.slice(0,l.index),r.viewTo=l.lineN):_i(e)}else{var f=zr(e,t,t,-1),m=zr(e,i,i+n,1);f&&m?(r.view=r.view.slice(0,f.index).concat(rn(e,f.lineN,m.lineN)).concat(r.view.slice(m.index)),r.viewTo+=n):_i(e)}var y=r.externalMeasured;y&&(i<y.lineN?y.lineN+=n:t<y.lineN+y.size&&(r.externalMeasured=null))}function Ei(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=[]);oe(l,i)==-1&&l.push(i)}function _i(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function zr(e,t,i,n){var r=Ui(e,t),s,l=e.display.view;if(!Pn||i==e.doc.first+e.doc.size)return{index:r,lineN:i};for(var f=e.display.viewFrom,m=0;m<r;m++)f+=l[m].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(;Ci(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=rn(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=rn(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(rn(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 m=f.empty();(m||e.options.showCursorWhenSelecting)&&ba(e,f.head,r),m||Ks(e,f,s)}return n}function ba(e,t,i){var n=ti(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=i.appendChild(O("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(O("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,m=Math.max(n.sizerWidth,Ii(e)-n.sizer.offsetLeft)-l.right,y=r.direction=="ltr";function U(rt,dt,St,xt){dt<0&&(dt=0),dt=Math.round(dt),xt=Math.round(xt),s.appendChild(O("div",null,"CodeMirror-selected","position: absolute; left: "+rt+`px;
|
|
top: `+dt+"px; width: "+(St==null?m-rt:St)+`px;
|
|
height: `+(xt-dt)+"px"))}function K(rt,dt,St){var xt=at(r,rt),Pt=xt.text.length,qt,Cn;function on(dn,Bn){return yo(e,Je(rt,dn),"div",xt,Bn)}function Gn(dn,Bn,kn){var gn=ma(e,xt,null,dn),fn=Bn=="ltr"==(kn=="after")?"left":"right",sn=kn=="after"?gn.begin:gn.end-(/\s/.test(xt.text.charAt(gn.end-1))?2:1);return on(sn,fn)[fn]}var jn=Ve(xt,r.direction);return ut(jn,dt||0,St==null?Pt:St,function(dn,Bn,kn,gn){var fn=kn=="ltr",sn=on(dn,fn?"left":"right"),Un=on(Bn-1,fn?"right":"left"),hr=dt==null&&dn==0,Mi=St==null&&Bn==Pt,Rn=gn==0,ci=!jn||gn==jn.length-1;if(Un.top-sn.top<=3){var wn=(y?hr:Mi)&&Rn,$o=(y?Mi:hr)&&ci,gi=wn?f:(fn?sn:Un).left,Gi=$o?m:(fn?Un:sn).right;U(gi,sn.top,Gi-gi,sn.bottom)}else{var Vi,On,dr,Jo;fn?(Vi=y&&hr&&Rn?f:sn.left,On=y?m:Gn(dn,kn,"before"),dr=y?f:Gn(Bn,kn,"after"),Jo=y&&Mi&&ci?m:Un.right):(Vi=y?Gn(dn,kn,"before"):f,On=!y&&hr&&Rn?m:sn.right,dr=!y&&Mi&&ci?f:Un.left,Jo=y?Gn(Bn,kn,"after"):m),U(Vi,sn.top,On-Vi,sn.bottom),sn.bottom<Un.top&&U(f,sn.bottom,null,Un.top),U(dr,Un.top,Jo-dr,Un.bottom)}(!qt||Gr(sn,qt)<0)&&(qt=sn),Gr(Un,qt)<0&&(qt=Un),(!Cn||Gr(sn,Cn)<0)&&(Cn=sn),Gr(Un,Cn)<0&&(Cn=Un)}),{start:qt,end:Cn}}var pe=t.from(),he=t.to();if(pe.line==he.line)K(pe.line,pe.ch,he.ch);else{var De=at(r,pe.line),Ge=at(r,he.line),qe=mn(De)==mn(Ge),it=K(pe.line,pe.ch,qe?De.text.length+1:null).end,ct=K(he.line,qe?0:null,he.ch).start;qe&&(it.top<ct.top-2?(U(it.right,it.top,null,it.bottom),U(f,ct.top,ct.left,ct.bottom)):U(it.right,it.top,ct.left-it.right,it.bottom)),it.bottom<ct.top&&U(f,it.bottom,null,ct.top)}i.appendChild(s)}function So(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||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(),ko(e))}function Ca(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,qi(e))},100)}function ko(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Re(e,"focus",e,t),e.state.focused=!0,j(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),I&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),So(e)}function qi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Re(e,"blur",e,t),e.state.focused=!1,Se(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(k&&E<8){var m=r.node.offsetTop+r.node.offsetHeight;l=m-i,i=m}else{var y=r.node.getBoundingClientRect();l=y.bottom-y.top,!s&&r.text.firstChild&&(f=r.text.firstChild.getBoundingClientRect().right-y.left-1)}var U=r.line.height-l;if((U>.005||U<-.005)&&(Kt(r.line,l),wa(r.line),r.rest))for(var K=0;K<r.rest.length;K++)wa(r.rest[K]);if(f>e.display.sizerWidth){var pe=Math.ceil(f/Qi(e.display));pe>e.display.maxLineLength&&(e.display.maxLineLength=pe,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function wa(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],n=i.node.parentNode;n&&(i.height=n.offsetHeight)}}function Xr(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Wr(e));var r=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,s=Mn(t,n),l=Mn(t,r);if(i&&i.ensure){var f=i.ensure.from.line,m=i.ensure.to.line;f<s?(s=f,l=Mn(t,Hn(at(t,f))+e.wrapper.clientHeight)):Math.min(m,t.lastLine())>=l&&(s=Mn(t,Hn(at(t,m))-e.wrapper.clientHeight),l=m)}return{from:s,to:Math.max(l,s+1)}}function Ys(e,t){if(He(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&&!B){var s=O("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-i.viewOffset-Wr(e.display))+`px;
|
|
height: `+(t.bottom-t.top+li(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?Je(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?Je(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,f=ti(e,t),m=!i||i==t?f:ti(e,i);r={left:Math.min(f.left,m.left),top:Math.min(f.top,m.top)-n,right:Math.max(f.left,m.left),bottom:Math.max(f.bottom,m.bottom)+n};var y=Ao(e,r),U=e.doc.scrollTop,K=e.doc.scrollLeft;if(y.scrollTop!=null&&(xr(e,y.scrollTop),Math.abs(e.doc.scrollTop-U)>1&&(l=!0)),y.scrollLeft!=null&&(Fi(e,y.scrollLeft),Math.abs(e.doc.scrollLeft-K)>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&&Fi(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=mo(e),l={};t.bottom-t.top>s&&(t.bottom=t.top+s);var f=e.doc.height+po(i),m=t.top<n,y=t.bottom>f-n;if(t.top<r)l.scrollTop=m?0:t.top;else if(t.bottom>r+s){var U=Math.min(t.top,(y?f:t.bottom)-s);U!=r&&(l.scrollTop=U)}var K=e.options.fixedGutter?0:i.gutters.offsetWidth,pe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-K,he=Ii(e)-i.gutters.offsetWidth,De=t.right-t.left>he;return De&&(t.right=t.left+he),t.left<10?l.scrollLeft=0:t.left<pe?l.scrollLeft=Math.max(0,t.left+K-(De?0:10)):t.right>he+pe-3&&(l.scrollLeft=t.right+(De?0:10)-he),l}function To(e,t){if(t==null)return;Kr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function 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);Ea(e,i,n,t.margin)}}function Ea(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;re||Mo(e,{top:t}),_a(e,t,!0),re&&Mo(e),Er(e,100)}function _a(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 Fi(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,Ra(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Cr(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+li(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Wi=function(e,t,i){this.cm=i;var n=this.vert=O("div",[O("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=O("div",[O("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=r.tabIndex=-1,e(n),e(r),we(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),we(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,k&&E<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Wi.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}},Wi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Wi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Wi.prototype.zeroWidthHack=function(){var e=ne&&!Z?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new G,this.disableVert=new G},Wi.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)},Wi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var wr=function(){};wr.prototype.update=function(){return{bottom:0,right:0}},wr.prototype.setScrollLeft=function(){},wr.prototype.setScrollTop=function(){},wr.prototype.clear=function(){};function tr(e,t){t||(t=Cr(e));var i=e.display.barWidth,n=e.display.barHeight;Sa(e,t);for(var r=0;r<4&&i!=e.display.barWidth||n!=e.display.barHeight;r++)i!=e.display.barWidth&&e.options.lineWrapping&&Vr(e),Sa(e,Cr(e)),i=e.display.barWidth,n=e.display.barHeight}function Sa(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var ka={native:Wi,null:wr};function Aa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Se(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new ka[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),we(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"?Fi(e,t):xr(e,t)},e),e.display.scrollbars.addClass&&j(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function Hi(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},Nt(e.curOp)}function zi(e){var t=e.curOp;t&&Yt(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&&Ro(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Vr(t),e.barMeasure=Cr(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+li(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&&Fi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==W();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&&So(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&&Ta(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&_a(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Fi(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||Re(s[f],"hide");if(l)for(var m=0;m<l.length;++m)l[m].lines.length&&Re(l[m],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Re(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function zn(e,t){if(e.curOp)return t();Hi(e);try{return t()}finally{zi(e)}}function bn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Hi(e);try{return t.apply(e,arguments)}finally{zi(e)}}}function Ln(e){return function(){if(this.curOp)return e.apply(this,arguments);Hi(this);try{return e.apply(this,arguments)}finally{zi(this)}}}function xn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Hi(t);try{return e.apply(this,arguments)}finally{zi(t)}}}function Er(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=ve(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?cn(t.mode,n.state):null,m=$(e,s,n,!0);f&&(n.state=f),s.styles=m.styles;var y=s.styleClasses,U=m.classes;U?s.styleClasses=U:y&&(s.styleClasses=null);for(var K=!l||l.length!=s.styles.length||y!=U&&(!y||!U||y.bgClass!=U.bgClass||y.textClass!=U.textClass),pe=0;!K&&pe<l.length;++pe)K=l[pe]!=s.styles[pe];K&&r.push(n.line),s.stateAfter=n.save(),n.nextLine()}else s.text.length<=e.options.maxHighlightLength&&mt(e,s.text,n),s.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return Er(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),r.length&&zn(e,function(){for(var s=0;s<r.length;s++)Ei(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=wo(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++)Re.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=li(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=li(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=W();if(!t||!_(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&_(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==W())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&_(document.body,e.anchorNode)&&_(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 Ro(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return _i(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)&&(_i(e),t.dims=wo(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)),Pn&&(s=Ci(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=Hn(at(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var m=va(e);if(!f&&m==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var y=sl(e);return m>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),m>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(y),Oe(i.cursorDiv),Oe(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,f&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Er(e,400)),i.updateLineNumbers=null,!0}function Ta(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Ii(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+po(e.display)-mo(e),i.top)}),t.visible=Xr(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Xr(e.display,e.doc,i));if(!Ro(e,t))break;Vr(e);var r=Cr(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(Ro(e,i)){Vr(e),Ta(e,i);var n=Cr(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(De){var Ge=De.nextSibling;return I&&ne&&e.display.currentWheelTarget==De?De.style.display="none":De.parentNode.removeChild(De),Ge}for(var m=n.view,y=n.viewFrom,U=0;U<m.length;U++){var K=m[U];if(!K.hidden)if(!K.node||K.node.parentNode!=s){var pe=Is(e,K,y,i);s.insertBefore(pe,l)}else{for(;l!=K.node;)l=f(l);var he=r&&t!=null&&t<=y&&K.lineNumber;K.changes&&(oe(K.changes,"gutter")>-1&&(he=!1),pr(e,K,y,i)),he&&(Oe(K.lineNumber),K.lineNumber.appendChild(document.createTextNode(vi(e.options,y)))),l=K.node.nextSibling}y+=K.size}for(;l;)l=f(l)}function Lo(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+li(e)+"px"}function Ra(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=Eo(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,s=n+"px",l=0;l<i.length;l++)if(!i[l].hidden){e.options.fixedGutter&&(i[l].gutter&&(i[l].gutter.style.left=s),i[l].gutterBackground&&(i[l].gutterBackground.style.left=s));var f=i[l].alignable;if(f)for(var m=0;m<f.length;m++)f[m].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=n+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(O("div",[O("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",Lo(e.display),!0}return!1}function Po(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 La(e){var t=e.gutters,i=e.gutterSpecs;Oe(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(O("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",Lo(e)}function _r(e){La(e.display),Nn(e),Ra(e)}function cl(e,t,i,n){var r=this;this.input=i,r.scrollbarFiller=O("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=O("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=de("div",null,"CodeMirror-code"),r.selectionDiv=O("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=O("div",null,"CodeMirror-cursors"),r.measure=O("div",null,"CodeMirror-measure"),r.lineMeasure=O("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=O("div",[s],null,"position: relative"),r.sizer=O("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=O("div",null,null,"position: absolute; height: "+Ce+"px; width: 1px;"),r.gutters=O("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=O("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=O("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),k&&E<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),!I&&!(re&&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=Po(n.gutters,n.lineNumbers),La(r),i.init(r)}var $r=0,Yn=null;k?Yn=-.53:re?Yn=15:R?Yn=-.7:te&&(Yn=-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 hl(e){var t=Oa(e);return t.x*=Yn,t.y*=Yn,t}function Pa(e,t){var i=Oa(t),n=i.x,r=i.y,s=e.display,l=s.scroller,f=l.scrollWidth>l.clientWidth,m=l.scrollHeight>l.clientHeight;if(!(n&&f||r&&m))return;if(r&&ne&&I){e:for(var y=t.target,U=s.view;y!=l;y=y.parentNode)for(var K=0;K<U.length;K++)if(U[K].node==y){e.display.currentWheelTarget=y;break e}}if(n&&!re&&!C&&Yn!=null){r&&m&&xr(e,Math.max(0,l.scrollTop+r*Yn)),Fi(e,Math.max(0,l.scrollLeft+n*Yn)),(!r||r&&m)&&x(t),s.wheelStartX=null;return}if(r&&Yn!=null){var pe=r*Yn,he=e.doc.scrollTop,De=he+s.wrapper.clientHeight;pe<0?he=Math.max(0,he+pe-50):De=Math.min(e.doc.height,De+pe+50),Mo(e,{top:he,bottom:De})}$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 Ge=l.scrollLeft-s.wheelStartX,qe=l.scrollTop-s.wheelStartY,it=qe&&s.wheelDY&&qe/s.wheelDY||Ge&&s.wheelDX&&Ge/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!it)return;Yn=(Yn*$r+it)/($r+1),++$r},200)):(s.wheelDX+=n,s.wheelDY+=r))}var $n=function(e,t){this.ranges=e,this.primIndex=t};$n.prototype.primary=function(){return this.ranges[this.primIndex]},$n.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(!ri(i.anchor,n.anchor)||!ri(i.head,n.head))return!1}return!0},$n.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ht(hi(this.ranges[t].anchor),hi(this.ranges[t].head));return new $n(e,this.primIndex)},$n.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},$n.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(kt(t,n.from())>=0&&kt(e,n.to())<=0)return i}return-1};var Ht=function(e,t){this.anchor=e,this.head=t};Ht.prototype.from=function(){return Li(this.anchor,this.head)},Ht.prototype.to=function(){return di(this.anchor,this.head)},Ht.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ni(e,t,i){var n=e&&e.options.selectionsMayTouch,r=t[i];t.sort(function(pe,he){return kt(pe.from(),he.from())}),i=oe(t,r);for(var s=1;s<t.length;s++){var l=t[s],f=t[s-1],m=kt(f.to(),l.from());if(n&&!l.empty()?m>0:m>=0){var y=Li(f.from(),l.from()),U=di(f.to(),l.to()),K=f.empty()?l.from()==l.head:f.from()==f.head;s<=i&&--i,t.splice(--s,2,new Ht(K?U:y,K?y:U))}}return new $n(t,i)}function Si(e,t){return new $n([new Ht(e,t||e)],0)}function ki(e){return e.text?Je(e.from.line+e.text.length-1,b(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Da(e,t){if(kt(e,t.from)<0)return e;if(kt(e,t.to)<=0)return ki(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+=ki(t).ch-t.to.ch),Je(i,n)}function Do(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var r=e.sel.ranges[n];i.push(new Ht(Da(r.anchor,t),Da(r.head,t)))}return ni(e.cm,i,e.sel.primIndex)}function Na(e,t,i){return e.line==t.line?Je(i.line,e.ch-t.ch+i.ch):Je(i.line+(e.line-t.line),e.ch)}function dl(e,t,i){for(var n=[],r=Je(e.first,0),s=r,l=0;l<t.length;l++){var f=t[l],m=Na(f.from,r,s),y=Na(ki(f),r,s);if(r=f.to,s=y,i=="around"){var U=e.sel.ranges[l],K=kt(U.head,U.anchor)<0;n[l]=new Ht(K?y:m,K?m:y)}else n[l]=new Ht(m,m)}return new $n(n,e.sel.primIndex)}function No(e){e.doc.mode=Vt(e.options,e.doc.modeOption),Sr(e)}function Sr(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Er(e,100),e.state.modeGen++,e.curOp&&Nn(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(ct){return i?i[ct]:null}function s(ct,rt,dt){uo(ct,rt,dt,n),Jt(ct,"change",ct,t)}function l(ct,rt){for(var dt=[],St=ct;St<rt;++St)dt.push(new wi(y[St],r(St),n));return dt}var f=t.from,m=t.to,y=t.text,U=at(e,f.line),K=at(e,m.line),pe=b(y),he=r(y.length-1),De=m.line-f.line;if(t.full)e.insert(0,l(0,y.length)),e.remove(y.length,e.size-y.length);else if(Ia(e,t)){var Ge=l(0,y.length-1);s(K,K.text,he),De&&e.remove(f.line,De),Ge.length&&e.insert(f.line,Ge)}else if(U==K)if(y.length==1)s(U,U.text.slice(0,f.ch)+pe+U.text.slice(m.ch),he);else{var qe=l(1,y.length-1);qe.push(new wi(pe+U.text.slice(m.ch),he,n)),s(U,U.text.slice(0,f.ch)+y[0],r(0)),e.insert(f.line+1,qe)}else if(y.length==1)s(U,U.text.slice(0,f.ch)+y[0]+K.text.slice(m.ch),r(0)),e.remove(f.line+1,De);else{s(U,U.text.slice(0,f.ch)+y[0],r(0)),s(K,pe+K.text.slice(m.ch),he);var it=l(1,y.length-1);De>1&&e.remove(f.line+1,De-1),e.insert(f.line+1,it)}Jt(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 m=r.linked[f];if(m.doc==s)continue;var y=l&&m.sharedHist;if(i&&!y)continue;t(m.doc,y),n(m.doc,r,y)}}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,_o(e),No(e),Ba(e),e.options.lineWrapping||fi(e),e.options.mode=t.modeOption,Nn(e)}function Ba(e){(e.doc.direction=="rtl"?j:Se)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){zn(e,function(){Ba(e),Nn(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:hi(t.from),to:ki(t),text:Zt(e,t.from,t.to)};return Wa(e,i,t.from.line,t.to.line+1),Ai(e,function(n){return Wa(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 Fa(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),kt(t.from,t.to)==0&&kt(t.from,f.to)==0?f.to=ki(t):l.changes.push(jo(e,t));else{var m=b(r.done);for((!m||!m.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||Re(e,"historyAdded")}function ml(e,t,i,n){var r=t.charAt(0);return r=="*"||r=="+"&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,n){var r=e.history,s=n&&n.origin;i==r.lastSelOp||s&&r.lastSelOrigin==s&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==s||ml(e,s,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 Wa(e,t,i,n){var r=t["spans_"+e.id],s=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(l){l.markedSpans&&((r||(r=t["spans_"+e.id]={}))[s]=l.markedSpans),++s})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var n=[],r=0;r<t.text.length;++r)n.push(vl(i[r]));return n}function Ha(e,t){var i=yl(e,t),n=Fn(e,t);if(!i)return n;if(!n)return i;for(var r=0;r<i.length;++r){var s=i[r],l=n[r];if(s&&l){e:for(var f=0;f<l.length;++f){for(var m=l[f],y=0;y<s.length;++y)if(s[y].marker==m.marker)continue e;s.push(m)}}else l&&(i[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?$n.prototype.deepCopy.call(s):s);continue}var l=s.changes,f=[];n.push({changes:f});for(var m=0;m<l.length;++m){var y=l[m],U=void 0;if(f.push({from:y.from,to:y.to,text:y.text}),t)for(var K in y)(U=K.match(/^spans_(\d+)$/))&&(oe(t,Number(U[1]))>-1&&(b(f)[K]=y[K],delete y[K]))}}return n}function Bo(e,t,i,n){if(n){var r=e.anchor;if(i){var s=kt(t,r)<0;s!=kt(i,r)<0?(r=t,t=i):s!=kt(t,i)<0&&(t=i)}return new Ht(r,t)}else return new Ht(i||t,t)}function Qr(e,t,i,n,r){r==null&&(r=e.cm&&(e.cm.display.shift||e.extend)),Tn(e,new $n([Bo(e.sel.primary(),t,i,r)],0),n)}function za(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=ni(e.cm,n,e.sel.primIndex);Tn(e,l,i)}function Uo(e,t,i,n){var r=e.sel.ranges.slice(0);r[t]=i,Tn(e,ni(e.cm,r,e.sel.primIndex),n)}function Ga(e,t,i,n){Tn(e,Si(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 Ht(o(e,r[s].anchor),o(e,r[s].head))},origin:i&&i.origin};return Re(e,"beforeSelectionChange",e,n),e.cm&&Re(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?ni(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)):Tn(e,t,i)}function Tn(e,t,i){qr(e,t,i),gl(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||(kt(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,q(e.cm)),Jt(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],m=eo(e,l.anchor,f&&f.anchor,i,n),y=eo(e,l.head,f&&f.head,i,n);(r||m!=l.anchor||y!=l.head)&&(r||(r=t.ranges.slice(0,s)),r[s]=new Ht(m,y))}return r?ni(e.cm,r,t.primIndex):t}function ir(e,t,i,n,r){var s=at(e,t.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var f=s.markedSpans[l],m=f.marker,y="selectLeft"in m?!m.selectLeft:m.inclusiveLeft,U="selectRight"in m?!m.selectRight:m.inclusiveRight;if((f.from==null||(y?f.from<=t.ch:f.from<t.ch))&&(f.to==null||(U?f.to>=t.ch:f.to>t.ch))){if(r&&(Re(m,"beforeCursorEnter"),m.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!m.atomic)continue;if(i){var K=m.find(n<0?1:-1),pe=void 0;if((n<0?U:y)&&(K=$a(e,K,-n,K&&K.line==t.line?s:null)),K&&K.line==t.line&&(pe=kt(K,i))&&(n<0?pe<0:pe>0))return ir(e,K,t,n,r)}var he=m.find(n<0?-1:1);return(n<0?y:U)&&(he=$a(e,he,n,he.line==t.line?s:null)),he?ir(e,he,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,Je(e.first,0))}function $a(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,Je(t.line-1)):null:i>0&&t.ch==(n||at(e,t.line)).text.length?t.line<e.first+e.size-1?Je(t.line+1,0):null:new Je(t.line,t.ch+i)}function Ja(e){e.setSelection(Je(e.firstLine(),0),Je(e.lastLine()),me)}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)}),Re(e,"beforeChange",e,n),e.cm&&Re(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 bn(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]==""&&kt(t.from,t.to)==0)return;var i=Do(e,t);Fa(e,t,i,e.cm?e.cm.curOp.id:NaN),kr(e,t,i,Fn(e,t));var n=[];Ai(e,function(r,s){!s&&oe(n,r.history)==-1&&(ns(r.history,t),n.push(r.history)),kr(r,t,null,Fn(r,t))})}function to(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var r=e.history,s,l=e.sel,f=t=="undo"?r.done:r.undone,m=t=="undo"?r.undone:r.done,y=0;y<f.length&&!(s=f[y],i?s.ranges&&!s.equals(e.sel):!s.ranges);y++);if(y==f.length)return;for(r.lastOrigin=r.lastSelOrigin=null;;)if(s=f.pop(),s.ranges){if(Zr(s,m),i&&!s.equals(e.sel)){Tn(e,s,{clearRedo:!1});return}l=s}else if(n){f.push(s);return}else break;var U=[];Zr(l,m),m.push({changes:U,generation:r.generation}),r.generation=s.generation||++r.maxGeneration;for(var K=Y(e,"beforeChange")||e.cm&&Y(e.cm,"beforeChange"),pe=function(Ge){var qe=s.changes[Ge];if(qe.origin=t,K&&!Za(e,qe,!1))return f.length=0,{};U.push(jo(e,qe));var it=Ge?Do(e,qe):b(f);kr(e,qe,it,Ha(e,qe)),!Ge&&e.cm&&e.cm.scrollIntoView({from:qe.from,to:ki(qe)});var ct=[];Ai(e,function(rt,dt){!dt&&oe(ct,rt.history)==-1&&(ns(rt.history,qe),ct.push(rt.history)),kr(rt,qe,null,Ha(rt,qe))})},he=s.changes.length-1;he>=0;--he){var De=pe(he);if(De)return De.v}}function qa(e,t){if(t==0)return;if(e.first+=t,e.sel=new $n(X(e.sel.ranges,function(r){return new Ht(Je(r.anchor.line+t,r.anchor.ch),Je(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){Nn(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)Ei(e.cm,n,"gutter")}}function kr(e,t,i,n){if(e.cm&&!e.cm.curOp)return bn(e.cm,kr)(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:Je(e.first,0),to:Je(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:Je(s,at(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Zt(e,t.from,t.to),i||(i=Do(e,t)),e.cm?xl(e.cm,t,n):Io(e,t,n),qr(e,i,me),e.cantEdit&&eo(e,Je(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,m=s.line;e.options.lineWrapping||(m=Tt(mn(at(n,s.line))),n.iter(m,l.line+1,function(he){if(he==r.maxLine)return f=!0,!0})),n.sel.contains(t.from,t.to)>-1&&q(e),Io(n,t,i,ga(e)),e.options.lineWrapping||(n.iter(m,s.line+t.text.length,function(he){var De=$i(he);De>r.maxLineLength&&(r.maxLine=he,r.maxLineLength=De,r.maxLineChanged=!0,f=!1)}),f&&(e.curOp.updateMaxLine=!0)),Zn(n,s.line),Er(e,400);var y=t.text.length-(l.line-s.line)-1;t.full?Nn(e):s.line==l.line&&t.text.length==1&&!Ia(e.doc,t)?Ei(e,s.line,"text"):Nn(e,s.line,l.line+1,y);var U=Y(e,"changes"),K=Y(e,"change");if(K||U){var pe={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};K&&Jt(e,"change",e,pe),U&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(pe)}e.display.selForContextMenu=null}function or(e,t,i,n,r){var s;n||(n=i),kt(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 m=0;m<s.changes.length;++m){var y=s.changes[m];if(i<y.from.line)y.from=Je(y.from.line+n,y.from.ch),y.to=Je(y.to.line+n,y.to.ch);else if(t<=y.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=at(e,h(e,t)):r=Tt(t),r==null?null:(n(s,r)&&e.cm&&Ei(e.cm,r,i),s)}function Tr(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}Tr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var r=this.lines[i];this.height-=r.height,co(r),Jt(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 Rr(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}Rr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],r=n.chunkSize();if(e<r){var s=Math.min(t,r-e),l=n.height;if(n.removeInner(e,s),this.height-=l-n.height,r==s&&(this.children.splice(i--,1),n.parent=null),(t-=s)==0)break;e=0}else e-=r}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Tr))){var f=[];this.collapse(f),this.children=[new Tr(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 m=new Tr(r.lines.slice(f,f+=25));r.height-=m.height,this.children.splice(++n,0,m),m.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 Rr(t);if(e.parent){e.size-=i.size,e.height-=i.height;var r=oe(e.parent.children,e);e.parent.children.splice(r+1,0,i)}else{var n=new Rr(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=Tt(i);if(n==null||!t)return;for(var r=0;r<t.length;++r)t[r]==this&&t.splice(r--,1);t.length||(i.widgets=null);var s=gr(this);Kt(i,Math.max(0,i.height-s)),e&&(zn(e,function(){is(e,i,-s),Ei(e,n,"widget")}),Jt(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=gr(this)-t;if(!r)return;ei(this.doc,n)||Kt(n,n.height+r),i&&zn(i,function(){i.curOp.forceUpdate=!0,is(i,n,r),Jt(i,"lineWidgetChanged",i,e,Tt(n))})},ie(Mr);function is(e,t,i){Hn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&To(e,i)}function Cl(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&&!ei(e,l)){var m=Hn(l)<e.scrollTop;Kt(l,l.height+gr(r)),m&&To(s,r.height),s.curOp.forceUpdate=!0}return!0}),s&&Jt(s,"lineWidgetAdded",s,r,typeof t=="number"?t:Tt(t)),r}var rs=0,Ti=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++rs};Ti.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Hi(e),Y(this,"clear")){var i=this.find();i&&Jt(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=qn(l.markedSpans,this);e&&!this.collapsed?Ei(e,Tt(l),"text"):e&&(f.to!=null&&(r=Tt(l)),f.from!=null&&(n=Tt(l))),l.markedSpans=ai(l.markedSpans,f),f.from==null&&this.collapsed&&!ei(this.doc,l)&&e&&Kt(l,Zi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var m=0;m<this.lines.length;++m){var y=mn(this.lines[m]),U=$i(y);U>e.display.maxLineLength&&(e.display.maxLine=y,e.display.maxLineLength=U,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Nn(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&&Jt(e,"markerCleared",e,this,n,r),t&&zi(e),this.parent&&this.parent.clear()},Ti.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=qn(s.markedSpans,this);if(l.from!=null&&(i=Je(t?s:Tt(s),l.from),e==-1))return i;if(l.to!=null&&(n=Je(t?s:Tt(s),l.to),e==1))return n}return i&&{from:i,to:n}},Ti.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;zn(n,function(){var r=t.line,s=Tt(t.line),l=go(n,s);if(l&&(la(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!ei(i.doc,r)&&i.height!=null){var f=i.height;i.height=null;var m=gr(i)-f;m&&Kt(r,r.height+m)}Jt(n,"markerChanged",n,e)})},Ti.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||oe(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ti.prototype.detachLine=function(e){if(this.lines.splice(oe(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ie(Ti);function ar(e,t,i,n,r){if(n&&n.shared)return wl(e,t,i,n,r);if(e.cm&&!e.cm.curOp)return bn(e.cm,ar)(e,t,i,n,r);var s=new Ti(e,r),l=kt(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(pn(e,t.line,t,i,s)||t.line!=i.line&&pn(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");oi()}s.addToHistory&&Fa(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var f=t.line,m=e.cm,y;if(e.iter(f,i.line+1,function(K){m&&s.collapsed&&!m.options.lineWrapping&&mn(K)==m.display.maxLine&&(y=!0),s.collapsed&&f!=t.line&&Kt(K,0),Kn(K,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(K){ei(e,K)&&Kt(K,0)}),s.clearOnEnter&&we(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(Dn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++rs,s.atomic=!0),m){if(y&&(m.curOp.updateMaxLine=!0),s.collapsed)Nn(m,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var U=t.line;U<=i.line;U++)Ei(m,U,"text");s.atomic&&Ka(m.doc),Jt(m,"markerAdded",m,s)}return s}var Lr=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Lr.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Jt(this,"clear")},Lr.prototype.find=function(e,t){return this.primary.find(e,t)},ie(Lr);function wl(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(m){f&&(n.widgetNode=f.cloneNode(!0)),s.push(ar(m,o(m,t),o(m,i),n,r));for(var y=0;y<m.linked.length;++y)if(m.linked[y].isParent)return;l=b(s)}),new Lr(s,l)}function os(e){return e.findMarks(Je(e.first,0),e.clipPos(Je(e.lastLine())),function(t){return t.parent})}function El(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.find(),s=e.clipPos(r.from),l=e.clipPos(r.to);if(kt(s,l)){var f=ar(e,s,l,n.primary,n.primary.type);n.markers.push(f),f.parent=n}}}function _l(e){for(var t=function(n){var r=e[n],s=[r.primary.doc];Ai(r.primary.doc,function(m){return s.push(m)});for(var l=0;l<r.markers.length;l++){var f=r.markers[l];oe(s,f.doc)==-1&&(f.parent=null,r.markers.splice(l--,1))}},i=0;i<e.length;i++)t(i)}var Sl=0,In=function(e,t,i,n,r){if(!(this instanceof In))return new In(e,t,i,n,r);i==null&&(i=0),Rr.call(this,[new Tr([new wi("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var s=Je(i,0);this.sel=Si(s),this.history=new Jr(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=r=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Io(this,{from:s,to:s,text:e}),Tn(this,Si(s),me)};In.prototype=Ae(Rr.prototype,{constructor:In,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=hn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:xn(function(e){var t=Je(this.first,0),i=this.first+this.size-1;rr(this,{from:t,to:Je(i,at(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&br(this.cm,0,0),Tn(this,Si(t),me)}),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=Zt(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(An(this,e))return at(this,e)},getLineNumber:function(e){return Tt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=at(this,e)),mn(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:xn(function(e,t,i){Ga(this,o(this,typeof e=="number"?Je(e,t||0):e),null,i)}),setSelection:xn(function(e,t,i){Ga(this,o(this,e),o(this,t||e),i)}),extendSelection:xn(function(e,t,i){Qr(this,o(this,e),t&&o(this,t),i)}),extendSelections:xn(function(e,t){za(this,u(this,e),t)}),extendSelectionsBy:xn(function(e,t){var i=X(this.sel.ranges,e);za(this,u(this,i),t)}),setSelections:xn(function(e,t,i){if(!e.length)return;for(var n=[],r=0;r<e.length;r++)n[r]=new Ht(o(this,e[r].anchor),o(this,e[r].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Tn(this,ni(this.cm,n,t),i)}),addSelection:xn(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Ht(o(this,e),o(this,t||e))),Tn(this,ni(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=Zt(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=Zt(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:xn(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),m=n.length-1;m>=0;m--)rr(this,n[m]);f?Va(this,f):this.cm&&er(this.cm)}),undo:xn(function(){to(this,"undo")}),redo:xn(function(){to(this,"redo")}),undoSelection:xn(function(){to(this,"undo",!0)}),redoSelection:xn(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:xn(function(e,t,i){return Ar(this,e,"gutter",function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&Xe(r)&&(n.gutterMarkers=null),!0})}),clearGutter:xn(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&Ar(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Xe(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!An(this,e))return null;if(t=e,e=at(this,e),!e)return null}else if(t=Tt(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:xn(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(xe(i).test(n[r]))return!1;n[r]+=" "+i}return!0})}),removeLineClass:xn(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(xe(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:xn(function(e,t,i){return Cl(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=at(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 m=l[f];!(m.to!=null&&r==e.line&&e.ch>=m.to||m.from==null&&r!=e.line||m.from!=null&&r==t.line&&m.from>=t.ch)&&(!i||i(m.marker))&&n.push(m.marker.parent||m.marker)}++r}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)i[n].from!=null&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first,n=this.lineSeparator().length;return this.iter(function(r){var s=r.text.length+n;if(s>e)return t=e,!0;e-=s,++i}),o(this,Je(i,t))},indexFromPos:function(e){e=o(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+i}),t},copy:function(e){var t=new In(hn(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 In(hn(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],El(n,os(this)),n},unlinkDoc:function(e){if(e instanceof tn&&(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),_l(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):gt(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:xn(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)})}),In.prototype.eachLine=In.prototype.iter;var as=0;function kl(e){var t=this;if(ss(t),He(t,e)||pi(t.display,e))return;x(e),k&&(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&&bn(t,function(){i=o(t.doc,i);var he={from:i,to:i,text:t.doc.splitLines(s.filter(function(De){return De!=null}).join(t.doc.lineSeparator())),origin:"paste"};rr(t.doc,he),Va(t.doc,Si(o(t.doc,i),o(t.doc,ki(he))))})()},m=function(he,De){if(t.options.allowDropFileTypes&&oe(t.options.allowDropFileTypes,he.type)==-1){f();return}var Ge=new FileReader;Ge.onerror=function(){return f()},Ge.onload=function(){var qe=Ge.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(qe)){f();return}s[De]=qe,f()},Ge.readAsText(he)},y=0;y<n.length;y++)m(n[y],y);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var U=e.dataTransfer.getData("Text");if(U){var K;if(t.state.draggingText&&!t.state.draggingText.copy&&(K=t.listSelections()),qr(t.doc,Si(i,i)),K)for(var pe=0;pe<K.length;++pe)or(t.doc,"",K[pe].anchor,K[pe].head,"drag");t.replaceSelection(U,"around","paste"),t.display.input.focus()}}catch(he){}}}function Al(e,t){if(k&&(!e.state.draggingText||+new Date-as<100)){N(t);return}if(He(e,t)||pi(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!te){var i=O("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",C&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),C&&i.parentNode.removeChild(i)}}function Tl(e,t){var i=Bi(e,t);if(!i)return;var n=document.createDocumentFragment();ba(e,i,n),e.display.dragCursor||(e.display.dragCursor=O("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),Ee(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 Rl(){if(us)return;Ml(),us=!0}function Ml(){var e;we(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ls(Ll)},100))}),we(window,"blur",function(){return ls(qi)})}function Ll(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ri={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++)Ri[Or+48]=Ri[Or+96]=String(Or);for(var no=65;no<=90;no++)Ri[no]=String.fromCharCode(no);for(var Pr=1;Pr<=12;Pr++)Ri[Pr+111]=Ri[Pr+63235]="F"+Pr;var mi={};mi.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"},mi.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"},mi.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"},mi.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"]},mi.default=ne?mi.macDefault:mi.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 Pl(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 m=t[f];if(!m)t[f]=l;else if(m!=l)throw new Error("Inconsistent bindings for "+f)}delete e[i]}for(var y in t)e[y]=t[y];return e}function 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 cs(e){var t=typeof e=="string"?e:Ri[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function hs(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(Le?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(Le?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function ds(e,t){if(C&&e.keyCode==34&&e.char)return!1;var i=Ri[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),hs(i,e,t))}function io(e){return typeof e=="string"?mi[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&&kt(s.from,b(n).to)<=0;){var l=n.pop();if(kt(l.from,s.from)<0){s.from=l.from;break}}n.push(s)}zn(e,function(){for(var f=n.length-1;f>=0;f--)or(e.doc,"",n[f].from,n[f].to,"+delete");er(e)})}function Fo(e,t,i){var n=Be(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Wo(e,t,i){var n=Fo(e,t.ch,i);return n==null?null:new Je(t.line,n,i<0?"after":"before")}function Ho(e,t,i,n,r){if(e){t.doc.direction=="rtl"&&(r=-r);var s=Ve(i,t.doc.direction);if(s){var l=r<0?b(s):s[0],f=r<0==(l.level==1),m=f?"after":"before",y;if(l.level>0||t.doc.direction=="rtl"){var U=Ji(t,i);y=r<0?i.text.length-1:0;var K=ui(t,U,y).top;y=ft(function(pe){return ui(t,U,pe).top==K},r<0==(l.level==1)?l.from:l.to-1,y),m=="before"&&(y=Fo(i,y,1))}else y=r<0?l.to:l.from;return new Je(n,y,m)}}return new Je(n,r<0?i.text.length:0,r<0?"before":"after")}function Dl(e,t,i,n){var r=Ve(t,e.doc.direction);if(!r)return Wo(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var s=nt(r,i.ch,i.sticky),l=r[s];if(e.doc.direction=="ltr"&&l.level%2==0&&(n>0?l.to>i.ch:l.from<i.ch))return Wo(t,i,n);var f=function(it,ct){return Fo(t,it instanceof Je?it.ch:it,ct)},m,y=function(it){return e.options.lineWrapping?(m=m||Ji(e,t),ma(e,t,m,it)):{begin:0,end:t.text.length}},U=y(i.sticky=="before"?f(i,-1):i.ch);if(e.doc.direction=="rtl"||l.level==1){var K=l.level==1==n<0,pe=f(i,K?1:-1);if(pe!=null&&(K?pe<=l.to&&pe<=U.end:pe>=l.from&&pe>=U.begin)){var he=K?"before":"after";return new Je(i.line,pe,he)}}var De=function(it,ct,rt){for(var dt=function(qt,Cn){return Cn?new Je(i.line,f(qt,1),"before"):new Je(i.line,qt,"after")};it>=0&&it<r.length;it+=ct){var St=r[it],xt=ct>0==(St.level!=1),Pt=xt?rt.begin:f(rt.end,-1);if(St.from<=Pt&&Pt<St.to)return dt(Pt,xt);if(Pt=xt?St.from:f(St.to,-1),rt.begin<=Pt&&Pt<rt.end)return dt(Pt,xt)}},Ge=De(s+n,n,U);if(Ge)return Ge;var qe=n>0?U.end:f(U.begin,-1);return qe!=null&&!(n>0&&qe==t.text.length)&&(Ge=De(n>0?0:r.length-1,n,y(qe)),Ge)?Ge:null}var Dr={selectAll:Ja,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),me)},killLine:function(e){return lr(e,function(t){if(t.empty()){var i=at(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:Je(t.head.line+1,0)}:{from:t.head,to:Je(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return lr(e,function(t){return{from:Je(t.from().line,0),to:o(e.doc,Je(t.to().line+1,0))}})},delLineLeft:function(e){return lr(e,function(t){return{from:Je(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(Je(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Je(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return fs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ps(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Nl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},ge)},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")},ge)},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},ge)},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=S(e.getLine(s.line),s.ch,n);t.push(V(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return zn(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=at(e.doc,r.line).text;if(s){if(r.ch==s.length&&(r=new Je(r.line,r.ch-1)),r.ch>0)r=new Je(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),Je(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var l=at(e.doc,r.line-1).text;l&&(r=new Je(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),Je(r.line-1,l.length-1),r,"+transpose"))}}i.push(new Ht(r,r))}e.setSelections(i)})},newlineAndIndent:function(e){return zn(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=at(e.doc,t),n=mn(i);return n!=i&&(t=Tt(n)),Ho(!0,e,n,t,1)}function Nl(e,t){var i=at(e.doc,t),n=si(i);return n!=i&&(t=Tt(n)),Ho(!0,e,i,t,-1)}function ps(e,t){var i=fs(e,t.line),n=at(e.doc,i.line),r=Ve(n,e.doc.direction);if(!r||r[0].level==0){var s=Math.max(i.ch,n.text.search(/\S/)),l=t.line==i.line&&t.ch<=s&&t.ch;return Je(i.line,l?0:s,i.sticky)}return i}function ro(e,t,i){if(typeof t=="string"&&(t=Dr[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),r=t(e)!=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 G;function Nr(e,t,i,n){var r=e.state.keySeq;if(r){if(cs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:jl.set(50,function(){e.state.keySeq==r&&(e.state.keySeq=null,e.display.input.reset())}),ms(e,r+" "+t,i,n))return!0}return ms(e,t,i,n)}function ms(e,t,i,n){var r=Il(e,t,n);return r=="multi"&&(e.state.keySeq=t),r=="handled"&&Jt(e,"keyHandled",e,t,i),(r=="handled"||r=="multi")&&(x(i),So(e)),!!r}function gs(e,t){var i=ds(t,!0);return i?t.shiftKey&&!e.state.keySeq?Nr(e,"Shift-"+i,t,function(n){return ro(e,n,!0)})||Nr(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return ro(e,n)}):Nr(e,i,t,function(n){return ro(e,n)}):!1}function Bl(e,t,i){return Nr(e,"'"+i+"'",t,function(n){return ro(e,n,!0)})}var zo=null;function vs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=W(),He(t,e))return;k&&E<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=gs(t,e);C&&(zo=n?i:null,!n&&i==88&&!vt&&(ne?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),re&&!ne&&!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;j(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(Se(t,"CodeMirror-crosshair"),tt(document,"keyup",i),tt(document,"mouseover",i))}we(document,"keyup",i),we(document,"mouseover",i)}function ys(e){e.keyCode==16&&(this.doc.sel.shift=!1),He(this,e)}function bs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(pi(t.display,e)||He(t,e)||e.ctrlKey&&!e.altKey||ne&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(C&&i==zo){zo=null,x(e);return}if(C&&(!e.which||e.which<10)&&gs(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 Fl=400,Go=function(e,t,i){this.time=e,this.pos=t,this.button=i};Go.prototype.compare=function(e,t,i){return this.time+Fl>e&&kt(t,this.pos)==0&&i==this.button};var Ir,jr;function Wl(e,t){var i=+new Date;return jr&&jr.compare(i,e,t)?(Ir=jr=null,"triple"):Ir&&Ir.compare(i,e,t)?(jr=new Go(i,e,t),Ir=null,"double"):(Ir=new Go(i,e,t),jr=null,"single")}function xs(e){var t=this,i=t.display;if(He(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,pi(i,e)){I||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Vo(t,e))return;var n=Bi(t,e),r=ke(e),s=n?Wl(n,r):"single";if(window.focus(),r==1&&t.state.selectingText&&t.state.selectingText(e),n&&Hl(t,r,n,s,e))return;r==1?n?Gl(t,n,s,e):fe(e)==i.scroller&&x(e):r==2?(n&&Qr(t.doc,n),setTimeout(function(){return i.input.focus()},20)):r==3&&(Fe?t.display.input.onContextMenu(e):Ca(t))}function Hl(e,t,i,n,r){var s="Click";return n=="double"?s="Double"+s:n=="triple"&&(s="Triple"+s),s=(t==1?"Left":t==2?"Middle":"Right")+s,Nr(e,hs(s,r),r,function(l){if(typeof l=="string"&&(l=Dr[l]),!l)return!1;var f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),f=l(e,i)!=Me}finally{e.state.suppressEdits=!1}return f})}function zl(e,t,i){var n=e.getOption("configureMouse"),r=n?n(e,t,i):{};if(r.unit==null){var s=Pe?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=ne?i.metaKey:i.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(ne?i.altKey:i.ctrlKey)),r}function Gl(e,t,i,n){k?setTimeout(p(xa,e),0):e.curOp.focus=W();var r=zl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&Ye&&!e.isReadOnly()&&i=="single"&&(l=s.contains(t))>-1&&(kt((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(kt(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=bn(e,function(y){I&&(r.scroller.draggable=!1),e.state.draggingText=!1,tt(r.wrapper.ownerDocument,"mouseup",l),tt(r.wrapper.ownerDocument,"mousemove",f),tt(r.scroller,"dragstart",m),tt(r.scroller,"drop",l),s||(x(y),n.addNew||Qr(e.doc,i,null,null,n.extend),I&&!te||k&&E==9?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),f=function(y){s=s||Math.abs(t.clientX-y.clientX)+Math.abs(t.clientY-y.clientY)>=10},m=function(){return s=!0};I&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),we(r.wrapper.ownerDocument,"mouseup",l),we(r.wrapper.ownerDocument,"mousemove",f),we(r.scroller,"dragstart",m),we(r.scroller,"drop",l),Ca(e),setTimeout(function(){return r.input.focus()},20)}function Cs(e,t,i){if(i=="char")return new Ht(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Ht(Je(t.line,0),o(e.doc,Je(t.line+1,0)));var n=i(e,t);return new Ht(n.from,n.to)}function Xl(e,t,i,n){var r=e.display,s=e.doc;x(t);var l,f,m=s.sel,y=m.ranges;if(n.addNew&&!n.extend?(f=s.sel.contains(i),f>-1?l=y[f]:l=new Ht(i,i)):(l=s.sel.primary(),f=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new Ht(i,i)),i=Bi(e,t,!0,!0),f=-1;else{var U=Cs(e,i,n.unit);n.extend?l=Bo(l,U.anchor,U.head,n.extend):l=U}n.addNew?f==-1?(f=y.length,Tn(s,ni(e,y.concat([l]),f),{scroll:!1,origin:"*mouse"})):y.length>1&&y[f].empty()&&n.unit=="char"&&!n.extend?(Tn(s,ni(e,y.slice(0,f).concat(y.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),m=s.sel):Uo(s,f,l,_e):(f=0,Tn(s,new $n([l],0),_e),m=s.sel);var K=i;function pe(rt){if(kt(K,rt)==0)return;if(K=rt,n.unit=="rectangle"){for(var dt=[],St=e.options.tabSize,xt=S(at(s,i.line).text,i.ch,St),Pt=S(at(s,rt.line).text,rt.ch,St),qt=Math.min(xt,Pt),Cn=Math.max(xt,Pt),on=Math.min(i.line,rt.line),Gn=Math.min(e.lastLine(),Math.max(i.line,rt.line));on<=Gn;on++){var jn=at(s,on).text,dn=le(jn,qt,St);qt==Cn?dt.push(new Ht(Je(on,dn),Je(on,dn))):jn.length>dn&&dt.push(new Ht(Je(on,dn),Je(on,le(jn,Cn,St))))}dt.length||dt.push(new Ht(i,i)),Tn(s,ni(e,m.ranges.slice(0,f).concat(dt),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(rt)}else{var Bn=l,kn=Cs(e,rt,n.unit),gn=Bn.anchor,fn;kt(kn.anchor,gn)>0?(fn=kn.head,gn=Li(Bn.from(),kn.anchor)):(fn=kn.anchor,gn=di(Bn.to(),kn.head));var sn=m.ranges.slice(0);sn[f]=Kl(e,new Ht(o(s,gn),fn)),Tn(s,ni(e,sn,f),_e)}}var he=r.wrapper.getBoundingClientRect(),De=0;function Ge(rt){var dt=++De,St=Bi(e,rt,!0,n.unit=="rectangle");if(!St)return;if(kt(St,K)!=0){e.curOp.focus=W(),pe(St);var xt=Xr(r,s);(St.line>=xt.to||St.line<xt.from)&&setTimeout(bn(e,function(){De==dt&&Ge(rt)}),150)}else{var Pt=rt.clientY<he.top?-20:rt.clientY>he.bottom?20:0;Pt&&setTimeout(bn(e,function(){if(De!=dt)return;r.scroller.scrollTop+=Pt,Ge(rt)}),50)}}function qe(rt){e.state.selectingText=!1,De=Infinity,rt&&(x(rt),r.input.focus()),tt(r.wrapper.ownerDocument,"mousemove",it),tt(r.wrapper.ownerDocument,"mouseup",ct),s.history.lastSelOrigin=null}var it=bn(e,function(rt){rt.buttons===0||!ke(rt)?qe(rt):Ge(rt)}),ct=bn(e,qe);e.state.selectingText=ct,we(r.wrapper.ownerDocument,"mousemove",it),we(r.wrapper.ownerDocument,"mouseup",ct)}function Kl(e,t){var i=t.anchor,n=t.head,r=at(e.doc,i.line);if(kt(i,n)==0&&i.sticky==n.sticky)return t;var s=Ve(r);if(!s)return t;var l=nt(s,i.ch,i.sticky),f=s[l];if(f.from!=i.ch&&f.to!=i.ch)return t;var m=l+(f.from==i.ch==(f.level!=1)?0:1);if(m==0||m==s.length)return t;var y;if(n.line!=i.line)y=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var U=nt(s,n.ch,n.sticky),K=U-l||(n.ch-i.ch)*(f.level==1?-1:1);U==m-1||U==m?y=K<0:y=K>0}var pe=s[m+(y?-1:0)],he=y==(pe.level==1),De=he?pe.from:pe.to,Ge=he?"after":"before";return i.ch==De&&i.sticky==Ge?t:new Ht(new Je(i.line,De,Ge),n)}function ws(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(pe){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&x(t);var l=e.display,f=l.lineDiv.getBoundingClientRect();if(s>f.bottom||!Y(e,i))return L(t);s-=f.top-l.viewOffset;for(var m=0;m<e.display.gutterSpecs.length;++m){var y=l.gutters.childNodes[m];if(y&&y.getBoundingClientRect().right>=r){var U=Mn(e.doc,s),K=e.display.gutterSpecs[m];return Re(e,i,e,U,K.className,t),L(t)}}}function Vo(e,t){return ws(e,t,"gutterClick",!0)}function Es(e,t){if(pi(e.display,t)||Yl(e,t))return;if(He(e,t,"contextmenu"))return;Fe||e.display.input.onContextMenu(t)}function Yl(e,t){return Y(e,"gutterContextMenu")?ws(e,t,"gutterContextMenu",!1):!1}function _s(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"}},Ss={},oo={};function $l(e){var t=e.optionHandlers;function i(n,r,s,l){e.defaults[n]=r,s&&(t[n]=l?function(f,m,y){y!=ur&&s(f,m,y)}: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){Sr(n),vr(n),Nn(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(m){for(var y=0;;){var U=m.text.indexOf(r,y);if(U==-1)break;y=U+r.length,s.push(Je(l,U))}l++});for(var f=s.length-1;f>=0;f--)or(n.doc,r,s[f],Je(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",yt,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){_s(n),_r(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=Po(r,n.options.lineNumbers),_r(n)},!0),i("fixedGutter",!0,function(n,r){n.display.gutters.style.left=r?Eo(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return 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=Po(n.options.gutters,r),_r(n)},!0),i("firstLineNumber",1,_r,!0),i("lineNumberFormatter",function(n){return n},_r,!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,Sr,!0),i("addModeClass",!1,Sr,!0),i("pollInterval",100),i("undoDepth",200,function(n,r){return n.doc.history.undoDepth=r}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,Sr,!0),i("moveInputWithCursor",!0,function(n,r){r||n.display.input.resetPosition()}),i("tabindex",null,function(n,r){return n.display.input.getField().tabIndex=r||""}),i("autofocus",null),i("direction","ltr",function(n,r){return n.doc.setDirection(r)},!0),i("phrases",null)}function Jl(e,t,i){var n=i&&i!=ur;if(!t!=!n){var r=e.display.dragFunctions,s=t?we:tt;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?(j(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Se(e.display.wrapper,"CodeMirror-wrap"),fi(e)),_o(e),Nn(e),vr(e),setTimeout(function(){return tr(e)},100)}function tn(e,t){var i=this;if(!(this instanceof tn))return new tn(e,t);this.options=t=t?d(t):{},d(Ss,t,!1);var n=t.value;typeof n=="string"?n=new In(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var r=new tn.inputStyles[t.inputStyle](this),s=this.display=new cl(e,n,r,t);s.wrapper.CodeMirror=this,_s(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 G,keySeq:null,specialChars:null},t.autofocus&&!ce&&s.input.focus(),k&&E<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Rl(),Hi(this),this.curOp.forceUpdate=!0,ja(this,n),t.autofocus&&!ce||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&ko(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);zi(this),I&&t.lineWrapping&&getComputedStyle(s.lineDiv).textRendering=="optimizelegibility"&&(s.lineDiv.style.textRendering="auto")}tn.defaults=Ss,tn.optionHandlers=oo;function Ql(e){var t=e.display;we(t.scroller,"mousedown",bn(e,xs)),k&&E<11?we(t.scroller,"dblclick",bn(e,function(m){if(He(e,m))return;var y=Bi(e,m);if(!y||Vo(e,m)||pi(e.display,m))return;x(m);var U=e.findWordAt(y);Qr(e.doc,U.anchor,U.head)})):we(t.scroller,"dblclick",function(m){return He(e,m)||x(m)}),we(t.scroller,"contextmenu",function(m){return Es(e,m)}),we(t.input.getField(),"contextmenu",function(m){t.scroller.contains(m.target)||Es(e,m)});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(m){if(m.touches.length!=1)return!1;var y=m.touches[0];return y.radiusX<=1&&y.radiusY<=1}function l(m,y){if(y.left==null)return!0;var U=y.left-m.left,K=y.top-m.top;return U*U+K*K>20*20}we(t.scroller,"touchstart",function(m){if(!He(e,m)&&!s(m)&&!Vo(e,m)){t.input.ensurePolled(),clearTimeout(i);var y=+new Date;t.activeTouch={start:y,moved:!1,prev:y-n.end<=300?n:null},m.touches.length==1&&(t.activeTouch.left=m.touches[0].pageX,t.activeTouch.top=m.touches[0].pageY)}}),we(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),we(t.scroller,"touchend",function(m){var y=t.activeTouch;if(y&&!pi(t,m)&&y.left!=null&&!y.moved&&new Date-y.start<300){var U=e.coordsChar(t.activeTouch,"page"),K;!y.prev||l(y,y.prev)?K=new Ht(U,U):!y.prev.prev||l(y,y.prev.prev)?K=e.findWordAt(U):K=new Ht(Je(U.line,0),o(e.doc,Je(U.line+1,0))),e.setSelection(K.anchor,K.head),e.focus(),x(m)}r()}),we(t.scroller,"touchcancel",r),we(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xr(e,t.scroller.scrollTop),Fi(e,t.scroller.scrollLeft,!0),Re(e,"scroll",e))}),we(t.scroller,"mousewheel",function(m){return Pa(e,m)}),we(t.scroller,"DOMMouseScroll",function(m){return Pa(e,m)}),we(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(m){He(e,m)||N(m)},over:function(m){He(e,m)||(Tl(e,m),N(m))},start:function(m){return Al(e,m)},drop:bn(e,kl),leave:function(m){He(e,m)||ss(e)}};var f=t.input.getField();we(f,"keyup",function(m){return ys.call(e,m)}),we(f,"keydown",bn(e,vs)),we(f,"keypress",bn(e,bs)),we(f,"focus",function(m){return ko(e,m)}),we(f,"blur",function(m){return qi(e,m)})}var Xo=[];tn.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=ve(e,t).state:i="prev");var l=e.options.tabSize,f=at(r,t),m=S(f.text,null,l);f.stateAfter&&(f.stateAfter=null);var y=f.text.match(/^\s*/)[0],U;if(!n&&!/\S/.test(f.text))U=0,i="not";else if(i=="smart"&&(U=r.mode.indent(s,f.text.slice(y.length),f.text),U==Me||U>150)){if(!n)return;i="prev"}i=="prev"?t>r.first?U=S(at(r,t-1).text,null,l):U=0:i=="add"?U=m+e.options.indentUnit:i=="subtract"?U=m-e.options.indentUnit:typeof i=="number"&&(U=m+i),U=Math.max(0,U);var K="",pe=0;if(e.options.indentWithTabs)for(var he=Math.floor(U/l);he;--he)pe+=l,K+=" ";if(pe<U&&(K+=V(U-pe)),K!=y)return or(r,K,Je(t,0),Je(t,y.length),"+input"),f.stateAfter=null,!0;for(var De=0;De<r.sel.ranges.length;De++){var Ge=r.sel.ranges[De];if(Ge.head.line==t&&Ge.head.ch<y.length){var qe=Je(t,y.length);Uo(r,De,new Ht(qe,qe));break}}}var ii=null;function ao(e){ii=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,m=gt(t),y=null;if(f&&n.ranges.length>1)if(ii&&ii.text.join(`
|
|
`)==t){if(n.ranges.length%ii.text.length==0){y=[];for(var U=0;U<ii.text.length;U++)y.push(s.splitLines(ii.text[U]))}}else m.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(y=X(m,function(it){return[it]}));for(var K=e.curOp.updateInput,pe=n.ranges.length-1;pe>=0;pe--){var he=n.ranges[pe],De=he.from(),Ge=he.to();he.empty()&&(i&&i>0?De=Je(De.line,De.ch-i):e.state.overwrite&&!f?Ge=Je(Ge.line,Math.min(at(s,Ge.line).text.length,Ge.ch+b(m).length)):f&&ii&&ii.lineWise&&ii.text.join(`
|
|
`)==m.join(`
|
|
`)&&(De=Ge=Je(De.line,0)));var qe={from:De,to:Ge,text:y?y[pe%y.length]:m,origin:r||(f?"paste":e.state.cutIncoming>l?"cut":"+input")};rr(e.doc,qe),Jt(e,"inputRead",e,qe)}t&&!f&&As(e,t),er(e),e.curOp.updateInput<2&&(e.curOp.updateInput=K),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ks(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&zn(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(at(e.doc,r.head.line).text.slice(0,r.head.ch))&&(l=Br(e,r.head.line,"smart")));l&&Jt(e,"electricInput",e,r.head.line)}}function Ts(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var r=e.doc.sel.ranges[n].head.line,s={anchor:Je(r,0),head:Je(r+1,0)};i.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:i}}function Rs(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ms(){var e=O("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=O("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return I?e.style.width="1000px":e.setAttribute("wrap","off"),J&&(e.style.border="1px solid black"),Rs(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)&&bn(this,t[n])(this,r,l),Re(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:Ln(function(n,r){var s=n.token?n:e.getMode(this.options,n);if(s.startState)throw new Error("Overlays may not be stateful.");M(this.state.overlays,{mode:s,modeSpec:n,opaque:r&&r.opaque,priority:r&&r.priority||0},function(l){return l.priority}),this.state.modeGen++,Nn(this)}),removeOverlay:Ln(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++,Nn(this);return}}}),indentLine:Ln(function(n,r,s){typeof r!="string"&&typeof r!="number"&&(r==null?r=this.options.smartIndent?"smart":"prev":r=r?"add":"subtract"),An(this.doc,n)&&Br(this,n,r,s)}),indentSelection:Ln(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 m=f.from(),y=f.to(),U=Math.max(s,m.line);s=Math.min(this.lastLine(),y.line-(y.ch?0:1))+1;for(var K=U;K<s;++K)Br(this,K,n);var pe=this.doc.sel.ranges;m.ch==0&&r.length==pe.length&&pe[l].from().ch>0&&Uo(this.doc,l,new Ht(m,pe[l].to()),me)}}}),getTokenAt:function(n,r){return zt(this,n,r)},getLineTokens:function(n,r){return zt(this,Je(n),r,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var r=Ue(this,at(this.doc,n.line)),s=0,l=(r.length-1)/2,f=n.ch,m;if(f==0)m=r[2];else for(;;){var y=s+l>>1;if((y?r[y*2-1]:0)>=f)l=y;else if(r[y*2+1]<f)s=y+1;else{m=r[y*2+2];break}}var U=m?m.indexOf("overlay "):-1;return U<0?m:U==0?null:m.slice(0,U-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 m=0;m<f[r].length;m++){var y=l[f[r][m]];y&&s.push(y)}else f.helperType&&l[f.helperType]?s.push(l[f.helperType]):l[f.name]&&s.push(l[f.name]);for(var U=0;U<l._global.length;U++){var K=l._global[U];K.pred(f,this)&&oe(s,K.val)==-1&&s.push(K.val)}return s},getStateAfter:function(n,r){var s=this.doc;return n=h(s,n==null?s.first+s.size-1:n),ve(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(),ti(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,Mn(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,r,s){var l=!1,f;if(typeof n=="number"){var m=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>m&&(n=m,l=!0),f=at(this.doc,n)}else f=n;return Hr(this,f,{top:0,left:0},r||"page",s||l).top+(l?this.doc.height-Hn(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 m=this.display;n=ti(this,o(this.doc,n));var y=n.bottom,U=n.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),m.sizer.appendChild(r),l=="over")y=n.top;else if(l=="above"||l=="near"){var K=Math.max(m.wrapper.clientHeight,this.doc.height),pe=Math.max(m.sizer.clientWidth,m.lineSpace.clientWidth);(l=="above"||n.bottom+r.offsetHeight>K)&&n.top>r.offsetHeight?y=n.top-r.offsetHeight:n.bottom+r.offsetHeight<=K&&(y=n.bottom),U+r.offsetWidth>pe&&(U=pe-r.offsetWidth)}r.style.top=y+"px",r.style.left=r.style.right="",f=="right"?(U=m.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(f=="left"?U=0:f=="middle"&&(U=(m.sizer.clientWidth-r.offsetWidth)/2),r.style.left=U+"px"),s&&Js(this,{left:U,top:y,right:U+r.offsetWidth,bottom:y+r.offsetHeight})},triggerOnKeyDown:Ln(vs),triggerOnKeyPress:Ln(bs),triggerOnKeyUp:ys,triggerOnMouseDown:Ln(xs),execCommand:function(n){if(Dr.hasOwnProperty(n))return Dr[n].call(null,this)},triggerElectric:Ln(function(n){As(this,n)}),findPosH:function(n,r,s,l){var f=1;r<0&&(f=-1,r=-r);for(var m=o(this.doc,n),y=0;y<r&&!(m=Yo(this.doc,m,f,s,l),m.hitSide);++y);return m},moveH:Ln(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()},ge)}),deleteH:Ln(function(n,r){var s=this.doc.sel,l=this.doc;s.somethingSelected()?l.replaceSelection("",null,"+delete"):lr(this,function(f){var m=Yo(l,f.head,n,r,!1);return n<0?{from:m,to:f.head}:{from:f.head,to:m}})}),findPosV:function(n,r,s,l){var f=1,m=l;r<0&&(f=-1,r=-r);for(var y=o(this.doc,n),U=0;U<r;++U){var K=ti(this,y,"div");if(m==null?m=K.left:K.left=m,y=Ls(this,K,f,s),y.hitSide)break}return y},moveV:Ln(function(n,r){var s=this,l=this.doc,f=[],m=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(U){if(m)return n<0?U.from():U.to();var K=ti(s,U.head,"div");U.goalColumn!=null&&(K.left=U.goalColumn),f.push(K.left);var pe=Ls(s,K,n,r);return r=="page"&&U==l.sel.primary()&&To(s,yo(s,pe,"div").top-K.top),pe},ge),f.length)for(var y=0;y<l.sel.ranges.length;y++)l.sel.ranges[y].goalColumn=f[y]}),findWordAt:function(n){var r=this.doc,s=at(r,n.line).text,l=n.ch,f=n.ch;if(s){var m=this.getHelper(n,"wordChars");(n.sticky=="before"||f==s.length)&&l?--l:++f;for(var y=s.charAt(l),U=je(y,m)?function(K){return je(K,m)}:/\s/.test(y)?function(K){return/\s/.test(K)}:function(K){return!/\s/.test(K)&&!je(K)};l>0&&U(s.charAt(l-1));)--l;for(;f<s.length&&U(s.charAt(f));)++f}return new Ht(Je(n.line,l),Je(n.line,f))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?j(this.display.cursorDiv,"CodeMirror-overwrite"):Se(this.display.cursorDiv,"CodeMirror-overwrite"),Re(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==W()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ln(function(n,r){br(this,n,r)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-li(this)-this.display.barHeight,width:n.scrollWidth-li(this)-this.display.barWidth,clientHeight:mo(this),clientWidth:Ii(this)}},scrollIntoView:Ln(function(n,r){n==null?(n={from:this.doc.sel.primary().head,to:null},r==null&&(r=this.options.cursorScrollMargin)):typeof n=="number"?n={from:Je(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=r||0,n.from.line!=null?Zs(this,n):Ea(this,n.from,n.to,n.margin)}),setSize:Ln(function(n,r){var s=this,l=function(m){return typeof m=="number"||/^\d+$/.test(String(m))?m+"px":m};n!=null&&(this.display.wrapper.style.width=l(n)),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(m){if(m.widgets){for(var y=0;y<m.widgets.length;y++)if(m.widgets[y].noHScroll){Ei(s,f,"widget");break}}++f}),this.curOp.forceUpdate=!0,Re(this,"refresh",this)}),operation:function(n){return zn(this,n)},startOperation:function(){return Hi(this)},endOperation:function(){return zi(this)},refresh:Ln(function(){var n=this.display.cachedTextHeight;Nn(this),this.curOp.forceUpdate=!0,vr(this),br(this,this.doc.scrollLeft,this.doc.scrollTop),Lo(this.display),(n==null||Math.abs(n-Zi(this.display))>.5||this.options.lineWrapping)&&_o(this),Re(this,"refresh",this)}),swapDoc:Ln(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,Jt(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}},ie(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=at(e,t.line),m=r&&e.direction=="rtl"?-i:i;function y(){var ct=t.line+m;return ct<e.first||ct>=e.first+e.size?!1:(t=new Je(ct,t.ch,t.sticky),f=at(e,ct))}function U(ct){var rt;if(n=="codepoint"){var dt=f.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(dt)?rt=null:rt=new Je(t.line,Math.max(0,Math.min(f.text.length,t.ch+i*(dt>=55296&&dt<56320?2:1))),-i)}else r?rt=Dl(e.cm,f,t,i):rt=Wo(f,t,i);if(rt==null)if(!ct&&y())t=Ho(r,e.cm,f,t.line,m);else return!1;else t=rt;return!0}if(n=="char"||n=="codepoint")U();else if(n=="column")U(!0);else if(n=="word"||n=="group")for(var K=null,pe=n=="group",he=e.cm&&e.cm.getHelper(t,"wordChars"),De=!0;!(i<0&&!U(!De));De=!1){var Ge=f.text.charAt(t.ch)||`
|
|
`,qe=je(Ge,he)?"w":pe&&Ge==`
|
|
`?"n":!pe||/\s/.test(Ge)?null:"p";if(pe&&!De&&!qe&&(qe="s"),K&&K!=qe){i<0&&(i=1,U(),t.sticky="after");break}if(qe&&(K=qe),i>0&&!U(!De))break}var it=eo(e,t,s,l,!0);return ri(s,it)&&(it.hitSide=!0),it}function Ls(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),m=Math.max(f-.5*Zi(e.display),3);l=(i>0?t.bottom:t.top)+i*m}else n=="line"&&(l=i>0?t.bottom+3:t.top-3);for(var y;!(y=xo(e,s,l),!y.outside);){if(i<0?l<=0:l>=r.height){y.hitSide=!0;break}l+=i*5}return y}var $t=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new G,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};$t.prototype.init=function(e){var t=this,i=this,n=i.cm,r=i.div=e.lineDiv;Rs(r,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function s(f){for(var m=f.target;m;m=m.parentNode){if(m==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(m.className))break}return!1}we(r,"paste",function(f){if(!s(f)||He(n,f)||ks(f,n))return;E<=11&&setTimeout(bn(n,function(){return t.updateFromDOM()}),20)}),we(r,"compositionstart",function(f){t.composing={data:f.data,done:!1}}),we(r,"compositionupdate",function(f){t.composing||(t.composing={data:f.data,done:!1})}),we(r,"compositionend",function(f){t.composing&&(f.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),we(r,"touchstart",function(){return i.forceCompositionEnd()}),we(r,"input",function(){t.composing||t.readFromDOMSoon()});function l(f){if(!s(f)||He(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 m=Ts(n);ao({lineWise:!0,text:m.text}),f.type=="cut"&&n.operation(function(){n.setSelections(m.ranges,0,me),n.replaceSelection("",null,"cut")})}else return;if(f.clipboardData){f.clipboardData.clearData();var y=ii.text.join(`
|
|
`);if(f.clipboardData.setData("Text",y),f.clipboardData.getData("Text")==y){f.preventDefault();return}}var U=Ms(),K=U.firstChild;n.display.lineSpace.insertBefore(U,n.display.lineSpace.firstChild),K.value=ii.text.join(`
|
|
`);var pe=document.activeElement;P(K),setTimeout(function(){n.display.lineSpace.removeChild(U),pe.focus(),pe==r&&i.showPrimarySelection()},50)}we(r,"copy",l),we(r,"cut",l)},$t.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},$t.prototype.prepareSelection=function(){var e=ya(this.cm,!1);return e.focus=document.activeElement==this.div,e},$t.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},$t.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},$t.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&&kt(Li(s,l),n)==0&&kt(di(s,l),r)==0)return;var f=t.display.view,m=n.line>=t.display.viewFrom&&Os(t,n)||{node:f[0].measure.map[2],offset:0},y=r.line<t.display.viewTo&&Os(t,r);if(!y){var U=f[f.length-1].measure,K=U.maps?U.maps[U.maps.length-1]:U.map;y={node:K[K.length-1],offset:K[K.length-2]-K[K.length-3]}}if(!m||!y){e.removeAllRanges();return}var pe=e.rangeCount&&e.getRangeAt(0),he;try{he=Q(m.node,m.offset,y.offset,y.node)}catch(De){}he&&(!re&&t.state.focused?(e.collapse(m.node,m.offset),he.collapsed||(e.removeAllRanges(),e.addRange(he))):(e.removeAllRanges(),e.addRange(he)),pe&&e.anchorNode==null?e.addRange(pe):re&&this.startGracePeriod()),this.rememberSelection()},$t.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)},$t.prototype.showMultipleSelections=function(e){Ee(this.cm.display.cursorDiv,e.cursors),Ee(this.cm.display.selectionDiv,e.selection)},$t.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},$t.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return _(this.div,t)},$t.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},$t.prototype.blur=function(){this.div.blur()},$t.prototype.getField=function(){return this.div},$t.prototype.supportsTouch=function(){return!0},$t.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():zn(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)},$t.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},$t.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(F&&R&&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&&zn(t,function(){Tn(t.doc,Si(i,n),me),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},$t.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),n=i.from(),r=i.to();if(n.ch==0&&n.line>e.firstLine()&&(n=Je(n.line-1,at(e.doc,n.line-1).length)),r.ch==at(e.doc,r.line).text.length&&r.line<e.lastLine()&&(r=Je(r.line+1,0)),n.line<t.viewFrom||r.line>t.viewTo-1)return!1;var s,l,f;n.line==t.viewFrom||(s=Ui(e,n.line))==0?(l=Tt(t.view[0].line),f=t.view[0].node):(l=Tt(t.view[s].line),f=t.view[s-1].node.nextSibling);var m=Ui(e,r.line),y,U;if(m==t.view.length-1?(y=t.viewTo-1,U=t.lineDiv.lastChild):(y=Tt(t.view[m+1].line)-1,U=t.view[m+1].node.previousSibling),!f)return!1;for(var K=e.doc.splitLines(tu(e,f,U,l,y)),pe=Zt(e.doc,Je(l,0),Je(y,at(e.doc,y).text.length));K.length>1&&pe.length>1;)if(b(K)==b(pe))K.pop(),pe.pop(),y--;else if(K[0]==pe[0])K.shift(),pe.shift(),l++;else break;for(var he=0,De=0,Ge=K[0],qe=pe[0],it=Math.min(Ge.length,qe.length);he<it&&Ge.charCodeAt(he)==qe.charCodeAt(he);)++he;for(var ct=b(K),rt=b(pe),dt=Math.min(ct.length-(K.length==1?he:0),rt.length-(pe.length==1?he:0));De<dt&&ct.charCodeAt(ct.length-De-1)==rt.charCodeAt(rt.length-De-1);)++De;if(K.length==1&&pe.length==1&&l==n.line)for(;he&&he>n.ch&&ct.charCodeAt(ct.length-De-1)==rt.charCodeAt(rt.length-De-1);)he--,De++;K[K.length-1]=ct.slice(0,ct.length-De).replace(/^\u200b+/,""),K[0]=K[0].slice(he).replace(/\u200b+$/,"");var St=Je(l,he),xt=Je(y,pe.length?b(pe).length-De:0);if(K.length>1||K[0]||kt(St,xt))return or(e.doc,K,St,xt,"+input"),!0},$t.prototype.ensurePolled=function(){this.forceCompositionEnd()},$t.prototype.reset=function(){this.forceCompositionEnd()},$t.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},$t.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)},$t.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&zn(this.cm,function(){return Nn(e.cm)})},$t.prototype.setUneditable=function(e){e.contentEditable="false"},$t.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||bn(this.cm,Ko)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},$t.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},$t.prototype.onContextMenu=function(){},$t.prototype.resetPosition=function(){},$t.prototype.needsContentAttribute=!0;function Os(e,t){var i=go(e,t.line);if(!i||i.hidden)return null;var n=at(e.doc,t.line),r=ra(i,n,t.line),s=Ve(n,e.doc.direction),l="left";if(s){var f=nt(s,t.ch);l=f%2?"right":"left"}var m=sa(r.map,t.ch,l);return m.offset=m.collapse=="right"?m.end:m.start,m}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function cr(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,r){var s="",l=!1,f=e.doc.lineSeparator(),m=!1;function y(he){return function(De){return De.id==he}}function U(){l&&(s+=f,m&&(s+=f),l=m=!1)}function K(he){he&&(U(),s+=he)}function pe(he){if(he.nodeType==1){var De=he.getAttribute("cm-text");if(De){K(De);return}var Ge=he.getAttribute("cm-marker"),qe;if(Ge){var it=e.findMarks(Je(n,0),Je(r+1,0),y(+Ge));it.length&&(qe=it[0].find(0))&&K(Zt(e.doc,qe.from,qe.to).join(f));return}if(he.getAttribute("contenteditable")=="false")return;var ct=/^(pre|div|p|li|table|br)$/i.test(he.nodeName);if(!/^br$/i.test(he.nodeName)&&he.textContent.length==0)return;ct&&U();for(var rt=0;rt<he.childNodes.length;rt++)pe(he.childNodes[rt]);/^(pre|p)$/i.test(he.nodeName)&&(m=!0),ct&&(l=!0)}else he.nodeType==3&&K(he.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(pe(t),t==i);)t=t.nextSibling,m=!1;return s}function so(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return cr(e.clipPos(Je(e.display.viewTo-1)),!0);t=null,i=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var r=0;r<e.display.view.length;r++){var s=e.display.view[r];if(s.node==n)return nu(s,t,i)}}function nu(e,t,i){var n=e.text.firstChild,r=!1;if(!t||!_(n,t))return cr(Je(Tt(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 cr(Je(Tt(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 m=e.measure,y=m.maps;function U(qe,it,ct){for(var rt=-1;rt<(y?y.length:0);rt++)for(var dt=rt<0?m.map:y[rt],St=0;St<dt.length;St+=3){var xt=dt[St+2];if(xt==qe||xt==it){var Pt=Tt(rt<0?e.line:e.rest[rt]),qt=dt[St]+ct;return(ct<0||xt!=qe)&&(qt=dt[St+(ct?1:0)]),Je(Pt,qt)}}}var K=U(l,f,i);if(K)return cr(K,r);for(var pe=f.nextSibling,he=l?l.nodeValue.length-i:0;pe;pe=pe.nextSibling){if(K=U(pe,pe.firstChild,0),K)return cr(Je(K.line,K.ch-he),r);he+=pe.textContent.length}for(var De=f.previousSibling,Ge=i;De;De=De.previousSibling){if(K=U(De,De.firstChild,-1),K)return cr(Je(K.line,K.ch+Ge),r);Ge+=De.textContent.length}}var un=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new G,this.hasSelection=!1,this.composing=null};un.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),J&&(r.style.width="0px"),we(r,"input",function(){k&&E>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),we(r,"paste",function(l){if(He(n,l)||ks(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if(He(n,l))return;if(n.somethingSelected())ao({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var f=Ts(n);ao({lineWise:!0,text:f.text}),l.type=="cut"?n.setSelections(f.ranges,null,me):(i.prevInput="",r.value=f.text.join(`
|
|
`),P(r))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}we(r,"cut",s),we(r,"copy",s),we(e.scroller,"paste",function(l){if(pi(e,l)||He(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)}),we(e.lineSpace,"selectstart",function(l){pi(e,l)||x(l)}),we(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"})}}),we(r,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},un.prototype.createField=function(e){this.wrapper=Ms(),this.textarea=this.wrapper.firstChild},un.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},un.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=ya(e);if(e.options.moveInputWithCursor){var r=ti(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},un.prototype.showSelection=function(e){var t=this.cm,i=t.display;Ee(i.cursorDiv,e.cursors),Ee(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},un.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&&P(this.textarea),k&&E>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",k&&E>=9&&(this.hasSelection=null))},un.prototype.getField=function(){return this.textarea},un.prototype.supportsTouch=function(){return!1},un.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!ce||W()!=this.textarea))try{this.textarea.focus()}catch(e){}},un.prototype.blur=function(){this.textarea.blur()},un.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},un.prototype.receivedFocus=function(){this.slowPoll()},un.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()})},un.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)},un.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||ot(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(k&&E>=9&&this.hasSelection===r||ne&&/[\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 zn(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},un.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},un.prototype.onKeyPress=function(){k&&E>=9&&(this.hasSelection=null),this.fastPoll()},un.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||C)return;var f=i.options.resetSelectionOnContextMenu;f&&i.doc.sel.contains(s)==-1&&bn(i,Tn)(i.doc,Si(s),me);var m=r.style.cssText,y=t.wrapper.style.cssText,U=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-U.top-5)+"px; left: "+(e.clientX-U.left-5)+`px;
|
|
z-index: 1000; background: `+(k?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var K;I&&(K=window.scrollY),n.input.focus(),I&&window.scrollTo(null,K),n.input.reset(),i.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=he,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function pe(){if(r.selectionStart!=null){var Ge=i.somethingSelected(),qe="\u200B"+(Ge?r.value:"");r.value="\u21DA",r.value=qe,t.prevInput=Ge?"":"\u200B",r.selectionStart=1,r.selectionEnd=qe.length,n.selForContextMenu=i.doc.sel}}function he(){if(t.contextMenuPending!=he)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=y,r.style.cssText=m,k&&E<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),r.selectionStart!=null){(!k||k&&E<9)&&pe();var Ge=0,qe=function(){n.selForContextMenu==i.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?bn(i,Ja)(i):Ge++<10?n.detectingSelectAll=setTimeout(qe,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(qe,200)}}if(k&&E>=9&&pe(),Fe){N(e);var De=function(){tt(window,"mouseup",De),setTimeout(he,20)};we(window,"mouseup",De)}else setTimeout(he,50)},un.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},un.prototype.setUneditable=function(){},un.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=W();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=f.getValue()}var r;if(e.form&&(we(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(m){}}t.finishInit=function(m){m.save=n,m.getTextArea=function(){return e},m.toTextArea=function(){m.toTextArea=isNaN,n(),e.parentNode.removeChild(m.getWrapperElement()),e.style.display="",e.form&&(tt(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var f=tn(function(m){return e.parentNode.insertBefore(m,e.nextSibling)},t);return f}function ru(e){e.off=tt,e.on=we,e.wheelEventPixels=hl,e.Doc=In,e.splitLines=gt,e.countColumn=S,e.findColumn=le,e.isWordChar=Te,e.Pass=Me,e.signal=Re,e.Line=wi,e.changeEnd=ki,e.scrollbarModel=ka,e.Pos=Je,e.cmpPos=kt,e.modes=Lt,e.mimeModes=wt,e.resolveMode=ht,e.getMode=Vt,e.modeExtensions=Xt,e.extendMode=nn,e.copyState=cn,e.startState=an,e.innerMode=Jn,e.commands=Dr,e.keyMap=mi,e.keyName=ds,e.isModifierKey=cs,e.lookupKey=sr,e.normalizeKeyMap=Pl,e.StringStream=pt,e.SharedTextMarker=Lr,e.TextMarker=Ti,e.LineWidget=Mr,e.e_preventDefault=x,e.e_stopPropagation=w,e.e_stop=N,e.addClass=j,e.contains=_,e.rmClass=Se,e.keyNames=Ri}$l(tn),ql(tn);var ou="iter insert remove copy getEditor constructor".split(" ");for(var lo in In.prototype)In.prototype.hasOwnProperty(lo)&&oe(ou,lo)<0&&(tn.prototype[lo]=function(e){return function(){return e.apply(this.doc,arguments)}}(In.prototype[lo]));return ie(In),tn.inputStyles={textarea:un,contenteditable:$t},tn.defineMode=function(e){!tn.defaults.mode&&e!="null"&&(tn.defaults.mode=e),en.apply(this,arguments)},tn.defineMIME=Ut,tn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),tn.defineMIME("text/plain","null"),tn.defineExtension=function(e,t){tn.prototype[e]=t},tn.defineDocExtension=function(e,t){In.prototype[e]=t},tn.fromTextArea=iu,ru(tn),tn.version="5.58.2",tn})},"W/I6":function(et,Ze,v){"use strict";var H=v("5NDa"),se=v("5rEg"),re=v("0Owb"),ue=v("oBTY"),D=v("miYZ"),z=v("tsqr"),k=v("tJVT"),E=v("PpiC"),I=v("q1tI"),T=v.n(I),R=v("Ag4I"),C=v.n(R),te=v("FTkQ"),Z=v.n(te),B=function(F){var ce=F.InputRight,ne=F.value,Pe=ne===void 0?[]:ne,$e=F.onChange,ye=Object(E.a)(F,["InputRight","value","onChange"]),Le=Object(I.useState)(),Fe=Object(k.a)(Le,2),xe=Fe[0],Se=Fe[1],Oe=function(de){var Q=Pe.filter(function(_,W){return W!==de});$e(Q)},Ee=function(de){if(de.preventDefault(),!xe)return;if(Pe.findIndex(function(Q){return Q.name===xe})>-1){z.b.warn("\u4E0D\u5141\u8BB8\u6DFB\u52A0\u76F8\u540C\u6807\u7B7E");return}$e([].concat(Object(ue.a)(Pe),[{id:null,name:xe}])),Se(null)};return T.a.createElement("div",null,T.a.createElement(se.a,Object(re.a)({style:{width:300},value:xe,onChange:function(de){return Se(de.target.value)},onPressEnter:Ee,onBlur:Ee},ye)),ce||T.a.createElement("span",{className:"pl20 font14 c-light-black"},"\u56DE\u8F66\u6DFB\u52A0\u6807\u7B7E"),T.a.createElement("div",{className:"mt20"},Pe==null?void 0:Pe.map(function(O,de){return T.a.createElement("div",{key:de,className:C.a.btn},T.a.createElement("span",{className:C.a.s1},O.name),T.a.createElement("img",{src:Z.a,className:C.a.s2,onClick:function(){return Oe(de)}}))})))};Ze.a=B},Y1PL:function(et,Ze,v){"use strict";v.r(Ze),v.d(Ze,"ResizableTextArea",function(){return oe});var H=v("wx14"),se=v("1OyB"),re=v("vuIU"),ue=v("Ji7U"),D=v("LK+K"),z=v("q1tI"),k=v("VTBJ"),E=v("rePB"),I=v("Zm9Q"),T=v("Kwbf"),R=v("c+Xe"),C=v("m+aA"),te=v("bdgK"),Z=new Map;function B(me){me.forEach(function(_e){var ge,le=_e.target;(ge=Z.get(le))===null||ge===void 0||ge.forEach(function(ee){return ee(le)})})}var J=new te.default(B),F=null,ce=null;function ne(me,_e){Z.has(me)||(Z.set(me,new Set),J.observe(me)),Z.get(me).add(_e)}function Pe(me,_e){Z.has(me)&&(Z.get(me).delete(_e),Z.get(me).size||(J.unobserve(me),Z.delete(me)))}var $e=function(me){Object(ue.a)(ge,me);var _e=Object(D.a)(ge);function ge(){return Object(se.a)(this,ge),_e.apply(this,arguments)}return Object(re.a)(ge,[{key:"render",value:function(){return this.props.children}}]),ge}(z.Component),ye=z.createContext(null);function Le(me){var _e=me.children,ge=me.onBatchResize,le=z.useRef(0),ee=z.useRef([]),V=z.useContext(ye),b=z.useCallback(function(X,M,be){le.current+=1;var Ae=le.current;ee.current.push({size:X,element:M,data:be}),Promise.resolve().then(function(){Ae===le.current&&(ge==null||ge(ee.current),ee.current=[])}),V==null||V(X,M,be)},[ge,V]);return z.createElement(ye.Provider,{value:b},_e)}function Fe(me){var _e=me.children,ge=me.disabled,le=z.useRef(null),ee=z.useRef(null),V=z.useContext(ye),b=z.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),X=z.isValidElement(_e)&&Object(R.c)(_e),M=X?_e.ref:null,be=z.useMemo(function(){return Object(R.a)(M,le)},[M,le]),Ae=z.useRef(me);Ae.current=me;var ae=z.useCallback(function(Te){var je=Ae.current,Xe=je.onResize,Ie=je.data,Ne=Te.getBoundingClientRect(),Be=Ne.width,ft=Ne.height,ut=Te.offsetWidth,st=Te.offsetHeight,nt=Math.floor(Be),Qe=Math.floor(ft);if(b.current.width!==nt||b.current.height!==Qe||b.current.offsetWidth!==ut||b.current.offsetHeight!==st){var Ve={width:nt,height:Qe,offsetWidth:ut,offsetHeight:st};b.current=Ve;var Ke=ut===Math.round(Be)?Be:ut,we=st===Math.round(ft)?ft:st,lt=Object(k.a)(Object(k.a)({},Ve),{},{offsetWidth:Ke,offsetHeight:we});V==null||V(lt,Te,Ie),Xe&&Promise.resolve().then(function(){Xe(lt,Te)})}},[]);return z.useEffect(function(){var Te=Object(C.a)(le.current)||Object(C.a)(ee.current);return Te&&!ge&&ne(Te,ae),function(){return Pe(Te,ae)}},[le.current,ge]),z.createElement($e,{ref:ee},X?z.cloneElement(_e,{ref:be}):_e)}var xe="rc-observer-key";function Se(me){var _e=me.children,ge=Object(I.a)(_e);return ge.map(function(le,ee){var V=(le==null?void 0:le.key)||"".concat(xe,"-").concat(ee);return z.createElement(Fe,Object(H.a)({},me,{key:V}),le)})}Se.Collection=Le;var Oe=Se,Ee=v("bT9E"),O=v("TSYQ"),de=v.n(O),Q=`
|
|
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
|
|
`,_=["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"],W={},j;function A(me){var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ge=me.getAttribute("id")||me.getAttribute("data-reactid")||me.getAttribute("name");if(_e&&W[ge])return W[ge];var le=window.getComputedStyle(me),ee=le.getPropertyValue("box-sizing")||le.getPropertyValue("-moz-box-sizing")||le.getPropertyValue("-webkit-box-sizing"),V=parseFloat(le.getPropertyValue("padding-bottom"))+parseFloat(le.getPropertyValue("padding-top")),b=parseFloat(le.getPropertyValue("border-bottom-width"))+parseFloat(le.getPropertyValue("border-top-width")),X=_.map(function(be){return"".concat(be,":").concat(le.getPropertyValue(be))}).join(";"),M={sizingStyle:X,paddingSize:V,borderSize:b,boxSizing:ee};return _e&&ge&&(W[ge]=M),M}function P(me){var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,le=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;j||(j=document.createElement("textarea"),j.setAttribute("tab-index","-1"),j.setAttribute("aria-hidden","true"),document.body.appendChild(j)),me.getAttribute("wrap")?j.setAttribute("wrap",me.getAttribute("wrap")):j.removeAttribute("wrap");var ee=A(me,_e),V=ee.paddingSize,b=ee.borderSize,X=ee.boxSizing,M=ee.sizingStyle;j.setAttribute("style","".concat(M,";").concat(Q)),j.value=me.value||me.placeholder||"";var be=Number.MIN_SAFE_INTEGER,Ae=Number.MAX_SAFE_INTEGER,ae=j.scrollHeight,Te;if(X==="border-box"?ae+=b:X==="content-box"&&(ae-=V),ge!==null||le!==null){j.value=" ";var je=j.scrollHeight-V;ge!==null&&(be=je*ge,X==="border-box"&&(be=be+V+b),ae=Math.max(be,ae)),le!==null&&(Ae=je*le,X==="border-box"&&(Ae=Ae+V+b),Te=ae>Ae?"":"hidden",ae=Math.min(Ae,ae))}return{height:ae,minHeight:be,maxHeight:Ae,overflowY:Te,resize:"none"}}var p=v("Gytx"),d=v.n(p),S;(function(me){me[me.NONE=0]="NONE",me[me.RESIZING=1]="RESIZING",me[me.RESIZED=2]="RESIZED"})(S||(S={}));var G=function(me){Object(ue.a)(ge,me);var _e=Object(D.a)(ge);function ge(le){var ee;return Object(se.a)(this,ge),ee=_e.call(this,le),ee.nextFrameActionId=void 0,ee.resizeFrameId=void 0,ee.textArea=void 0,ee.saveTextArea=function(V){ee.textArea=V},ee.handleResize=function(V){var b=ee.state.resizeStatus,X=ee.props,M=X.autoSize,be=X.onResize;if(b!==S.NONE)return;typeof be=="function"&&be(V),M&&ee.resizeOnNextFrame()},ee.resizeOnNextFrame=function(){cancelAnimationFrame(ee.nextFrameActionId),ee.nextFrameActionId=requestAnimationFrame(ee.resizeTextarea)},ee.resizeTextarea=function(){var V=ee.props.autoSize;if(!V||!ee.textArea)return;var b=V.minRows,X=V.maxRows,M=P(ee.textArea,!1,b,X);ee.setState({textareaStyles:M,resizeStatus:S.RESIZING},function(){cancelAnimationFrame(ee.resizeFrameId),ee.resizeFrameId=requestAnimationFrame(function(){ee.setState({resizeStatus:S.RESIZED},function(){ee.resizeFrameId=requestAnimationFrame(function(){ee.setState({resizeStatus:S.NONE}),ee.fixFirefoxAutoScroll()})})})})},ee.renderTextArea=function(){var V=ee.props,b=V.prefixCls,X=b===void 0?"rc-textarea":b,M=V.autoSize,be=V.onResize,Ae=V.className,ae=V.disabled,Te=ee.state,je=Te.textareaStyles,Xe=Te.resizeStatus,Ie=Object(Ee.a)(ee.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ne=de()(X,Ae,Object(E.a)({},"".concat(X,"-disabled"),ae));"value"in Ie&&(Ie.value=Ie.value||"");var Be=Object(k.a)(Object(k.a)(Object(k.a)({},ee.props.style),je),Xe===S.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return z.createElement(Oe,{onResize:ee.handleResize,disabled:!(M||be)},z.createElement("textarea",Object(H.a)({},Ie,{className:Ne,style:Be,ref:ee.saveTextArea})))},ee.state={textareaStyles:{},resizeStatus:S.NONE},ee}return Object(re.a)(ge,[{key:"componentDidUpdate",value:function(ee){(ee.value!==this.props.value||!d()(ee.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 ee=this.textArea.selectionStart,V=this.textArea.selectionEnd;this.textArea.setSelectionRange(ee,V)}}catch(b){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ge}(z.Component),oe=G,Ce=function(me){Object(ue.a)(ge,me);var _e=Object(D.a)(ge);function ge(le){var ee;Object(se.a)(this,ge),ee=_e.call(this,le),ee.resizableTextArea=void 0,ee.focus=function(){ee.resizableTextArea.textArea.focus()},ee.saveTextArea=function(b){ee.resizableTextArea=b},ee.handleChange=function(b){var X=ee.props.onChange;ee.setValue(b.target.value,function(){ee.resizableTextArea.resizeTextarea()}),X&&X(b)},ee.handleKeyDown=function(b){var X=ee.props,M=X.onPressEnter,be=X.onKeyDown;b.keyCode===13&&M&&M(b),be&&be(b)};var V=typeof le.value=="undefined"||le.value===null?le.defaultValue:le.value;return ee.state={value:V},ee}return Object(re.a)(ge,[{key:"setValue",value:function(ee,V){"value"in this.props||this.setState({value:ee},V)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return z.createElement(oe,Object(H.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ee){return"value"in ee?{value:ee.value}:null}}]),ge}(z.Component),Me=Ze.default=Ce},YiCM:function(et,Ze,v){et.exports={flexRow:"flexRow___1gyd-",flexJustifyCenter:"flexJustifyCenter___19NSh",flexAlignEnd:"flexAlignEnd___3THeK",flexAlignCenter:"flexAlignCenter___1yurC",flexColumn:"flexColumn___3l0VS",formWrap:"formWrap___28DyB",JupyterFieldWrapElse:"JupyterFieldWrapElse___9ONZN",button:"button___3DTwc",buttonWrap:"buttonWrap___n_juQ",width240:"width240___3x3F-",difficultyHint:"difficultyHint___bU8gT",color888:"color888___3aAYi",color0152d9:"color0152d9___2qsP8",installPackage:"installPackage___3uqSL",apply:"apply___1rKfU",p1:"p1___tgl6j",p2:"p2___1P24b"}},ZW9T:function(et,Ze,v){"use strict";v.d(Ze,"a",function(){return $e});var H=v("k1fw"),se=v("miYZ"),re=v("tsqr"),ue=v("rAM+"),D=v("tJVT"),z=v("PpiC"),k=v("q1tI"),E=v.n(k),I=v("bdgK");function T(ye,Le,Fe,xe,Se){var Oe=Le.getWordUntilPosition(Fe),Ee={startLineNumber:Fe.lineNumber,endLineNumber:Fe.lineNumber,startColumn:Oe.startColumn,endColumn:Oe.endColumn},O=xe.map(function(de){return{label:de,kind:ye.languages.CompletionItemKind.Keyword,insertText:de,insertTextRules:ye.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ee}});return Se.map(function(de){O.push(Object(H.a)(Object(H.a)({},de),{},{range:Ee}))}),O}var R=function(ye){var Le={label:"ifelse",kind:ye.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`),insertTextRules:ye.languages.CompletionItemInsertTextRule.InsertAsSnippet},Fe=["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"];ye.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Ee,O){var de=T(ye,Ee,O,Fe,[Le]);return{suggestions:de}}});var xe=["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"];ye.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Ee,O){var de=[{label:"print",kind:ye.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
`),insertTextRules:ye.languages.CompletionItemInsertTextRule.InsertAsSnippet}],Q=T(ye,Ee,O,xe,de);return{suggestions:Q}}});var Se=["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"];ye.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Ee,O){var de=[Le,{label:"main",kind:ye.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`),insertTextRules:ye.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:ye.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
|
|
`),insertTextRules:ye.languages.CompletionItemInsertTextRule.InsertAsSnippet}],Q=T(ye,Ee,O,Se,de);return{suggestions:Q}}})},C="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",te=v("LvDl");function Z(ye){return/^\d+$/.test(ye)?"".concat(ye,"px"):ye}function B(){}var J=!1,F={"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 ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Le=ye;if(Array.isArray(ye)){for(var Fe=0;Fe<ye.length;Fe++){var xe=F[ye[Fe]];if(xe)return xe}return Le[0]}return F[Le]||Le}var ne=null,Pe=Ze.b=function(ye){var Le=ye.width,Fe=Le===void 0?"100%":Le,xe=ye.height,Se=xe===void 0?"100%":xe,Oe=ye.value,Ee=ye.language,O=Ee===void 0?"javascript":Ee,de=ye.style,Q=de===void 0?{}:de,_=ye.options,W=_===void 0?{}:_,j=ye.overrideServices,A=j===void 0?{}:j,P=ye.theme,p=P===void 0?"vs-dark":P,d=ye.onEditBlur,S=ye.onSave,G=ye.autoHeight,oe=G===void 0?!1:G,Ce=ye.forbidCopy,Me=Ce===void 0?!1:Ce,me=ye.onChange,_e=me===void 0?B:me,ge=ye.editorDidMount,le=ge===void 0?B:ge,ee=ye.onFocus,V=ee===void 0?B:ee,b=ye.filename,X=b===void 0?"educoder.txt":b,M=Object(z.a)(ye,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),be=Object(k.useRef)(),Ae=Object(k.useRef)({}),ae=Object(k.useRef)(),Te=Object(k.useRef)(!1),je=Object(k.useRef)(),Xe=Object(k.useState)(!1),Ie=Object(D.a)(Xe,2),Ne=Ie[0],Be=Ie[1];function ft(){var L;return be.current&&(L=new I.default(function(N){var fe=Object(ue.a)(N),ke;try{for(fe.s();!(ke=fe.n()).done;){var Ye=ke.value;(Ye.target.offsetHeight>0||Ye.target.offsetWidth>0)&&Ae.current.instance.layout()}}catch(bt){fe.e(bt)}finally{fe.f()}}),L.observe(be.current)),L}function ut(){re.b.warn(decodeURIComponent(C))}var st=function(){var N=Ae.current.instance;if(Oe!=null&&N&&Ne){var fe=N.getModel();fe&&Oe!==fe.getValue()&&(J=!0,fe.setValue(Oe),N.layout(),J=!1)}};Object(k.useEffect)(function(){ae.current&&clearTimeout(ae.current),ae.current=setTimeout(function(){st()},500)},[Oe,Ne,Ae.current]);function nt(){var L=Ae.current.instance;if(L){var N=L.getSelection(),fe=Ae.current.pastePos||{},ke=new ne.Range(fe.startLineNumber||N.endLineNumber,fe.startColumn||N.endColumn,fe.endLineNumber||N.endLineNumber,fe.endColumn||N.endColumn);setTimeout(function(){L.executeEdits("",[{range:ke,text:""}])},300)}}function Qe(L){(window.navigator.platform.match("Mac")?L.metaKey:L.ctrlKey)&&L.keyCode==83&&(L.preventDefault(),S())}var Ve=function(){if(oe&&Ae.current.instance){var N=Ae.current.instance.getContentHeight();x(N<Se?Se:N)}else x(Se)};function Ke(L){var N=document.createEvent("MouseEvents");N.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),L.dispatchEvent(N)}function we(L,N){var fe=window.URL||window.webkitURL||window,ke=new Blob([N]),Ye=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ye.href=fe.createObjectURL(ke),Ye.download=L,Ke(Ye)}Object(k.useEffect)(function(){Ve()},[Ve]),Object(k.useEffect)(function(){be.current&&!Ne&&v.e(27).then(v.t.bind(null,"M/lh",7)).then(function(L){try{ne=L,Ae.current.instance=ne.editor.create(be.current,{value:Oe,language:ce(O),theme:p,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},A);var N=Ae.current.instance;if(le(N,ne),setTimeout(function(){Ve(),Ae.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){we(X||"educoder.txt",N.getValue())}})},500),Ae.current.subscription=N.onDidChangeModelContent(function(ke){Te.current?clearTimeout(je.current):(Ve(),_e(N.getValue(),ke)),je.current=setTimeout(function(){Te.current=!1},500)}),window.Monaco||R(ne),Me&&(N.addCommand(ne.KeyMod.CtrlCmd|ne.KeyMod.Shift|ne.KeyCode.KEY_V,function(){return ut(),null}),N.addCommand(ne.KeyMod.CtrlCmd|ne.KeyCode.KEY_C,function(){return ut(),null})),window.Monaco=ne,d&&N.onDidBlurEditorWidget(function(){d(N.getValue())}),V&&N.onDidFocusEditorText(function(){V(N.getValue())}),Me){N.addCommand(ne.KeyMod.CtrlCmd|ne.KeyCode.KEY_V,function(){return ut(),null}),N.onDidPaste(function(ke){Ae.current.pastePos=ke});try{window.addEventListener("paste",nt)}catch(ke){}}var fe=ft();return Be(!0),function(){var ke=Ae.current.instance;ke.dispose();var Ye=ke.getModel();Ye&&Ye.dispose(),Ae.current.subscription&&Ae.current.subscription.dispose(),Me&&window.removeEventListener("paste",nt),fe.unobserve(be.current)}}catch(ke){}})},[]),Object(k.useEffect)(function(){var L=Ae.current.instance;if(L&&Ne)return document.addEventListener("keydown",Qe,!1),function(){document.removeEventListener("keydown",Qe)}},[S,Ne]),Object(k.useEffect)(function(){var L=Ae.current.instance;if(L&&Ne){var N=ce(O);ne.editor.setModelLanguage(L.getModel(),N),console.log("language:",O,L.getModel(),N)}},[O,Ne]),Object(k.useEffect)(function(){var L=Ae.current.instance;L&&Ne&&ne.editor.setTheme(p)},[p,Ne]),Object(k.useEffect)(function(){var L=Ae.current.instance;L&&Ne&&(L.updateOptions(Object(H.a)({},W)),setTimeout(function(){L.getModel().updateOptions(Object(H.a)({},W))},200))},[JSON.stringify(W),Ne]),Object(k.useEffect)(function(){var L=Ae.current.instance;L&&Ne&&L.layout()},[Fe,Se,Ne]);var lt=Object(k.useState)(Z(Fe)),tt=Object(D.a)(lt,2),Re=tt[0],He=tt[1],q=Object(k.useState)(Z(Se)),Y=Object(D.a)(q,2),ie=Y[0],x=Y[1],w=Object(H.a)(Object(H.a)({},Q),{},{width:Re,height:ie});return E.a.createElement("div",{className:"my-monaco-editor",ref:be,style:w})};function $e(ye){var Le=ye.width,Fe=Le===void 0?"100%":Le,xe=ye.height,Se=xe===void 0?"100%":xe,Oe=ye.original,Ee=ye.modified,O=ye.language,de=ye.options,Q=de===void 0?{}:de,_=Object(k.useRef)(),W=Object(k.useState)(null),j=Object(D.a)(W,2),A=j[0],P=j[1];function p(oe){var Ce;return _.current&&(Ce=new I.default(function(Me){var me=Object(ue.a)(Me),_e;try{for(me.s();!(_e=me.n()).done;){var ge=_e.value;(ge.target.offsetHeight>0||ge.target.offsetWidth>0)&&oe.layout()}}catch(le){me.e(le)}finally{me.f()}}),Ce.observe(_.current)),Ce}Object(k.useEffect)(function(){_.current&&v.e(27).then(v.t.bind(null,"M/lh",7)).then(function(oe){ne=oe;var Ce=ne.editor.createDiffEditor(_.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},Q),{},{wordWrap:!0}));P(Ce);var Me=p(Ce);return function(){Ce.dispose();var me=Ce.getModel();me&&me.dispose(),Me.unobserve(_.current)}})},[]),Object(k.useEffect)(function(){A&&A.setModel({original:ne.editor.createModel(Oe,O),modified:ne.editor.createModel(Ee,O)})},[Oe,Ee,O,A]);var d=Z(Fe),S=Z(Se),G={width:d,height:S};return E.a.createElement("div",{className:"my-diff-editor",ref:_,style:G})}},ZpRC:function(et,Ze,v){"use strict";function H(R){return typeof R=="object"&&R!=null&&R.nodeType===1}function se(R,C){return(!C||R!=="hidden")&&R!=="visible"&&R!=="clip"}function re(R,C){if(R.clientHeight<R.scrollHeight||R.clientWidth<R.scrollWidth){var te=getComputedStyle(R,null);return se(te.overflowY,C)||se(te.overflowX,C)||function(Z){var B=function(J){if(!J.ownerDocument||!J.ownerDocument.defaultView)return null;try{return J.ownerDocument.defaultView.frameElement}catch(F){return null}}(Z);return!!B&&(B.clientHeight<Z.scrollHeight||B.clientWidth<Z.scrollWidth)}(R)}return!1}function ue(R,C,te,Z,B,J,F,ce){return J<R&&F>C||J>R&&F<C?0:J<=R&&ce<=te||F>=C&&ce>=te?J-R-Z:F>C&&ce<te||J<R&&ce>te?F-C+B:0}var D=function(R,C){var te=window,Z=C.scrollMode,B=C.block,J=C.inline,F=C.boundary,ce=C.skipOverflowHiddenElements,ne=typeof F=="function"?F:function(je){return je!==F};if(!H(R))throw new TypeError("Invalid target");for(var Pe=document.scrollingElement||document.documentElement,$e=[],ye=R;H(ye)&&ne(ye);){if((ye=ye.parentElement)===Pe){$e.push(ye);break}ye!=null&&ye===document.body&&re(ye)&&!re(document.documentElement)||ye!=null&&re(ye,ce)&&$e.push(ye)}for(var Le=te.visualViewport?te.visualViewport.width:innerWidth,Fe=te.visualViewport?te.visualViewport.height:innerHeight,xe=window.scrollX||pageXOffset,Se=window.scrollY||pageYOffset,Oe=R.getBoundingClientRect(),Ee=Oe.height,O=Oe.width,de=Oe.top,Q=Oe.right,_=Oe.bottom,W=Oe.left,j=B==="start"||B==="nearest"?de:B==="end"?_:de+Ee/2,A=J==="center"?W+O/2:J==="end"?Q:W,P=[],p=0;p<$e.length;p++){var d=$e[p],S=d.getBoundingClientRect(),G=S.height,oe=S.width,Ce=S.top,Me=S.right,me=S.bottom,_e=S.left;if(Z==="if-needed"&&de>=0&&W>=0&&_<=Fe&&Q<=Le&&de>=Ce&&_<=me&&W>=_e&&Q<=Me)return P;var ge=getComputedStyle(d),le=parseInt(ge.borderLeftWidth,10),ee=parseInt(ge.borderTopWidth,10),V=parseInt(ge.borderRightWidth,10),b=parseInt(ge.borderBottomWidth,10),X=0,M=0,be="offsetWidth"in d?d.offsetWidth-d.clientWidth-le-V:0,Ae="offsetHeight"in d?d.offsetHeight-d.clientHeight-ee-b:0;if(Pe===d)X=B==="start"?j:B==="end"?j-Fe:B==="nearest"?ue(Se,Se+Fe,Fe,ee,b,Se+j,Se+j+Ee,Ee):j-Fe/2,M=J==="start"?A:J==="center"?A-Le/2:J==="end"?A-Le:ue(xe,xe+Le,Le,le,V,xe+A,xe+A+O,O),X=Math.max(0,X+Se),M=Math.max(0,M+xe);else{X=B==="start"?j-Ce-ee:B==="end"?j-me+b+Ae:B==="nearest"?ue(Ce,me,G,ee,b+Ae,j,j+Ee,Ee):j-(Ce+G/2)+Ae/2,M=J==="start"?A-_e-le:J==="center"?A-(_e+oe/2)+be/2:J==="end"?A-Me+V+be:ue(_e,Me,oe,le,V+be,A,A+O,O);var ae=d.scrollLeft,Te=d.scrollTop;j+=Te-(X=Math.max(0,Math.min(Te+X,d.scrollHeight-G+Ae))),A+=ae-(M=Math.max(0,Math.min(ae+M,d.scrollWidth-oe+be)))}P.push({el:d,top:X,left:M})}return P};function z(R){return R===Object(R)&&Object.keys(R).length!==0}function k(R,C){C===void 0&&(C="auto");var te="scrollBehavior"in document.body.style;R.forEach(function(Z){var B=Z.el,J=Z.top,F=Z.left;B.scroll&&te?B.scroll({top:J,left:F,behavior:C}):(B.scrollTop=J,B.scrollLeft=F)})}function E(R){return R===!1?{block:"end",inline:"nearest"}:z(R)?R:{block:"start",inline:"nearest"}}function I(R,C){var te=!R.ownerDocument.documentElement.contains(R);if(z(C)&&typeof C.behavior=="function")return C.behavior(te?[]:D(R,C));if(te)return;var Z=E(C);return k(D(R,Z),Z.behavior)}var T=Ze.a=I},Zss7:function(et,Ze,v){var H;(function(se){var re=/^\s+/,ue=/\s+$/,D=0,z=se.round,k=se.min,E=se.max,I=se.random;function T(b,X){if(b=b||"",X=X||{},b instanceof T)return b;if(!(this instanceof T))return new T(b,X);var M=R(b);this._originalInput=b,this._r=M.r,this._g=M.g,this._b=M.b,this._a=M.a,this._roundA=z(100*this._a)/100,this._format=X.format||M.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=M.ok,this._tc_id=D++}T.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,M,be,Ae,ae,Te;return X=b.r/255,M=b.g/255,be=b.b/255,X<=.03928?Ae=X/12.92:Ae=se.pow((X+.055)/1.055,2.4),M<=.03928?ae=M/12.92:ae=se.pow((M+.055)/1.055,2.4),be<=.03928?Te=be/12.92:Te=se.pow((be+.055)/1.055,2.4),.2126*Ae+.7152*ae+.0722*Te},setAlpha:function(b){return this._a=P(b),this._roundA=z(100*this._a)/100,this},toHsv:function(){var b=B(this._r,this._g,this._b);return{h:b.h*360,s:b.s,v:b.v,a:this._a}},toHsvString:function(){var b=B(this._r,this._g,this._b),X=z(b.h*360),M=z(b.s*100),be=z(b.v*100);return this._a==1?"hsv("+X+", "+M+"%, "+be+"%)":"hsva("+X+", "+M+"%, "+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),M=z(b.s*100),be=z(b.l*100);return this._a==1?"hsl("+X+", "+M+"%, "+be+"%)":"hsla("+X+", "+M+"%, "+be+"%, "+this._roundA+")"},toHex:function(b){return F(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:j[F(this._r,this._g,this._b,!0)]||!1},toFilter:function(b){var X="#"+ne(this._r,this._g,this._b,this._a),M=X,be=this._gradientType?"GradientType = 1, ":"";if(b){var Ae=T(b);M="#"+ne(Ae._r,Ae._g,Ae._b,Ae._a)}return"progid:DXImageTransform.Microsoft.gradient("+be+"startColorstr="+X+",endColorstr="+M+")"},toString:function(b){var X=!!b;b=b||this._format;var M=!1,be=this._a<1&&this._a>=0,Ae=!X&&be&&(b==="hex"||b==="hex6"||b==="hex3"||b==="hex4"||b==="hex8"||b==="name");return Ae?b==="name"&&this._a===0?this.toName():this.toRgbString():(b==="rgb"&&(M=this.toRgbString()),b==="prgb"&&(M=this.toPercentageRgbString()),(b==="hex"||b==="hex6")&&(M=this.toHexString()),b==="hex3"&&(M=this.toHexString(!0)),b==="hex4"&&(M=this.toHex8String(!0)),b==="hex8"&&(M=this.toHex8String()),b==="name"&&(M=this.toName()),b==="hsl"&&(M=this.toHslString()),b==="hsv"&&(M=this.toHsvString()),M||this.toHexString())},clone:function(){return T(this.toString())},_applyModification:function(b,X){var M=b.apply(null,[this].concat([].slice.call(X)));return this._r=M._r,this._g=M._g,this._b=M._b,this.setAlpha(M._a),this},lighten:function(){return this._applyModification(Le,arguments)},brighten:function(){return this._applyModification(Fe,arguments)},darken:function(){return this._applyModification(xe,arguments)},desaturate:function(){return this._applyModification(Pe,arguments)},saturate:function(){return this._applyModification($e,arguments)},greyscale:function(){return this._applyModification(ye,arguments)},spin:function(){return this._applyModification(Se,arguments)},_applyCombination:function(b,X){return b.apply(null,[this].concat([].slice.call(X)))},analogous:function(){return this._applyCombination(Q,arguments)},complement:function(){return this._applyCombination(Oe,arguments)},monochromatic:function(){return this._applyCombination(_,arguments)},splitcomplement:function(){return this._applyCombination(de,arguments)},triad:function(){return this._applyCombination(Ee,arguments)},tetrad:function(){return this._applyCombination(O,arguments)}},T.fromRatio=function(b,X){if(typeof b=="object"){var M={};for(var be in b)b.hasOwnProperty(be)&&(be==="a"?M[be]=b[be]:M[be]=Me(b[be]));b=M}return T(b,X)};function R(b){var X={r:0,g:0,b:0},M=1,be=null,Ae=null,ae=null,Te=!1,je=!1;return typeof b=="string"&&(b=ee(b)),typeof b=="object"&&(le(b.r)&&le(b.g)&&le(b.b)?(X=C(b.r,b.g,b.b),Te=!0,je=String(b.r).substr(-1)==="%"?"prgb":"rgb"):le(b.h)&&le(b.s)&&le(b.v)?(be=Me(b.s),Ae=Me(b.v),X=J(b.h,be,Ae),Te=!0,je="hsv"):le(b.h)&&le(b.s)&&le(b.l)&&(be=Me(b.s),ae=Me(b.l),X=Z(b.h,be,ae),Te=!0,je="hsl"),b.hasOwnProperty("a")&&(M=b.a)),M=P(M),{ok:Te,format:b.format||je,r:k(255,E(X.r,0)),g:k(255,E(X.g,0)),b:k(255,E(X.b,0)),a:M}}function C(b,X,M){return{r:p(b,255)*255,g:p(X,255)*255,b:p(M,255)*255}}function te(b,X,M){b=p(b,255),X=p(X,255),M=p(M,255);var be=E(b,X,M),Ae=k(b,X,M),ae,Te,je=(be+Ae)/2;if(be==Ae)ae=Te=0;else{var Xe=be-Ae;Te=je>.5?Xe/(2-be-Ae):Xe/(be+Ae);switch(be){case b:ae=(X-M)/Xe+(X<M?6:0);break;case X:ae=(M-b)/Xe+2;break;case M:ae=(b-X)/Xe+4;break}ae/=6}return{h:ae,s:Te,l:je}}function Z(b,X,M){var be,Ae,ae;b=p(b,360),X=p(X,100),M=p(M,100);function Te(Ie,Ne,Be){return Be<0&&(Be+=1),Be>1&&(Be-=1),Be<1/6?Ie+(Ne-Ie)*6*Be:Be<1/2?Ne:Be<2/3?Ie+(Ne-Ie)*(2/3-Be)*6:Ie}if(X===0)be=Ae=ae=M;else{var je=M<.5?M*(1+X):M+X-M*X,Xe=2*M-je;be=Te(Xe,je,b+1/3),Ae=Te(Xe,je,b),ae=Te(Xe,je,b-1/3)}return{r:be*255,g:Ae*255,b:ae*255}}function B(b,X,M){b=p(b,255),X=p(X,255),M=p(M,255);var be=E(b,X,M),Ae=k(b,X,M),ae,Te,je=be,Xe=be-Ae;if(Te=be===0?0:Xe/be,be==Ae)ae=0;else{switch(be){case b:ae=(X-M)/Xe+(X<M?6:0);break;case X:ae=(M-b)/Xe+2;break;case M:ae=(b-X)/Xe+4;break}ae/=6}return{h:ae,s:Te,v:je}}function J(b,X,M){b=p(b,360)*6,X=p(X,100),M=p(M,100);var be=se.floor(b),Ae=b-be,ae=M*(1-X),Te=M*(1-Ae*X),je=M*(1-(1-Ae)*X),Xe=be%6,Ie=[M,Te,ae,ae,je,M][Xe],Ne=[je,M,M,Te,ae,ae][Xe],Be=[ae,ae,je,M,M,Te][Xe];return{r:Ie*255,g:Ne*255,b:Be*255}}function F(b,X,M,be){var Ae=[Ce(z(b).toString(16)),Ce(z(X).toString(16)),Ce(z(M).toString(16))];return be&&Ae[0].charAt(0)==Ae[0].charAt(1)&&Ae[1].charAt(0)==Ae[1].charAt(1)&&Ae[2].charAt(0)==Ae[2].charAt(1)?Ae[0].charAt(0)+Ae[1].charAt(0)+Ae[2].charAt(0):Ae.join("")}function ce(b,X,M,be,Ae){var ae=[Ce(z(b).toString(16)),Ce(z(X).toString(16)),Ce(z(M).toString(16)),Ce(me(be))];return Ae&&ae[0].charAt(0)==ae[0].charAt(1)&&ae[1].charAt(0)==ae[1].charAt(1)&&ae[2].charAt(0)==ae[2].charAt(1)&&ae[3].charAt(0)==ae[3].charAt(1)?ae[0].charAt(0)+ae[1].charAt(0)+ae[2].charAt(0)+ae[3].charAt(0):ae.join("")}function ne(b,X,M,be){var Ae=[Ce(me(be)),Ce(z(b).toString(16)),Ce(z(X).toString(16)),Ce(z(M).toString(16))];return Ae.join("")}T.equals=function(b,X){return!b||!X?!1:T(b).toRgbString()==T(X).toRgbString()},T.random=function(){return T.fromRatio({r:I(),g:I(),b:I()})};function Pe(b,X){X=X===0?0:X||10;var M=T(b).toHsl();return M.s-=X/100,M.s=d(M.s),T(M)}function $e(b,X){X=X===0?0:X||10;var M=T(b).toHsl();return M.s+=X/100,M.s=d(M.s),T(M)}function ye(b){return T(b).desaturate(100)}function Le(b,X){X=X===0?0:X||10;var M=T(b).toHsl();return M.l+=X/100,M.l=d(M.l),T(M)}function Fe(b,X){X=X===0?0:X||10;var M=T(b).toRgb();return M.r=E(0,k(255,M.r-z(255*-(X/100)))),M.g=E(0,k(255,M.g-z(255*-(X/100)))),M.b=E(0,k(255,M.b-z(255*-(X/100)))),T(M)}function xe(b,X){X=X===0?0:X||10;var M=T(b).toHsl();return M.l-=X/100,M.l=d(M.l),T(M)}function Se(b,X){var M=T(b).toHsl(),be=(M.h+X)%360;return M.h=be<0?360+be:be,T(M)}function Oe(b){var X=T(b).toHsl();return X.h=(X.h+180)%360,T(X)}function Ee(b){var X=T(b).toHsl(),M=X.h;return[T(b),T({h:(M+120)%360,s:X.s,l:X.l}),T({h:(M+240)%360,s:X.s,l:X.l})]}function O(b){var X=T(b).toHsl(),M=X.h;return[T(b),T({h:(M+90)%360,s:X.s,l:X.l}),T({h:(M+180)%360,s:X.s,l:X.l}),T({h:(M+270)%360,s:X.s,l:X.l})]}function de(b){var X=T(b).toHsl(),M=X.h;return[T(b),T({h:(M+72)%360,s:X.s,l:X.l}),T({h:(M+216)%360,s:X.s,l:X.l})]}function Q(b,X,M){X=X||6,M=M||30;var be=T(b).toHsl(),Ae=360/M,ae=[T(b)];for(be.h=(be.h-(Ae*X>>1)+720)%360;--X;)be.h=(be.h+Ae)%360,ae.push(T(be));return ae}function _(b,X){X=X||6;for(var M=T(b).toHsv(),be=M.h,Ae=M.s,ae=M.v,Te=[],je=1/X;X--;)Te.push(T({h:be,s:Ae,v:ae})),ae=(ae+je)%1;return Te}T.mix=function(b,X,M){M=M===0?0:M||50;var be=T(b).toRgb(),Ae=T(X).toRgb(),ae=M/100,Te={r:(Ae.r-be.r)*ae+be.r,g:(Ae.g-be.g)*ae+be.g,b:(Ae.b-be.b)*ae+be.b,a:(Ae.a-be.a)*ae+be.a};return T(Te)},T.readability=function(b,X){var M=T(b),be=T(X);return(se.max(M.getLuminance(),be.getLuminance())+.05)/(se.min(M.getLuminance(),be.getLuminance())+.05)},T.isReadable=function(b,X,M){var be=T.readability(b,X),Ae,ae;ae=!1,Ae=V(M);switch(Ae.level+Ae.size){case"AAsmall":case"AAAlarge":ae=be>=4.5;break;case"AAlarge":ae=be>=3;break;case"AAAsmall":ae=be>=7;break}return ae},T.mostReadable=function(b,X,M){var be=null,Ae=0,ae,Te,je,Xe;M=M||{},Te=M.includeFallbackColors,je=M.level,Xe=M.size;for(var Ie=0;Ie<X.length;Ie++)ae=T.readability(b,X[Ie]),ae>Ae&&(Ae=ae,be=T(X[Ie]));return T.isReadable(b,be,{level:je,size:Xe})||!Te?be:(M.includeFallbackColors=!1,T.mostReadable(b,["#fff","#000"],M))};var W=T.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"},j=T.hexNames=A(W);function A(b){var X={};for(var M in b)b.hasOwnProperty(M)&&(X[b[M]]=M);return X}function P(b){return b=parseFloat(b),(isNaN(b)||b<0||b>1)&&(b=1),b}function p(b,X){G(b)&&(b="100%");var M=oe(b);return b=k(X,E(0,parseFloat(b))),M&&(b=parseInt(b*X,10)/100),se.abs(b-X)<1e-6?1:b%X/parseFloat(X)}function d(b){return k(1,E(0,b))}function S(b){return parseInt(b,16)}function G(b){return typeof b=="string"&&b.indexOf(".")!=-1&&parseFloat(b)===1}function oe(b){return typeof b=="string"&&b.indexOf("%")!=-1}function Ce(b){return b.length==1?"0"+b:""+b}function Me(b){return b<=1&&(b=b*100+"%"),b}function me(b){return se.round(parseFloat(b)*255).toString(16)}function _e(b){return S(b)/255}var ge=function(){var b="[-\\+]?\\d+%?",X="[-\\+]?\\d*\\.\\d+%?",M="(?:"+X+")|(?:"+b+")",be="[\\s|\\(]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")\\s*\\)?",Ae="[\\s|\\(]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")\\s*\\)?";return{CSS_UNIT:new RegExp(M),rgb:new RegExp("rgb"+be),rgba:new RegExp("rgba"+Ae),hsl:new RegExp("hsl"+be),hsla:new RegExp("hsla"+Ae),hsv:new RegExp("hsv"+be),hsva:new RegExp("hsva"+Ae),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 le(b){return!!ge.CSS_UNIT.exec(b)}function ee(b){b=b.replace(re,"").replace(ue,"").toLowerCase();var X=!1;if(W[b])b=W[b],X=!0;else if(b=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var M;return(M=ge.rgb.exec(b))?{r:M[1],g:M[2],b:M[3]}:(M=ge.rgba.exec(b))?{r:M[1],g:M[2],b:M[3],a:M[4]}:(M=ge.hsl.exec(b))?{h:M[1],s:M[2],l:M[3]}:(M=ge.hsla.exec(b))?{h:M[1],s:M[2],l:M[3],a:M[4]}:(M=ge.hsv.exec(b))?{h:M[1],s:M[2],v:M[3]}:(M=ge.hsva.exec(b))?{h:M[1],s:M[2],v:M[3],a:M[4]}:(M=ge.hex8.exec(b))?{r:S(M[1]),g:S(M[2]),b:S(M[3]),a:_e(M[4]),format:X?"name":"hex8"}:(M=ge.hex6.exec(b))?{r:S(M[1]),g:S(M[2]),b:S(M[3]),format:X?"name":"hex"}:(M=ge.hex4.exec(b))?{r:S(M[1]+""+M[1]),g:S(M[2]+""+M[2]),b:S(M[3]+""+M[3]),a:_e(M[4]+""+M[4]),format:X?"name":"hex8"}:(M=ge.hex3.exec(b))?{r:S(M[1]+""+M[1]),g:S(M[2]+""+M[2]),b:S(M[3]+""+M[3]),format:X?"name":"hex"}:!1}function V(b){var X,M;return b=b||{level:"AA",size:"small"},X=(b.level||"AA").toUpperCase(),M=(b.size||"small").toLowerCase(),X!=="AA"&&X!=="AAA"&&(X="AA"),M!=="small"&&M!=="large"&&(M="small"),{level:X,size:M}}et.exports?et.exports=T:!(H=function(){return T}.call(Ze,v,Ze,et),H!==void 0&&(et.exports=H))})(Math)},aRTE:function(et,Ze){et.exports={L:1,M:0,Q:3,H:2}},bT9E:function(et,Ze,v){"use strict";v.d(Ze,"a",function(){return se});var H=v("VTBJ");function se(re,ue){var D=Object(H.a)({},re);return Array.isArray(ue)&&ue.forEach(function(z){delete D[z]}),D}},bqDo:function(et,Ze,v){"use strict";var H=v("0Owb"),se=v("k1fw"),re=v("miYZ"),ue=v("tsqr"),D=v("tJVT"),z=v("p5ED"),k=v("q1tI"),E=v.n(k),I=function(R){var C=R.fileName,te=R.fileType,Z=R.url,B=Object(k.useState)({name:"",filename:"",type:"",className:"",data:"",close:!0,hasMask:!0,style:{position:"fixed",zIndex:9999,background:"rgba(0,0,0,.7)"},monacoEditor:{value:"",language:"",theme:"vs",options:{readOnly:!0}}}),J=Object(D.a)(B,2),F=J[0],ce=J[1];return E.a.createElement("div",null,E.a.createElement("span",{style:{cursor:"pointer",color:"#1890ff"},onClick:function(){var Pe=["office","pdf","image","other","video","audio","download"];if(!Pe.includes(te)){ue.b.info("\u5F53\u524D\u7C7B\u578B\u6682\u4E0D\u652F\u6301\u9884\u89C8");return}ce(Object(se.a)(Object(se.a)({},F),{},{filename:C,type:te,data:Z}))}},C),E.a.createElement(z.a,Object(H.a)({},F,{onClose:function(){ce(Object(se.a)(Object(se.a)({},F),{},{type:""}))}})))};Ze.a=I},c5Ni:function(et,Ze,v){},dGDm:function(et,Ze,v){et.exports={selectEnvironment:"selectEnvironment___1zrTT",search:"search___2Sku-",searchListWrap:"searchListWrap___30F5Q",searchList:"searchList___dxlP6",name:"name___28Ilk",tag:"tag___GYHhS",limitTag:"limitTag___Bds0k",searchListActive:"searchListActive___1H-dL",spin:"spin___2GYcy",common:"common___JE3ZS",title:"title___11-q3",tags:"tags___3vE7b",tagActive:"tagActive___1c0bT",wrap:"wrap___fFVWs",allList:"allList___2mVBv",item:"item___2NPtB",itemActive:"itemActive___2aQTm",line:"line___yjjYk",apply:"apply___3NyxD",p1:"p1___2xNuY",p2:"p2___uGM8U",list:"list___1jtVf",items:"items___3gafm",darklySelectEnvironment:"darklySelectEnvironment___2KS0W"}},dQei:function(et,Ze){for(var v={glog:function(se){if(se<1)throw new Error("glog("+se+")");return v.LOG_TABLE[se]},gexp:function(se){for(;se<0;)se+=255;for(;se>=256;)se-=255;return v.EXP_TABLE[se]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},H=0;H<8;H++)v.EXP_TABLE[H]=1<<H;for(var H=8;H<256;H++)v.EXP_TABLE[H]=v.EXP_TABLE[H-4]^v.EXP_TABLE[H-5]^v.EXP_TABLE[H-6]^v.EXP_TABLE[H-8];for(var H=0;H<255;H++)v.LOG_TABLE[v.EXP_TABLE[H]]=H;et.exports=v},dWSS:function(et,Ze,v){var H=v("dQei");function se(re,ue){if(re.length==null)throw new Error(re.length+"/"+ue);for(var D=0;D<re.length&&re[D]==0;)D++;this.num=new Array(re.length-D+ue);for(var z=0;z<re.length-D;z++)this.num[z]=re[z+D]}se.prototype={get:function(re){return this.num[re]},getLength:function(){return this.num.length},multiply:function(re){for(var ue=new Array(this.getLength()+re.getLength()-1),D=0;D<this.getLength();D++)for(var z=0;z<re.getLength();z++)ue[D+z]^=H.gexp(H.glog(this.get(D))+H.glog(re.get(z)));return new se(ue,0)},mod:function(re){if(this.getLength()-re.getLength()<0)return this;for(var ue=H.glog(this.get(0))-H.glog(re.get(0)),D=new Array(this.getLength()),z=0;z<this.getLength();z++)D[z]=this.get(z);for(var z=0;z<re.getLength();z++)D[z]^=H.gexp(H.glog(re.get(z))+ue);return new se(D,0).mod(re)}},et.exports=se},dejd:function(et,Ze,v){},dmUQ:function(et,Ze,v){"use strict";var H=v("Ff2n"),se=v("rePB"),re=v("1OyB"),ue=v("vuIU"),D=v("Ji7U"),z=v("md7G"),k=v("foSv"),E=v("q1tI"),I=v.n(E),T=v("TSYQ"),R=v.n(T),C=v("4IlW");function te(Ee,O){var de=Object.keys(Ee);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols(Ee);O&&(Q=Q.filter(function(_){return Object.getOwnPropertyDescriptor(Ee,_).enumerable})),de.push.apply(de,Q)}return de}function Z(Ee){for(var O=1;O<arguments.length;O++){var de=arguments[O]!=null?arguments[O]:{};O%2?te(Object(de),!0).forEach(function(Q){Object(se.a)(Ee,Q,de[Q])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Ee,Object.getOwnPropertyDescriptors(de)):te(Object(de)).forEach(function(Q){Object.defineProperty(Ee,Q,Object.getOwnPropertyDescriptor(de,Q))})}return Ee}function B(Ee){var O=J();return function(){var Q=Object(k.a)(Ee),_;if(O){var W=Object(k.a)(this).constructor;_=Reflect.construct(Q,arguments,W)}else _=Q.apply(this,arguments);return Object(z.a)(this,_)}}function J(){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(Ee){return!1}}function F(){}function ce(Ee){Ee.preventDefault()}var ne=function(O){return O.replace(/[^\w.-]+/g,"")},Pe=200,$e=600,ye=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,Le=function(O){return O!=null},Fe=function(O,de){return de===O||typeof de=="number"&&typeof O=="number"&&isNaN(de)&&isNaN(O)},xe=function(Ee){Object(D.a)(de,Ee);var O=B(de);function de(Q){var _;Object(re.a)(this,de),_=O.call(this,Q),_.onKeyDown=function(A){var P=_.props,p=P.onKeyDown,d=P.onPressEnter;if(A.keyCode===C.a.UP){var S=_.getRatio(A);_.up(A,S,null),_.stop()}else if(A.keyCode===C.a.DOWN){var G=_.getRatio(A);_.down(A,G,null),_.stop()}else A.keyCode===C.a.ENTER&&d&&d(A);if(_.recordCursorPosition(),_.lastKeyCode=A.keyCode,p){for(var oe=arguments.length,Ce=new Array(oe>1?oe-1:0),Me=1;Me<oe;Me++)Ce[Me-1]=arguments[Me];p.apply(void 0,[A].concat(Ce))}},_.onKeyUp=function(A){var P=_.props.onKeyUp;if(_.stop(),_.recordCursorPosition(),P){for(var p=arguments.length,d=new Array(p>1?p-1:0),S=1;S<p;S++)d[S-1]=arguments[S];P.apply(void 0,[A].concat(d))}},_.onChange=function(A){var P=_.props.onChange;_.state.focused&&(_.inputting=!0),_.rawInput=_.props.parser(_.getValueFromEvent(A)),_.setState({inputValue:_.rawInput}),P(_.toNumber(_.rawInput))},_.onMouseUp=function(){var A=_.props.onMouseUp;_.recordCursorPosition(),A&&A.apply(void 0,arguments)},_.onFocus=function(){var A;_.setState({focused:!0}),(A=_.props).onFocus.apply(A,arguments)},_.onBlur=function(){var A=_.props.onBlur;_.inputting=!1,_.setState({focused:!1});var P=_.getCurrentValidValue(_.state.inputValue),p=_.setValue(P,F);if(A){var d=_.input.value,S=_.getInputDisplayValue({focus:!1,value:p});_.input.value=S&&Number(S),A.apply(void 0,arguments),_.input.value=d}},_.getRatio=function(A){var P=1;return A.metaKey||A.ctrlKey?P=.1:A.shiftKey&&(P=10),P},_.getFullNum=function(A){return isNaN(A)?A:/e/i.test(String(A))?Number(A).toFixed(18).replace(/\.?0+$/,""):A},_.getPrecision=function(A){if(Le(_.props.precision))return _.props.precision;var P=String(A);if(P.indexOf("e-")>=0)return parseInt(P.slice(P.indexOf("e-")+2),10);var p=0;return P.indexOf(".")>=0&&(p=P.length-P.indexOf(".")-1),p},_.getInputDisplayValue=function(A){var P=A||_.state,p=P.focused,d=P.inputValue,S=P.value,G;p?G=d:G=_.toPrecisionAsStep(S),G==null&&(G="");var oe=_.formatWrapper(G);return Le(_.props.decimalSeparator)&&(oe=oe.toString().replace(".",_.props.decimalSeparator)),oe},_.recordCursorPosition=function(){try{_.cursorStart=_.input.selectionStart,_.cursorEnd=_.input.selectionEnd,_.currentValue=_.input.value,_.cursorBefore=_.input.value.substring(0,_.cursorStart),_.cursorAfter=_.input.value.substring(_.cursorEnd)}catch(A){}},_.restoreByAfter=function(A){if(A===void 0)return!1;var P=_.input.value,p=P.lastIndexOf(A);if(p===-1)return!1;var d=_.cursorBefore.length;return _.lastKeyCode===C.a.DELETE&&_.cursorBefore.charAt(d-1)===A[0]?(_.fixCaret(d,d),!0):p+A.length===P.length?(_.fixCaret(p,p),!0):!1},_.partRestoreByAfter=function(A){return A===void 0?!1:Array.prototype.some.call(A,function(P,p){var d=A.substring(p);return _.restoreByAfter(d)})},_.isNotCompleteNumber=function(A){return isNaN(A)||A===""||A===null||A&&A.toString().indexOf(".")===A.toString().length-1},_.stop=function(){_.autoStepTimer&&clearTimeout(_.autoStepTimer)},_.down=function(A,P,p){_.pressingUpOrDown=!0,_.step("down",A,P,p)},_.up=function(A,P,p){_.pressingUpOrDown=!0,_.step("up",A,P,p)},_.saveInput=function(A){_.input=A};var W=Q.value;W===void 0&&(W=Q.defaultValue),_.state={focused:Q.autoFocus};var j=_.getValidValue(_.toNumber(W));return _.state=Z(Z({},_.state),{},{inputValue:_.toPrecisionAsStep(j),value:j}),_}return Object(ue.a)(de,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(_){var W=this.props,j=W.value,A=W.onChange,P=W.max,p=W.min,d=this.state.focused;if(_){if(!Fe(_.value,j)||!Fe(_.max,P)||!Fe(_.min,p)){var S=d?j:this.getValidValue(j),G;this.pressingUpOrDown?G=S:this.inputting?G=this.rawInput:G=this.toPrecisionAsStep(S),this.setState({value:S,inputValue:G})}var oe="value"in this.props?j:this.state.value;"max"in this.props&&_.max!==P&&typeof oe=="number"&&oe>P&&A&&A(P),"min"in this.props&&_.min!==p&&typeof oe=="number"&&oe<p&&A&&A(p)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Ce=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===C.a.BACKSPACE?Ce=this.cursorStart-1:this.lastKeyCode===C.a.DELETE&&(Ce=this.cursorStart):Ce=this.input.value.length,this.fixCaret(Ce,Ce)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case C.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case C.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(_){var W=_;return W===""?W="":this.isNotCompleteNumber(parseFloat(W))?W=this.state.value:W=this.getValidValue(W),this.toNumber(W)}},{key:"getValueFromEvent",value:function(_){var W=_.target.value.trim().replace(/。/g,".");return Le(this.props.decimalSeparator)&&(W=W.replace(this.props.decimalSeparator,".")),W}},{key:"getValidValue",value:function(_){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,A=parseFloat(_);return isNaN(A)?_:(A<W&&(A=W),A>j&&(A=j),A)}},{key:"setValue",value:function(_,W){var j=this.props.precision,A=this.isNotCompleteNumber(parseFloat(_))?null:parseFloat(_),P=this.state.value,p=P===void 0?null:P,d=this.state.inputValue,S=d===void 0?null:d,G=typeof A=="number"?A.toFixed(j):"".concat(A),oe=A!==p||G!=="".concat(S);return"value"in this.props?(S=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:S},W)):this.setState({value:A,inputValue:this.toPrecisionAsStep(_)},W),oe&&this.props.onChange(A),A}},{key:"getMaxPrecision",value:function(_){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.props,A=j.precision,P=j.step;if(Le(A))return A;var p=this.getPrecision(W),d=this.getPrecision(P),S=this.getPrecision(_);return _?Math.max(S,p+d):p+d}},{key:"getPrecisionFactor",value:function(_){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.getMaxPrecision(_,W);return Math.pow(10,j)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(_){return this.props.formatter?this.props.formatter(_):_}},{key:"toPrecisionAsStep",value:function(_){if(this.isNotCompleteNumber(_)||_==="")return _;var W=Math.abs(this.getMaxPrecision(_));return isNaN(W)?_.toString():Number(_).toFixed(W)}},{key:"toNumber",value:function(_){var W=this.props.precision,j=this.state.focused,A=_&&_.length>16&&j;return this.isNotCompleteNumber(_)||A?_:Le(W)?Math.round(_*Math.pow(10,W))/Math.pow(10,W):Number(_)}},{key:"upStep",value:function(_,W){var j=this.props.step,A=this.getPrecisionFactor(_,W),P=Math.abs(this.getMaxPrecision(_,W)),p=((A*_+A*j*W)/A).toFixed(P);return this.toNumber(p)}},{key:"downStep",value:function(_,W){var j=this.props.step,A=this.getPrecisionFactor(_,W),P=Math.abs(this.getMaxPrecision(_,W)),p=((A*_-A*j*W)/A).toFixed(P);return this.toNumber(p)}},{key:"step",value:function(_,W){var j=this,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,P=arguments.length>3?arguments[3]:void 0;this.stop(),W&&(W.persist(),W.preventDefault());var p=this.props;if(p.disabled)return;var d=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(d))return;var S=this["".concat(_,"Step")](d,A),G=S>p.max||S<p.min;if(S>p.max?S=p.max:S<p.min&&(S=p.min),this.setValue(S,null),this.setState({focused:!0},function(){j.pressingUpOrDown=!1}),G)return;this.autoStepTimer=setTimeout(function(){j[_](W,A,!0)},P?Pe:$e)}},{key:"fixCaret",value:function(_,W){if(_===void 0||W===void 0||!this.input||!this.input.value)return;try{var j=this.input.selectionStart,A=this.input.selectionEnd;(_!==j||W!==A)&&this.input.setSelectionRange(_,W)}catch(P){}}},{key:"render",value:function(){var _,W=this.props,j=W.prefixCls,A=W.disabled,P=W.readOnly,p=W.useTouch,d=W.autoComplete,S=W.upHandler,G=W.downHandler,oe=W.className,Ce=W.max,Me=W.min,me=W.style,_e=W.title,ge=W.onMouseEnter,le=W.onMouseLeave,ee=W.onMouseOver,V=W.onMouseOut,b=W.required,X=W.onClick,M=W.tabIndex,be=W.type,Ae=W.placeholder,ae=W.id,Te=W.inputMode,je=W.pattern,Xe=W.step,Ie=W.maxLength,Ne=W.autoFocus,Be=W.name,ft=W.onPaste,ut=W.onInput,st=Object(H.a)(W,["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"]),nt=this.state,Qe=nt.value,Ve=nt.focused,Ke=R()(j,(_={},Object(se.a)(_,oe,!!oe),Object(se.a)(_,"".concat(j,"-disabled"),A),Object(se.a)(_,"".concat(j,"-focused"),Ve),_)),we={};Object.keys(st).forEach(function(N){(N.substr(0,5)==="data-"||N.substr(0,5)==="aria-"||N==="role")&&(we[N]=st[N])});var lt=!P&&!A,tt=this.getInputDisplayValue(null),Re=(Qe||Qe===0)&&(isNaN(Qe)||Number(Qe)>=Ce),He=(Qe||Qe===0)&&(isNaN(Qe)||Number(Qe)<=Me),q=Re||A||P,Y=He||A||P,ie=R()("".concat(j,"-handler"),"".concat(j,"-handler-up"),Object(se.a)({},"".concat(j,"-handler-up-disabled"),q)),x=R()("".concat(j,"-handler"),"".concat(j,"-handler-down"),Object(se.a)({},"".concat(j,"-handler-down-disabled"),Y)),w=p?{onTouchStart:q?F:this.up,onTouchEnd:this.stop}:{onMouseDown:q?F:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},L=p?{onTouchStart:Y?F:this.down,onTouchEnd:this.stop}:{onMouseDown:Y?F:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return I.a.createElement("div",{className:Ke,style:me,title:_e,onMouseEnter:ge,onMouseLeave:le,onMouseOver:ee,onMouseOut:V,onFocus:function(){return null},onBlur:function(){return null}},I.a.createElement("div",{className:"".concat(j,"-handler-wrap")},I.a.createElement("span",Object.assign({unselectable:"on"},w,{role:"button","aria-label":"Increase Value","aria-disabled":q,className:ie}),S||I.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-up-inner"),onClick:ce})),I.a.createElement("span",Object.assign({unselectable:"on"},L,{role:"button","aria-label":"Decrease Value","aria-disabled":Y,className:x}),G||I.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-down-inner"),onClick:ce}))),I.a.createElement("div",{className:"".concat(j,"-input-wrap")},I.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Me,"aria-valuemax":Ce,"aria-valuenow":Qe,required:b,type:be,placeholder:Ae,onPaste:ft,onClick:X,onMouseUp:this.onMouseUp,className:"".concat(j,"-input"),tabIndex:M,autoComplete:d,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:lt?this.onKeyDown:F,onKeyUp:lt?this.onKeyUp:F,autoFocus:Ne,maxLength:Ie,readOnly:P,disabled:A,max:Ce,min:Me,step:Xe,name:Be,title:_e,id:ae,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(tt),pattern:je,inputMode:Te,onInput:ut},we))))}}]),de}(I.a.Component);xe.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:ye,min:-ye,step:1,style:{},onChange:F,onKeyDown:F,onPressEnter:F,onFocus:F,onBlur:F,parser:ne,required:!1,autoComplete:"off"};var Se=xe,Oe=Ze.a=Se},dugo:function(et,Ze,v){"use strict";v.r(Ze);var H=v("7Kak"),se=v("9yH6"),re=v("tJVT"),ue=v("q1tI"),D=v.n(ue),z=v("FrRK"),k=v("2qtc"),E=v("kLXV"),I=v("5Dmo"),T=v("3S7+"),R=v("14J3"),C=v("BMrR"),te=v("+L6B"),Z=v("2/Rp"),B=v("R9oj"),J=v("ECub"),F=v("miYZ"),ce=v("tsqr"),ne=v("9og8"),Pe=v("WmNS"),$e=v.n(Pe),ye=v("9kvl"),Le=v("HBuW"),Fe=v("1vsH"),xe=v("Lai7"),Se=v.n(xe),Oe=v("9Bee"),Ee=v("EGTK"),O=v("m3rI"),de=v("mT4J"),Q=v.n(de),_=v("ErOA"),W=v("bqDo"),j=function(Ie){var Ne=Ie.newShixuns,Be=Ie.user,ft=Ie.dispatch,ut=Object(ue.useState)(null),st=Object(re.a)(ut,2),nt=st[0],Qe=st[1],Ve=Object(ue.useState)(null),Ke=Object(re.a)(Ve,2),we=Ke[0],lt=Ke[1],tt=Object(ue.useState)({}),Re=Object(re.a)(tt,2),He=Re[0],q=Re[1],Y=Object(ue.useState)(!1),ie=Object(re.a)(Y,2),x=ie[0],w=ie[1],L=Object(ue.useState)(!1),N=Object(re.a)(L,2),fe=N[0],ke=N[1],Ye=Ne.environmentData,bt=Ye.frequence_image,Rt=bt===void 0?[]:bt,We=Ye.environments,Ct=We===void 0?[]:We,gt=Ye.other_image,ot=gt===void 0?[]:gt,vt=He.name,_t=He.description,Mt=He.authorization,Lt=He.template_shixuns,wt=Lt===void 0?[]:Lt,en=He.recommend_shixuns,Ut=en===void 0?[]:en,ht=He.introduction_document,Vt=ht===void 0?[]:ht;Object(ue.useEffect)(function(){ft({type:"newShixuns/getEnvironmentData"})},[]),Object(ue.useEffect)(function(){if(we===null)return;Xt()},[we]);var Xt=function(){var pt=Object(ne.a)($e.a.mark(function at(){var Zt;return $e.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:return Kt.next=2,Object(Le.R)({mirror_repository_id:we});case 2:Zt=Kt.sent,q(Zt.data);case 4:case"end":return Kt.stop()}},at)}));return function(){return pt.apply(this,arguments)}}();Object(ue.useEffect)(function(){(Rt==null?void 0:Rt.length)>0&<(Rt[0].id)},[Rt]);var nn=function(at){Qe(at),w(!0)},cn=function(){var pt=Object(ne.a)($e.a.mark(function at(){var Zt,hn;return $e.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return ke(!0),Tt.next=3,Object(_.a)("/api/shixuns/".concat(nt==null?void 0:nt.identifier,"/copy.json"),{method:"post",body:{}});case 3:Zt=Tt.sent,Zt.status===0&&(ye.d===null||ye.d===void 0||ye.d.push("/shixuns/".concat((hn=Zt.data)===null||hn===void 0?void 0:hn.shixun,"/edit")),w(!1),ce.b.success("\u590D\u5236\u6210\u529F")),ke(!1);case 6:case"end":return Tt.stop()}},at)}));return function(){return pt.apply(this,arguments)}}(),Jn=function(){w(!1)},an=function(){var pt=Object(ne.a)($e.a.mark(function at(){var Zt,hn,Kt,Tt=arguments;return $e.a.wrap(function(An){for(;;)switch(An.prev=An.next){case 0:return Zt=Tt.length>0&&Tt[0]!==void 0?Tt[0]:!1,Object(Fe.ab)(["\u5B9E\u8DF5\u9879\u76EE","\u65B0\u5EFA\u5B9E\u8DF5\u9879\u76EE","\u5168\u5B9E\u8DF5\u9879\u76EE",Zt?"\u6682\u4E0D\u9009\u7528\u955C\u50CF":"\u4F7F\u7528\u5F53\u524D\u955C\u50CF"]),hn=we&&!Zt?{image_id:we}:{},An.next=5,Object(_.a)("/api/shixuns/choose_environment_or_skip.json",{method:"post",body:hn});case 5:Kt=An.sent,Kt.status===0&&ye.d.push("/shixuns/".concat(Kt.data.identifier,"/edit"));case 7:case"end":return An.stop()}},at)}));return function(){return pt.apply(this,arguments)}}();return D.a.createElement("div",{className:Q.a.practice},D.a.createElement(Ee.a,{dispatch:ft,value:we,data:Ct,otherData:ot,tags:Rt,onChange:function(at){return lt(at)}}),D.a.createElement("div",{className:Q.a.right},D.a.createElement("header",null,D.a.createElement("div",{className:Q.a.title},"\u5B9E\u9A8C\u73AF\u5883:\xA0",we===null?"\u2014 \u2014":vt)),D.a.createElement("div",{className:Q.a.content},we===null&&D.a.createElement(D.a.Fragment,null,D.a.createElement(J.a,{image:Se.a,description:"\u8BF7\u9009\u62E9\u5B9E\u9A8C\u73AF\u5883"}),D.a.createElement("div",{className:Q.a.btns},D.a.createElement(Z.a,{size:"large",style:{marginRight:20},onClick:function(){return an(!0)}}," \u6682\u4E0D\u9009\u7528\u955C\u50CF"),D.a.createElement(Z.a,{size:"large",type:"primary",disabled:we===null,onClick:function(){return an()}},"\u4F7F\u7528\u5F53\u524D\u955C\u50CF"))),we!==null&&D.a.createElement("div",{className:Q.a.des},D.a.createElement("div",{className:Q.a.mainBody},D.a.createElement(Oe.a,{value:_t})),(Vt==null?void 0:Vt.length)>0&&D.a.createElement("div",{className:Q.a.introDocWrapper},D.a.createElement("div",{className:Q.a.title},"\u4ECB\u7ECD\u6587\u6863"),Vt==null?void 0:Vt.map(function(pt){return D.a.createElement(C.a,null,D.a.createElement(W.a,{key:pt.id,fileName:pt.name,fileType:pt.file_type,url:"".concat(O.a.API_SERVER).concat(pt.url)}),D.a.createElement("a",{style:{marginLeft:12},download:!0,href:"".concat(O.a.API_SERVER).concat(pt.url)},"\u4E0B\u8F7D"))})),D.a.createElement("div",{className:Q.a.btns,style:{borderBottom:wt.length||Ut.length?"1px solid #F1F1F1":0}},D.a.createElement(Z.a,{size:"large",style:{marginRight:20},onClick:function(){return an(!0)}}," \u6682\u4E0D\u9009\u7528\u955C\u50CF"),D.a.createElement(Z.a,{size:"large",type:"primary",disabled:we===null,onClick:function(){return an()}},"\u4F7F\u7528\u5F53\u524D\u955C\u50CF")),!!wt.length&&D.a.createElement("div",{className:Q.a.title},"\u57FA\u4E8E\u6A21\u677F\u521B\u5EFA"),D.a.createElement("ul",{className:Q.a.sys},wt.map(function(pt,at){var Zt=pt.pic,hn=pt.name,Kt=pt.identifier,Tt=pt.template_description,Mn=pt.id;return D.a.createElement("li",{className:Q.a.li,key:at},D.a.createElement("div",{className:Q.a.d1},D.a.createElement("div",{className:Q.a.img},D.a.createElement("img",{src:"".concat(O.a.IMG_SERVER,"/").concat(Zt)})),D.a.createElement("div",{className:Q.a.btn},D.a.createElement("div",{className:Q.a.b1,onClick:function(){return Object(Fe.Q)("/shixuns/".concat(Kt,"/challenges"))}},"\u67E5\u770B\u8BE6\u60C5"),D.a.createElement("div",{className:Q.a.b2,onClick:function(){return nn(pt)}},"\u4F7F\u7528\u6A21\u677F")),D.a.createElement("div",{className:Q.a.bot},hn||"--")),Tt?D.a.createElement(T.a,{title:Tt},D.a.createElement("div",{className:Q.a.d2},Tt)):D.a.createElement("div",{className:Q.a.d2},"--"))})),!!Ut.length&&D.a.createElement("div",{className:Q.a.title},"\u63A8\u8350\u5B9E\u8DF5\u9879\u76EE\u6837\u4F8B"),D.a.createElement("ul",{className:Q.a.sys},Ut.map(function(pt,at){var Zt=pt.pic,hn=pt.name,Kt=pt.identifier,Tt=pt.id;return D.a.createElement("li",{className:Q.a.li,key:at},D.a.createElement("div",{className:Q.a.d1},D.a.createElement("div",{className:Q.a.img},D.a.createElement("img",{src:"".concat(O.a.IMG_SERVER,"/").concat(Zt)})),D.a.createElement("div",{className:Q.a.btn},D.a.createElement("div",{className:Q.a.b1,onClick:function(){return Object(Fe.Q)("/shixuns/".concat(Kt,"/challenges"))}},"\u67E5\u770B\u8BE6\u60C5"),D.a.createElement("div",{className:Q.a.b2,onClick:function(){return nn(pt)}},"\u4E00\u952E\u590D\u5236")),D.a.createElement("div",{className:Q.a.bot},hn)))}))))),D.a.createElement(E.a,{title:"\u4E00\u952E\u65B0\u5EFA",visible:x,centered:!0,onCancel:Jn,footer:null,wrapClassName:Q.a.practiceModal},Mt&&D.a.createElement("div",{className:Q.a.content},D.a.createElement("p",null,"\u4E00\u952E\u65B0\u5EFA\u540E\uFF0C\u60A8\u53EF\u4EE5\u57FA\u4E8E\u8FD9\u4E2A\u5B9E\u8BAD\u4FEE\u6539\u5F62\u6210\u65B0\u7684\u5B9E\u8BAD"),D.a.createElement(Z.a,{className:Q.a.btn,loading:fe,onClick:cn},"\u786E\u8BA4\u590D\u5236")),!Mt&&D.a.createElement("div",{className:Q.a.content},D.a.createElement("aside",null,D.a.createElement("p",null,"\u8BE5\u5B9E\u8BAD\u6240\u4F7F\u7528\u7684\u5B9E\u9A8C\u73AF\u5883\u4E3A\u79C1\u6709\u73AF\u5883\uFF1A",D.a.createElement("span",{style:{color:"#0152d9"}},vt)),D.a.createElement("p",null,"\u60A8\u65E0\u8BE5\u5B9E\u9A8C\u73AF\u5883\u7684\u4F7F\u7528\u6743\u9650\uFF0C\u6240\u4EE5\u65E0\u6CD5\u590D\u5236\u8BE5\u5B9E\u8BAD")),D.a.createElement("div",{onClick:function(){return w(!1)}},"\u6211\u77E5\u9053\u4E86"))))},A=Object(ye.a)(function(Xe){var Ie=Xe.newShixuns,Ne=Xe.globalSetting,Be=Xe.user;return{newShixuns:Ie,globalSetting:Ne,user:Be}})(j),P=v("sRBo"),p=v("kaz8"),d=v("5NDa"),S=v("5rEg"),G=v("k1fw"),oe=v("y8nQ"),Ce=v("Vl3Y"),Me=v("OaEy"),me=v("2fM7"),_e=v("Ot1p"),ge=v("YiCM"),le=v.n(ge),ee=v("QXZ7"),V=v("W/I6"),b=me.a.Option,X=function(Ie){var Ne,Be,ft,ut,st,nt=Ie.newShixuns,Qe=Ie.loading,Ve=Ie.dispatch,Ke=Ie.is_jupyter_lab,we=Ie.user,lt=Ce.a.useForm(),tt=Object(re.a)(lt,1),Re=tt[0],He=Object(ue.useState)({}),q=Object(re.a)(He,2),Y=q[0],ie=q[1],x=Object(ue.useState)(!1),w=Object(re.a)(x,2),L=w[0],N=w[1],fe=Object(ue.useState)({}),ke=Object(re.a)(fe,2),Ye=ke[0],bt=ke[1];Object(ue.useEffect)(function(){var vt="newShixuns/getNewShixunsData";Ke&&(vt="newShixuns/getShixunsJupyterLab"),Ve({type:vt})},[Ke]),Object(ue.useEffect)(function(){var vt,_t,Mt,Lt=nt==null||((vt=nt.newData)===null||vt===void 0||((_t=vt.main_type)===null||_t===void 0||((Mt=_t[0])===null||Mt===void 0)))?void 0:Mt.id;Re.setFieldsValue({mainType:Lt}),Ct(Lt)},[nt]);var Rt=function(){Ve({type:"newShixuns/setActionTabs",payload:{key:"NewShixuns-Apply"}})},We=function(_t,Mt){ie(Object(G.a)({},Mt)),console.log(_t,"changeValues"),"mainType"in _t&&Ct(Mt.mainType,Mt.subType),"subType"in _t&&Ct(Mt.mainType,Mt.subType)},Ct=function(_t){var Mt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Lt=nt.newData||{},wt=Lt.main_type,en=Lt.small_type,Ut=wt==null?void 0:wt.find(function(Vt){return Vt.id===_t}),ht={mainTypeName:Ut==null?void 0:Ut.type_name,mainTypeDescription:Ut==null?void 0:Ut.description,smallType:[]};Mt.map(function(Vt){en.map(function(Xt){Vt===Xt.id&&!!Xt.description&&ht.smallType.push({name:Xt.type_name,des:Xt.description})})}),bt(ht)},gt=function(){var vt=Object(ne.a)($e.a.mark(function _t(Mt){var Lt,wt,en,Ut,ht,Vt,Xt,nn,cn;return $e.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:return Lt=Mt||{},wt=Lt.intro,en=Lt.mainType,Ut=Lt.subType,ht=Lt.name,Vt=Lt.difficulty,Xt=Lt.jupyter_show_description,nn=Xt===void 0?!1:Xt,Object(Fe.ab)(["\u5B9E\u8DF5\u9879\u76EE","\u65B0\u5EFA\u5B9E\u8DF5\u9879\u76EE",Ke?"Jupyter Notebook\u5B9E\u8DF5\u9879\u76EE":"JupyterLab\u5B9E\u8DF5\u9879\u76EE","\u4FDD\u5B58"]),an.next=4,Ve({type:"newShixuns/submitShixuns",payload:{description:wt,main_type:en,sub_type:Ut,shixun:{jupyter_show_description:nn,shixun_tags:Mt==null?void 0:Mt.tag_names,name:ht,trainee:Vt,is_jupyter:!Ke,is_jupyter_lab:Ke}}});case 4:cn=an.sent,cn&&ye.d.push("/shixuns/".concat(cn.shixun_identifier,"/challenges"));case 6:case"end":return an.stop()}},_t)}));return function(Mt){return vt.apply(this,arguments)}}(),ot=function(){Ve({type:"newShixuns/setActionTabs",payload:{key:"Create-Environment"}})};return D.a.createElement(Ce.a,{form:Re,className:le.a.JupyterFieldWrapElse,scrollToFirstError:!0,layout:"vertical",initialValues:{difficulty:1},onValuesChange:We,onFinish:gt},D.a.createElement("div",{className:le.a.fieldWrap},D.a.createElement(Ce.a.Item,{name:"name",label:"\u540D\u79F0:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0"},{max:60,message:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}]},D.a.createElement(S.a,{bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26",suffix:"".concat(((Ne=Y.name)===null||Ne===void 0?void 0:Ne.length)||0,"/60")})),D.a.createElement(Ce.a.Item,{name:"intro",label:"\u7B80\u4ECB:"},D.a.createElement(_e.a,{watch:!0})),D.a.createElement(Ce.a.Item,{name:"jupyter_show_description",valuePropName:"checked"},D.a.createElement(p.a,null,"\u663E\u793A\u4EFB\u52A1\u8981\u6C42\uFF08\u52FE\u9009\u540E\uFF0C\u5C06\u7B80\u4ECB\u4F5C\u4E3A\u4EFB\u52A1\u8981\u6C42\u663E\u793A\u5728\u5B9E\u8DF5\u9879\u76EE\u6311\u6218\u9875\u9762\uFF09")),D.a.createElement("div",{className:"".concat(le.a.flexRow," ").concat(le.a.flexAlignCenter)},D.a.createElement(Ce.a.Item,{className:le.a.width180,name:"difficulty",label:"\u96BE\u6613\u5EA6:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u6613\u5EA6"}]},D.a.createElement(me.a,{bordered:!1,placeholder:"\u8BF7\u9009\u62E9\u96BE\u6613\u5EA6",style:{width:500}},D.a.createElement(b,{value:1},"\u521D\u7EA7"),D.a.createElement(b,{value:2},"\u4E2D\u7EA7"),D.a.createElement(b,{value:3},"\u4E2D\u9AD8\u7EA7"),D.a.createElement(b,{value:4},"\u9AD8\u7EA7")))),D.a.createElement("div",{className:"".concat(le.a.flexRow," ").concat(le.a.flexAlignCenter)},D.a.createElement(Ce.a.Item,{name:"tag_names",label:D.a.createElement("div",null,"\u6280\u80FD\u6807\u7B7E :"," "),rules:[{required:!0,message:"\u8BF7\u9009\u8F93\u5165\u6280\u80FD\u6807\u7B7E"}]},D.a.createElement(V.a,{placeholder:"\u6DFB\u52A0\u6807\u7B7E"}))),D.a.createElement("div",{className:"".concat(le.a.flexRow," ").concat(le.a.flexAlignEnd)},D.a.createElement(Ce.a.Item,{className:le.a.width240,name:"mainType",label:"\u5B9E\u9A8C\u73AF\u5883:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u4E3B\u7C7B\u522B"}]},D.a.createElement(me.a,{bordered:!1,placeholder:"\u8BF7\u9009\u62E9\u4E3B\u7C7B\u522B"},(Be=nt.newData)===null||Be===void 0||((ft=Be.main_type)===null||ft===void 0)?void 0:ft.map(function(vt){return D.a.createElement(b,{value:vt.id,key:vt.id,name:vt.description},vt.type_name)}))),D.a.createElement(Ce.a.Item,{name:"subType",className:"".concat(le.a.width240," ml20")},D.a.createElement(me.a,{getPopupContainer:function(_t){return _t.parentNode},bordered:!1,placeholder:"\u8BF7\u9009\u62E9\u5C0F\u7C7B\u522B",mode:"multiple"},(ut=nt.newData)===null||ut===void 0||((st=ut.small_type)===null||st===void 0)?void 0:st.map(function(vt){return D.a.createElement(b,{value:vt.id,key:vt.id,name:vt.description},vt.type_name)}))),D.a.createElement("div",{className:le.a.installPackage,onClick:function(){return N(!0)}},"\u73AF\u5883\u4ECB\u7ECD")),D.a.createElement("div",{className:le.a.apply},D.a.createElement("span",{className:le.a.p1},"\u6CA1\u6709\u5B9E\u9A8C\u73AF\u5883\uFF1F"),D.a.createElement("span",{className:le.a.p2,onClick:Rt}," ","\u7533\u8BF7\u65B0\u5EFA"),D.a.createElement("span",{className:le.a.p2,onClick:ot}," ","\u5728\u7EBF\u521B\u5EFA"))),D.a.createElement(Ce.a.Item,null,D.a.createElement("div",{className:le.a.buttonWrap},D.a.createElement(Z.a,{size:"large",className:"".concat(le.a.button," mr20"),onClick:function(){Object(Fe.ab)(["\u5B9E\u8DF5\u9879\u76EE","\u65B0\u5EFA\u5B9E\u8DF5\u9879\u76EE",Ke?"Jupyter Notebook\u5B9E\u8DF5\u9879\u76EE":"JupyterLab\u5B9E\u8DF5\u9879\u76EE","\u53D6\u6D88"]),ye.d.push("/shixuns")}},"\u53D6\u6D88"),D.a.createElement(Z.a,{size:"large",type:"primary",className:"".concat(le.a.button," mr20"),htmlType:"submit",loading:Qe["newShixuns/submitCourses"]},"\u4FDD\u5B58"))),D.a.createElement(ee.a,{installPackage:Ye,visible:L,setVisible:N}))},M=Object(ye.a)(function(Xe){var Ie=Xe.newShixuns,Ne=Xe.loading,Be=Xe.user;return{newShixuns:Ie,loading:Ne.effects,user:Be}})(X),be=v("N3QO"),Ae=v("6f40"),ae=v.n(Ae),Te=function(){var Ie=Object(ue.useState)("1"),Ne=Object(re.a)(Ie,2),Be=Ne[0],ft=Ne[1],ut=function(nt){ft(nt.target.value)};return D.a.createElement("section",{className:ae.a.practicalTraining},D.a.createElement("div",{className:ae.a.titleWrap},D.a.createElement("div",{className:ae.a.title},"\u65B0\u5EFA\u5B9E\u8DF5\u9879\u76EE"),D.a.createElement("div",{className:ae.a.line}),D.a.createElement(se.a.Group,{value:Be,onChange:ut},D.a.createElement(se.a,{style:{fontSize:16},value:"1"},"\u5168\u6808\u5B9E\u8DF5\u9879\u76EE"),D.a.createElement(se.a,{value:"2",style:{marginLeft:40,fontSize:16}},"Jupyter Notebook\u5B9E\u8DF5\u9879\u76EE"),D.a.createElement(se.a,{value:"3",style:{marginLeft:40,fontSize:16}},"JupyterLab\u5B9E\u8DF5\u9879\u76EE")),D.a.createElement("div",{className:ae.a.dec},Be==="1"&&"\u591A\u529F\u80FD\u65B0\u578B\u5B9E\u6218\u9879\u76EE\u6A21\u5F0F\uFF0C\u652F\u6301\u56FE\u5F62\u5316\u684C\u9762\u3001Web IDE\u3001\u547D\u4EE4\u884C\u3001\u865A\u62DF\u4EFF\u771F\u7B49\u591A\u79CD\u5B9E\u9A8C\u573A\u666F\uFF0C\u9002\u7528\u4E8E\u5404\u7C7B\u590D\u6742\u5DE5\u7A0B\u9879\u76EE\u7814\u53D1\u3002",Be==="2"&&"\u591A\u529F\u80FD\u5B9E\u65F6\u4EA4\u4E92\u5B9E\u9A8C\u6A21\u5F0F\uFF0C\u652F\u6301\u5B9E\u65F6\u4EE3\u7801\u3001\u6570\u5B66\u65B9\u7A0B\u3001\u53EF\u89C6\u5316\u548CMarkDown\u7B49\u3002 \u9002\u7528\u4E8E\u6570\u636E\u6E05\u7406\u3001\u6570\u503C\u6A21\u62DF\u3001\u7EDF\u8BA1\u5EFA\u6A21\u3001\u673A\u5668\u5B66\u4E60\u7B49\u7CFB\u5217\u5B9E\u9A8C\u3002",Be==="3"&&"JupyterLab\u662F\u65B0\u4E00\u4EE3Jupyter Notebook\uFF0C\u914D\u7F6E\u6587\u4EF6\u76EE\u5F55\u548CNotebook\uFF0C\u652F\u6301\u6570\u636E\u79D1\u5B66\u4E2D\u7684\u5404\u79CD\u5DE5\u4F5C\u6D41\u7A0B\uFF0C\u9002\u5408\u4E2D\u5927\u578B\u9879\u76EE\u3002")),Be==="1"&&D.a.createElement(A,null),(Be==="2"||Be==="3")&&D.a.createElement(M,{is_jupyter_lab:!(Be==="2")}),D.a.createElement(z.a,null),D.a.createElement(be.a,null))},je=Ze.default=Te},f4xo:function(et,Ze,v){var H=v("nVVt");function se(re){this.mode=H.MODE_8BIT_BYTE,this.data=re}se.prototype={getLength:function(re){return this.data.length},write:function(re){for(var ue=0;ue<this.data.length;ue++)re.put(this.data.charCodeAt(ue),8)}},et.exports=se},h78n:function(et,Ze,v){"use strict";v.d(Ze,"a",function(){return _});var H=v("q1tI"),se=v.n(H),re=v("TSYQ"),ue=v.n(re),D={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},z=function(A){var P=A.map(function(){return Object(H.useRef)()}),p=Object(H.useRef)();return Object(H.useEffect)(function(){var d=Date.now(),S=!1;Object.keys(P).forEach(function(G){var oe=P[G].current;if(!oe)return;S=!0;var Ce=oe.style;Ce.transitionDuration=".3s, .3s, .3s, .06s",p.current&&d-p.current<100&&(Ce.transitionDuration="0s, 0s")}),S&&(p.current=Date.now())}),[P]};function k(){return k=Object.assign||function(j){for(var A=1;A<arguments.length;A++){var P=arguments[A];for(var p in P)Object.prototype.hasOwnProperty.call(P,p)&&(j[p]=P[p])}return j},k.apply(this,arguments)}function E(j,A){return te(j)||C(j,A)||T(j,A)||I()}function I(){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 T(j,A){if(!j)return;if(typeof j=="string")return R(j,A);var P=Object.prototype.toString.call(j).slice(8,-1);if(P==="Object"&&j.constructor&&(P=j.constructor.name),P==="Map"||P==="Set")return Array.from(j);if(P==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(P))return R(j,A)}function R(j,A){(A==null||A>j.length)&&(A=j.length);for(var P=0,p=new Array(A);P<A;P++)p[P]=j[P];return p}function C(j,A){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(j)))return;var P=[],p=!0,d=!1,S=void 0;try{for(var G=j[Symbol.iterator](),oe;!(p=(oe=G.next()).done)&&!(P.push(oe.value),A&&P.length===A);p=!0);}catch(Ce){d=!0,S=Ce}finally{try{!p&&G.return!=null&&G.return()}finally{if(d)throw S}}return P}function te(j){if(Array.isArray(j))return j}function Z(j,A){if(j==null)return{};var P=B(j,A),p,d;if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(j);for(d=0;d<S.length;d++){if(p=S[d],A.indexOf(p)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(j,p))continue;P[p]=j[p]}}return P}function B(j,A){if(j==null)return{};var P={},p=Object.keys(j),d,S;for(S=0;S<p.length;S++){if(d=p[S],A.indexOf(d)>=0)continue;P[d]=j[d]}return P}var J=function(A){var P=A.className,p=A.percent,d=A.prefixCls,S=A.strokeColor,G=A.strokeLinecap,oe=A.strokeWidth,Ce=A.style,Me=A.trailColor,me=A.trailWidth,_e=A.transition,ge=Z(A,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete ge.gapPosition;var le=Array.isArray(p)?p:[p],ee=Array.isArray(S)?S:[S],V=z(le),b=E(V,1),X=b[0],M=oe/2,be=100-oe/2,Ae="M ".concat(G==="round"?M:0,",").concat(M,`
|
|
L `).concat(G==="round"?be:100,",").concat(M),ae="0 0 100 ".concat(oe),Te=0;return se.a.createElement("svg",k({className:ue()("".concat(d,"-line"),P),viewBox:ae,preserveAspectRatio:"none",style:Ce},ge),se.a.createElement("path",{className:"".concat(d,"-line-trail"),d:Ae,strokeLinecap:G,stroke:Me,strokeWidth:me||oe,fillOpacity:"0"}),le.map(function(je,Xe){var Ie={strokeDasharray:"".concat(je,"px, 100px"),strokeDashoffset:"-".concat(Te,"px"),transition:_e||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Ne=ee[Xe]||ee[ee.length-1];return Te+=je,se.a.createElement("path",{key:Xe,className:"".concat(d,"-line-path"),d:Ae,strokeLinecap:G,stroke:Ne,strokeWidth:oe,fillOpacity:"0",ref:X[Xe],style:Ie})}))};J.defaultProps=D;var F=J;function ce(){return ce=Object.assign||function(j){for(var A=1;A<arguments.length;A++){var P=arguments[A];for(var p in P)Object.prototype.hasOwnProperty.call(P,p)&&(j[p]=P[p])}return j},ce.apply(this,arguments)}function ne(j,A){return Fe(j)||Le(j,A)||$e(j,A)||Pe()}function Pe(){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(j,A){if(!j)return;if(typeof j=="string")return ye(j,A);var P=Object.prototype.toString.call(j).slice(8,-1);if(P==="Object"&&j.constructor&&(P=j.constructor.name),P==="Map"||P==="Set")return Array.from(j);if(P==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(P))return ye(j,A)}function ye(j,A){(A==null||A>j.length)&&(A=j.length);for(var P=0,p=new Array(A);P<A;P++)p[P]=j[P];return p}function Le(j,A){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(j)))return;var P=[],p=!0,d=!1,S=void 0;try{for(var G=j[Symbol.iterator](),oe;!(p=(oe=G.next()).done)&&!(P.push(oe.value),A&&P.length===A);p=!0);}catch(Ce){d=!0,S=Ce}finally{try{!p&&G.return!=null&&G.return()}finally{if(d)throw S}}return P}function Fe(j){if(Array.isArray(j))return j}function xe(j,A){if(j==null)return{};var P=Se(j,A),p,d;if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(j);for(d=0;d<S.length;d++){if(p=S[d],A.indexOf(p)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(j,p))continue;P[p]=j[p]}}return P}function Se(j,A){if(j==null)return{};var P={},p=Object.keys(j),d,S;for(S=0;S<p.length;S++){if(d=p[S],A.indexOf(d)>=0)continue;P[d]=j[d]}return P}var Oe=0;function Ee(j){return+j.replace("%","")}function O(j){return Array.isArray(j)?j:[j]}function de(j,A,P,p){var d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,S=arguments.length>5?arguments[5]:void 0,G=50-p/2,oe=0,Ce=-G,Me=0,me=-2*G;switch(S){case"left":oe=-G,Ce=0,Me=2*G,me=0;break;case"right":oe=G,Ce=0,Me=-2*G,me=0;break;case"bottom":Ce=G,me=2*G;break;default:}var _e="M 50,50 m ".concat(oe,",").concat(Ce,`
|
|
a `).concat(G,",").concat(G," 0 1 1 ").concat(Me,",").concat(-me,`
|
|
a `).concat(G,",").concat(G," 0 1 1 ").concat(-Me,",").concat(me),ge=Math.PI*2*G,le={stroke:P,strokeDasharray:"".concat(A/100*(ge-d),"px ").concat(ge,"px"),strokeDashoffset:"-".concat(d/2+j/100*(ge-d),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:_e,pathStyle:le}}var Q=function(A){var P=A.prefixCls,p=A.strokeWidth,d=A.trailWidth,S=A.gapDegree,G=A.gapPosition,oe=A.trailColor,Ce=A.strokeLinecap,Me=A.style,me=A.className,_e=A.strokeColor,ge=A.percent,le=xe(A,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),ee=Object(H.useMemo)(function(){return Oe+=1,Oe},[]),V=de(0,100,oe,p,S,G),b=V.pathString,X=V.pathStyle,M=O(ge),be=O(_e),Ae=be.find(function(Ie){return Object.prototype.toString.call(Ie)==="[object Object]"}),ae=z(M),Te=ne(ae,1),je=Te[0],Xe=function(){var Ne=0;return M.map(function(Be,ft){var ut=be[ft]||be[be.length-1],st=Object.prototype.toString.call(ut)==="[object Object]"?"url(#".concat(P,"-gradient-").concat(ee,")"):"",nt=de(Ne,Be,ut,p,S,G);return Ne+=Be,se.a.createElement("path",{key:ft,className:"".concat(P,"-circle-path"),d:nt.pathString,stroke:st,strokeLinecap:Ce,strokeWidth:p,opacity:Be===0?0:1,fillOpacity:"0",style:nt.pathStyle,ref:je[ft]})})};return se.a.createElement("svg",ce({className:ue()("".concat(P,"-circle"),me),viewBox:"0 0 100 100",style:Me},le),Ae&&se.a.createElement("defs",null,se.a.createElement("linearGradient",{id:"".concat(P,"-gradient-").concat(ee),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Ae).sort(function(Ie,Ne){return Ee(Ie)-Ee(Ne)}).map(function(Ie,Ne){return se.a.createElement("stop",{key:Ne,offset:Ie,stopColor:Ae[Ie]})}))),se.a.createElement("path",{className:"".concat(P,"-circle-trail"),d:b,stroke:oe,strokeLinecap:Ce,strokeWidth:d||p,fillOpacity:"0",style:X}),Xe().reverse())};Q.defaultProps=D;var _=Q,W={Line:F,Circle:_}},kSUc:function(et,Ze,v){},lZu9:function(et,Ze,v){(function(H){H(v("VrN/"),v("1eCo"),v("8EBN"))})(function(H){"use strict";H.defineMode("markdown",function(se,re){var ue=H.getMode(se,"text/html"),D=ue.name=="null";function z(p){if(H.findModeByName){var d=H.findModeByName(p);d&&(p=d.mime||d.mimes[0])}var S=H.getMode(se,p);return S.name=="null"?null:S}re.highlightFormatting===void 0&&(re.highlightFormatting=!1),re.maxBlockquoteDepth===void 0&&(re.maxBlockquoteDepth=0),re.taskLists===void 0&&(re.taskLists=!1),re.strikethrough===void 0&&(re.strikethrough=!1),re.emoji===void 0&&(re.emoji=!1),re.fencedCodeBlockHighlighting===void 0&&(re.fencedCodeBlockHighlighting=!0),re.fencedCodeBlockDefaultMode===void 0&&(re.fencedCodeBlockDefaultMode="text/plain"),re.xml===void 0&&(re.xml=!0),re.tokenTypeOverrides===void 0&&(re.tokenTypeOverrides={});var k={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 E in k)k.hasOwnProperty(E)&&re.tokenTypeOverrides[E]&&(k[E]=re.tokenTypeOverrides[E]);var I=/^([*\-_])(?:\s*\1){2,}\s*$/,T=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,R=/^\[(x| )\](?=\s)/i,C=re.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,te=/^ {0,3}(?:\={1,}|-{2,})\s*$/,Z=/^[^#!\[\]*_\\<>` "'(~:]+/,B=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,J=/^\s*\[[^\]]+?\]:.*$/,F=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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 ne(p,d,S){return d.f=d.inline=S,S(p,d)}function Pe(p,d,S){return d.f=d.block=S,S(p,d)}function $e(p){return!p||!/\S/.test(p.string)}function ye(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==Fe){var d=D;if(!d){var S=H.innerMode(ue,p.htmlState);d=S.mode.name=="xml"&&S.state.tagStart===null&&!S.state.context&&S.state.tokenize.isInText}d&&(p.f=Ee,p.block=Le,p.htmlState=null)}return p.trailingSpace=0,p.trailingSpaceNewLine=!1,p.prevLine=p.thisLine,p.thisLine={stream:null},null}function Le(p,d){var S=p.column()===d.indentation,G=$e(d.prevLine.stream),oe=d.indentedCode,Ce=d.prevLine.hr,Me=d.list!==!1,me=(d.listStack[d.listStack.length-1]||0)+3;d.indentedCode=!1;var _e=d.indentation;if(d.indentationDiff===null&&(d.indentationDiff=d.indentation,Me)){for(d.list=null;_e<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=_e-d.listStack[d.listStack.length-1])}var ge=!G&&!Ce&&!d.prevLine.header&&(!Me||!oe)&&!d.prevLine.fencedCodeEnd,le=(d.list===!1||Ce||G)&&d.indentation<=me&&p.match(I),ee=null;if(d.indentationDiff>=4&&(oe||d.prevLine.fencedCodeEnd||d.prevLine.header||G))return p.skipToEnd(),d.indentedCode=!0,k.code;if(p.eatSpace())return null;if(S&&d.indentation<=me&&(ee=p.match(C))&&ee[1].length<=6)return d.quote=0,d.header=ee[1].length,d.thisLine.header=!0,re.highlightFormatting&&(d.formatting="header"),d.f=d.inline,Se(d);if(d.indentation<=me&&p.eat(">"))return d.quote=S?1:d.quote+1,re.highlightFormatting&&(d.formatting="quote"),p.eatSpace(),Se(d);if(!le&&!d.setext&&S&&d.indentation<=me&&(ee=p.match(T))){var V=ee[1]?"ol":"ul";return d.indentation=_e+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,re.taskLists&&p.match(R,!1)&&(d.taskList=!0),d.f=d.inline,re.highlightFormatting&&(d.formatting=["list","list-"+V]),Se(d)}else{if(S&&d.indentation<=me&&(ee=p.match(B,!0)))return d.quote=0,d.fencedEndRE=new RegExp(ee[1]+"+ *$"),d.localMode=re.fencedCodeBlockHighlighting&&z(ee[2]||re.fencedCodeBlockDefaultMode),d.localMode&&(d.localState=H.startState(d.localMode)),d.f=d.block=xe,re.highlightFormatting&&(d.formatting="code-block"),d.code=-1,Se(d);if(d.setext||(!ge||!Me)&&!d.quote&&d.list===!1&&!d.code&&!le&&!J.test(p.string)&&(ee=p.lookAhead(1))&&(ee=ee.match(te)))return d.setext?(d.header=d.setext,d.setext=0,p.skipToEnd(),re.highlightFormatting&&(d.formatting="header")):(d.header=ee[0].charAt(0)=="="?1:2,d.setext=d.header),d.thisLine.header=!0,d.f=d.inline,Se(d);if(le)return p.skipToEnd(),d.hr=!0,d.thisLine.hr=!0,k.hr;if(p.peek()==="[")return ne(p,d,W)}return ne(p,d,d.inline)}function Fe(p,d){var S=ue.token(p,d.htmlState);if(!D){var G=H.innerMode(ue,d.htmlState);(G.mode.name=="xml"&&G.state.tagStart===null&&!G.state.context&&G.state.tokenize.isInText||d.md_inside&&p.current().indexOf(">")>-1)&&(d.f=Ee,d.block=Le,d.htmlState=null)}return S}function xe(p,d){var S=d.listStack[d.listStack.length-1]||0,G=d.indentation<S,oe=S+3;if(d.fencedEndRE&&d.indentation<=oe&&(G||p.match(d.fencedEndRE))){re.highlightFormatting&&(d.formatting="code-block");var Ce;return G||(Ce=Se(d)),d.localMode=d.localState=null,d.block=Le,d.f=Ee,d.fencedEndRE=null,d.code=0,d.thisLine.fencedCodeEnd=!0,G?Pe(p,d,d.block):Ce}else return d.localMode?d.localMode.token(p,d.localState):(p.skipToEnd(),k.code)}function Se(p){var d=[];if(p.formatting){d.push(k.formatting),typeof p.formatting=="string"&&(p.formatting=[p.formatting]);for(var S=0;S<p.formatting.length;S++)d.push(k.formatting+"-"+p.formatting[S]),p.formatting[S]==="header"&&d.push(k.formatting+"-"+p.formatting[S]+"-"+p.header),p.formatting[S]==="quote"&&(!re.maxBlockquoteDepth||re.maxBlockquoteDepth>=p.quote?d.push(k.formatting+"-"+p.formatting[S]+"-"+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(k.linkHref,"url"):(p.strong&&d.push(k.strong),p.em&&d.push(k.em),p.strikethrough&&d.push(k.strikethrough),p.emoji&&d.push(k.emoji),p.linkText&&d.push(k.linkText),p.code&&d.push(k.code),p.image&&d.push(k.image),p.imageAltText&&d.push(k.imageAltText,"link"),p.imageMarker&&d.push(k.imageMarker)),p.header&&d.push(k.header,k.header+"-"+p.header),p.quote&&(d.push(k.quote),!re.maxBlockquoteDepth||re.maxBlockquoteDepth>=p.quote?d.push(k.quote+"-"+p.quote):d.push(k.quote+"-"+re.maxBlockquoteDepth)),p.list!==!1){var G=(p.listStack.length-1)%3;G?G===1?d.push(k.list2):d.push(k.list3):d.push(k.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 Oe(p,d){return p.match(Z,!0)?Se(d):void 0}function Ee(p,d){var S=d.text(p,d);if(typeof S!="undefined")return S;if(d.list)return d.list=null,Se(d);if(d.taskList){var G=p.match(R,!0)[1]===" ";return G?d.taskOpen=!0:d.taskClosed=!0,re.highlightFormatting&&(d.formatting="task"),d.taskList=!1,Se(d)}if(d.taskOpen=!1,d.taskClosed=!1,d.header&&p.match(/^#+$/,!0))return re.highlightFormatting&&(d.formatting="header"),Se(d);var oe=p.next();if(d.linkTitle){d.linkTitle=!1;var Ce=oe;oe==="("&&(Ce=")"),Ce=(Ce+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Me="^\\s*(?:[^"+Ce+"\\\\]+|\\\\\\\\|\\\\.)"+Ce;if(p.match(new RegExp(Me),!0))return k.linkHref}if(oe==="`"){var me=d.formatting;re.highlightFormatting&&(d.formatting="code"),p.eatWhile("`");var _e=p.current().length;if(d.code==0&&(!d.quote||_e==1))return d.code=_e,Se(d);if(_e==d.code){var ge=Se(d);return d.code=0,ge}else return d.formatting=me,Se(d)}else if(d.code)return Se(d);if(oe==="\\"&&(p.next(),re.highlightFormatting)){var le=Se(d),ee=k.formatting+"-escape";return le?le+" "+ee:ee}if(oe==="!"&&p.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return d.imageMarker=!0,d.image=!0,re.highlightFormatting&&(d.formatting="image"),Se(d);if(oe==="["&&d.imageMarker&&p.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return d.imageMarker=!1,d.imageAltText=!0,re.highlightFormatting&&(d.formatting="image"),Se(d);if(oe==="]"&&d.imageAltText){re.highlightFormatting&&(d.formatting="image");var le=Se(d);return d.imageAltText=!1,d.image=!1,d.inline=d.f=de,le}if(oe==="["&&!d.image)return d.linkText&&p.match(/^.*?\]/)||(d.linkText=!0,re.highlightFormatting&&(d.formatting="link")),Se(d);if(oe==="]"&&d.linkText){re.highlightFormatting&&(d.formatting="link");var le=Se(d);return d.linkText=!1,d.inline=d.f=p.match(/\(.*?\)| ?\[.*?\]/,!1)?de:Ee,le}if(oe==="<"&&p.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=O,re.highlightFormatting&&(d.formatting="link");var le=Se(d);return le?le+=" ":le="",le+k.linkInline}if(oe==="<"&&p.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=O,re.highlightFormatting&&(d.formatting="link");var le=Se(d);return le?le+=" ":le="",le+k.linkEmail}if(re.xml&&oe==="<"&&p.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var V=p.string.indexOf(">",p.pos);if(V!=-1){var b=p.string.substring(p.start,V);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(d.md_inside=!0)}return p.backUp(1),d.htmlState=H.startState(ue),Pe(p,d,Fe)}if(re.xml&&oe==="<"&&p.match(/^\/\w*?>/))return d.md_inside=!1,"tag";if(oe==="*"||oe==="_"){for(var X=1,M=p.pos==1?" ":p.string.charAt(p.pos-2);X<3&&p.eat(oe);)X++;var be=p.peek()||" ",Ae=!/\s/.test(be)&&(!F.test(be)||/\s/.test(M)||F.test(M)),ae=!/\s/.test(M)&&(!F.test(M)||/\s/.test(be)||F.test(be)),Te=null,je=null;if(X%2&&(!d.em&&Ae&&(oe==="*"||!ae||F.test(M))?Te=!0:d.em==oe&&ae&&(oe==="*"||!Ae||F.test(be))&&(Te=!1)),X>1&&(!d.strong&&Ae&&(oe==="*"||!ae||F.test(M))?je=!0:d.strong==oe&&ae&&(oe==="*"||!Ae||F.test(be))&&(je=!1)),je!=null||Te!=null){re.highlightFormatting&&(d.formatting=Te==null?"strong":je==null?"em":"strong em"),Te===!0&&(d.em=oe),je===!0&&(d.strong=oe);var ge=Se(d);return Te===!1&&(d.em=!1),je===!1&&(d.strong=!1),ge}}else if(oe===" "&&(p.eat("*")||p.eat("_"))){if(p.peek()===" ")return Se(d);p.backUp(1)}if(re.strikethrough){if(oe==="~"&&p.eatWhile(oe)){if(d.strikethrough){re.highlightFormatting&&(d.formatting="strikethrough");var ge=Se(d);return d.strikethrough=!1,ge}else if(p.match(/^[^\s]/,!1))return d.strikethrough=!0,re.highlightFormatting&&(d.formatting="strikethrough"),Se(d)}else if(oe===" "&&p.match(/^~~/,!0)){if(p.peek()===" ")return Se(d);p.backUp(2)}}if(re.emoji&&oe===":"&&p.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){d.emoji=!0,re.highlightFormatting&&(d.formatting="emoji");var Xe=Se(d);return d.emoji=!1,Xe}return oe===" "&&(p.match(/^ +$/,!1)?d.trailingSpace++:d.trailingSpace&&(d.trailingSpaceNewLine=!0)),Se(d)}function O(p,d){var S=p.next();if(S===">"){d.f=d.inline=Ee,re.highlightFormatting&&(d.formatting="link");var G=Se(d);return G?G+=" ":G="",G+k.linkInline}return p.match(/^[^>]+/,!0),k.linkInline}function de(p,d){if(p.eatSpace())return null;var S=p.next();return S==="("||S==="["?(d.f=d.inline=_(S==="("?")":"]"),re.highlightFormatting&&(d.formatting="link-string"),d.linkHref=!0,Se(d)):"error"}var Q={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function _(p){return function(d,S){var G=d.next();if(G===p){S.f=S.inline=Ee,re.highlightFormatting&&(S.formatting="link-string");var oe=Se(S);return S.linkHref=!1,oe}return d.match(Q[p]),S.linkHref=!0,Se(S)}}function W(p,d){return p.match(/^([^\]\\]|\\.)*\]:/,!1)?(d.f=j,p.next(),re.highlightFormatting&&(d.formatting="link"),d.linkText=!0,Se(d)):ne(p,d,Ee)}function j(p,d){if(p.match(/^\]:/,!0)){d.f=d.inline=A,re.highlightFormatting&&(d.formatting="link");var S=Se(d);return d.linkText=!1,S}return p.match(/^([^\]\\]|\\.)+/,!0),k.linkText}function A(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=Ee,k.linkHref+" url")}var P={startState:function(){return{f:Le,prevLine:{stream:null},thisLine:{stream:null},block:Le,htmlState:null,indentation:0,inline:Ee,text:Oe,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(ue,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 ye(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!=Fe)){var S=p.match(/^\s*/,!0)[0].replace(/\t/g,ce).length;if(d.indentation=S,d.indentationDiff=null,S>0)return null}}return d.f(p,d)},innerMode:function(p){return p.block==Fe?{state:p.htmlState,mode:ue}:p.localState?{state:p.localState,mode:p.localMode}:{state:p,mode:P}},indent:function(p,d,S){return p.block==Fe&&ue.indent?ue.indent(p.htmlState,d,S):p.localState&&p.localMode.indent?p.localMode.indent(p.localState,d,S):H.Pass},blankLine:ye,getType:Se,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return P},"xml"),H.defineMIME("text/markdown","markdown"),H.defineMIME("text/x-markdown","markdown")})},mT4J:function(et,Ze,v){et.exports={practice:"practice___2GgSp",right:"right___2iW-T",title:"title___2wI-Y",content:"content___39urh",des:"des___3lOLJ",mainBody:"mainBody___2O3bf",sys:"sys___9a4Vo",li:"li___1a3_u",d1:"d1___--jU-",img:"img___3TRW8",bot:"bot___3H4-s",btn:"btn___2pVoZ",b1:"b1___3uZem",b2:"b2___3A6em",d2:"d2___2tiq3",btns:"btns___2p8vO",practiceModal:"practiceModal___15Ue6"}},nVVt:function(et,Ze){et.exports={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3}},osHv:function(et,Ze,v){(function(H){H(v("VrN/"))})(function(H){"use strict";var se=H.Pos;function re(F,ce){return F.line-ce.line||F.ch-ce.ch}var ue="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",D=ue+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",z=new RegExp("<(/?)(["+ue+"]["+D+"]*)","g");function k(F,ce,ne,Pe){this.line=ce,this.ch=ne,this.cm=F,this.text=F.getLine(ce),this.min=Pe?Math.max(Pe.from,F.firstLine()):F.firstLine(),this.max=Pe?Math.min(Pe.to-1,F.lastLine()):F.lastLine()}function E(F,ce){var ne=F.cm.getTokenTypeAt(se(F.line,ce));return ne&&/\btag\b/.test(ne)}function I(F){return F.line>=F.max?void 0:(F.ch=0,F.text=F.cm.getLine(++F.line),!0)}function T(F){return F.line<=F.min?void 0:(F.text=F.cm.getLine(--F.line),F.ch=F.text.length,!0)}function R(F){for(;;){var ce=F.text.indexOf(">",F.ch);if(ce==-1){if(I(F))continue;return}if(!E(F,ce+1)){F.ch=ce+1;continue}var ne=F.text.lastIndexOf("/",ce),Pe=ne>-1&&!/\S/.test(F.text.slice(ne+1,ce));return F.ch=ce+1,Pe?"selfClose":"regular"}}function C(F){for(;;){var ce=F.ch?F.text.lastIndexOf("<",F.ch-1):-1;if(ce==-1){if(T(F))continue;return}if(!E(F,ce+1)){F.ch=ce;continue}z.lastIndex=ce,F.ch=ce;var ne=z.exec(F.text);if(ne&&ne.index==ce)return ne}}function te(F){for(;;){z.lastIndex=F.ch;var ce=z.exec(F.text);if(!ce){if(I(F))continue;return}if(!E(F,ce.index+1)){F.ch=ce.index+1;continue}return F.ch=ce.index+ce[0].length,ce}}function Z(F){for(;;){var ce=F.ch?F.text.lastIndexOf(">",F.ch-1):-1;if(ce==-1){if(T(F))continue;return}if(!E(F,ce+1)){F.ch=ce;continue}var ne=F.text.lastIndexOf("/",ce),Pe=ne>-1&&!/\S/.test(F.text.slice(ne+1,ce));return F.ch=ce+1,Pe?"selfClose":"regular"}}function B(F,ce){for(var ne=[];;){var Pe=te(F),$e,ye=F.line,Le=F.ch-(Pe?Pe[0].length:0);if(!Pe||!($e=R(F)))return;if($e=="selfClose")continue;if(Pe[1]){for(var Fe=ne.length-1;Fe>=0;--Fe)if(ne[Fe]==Pe[2]){ne.length=Fe;break}if(Fe<0&&(!ce||ce==Pe[2]))return{tag:Pe[2],from:se(ye,Le),to:se(F.line,F.ch)}}else ne.push(Pe[2])}}function J(F,ce){for(var ne=[];;){var Pe=Z(F);if(!Pe)return;if(Pe=="selfClose"){C(F);continue}var $e=F.line,ye=F.ch,Le=C(F);if(!Le)return;if(Le[1])ne.push(Le[2]);else{for(var Fe=ne.length-1;Fe>=0;--Fe)if(ne[Fe]==Le[2]){ne.length=Fe;break}if(Fe<0&&(!ce||ce==Le[2]))return{tag:Le[2],from:se(F.line,F.ch),to:se($e,ye)}}}}H.registerHelper("fold","xml",function(F,ce){for(var ne=new k(F,ce.line,0);;){var Pe=te(ne);if(!Pe||ne.line!=ce.line)return;var $e=R(ne);if(!$e)return;if(!Pe[1]&&$e!="selfClose"){var ye=se(ne.line,ne.ch),Le=B(ne,Pe[2]);return Le&&re(Le.from,ye)>0?{from:ye,to:Le.from}:null}}}),H.findMatchingTag=function(F,ce,ne){var Pe=new k(F,ce.line,ce.ch,ne);if(Pe.text.indexOf(">")==-1&&Pe.text.indexOf("<")==-1)return;var $e=R(Pe),ye=$e&&se(Pe.line,Pe.ch),Le=$e&&C(Pe);if(!$e||!Le||re(Pe,ce)>0)return;var Fe={from:se(Pe.line,Pe.ch),to:ye,tag:Le[2]};return $e=="selfClose"?{open:Fe,close:null,at:"open"}:Le[1]?{open:J(Pe,Le[2]),close:Fe,at:"close"}:(Pe=new k(F,ye.line,ye.ch,ne),{open:Fe,close:B(Pe,Le[2]),at:"open"})},H.findEnclosingTag=function(F,ce,ne,Pe){for(var $e=new k(F,ce.line,ce.ch,ne);;){var ye=J($e,Pe);if(!ye)break;var Le=new k(F,ce.line,ce.ch,ne),Fe=B(Le,ye.tag);if(Fe)return{open:ye,close:Fe}}},H.scanForClosingTag=function(F,ce,ne,Pe){var $e=new k(F,ce.line,ce.ch,Pe?{from:0,to:Pe}:null);return B($e,ne)}})},p5ED:function(et,Ze,v){"use strict";var H=v("+L6B"),se=v("2/Rp"),re=v("5Dmo"),ue=v("3S7+"),D=v("k1fw"),z=v("tJVT"),k=v("q1tI"),E=v.n(k),I=v("vHTk"),T=v.n(I),R=v("yEEn"),C=v("ZW9T"),te=v("1vsH"),Z=v("m3rI");Ze.a=function(B){var J=B.name,F=B.data,ce=B.theme,ne=B.type,Pe=B.filename,$e=B.monacoEditor,ye=B.className,Le=B.style,Fe=B.close,xe=B.onClose,Se=B.hasMask,Oe=B.otherData,Ee=Object(k.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),O=Object(z.a)(Ee,2),de=O[0],Q=O[1],_=Object(k.useState)(""),W=Object(z.a)(_,2),j=W[0],A=W[1],P,p=1024*1024,d=10*p,S=Object(k.useRef)();ne==="office"&&(P=Object(te.R)(F).filesize,P>d&&(ne="other")),Pe&&($e.filename=Pe),Object(k.useEffect)(function(){var Ce,Me,me=(Ce=document.cookie)===null||Ce===void 0||((Me=Ce.replace(/\s/g,""))===null||Me===void 0)?void 0:Me.split(";");me==null||me.map(function(_e){var ge=_e.split("=");ge[0]==="_educoder_session"&&A(ge[1])})},[]);var G=function(){if(F.startsWith("http")||F.startsWith("blob:")){oe();return}Object(te.x)(Pe||"educoder",F,Pe)},oe=function(){Object(te.v)(Pe||"educoder",decodeURIComponent(F))};return E.a.createElement("div",{style:Object(D.a)({},Le||{}),className:"".concat(Se&&T.a.bgBlack," ").concat(ne?T.a.wrp:"hide")},Fe&&E.a.createElement("div",{className:T.a.close,ref:S},E.a.createElement(ue.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return S.current}},E.a.createElement("span",{onClick:oe},E.a.createElement("i",{className:"icon-quxiaozhiding"}))),E.a.createElement(ue.a,{title:"\u5173\u95ED",getPopupContainer:function(){return S.current}},E.a.createElement("span",{className:"",onClick:xe},E.a.createElement("i",{className:"icon-guanbi1"})))),E.a.createElement("div",{className:"".concat(T.a[ye]," ").concat(ye," ").concat(T.a.monaco," ").concat(ne==="txt"?"show":"hide")},ne==="txt"&&E.a.createElement(C.b,$e)),ne==="audio"&&E.a.createElement("audio",{src:"".concat((F==null?void 0:F.indexOf("http://"))>-1||(F==null?void 0:F.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(F),autoPlay:!0}),ne==="video"&&E.a.createElement(E.a.Fragment,null,(F==null?void 0:F.indexOf("http"))>-1?E.a.createElement("video",{controls:!0,src:"".concat(F),autoPlay:!0}):E.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(F),autoPlay:!0})),ne==="office"&&E.a.createElement("iframe",{src:"https://view.officeapps.live.com/op/embed.aspx?src=".concat(F,"?").concat(encodeURIComponent("disposition=office&token=".concat(j)))}),(ne==="xlsx"||ne==="doc"||ne==="pptx"||ne==="docx")&&E.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(Oe.key,"&url=").concat(Z.a.API_SERVER+Oe.url,"&callbackUrl=").concat(Z.a.API_SERVER+Oe.callbackUrl,"&fileType=").concat(Oe.fileType,"&title=").concat(Oe.title,"&model=").concat(Oe.model)}),ne==="html"&&E.a.createElement("iframe",{src:F+"&disposition=inline"}),ne==="pdf"&&E.a.createElement("embed",{className:T.a.embed,src:F,type:"application/pdf"}),ne==="image"&&E.a.createElement("img",{src:"".concat((F==null?void 0:F.indexOf("http://"))>-1||(F==null?void 0:F.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(F)}),ne==="other"&&E.a.createElement("div",null,E.a.createElement(se.a,{type:"primary",size:"large",onClick:G},E.a.createElement(R.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),ne==="download"&&E.a.createElement(se.a,{type:"primary",size:"large",onClick:G},E.a.createElement(R.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(et,Ze,v){},qB8g:function(et,Ze,v){et.exports={flexRow:"flexRow___Aj71W",flexColumn:"flexColumn___2jvSr",formWrap:"formWrap___3OxLN",upload:"upload___2lUf4",color0152d9:"color0152d9___10ICR",colorCCC:"colorCCC___2mbRd",footerWrap:"footerWrap___1Ytvb",qrCode:"qrCode___2RFKG",a1:"a1___HdrHw",code:"code___17cwA",group:"group___DUj4t",groupNumber:"groupNumber___3_2zt",a2:"a2___2_e5C"}},"rAM+":function(et,Ze,v){"use strict";v.d(Ze,"a",function(){return se});var H=v("Qw5x");function se(re,ue){var D;if(typeof Symbol=="undefined"||re[Symbol.iterator]==null){if(Array.isArray(re)||(D=Object(H.a)(re))||ue&&re&&typeof re.length=="number"){D&&(re=D);var z=0,k=function(){};return{s:k,n:function(){return z>=re.length?{done:!0}:{done:!1,value:re[z++]}},e:function(C){throw C},f:k}}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 E=!0,I=!1,T;return{s:function(){D=re[Symbol.iterator]()},n:function(){var C=D.next();return E=C.done,C},e:function(C){I=!0,T=C},f:function(){try{!E&&D.return!=null&&D.return()}finally{if(I)throw T}}}}},rUJ1:function(et,Ze){const v=/[&<>"']/,H=/[&<>"']/g,se=/[<>"']|&(?!#?\w+;)/,re=/[<>"']|&(?!#?\w+;)/g,ue={"&":"&","<":"<",">":">",'"':""","'":"'"},D=xe=>ue[xe];function z(xe,Se){if(Se){if(v.test(xe))return xe.replace(H,D)}else if(se.test(xe))return xe.replace(re,D);return xe}const k=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function E(xe){return xe.replace(k,(Se,Oe)=>(Oe=Oe.toLowerCase(),Oe==="colon"?":":Oe.charAt(0)==="#"?Oe.charAt(1)==="x"?String.fromCharCode(parseInt(Oe.substring(2),16)):String.fromCharCode(+Oe.substring(1)):""))}const I=/(^|[^\[])\^/g;function T(xe,Se){xe=xe.source||xe,Se=Se||"";const Oe={replace:(Ee,O)=>(O=O.source||O,O=O.replace(I,"$1"),xe=xe.replace(Ee,O),Oe),getRegex:()=>new RegExp(xe,Se)};return Oe}const R=/[^\w:]/g,C=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function te(xe,Se,Oe){if(xe){let Ee;try{Ee=decodeURIComponent(E(Oe)).replace(R,"").toLowerCase()}catch(O){return null}if(Ee.indexOf("javascript:")===0||Ee.indexOf("vbscript:")===0||Ee.indexOf("data:")===0)return null}Se&&!C.test(Oe)&&(Oe=ce(Se,Oe));try{Oe=encodeURI(Oe).replace(/%25/g,"%")}catch(Ee){return null}return Oe}const Z={},B=/^[^:]+:\/*[^/]*$/,J=/^([^:]+:)[\s\S]*$/,F=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ce(xe,Se){Z[" "+xe]||(B.test(xe)?Z[" "+xe]=xe+"/":Z[" "+xe]=ye(xe,"/",!0)),xe=Z[" "+xe];const Oe=xe.indexOf(":")===-1;return Se.substring(0,2)==="//"?Oe?Se:xe.replace(J,"$1")+Se:Se.charAt(0)==="/"?Oe?Se:xe.replace(F,"$1")+Se:xe+Se}const ne={exec:function(){}};function Pe(xe){let Se=1,Oe,Ee;for(;Se<arguments.length;Se++){Oe=arguments[Se];for(Ee in Oe)Object.prototype.hasOwnProperty.call(Oe,Ee)&&(xe[Ee]=Oe[Ee])}return xe}function $e(xe,Se){const Oe=xe.replace(/\|/g,(de,Q,_)=>{let W=!1,j=Q;for(;--j>=0&&_[j]==="\\";)W=!W;return W?"|":" |"}),Ee=Oe.split(/ \|/);let O=0;if(Ee.length>Se)Ee.splice(Se);else for(;Ee.length<Se;)Ee.push("");for(;O<Ee.length;O++)Ee[O]=Ee[O].trim().replace(/\\\|/g,"|");return Ee}function ye(xe,Se,Oe){const Ee=xe.length;if(Ee===0)return"";let O=0;for(;O<Ee;){const de=xe.charAt(Ee-O-1);if(de===Se&&!Oe)O++;else if(de!==Se&&Oe)O++;else break}return xe.substr(0,Ee-O)}function Le(xe,Se){if(xe.indexOf(Se[1])===-1)return-1;const Oe=xe.length;let Ee=0,O=0;for(;O<Oe;O++)if(xe[O]==="\\")O++;else if(xe[O]===Se[0])Ee++;else if(xe[O]===Se[1]&&(Ee--,Ee<0))return O;return-1}function Fe(xe){xe&&xe.sanitize&&!xe.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")}et.exports={escape:z,unescape:E,edit:T,cleanUrl:te,resolveUrl:ce,noopTest:ne,merge:Pe,splitCells:$e,rtrim:ye,findClosingBracket:Le,checkSanitizeDeprecation:Fe}},rcnY:function(et,Ze,v){var H=v("aRTE");function se(re,ue){this.totalCount=re,this.dataCount=ue}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(re,ue){var D=se.getRsBlockTable(re,ue);if(D==null)throw new Error("bad rs block @ typeNumber:"+re+"/errorCorrectLevel:"+ue);for(var z=D.length/3,k=new Array,E=0;E<z;E++)for(var I=D[E*3+0],T=D[E*3+1],R=D[E*3+2],C=0;C<I;C++)k.push(new se(T,R));return k},se.getRsBlockTable=function(re,ue){switch(ue){case H.L:return se.RS_BLOCK_TABLE[(re-1)*4+0];case H.M:return se.RS_BLOCK_TABLE[(re-1)*4+1];case H.Q:return se.RS_BLOCK_TABLE[(re-1)*4+2];case H.H:return se.RS_BLOCK_TABLE[(re-1)*4+3];default:return}},et.exports=se},vHTk:function(et,Ze,v){et.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wU8J:function(et,Ze){function v(){this.buffer=new Array,this.length=0}v.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 re=0;re<se;re++)this.putBit((H>>>se-re-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++}},et.exports=v}}]);
|