(window.webpackJsonp=window.webpackJsonp||[]).push([[174,6,7,17],{"+NIl":function(ot,Je,x){(function(F){F(x("VrN/"))})(function(F){"use strict";F.defineMode("stex",function(le,ne){"use strict";function ge(Q,U){Q.cmdState.push(U)}function se(Q){return Q.cmdState.length>0?Q.cmdState[Q.cmdState.length-1]:null}function G(Q){var U=Q.cmdState.pop();U&&U.closeBracket()}function _(Q){for(var U=Q.cmdState,J=U.length-1;J>=0;J--){var Y=U[J];if(Y.name=="DEFAULT")continue;return Y}return{styleIdentifier:function(){return null}}}function I(Q,U,J){return function(){this.name=Q,this.bracketNo=0,this.style=U,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 k={};k.importmodule=I("importmodule","tag",["string","builtin"]),k.documentclass=I("documentclass","tag",["","atom"]),k.usepackage=I("usepackage","tag",["atom"]),k.begin=I("begin","tag",["atom"]),k.end=I("end","tag",["atom"]),k.label=I("label","tag",["atom"]),k.ref=I("ref","tag",["atom"]),k.eqref=I("eqref","tag",["atom"]),k.cite=I("cite","tag",["atom"]),k.bibitem=I("bibitem","tag",["atom"]),k.Bibitem=I("Bibitem","tag",["atom"]),k.RBibitem=I("RBibitem","tag",["atom"]),k.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function O(Q,U){Q.f=U}function T(Q,U){var J;if(Q.match(/^\\[a-zA-Z@]+/)){var Y=Q.current().slice(1);return J=k.hasOwnProperty(Y)?k[Y]:k.DEFAULT,J=new J,ge(U,J),O(U,ee),J.style}if(Q.match(/^\\[$&%#{}_]/))return"tag";if(Q.match(/^\\[,;!\/\\]/))return"tag";if(Q.match("\\["))return O(U,function(me,ze){return A(me,ze,"\\]")}),"keyword";if(Q.match("\\("))return O(U,function(me,ze){return A(me,ze,"\\)")}),"keyword";if(Q.match("$$"))return O(U,function(me,ze){return A(me,ze,"$$")}),"keyword";if(Q.match("$"))return O(U,function(me,ze){return A(me,ze,"$")}),"keyword";var he=Q.next();if(he=="%")return Q.skipToEnd(),"comment";if(he=="}"||he=="]"){if(J=se(U),J)J.closeBracket(he),O(U,ee);else return"error";return"bracket"}else return he=="{"||he=="["?(J=k.DEFAULT,J=new J,ge(U,J),"bracket"):/\d/.test(he)?(Q.eatWhile(/[\w.%]/),"atom"):(Q.eatWhile(/[\w\-_]/),J=_(U),J.name=="begin"&&(J.argument=Q.current()),J.styleIdentifier())}function A(Q,U,J){if(Q.eatSpace())return null;if(J&&Q.match(J))return O(U,T),"keyword";if(Q.match(/^\\[a-zA-Z@]+/))return"tag";if(Q.match(/^[a-zA-Z]+/))return"variable-2";if(Q.match(/^\\[$&%#{}_]/))return"tag";if(Q.match(/^\\[,;!\/]/))return"tag";if(Q.match(/^[\^_&]/))return"tag";if(Q.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(Q.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var Y=Q.next();return Y=="{"||Y=="}"||Y=="["||Y=="]"||Y=="("||Y==")"?"bracket":Y=="%"?(Q.skipToEnd(),"comment"):"error"}function ee(Q,U){var J=Q.peek(),Y;return J=="{"||J=="["?(Y=se(U),Y.openBracket(J),Q.eat(J),O(U,T),"bracket"):/[ \t\r]/.test(J)?(Q.eat(J),null):(O(U,T),G(U),T(Q,U))}return{startState:function(){var Q=ne.inMathMode?function(U,J){return A(U,J)}:T;return{cmdState:[],f:Q}},copyState:function(Q){return{cmdState:Q.cmdState.slice(),f:Q.f}},token:function(Q,U){return U.f(Q,U)},blankLine:function(Q){Q.f=T,Q.cmdState.length=0},lineComment:"%"}}),F.defineMIME("text/x-stex","stex"),F.defineMIME("text/x-latex","stex")})},"19Vz":function(ot,Je,x){(function(F){F(x("VrN/"))})(function(F){F.defineOption("placeholder","",function(I,k,O){var T=O&&O!=F.Init;if(k&&!T)I.on("blur",se),I.on("change",G),I.on("swapDoc",G),F.on(I.getInputField(),"compositionupdate",I.state.placeholderCompose=function(){ge(I)}),G(I);else if(!k&&T){I.off("blur",se),I.off("change",G),I.off("swapDoc",G),F.off(I.getInputField(),"compositionupdate",I.state.placeholderCompose),le(I);var A=I.getWrapperElement();A.className=A.className.replace(" CodeMirror-empty","")}k&&!I.hasFocus()&&se(I)});function le(I){I.state.placeholder&&(I.state.placeholder.parentNode.removeChild(I.state.placeholder),I.state.placeholder=null)}function ne(I){le(I);var k=I.state.placeholder=document.createElement("pre");k.style.cssText="height: 0; overflow: visible",k.style.direction=I.getOption("direction"),k.className="CodeMirror-placeholder CodeMirror-line-like";var O=I.getOption("placeholder");typeof O=="string"&&(O=document.createTextNode(O)),k.appendChild(O),I.display.lineSpace.insertBefore(k,I.display.lineSpace.firstChild)}function ge(I){setTimeout(function(){var k=!1,O=I.getInputField();O.nodeName=="TEXTAREA"?k=!O.value:I.lineCount()==1&&(k=!/[^\u200b]/.test(O.querySelector(".CodeMirror-line").textContent)),k?ne(I):le(I)},20)}function se(I){_(I)&&ne(I)}function G(I){var k=I.getWrapperElement(),O=_(I);k.className=k.className.replace(" CodeMirror-empty","")+(O?" CodeMirror-empty":""),O?ne(I):le(I)}function _(I){return I.lineCount()===1&&I.getLine(0)===""}})},"1eCo":function(ot,Je,x){(function(F){F(x("VrN/"))})(function(F){"use strict";var le={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},ne={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};F.defineMode("xml",function(ge,se){var G=ge.indentUnit,_={},I=se.htmlMode?le:ne;for(var k in I)_[k]=I[k];for(var k in se)_[k]=se[k];var O,T;function A(R,oe){function re(P){return oe.tokenize=P,P(R,oe)}var C=R.next();if(C=="<")return R.eat("!")?R.eat("[")?R.match("CDATA[")?re(U("atom","]]>")):null:R.match("--")?re(U("comment","-->")):R.match("DOCTYPE",!0,!0)?(R.eatWhile(/[\w\._\-]/),re(J(1))):null:R.eat("?")?(R.eatWhile(/[\w\._\-]/),oe.tokenize=U("meta","?>"),"meta"):(O=R.eat("/")?"closeTag":"openTag",oe.tokenize=ee,"tag bracket");if(C=="&"){var N;return R.eat("#")?R.eat("x")?N=R.eatWhile(/[a-fA-F\d]/)&&R.eat(";"):N=R.eatWhile(/[\d]/)&&R.eat(";"):N=R.eatWhile(/[\w\.\-:]/)&&R.eat(";"),N?"atom":"error"}else return R.eatWhile(/[^&<]/),null}A.isInText=!0;function ee(R,oe){var re=R.next();if(re==">"||re=="/"&&R.eat(">"))return oe.tokenize=A,O=re==">"?"endTag":"selfcloseTag","tag bracket";if(re=="=")return O="equals",null;if(re=="<"){oe.tokenize=A,oe.state=ze,oe.tagName=oe.tagStart=null;var C=oe.tokenize(R,oe);return C?C+" tag error":"tag error"}else return/[\'\"]/.test(re)?(oe.tokenize=Q(re),oe.stringStartCol=R.column(),oe.tokenize(R,oe)):(R.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Q(R){var oe=function(re,C){for(;!re.eol();)if(re.next()==R){C.tokenize=ee;break}return"string"};return oe.isInAttribute=!0,oe}function U(R,oe){return function(re,C){for(;!re.eol();){if(re.match(oe)){C.tokenize=A;break}re.next()}return R}}function J(R){return function(oe,re){for(var C;(C=oe.next())!=null;){if(C=="<")return re.tokenize=J(R+1),re.tokenize(oe,re);if(C==">")if(R==1){re.tokenize=A;break}else return re.tokenize=J(R-1),re.tokenize(oe,re)}return"meta"}}function Y(R,oe,re){this.prev=R.context,this.tagName=oe,this.indent=R.indented,this.startOfLine=re,(_.doNotIndent.hasOwnProperty(oe)||R.context&&R.context.noIndent)&&(this.noIndent=!0)}function he(R){R.context&&(R.context=R.context.prev)}function me(R,oe){for(var re;;){if(!R.context)return;if(re=R.context.tagName,!_.contextGrabbers.hasOwnProperty(re)||!_.contextGrabbers[re].hasOwnProperty(oe))return;he(R)}}function ze(R,oe,re){return R=="openTag"?(re.tagStart=oe.column(),Ye):R=="closeTag"?_e:ze}function Ye(R,oe,re){return R=="word"?(re.tagName=oe.current(),T="tag",Ee):_.allowMissingTagName&&R=="endTag"?(T="tag bracket",Ee(R,oe,re)):(T="error",Ye)}function _e(R,oe,re){if(R=="word"){var C=oe.current();return re.context&&re.context.tagName!=C&&_.implicitlyClosed.hasOwnProperty(re.context.tagName)&&he(re),re.context&&re.context.tagName==C||_.matchClosing===!1?(T="tag",ke):(T="tag error",Ue)}else return _.allowMissingTagName&&R=="endTag"?(T="tag bracket",ke(R,oe,re)):(T="error",Ue)}function ke(R,oe,re){return R!="endTag"?(T="error",ke):(he(re),ze)}function Ue(R,oe,re){return T="error",ke(R,oe,re)}function Ee(R,oe,re){if(R=="word")return T="attribute",Le;if(R=="endTag"||R=="selfcloseTag"){var C=re.tagName,N=re.tagStart;return re.tagName=re.tagStart=null,R=="selfcloseTag"||_.autoSelfClosers.hasOwnProperty(C)?me(re,C):(me(re,C),re.context=new Y(re,C,N==re.indented)),ze}return T="error",Ee}function Le(R,oe,re){return R=="equals"?Se:(_.allowMissing||(T="error"),Ee(R,oe,re))}function Se(R,oe,re){return R=="string"?ce:R=="word"&&_.allowUnquoted?(T="string",Ee):(T="error",Ee(R,oe,re))}function ce(R,oe,re){return R=="string"?ce:Ee(R,oe,re)}return{startState:function(R){var oe={tokenize:A,state:ze,indented:R||0,tagName:null,tagStart:null,context:null};return R!=null&&(oe.baseIndent=R),oe},token:function(R,oe){if(!oe.tagName&&R.sol()&&(oe.indented=R.indentation()),R.eatSpace())return null;O=null;var re=oe.tokenize(R,oe);return(re||O)&&re!="comment"&&(T=null,oe.state=oe.state(O||re,R,oe),T&&(re=T=="error"?re+" error":T)),re},indent:function(R,oe,re){var C=R.context;if(R.tokenize.isInAttribute)return R.tagStart==R.indented?R.stringStartCol+1:R.indented+G;if(C&&C.noIndent)return F.Pass;if(R.tokenize!=ee&&R.tokenize!=A)return re?re.match(/^(\s*)/)[0].length:0;if(R.tagName)return _.multilineTagIndentPastTag!==!1?R.tagStart+R.tagName.length+2:R.tagStart+G*(_.multilineTagIndentFactor||1);if(_.alignCDATA&&/$/,blockCommentStart:"",configuration:_.htmlMode?"html":"xml",helperType:_.htmlMode?"html":"xml",skipAttribute:function(R){R.state==Se&&(R.state=Ee)},xmlCurrentTag:function(R){return R.tagName?{name:R.tagName,close:R.type=="closeTag"}:null},xmlCurrentContext:function(R){for(var oe=[],re=R.context;re;re=re.prev)re.tagName&&oe.push(re.tagName);return oe.reverse()}}}),F.defineMIME("text/xml","xml"),F.defineMIME("application/xml","xml"),F.mimeModes.hasOwnProperty("text/html")||F.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"55Ip":function(ot,Je,x){"use strict";x.d(Je,"a",function(){return me}),x.d(Je,"b",function(){return Ee});var F=x("Ty5D"),le=x("dI71"),ne=x("q1tI"),ge=x.n(ne),se=x("YS25"),G=x("17x9"),_=x.n(G),I=x("wx14"),k=x("zLVn"),O=x("9R94"),T=function(Se){Object(le.a)(ce,Se);function ce(){for(var oe,re=arguments.length,C=new Array(re),N=0;N1&&arguments[1]!==void 0?arguments[1]:0,U=(_[ee[Q+0]]+_[ee[Q+1]]+_[ee[Q+2]]+_[ee[Q+3]]+"-"+_[ee[Q+4]]+_[ee[Q+5]]+"-"+_[ee[Q+6]]+_[ee[Q+7]]+"-"+_[ee[Q+8]]+_[ee[Q+9]]+"-"+_[ee[Q+10]]+_[ee[Q+11]]+_[ee[Q+12]]+_[ee[Q+13]]+_[ee[Q+14]]+_[ee[Q+15]]).toLowerCase();if(!G(U))throw TypeError("Stringified UUID is invalid");return U}var O=k;function T(ee,Q,U){ee=ee||{};var J=ee.random||(ee.rng||ne)();if(J[6]=J[6]&15|64,J[8]=J[8]&63|128,Q){U=U||0;for(var Y=0;Y<16;++Y)Q[U+Y]=J[Y];return Q}return O(J)}var A=Je.a=T},"7ahc":function(ot,Je,x){"use strict";x.d(Je,"a",function(){return Ye});var F=x("k1fw"),le=x("0Owb"),ne=x("+L6B"),ge=x("2/Rp"),se=x("y8nQ"),G=x("Vl3Y"),_=x("tJVT"),I=x("OaEy"),k=x("2fM7"),O=x("q1tI"),T=x.n(O),A=x("VrN/"),ee=x.n(A),Q=x("p77/"),U=x.n(Q),J=x("c5Ni"),Y=x.n(J),he=k.a.Option,me={labelCol:{span:4},wrapperCol:{span:20}},ze={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Je.b=function(_e){var ke=_e.callback,Ue=_e.onCancel,Ee=Object(O.useState)("python"),Le=Object(_.a)(Ee,2),Se=Le[0],ce=Le[1];function R(re){ce(ze[re][1])}function oe(re){ke(re)}return T.a.createElement(G.a,Object(le.a)({},me,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:oe}),T.a.createElement(G.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},T.a.createElement(k.a,{onChange:R},Object.keys(ze).map(function(re){return T.a.createElement(he,{key:re,value:re},ze[re][0])}))),T.a.createElement(G.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},T.a.createElement(Ye,{mode:Se})),T.a.createElement("div",{className:"flex-container flex-end"},T.a.createElement(ge.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(ge.a,{type:"ghost",onClick:Ue},"\u53D6\u6D88")))};function Ye(_e){var ke=_e.value,Ue=_e.onChange,Ee=_e.mode,Le=_e.options,Se=Le===void 0?{}:Le,ce=Object(O.useRef)(),R=Object(O.useState)(),oe=Object(_.a)(R,2),re=oe[0],C=oe[1];return Object(O.useEffect)(function(){if(re){function N(P){var w=P.getValue();Ue&&Ue(w)}return re.on("change",N),function(){re.off("change",N)}}},[re,Ue]),Object(O.useEffect)(function(){re&&re.setOption("mode",Ee)},[re,Ee]),Object(O.useEffect)(function(){re&&((ke!==re.getValue()||ke==="")&&setTimeout(function(){re.setValue(ke||" ")},300))},[re,ke]),Object(O.useEffect)(function(){if(ce.current&&!re){var N=ee.a.fromTextArea(ce.current,Object(F.a)({mode:Ee,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Se));C(N)}},[ce.current,re]),T.a.createElement("div",{className:"my-codemirror-container"},T.a.createElement("textarea",{ref:ce}))}},"7ixt":function(ot,Je,x){"use strict";x.d(Je,"a",function(){return ne});var F={adjustX:1,adjustY:1},le=[0,0],ne={left:{points:["cr","cl"],overflow:F,offset:[-4,0],targetOffset:le},right:{points:["cl","cr"],overflow:F,offset:[4,0],targetOffset:le},top:{points:["bc","tc"],overflow:F,offset:[0,-4],targetOffset:le},bottom:{points:["tc","bc"],overflow:F,offset:[0,4],targetOffset:le},topLeft:{points:["bl","tl"],overflow:F,offset:[0,-4],targetOffset:le},leftTop:{points:["tr","tl"],overflow:F,offset:[-4,0],targetOffset:le},topRight:{points:["br","tr"],overflow:F,offset:[0,-4],targetOffset:le},rightTop:{points:["tl","tr"],overflow:F,offset:[4,0],targetOffset:le},bottomRight:{points:["tr","br"],overflow:F,offset:[0,4],targetOffset:le},rightBottom:{points:["bl","br"],overflow:F,offset:[4,0],targetOffset:le},bottomLeft:{points:["tl","bl"],overflow:F,offset:[0,4],targetOffset:le},leftBottom:{points:["br","bl"],overflow:F,offset:[-4,0],targetOffset:le}},ge=ne},"8EBN":function(ot,Je,x){(function(F){F(x("VrN/"))})(function(F){"use strict";F.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 le=0;le-1&&ge.substring(_+1,ge.length);if(I)return F.findModeByExtension(I)},F.findModeByName=function(ge){ge=ge.toLowerCase();for(var se=0;se=u.length?g.slice(u.length):g}).join(` `)}var Y=[],he=["
    "],me=new Q.a.Renderer,ze=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Ye(){Y.length=0,he=["
      "]}var _e={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function ke(c,o,a,u){if(o>=c.length||c[o].level<=a)return o;var g=c[o];u.push("
    • "+g.text+""),o++;var h=[];return o=ke(c,o,g.level,h),h.length>0&&(u.push("
        "),h.forEach(function(X){u.push(X)}),u.push("
      ")),u.push("
    • "),o=ke(c,o,a,u),o}function Ue(){return ke(Y,0,0,he),he.push("
    "),he.join("")}var Ee={heading:function(o){var a=ze.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]||""),h=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(h)>=0){var X=ce(),je=g;g=X,R[X]={type:"block",expression:je}}return{type:"code",raw:u,lang:h,text:g}}}},Le=/(?:\${2})([^\n`]+?)(?:\${2})/gi,Se=0,ce=function(){return"__special_katext_id_".concat(Se++,"__")},R={};function oe(){return R}function re(){Se=0,R={}}function C(c){return c=c.replace(Le,function(o,a){var u=ce();return R[u]={type:"inline",expression:a},u}),c}var N=me.listitem;me.listitem=function(c){return N(C(c))};var P=me.paragraph;me.paragraph=function(c){return P(C(c))};var w=me.tablecell;me.tablecell=function(c,o){return w(C(c),o)},me.code=function(c,o,a){var u=(o||"").match(/\S*/)[0];return u?["latex","katex","math"].indexOf(u)>=0?"

    ".concat(c,"

    "):'
    ').concat(a?c:Object(U.escape)(c,!0),`
    `):'
    '+(a?c:Object(U.escape)(c,!0))+"
    "},me.heading=function(c,o,a){var u=this.options.headerPrefix+a.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return Y.push({anchor:u,level:o,text:c}),"'+c+""},Q.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),Q.a.use({tokenizer:Ee,renderer:me});var L=Q.a,p=x("SJMd"),d=x("ulZh"),E=x.n(d),H=x("m3rI"),$=x("Oy/b"),Ce=x("p5ED"),Me=x("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 be=function(c,o){return(be=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])})(c,o)};function xe(c,o){function a(){this.constructor=c}be(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function ue(c,o,a,u){return new(a||(a=Promise))(function(g,h){function X(ht){try{pe(u.next(ht))}catch(Fe){h(Fe)}}function je(ht){try{pe(u.throw(ht))}catch(Fe){h(Fe)}}function pe(ht){var Fe;ht.done?g(ht.value):(Fe=ht.value,Fe instanceof a?Fe:new a(function(wt){wt(Fe)})).then(X,je)}pe((u=u.apply(c,o||[])).next())})}function ve(c,o){var a,u,g,h,X={label:0,sent:function(){if(1&g[0])throw g[1];return g[1]},trys:[],ops:[]};return h={next:je(0),throw:je(1),return:je(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function je(pe){return function(ht){return function(Fe){if(a)throw new TypeError("Generator is already executing.");for(;X;)try{if(a=1,u&&(g=2&Fe[0]?u.return:Fe[0]?u.throw||((g=u.return)&&g.call(u),0):u.next)&&!(g=g.call(u,Fe[1])).done)return g;switch(u=0,g&&(Fe=[2&Fe[0],g.value]),Fe[0]){case 0:case 1:g=Fe;break;case 4:return X.label++,{value:Fe[1],done:!1};case 5:X.label++,u=Fe[1],Fe=[0];continue;case 7:Fe=X.ops.pop(),X.trys.pop();continue;default:if(!(g=X.trys,(g=g.length>0&&g[g.length-1])||Fe[0]!==6&&Fe[0]!==2)){X=0;continue}if(Fe[0]===3&&(!g||Fe[1]>g[0]&&Fe[1]',"select"),this.addActionButton(u,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(u,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(u,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(u,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(u,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(u,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(u,'',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(h){var X=document.createElement("div");X.className=""+a.toolbarButtonStyleClass.name,X.setAttribute("data-type-name",h.typeName),X.innerHTML=h.icon,X.addEventListener("click",function(){a.markerToolbarButtonClicked(X,h)}),a.buttons.push(X),a.markerButtons.push(X)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',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,'',"render"),this.addActionButton(g,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},c.prototype.addButtonClickListener=function(o){this.buttonClickListeners.push(o)},c.prototype.removeButtonClickListener=function(o){this.buttonClickListeners.indexOf(o)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(o),1)},c.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},c.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var o=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var a=0;a0&&this.buttonClickListeners.forEach(function(u){return u("marker",a)}),this.markerButtonOverflowBlock.style.display="none"},c.prototype.actionToolbarButtonClicked=function(o,a){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("action",a)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},c.prototype.setActiveButton=function(o){this.resetButtonStyles(),o.className=o.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),o.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},c.prototype.setActiveMarkerButton=function(o){var a=this.markerButtons.find(function(u){return u.getAttribute("data-type-name")===o});a&&this.setActiveButton(a)},c.prototype.setCurrentMarker=function(o){var a=this;this.currentMarker=o,this.buttons.filter(function(u){return/delete|notes/.test(u.getAttribute("data-action"))}).forEach(function(u){a.currentMarker===void 0?(u.style.fillOpacity="0.4",u.style.pointerEvents="none"):(u.style.fillOpacity="1",u.style.pointerEvents="all")})},c}(),Ne=function(){function c(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 c.prototype.addStyles=function(){var o;this.toolboxStyleClass=this.styles.addClass(new ie("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 ie("toolbox_colors",` color: `+this.uiStyleSettings.toolboxColor+`; `));var a=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ie("toolbox-button-row",` display: flex; cursor: default; box-sizing: content-box; `)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ie("toolbox-button-row_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`; `)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ie("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 ie("toolbox-panel-row_colors",` background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`; `)),this.toolboxButtonStyleClass=this.styles.addClass(new ie("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 ie("toolbox-button_colors",` fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ie("toolbox-active-button_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`; fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.styles.addRule(new we("."+this.toolboxButtonStyleColorsClass.name+":hover",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+` `)),this.styles.addRule(new we("."+this.toolboxButtonStyleClass.name+" svg",` height: `+this.uiStyleSettings.toolbarHeight/2+`px; `))},c.prototype.show=function(o){var a;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolboxStyleClass.name+" "+((a=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&a!==void 0?a:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},c.prototype.setPanelButtons=function(o){var a,u,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(h){var X;h.uiStyleSettings=g.uiStyleSettings;var je=document.createElement("div");je.className=g.toolboxButtonStyleClass.name+" "+((X=g.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&X!==void 0?X:g.toolboxButtonStyleColorsClass.name),je.innerHTML=h.icon,je.title=h.title,je.addEventListener("click",function(){g.panelButtonClick(h)}),g.panelButtons.push(je),g.buttonRow.appendChild(je)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},c.prototype.panelButtonClick=function(o){var a=this,u=-1;if(o!==this.activePanel){u=this.panels.indexOf(o),this.panelRow.innerHTML="";var 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(h,X){var je,pe;h.className=a.toolboxButtonStyleClass.name+" "+(X===u?""+((je=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&je!==void 0?je:a.toolboxActiveButtonStyleColorsClass.name):""+((pe=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&pe!==void 0?pe:a.toolboxButtonStyleColorsClass.name))})},c}(),He=function(c,o){this.title=c,this.icon=o},Ie=function(c){function o(a,u,g,h){var X=c.call(this,a,h||'')||this;return X.colors=[],X.addTransparent=!1,X.colorBoxes=[],X.colors=u,X.currentColor=g,X.setCurrentColor=X.setCurrentColor.bind(X),X.getColorBox=X.getColorBox.bind(X),X}return xe(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.whiteSpace="nowrap",this.colors.forEach(function(g){var h=a.getColorBox(g);u.appendChild(h),a.colorBoxes.push(h)}),u},o.prototype.getColorBox=function(a){var u=this,g=this.uiStyleSettings.toolbarHeight/4,h=this.uiStyleSettings.toolbarHeight-g,X=document.createElement("div");X.style.display="inline-block",X.style.boxSizing="content-box",X.style.width=h-2+"px",X.style.height=h-2+"px",X.style.padding="1px",X.style.marginRight="2px",X.style.marginBottom="2px",X.style.borderWidth="2px",X.style.borderStyle="solid",X.style.borderRadius=(h+2)/2+"px",X.style.borderColor=a===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){u.setCurrentColor(a,X)});var je=document.createElement("div");return je.style.display="inline-block",je.style.width=h-2+"px",je.style.height=h-2+"px",je.style.backgroundColor=a,je.style.borderRadius=h/2+"px",a==="transparent"&&(je.style.fill=this.uiStyleSettings.toolboxAccentColor,je.innerHTML=` `),X.appendChild(je),X},o.prototype.setCurrentColor=function(a,u){var g=this;this.currentColor=a,this.colorBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(a)},o}(He),Re=function(){function c(o,a,u){this._state="new",this._isSelected=!1,this._container=o,this._overlayContainer=a,this.globalSettings=u,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(c.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),c.prototype.ownsTarget=function(o){return!1},Object.defineProperty(c.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),c.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},c.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},c.prototype.pointerDown=function(o,a){},c.prototype.dblClick=function(o,a){},c.prototype.manipulate=function(o){},c.prototype.pointerUp=function(o){this.stateChanged()},c.prototype.dispose=function(){},c.prototype.addMarkerVisualToContainer=function(o){this.container.childNodes.length>0?this.container.insertBefore(o,this.container.childNodes[0]):this.container.appendChild(o)},c.prototype.getState=function(){return{typeName:c.typeName,state:this.state,notes:this.notes}},c.prototype.restoreState=function(o){this._state=o.state,this.notes=o.notes},c.prototype.scale=function(o,a){},c.prototype.colorChanged=function(o){this.onColorChanged&&this.onColorChanged(o),this.stateChanged()},c.prototype.fillColorChanged=function(o){this.onFillColorChanged&&this.onFillColorChanged(o),this.stateChanged()},c.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var o=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),o.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(o)&&this.onStateChanged(this)}},c.typeName="MarkerBase",c}(),Be=function(){function c(){this.findGripByVisual=this.findGripByVisual.bind(this)}return c.prototype.findGripByVisual=function(o){return this.topLeft.ownsTarget(o)?this.topLeft:this.topCenter.ownsTarget(o)?this.topCenter:this.topRight.ownsTarget(o)?this.topRight:this.centerLeft.ownsTarget(o)?this.centerLeft:this.centerRight.ownsTarget(o)?this.centerRight:this.bottomLeft.ownsTarget(o)?this.bottomLeft:this.bottomCenter.ownsTarget(o)?this.bottomCenter:this.bottomRight.ownsTarget(o)?this.bottomRight:void 0},c}(),Ze=function(){function c(){this.GRIP_SIZE=10,this.visual=z.createGroup(),this.visual.appendChild(z.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(z.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return c.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},c}(),at=function(){function c(){}return c.toITransformMatrix=function(o){return{a:o.a,b:o.b,c:o.c,d:o.d,e:o.e,f:o.f}},c.toSVGMatrix=function(o,a){return o.a=a.a,o.b=a.b,o.c=a.c,o.d=a.d,o.e=a.e,o.f=a.f,o},c}(),et=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.left=0,h.top=0,h.width=0,h.height=0,h.defaultSize={x:50,y:20},h.offsetX=0,h.offsetY=0,h.rotationAngle=0,h.CB_DISTANCE=10,h._suppressMarkerCreateEvent=!1,h.container.transform.baseVal.appendItem(z.createTransform()),h.setupControlBox(),h}return xe(o,c),Object.defineProperty(o.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"visual",{get:function(){return this._visual},set:function(a){this._visual=a;var u=z.createTransform();this._visual.transform.baseVal.appendItem(u)},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!!c.prototype.ownsTarget.call(this,a)||!!(this.controlGrips.findGripByVisual(a)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(a))},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.left=a.x,this.top=a.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var 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 h=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=h.x-this.width/2,this.top=h.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var X=this.container.transform.baseVal.getItem(0);X.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(X,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},o.prototype.pointerUp=function(a){var u=this.state;c.prototype.pointerUp.call(this,a),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},o.prototype.moveVisual=function(a){this.visual.style.transform="translate("+a.x+"px, "+a.y+"px)"},o.prototype.manipulate=function(a){var u=this.unrotatePoint(a);this.state==="creating"?this.resize(a):this.state==="move"?(this.left=this.manipulationStartLeft+(u.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(u.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(u):this.state==="rotate"&&this.rotate(a)},o.prototype.resize=function(a){var u=this.manipulationStartLeft,g=this.manipulationStartWidth,h=this.manipulationStartTop,X=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:h=this.manipulationStartTop+a.y-this.manipulationStartY,X=this.manipulationStartHeight+this.manipulationStartTop-h;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:X=this.manipulationStartHeight+a.y-this.manipulationStartY}g>=0?(this.left=u,this.width=g):(this.left=u+g,this.width=-g),X>=0?(this.top=h,this.height=X):(this.top=h+X,this.height=-X),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=z.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=z.createPoint(a.x,a.y);return{x:(g=g.matrixTransform(u)).x,y:g.y}},o.prototype.select=function(){c.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){c.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=z.createGroup();var a=z.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=z.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=z.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new 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 Ze;return a.visual.transform.baseVal.appendItem(z.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.controlGrips.topLeft.GRIP_SIZE,u=-a/2,g=u,h=(this.width+this.CB_DISTANCE)/2-a/2,X=(this.height+this.CB_DISTANCE)/2-a/2,je=this.height+this.CB_DISTANCE-a/2,pe=this.width+this.CB_DISTANCE-a/2;this.positionGrip(this.controlGrips.topLeft.visual,u,g),this.positionGrip(this.controlGrips.topCenter.visual,h,g),this.positionGrip(this.controlGrips.topRight.visual,pe,g),this.positionGrip(this.controlGrips.centerLeft.visual,u,X),this.positionGrip(this.controlGrips.centerRight.visual,pe,X),this.positionGrip(this.controlGrips.bottomLeft.visual,u,je),this.positionGrip(this.controlGrips.bottomCenter.visual,h,je),this.positionGrip(this.controlGrips.bottomRight.visual,pe,je),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,h,g-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(a,u,g){var h=a.transform.baseVal.getItem(0);h.setTranslate(u,g),a.transform.baseVal.replaceItem(h,0)},o.prototype.hideControlBox=function(){this.controlBox.style.display="none"},o.prototype.showControlBox=function(){this.controlBox.style.display=""},o.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:at.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:at.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},c.prototype.getState.call(this))},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.left=u.left,this.top=u.top,this.width=u.width,this.height=u.height,this.rotationAngle=u.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(at.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(at.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u);var g=this.rotatePoint({x:this.left,y:this.top}),h=this.unrotatePoint({x:g.x*a,y:g.y*u});this.left=h.x,this.top=h.y,this.width=this.width*a,this.height=this.height*u,this.adjustControlBox()},o}(Re),nt=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.fillColor="transparent",h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.opacity=1,h.setStrokeColor=h.setStrokeColor.bind(h),h.setFillColor=h.setFillColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.createVisual=h.createVisual.bind(h),h}return xe(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=z.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){c.prototype.setSize.call(this),z.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){c.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&z.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&z.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&z.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&z.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},c.prototype.getState.call(this))},o.prototype.restoreState=function(a){var u=a;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),c.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.setSize()},o.title="Rectangle marker",o}(et),pt=function(c){function o(a,u,g,h){var X=c.call(this,a,h||'')||this;return X.widths=[],X.widthBoxes=[],X.widths=u,X.currentWidth=g,X.setCurrentWidth=X.setCurrentWidth.bind(X),X}return xe(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.widths.forEach(function(g){var h=document.createElement("div");h.style.display="flex",h.style.flexGrow="2",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.borderColor=g===a.currentWidth?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentWidth(g,h)}),u.appendChild(h);var X=document.createElement("div");X.innerText=g.toString(),X.style.marginRight="5px",h.appendChild(X);var je=document.createElement("div");je.style.minHeight="20px",je.style.flexGrow="2",je.style.display="flex",je.style.alignItems="center";var pe=document.createElement("hr");pe.style.minWidth="20px",pe.style.border="0px",pe.style.borderTop=g+"px solid "+a.uiStyleSettings.toolboxColor,pe.style.flexGrow="2",je.appendChild(pe),h.appendChild(je),a.widthBoxes.push(h)}),u},o.prototype.setCurrentWidth=function(a,u){var g=this;this.currentWidth=a,this.widthBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(He),ut=function(c){function o(a,u,g,h){var X=c.call(this,a,h||'')||this;return X.styles=[],X.styleBoxes=[],X.styles=u,X.currentStyle=g,X.setCurrentStyle=X.setCurrentStyle.bind(X),X}return xe(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.styles.forEach(function(g){var h=document.createElement("div");h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.overflow="hidden",h.style.maxWidth=100/a.styles.length-5+"%",h.style.borderColor=g===a.currentStyle?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentStyle(g,h)}),u.appendChild(h);var X=document.createElement("div");X.style.minHeight="20px",X.style.flexGrow="2",X.style.overflow="hidden";var je=` `;X.innerHTML=je,h.appendChild(X),a.styleBoxes.push(h)}),u},o.prototype.setCurrentStyle=function(a,u){var g=this;this.currentStyle=a,this.styleBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(He),it=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.strokeColor=g.defaultColor,h.strokeWidth=g.defaultStrokeWidth,h.strokeDasharray=g.defaultStrokeDasharray,h.strokePanel=new Ie("Line color",g.defaultColorSet,g.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new pt("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new ut("Line style",g.defaultStrokeDasharrays,g.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return xe(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="FrameMarker",o.title="Frame marker",o.icon='',o}(nt),Oe=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},vt=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.x1=0,h.y1=0,h.x2=0,h.y2=0,h.defaultLength=50,h.manipulationStartX=0,h.manipulationStartY=0,h.manipulationStartX1=0,h.manipulationStartY1=0,h.manipulationStartX2=0,h.manipulationStartY2=0,h.setupControlBox(),h}return xe(o,c),o.prototype.ownsTarget=function(a){return!!c.prototype.ownsTarget.call(this,a)||!(!this.grip1.ownsTarget(a)&&!this.grip2.ownsTarget(a))},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.manipulationStartX=a.x,this.manipulationStartY=a.y,this.state==="new"&&(this.x1=a.x,this.y1=a.y,this.x2=a.x,this.y2=a.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(u)?this.activeGrip=this.grip1:this.grip2.ownsTarget(u)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},o.prototype.pointerUp=function(a){var u=this.state;c.prototype.pointerUp.call(this,a),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},o.prototype.adjustVisual=function(){},o.prototype.manipulate=function(a){this.state==="creating"?this.resize(a):this.state==="move"?(this.x1=this.manipulationStartX1+a.x-this.manipulationStartX,this.y1=this.manipulationStartY1+a.y-this.manipulationStartY,this.x2=this.manipulationStartX2+a.x-this.manipulationStartX,this.y2=this.manipulationStartY2+a.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(a)},o.prototype.resize=function(a){switch(this.activeGrip){case this.grip1:this.x1=a.x,this.y1=a.y;break;case this.grip2:case void 0:this.x2=a.x,this.y2=a.y}this.adjustVisual(),this.adjustControlBox()},o.prototype.select=function(){c.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){c.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=z.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},o.prototype.adjustControlBox=function(){this.positionGrips()},o.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},o.prototype.createGrip=function(){var a=new Ze;return a.visual.transform.baseVal.appendItem(z.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-a/2,this.y1-a/2),this.positionGrip(this.grip2.visual,this.x2-a/2,this.y2-a/2)},o.prototype.positionGrip=function(a,u,g){var h=a.transform.baseVal.getItem(0);h.setTranslate(u,g),a.transform.baseVal.replaceItem(h,0)},o.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},c.prototype.getState.call(this))},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.x1=u.x1,this.y1=u.y1,this.x2=u.x2,this.y2=u.y2},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.x1=this.x1*a,this.y1=this.y1*u,this.x2=this.x2*a,this.y2=this.y2*u,this.adjustVisual(),this.adjustControlBox()},o}(Re),st=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.setStrokeColor=h.setStrokeColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.strokeColor=g.defaultColor,h.strokeWidth=g.defaultStrokeWidth,h.strokeDasharray=g.defaultStrokeDasharray,h.strokePanel=new Ie("Line color",g.defaultColorSet,g.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new pt("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new ut("Line style",g.defaultStrokeDasharrays,g.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return xe(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorLine&&a!==this.visibleLine)},o.prototype.createVisual=function(){this.visual=z.createGroup(),this.selectorLine=z.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=z.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},o.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),z.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),z.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),z.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.createVisual(),this.adjustVisual()},o.typeName="LineMarker",o.title="Line marker",o.icon='',o}(vt),Pe=function(c){function o(a,u,g,h){var X=c.call(this,a,h||'')||this;return X.fonts=[],X.fontBoxes=[],X.fonts=u,X.currentFont=g,X.setCurrentFont=X.setCurrentFont.bind(X),X}return xe(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.flexGrow="2",this.fonts.forEach(function(g){var h=document.createElement("div");h.style.display="inline-block",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.overflow="hidden",h.style.maxWidth=100/a.fonts.length-5+"%",h.style.borderColor=g===a.currentFont?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentFont(g,h)}),u.appendChild(h);var X=document.createElement("div");X.style.display="flex",X.style.minHeight="20px",X.style.flexGrow="2",X.style.fontFamily=g,X.style.overflow="hidden";var je=document.createElement("div");je.style.whiteSpace="nowrap",je.style.overflow="hidden",je.style.textOverflow="ellipsis",je.innerHTML="The quick brown fox jumps over the lazy dog",X.appendChild(je),h.appendChild(X),a.fontBoxes.push(h)}),u},o.prototype.setCurrentFont=function(a,u){var g=this;this.currentFont=a,this.fontBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(He),Xe=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.color="transparent",h.padding=5,h.DEFAULT_TEXT="your text here",h.text=h.DEFAULT_TEXT,h.isMoved=!1,h.color=g.defaultColor,h.fontFamily=g.defaultFontFamily,h.defaultSize={x:100,y:30},h.setColor=h.setColor.bind(h),h.setFont=h.setFont.bind(h),h.renderText=h.renderText.bind(h),h.sizeText=h.sizeText.bind(h),h.textEditDivClicked=h.textEditDivClicked.bind(h),h.showTextEditor=h.showTextEditor.bind(h),h.setSize=h.setSize.bind(h),h.positionTextEditor=h.positionTextEditor.bind(h),h.colorPanel=new Ie("Color",g.defaultColorSet,g.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.fontFamilyPanel=new Pe("Font",g.defaultFontFamilies,g.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h}return xe(o,c),o.prototype.ownsTarget=function(a){if(c.prototype.ownsTarget.call(this,a)||a===this.visual||a===this.textElement||a===this.bgRectangle)return!0;var u=!1;return this.textElement.childNodes.forEach(function(g){g===a&&(u=!0)}),u},o.prototype.createVisual=function(){this.visual=z.createGroup(),this.bgRectangle=z.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=z.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(z.createTransform()),this.textElement.transform.baseVal.appendItem(z.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.isMoved=!1,this.pointerDownPoint=a,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.renderText=function(){var a=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(u){a.textElement.appendChild(z.createTSpan(u.trim()===""?" ":u.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},o.prototype.getTextScale=function(){var a=this.textElement.getBBox(),u=1;if(a.width>0&&a.height>0){var g=(1*this.width-this.width*this.padding*2/100)/a.width,h=(1*this.height-this.height*this.padding*2/100)/a.height;u=Math.min(g,h)}return u},o.prototype.getTextPosition=function(a){var u=this.textElement.getBBox(),g=0,h=0;return u.width>0&&u.height>0&&(g=(this.width-u.width*a)/2,h=this.height/2-u.height*a/2),{x:g,y:h}},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){c.prototype.manipulate.call(this,a),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(a.x-this.pointerDownPoint.x)>5||Math.abs(a.y-this.pointerDownPoint.y)>5)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.isMoved=!0,this.setSize(),this.sizeText()},o.prototype.setSize=function(){c.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(z.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),z.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},o.prototype.pointerUp=function(a){var u=this.state;u==="creating"&&(this._suppressMarkerCreateEvent=!0),c.prototype.pointerUp.call(this,a),this.setSize(),(u==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},o.prototype.showTextEditor=function(){var a=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(u){u.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var u=Number.parseFloat(a.textEditor.style.fontSize);a.textEditor.clientWidth>=Number.parseInt(a.textEditor.style.maxWidth)&&u>.9;)u-=.1,a.textEditor.style.fontSize=Math.max(u,.9)+"em"}),this.textEditor.addEventListener("keyup",function(u){u.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(u){if(u.clipboardData){var g=u.clipboardData.getData("text"),h=window.getSelection();if(!h.rangeCount)return!1;h.deleteFromDocument(),h.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(),h={x:g.width*a,y:g.height*a};u.x-=h.x/2,u.y-=h.y/2,this.textEditor.style.top=u.y+"px",this.textEditor.style.left=u.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-u.x+"px",this.textEditor.style.fontSize=Math.max(16*a,12)+"px",this.textElement.style.display="none"}},o.prototype.textEditDivClicked=function(a){this.text=a.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},o.prototype.select=function(){c.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},o.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),c.prototype.deselect.call(this)},o.prototype.dblClick=function(a,u){c.prototype.dblClick.call(this,a,u),this.showTextEditor()},o.prototype.setColor=function(a){this.textElement&&z.setAttributes(this.textElement,[["fill",a]]),this.color=a,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(a)},o.prototype.setFont=function(a){this.textElement&&z.setAttributes(this.textElement,[["font-family",a]]),this.fontFamily=a,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},o.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},o.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.color=u.color,this.fontFamily=u.fontFamily,this.padding=u.padding,this.text=u.text,this.createVisual(),c.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.setSize(),this.sizeText(),this.positionTextEditor()},o.typeName="TextMarker",o.title="Text marker",o.icon='',o}(et),te=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.color="transparent",h.lineWidth=3,h.drawing=!1,h.pixelRatio=1,h.color=g.defaultColor,h.lineWidth=g.defaultStrokeWidth,h.pixelRatio=g.freehandPixelRatio,h.setColor=h.setColor.bind(h),h.addCanvas=h.addCanvas.bind(h),h.finishCreation=h.finishCreation.bind(h),h.setLineWidth=h.setLineWidth.bind(h),h.colorPanel=new Ie("Color",g.defaultColorSet,g.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.lineWidthPanel=new pt("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),h.lineWidthPanel.onWidthChanged=h.setLineWidth,h}return xe(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.drawingImage)},o.prototype.createVisual=function(){this.visual=z.createGroup(),this.drawingImage=z.createImage(),this.visual.appendChild(this.drawingImage);var a=z.createTransform();this.visual.transform.baseVal.appendItem(a),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(a.x,a.y),this.drawing=!0):c.prototype.pointerDown.call(this,a,u)},o.prototype.manipulate=function(a){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(a.x,a.y),this.canvasContext.stroke()):c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),z.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),z.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):c.prototype.pointerUp.call(this,a)},o.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},o.prototype.select=function(){this.state==="creating"&&this.finishCreation(),c.prototype.select.call(this)},o.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),c.prototype.deselect.call(this)},o.prototype.finishCreation=function(){for(var a=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),u=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],g=u[0],h=u[1],X=u[2],je=u[3],pe=!1,ht=0;ht0&&(pe=!0,htje&&(je=ht),Fe>X&&(X=Fe));if(pe){this.left=g/this.pixelRatio,this.top=h/this.pixelRatio,this.width=(X-g)/this.pixelRatio,this.height=(je-h)/this.pixelRatio;var wt=document.createElement("canvas");wt.width=X-g,wt.height=je-h,wt.getContext("2d").putImageData(this.canvasContext.getImageData(g,h,X-g,je-h),0,0),this.drawingImgUrl=wt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){z.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),z.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},o.prototype.setColor=function(a){this.color=a,this.colorChanged(a)},o.prototype.setLineWidth=function(a){this.lineWidth=a},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({drawingImgUrl:this.drawingImgUrl},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){this.createVisual(),c.prototype.restoreState.call(this,a),this.drawingImgUrl=a.drawingImgUrl,this.setDrawingImage()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.setDrawingImage()},o.typeName="FreehandMarker",o.title="Freehand marker",o.icon='',o}(et),K=function(c){function o(a,u,g){var h=c.call(this,a,g||'')||this;return h.typeBoxes=[],h.currentType=u,h.setCurrentType=h.setCurrentType.bind(h),h}return xe(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2";for(var g=function(je){var pe="both";switch(je){case 0:pe="both";break;case 1:pe="start";break;case 2:pe="end";break;case 3:pe="none"}var ht=document.createElement("div");if(ht.style.display="flex",ht.style.flexGrow="2",ht.style.alignItems="center",ht.style.justifyContent="space-between",ht.style.padding="5px",ht.style.borderWidth="2px",ht.style.borderStyle="solid",ht.style.borderColor=pe===h.currentType?h.uiStyleSettings.toolboxAccentColor:"transparent",ht.addEventListener("click",function(){a.setCurrentType(pe,ht)}),u.appendChild(ht),pe==="both"||pe==="start"){var Fe=document.createElement("div");Fe.style.display="flex",Fe.style.alignItems="center",Fe.style.minHeight="20px",Fe.innerHTML=` `,Fe.style.marginLeft="5px",ht.appendChild(Fe)}var wt=document.createElement("div");wt.style.display="flex",wt.style.alignItems="center",wt.style.minHeight="20px",wt.style.flexGrow="2";var Pt=document.createElement("hr");if(Pt.style.minWidth="20px",Pt.style.border="0px",Pt.style.borderTop="3px solid "+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee"),Pt.style.flexGrow="2",wt.appendChild(Pt),ht.appendChild(wt),pe==="both"||pe==="end"){var Ht=document.createElement("div");Ht.style.display="flex",Ht.style.alignItems="center",Ht.style.minHeight="20px",Ht.innerHTML=` `,Ht.style.marginRight="5px",ht.appendChild(Ht)}h.typeBoxes.push(ht)},h=this,X=0;X<4;X++)g(X);return u},o.prototype.setCurrentType=function(a,u){var g=this;this.currentType=a,this.typeBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings!==void 0?g.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(He),q=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.arrowType="end",h.arrowBaseHeight=10,h.arrowBaseWidth=10,h.getArrowPoints=h.getArrowPoints.bind(h),h.setArrowType=h.setArrowType.bind(h),h.arrowTypePanel=new K("Arrow type","end"),h.arrowTypePanel.onArrowTypeChanged=h.setArrowType,h}return xe(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.arrow1&&a!==this.arrow2)},o.prototype.getArrowPoints=function(a,u){var g=this.arrowBaseWidth+2*this.strokeWidth,h=this.arrowBaseHeight+2*this.strokeWidth;return a-g/2+","+(u+h/2)+" "+a+","+(u-h/2)+" "+(a+g/2)+","+(u+h/2)},o.prototype.createTips=function(){this.arrow1=z.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(z.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=z.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(z.createTransform()),this.visual.appendChild(this.arrow2)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(c.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",z.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),z.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var a=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),u=this.arrow1.transform.baseVal.getItem(0);u.setRotate(a,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(u,0);var 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},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.arrowType=u.arrowType,this.createTips(),this.adjustVisual()},o.typeName="ArrowMarker",o.title="Arrow marker",o.icon='',o}(st),y=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.fillColor=g.defaultFillColor,h.strokeWidth=0,h.fillPanel=new Ie("Color",g.defaultColorSet,g.defaultFillColor),h.fillPanel.onColorChanged=h.setFillColor,h}return xe(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="CoverMarker",o.title="Cover marker",o.icon='',o}(nt),S=function(c){function o(a,u,g,h){var X=c.call(this,a,h||'')||this;return X.opacities=[],X.opacityBoxes=[],X.opacities=u,X.currentOpacity=g,X.setCurrentOpacity=X.setCurrentOpacity.bind(X),X}return xe(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",u.style.justifyContent="space-between",this.opacities.forEach(function(g){var h=document.createElement("div");h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="center",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.borderColor=g===a.currentOpacity?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentOpacity(g,h)}),u.appendChild(h);var X=document.createElement("div");X.innerText=100*g+"%",h.appendChild(X),a.opacityBoxes.push(h)}),u},o.prototype.setCurrentOpacity=function(a,u){var g=this;this.currentOpacity=a,this.opacityBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(He),D=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.setOpacity=h.setOpacity.bind(h),h.fillColor=g.defaultHighlightColor,h.strokeWidth=0,h.opacity=g.defaultHighlightOpacity,h.fillPanel=new Ie("Color",g.defaultColorSet,h.fillColor),h.fillPanel.onColorChanged=h.setFillColor,h.opacityPanel=new S("Opacity",g.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return xe(o,c),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&z.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="HighlightMarker",o.title="Highlight marker",o.icon='',o}(y),j='',fe=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.bgColor="transparent",h.tipPosition={x:0,y:0},h.tipBase1Position={x:0,y:0},h.tipBase2Position={x:0,y:0},h.tipMoving=!1,h.color=g.defaultStrokeColor,h.bgColor=g.defaultFillColor,h.fontFamily=g.defaultFontFamily,h.defaultSize={x:100,y:30},h.setBgColor=h.setBgColor.bind(h),h.getTipPoints=h.getTipPoints.bind(h),h.positionTip=h.positionTip.bind(h),h.setTipPoints=h.setTipPoints.bind(h),h.colorPanel=new Ie("Text color",g.defaultColorSet,h.color,''),h.colorPanel.onColorChanged=h.setColor,h.bgColorPanel=new Ie("Fill color",g.defaultColorSet,h.bgColor,j),h.bgColorPanel.onColorChanged=h.setBgColor,h.fontFamilyPanel=new Pe("Font",g.defaultFontFamilies,g.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h.tipGrip=new Ze,h.tipGrip.visual.transform.baseVal.appendItem(z.createTransform()),h.controlBox.appendChild(h.tipGrip.visual),h}return xe(o,c),o.prototype.ownsTarget=function(a){return c.prototype.ownsTarget.call(this,a)||this.tipGrip.ownsTarget(a)||this.tip===a},o.prototype.createTip=function(){z.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=z.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},o.prototype.pointerDown=function(a,u){this.state==="new"&&c.prototype.pointerDown.call(this,a,u),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(u)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):c.prototype.pointerDown.call(this,a,u)},o.prototype.pointerUp=function(a){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,c.prototype.pointerUp.call(this,a);else{var u=this.state==="creating";c.prototype.pointerUp.call(this,a),this.setTipPoints(u),this.positionTip()}},o.prototype.manipulate=function(a){if(this.tipMoving){var u=this.unrotatePoint(a);this.tipPosition={x:u.x-this.manipulationStartLeft,y:u.y-this.manipulationStartTop},this.positionTip()}else c.prototype.manipulate.call(this,a)},o.prototype.setBgColor=function(a){this.bgRectangle&&this.tip&&(z.setAttributes(this.bgRectangle,[["fill",a]]),z.setAttributes(this.tip,[["fill",a]])),this.bgColor=a,this.fillColorChanged(a)},o.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},o.prototype.setTipPoints=function(a){a===void 0&&(a=!1);var u=Math.min(this.height/2,15),g=this.height/5;a&&(this.tipPosition={x:u+g/2,y:this.height+20});var h=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?h.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=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a),this.createTips(),this.adjustVisual()},o.typeName="MeasurementMarker",o.title="Measurement marker",o.icon='',o}(st),yt=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.strokePanel.colors=g.defaultColorSet,h.fillColor="transparent",h}return xe(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="EllipseFrameMarker",o.title="Ellipse frame marker",o.icon='',o}(Ae),Tt=function(){function c(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(c.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),c.prototype.addUndoStep=function(o){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(o)||(this.undoStack.push(o),JSON.stringify(this.lastRedoStep)!==JSON.stringify(o)&&this.redoStack.splice(0,this.redoStack.length))},c.prototype.replaceLastUndoStep=function(o){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=o)},c.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},c.prototype.undo=function(){if(this.undoStack.length>1){var o=this.undoStack.pop();return o!==void 0&&this.redoStack.push(o),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},c.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},c}(),Ge=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.curveX=0,h.curveY=0,h.manipulationStartCurveX=0,h.manipulationStartCurveY=0,h.setStrokeColor=h.setStrokeColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.positionGrips=h.positionGrips.bind(h),h.addControlGrips=h.addControlGrips.bind(h),h.adjustVisual=h.adjustVisual.bind(h),h.setupControlBox=h.setupControlBox.bind(h),h.resize=h.resize.bind(h),h.strokeColor=g.defaultColor,h.strokeWidth=g.defaultStrokeWidth,h.strokeDasharray=g.defaultStrokeDasharray,h.strokePanel=new Ie("Line color",g.defaultColorSet,g.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new pt("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new ut("Line style",g.defaultStrokeDasharrays,g.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return xe(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorCurve&&a!==this.visibleCurve&&!this.curveGrip.ownsTarget(a))},o.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},o.prototype.createVisual=function(){this.visual=z.createGroup(),this.selectorCurve=z.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=z.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=a.x,this.curveY=a.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(u)&&(this.activeGrip=this.curveGrip,this._state="resize")},o.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),z.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),z.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),z.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){c.prototype.setupControlBox.call(this),this.curveControlLine1=z.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=z.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},o.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,c.prototype.addControlGrips.call(this)},o.prototype.positionGrips=function(){c.prototype.positionGrips.call(this);var a=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-a/2,this.curveY-a/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},o.prototype.manipulate=function(a){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+a.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+a.y-this.manipulationStartY),c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){this.activeGrip===this.curveGrip&&(this.curveX=a.x,this.curveY=a.y),c.prototype.resize.call(this,a),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.adjustVisual()},o.prototype.scale=function(a,u){this.curveX=this.curveX*a,this.curveY=this.curveY*u,c.prototype.scale.call(this,a,u)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.curveX=u.curveX,this.curveY=u.curveY,this.createVisual(),this.adjustVisual()},o.typeName="CurveMarker",o.title="Curve marker",o.icon='',o}(vt),Et=function(){function c(o,a){a===void 0&&(a=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=o,this.cancelable=a}return Object.defineProperty(c.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),c.prototype.preventDefault=function(){this._defaultPrevented=!0},c}(),mt=function(c){function o(a,u,g){var h=c.call(this,a,!1)||this;return h.dataUrl=u,h.state=g,h}return xe(o,c),o}(Et),tt=function(c){function o(a,u,g){g===void 0&&(g=!1);var h=c.call(this,a,g)||this;return h.marker=u,h}return xe(o,c),o}(Et),Dt=function(){function c(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return c.prototype.addEventListener=function(o,a){this[o].push(a)},c.prototype.removeEventListener=function(o,a){var u=this[o].indexOf(a);u>-1&&this[o].splice(u,1)},c}(),At=function(){function c(o){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Oe,this._isOpen=!1,this.undoRedoManager=new Tt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Dt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=c.instanceCounter++,this.styles=new ye(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=o,this.targetRoot=document.body,this.width=o.clientWidth,this.height=o.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(c.prototype,"ALL_MARKER_TYPES",{get:function(){return[it,te,q,Xe,yt,Ae,D,fe,Ke,y,st,Ge]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[it,te,q,Xe,Ae,D,fe]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"BASIC_MARKER_TYPES",{get:function(){return[it,te,q,Xe,D]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(o){var a=this;this._availableMarkerTypes.splice(0),o.forEach(function(u){if(typeof u=="string"){var g=a.ALL_MARKER_TYPES.find(function(h){return h.typeName===u});g!==void 0&&a._availableMarkerTypes.push(g)}else a._availableMarkerTypes.push(u)})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(o){this._zoomLevel=o,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),c.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),b.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},c.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&M.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=M.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new Et(o))})},c.prototype.render=function(){return ue(this,void 0,void 0,function(){var o;return ve(this,function(a){switch(a.label){case 0:return this.setCurrentMarker(),(o=new W).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.markersOnly=this.renderMarkersOnly,o.width=this.renderWidth,o.height=this.renderHeight,[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return a.sent(),[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,a.sent()]}})})},c.prototype.close=function(o){var a=this;if(o===void 0&&(o=!1),this.isOpen){var u=!1;o||this.eventListeners.beforeclose.forEach(function(g){var h=new Et(a,!0);g(h),h.defaultPrevented&&(u=!0)}),u||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(g){return g(new Et(a))}),this.detachEvents(),this._isOpen=!1)}},c.prototype.addMarkersToToolbar=function(){for(var o,a=[],u=0;uthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*o:this.editorCanvas.clientWidth,u=a',o.title="Powered by marker.js",o.style.display="grid",o.style.alignItems="center",o.style.justifyItems="center",o.style.padding="3px",o.style.width="20px",o.style.height="20px",this.logoUI.appendChild(o),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},c.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},c.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},c.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},c.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new 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-1&&this.markers.splice(this.markers.indexOf(o),1),o.dispose()},c.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},c.prototype.toolbarButtonClicked=function(o,a){if(o==="marker"&&a!==void 0)this.createNewMarker(a);else if(o==="action")switch(a){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},c.prototype.deleteSelectedMarker=function(){var o=this;if(this._currentMarker!==void 0){var a=!1;if(this.eventListeners.markerbeforedelete.forEach(function(g){var h=new tt(o,o._currentMarker,!0);g(h),h.defaultPrevented&&(a=!0)}),!a){var u=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(g){return g(new tt(o,u))})}}},c.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(X){var je=new tt(o,void 0,!0);X(je),je.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function(X){var je=g.markers[X];g.setCurrentMarker(g.markers[X]),g._currentMarker.dispose(),g.markerImage.removeChild(g._currentMarker.container),g.markers.splice(g.markers.indexOf(g._currentMarker),1),g.eventListeners.markerdelete.forEach(function(pe){return pe(new tt(o,je))})},g=this,h=this.markers.length-1;h>=0;h--)u(h);this.addUndoStep()}},Object.defineProperty(c.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),c.prototype.showNotesEditor=function(){var o;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(o=this._currentMarker.notes)!==null&&o!==void 0?o:"",this.overlayContainer.appendChild(this.notesArea))},c.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},c.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},c.prototype.addUndoStep=function(){var o=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var a=this.getState(),u=this.undoRedoManager.getLastUndoStep();if(!u||u.width===a.width&&u.height===a.height){var g=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(a),g1&&this.panTo({x:o.clientX,y:o.clientY}))},c.prototype.onPointerUp=function(o){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(o.clientX,o.clientY)),this.isDragging=!1,this.addUndoStep()},c.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},c.prototype.onKeyUp=function(o){this._currentMarker===void 0||this.notesArea!==void 0||o.key!=="Delete"&&o.key!=="Backspace"||this.deleteSelectedMarker()},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.markerImage.getBoundingClientRect();return{x:(o-u.left)/this.zoomLevel,y:(a-u.top)/this.zoomLevel}},c.prototype.onWindowResize=function(){this.positionUI()},c.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},c.prototype.addLicenseKey=function(o){b.addKey(o)},c.prototype.addEventListener=function(o,a){this.eventListeners.addEventListener(o,a)},c.prototype.removeEventListener=function(o,a){this.eventListeners.removeEventListener(o,a)},c.prototype.renderState=function(o){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(o),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(c.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),c.prototype.focus=function(){var o=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(a){return a(new Et(o))}))},c.prototype.blur=function(){var o=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(a){return a(new Et(o))}))},c.instanceCounter=0,c}();/* ********************************** cropro version 1.2.0 @license SEE LICENSE IN LICENSE copyright Alan Mendelevich see README and LICENSE for details ********************************** *//*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var Vt=function(c,o){return(Vt=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])})(c,o)};function jt(c,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function a(){this.constructor=c}Vt(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function kt(c,o,a,u){return new(a||(a=Promise))(function(g,h){function X(ht){try{pe(u.next(ht))}catch(Fe){h(Fe)}}function je(ht){try{pe(u.throw(ht))}catch(Fe){h(Fe)}}function pe(ht){var Fe;ht.done?g(ht.value):(Fe=ht.value,Fe instanceof a?Fe:new a(function(wt){wt(Fe)})).then(X,je)}pe((u=u.apply(c,o||[])).next())})}function mn(c,o){var a,u,g,h,X={label:0,sent:function(){if(1&g[0])throw g[1];return g[1]},trys:[],ops:[]};return h={next:je(0),throw:je(1),return:je(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function je(pe){return function(ht){return function(Fe){if(a)throw new TypeError("Generator is already executing.");for(;X;)try{if(a=1,u&&(g=2&Fe[0]?u.return:Fe[0]?u.throw||((g=u.return)&&g.call(u),0):u.next)&&!(g=g.call(u,Fe[1])).done)return g;switch(u=0,g&&(Fe=[2&Fe[0],g.value]),Fe[0]){case 0:case 1:g=Fe;break;case 4:return X.label++,{value:Fe[1],done:!1};case 5:X.label++,u=Fe[1],Fe=[0];continue;case 7:Fe=X.ops.pop(),X.trys.pop();continue;default:if(!(g=X.trys,(g=g.length>0&&g[g.length-1])||Fe[0]!==6&&Fe[0]!==2)){X=0;continue}if(Fe[0]===3&&(!g||Fe[1]>g[0]&&Fe[1]0&&a>0){var u=new Un(o,a),g=u.ratio>=1?20:u.getHorizontalLength(20),h=u.ratio<1?20:u.getVerticalLength(20),X=document.createElementNS("http://www.w3.org/2000/svg","svg");X.setAttribute("xmlns","http://www.w3.org/2000/svg"),X.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(X);var je=ft.createDefs();X.appendChild(je);var pe=ft.createElement("clipPath",[["id","text-bg-clip"]]);je.appendChild(pe);var ht=ft.createPath(ft.getHollowRectanglePath((24-g)/2,(24-h)/2,g,h,(24-g)/2+2,(24-h)/2+2,g-4,h-4));X.appendChild(ht);var Fe=ft.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Fe.appendChild(ft.createTSpan(o+":"+a)),X.appendChild(Fe);var wt=Fe.getBBox();ft.setAttributes(Fe,[["x",((24-wt.width)/2).toString()],["y",((24-wt.height)/2-wt.y).toString()]]);var Pt=ft.createPath(ft.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(wt.width))/2,(24-Math.ceil(wt.height))/2,Math.ceil(wt.width),Math.ceil(wt.height)));return pe.appendChild(Pt),ft.setAttributes(ht,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(X),X.outerHTML}return''},c}(),_n=function(c){function o(a,u,g){var h=c.call(this,a,u)||this;return h.isDropdownOpen=!1,h.onClick=h.dropdownButtonClicked,h.dropdownButtons=g,h}return jt(o,c),o.prototype.setupDropdown=function(){var a=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(u){u.className=a.className,u.colorsClassName=a.colorsClassName,a.dropdownBlock.appendChild(u.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},o.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},o.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},o.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},o.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},o.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},o}(Nt),Rt=function(){function c(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=ft.createGroup(),this.visual.appendChild(ft.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ft.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return c.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},c.prototype.setCenter=function(o,a){this.visual.childNodes.forEach(function(u){return ft.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},c}(),Kn=function(){function c(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(c.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(o){this._aspectRatio=o,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.gridContainer&&ft.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(o){this._zoomFactor=o,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),c.prototype.open=function(){var o=this;this.cropShadeElement=ft.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=ft.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;athis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-a.height/2),ft.setAttributes(this.cropRectElement,[["x",a.x.toString()],["y",a.y.toString()],["width",a.width.toString()],["height",a.height.toString()]]);var u=a.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(h,X){var je=a.y+u*(X+1);ft.setAttributes(h,[["x1",""+a.x],["y1",""+je],["x2",""+(a.x+a.width)],["y2",""+je]])});var g=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(h,X){var je=a.x+g*(X+1);ft.setAttributes(h,[["x1",""+je],["y1",""+a.y],["x2",""+je],["y2",""+(a.y+a.height)]])}),ft.setAttributes(this.cropShadeElement,[["d",ft.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,a.x,a.y,a.width,a.height)]]),this.topLeftGrip.setCenter(a.x,a.y),this.topRightGrip.setCenter(a.x+a.width,a.y),this.bottomLeftGrip.setCenter(a.x,a.y+a.height),this.bottomRightGrip.setCenter(a.x+a.width,a.y+a.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},c.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.container.getBoundingClientRect();return{x:o-u.left+this.margin,y:a-u.top+this.margin}},c.prototype.onPointerDown=function(o){this.container.setPointerCapture(o.pointerId),this.previousPoint=this.clientToLocalCoordinates(o.clientX,o.clientY),this.cropRectElement===o.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(o.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(o.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(o.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(o.target)&&(this.activeGrip=this.bottomRightGrip)},c.prototype.onPointerMove=function(o){if(this.isMoving)this.move(this.clientToLocalCoordinates(o.clientX,o.clientY));else if(this.activeGrip){var a=this.clientToLocalCoordinates(o.clientX,o.clientY);this.resize(a)}o.preventDefault()},c.prototype.onPointerUp=function(o){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(o.pointerId)},c.prototype.move=function(o){var a=o.x-this.previousPoint.x,u=o.y-this.previousPoint.y;this.zoomFactor!==1&&(a=-a/this.zoomFactor,u=-u/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+a),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+u),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=o},c.prototype.resize=function(o){var a=Object.assign({},this.cropRect),u=o.x-this.previousPoint.x,g=o.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:a.x+uthis.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))},c.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var o=this.cropRect.x+this.cropRect.width/2,a=this.cropRect.y+this.cropRect.height/2,u=this.aspectRatio.getHorizontalLength(this.cropRect.height),g=this.aspectRatio.getVerticalLength(this.cropRect.width);u/this.canvasWidththis.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=o-this.cropRect.width/2,this.cropRect.y=a-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},c.prototype.getRescaledRect=function(o,a,u,g,h,X){var je=u/o,pe=g/a;return{x:(h.x-X)*je+X,y:(h.y-X)*pe+X,width:h.width*je,height:h.height*pe}},c.prototype.scaleCanvas=function(o,a){var u=this.getRescaledRect(this.canvasWidth,this.canvasHeight,o,a,this.cropRect,this.margin);this.canvasWidth=o,this.canvasHeight=a,this.onCropChange&&this.onCropChange(u),this.setCropRectangle(u)},c}(),hi=function(){function c(o){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=o,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(c.prototype,"angle",{get:function(){return this._angle},set:function(o){this._angle=o,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),c.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},c.prototype.onPointerDown=function(o){this.controlContainer.setPointerCapture(o.pointerId),this.isDragging=!0,this.previousPoint={x:o.clientX,y:o.clientY}},c.prototype.onPointerMove=function(o){this.isDragging&&(this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.previousPoint.x=o.clientX)},c.prototype.onPointerUp=function(o){this.isDragging&&this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(o.pointerId)},c.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var o=this.angleLabelText.getBBox();ft.setAttributes(this.angleLabelElement,[["x",((this.width-o.width)/2).toString()],["y",(this.height/2).toString()]])}},c.prototype.positionScaleShape=function(){if(this.scaleShape){var o=this.scaleShape.transform.baseVal.getItem(0);o.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(o,0)}},c.prototype.getVisual=function(){var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("width",this.width+"px"),o.setAttribute("height",this.height+"px"),o.setAttribute("viewBox","0 0 "+this.width+" "+this.height),o.style.flexShrink="0",document.body.appendChild(o);for(var a="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,u=1;u<=this.width/5+10;u++){var g=u%5==0?this.height/3:this.height/6;a+="h4v"+-g+"h1v"+g}a+="v1H0Z",this.scaleShape=ft.createPath(a);var h=ft.createTransform();this.scaleShape.transform.baseVal.appendItem(h),o.appendChild(this.scaleShape),this.angleLabelElement=ft.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=ft.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var X=ft.createTSpan("");return X.innerHTML="°",this.angleLabelElement.appendChild(X),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},c}(),vi=function(){function c(){this.naturalSize=!1,this.imageType="image/png"}return c.prototype.rasterize=function(o,a,u,g,h,X,je){var pe=this;return new Promise(function(ht){var Fe=document.createElement("canvas");Fe.width=o.width.baseVal.value-2*g,Fe.height=o.height.baseVal.value-2*g;var wt=1,Pt=1;pe.naturalSize===!0?(wt=a.naturalWidth/(o.width.baseVal.value-2*g)/X,Pt=a.naturalHeight/(o.height.baseVal.value-2*g)/je,Fe.width=a.naturalWidth/X,Fe.height=a.naturalHeight/je):pe.width!==void 0&&pe.height!==void 0&&(wt=pe.width/u.width,Pt=pe.height/u.height,Fe.width*=wt,Fe.height*=Pt);var Ht=Fe.getContext("2d");Ht.translate(Fe.width/2,Fe.height/2),Ht.rotate(h*Math.PI/180),Ht.scale(X,je),Ht.translate(-Fe.width/2,-Fe.height/2),Ht.drawImage(a,0,0,Fe.width,Fe.height);var Hn=document.createElement("canvas");Hn.width=u.width*wt,Hn.height=u.height*Pt,Hn.getContext("2d").putImageData(Ht.getImageData((u.x-g)*wt,(u.y-g)*Pt,u.width*wt,u.height*Pt),0,0),ht(Hn.toDataURL(pe.imageType,pe.imageQuality))})},c}(),Ve=function(){function c(o){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=c.instanceCounter++,this.styles=new En(this.instanceNo),this.target=o,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(c.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(o){this._zoomToCropEnabled=o,o?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"gridLines",{get:function(){return this._gridLines},set:function(o){this._gridLines=o,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(o){this._rotationAngle=o,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"aspectRatio",{get:function(){var o;return(o=this._aspectRatio)!==null&&o!==void 0?o:this.aspectRatios[0]},set:function(o){this._aspectRatio=o},enumerable:!1,configurable:!0}),c.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},c.prototype.show=function(){this.showUI(),this.open()},c.prototype.close=function(o){o===void 0&&(o=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),o||this.closeEventListeners.forEach(function(a){return a()}),this._isOpen=!1)},c.prototype.addRenderEventListener=function(o){this.renderEventListeners.push(o)},c.prototype.removeRenderEventListener=function(o){this.renderEventListeners.indexOf(o)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(o),1)},c.prototype.addCloseEventListener=function(o){this.closeEventListeners.push(o)},c.prototype.removeCloseEventListener=function(o){this.closeEventListeners.indexOf(o)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(o),1)},c.prototype.setupResizeObserver=function(){var o=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){o.resize(o.target.clientWidth,o.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},c.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var o=1*this.target.clientWidth/this.target.clientHeight,a=this.contentDiv.clientWidth/o>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*o:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,u=a+2*this.CANVAS_MARGINo+this.CANVAS_MARGIN?this.target.offsetTop-(o+this.CANVAS_MARGIN):0;this.coverDiv.style.top=a+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},c.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},c.prototype.addTopToolbar=function(){var o=this;this.topToolbar=new Tn,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var a=new Xn;a.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(a);var u=[];this.aspectRatios.forEach(function(Pt){var Ht=new Nt(ui.getIcon(Pt.horizontal,Pt.vertical),Pt.horizontal===0&&Pt.vertical===0?"FREE":Pt.horizontal+":"+Pt.vertical);Ht.onClick=function(){return o.ratioButtonClicked(Pt)},u.push(Ht)}),this.aspectRatioButton=new _n(ui.getIcon(0,0),"Aspect ratio",u),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,a.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var g=new Nt('',"Toggle grid");g.isActive=this.isGridVisible,g.onClick=function(){o.isGridVisible=!o.isGridVisible,g.isActive=o.isGridVisible},a.addButton(g);var h=new Nt('',"Zoom to selection");if(h.isActive=this.zoomToCropEnabled,h.onClick=function(){o.zoomToCropEnabled=!o.zoomToCropEnabled,h.isActive=o.zoomToCropEnabled},a.addButton(h),!sn.isLicensed){var X=new ct;this.topToolbar.addElementBlock(X);var je=document.createElement("div");je.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var pe=document.createElement("a");pe.style.color="currentColor",pe.href="https://markerjs.com/products/cropro",pe.target="_blank",pe.innerHTML='',je.appendChild(pe),X.addElement(je)}var ht=new Xn;ht.minWidth=3*this.toolbarHeight+"px",ht.contentAlign="end",this.topToolbar.addButtonBlock(ht);var Fe=new Nt('',"OK");Fe.onClick=this.startRenderAndClose,ht.addButton(Fe),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Fe.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var wt=new Nt('',"Close");wt.onClick=this.close,ht.addButton(wt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(wt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},c.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new Tn,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var a=new Xn;a.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(a);var u=new Nt('',"Rotate left");u.onClick=this.rotateLeftButtonClicked,a.addButton(u);var g=new Nt('',"Rotate right");g.onClick=this.rotateRightButtonClicked,a.addButton(g);var h=new ct;h.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(h),this.straightener=new hi("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(ht){o.rotateBy(ht),o.straightener.angle=o.rotationAngle},h.addElement(this.straightener.getUI());var X=new Xn;X.minWidth=2*this.toolbarHeight+"px",X.contentAlign="end",this.bottomToolbar.addButtonBlock(X);var je=new Nt('',"Flip horizontal");je.onClick=this.flipHorizontallyButtonClicked,X.addButton(je);var pe=new Nt('',"Flip vertical");pe.onClick=this.flipVerticallyButtonClicked,X.addButton(pe)},c.prototype.ratioButtonClicked=function(o){this.aspectRatio=o,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},c.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ui.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},c.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Un(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},c.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},c.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},c.prototype.restoreState=function(o){if(o){var a=this.cropLayer.getRescaledRect(o.width,o.height,this.imageWidth,this.imageHeight,o.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(a),this.cropRectChanged(a),this.flippedHorizontally=o.flippedHorizontally,this.flippedVertically=o.flippedVertically,this.applyFlip(),this.rotationAngle=o.rotationAngle,this.applyRotation()}},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.cropImage.getBoundingClientRect();return{x:o-u.left,y:a-u.top}},c.prototype.onWindowResize=function(){this.positionUI()},c.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var o=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},c.prototype.rotateLeftButtonClicked=function(){var o=this.rotationAngle-90;this.rotationAngle%90!=0&&(o+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(o)},c.prototype.rotateRightButtonClicked=function(){var o=this.rotationAngle+90;this.rotationAngle%90!=0&&(o-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(o)},c.prototype.rotateTo=function(o){o=(o=o>180?o-360:o)<=-180?o+360:o,this.rotationAngle=o,this.applyRotation()},c.prototype.rotateBy=function(o){this.rotateTo((this.rotationAngle+o)%360)},c.prototype.applyRotation=function(){var o=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var a=this.editingTargetRotationContainer.transform.baseVal.getItem(0);a.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(a,0);var u=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/u.width,this.imageHeight/u.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=o},c.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},c.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},c.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},c.prototype.startRenderAndClose=function(){return kt(this,void 0,void 0,function(){var o,a;return mn(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]}})})},c.prototype.render=function(){return kt(this,void 0,void 0,function(){var o;return mn(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(),ft.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,o.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return a.sent(),[4,o.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,a.sent()]}})})},c.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new gn("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 gn("toolbar_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarBlockStyleClass=this.styles.addClass(new gn("toolbar-block",` display: flex; align-items: center; box-sizing: content-box; `));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new gn("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 gn("toolbar_button_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new gn("toolbar_active_button",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; background-color: `+this.styles.settings.toolbarBackgroundActiveColor+` `)),this.styles.addRule(new ln("."+this.toolbarButtonStyleClass.name+" svg",` height: `+this.toolbarHeight/2+`px; `)),this.styles.addRule(new ln("."+this.toolbarButtonStyleColorsClass.name+":hover",` background-color: `+this.styles.settings.toolbarBackgroundHoverColor+` `)),this.toolbarDropdownStyleClass=this.styles.addClass(new gn("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 gn("toolbar_dropdown_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new gn("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 gn("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 gn("toolbar_straightener_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `))},c.instanceCounter=0,c}(),Ct=x("8hTe"),ti=x.n(Ct),ci=/]*>/g;function di(c){var o=document.createElement("div");return o.innerHTML=c,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var Ri=Je.a=function(c){var o=c.value,a=o===void 0?"":o,u=c.edit,g=u===void 0?!1:u,h=c.className,X=c.showTextOnly,je=c.showLines,pe=c.replaces,ht=c.zoomImg,Fe=c.hasMask,wt=c.style,Pt=wt===void 0?{}:wt,Ht=c.stylesPrev,Hn=Ht===void 0?{}:Ht,zn=String(a),un=Object(O.useRef)(),Yn=Object(O.useRef)(),Xi=Object(O.useState)(""),An=Object(_.a)(Xi,2),Ln=An[0],ni=An[1],yi=Object(O.useState)("office"),Jn=Object(_.a)(yi,2),ii=Jn[0],Wn=Jn[1],fr=function(){var Bt=new Ve(Yn.current);Bt.displayMode="popup",Bt.addRenderEventListener(function(){var vn=Object(G.a)(k.a.mark(function Ft(yn){var Kt;return k.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:return un.current.style.display="none",rn.next=3,Object(Me.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:yn}});case 3:Kt=rn.sent,Kt!=null&&Kt.id&&pe(Yn.current.getAttribute("src").replace(H.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 5:case"end":return rn.stop()}},Ft)}));return function(Ft){return vn.apply(this,arguments)}}()),Bt.show()},Ki=function(){var Bt=new At(Yn.current);Bt.settings.displayMode="popup",Bt.addEventListener("render",function(){var vn=Object(G.a)(k.a.mark(function Ft(yn){var Kt;return k.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:if(un.current.style.display="none",!Yn.current){rn.next=6;break}return rn.next=4,Object(Me.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:yn.dataUrl}});case 4:Kt=rn.sent,Kt!=null&&Kt.id&&pe(Yn.current.getAttribute("src").replace(H.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 6:case"end":return rn.stop()}},Ft)}));return function(Ft){return vn.apply(this,arguments)}}()),Bt.show(),window.markerArea=Bt},Nn=Object(O.useMemo)(function(){try{var qt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Bt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,vn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;zn=zn.replace(qt,"("+H.a.API_SERVER+"/api/attachments/").replace(Bt,'"'+H.a.API_SERVER+"/api/attachments/").replace(vn,'"'+H.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,` `),zn=zn.replace(new RegExp("(?[TOC]

    ",Ue()),Ye()),Ft=Ft.replace(/(__special_katext_id_\d+__)/g,function(bi,rn){var on=yn[rn],ri=on.type,xi=on.expression;return Object($.renderToString)(di(xi)||"",{displayMode:ri==="block",throwOnError:!1,output:"html"})}),Ft=Ft.replace(/▁/g,"\u2581\u2581\u2581"),re(),X){var Kt=document.createElement("div");return Kt.innerHTML=Ft,Kt.innerText}return setTimeout(function(){return Di()},500),Ft},[zn]),In=Object(O.useRef)();_e.WebkitLineClamp=je,je&&(Pt=Object(se.a)(Object(se.a)({},Pt),_e));function Oi(qt){var Bt=qt.target;if(Bt.tagName.toUpperCase()==="IMG"){if(ht){var vn=Bt.getAttribute("src");ni(vn),Wn("image")}}else if(Bt.tagName.toUpperCase()==="A"){var Ft=Bt.getAttribute("href");if(Ft.indexOf("office")>-1)qt.preventDefault(),ni(Ft),Wn("office");else if(Ft.indexOf("application/pdf")>-1)qt.preventDefault(),ni(Ft),Wn("pdf");else if(Ft.indexOf("type=text")>-1)qt.preventDefault(),ni(Ft),Wn("html");else if(Ft.startsWith("#")){qt.preventDefault();var yn=document.getElementById(Ft.replace("#",""));yn&&yn.scrollIntoView(!0)}}}var Di=function(){var Bt,vn=(Bt=In.current)===null||Bt===void 0?void 0:Bt.querySelectorAll("video");vn==null||vn.forEach(function(Ft){if(Ft.oncontextmenu=function(){return!1},Ft.src.indexOf(".m3u8")>-1&&!Ft.canPlayType("application/vnd.apple.mpegurl")){if(E.a.isSupported()){var yn=new E.a;yn.loadSource(Ft.src),yn.attachMedia(Ft)}}})};Object(O.useEffect)(function(){if(In.current&&Nn&&(Nn.match(ci)&&window.PR.prettyPrint()),In.current)return In.current.addEventListener("click",Oi),function(){In.current.removeEventListener("click",Oi),re(),Ye()}},[Nn,In.current,Oi]);var Pi=function(Bt){if(!g)return;Bt.target.nodeName==="IMG"?(un.current.style.display="flex",un.current.style.width=Bt.target.clientWidth+"px",un.current.style.height=Bt.target.clientHeight+"px",un.current.style.top=Bt.target.offsetTop+"px",un.current.style.left=Bt.target.offsetLeft+"px",Yn.current.src=Bt.target.getAttribute("src")):un.current.style.display="none"};return T.a.createElement("div",{style:{position:"relative"}},T.a.createElement("div",{ref:In,style:Object(se.a)({},Pt),className:"".concat(h||""," markdown-body ").concat(ti.a.mdBody),onMouseOver:Pi,dangerouslySetInnerHTML:{__html:Nn}}),T.a.createElement("div",{ref:un,className:ti.a.button},T.a.createElement(le.a,null,T.a.createElement(ge.a,{onClick:function(){return fr()}},"\u88C1\u526A"),T.a.createElement(ge.a,{onClick:function(){return Ki()}},"\u7F16\u8F91"))),T.a.createElement("img",{ref:Yn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),T.a.createElement(Ce.a,{close:!0,data:Ln,hasMask:Fe,type:Ln!=null&&Ln.length?ii:"",style:Object(se.a)({},Hn),onClose:function(){return ni("")}}))}},"9VGf":function(ot,Je,x){"use strict";x.d(Je,"a",function(){return ne});var F=x("q1tI"),le=x.n(F);function ne(ge,se){var G=Object(F.useRef)();Object(F.useEffect)(function(){G.current=ge}),Object(F.useEffect)(function(){function _(){G.current()}if(se!==null){var I=setInterval(_,se);return function(){return clearInterval(I)}}},[se])}},Bd2K:function(ot,Je,x){(function(F){F(x("VrN/"),x("osHv"))})(function(F){F.defineOption("autoCloseTags",!1,function(k,O,T){if(T!=F.Init&&T&&k.removeKeyMap("autoCloseTags"),!O)return;var A={name:"autoCloseTags"};(typeof O!="object"||O.whenClosing!==!1)&&(A["'/'"]=function(ee){return G(ee)}),(typeof O!="object"||O.whenOpening!==!1)&&(A["'>'"]=function(ee){return ge(ee)}),k.addKeyMap(A)});var le=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],ne=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function ge(k){if(k.getOption("disableInput"))return F.Pass;for(var O=k.listSelections(),T=[],A=k.getOption("autoCloseTags"),ee=0;eeQ.ch&&(me=me.slice(0,me.length-U.end+Q.ch));var ke=me.toLowerCase();if(!me||U.type=="string"&&(U.end!=Q.ch||!/[\"\']/.test(U.string.charAt(U.string.length-1))||U.string.length==1)||U.type=="tag"&&he.close||U.string.indexOf("/")==Q.ch-U.start-1||Ye&&_(Ye,ke)>-1||I(k,J.mode.xmlCurrentContext&&J.mode.xmlCurrentContext(Y)||[],me,Q,!0))return F.Pass;var Ue=typeof A=="object"&&A.emptyTags;if(Ue&&_(Ue,me)>-1){T[ee]={text:"/>",newPos:F.Pos(Q.line,Q.ch+2)};continue}var Ee=_e&&_(_e,ke)>-1;T[ee]={indent:Ee,text:">"+(Ee?` `:"")+"",newPos:Ee?F.Pos(Q.line+1,0):F.Pos(Q.line,Q.ch+1)}}for(var Le=typeof A=="object"&&A.dontIndentOnAutoClose,ee=O.length-1;ee>=0;ee--){var Se=T[ee];k.replaceRange(Se.text,O[ee].head,O[ee].anchor,"+insert");var ce=k.listSelections().slice(0);ce[ee]={head:Se.newPos,anchor:Se.newPos},k.setSelections(ce),!Le&&Se.indent&&(k.indentLine(Se.newPos.line,null,!0),k.indentLine(Se.newPos.line+1,null,!0))}}function se(k,O){for(var T=k.listSelections(),A=[],ee=O?"/":""&&(Ye+=">"),A[J]=Ye}if(k.replaceSelections(A),T=k.listSelections(),!U)for(var J=0;J=0&&O[Y]==T;Y--)++J;A=U.to;for(var Y=1;Y0){for(var O=0;O1&&arguments[1]!==void 0?arguments[1]:"",O=[],T=0;T=0)continue;if(!Object.prototype.propertyIsEnumerable.call(C,w))continue;P[w]=C[w]}}return P}function G(C,N){if(C==null)return{};var P={},w=Object.keys(C),L,p;for(p=0;p=0)continue;P[L]=C[L]}return P}function _(C,N){if(!(C instanceof N))throw new TypeError("Cannot call a class as a function")}function I(C,N){for(var P=0;P>6),N+=String.fromCharCode(128|w&63)):w<55296||w>=57344?(N+=String.fromCharCode(224|w>>12),N+=String.fromCharCode(128|w>>6&63),N+=String.fromCharCode(128|w&63)):(P++,w=65536+((w&1023)<<10|C.charCodeAt(P)&1023),N+=String.fromCharCode(240|w>>18),N+=String.fromCharCode(128|w>>12&63),N+=String.fromCharCode(128|w>>6&63),N+=String.fromCharCode(128|w&63))}return N}var Ye={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},_e={},ke=4,Ue=.1;function Ee(C){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,P=[];return C.forEach(function(w,L){var p=null;w.forEach(function(d,E){if(!d&&p!==null){P.push("M".concat(p+N," ").concat(L+N,"h").concat(E-p,"v1H").concat(p+N,"z")),p=null;return}if(E===w.length-1){if(!d)return;p===null?P.push("M".concat(E+N,",").concat(L+N," h1v1H").concat(E+N,"z")):P.push("M".concat(p+N,",").concat(L+N," h").concat(E+1-p,"v1H").concat(p+N,"z"));return}d&&p===null&&(p=E)})}),P.join("")}function Le(C,N){return C.slice().map(function(P,w){return w=N.y+N.h?P:P.map(function(L,p){return p=N.x+N.w?L:!1})})}function Se(C,N){var P=C.imageSettings,w=C.size,L=C.includeMargin;if(P==null)return null;var p=L?ke:0,d=N.length+p*2,E=Math.floor(w*Ue),H=d/w,$=(P.width||E)*H,Ce=(P.height||E)*H,Me=P.x==null?N.length/2-$/2:P.x*H,be=P.y==null?N.length/2-Ce/2:P.y*H,xe=null;if(P.excavate){var ue=Math.floor(Me),ve=Math.floor(be),Z=Math.ceil($+Me-ue),z=Math.ceil(Ce+be-ve);xe={x:ue,y:ve,w:Z,h:z}}return{x:Me,y:be,h:Ce,w:$,excavation:xe}}var ce=function(){try{new Path2D().addPath(new Path2D)}catch(C){return!1}return!0}(),R=function(C){ee(N,C);function N(){var P,w;_(this,N);for(var L=arguments.length,p=new Array(L),d=0;dte.length)&&(K=te.length);for(var q=0,y=new Array(K);q=te.length?{done:!0}:{done:!1,value:te[y++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return q=te[Symbol.iterator](),q.next.bind(q)}function G(te,K){return K={exports:{}},te(K,K.exports),K.exports}var _=G(function(te){function K(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function q(y){te.exports.defaults=y}te.exports={defaults:K(),getDefaults:K,changeDefaults:q}}),I=_.defaults,k=_.getDefaults,O=_.changeDefaults,T=/[&<>"']/,A=/[&<>"']/g,ee=/[<>"']|&(?!#?\w+;)/,Q=/[<>"']|&(?!#?\w+;)/g,U={"&":"&","<":"<",">":">",'"':""","'":"'"},J=function(K){return U[K]};function Y(te,K){if(K){if(T.test(te))return te.replace(A,J)}else if(ee.test(te))return te.replace(Q,J);return te}var he=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function me(te){return te.replace(he,function(K,q){return q=q.toLowerCase(),q==="colon"?":":q.charAt(0)==="#"?q.charAt(1)==="x"?String.fromCharCode(parseInt(q.substring(2),16)):String.fromCharCode(+q.substring(1)):""})}var ze=/(^|[^\[])\^/g;function Ye(te,K){te=te.source||te,K=K||"";var q={replace:function(S,D){return D=D.source||D,D=D.replace(ze,"$1"),te=te.replace(S,D),q},getRegex:function(){return new RegExp(te,K)}};return q}var _e=/[^\w:]/g,ke=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Ue(te,K,q){if(te){var y;try{y=decodeURIComponent(me(q)).replace(_e,"").toLowerCase()}catch(S){return null}if(y.indexOf("javascript:")===0||y.indexOf("vbscript:")===0||y.indexOf("data:")===0)return null}K&&!ke.test(q)&&(q=R(K,q));try{q=encodeURI(q).replace(/%25/g,"%")}catch(S){return null}return q}var Ee={},Le=/^[^:]+:\/*[^/]*$/,Se=/^([^:]+:)[\s\S]*$/,ce=/^([^:]+:\/*[^/]*)[\s\S]*$/;function R(te,K){Ee[" "+te]||(Le.test(te)?Ee[" "+te]=te+"/":Ee[" "+te]=N(te,"/",!0)),te=Ee[" "+te];var q=te.indexOf(":")===-1;return K.substring(0,2)==="//"?q?K:te.replace(Se,"$1")+K:K.charAt(0)==="/"?q?K:te.replace(ce,"$1")+K:te+K}var oe={exec:function(){}};function re(te){for(var K=1,q,y;K=0&&fe[Ke]==="\\";)Ae=!Ae;return Ae?"|":" |"}),y=q.split(/ \|/),S=0;if(y.length>K)y.splice(K);else for(;y.length=y.length?S.slice(y.length):S}).join(` `)}var be=function(){function te(q){this.options=q||p}var K=te.prototype;return K.space=function(y){var S=this.rules.block.newline.exec(y);if(S)return S[0].length>1?{type:"space",raw:S[0]}:{raw:` `}},K.code=function(y,S){var D=this.rules.block.code.exec(y);if(D){var j=S[S.length-1];if(j&&j.type==="paragraph")return{raw:D[0],text:D[0].trimRight()};var fe=D[0].replace(/^ {4}/gm,"");return{type:"code",raw:D[0],codeBlockStyle:"indented",text:this.options.pedantic?fe:d(fe,` `)}}},K.fences=function(y){var S=this.rules.block.fences.exec(y);if(S){var D=S[0],j=Me(D,S[3]||"");return{type:"code",raw:D,lang:S[2]?S[2].trim():S[2],text:j}}},K.heading=function(y){var S=this.rules.block.heading.exec(y);if(S)return{type:"heading",raw:S[0],depth:S[1].length,text:S[2]}},K.nptable=function(y){var S=this.rules.block.nptable.exec(y);if(S){var D={type:"table",header:E(S[1].replace(/^ *| *\| *$/g,"")),align:S[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:S[3]?S[3].replace(/\n$/,"").split(` `):[],raw:S[0]};if(D.header.length===D.align.length){var j=D.align.length,fe;for(fe=0;fe ?/gm,"");return{type:"blockquote",raw:S[0],text:D}}},K.list=function(y){var S=this.rules.block.list.exec(y);if(S){for(var D=S[0],j=S[2],fe=j.length>1,Ae=j[j.length-1]===")",Ke={type:"list",raw:D,ordered:fe,start:fe?+j.slice(0,-1):"",loose:!1,items:[]},yt=S[0].match(this.rules.block.item),Tt=!1,Ge,Et,mt,tt,Dt,At,Vt,jt=yt.length,kt=0;kt1||this.options.smartLists&&mt!==j)&&(tt=yt.slice(kt+1).join(` `),Ke.raw=Ke.raw.substring(0,Ke.raw.length-tt.length),kt=jt-1)),Dt=Tt||/\n\n(?!\s*$)/.test(Ge),kt!==jt-1&&(Tt=Ge.charAt(Ge.length-1)===` `,Dt||(Dt=Tt)),Dt&&(Ke.loose=!0),At=/^\[[ xX]\] /.test(Ge),Vt=void 0,At&&(Vt=Ge[1]!==" ",Ge=Ge.replace(/^\[[ xX]\] +/,"")),Ke.items.push({type:"list_item",raw:D,task:At,checked:Vt,loose:Dt,text:Ge});return Ke}},K.html=function(y){var S=this.rules.block.html.exec(y);if(S)return{type:this.options.sanitize?"paragraph":"html",raw:S[0],pre:!this.options.sanitizer&&(S[1]==="pre"||S[1]==="script"||S[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(S[0]):H(S[0]):S[0]}},K.def=function(y){var S=this.rules.block.def.exec(y);if(S){S[3]&&(S[3]=S[3].substring(1,S[3].length-1));var D=S[1].toLowerCase().replace(/\s+/g," ");return{tag:D,raw:S[0],href:S[2],title:S[3]}}},K.table=function(y){var S=this.rules.block.table.exec(y);if(S){var D={type:"table",header:E(S[1].replace(/^ *| *\| *$/g,"")),align:S[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:S[3]?S[3].replace(/\n$/,"").split(` `):[]};if(D.header.length===D.align.length){D.raw=S[0];var j=D.align.length,fe;for(fe=0;fe/i.test(j[0])&&(S=!1),!D&&/^<(pre|code|kbd|script)(\s|>)/i.test(j[0])?D=!0:D&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(j[0])&&(D=!1),{type:this.options.sanitize?"text":"html",raw:j[0],inLink:S,inRawBlock:D,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(j[0]):H(j[0]):j[0]}},K.link=function(y){var S=this.rules.inline.link.exec(y);if(S){var D=$(S[2],"()");if(D>-1){var j=S[0].indexOf("!")===0?5:4,fe=j+S[1].length+D;S[2]=S[2].substring(0,D),S[0]=S[0].substring(0,fe).trim(),S[3]=""}var Ae=S[2],Ke="";if(this.options.pedantic){var yt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ae);yt?(Ae=yt[1],Ke=yt[3]):Ke=""}else Ke=S[3]?S[3].slice(1,-1):"";Ae=Ae.trim().replace(/^<([\s\S]*)>$/,"$1");var Tt=Ce(S,{href:Ae&&Ae.replace(this.rules.inline._escapes,"$1"),title:Ke&&Ke.replace(this.rules.inline._escapes,"$1")},S[0]);return Tt}},K.reflink=function(y,S){var D;if((D=this.rules.inline.reflink.exec(y))||(D=this.rules.inline.nolink.exec(y))){var j=(D[2]||D[1]).replace(/\s+/g," ");if(j=S[j.toLowerCase()],!j||!j.href){var fe=D[0].charAt(0);return{type:"text",raw:fe,text:fe}}var Ae=Ce(D,j,D[0]);return Ae}},K.strong=function(y,S,D){D===void 0&&(D="");var j=this.rules.inline.strong.start.exec(y);if(j&&(!j[1]||j[1]&&(D===""||this.rules.inline.punctuation.exec(D)))){S=S.slice(-1*y.length);var fe=j[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;fe.lastIndex=0;for(var Ae;(j=fe.exec(S))!=null;)if(Ae=this.rules.inline.strong.middle.exec(S.slice(0,j.index+3)),Ae)return{type:"strong",raw:y.slice(0,Ae[0].length),text:y.slice(2,Ae[0].length-2)}}},K.em=function(y,S,D){D===void 0&&(D="");var j=this.rules.inline.em.start.exec(y);if(j&&(!j[1]||j[1]&&(D===""||this.rules.inline.punctuation.exec(D)))){S=S.slice(-1*y.length);var fe=j[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;fe.lastIndex=0;for(var Ae;(j=fe.exec(S))!=null;)if(Ae=this.rules.inline.em.middle.exec(S.slice(0,j.index+2)),Ae)return{type:"em",raw:y.slice(0,Ae[0].length),text:y.slice(1,Ae[0].length-1)}}},K.codespan=function(y){var S=this.rules.inline.code.exec(y);if(S){var D=S[2].replace(/\n/g," "),j=/[^ ]/.test(D),fe=D.startsWith(" ")&&D.endsWith(" ");return j&&fe&&(D=D.substring(1,D.length-1)),D=H(D,!0),{type:"codespan",raw:S[0],text:D}}},K.br=function(y){var S=this.rules.inline.br.exec(y);if(S)return{type:"br",raw:S[0]}},K.del=function(y){var S=this.rules.inline.del.exec(y);if(S)return{type:"del",raw:S[0],text:S[1]}},K.autolink=function(y,S){var D=this.rules.inline.autolink.exec(y);if(D){var j,fe;return D[2]==="@"?(j=H(this.options.mangle?S(D[1]):D[1]),fe="mailto:"+j):(j=H(D[1]),fe=j),{type:"link",raw:D[0],text:j,href:fe,tokens:[{type:"text",raw:j,text:j}]}}},K.url=function(y,S){var D;if(D=this.rules.inline.url.exec(y)){var j,fe;if(D[2]==="@")j=H(this.options.mangle?S(D[0]):D[0]),fe="mailto:"+j;else{var Ae;do Ae=D[0],D[0]=this.rules.inline._backpedal.exec(D[0])[0];while(Ae!==D[0]);j=H(D[0]),D[1]==="www."?fe="http://"+j:fe=j}return{type:"link",raw:D[0],text:j,href:fe,tokens:[{type:"text",raw:j,text:j}]}}},K.inlineText=function(y,S,D){var j=this.rules.inline.text.exec(y);if(j){var fe;return S?fe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(j[0]):H(j[0]):j[0]:fe=H(this.options.smartypants?D(j[0]):j[0]),{type:"text",raw:j[0],text:fe}}},te}(),xe=L.noopTest,ue=L.edit,ve=L.merge,Z={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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:xe,table:xe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};Z._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Z._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Z.def=ue(Z.def).replace("label",Z._label).replace("title",Z._title).getRegex(),Z.bullet=/(?:[*+-]|\d{1,9}[.)])/,Z.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,Z.item=ue(Z.item,"gm").replace(/bull/g,Z.bullet).getRegex(),Z.list=ue(Z.list).replace(/bull/g,Z.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Z.def.source+")").getRegex(),Z._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",Z._comment=//,Z.html=ue(Z.html,"i").replace("comment",Z._comment).replace("tag",Z._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Z.paragraph=ue(Z._paragraph).replace("hr",Z.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",")|<(?:script|pre|style|!--)").replace("tag",Z._tag).getRegex(),Z.blockquote=ue(Z.blockquote).replace("paragraph",Z.paragraph).getRegex(),Z.normal=ve({},Z),Z.gfm=ve({},Z.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*|$)"}),Z.gfm.nptable=ue(Z.gfm.nptable).replace("hr",Z.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",")|<(?:script|pre|style|!--)").replace("tag",Z._tag).getRegex(),Z.gfm.table=ue(Z.gfm.table).replace("hr",Z.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",")|<(?:script|pre|style|!--)").replace("tag",Z._tag).getRegex(),Z.pedantic=ve({},Z.normal,{html:ue(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Z._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:xe,paragraph:ue(Z.normal._paragraph).replace("hr",Z.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",Z.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:xe,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\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:xe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",z.punctuation=ue(z.punctuation).replace(/punctuation/g,z._punctuation).getRegex(),z._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",z._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",z.em.start=ue(z.em.start).replace(/punctuation/g,z._punctuation).getRegex(),z.em.middle=ue(z.em.middle).replace(/punctuation/g,z._punctuation).replace(/overlapSkip/g,z._overlapSkip).getRegex(),z.em.endAst=ue(z.em.endAst,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.em.endUnd=ue(z.em.endUnd,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.strong.start=ue(z.strong.start).replace(/punctuation/g,z._punctuation).getRegex(),z.strong.middle=ue(z.strong.middle).replace(/punctuation/g,z._punctuation).replace(/blockSkip/g,z._blockSkip).getRegex(),z.strong.endAst=ue(z.strong.endAst,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.strong.endUnd=ue(z.strong.endUnd,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.blockSkip=ue(z._blockSkip,"g").getRegex(),z.overlapSkip=ue(z._overlapSkip,"g").getRegex(),z._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,z._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,z._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,z.autolink=ue(z.autolink).replace("scheme",z._scheme).replace("email",z._email).getRegex(),z._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,z.tag=ue(z.tag).replace("comment",Z._comment).replace("attribute",z._attribute).getRegex(),z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,z._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,z.link=ue(z.link).replace("label",z._label).replace("href",z._href).replace("title",z._title).getRegex(),z.reflink=ue(z.reflink).replace("label",z._label).getRegex(),z.reflinkSearch=ue(z.reflinkSearch,"g").replace("reflink",z.reflink).replace("nolink",z.nolink).getRegex(),z.normal=ve({},z),z.pedantic=ve({},z.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:ue(/^!?\[(label)\]\((.*?)\)/).replace("label",z._label).getRegex(),reflink:ue(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",z._label).getRegex()}),z.gfm=ve({},z.normal,{escape:ue(z.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(y="x"+y.toString(16)),K+="&#"+y+";";return K}var Te=function(){function te(q){this.tokens=[],this.tokens.links=Object.create(null),this.options=q||W,this.options.tokenizer=this.options.tokenizer||new be,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var y={block:M.normal,inline:ye.normal};this.options.pedantic?(y.block=M.pedantic,y.inline=ye.pedantic):this.options.gfm&&(y.block=M.gfm,this.options.breaks?y.inline=ye.breaks:y.inline=ye.gfm),this.tokenizer.rules=y}te.lex=function(y,S){var D=new te(S);return D.lex(y)};var K=te.prototype;return K.lex=function(y){return y=y.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(y,this.tokens,!0),this.inline(this.tokens),this.tokens},K.blockTokens=function(y,S,D){S===void 0&&(S=[]),D===void 0&&(D=!0),y=y.replace(/^ +$/gm,"");for(var j,fe,Ae,Ke;y;){if(j=this.tokenizer.space(y)){y=y.substring(j.raw.length),j.type&&S.push(j);continue}if(j=this.tokenizer.code(y,S)){y=y.substring(j.raw.length),j.type?S.push(j):(Ke=S[S.length-1],Ke.raw+=` `+j.raw,Ke.text+=` `+j.text);continue}if(j=this.tokenizer.fences(y)){y=y.substring(j.raw.length),S.push(j);continue}if(j=this.tokenizer.heading(y)){y=y.substring(j.raw.length),S.push(j);continue}if(j=this.tokenizer.nptable(y)){y=y.substring(j.raw.length),S.push(j);continue}if(j=this.tokenizer.hr(y)){y=y.substring(j.raw.length),S.push(j);continue}if(j=this.tokenizer.blockquote(y)){y=y.substring(j.raw.length),j.tokens=this.blockTokens(j.text,[],D),S.push(j);continue}if(j=this.tokenizer.list(y)){for(y=y.substring(j.raw.length),Ae=j.items.length,fe=0;fe0)for(;(yt=this.tokenizer.rules.inline.reflinkSearch.exec(Ke))!=null;)Tt.includes(yt[0].slice(yt[0].lastIndexOf("[")+1,-1))&&(Ke=Ke.slice(0,yt.index)+"["+"a".repeat(yt[0].length-2)+"]"+Ke.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(yt=this.tokenizer.rules.inline.blockSkip.exec(Ke))!=null;)Ke=Ke.slice(0,yt.index)+"["+"a".repeat(yt[0].length-2)+"]"+Ke.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;y;){if(Ae=this.tokenizer.escape(y)){y=y.substring(Ae.raw.length),S.push(Ae);continue}if(Ae=this.tokenizer.tag(y,D,j)){y=y.substring(Ae.raw.length),D=Ae.inLink,j=Ae.inRawBlock,S.push(Ae);continue}if(Ae=this.tokenizer.link(y)){y=y.substring(Ae.raw.length),Ae.type==="link"&&(Ae.tokens=this.inlineTokens(Ae.text,[],!0,j)),S.push(Ae);continue}if(Ae=this.tokenizer.reflink(y,this.tokens.links)){y=y.substring(Ae.raw.length),Ae.type==="link"&&(Ae.tokens=this.inlineTokens(Ae.text,[],!0,j)),S.push(Ae);continue}if(Ae=this.tokenizer.strong(y,Ke,fe)){y=y.substring(Ae.raw.length),Ae.tokens=this.inlineTokens(Ae.text,[],D,j),S.push(Ae);continue}if(Ae=this.tokenizer.em(y,Ke,fe)){y=y.substring(Ae.raw.length),Ae.tokens=this.inlineTokens(Ae.text,[],D,j),S.push(Ae);continue}if(Ae=this.tokenizer.codespan(y)){y=y.substring(Ae.raw.length),S.push(Ae);continue}if(Ae=this.tokenizer.br(y)){y=y.substring(Ae.raw.length),S.push(Ae);continue}if(Ae=this.tokenizer.del(y)){y=y.substring(Ae.raw.length),Ae.tokens=this.inlineTokens(Ae.text,[],D,j),S.push(Ae);continue}if(Ae=this.tokenizer.autolink(y,ie)){y=y.substring(Ae.raw.length),S.push(Ae);continue}if(!D&&(Ae=this.tokenizer.url(y,ie))){y=y.substring(Ae.raw.length),S.push(Ae);continue}if(Ae=this.tokenizer.inlineText(y,j,we)){y=y.substring(Ae.raw.length),fe=Ae.raw.slice(-1),S.push(Ae);continue}if(y){var Ge="Infinite loop on byte: "+y.charCodeAt(0);if(this.options.silent){console.error(Ge);break}else throw new Error(Ge)}}return S},le(te,null,[{key:"rules",get:function(){return{block:M,inline:ye}}}]),te}(),Ne=_.defaults,He=L.cleanUrl,Ie=L.escape,Re=function(){function te(q){this.options=q||Ne}var K=te.prototype;return K.code=function(y,S,D){var j=(S||"").match(/\S*/)[0];if(this.options.highlight){var fe=this.options.highlight(y,j);fe!=null&&fe!==y&&(D=!0,y=fe)}return j?'
    '+(D?y:Ie(y,!0))+`
    `:"
    "+(D?y:Ie(y,!0))+`
    `},K.blockquote=function(y){return`
    `+y+`
    `},K.html=function(y){return y},K.heading=function(y,S,D,j){return this.options.headerIds?"'+y+" `:""+y+" `},K.hr=function(){return this.options.xhtml?`
    `:`
    `},K.list=function(y,S,D){var j=S?"ol":"ul",fe=S&&D!==1?' start="'+D+'"':"";return"<"+j+fe+`> `+y+" `},K.listitem=function(y){return"
  • "+y+`
  • `},K.checkbox=function(y){return" "},K.paragraph=function(y){return"

    "+y+`

    `},K.table=function(y,S){return S&&(S=""+S+""),` `+y+` `+S+`
    `},K.tablerow=function(y){return` `+y+` `},K.tablecell=function(y,S){var D=S.header?"th":"td",j=S.align?"<"+D+' align="'+S.align+'">':"<"+D+">";return j+y+" `},K.strong=function(y){return""+y+""},K.em=function(y){return""+y+""},K.codespan=function(y){return""+y+""},K.br=function(){return this.options.xhtml?"
    ":"
    "},K.del=function(y){return""+y+""},K.link=function(y,S,D){if(y=He(this.options.sanitize,this.options.baseUrl,y),y===null)return D;var j='",j},K.image=function(y,S,D){if(y=He(this.options.sanitize,this.options.baseUrl,y),y===null)return D;var j=''+D+'":">",j},K.text=function(y){return y},te}(),Be=function(){function te(){}var K=te.prototype;return K.strong=function(y){return y},K.em=function(y){return y},K.codespan=function(y){return y},K.del=function(y){return y},K.html=function(y){return y},K.text=function(y){return y},K.link=function(y,S,D){return""+D},K.image=function(y,S,D){return""+D},K.br=function(){return""},te}(),Ze=function(){function te(){this.seen={}}var K=te.prototype;return K.slug=function(y){var S=y.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(S)){var D=S;do this.seen[D]++,S=D+"-"+this.seen[D];while(this.seen.hasOwnProperty(S))}return this.seen[S]=0,S},te}(),at=_.defaults,et=L.unescape,nt=function(){function te(q){this.options=q||at,this.options.renderer=this.options.renderer||new Re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Be,this.slugger=new Ze}te.parse=function(y,S){var D=new te(S);return D.parse(y)};var K=te.prototype;return K.parse=function(y,S){S===void 0&&(S=!0);var D="",j,fe,Ae,Ke,yt,Tt,Ge,Et,mt,tt,Dt,At,Vt,jt,kt,mn,sn,ft,En=y.length;for(j=0;j0&&kt.tokens[0].type==="text"?(kt.tokens[0].text=ft+" "+kt.tokens[0].text,kt.tokens[0].tokens&&kt.tokens[0].tokens.length>0&&kt.tokens[0].tokens[0].type==="text"&&(kt.tokens[0].tokens[0].text=ft+" "+kt.tokens[0].tokens[0].text)):kt.tokens.unshift({type:"text",text:ft}):jt+=ft),jt+=this.parse(kt.tokens,Vt),mt+=this.renderer.listitem(jt,sn,mn);D+=this.renderer.list(mt,Dt,At);continue}case"html":{D+=this.renderer.html(tt.text);continue}case"paragraph":{D+=this.renderer.paragraph(this.parseInline(tt.tokens));continue}case"text":{for(mt=tt.tokens?this.parseInline(tt.tokens):tt.text;j+1An error occurred:

    "+it(Ae.message+"",!0)+"
    ";throw Ae}}Pe.options=Pe.setOptions=function(te){return pt(Pe.defaults,te),vt(Pe.defaults),Pe},Pe.getDefaults=Oe,Pe.defaults=st,Pe.use=function(te){var K=pt({},te);if(te.renderer&&function(){var y=Pe.defaults.renderer||new Re,S=function(fe){var Ae=y[fe];y[fe]=function(){for(var Ke=arguments.length,yt=new Array(Ke),Tt=0;Tt`,triples:"",explode:"[]{}"},ne=F.Pos;F.defineOption("autoCloseBrackets",!1,function(U,J,Y){Y&&Y!=F.Init&&(U.removeKeyMap(se),U.state.closeBrackets=null),J&&(G(ge(J,"pairs")),U.state.closeBrackets=J,U.addKeyMap(se))});function ge(U,J){return J=="pairs"&&typeof U=="string"?U:typeof U=="object"&&U[J]!=null?U[J]:le[J]}var se={Backspace:k,Enter:O};function G(U){for(var J=0;J=0;me--){var Ye=he[me].head;U.replaceRange("",ne(Ye.line,Ye.ch-1),ne(Ye.line,Ye.ch+1),"+delete")}}function O(U){var J=I(U),Y=J&&ge(J,"explode");if(!Y||U.getOption("disableInput"))return F.Pass;for(var he=U.listSelections(),me=0;me0;return{anchor:new ne(U.anchor.line,U.anchor.ch+(J?-1:1)),head:new ne(U.head.line,U.head.ch+(J?1:-1))}}function A(U,J){var Y=I(U);if(!Y||U.getOption("disableInput"))return F.Pass;var he=ge(Y,"pairs"),me=he.indexOf(J);if(me==-1)return F.Pass;for(var ze=ge(Y,"closeBefore"),Ye=ge(Y,"triples"),_e=he.charAt(me+1)==J,ke=U.listSelections(),Ue=me%2==0,Ee,Le=0;Le=0&&U.getRange(ce,ne(ce.line,ce.ch+3))==J+J+J?R="skipThree":R="skip";else if(_e&&ce.ch>1&&Ye.indexOf(J)>=0&&U.getRange(ne(ce.line,ce.ch-2),ce)==J+J){if(ce.ch>2&&/\bstring/.test(U.getTokenTypeAt(ne(ce.line,ce.ch-2))))return F.Pass;R="addFour"}else if(_e){var re=ce.ch==0?" ":U.getRange(ne(ce.line,ce.ch-1),ce);if(!F.isWordChar(oe)&&re!=J&&!F.isWordChar(re))R="both";else return F.Pass}else if(Ue&&(oe.length===0||/\s/.test(oe)||ze.indexOf(oe)>-1))R="both";else return F.Pass;if(!Ee)Ee=R;else if(Ee!=R)return F.Pass}var C=me%2?he.charAt(me-1):J,N=me%2?J:he.charAt(me+1);U.operation(function(){if(Ee=="skip")U.execCommand("goCharRight");else if(Ee=="skipThree")for(var P=0;P<3;P++)U.execCommand("goCharRight");else if(Ee=="surround"){for(var w=U.getSelections(),P=0;P0&&($.percent=$.loaded/$.total*100),L.onProgress($)});var d=new FormData;L.data&&Object.keys(L.data).forEach(function(H){var $=L.data[H];if(Array.isArray($)){$.forEach(function(Ce){d.append(H+"[]",Ce)});return}d.append(H,L.data[H])}),L.file instanceof Blob?d.append(L.filename,L.file,L.file.name):d.append(L.filename,L.file),p.onerror=function($){L.onError($)},p.onload=function(){return p.status<200||p.status>=300?L.onError(se(L,p),G(p)):L.onSuccess(G(p),p)},p.open(L.method,L.action,!0),L.withCredentials&&"withCredentials"in p&&(p.withCredentials=!0);var E=L.headers||{};return E["X-Requested-With"]!==null&&p.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(E).forEach(function(H){E[H]!==null&&p.setRequestHeader(H,E[H])}),p.send(d),{abort:function(){p.abort()}}}var I=+new Date,k=0;function O(){return"rc-upload-"+I+"-"+ ++k}function T(L,p){return L.indexOf(p,L.length-p.length)!==-1}var A=function(L,p){if(L&&p){var d=Array.isArray(p)?p:p.split(","),E=L.name||"",H=L.type||"",$=H.replace(/\/.*$/,"");return d.some(function(Ce){var Me=Ce.trim();return Me.charAt(0)==="."?T(E.toLowerCase(),Me.toLowerCase()):/\/\*$/.test(Me)?$===Me.replace(/\/.*$/,""):H===Me})}return!0};function ee(L,p){var d=L.createReader(),E=[];function H(){d.readEntries(function($){var Ce=Array.prototype.slice.apply($);E=E.concat(Ce);var Me=!Ce.length;Me?p(E):H()})}H()}var Q=function(p,d,E){var H=function $(Ce,Me){Me=Me||"",Ce.isFile?Ce.file(function(be){E(be)&&(Ce.fullPath&&!be.webkitRelativePath&&(Object.defineProperties(be,{webkitRelativePath:{writable:!0}}),be.webkitRelativePath=Ce.fullPath.replace(/^\//,""),Object.defineProperties(be,{webkitRelativePath:{writable:!1}})),d([be]))}):Ce.isDirectory&&ee(Ce,function(be){be.forEach(function(xe){$(xe,""+Me+Ce.name+"/")})})};p.forEach(function($){H($.webkitGetAsEntry())})},U=Q,J=Object.assign||function(L){for(var p=1;p=0)continue;if(!Object.prototype.hasOwnProperty.call(L,E))continue;d[E]=L[E]}return d}function Ye(L,p){if(!(L instanceof p))throw new TypeError("Cannot call a class as a function")}function _e(L,p){if(!L)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:L}function ke(L,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);L.prototype=Object.create(p&&p.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(L,p):L.__proto__=p)}var Ue=function(p){return Object.keys(p).reduce(function(d,E){return(E.substr(0,5)==="data-"||E.substr(0,5)==="aria-"||E==="role")&&(d[E]=p[E]),d},{})},Ee=function(L){ke(p,L);function p(){var d,E,H,$;Ye(this,p);for(var Ce=arguments.length,Me=Array(Ce),be=0;be=7&&this.setupTypeNumber(I),this.dataCache==null&&(this.dataCache=G.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,k)},_.setupPositionProbePattern=function(I,k){for(var O=-1;O<=7;O++){if(I+O<=-1||this.moduleCount<=I+O)continue;for(var T=-1;T<=7;T++){if(k+T<=-1||this.moduleCount<=k+T)continue;0<=O&&O<=6&&(T==0||T==6)||0<=T&&T<=6&&(O==0||O==6)||2<=O&&O<=4&&2<=T&&T<=4?this.modules[I+O][k+T]=!0:this.modules[I+O][k+T]=!1}}},_.getBestMaskPattern=function(){for(var I=0,k=0,O=0;O<8;O++){this.makeImpl(!0,O);var T=ge.getLostPoint(this);(O==0||I>T)&&(I=T,k=O)}return k},_.createMovieClip=function(I,k,O){var T=I.createEmptyMovieClip(k,O),A=1;this.make();for(var ee=0;ee>O&1)==1;this.modules[Math.floor(O/3)][O%3+this.moduleCount-8-3]=T}for(var O=0;O<18;O++){var T=!I&&(k>>O&1)==1;this.modules[O%3+this.moduleCount-8-3][Math.floor(O/3)]=T}},_.setupTypeInfo=function(I,k){for(var O=this.errorCorrectLevel<<3|k,T=ge.getBCHTypeInfo(O),A=0;A<15;A++){var ee=!I&&(T>>A&1)==1;A<6?this.modules[A][8]=ee:A<8?this.modules[A+1][8]=ee:this.modules[this.moduleCount-15+A][8]=ee}for(var A=0;A<15;A++){var ee=!I&&(T>>A&1)==1;A<8?this.modules[8][this.moduleCount-A-1]=ee:A<9?this.modules[8][15-A-1+1]=ee:this.modules[8][15-A-1]=ee}this.modules[this.moduleCount-8][8]=!I},_.mapData=function(I,k){for(var O=-1,T=this.moduleCount-1,A=7,ee=0,Q=this.moduleCount-1;Q>0;Q-=2)for(Q==6&&Q--;;){for(var U=0;U<2;U++)if(this.modules[T][Q-U]==null){var J=!1;ee>>A&1)==1);var Y=ge.getMask(k,T,Q-U);Y&&(J=!J),this.modules[T][Q-U]=J,A--,A==-1&&(ee++,A=7)}if(T+=O,T<0||this.moduleCount<=T){T-=O,O=-O;break}}},G.PAD0=236,G.PAD1=17,G.createData=function(I,k,O){for(var T=le.getRSBlocks(I,k),A=new ne,ee=0;eeU*8)throw new Error("code length overflow. ("+A.getLengthInBits()+">"+U*8+")");for(A.getLengthInBits()+4<=U*8&&A.put(0,4);A.getLengthInBits()%8!=0;)A.putBit(!1);for(;!(A.getLengthInBits()>=U*8);){if(A.put(G.PAD0,8),A.getLengthInBits()>=U*8)break;A.put(G.PAD1,8)}return G.createBytes(A,T)},G.createBytes=function(I,k){for(var O=0,T=0,A=0,ee=new Array(k.length),Q=new Array(k.length),U=0;U=0?Ye.get(_e):0}}for(var ke=0,he=0;he=0;)_^=se.G15<=0;)_^=se.G18<>>=1;return _},getPatternPosition:function(G){return se.PATTERN_POSITION_TABLE[G-1]},getMask:function(G,_,I){switch(G){case ge.PATTERN000:return(_+I)%2==0;case ge.PATTERN001:return _%2==0;case ge.PATTERN010:return I%3==0;case ge.PATTERN011:return(_+I)%3==0;case ge.PATTERN100:return(Math.floor(_/2)+Math.floor(I/3))%2==0;case ge.PATTERN101:return _*I%2+_*I%3==0;case ge.PATTERN110:return(_*I%2+_*I%3)%2==0;case ge.PATTERN111:return(_*I%3+(_+I)%2)%2==0;default:throw new Error("bad maskPattern:"+G)}},getErrorCorrectPolynomial:function(G){for(var _=new le([1],0),I=0;I5&&(I+=3+T-5)}for(var k=0;k<_-1;k++)for(var O=0;O<_-1;O++){var U=0;G.isDark(k,O)&&U++,G.isDark(k+1,O)&&U++,G.isDark(k,O+1)&&U++,G.isDark(k+1,O+1)&&U++,(U==0||U==4)&&(I+=3)}for(var k=0;k<_;k++)for(var O=0;O<_-6;O++)G.isDark(k,O)&&!G.isDark(k,O+1)&&G.isDark(k,O+2)&&G.isDark(k,O+3)&&G.isDark(k,O+4)&&!G.isDark(k,O+5)&&G.isDark(k,O+6)&&(I+=40);for(var O=0;O<_;O++)for(var k=0;k<_-6;k++)G.isDark(k,O)&&!G.isDark(k+1,O)&&G.isDark(k+2,O)&&G.isDark(k+3,O)&&G.isDark(k+4,O)&&!G.isDark(k+5,O)&&G.isDark(k+6,O)&&(I+=40);for(var J=0,O=0;O<_;O++)for(var k=0;k<_;k++)G.isDark(k,O)&&J++;var Y=Math.abs(100*J/_/_-50)/5;return I+=Y*10,I}};ot.exports=se},LdHM:function(ot,Je,x){"use strict";x.d(Je,"b",function(){return ze}),x.d(Je,"a",function(){return _e});var F=x("1OyB"),le=x("vuIU"),ne=x("Ji7U"),ge=x("LK+K"),se=x("q1tI"),G=x("rePB"),_=x("Ff2n"),I=x("ODXe"),k=x("4IlW"),O=x("bX4T"),T=x("YrtM"),A=x("TSYQ"),ee=x.n(A),Q=x("+nKL"),U=x("8OUc"),J=function(E,H){var $=E.prefixCls,Ce=E.id,Me=E.flattenOptions,be=E.childrenAsData,xe=E.values,ue=E.searchValue,ve=E.multiple,Z=E.defaultActiveFirstOption,z=E.height,b=E.itemHeight,W=E.notFoundContent,M=E.open,ye=E.menuItemSelectedIcon,we=E.virtual,ie=E.onSelect,Te=E.onToggleOpen,Ne=E.onActiveValue,He=E.onScroll,Ie=E.onMouseEnter,Re="".concat($,"-item"),Be=Object(T.a)(function(){return Me},[M,Me],function(Xe,te){return te[0]&&Xe[1]!==te[1]}),Ze=se.useRef(null),at=function(te){te.preventDefault()},et=function(te){Ze.current&&Ze.current.scrollTo({index:te})},nt=function(te){for(var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,q=Be.length,y=0;y1&&arguments[1]!==void 0?arguments[1]:!1;return Object(Ue.a)(d).map(function(H,$){if(!se.isValidElement(H)||!H.type)return null;var Ce=H.type.isSelectOptGroup,Me=H.key,be=H.props,xe=be.children,ue=Object(_.a)(be,["children"]);return E||!Ce?Ee(H):Object(ke.a)(Object(ke.a)({key:"__RC_SELECT_GRP__".concat(Me===null?$:Me,"__"),label:Me},ue),{},{options:Le(xe)})}).filter(function(H){return H})}var Se=x("2Qr1"),ce=x("qNPg"),R=x("U8pU"),oe=x("Kwbf"),re=x("WKfj");function C(d){var E=d.mode,H=d.options,$=d.children,Ce=d.backfill,Me=d.allowClear,be=d.placeholder,xe=d.getInputElement,ue=d.showSearch,ve=d.onSearch,Z=d.defaultOpen,z=d.autoFocus,b=d.labelInValue,W=d.value,M=d.inputValue,ye=d.optionLabelProp,we=E==="multiple"||E==="tags",ie=ue!==void 0?ue:we||E==="combobox",Te=H||Le($);if(Object(oe.a)(E!=="tags"||Te.every(function(Re){return!Re.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),E==="tags"||E==="combobox"){var Ne=Te.some(function(Re){return Re.options?Re.options.some(function(Be){return typeof("value"in Be?Be.value:Be.key)=="number"}):typeof("value"in Re?Re.value:Re.key)=="number"});Object(oe.a)(!Ne,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(oe.a)(E!=="combobox"||!ye,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(oe.a)(E==="combobox"||!Ce,"`backfill` only works with `combobox` mode."),Object(oe.a)(E==="combobox"||!xe,"`getInputElement` only work with `combobox` mode."),Object(oe.b)(E!=="combobox"||!xe||!Me||!be,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ve&&!ie&&E!=="combobox"&&E!=="tags"&&Object(oe.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(oe.b)(!Z||z,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),W!=null){var He=Object(re.d)(W);Object(oe.a)(!b||He.every(function(Re){return Object(R.a)(Re)==="object"&&("key"in Re||"value"in Re)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(oe.a)(!we||Array.isArray(W),"`value` should be array when `mode` is `multiple` or `tags`")}if($){var Ie=null;Object(Ue.a)($).some(function(Re){if(!se.isValidElement(Re)||!Re.type)return!1;var Be=Re.type;if(Be.isSelectOption)return!1;if(Be.isSelectOptGroup){var Ze=Object(Ue.a)(Re.props.children).every(function(at){return!se.isValidElement(at)||!Re.type||at.type.isSelectOption?!0:(Ie=at.type,!1)});return!Ze}return Ie=Be,!0}),Ie&&Object(oe.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ie.displayName||Ie.name||Ie,"`.")),Object(oe.a)(M===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var N=C,P=Object(ce.a)({prefixCls:"rc-select",components:{optionList:he},convertChildrenToData:Le,flattenOptions:Se.d,getLabeledValue:Se.e,filterOptions:Se.b,isValueDisabled:Se.g,findValueOption:Se.c,warningProps:N,fillOptionsWithMissingValue:Se.a}),w=function(d){Object(ne.a)(H,d);var E=Object(ge.a)(H);function H(){var $;return Object(F.a)(this,H),$=E.apply(this,arguments),$.selectRef=se.createRef(),$.focus=function(){$.selectRef.current.focus()},$.blur=function(){$.selectRef.current.blur()},$}return Object(le.a)(H,[{key:"render",value:function(){return se.createElement(P,Object.assign({ref:this.selectRef},this.props))}}]),H}(se.Component);w.Option=ze,w.OptGroup=_e;var L=w,p=Je.c=L},M8RZ:function(ot,Je,x){"use strict";x.d(Je,"a",function(){return k});var F=x("fWQN"),le=x("mtLc"),ne=x("yKVA"),ge=x("879j"),se=x("q1tI"),G=x.n(se),_=x("i8i4"),I=x.n(_),k=function(O){Object(ne.a)(A,O);var T=Object(ge.a)(A);function A(ee){var Q;Object(F.a)(this,A),Q=T.call(this,ee);var U=window.document;return Q.node=U.createElement("div"),U.body.appendChild(Q.node),Q}return Object(le.a)(A,[{key:"render",value:function(){var Q=this.props.children;return Object(_.createPortal)(Q,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),A}(G.a.Component)},OLES:function(ot,Je,x){"use strict";var F=x("U8pU"),le=x("VTBJ"),ne=x("Ff2n"),ge=x("q1tI"),se=x("uciX"),G=x("7ixt"),_=function(ee){var Q=ee.overlay,U=ee.prefixCls,J=ee.id,Y=ee.overlayInnerStyle;return ge.createElement("div",{className:"".concat(U,"-inner"),id:J,role:"tooltip",style:Y},typeof Q=="function"?Q():Q)},I=_,k=function(ee,Q){var U=ee.overlayClassName,J=ee.trigger,Y=J===void 0?["hover"]:J,he=ee.mouseEnterDelay,me=he===void 0?0:he,ze=ee.mouseLeaveDelay,Ye=ze===void 0?.1:ze,_e=ee.overlayStyle,ke=ee.prefixCls,Ue=ke===void 0?"rc-tooltip":ke,Ee=ee.children,Le=ee.onVisibleChange,Se=ee.afterVisibleChange,ce=ee.transitionName,R=ee.animation,oe=ee.placement,re=oe===void 0?"right":oe,C=ee.align,N=C===void 0?{}:C,P=ee.destroyTooltipOnHide,w=P===void 0?!1:P,L=ee.defaultVisible,p=ee.getTooltipContainer,d=ee.overlayInnerStyle,E=Object(ne.a)(ee,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),H=Object(ge.useRef)(null);Object(ge.useImperativeHandle)(Q,function(){return H.current});var $=Object(le.a)({},E);"visible"in ee&&($.popupVisible=ee.visible);var Ce=function(){var ve=ee.arrowContent,Z=ve===void 0?null:ve,z=ee.overlay,b=ee.id;return[ge.createElement("div",{className:"".concat(Ue,"-arrow"),key:"arrow"},Z),ge.createElement(I,{key:"content",prefixCls:Ue,id:b,overlay:z,overlayInnerStyle:d})]},Me=!1,be=!1;if(typeof w=="boolean")Me=w;else if(w&&Object(F.a)(w)==="object"){var xe=w.keepParent;Me=xe===!0,be=xe===!1}return ge.createElement(se.a,Object.assign({popupClassName:U,prefixCls:Ue,popup:Ce,action:Y,builtinPlacements:G.a,popupPlacement:re,ref:H,popupAlign:N,getPopupContainer:p,onPopupVisibleChange:Le,afterPopupVisibleChange:Se,popupTransitionName:ce,popupAnimation:R,defaultPopupVisible:L,destroyPopupOnHide:Me,autoDestroy:be,mouseLeaveDelay:Ye,popupStyle:_e,mouseEnterDelay:me},$),Ee)},O=Object(ge.forwardRef)(k),T=Je.a=O},Ot1p:function(ot,Je,x){"use strict";var F=x("2qtc"),le=x("kLXV"),ne=x("rAM+"),ge=x("miYZ"),se=x("tsqr"),G=x("9og8"),_=x("tJVT"),I=x("jrin"),k=x("WmNS"),O=x.n(k),T=x("q1tI"),A=x.n(T),ee=x("VrN/"),Q=x.n(ee),U=x("bdgK"),J=x("p77/"),Y=x("Bd2K"),he=x("ELLl"),me=x("19Vz"),ze=x("lZu9"),Ye=x("+NIl"),_e=x("kSUc"),ke=x("9Bee"),Ue=function(Ge){var Et=Ge.value,mt=Et===void 0?"":Et,tt=Ge.className,Dt=Ge.showTextOnly,At=Ge.showLines,Vt=Ge.style,jt=Vt===void 0?{}:Vt,kt=Object(T.useMemo)(function(){return""},[mt]);return A.a.createElement(A.a.Fragment,null,A.a.createElement("div",{dangerouslySetInnerHTML:{__html:kt}}))},Ee=x("Q9mQ"),Le=x("diRs"),Se=x("0Owb"),ce=x("dejd"),R=x("C+DQ"),oe=x("D1Df"),re=x.n(oe),C=x("1vsH"),N=x("m3rI"),P=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function w(Ge){var Et=Ge.onActionCallback,mt=Ge.title,tt=Ge.icon,Dt=Ge.actionName,At=Ge.className,Vt=At===void 0?"":At,jt=Ge.children;function kt(){Et(Dt)}return A.a.createElement("a",{title:mt,className:Vt,onClick:kt},A.a.createElement("i",{className:"md-iconfont ".concat(tt)}),jt)}var L=function(Ge){var Et=Ge.watch,mt=Ge.showNullButton,tt=Ge.onActionCallback,Dt=Ge.fullScreen,At=Ge.insertTemp,Vt=Ge.hidetoolBar,jt=Ge.uuid,kt=Ge.setOpenPhones,mn=Object(C.E)("_educoder_session_login"),sn=Object(C.E)("_educoder_session"),ft=[].concat(P,[{title:"".concat(Et?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Et?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return A.a.createElement("ul",{className:"markdown-toolbar-container"},!Vt&&ft.map(function(En,ln){return A.a.createElement("li",{key:ln},En.actionName?A.a.createElement(w,Object(Se.a)({},En,{onActionCallback:tt})):A.a.createElement("span",{className:"v-line"}))}),mt?A.a.createElement("li",null,A.a.createElement(w,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:tt},A.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,At&&A.a.createElement("li",null,A.a.createElement(w,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(At),onActionCallback:tt},A.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),A.a.createElement("li",null,A.a.createElement(Le.a,{title:"\u6253\u5F00\u624B\u673A\u626B\u4E00\u626B",content:A.a.createElement("div",null,A.a.createElement("span",{style:{display:"none"}},location.origin+"/react/build/upload.html?_educoder_session_login="+mn+"&_educoder_session="+sn+"&key="+jt+"&api="+encodeURIComponent(N.a.API_SERVER)),A.a.createElement(re.a,{size:150,fgColor:"#000",value:location.origin+"/react/build/upload.html?_educoder_session_login="+mn+"&_educoder_session="+sn+"&key="+jt+"&api="+encodeURIComponent(N.a.API_SERVER)}))},A.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return kt(!0)}},"\u624B\u673A\u4E0A\u4F20\u6587\u4EF6"))),A.a.createElement("li",{className:"btn-full-screen"},A.a.createElement(w,{icon:"".concat(Dt?"icon-shrink":"icon-enlarge"),title:Dt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:tt})))},p=x("M8RZ"),d=x("+L6B"),E=x("2/Rp"),H=x("y8nQ"),$=x("Vl3Y"),Ce=x("5NDa"),Me=x("5rEg"),be={labelCol:{span:4},wrapperCol:{span:20}},xe=function(Ge){var Et=Ge.callback,mt=Ge.onCancel;function tt(Dt){Et(Dt)}return A.a.createElement($.a,Object(Se.a)({},be,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:tt}),A.a.createElement($.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},A.a.createElement(Me.a,null)),A.a.createElement($.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},A.a.createElement(Me.a,null)),A.a.createElement("div",{className:"flex-container flex-end"},A.a.createElement(E.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(E.a,{type:"ghost",onClick:mt},"\u53D6\u6D88")))},ue=x("7ahc"),ve=x("k1fw"),Z=x("HmJG"),z=x("BjJ7"),b=$.a.useForm,W={width:280,marginRight:10},M={labelCol:{span:5},wrapperCol:{span:19}},ye=function(Ge){var Et=Ge.callback,mt=Ge.onCancel,tt=b(),Dt=Object(_.a)(tt,1),At=Dt[0],Vt=Object(T.useRef)();function jt(sn){Et(Object(ve.a)(Object(ve.a)({},sn),{},{name:Vt.current}))}function kt(sn,ft){At.setFieldsValue({src:"/api/attachments/".concat(sn.id,"?type=").concat(sn.content_type),type:ft.type})}function mn(sn){var ft=sn.target.files[0];Vt.current=ft.name,ie(ft,kt)}return A.a.createElement($.a,Object(Se.a)({form:At},M,{className:"upload-image-panel",onFinish:jt}),A.a.createElement($.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},A.a.createElement("div",{className:"flex-container"},A.a.createElement($.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},A.a.createElement(Me.a,{style:W})),A.a.createElement(we,{onFileChange:mn}))),A.a.createElement($.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},A.a.createElement(Me.a,{style:{width:264}})),A.a.createElement($.a.Item,{style:{textAlign:"right"}},A.a.createElement(E.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(E.a,{type:"ghost",onClick:mt},"\u53D6\u6D88")))};function we(Ge){var Et=Ge.onFileChange;return A.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",A.a.createElement("input",{type:"file",onChange:Et}))}function ie(Ge,Et){if(!Ge)throw new String("\u6CA1\u6709\u6587\u4EF6");var mt=new FormData;mt.append("editormd-image-file",Ge),mt.append("file_param_name","editormd-image-file"),mt.append("byxhr","true");var tt=new window.XMLHttpRequest;tt.withCredentials=!0,tt.addEventListener("load",function(Dt){Et(JSON.parse(Dt.target.responseText),Ge)},!1),tt.addEventListener("error",function(Dt){console.error(Dt)},!1),tt.open("POST","".concat(z.a,"/api/attachments.json")),tt.send(mt)}var Te=x("giR+"),Ne=x("fyUT"),He=x("7Kak"),Ie=x("9yH6"),Re=Ie.a.Group,Be={margin:"0 8px"},Ze=function(Ge){var Et=Ge.callback,mt=Ge.onCancel;function tt(Dt){Et(Dt)}return A.a.createElement($.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:tt},A.a.createElement("div",{className:"flex-container"},A.a.createElement("span",{style:Be},"\u5355\u5143\u683C\u6570\uFF1A"),A.a.createElement("span",{style:Be},"\u884C\u6570"),A.a.createElement($.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},A.a.createElement(Ne.a,null)),A.a.createElement("span",{style:Be},"\u5217\u6570"),A.a.createElement($.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},A.a.createElement(Ne.a,null))),A.a.createElement("div",{className:"flex-container",style:{marginTop:12}},A.a.createElement("span",{style:Be},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),A.a.createElement($.a.Item,{name:"align"},A.a.createElement(Re,null,A.a.createElement(Ie.a,{value:"default"},A.a.createElement("i",{className:"fa fa-align-justify"})),A.a.createElement(Ie.a,{value:"left"},A.a.createElement("i",{className:"fa fa-align-left"})),A.a.createElement(Ie.a,{value:"center"},A.a.createElement("i",{className:"fa fa-align-center"})),A.a.createElement(Ie.a,{value:"right"},A.a.createElement("i",{className:"fa fa-align-right"}))))),A.a.createElement("div",{className:"flex-container flex-end"},A.a.createElement(E.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(E.a,{type:"ghost",onClick:mt},"\u53D6\u6D88")))},at=x("ErOA"),et=x("7Cbv"),nt="link",pt="upload-image",ut="code-block",it="add-table",Oe="------------",vt={default:Oe,left:":".concat(Oe),center:":".concat(Oe,":"),right:"".concat(Oe,":")},st=x("9VGf"),Pe,Xe;function te(){}var K=0,q=1e4,y="\u2581",S=` **\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 D(Ge){return/^\d+$/.test(Ge)?"".concat(Ge,"px"):Ge}var j=navigator.platform.toUpperCase().indexOf("MAC")>=0,fe=j?"Cmd":"Ctrl",Ae=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],Ke=(Pe={},Object(I.a)(Pe,fe+"-B","bold"),Object(I.a)(Pe,fe+"-I","italic"),Pe),yt=(Xe={},Object(I.a)(Xe,nt,"\u6DFB\u52A0\u94FE\u63A5"),Object(I.a)(Xe,ut,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(I.a)(Xe,pt,"\u6DFB\u52A0\u6587\u4EF6"),Object(I.a)(Xe,it,"\u6DFB\u52A0\u8868\u683C"),Xe),Tt=Je.a=function(Ge){var Et=Ge.defaultValue,mt=Et===void 0?"":Et,tt=Ge.onChange,Dt=Ge.width,At=Dt===void 0?"100%":Dt,Vt=Ge.height,jt=Vt===void 0?400:Vt,kt=Ge.miniToolbar,mn=kt===void 0?!1:kt,sn=Ge.isFocus,ft=sn===void 0?!1:sn,En=Ge.watch,ln=Ge.insertTemp,gn=Ge.mode,Tn=gn===void 0?"markdown":gn,li=Ge.id,Xn=li===void 0?"markdown-editor-id":li,Nt=Ge.showResizeBar,ct=Nt===void 0?!1:Nt,Un=Ge.noStorage,ui=Un===void 0?!1:Un,_n=Ge.showNullButton,Rt=_n===void 0?!1:_n,Kn=Ge.hidetoolBar,hi=Kn===void 0?!1:Kn,vi=Ge.fullScreen,Ve=vi===void 0?!1:vi,Ct=Ge.onBlur,ti=Ge.onCMBeforeChange,ci=Ge.onFullScreen,di=Ge.className,Ri=di===void 0?"":di,c=Ge.disablePaste,o=c===void 0?!1:c,a=Ge.placeholder,u=a===void 0?"":a,g=Ge.values,h=g===void 0?"":g,X=Object(T.useState)(null),je=Object(_.a)(X,2),pe=je[0],ht=je[1],Fe=Object(T.useState)(mt),wt=Object(_.a)(Fe,2),Pt=wt[0],Ht=wt[1],Hn=Object(T.useState)(En),zn=Object(_.a)(Hn,2),un=zn[0],Yn=zn[1],Xi=Object(T.useState)(Ve),An=Object(_.a)(Xi,2),Ln=An[0],ni=An[1],yi=Object(T.useState)(""),Jn=Object(_.a)(yi,2),ii=Jn[0],Wn=Jn[1],fr=Object(T.useState)(0),Ki=Object(_.a)(fr,2),Nn=Ki[0],In=Ki[1],Oi=Object(T.useState)(jt),Di=Object(_.a)(Oi,2),Pi=Di[0],qt=Di[1],Bt=Object(T.useState)(!1),vn=Object(_.a)(Bt,2),Ft=vn[0],yn=vn[1],Kt=Object(T.useRef)(Object(et.a)()),bi=Object(T.useRef)(!1),rn=Object(T.useRef)(),on=Object(T.useRef)(),ri=Object(T.useRef)(),xi=Object(T.useRef)(),Ci=Object(T.useRef)(),Fr=function(){var dt=Object(G.a)(O.a.mark(function St(){var bt,Lt;return O.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return zt.next=2,Object(at.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Kt.current}});case 2:Lt=zt.sent,Lt!=null&&(bt=Lt.attachments)!==null&&bt!==void 0&&bt.length&&(console.log("cm:",pe,on),Lt.attachments.map(function(Ot){Ot.content_type.indexOf("image")>-1?pe.replaceSelection("![,](/api/attachments/".concat(Ot.id,"?type=").concat(Ot.content_type,")")):Ot.content_type.indexOf("video")>-1?pe.replaceSelection('')):Ot.content_type.indexOf("pdf")>-1?pe.replaceSelection('
    ').concat(Ot.name,"")):pe.replaceSelection("[".concat(Ot.name,"](").concat(N.a.API_SERVER,"/api/attachments/").concat(Ot.id,"?type=").concat(Ot.content_type,")"))}));case 4:case"end":return zt.stop()}},St)}));return function(){return dt.apply(this,arguments)}}();Object(T.useEffect)(function(){Ht(h),pe==null||pe.setValue(h)},[h]),Object(T.useEffect)(function(){ci==null||ci(Ln)},[Ln]),Object(T.useEffect)(function(){if(on.current){var dt=Q.a.fromTextArea(on.current,{mode:Tn,lineNumbers:!mn,lineWrapping:!0,value:mt,autoCloseTags:!0,autoCloseBrackets:!0});ft&&dt.focus();function St(bt,Lt){if(o){Lt.preventDefault();return}var It=Lt.clipboardData;if(It){var zt=It.types.toString(),Ot=It.items;if(zt==="Files"||It.types.indexOf("Files")>-1){if(Lt.preventDefault(),Tn=="stex")return;try{var Jt,hn=Ot[1];((Jt=Ot[0])===null||Jt===void 0?void 0:Jt.kind)==="file"&&(hn=Ot[0]);var Mt=hn.getAsFile(),Ni=Mt.name.split(".").pop();ie(Mt,function(Wt){if(Wt.id){var bn,Xt,$n;(Mt==null||((bn=Mt.type)===null||bn===void 0)?void 0:bn.indexOf("image"))>-1?dt.replaceSelection("![,](/api/attachments/".concat(Wt.id,"?type=").concat(Wt.content_type,")")):(Mt==null||((Xt=Mt.type)===null||Xt===void 0)?void 0:Xt.indexOf("video"))>-1?dt.replaceSelection('')):(Mt==null||(($n=Mt.type)===null||$n===void 0)?void 0:$n.indexOf("pdf"))>-1?dt.replaceSelection('').concat(Mt.name,"")):Ae.includes(Ni)?dt.replaceSelection('').concat(Mt.name,"")):dt.replaceSelection("[".concat(Mt.name,"](").concat(N.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})}catch(Wt){se.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return dt.on("paste",St),dt.on("dragleave",function(bt,Lt){ri.current.classList.remove("mouse-hover-md")}),dt.on("dragover",function(bt,Lt){ri.current.classList.add("mouse-hover-md")}),dt.on("drop",function(bt,Lt){ri.current.classList.add("mouse-hover-md");var It;if(It=Lt.dataTransfer.files,It.length>0){Lt.preventDefault(),Lt.stopPropagation();for(var zt=function(hn){var Mt=It[hn],Ni=Mt.name.split(".").pop();ie(Mt,function(Wt){if(Wt.id){var bn,Xt,$n;(Mt==null||((bn=Mt.type)===null||bn===void 0)?void 0:bn.indexOf("image"))>-1?dt.replaceSelection("![,](/api/attachments/".concat(Wt.id,"?type=").concat(Wt.content_type,")")):(Mt==null||((Xt=Mt.type)===null||Xt===void 0)?void 0:Xt.indexOf("video"))>-1?dt.replaceSelection('')):(Mt==null||(($n=Mt.type)===null||$n===void 0)?void 0:$n.indexOf("pdf"))>-1?dt.replaceSelection('').concat(Mt.name,"")):Ae.includes(Ni)?dt.replaceSelection('').concat(Mt.name,"")):dt.replaceSelection("[".concat(Mt.name,"](").concat(N.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})},Ot=0;Ot0||Ot.target.offsetWidth>0)&&(Zn(),pe.setSize("100%","100%"),pe.refresh())}}catch(Jt){It.e(Jt)}finally{It.f()}});return bt.observe(on.current.parentElement),bt}if(pe){var St=dt();return function(){St.unobserve(on.current.parentElement)}}},[pe,Zn]),Object(T.useEffect)(function(){if(pe){for(var dt=[],St=function(){var Ot=Lt[bt];It=Object(_.a)(Ot,2);var Jt=It[0],hn=It[1],Mt=Object(I.a)({},Jt,function(){Yi(hn)});dt.push(Mt),pe.addKeyMap(Mt)},bt=0,Lt=Object.entries(Ke);bt0){var dt=new Date().getTime(),St=window.sessionStorage.getItem(Xn);dt>=Nn+q&&(!St||St!==Pt)&&(window.sessionStorage.setItem(Xn,Pt),yn(!0))}},q),Object(T.useEffect)(function(){Yn(En)},[pe,En]),Object(T.useEffect)(function(){pe&&(ft&&pe.focus())},[pe,ft]),Object(T.useEffect)(function(){if(un&&pe){var dt=pe.getScrollerElement();function St(bt){var Lt=bt.target;if(Ci.current){var It=Lt.scrollTop/Lt.scrollHeight;Ci.current.scrollTop=Ci.current.scrollHeight*It}}return dt.addEventListener("scroll",St),function(){dt.removeEventListener("scroll",St)}}},[pe,un]),Object(T.useEffect)(function(){if(pe&&ti){function dt(St,bt){ti(St,bt)}return pe.on("beforeChange",dt),function(){pe.off("beforeChange",dt)}}},[pe,ti]),Object(T.useEffect)(function(){if(pe&&Ct){function dt(){Ct(pe.getValue())}return pe.on("blur",dt),function(){pe.off("blur",dt)}}},[pe,Ct]),Object(T.useEffect)(function(){if(pe){function dt(St){var bt=St.getValue();Ht(bt),In(new Date().getTime()),St.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),tt&&tt(bt)}return pe.on("change",dt),function(){pe.off("change",dt)}}},[pe,tt]),Object(T.useEffect)(function(){pe&&(mt==null?(pe.setValue(""),Ht("")):mt!==pe.getValue()&&(pe.setValue(mt),Ht(mt),pe.setCursor(pe.lineCount(),0)))},[pe,mt]);var Yi=Object(T.useCallback)(function(dt){var St=pe.getCursor(),bt=pe.getSelection(),Lt=bt.split(` `);switch(dt){case"bold":return pe.replaceSelection("**"+bt+"**"),bt===""&&pe.setCursor(St.line,St.ch+2),pe.focus();case"italic":return pe.replaceSelection("*"+bt+"*"),bt===""&&pe.setCursor(St.line,St.ch+1),pe.focus();case"code":return pe.replaceSelection("`"+bt+"`"),bt===""&&pe.setCursor(St.line,St.ch+1),pe.focus();case"inline-latex":return pe.replaceSelection("`$$"+bt+"$$`"),bt===""&&pe.setCursor(St.line,St.ch+3),pe.focus();case"latex":return pe.replaceSelection("```latex\n"+bt+"\n```"),pe.setCursor(St.line+1,bt.length+1),pe.focus();case"line-break":return pe.replaceSelection(`
    `),pe.focus();case"list-ul":return bt===""?pe.replaceSelection("- "+bt):pe.replaceSelection(Lt.map(function(It){return It===""?"":"- ".concat(It)}).join(` `)),pe.focus();case"list-ol":return bt===""?pe.replaceSelection("1. "+bt):pe.replaceSelection(Lt.map(function(It,zt){return It===""?"":"".concat(zt+1,". ").concat(It)}).join(` `)),pe.focus();case"add-null-ch":return bt===""&&pe.setCursor(St.line,St.ch+1),pe.replaceSelection(y),pe.focus();case"inster-template-1":return bt===""&&pe.setCursor(St.line,St.ch),pe.replaceSelection(S),pe.focus();case"eraser":return pe.setValue(""),pe.focus();case"trigger-watch":return Yn(!un),pe.focus();case"trigger-full-screen":return ni(!Ln),pe.focus();case nt:Wn(nt);return;case ut:Wn(ut);return;case pt:Wn(pt);return;case it:Wn(it);return;default:throw new Error}},[pe,un,Ln]),jn=Object(T.useCallback)(function(dt){Wn("");switch(ii){case nt:var St=dt.title,bt=dt.link;return pe.replaceSelection("[".concat(St,"](").concat(bt,")")),pe.focus();case ut:var Lt=dt.language,It=dt.content;return pe.replaceSelection(["```"+Lt,It,"```"].join(` `)),pe.focus();case pt:var zt=dt.src,Ot=dt.alt,Jt=dt.name;return zt.indexOf("type=image")>-1?pe.replaceSelection("![ ".concat(Ot||""," ]( ").concat(zt,' "').concat(Ot||"",'" )')):zt.indexOf("type=application/pdf")>-1?pe.replaceSelection('').concat(Jt,"")):pe.replaceSelection('').concat(Jt,"")),pe.focus();case it:for(var hn=dt.row,Mt=dt.col,Ni=dt.align,Wt=` `,bn=0;bn300&&(Jt=300);var hn=jt+Jt+"px";qt(hn)}}return dt.addEventListener("mousedown",Lt),document.addEventListener("mousemove",zt),document.addEventListener("mouseup",It),function(){dt.removeEventListener("mousedown",Lt),document.removeEventListener("mousemove",zt),document.removeEventListener("mouseup",It)}}},[pe,xi]),Object(T.useEffect)(function(){qt(jt)},[jt]);var wi=D(At),uo=D(Pi),ho={width:wi,height:uo},Zo=Object(T.useMemo)(function(){if(Nn){var dt=new Date(Nn),St=dt.getHours(),bt=dt.getMinutes(),Lt=dt.getSeconds();return St=St<10?"0"+St:St,bt=bt<10?"0"+bt:bt,Lt=Lt<10?"0"+Lt:Lt,"".concat(St,":").concat(bt,":").concat(Lt)}return 0},[Nn]);function Qo(){window.sessionStorage.removeItem(Xn),yn(!1),In(0)}function co(){yn(!1),In(0),pe.setValue(window.sessionStorage.getItem(Xn))}function Ur(dt,St){var bt=pe.getValue();bt=bt.replace(dt,St),Ht(bt),pe==null||pe.setValue(bt)}return A.a.createElement(T.Fragment,null,A.a.createElement("div",{className:"markdown-editor-wrapper",ref:ri},A.a.createElement("div",{className:"markdown-editor-container ".concat(Ri," ").concat(un?"on-preview":""," ").concat(mn?"mini":""," ").concat(Ln?"full-screen":""),style:ho},A.a.createElement(L,{insertTemp:ln,watch:un,fullScreen:Ln,showNullButton:Rt,onActionCallback:Yi,hidetoolBar:hi,uuid:Kt.current,setOpenPhones:function(){bi.current=!0}}),A.a.createElement("div",{className:"markdown-editor-body"},A.a.createElement("div",{className:"codemirror-container"},A.a.createElement("textarea",{ref:on,placeholder:u})),un?A.a.createElement("div",{ref:Ci,className:"preview-container"},Tn==="stex"&&A.a.createElement(Ue,{value:Pt}),Tn!=="stex"&&A.a.createElement(ke.a,{edit:!0,value:Pt,replaces:Ur})):null))),ct?A.a.createElement("a",{ref:xi,className:"editor-resize"}):null,A.a.createElement(p.a,null,yt[ii]?A.a.createElement(le.a,{centered:!0,title:yt[ii],visible:!0,onCancel:fi,footer:null},$i):null))}},SJMd:function(ot,Je){/** * @license * Copyright (C) 2006 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */var x,F,le,ne=!1,ge,se;window.PR_SHOULD_USE_CONTINUATION=!0;var G,_;(function(){var I=window,k=["break,continue,do,else,for,if,return,while"],O=[k,"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"],T=[O,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],A=[T,"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"],ee=[T,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],Q=[T,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],U="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",J=[T,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],Y="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",he=[k,"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"],me=[k,"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"],ze=[k,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Ye=[A,Q,ee,J,Y,he,me,ze],_e=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,ke="str",Ue="kwd",Ee="com",Le="typ",Se="lit",ce="pun",R="pln",oe="tag",re="dec",C="src",N="atn",P="atv",w="nocode",L="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function p(ie){for(var Te=0,Ne=!1,He=!1,Ie=0,Re=ie.length;Ie122||(y<65||q>90||vt.push([Math.max(65,q)|32,Math.min(y,90)|32]),y<97||q>122||vt.push([Math.max(97,q)&~32,Math.min(y,122)&~32]))}}vt.sort(function(fe,Ae){return fe[0]-Ae[0]||Ae[1]-fe[1]});for(var S=[],D=[],Xe=0;Xej[0]&&(j[1]+1>j[0]&&Pe.push("-"),Pe.push(et(j[1])))}return Pe.push("]"),Pe.join("")}function pt(it){for(var Oe=it.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),vt=Oe.length,st=[],Pe=0,Xe=0;Pe=2&&q==="["?Oe[Pe]=nt(te):q!=="\\"&&(Oe[Pe]=te.replace(/[a-zA-Z]/g,function(D){var j=D.charCodeAt(0);return"["+String.fromCharCode(j&~32,j|32)+"]"}))}return Oe.join("")}for(var ut=[],Ie=0,Re=ie.length;Ie=0;)Ne[ut.charAt(it)]=pt;var Oe=pt[1],vt=""+Oe;at.hasOwnProperty(vt)||(Ze.push(Oe),at[vt]=null)}Ze.push(/[\0-\uffff]/),He=p(Ze)})();var Ie=Te.length,Re=function(Be){for(var Ze=Be.sourceCode,at=Be.basePos,et=Be.sourceNode,nt=[at,R],pt=0,ut=Ze.match(He)||[],it={},Oe=0,vt=ut.length;Oe=5&&Pe.substring(0,5)==="lang-",te&&!(Xe&&typeof Xe[1]=="string")&&(te=!1,Pe=C),te||(it[st]=Pe)}var y=pt;if(pt+=st.length,!te)nt.push(at+y,Pe);else{var S=Xe[1],D=st.indexOf(S),j=D+S.length;Xe[2]&&(j=st.length-Xe[2].length,D=j-S.length);var fe=Pe.substring(5);E(et,at+y,st.substring(0,D),Re,nt),E(et,at+y+D,S,z(fe,S),nt),E(et,at+y+j,st.substring(j),Re,nt)}}Be.decorations=nt};return Re}function Me(ie){var Te=[],Ne=[];ie.tripleQuotedStrings?Te.push([ke,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ie.multiLineStrings?Te.push([ke,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Te.push([ke,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ie.verbatimStrings&&Ne.push([ke,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var He=ie.hashComments;He&&(ie.cStyleComments?(He>1?Te.push([Ee,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Te.push([Ee,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ne.push([ke,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Te.push([Ee,/^#[^\r\n]*/,null,"#"])),ie.cStyleComments&&(Ne.push([Ee,/^\/\/[^\r\n]*/,null]),Ne.push([Ee,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ie=ie.regexLiterals;if(Ie){var Re=Ie>1?"":` \r`,Be=Re?".":"[\\S\\s]",Ze="/(?=[^/*"+Re+"])(?:[^/\\x5B\\x5C"+Re+"]|\\x5C"+Be+"|\\x5B(?:[^\\x5C\\x5D"+Re+"]|\\x5C"+Be+")*(?:\\x5D|$))+/";Ne.push(["lang-regex",RegExp("^"+L+"("+Ze+")")])}var at=ie.types;at&&Ne.push([Le,at]);var et=(""+ie.keywords).replace(/^ | $/g,"");et.length&&Ne.push([Ue,new RegExp("^(?:"+et.replace(/[\s,]+/g,"|")+")\\b"),null]),Te.push([R,/^\s+/,null,` \r \xA0`]);var nt="^.[^\\s\\w.$@'\"`/\\\\]*";return ie.regexLiterals&&(nt+="(?!s*/)"),Ne.push([Se,/^@[a-z_$][a-z_$@0-9]*/i,null],[Le,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[R,/^[a-z_$][a-z_$@0-9]*/i,null],[Se,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[R,/^\\[\s\S]?/,null],[ce,new RegExp(nt),null]),Ce(Te,Ne)}var be=Me({keywords:Ye,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function xe(ie,Te,Ne){for(var He=/(?:^|\s)nocode(?:\s|$)/,Ie=/\r\n?|\n/,Re=ie.ownerDocument,Be=Re.createElement("li");ie.firstChild;)Be.appendChild(ie.firstChild);var Ze=[Be];function at(Oe){var vt=Oe.nodeType;if(vt==1&&!He.test(Oe.className))if(Oe.nodeName==="br")et(Oe),Oe.parentNode&&Oe.parentNode.removeChild(Oe);else for(var st=Oe.firstChild;st;st=st.nextSibling)at(st);else if((vt==3||vt==4)&&Ne){var Pe=Oe.nodeValue,Xe=Pe.match(Ie);if(Xe){var te=Pe.substring(0,Xe.index);Oe.nodeValue=te;var K=Pe.substring(Xe.index+Xe[0].length);if(K){var q=Oe.parentNode;q.insertBefore(Re.createTextNode(K),Oe.nextSibling)}et(Oe),te||Oe.parentNode.removeChild(Oe)}}}function et(Oe){for(;!Oe.nextSibling;)if(Oe=Oe.parentNode,!Oe)return;function vt(Xe,te){var K=te?Xe.cloneNode(!1):Xe,q=Xe.parentNode;if(q){var y=vt(q,1),S=Xe.nextSibling;y.appendChild(K);for(var D=S;D;D=S)S=D.nextSibling,y.appendChild(D)}return K}for(var st=vt(Oe.nextSibling,0),Pe;(Pe=st.parentNode)&&Pe.nodeType===1;)st=Pe;Ze.push(st)}for(var nt=0;nt=q&&(at+=2),Re>=y&&(pt+=2)}}finally{Pe&&(Pe.style.display=Xe)}}var ve={};function Z(ie,Te){for(var Ne=Te.length;--Ne>=0;){var He=Te[Ne];ve.hasOwnProperty(He)?I.console&&console.warn("cannot override language handler %s",He):ve[He]=ie}}function z(ie,Te){return ie&&ve.hasOwnProperty(ie)||(ie=/^\s*]*(?:>|$)/],[Ee,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[ce,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),Z(Ce([[R,/^[\s]+/,null,` \r `],[P,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[oe,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[N,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[ce,/^[=<>\/]+/],["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"]),Z(Ce([],[[P,/^[\s\S]+/]]),["uq.val"]),Z(Me({keywords:A,hashComments:!0,cStyleComments:!0,types:_e}),["c","cc","cpp","cxx","cyc","m"]),Z(Me({keywords:"null,true,false"}),["json"]),Z(Me({keywords:Q,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:_e}),["cs"]),Z(Me({keywords:ee,cStyleComments:!0}),["java"]),Z(Me({keywords:ze,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Z(Me({keywords:he,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Z(Me({keywords:Y,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Z(Me({keywords:me,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Z(Me({keywords:J,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Z(Me({keywords:U,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Z(Ce([],[[ke,/^[\s\S]+/]]),["regex"]);function b(ie){var Te=ie.langExtension;try{var Ne=d(ie.sourceNode,ie.pre),He=Ne.sourceCode;ie.sourceCode=He,ie.spans=Ne.spans,ie.basePos=0,z(Te,He)(ie),ue(ie)}catch(Ie){I.console&&console.log(Ie&&Ie.stack||Ie)}}function W(ie,Te,Ne){var He=Ne||!1,Ie=Te||null,Re=document.createElement("div");Re.innerHTML="
    "+ie+"
    ",Re=Re.firstChild,He&&xe(Re,He,!0);var Be={langExtension:Ie,numberLines:He,sourceNode:Re,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return b(Be),Re.innerHTML}function M(ie,Te){var Ne=Te||document.body,He=Ne.ownerDocument||document;function Ie(K){return Ne.getElementsByTagName(K)}for(var Re=[Ie("pre"),Ie("code"),Ie("xmp")],Be=[],Ze=0;Ze=15&&(A=!1,k=!0);var ke=me&&(O||A&&(_e==null||_e<12.11)),Ue=ne||_&&I>=9;function Ee(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Le=function(e,t){var i=e.className,n=Ee(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 Se(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function ce(e,t){return Se(e).appendChild(t)}function R(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)return l+(t-s);l+=f-s,l+=i-l%i,s=f+1}}var H=function(){this.id=null,this.f=null,this.time=0,this.handler=p(this.onTimeout,this)};H.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},H.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i=t)return n+Math.min(l,t-r);if(r+=s-n,r+=i-r%i,n=s+1,r>=t)return n}}var Z=[""];function z(e){for(;Z.length<=e;)Z.push(b(Z)+" ");return Z[e]}function b(e){return e[e.length-1]}function W(e,t){for(var i=[],n=0;n"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ie.test(e))}function Ne(e,t){return t?t.source.indexOf("\\w")>-1&&Te(e)?!0:t.test(e):Te(e)}function He(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 Re(e){return e.charCodeAt(0)>=768&&Ie.test(e)}function Be(e,t,i){for(;(i<0?t>0:ti?-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 at(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var r=!1,s=0;st||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 et=null;function nt(e,t,i){var n;et=null;for(var r=0;rt)return r;s.to==t&&(s.from!=s.to&&i=="before"?n=r:et=r),s.from==t&&(s.from!=s.to&&i!="before"?n=r:et=r)}return n!=null?n:et}var pt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(v){return v<=247?e.charAt(v):1424<=v&&v<=1524?"R":1536<=v&&v<=1785?t.charAt(v-1536):1774<=v&&v<=2220?"r":8192<=v&&v<=8203?"w":v==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,f=/[1n]/;function m(v,B,V){this.level=v,this.from=B,this.to=V}return function(v,B){var V=B=="ltr"?"L":"R";if(v.length==0||B=="ltr"&&!n.test(v))return!1;for(var de=v.length,ae=[],De=0;De-1&&(n[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function Pe(e,t){var i=vt(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),r=0;r0}function q(e){e.prototype.on=function(t,i){Oe(this,t,i)},e.prototype.off=function(t,i){st(this,t,i)}}function y(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function S(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function D(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function j(e){y(e),S(e)}function fe(e){return e.target||e.srcElement}function Ae(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),me&&e.ctrlKey&&t==1&&(t=3),t}var Ke=function(){if(_&&I<9)return!1;var e=R("div");return"draggable"in e||"dragDrop"in e}(),yt;function Tt(e){if(yt==null){var t=R("span","\u200B");ce(e,R("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(yt=t.offsetWidth<=1&&t.offsetHeight>2&&!(_&&I<8))}var i=yt?R("span","\u200B"):R("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Ge;function Et(e){if(Ge!=null)return Ge;var t=ce(e,document.createTextNode("A\u062EA")),i=re(t,0,1).getBoundingClientRect(),n=re(t,1,2).getBoundingClientRect();return Se(e),!i||i.left==i.right?!1:Ge=n.right-i.right<3}var mt=` b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var r=e.indexOf(` `,t);r==-1&&(r=e.length);var s=e.slice(t,e.charAt(r-1)=="\r"?r-1:r),l=s.indexOf("\r");l!=-1?(i.push(s.slice(0,l)),t+=l+1):(i.push(s),t=r+1)}return i}:function(e){return e.split(/\r\n?|\n/)},tt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Dt=function(){var e=R("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),At=null;function Vt(e){if(At!=null)return At;var t=ce(e,R("span","x")),i=t.getBoundingClientRect(),n=re(t,0,1).getBoundingClientRect();return At=Math.abs(i.left-n.left)>1}var jt={},kt={};function mn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),jt[e]=t}function sn(e,t){kt[e]=t}function ft(e){if(typeof e=="string"&&kt.hasOwnProperty(e))e=kt[e];else if(e&&typeof e.name=="string"&&kt.hasOwnProperty(e.name)){var t=kt[e.name];typeof t=="string"&&(t={name:t}),e=we(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return ft("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return ft("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function En(e,t){t=ft(t);var i=jt[t.name];if(!i)return En(e,"text/plain");var n=i(e,t);if(ln.hasOwnProperty(t.name)){var r=ln[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 ln={};function gn(e,t){var i=ln.hasOwnProperty(e)?ln[e]:ln[e]={};d(t,i)}function Tn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var r=t[n];r instanceof Array&&(r=r.concat([])),i[n]=r}return i}function li(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function Xn(e,t,i){return e.startState?e.startState(t,i):!0}var Nt=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};Nt.prototype.eol=function(){return this.pos>=this.string.length},Nt.prototype.sol=function(){return this.pos==this.lineStart},Nt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Nt.prototype.next=function(){if(this.post},Nt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Nt.prototype.skipToEnd=function(){this.pos=this.string.length},Nt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Nt.prototype.backUp=function(e){this.pos-=e},Nt.prototype.column=function(){return this.lastColumnPos0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}},Nt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Nt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Nt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Nt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ct(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var n=0;;++n){var r=i.children[n],s=r.chunkSize();if(t=e.first&&ti?Ve(i,ct(e,i).text.length):a(t,ct(e,t.line).text.length)}function a(e,t){var i=e.ch;return i==null||i>t?Ve(e.line,t):i<0?Ve(e.line,0):e}function u(e,t){for(var i=[],n=0;nthis.maxLookAhead&&(this.maxLookAhead=e),t},h.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},h.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},h.fromSaved=function(e,t,i){return t instanceof g?new h(e,Tn(e.mode,t.state),i,t.lookAhead):new h(e,Tn(e.mode,t),i)},h.prototype.save=function(e){var t=e!==!1?Tn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new g(t,this.maxLookAhead):t};function X(e,t,i,n){var r=[e.state.modeGen],s={};zn(e,t.text,e.doc.mode,i,function(v,B){return r.push(v,B)},s,n);for(var l=i.state,f=function(v){i.baseTokens=r;var B=e.state.overlays[v],V=1,de=0;i.state=!0,zn(e,t.text,B.mode,i,function(ae,De){for(var We=V;deae&&r.splice(V,1,ae,r[V+1],$e),V+=2,de=Math.min(ae,$e)}if(!De)return;if(B.opaque)r.splice(We,V-We,ae,"overlay "+De),V=We+2;else for(;Wee.options.maxHighlightLength&&Tn(e.doc.mode,n.state),s=X(e,t,n);r&&(n.state=r),t.stateAfter=n.save(!r),t.styles=s.styles,s.classes?t.styleClasses=s.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function pe(e,t,i){var n=e.doc,r=e.display;if(!n.mode.startState)return new h(n,!0,t);var s=un(e,t,i),l=s>n.first&&ct(n,s-1).stateAfter,f=l?h.fromSaved(n,l,s):new h(n,Xn(n.mode),s);return n.iter(s,t,function(m){ht(e,m.text,f);var v=f.line;m.stateAfter=v==t-1||v%5==0||v>=r.viewFrom&&vt.start)return s}throw new Error("Mode "+e.name+" failed to advance stream.")}var Pt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Ht(e,t,i,n){var r=e.doc,s=r.mode,l;t=o(r,t);var f=ct(r,t.line),m=pe(e,t.line,i),v=new Nt(f.text,e.options.tabSize,m),B;for(n&&(B=[]);(n||v.pose.options.maxHighlightLength?(f=!1,l&&ht(e,t,n,B.pos),B.pos=t.length,V=null):V=Hn(wt(i,B,n.state,de),s),de){var ae=de[0].name;ae&&(V="m-"+(V?ae+" "+V:ae))}if(!f||v!=V){for(;ml;--f){if(f<=s.first)return s.first;var m=ct(s,f-1),v=m.stateAfter;if(v&&(!i||f+(v instanceof g?v.lookAhead:0)<=s.modeFrontier))return f;var B=E(m.text,null,e.options.tabSize);(r==null||n>B)&&(r=f-1,n=B)}return r}function Yn(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontieri;n--){var r=ct(e,n).stateAfter;if(r&&(!(r instanceof g)||n+r.lookAhead=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=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.from0&&f)for(var lt=0;lt0)continue;var B=[m,1],V=Ct(v.from,f.from),de=Ct(v.to,f.to);(V<0||!l.inclusiveLeft&&!V)&&B.push({from:v.from,to:f.from}),(de>0||!l.inclusiveRight&&!de)&&B.push({from:f.to,to:v.to}),r.splice.apply(r,B),m+=B.length-3}return r}function Di(e){var t=e.markedSpans;if(!t)return;for(var i=0;it)&&(!n||vn(n,s.marker)<0)&&(n=s.marker)}return n}function rn(e,t,i,n,r){var s=ct(e,t),l=An&&s.markedSpans;if(l)for(var f=0;f=0&&V<=0||B<=0&&V>=0)continue;if(B<=0&&(m.marker.inclusiveRight&&r.inclusiveLeft?Ct(v.to,i)>=0:Ct(v.to,i)>0)||B>=0&&(m.marker.inclusiveRight&&r.inclusiveLeft?Ct(v.from,n)<=0:Ct(v.from,n)<0))return!0}}function on(e){for(var t;t=yn(e);)e=t.find(-1,!0).line;return e}function ri(e){for(var t;t=Kt(e);)e=t.find(1,!0).line;return e}function xi(e){for(var t,i;t=Kt(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function Ci(e,t){var i=ct(e,t),n=on(i);return i==n?t:Rt(n)}function Fr(e,t){if(t>e.lastLine())return t;var i=ct(e,t),n;if(!Zn(e,i))return t;for(;n=Kt(i);)i=n.find(1,!0).line;return Rt(i)+1}function Zn(e,t){var i=An&&t.markedSpans;if(i)for(var n=void 0,r=0;rt.maxLineLength&&(t.maxLineLength=r,t.maxLine=n)})}var wi=function(e,t,i){this.text=e,Pi(this,t),this.height=i?i(this):1};wi.prototype.lineNo=function(){return Rt(this)},q(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),Di(e),Pi(e,i);var r=n?n(e):1;r!=e.height&&_n(e,r)}function ho(e){e.parent=null,Di(e)}var Zo={},Qo={};function co(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Qo:Zo;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Ur(e,t){var i=oe("span",null,null,k?"padding-right: .1px":null),n={pre:oe("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=St,Et(e.display.measure)&&(l=ut(s,e.doc.direction))&&(n.addToken=Lt(n.addToken,l)),n.map=[];var f=t!=e.display.externalMeasured&&Rt(s);zt(s,n,je(e,s,f)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=w(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=w(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(Tt(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(k){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 Pe(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=w(n.pre.className,n.textClass||"")),n}function dt(e){var t=R("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function St(e,t,i,n,r,s,l){if(!t)return;var f=e.splitSpaces?bt(t,e.trailingSpace):t,m=e.cm.state.specialChars,v=!1,B;if(!m.test(t))e.col+=t.length,B=document.createTextNode(f),e.map.push(e.pos,e.pos+t.length,B),_&&I<9&&(v=!0),e.pos+=t.length;else{B=document.createDocumentFragment();for(var V=0;;){m.lastIndex=V;var de=m.exec(t),ae=de?de.index-V:t.length-V;if(ae){var De=document.createTextNode(f.slice(V,V+ae));_&&I<9?B.appendChild(R("span",[De])):B.appendChild(De),e.map.push(e.pos,e.pos+ae,De),e.col+=ae,e.pos+=ae}if(!de)break;V+=ae+1;var We=void 0;if(de[0]==" "){var $e=e.cm.options.tabSize,Qe=$e-e.col%$e;We=B.appendChild(R("span",z(Qe),"cm-tab")),We.setAttribute("role","presentation"),We.setAttribute("cm-text"," "),e.col+=Qe}else de[0]=="\r"||de[0]==` `?(We=B.appendChild(R("span",de[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),We.setAttribute("cm-text",de[0]),e.col+=1):(We=e.cm.options.specialCharPlaceholder(de[0]),We.setAttribute("cm-text",de[0]),_&&I<9?B.appendChild(R("span",[We])):B.appendChild(We),e.col+=1);e.map.push(e.pos,e.pos+1,We),e.pos++}}if(e.trailingSpace=f.charCodeAt(t.length-1)==32,i||n||r||v||s||l){var rt=i||"";n&&(rt+=n),r&&(rt+=r);var qe=R("span",[B],rt,s);if(l)for(var lt in l)l.hasOwnProperty(lt)&<!="style"&<!="class"&&qe.setAttribute(lt,l[lt]);return e.content.appendChild(qe)}e.content.appendChild(B)}function bt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",r=0;rv&&V.from<=v);de++);if(V.to>=B)return e(i,n,r,s,l,f,m);e(i,n.slice(0,V.to-v),r,s,null,f,m),s=null,n=n.slice(V.to-v),v=V.to}}}function It(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 zt(e,t,i){var n=e.markedSpans,r=e.text,s=0;if(!n){for(var l=1;lm||_t.collapsed&>.to==m&>.from==m)){if(gt.to!=null&>.to!=m&&ae>gt.to&&(ae=gt.to,We=""),_t.className&&(De+=" "+_t.className),_t.css&&(de=(de?de+";":"")+_t.css),_t.startStyle&>.from==m&&($e+=" "+_t.startStyle),_t.endStyle&>.to==ae&&(lt||(lt=[])).push(_t.endStyle,gt.to),_t.title&&((rt||(rt={})).title=_t.title),_t.attributes)for(var Yt in _t.attributes)(rt||(rt={}))[Yt]=_t.attributes[Yt];_t.collapsed&&(!Qe||vn(Qe.marker,_t)<0)&&(Qe=gt)}else gt.from>m&&ae>gt.from&&(ae=gt.from)}if(lt)for(var fn=0;fn=f)break;for(var Fn=Math.min(f,ae);;){if(B){var On=m+B.length;if(!Qe){var tn=On>Fn?B.slice(0,Fn-m):B;t.addToken(t,tn,V?V+De:De,$e,m+tn.length==ae?We:"",de,rt)}if(On>=Fn){B=B.slice(Fn-m),m=Fn;break}m=On,$e=""}B=r.slice(s,s=i[v++]),V=co(i[v++],t.cm.options)}}}function Ot(e,t,i){this.line=t,this.rest=xi(t),this.size=this.rest?Rt(b(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Zn(e,t)}function Jt(e,t,i){for(var n=[],r,s=t;s2&&s.push((m.bottom+v.top)/2-i.top)}}s.push(i.bottom-i.top)}}function ra(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;ni)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Fs(e,t){t=on(t);var i=Rt(t),n=e.display.externalMeasured=new Ot(e.doc,t,i);n.lineN=i;var r=n.built=Ur(e,n);return n.text=r.pre,ce(e.display.lineMeasure,r.pre),n}function oa(e,t,i,n){return ai(e,Ji(e,t),i,n)}function go(e,t){if(t>=e.display.viewFrom&&t=i.lineN&&tt)&&(s=m-f,r=s-1,t>=m&&(l="right")),r!=null){if(n=e[v+2],f==m&&i==(n.insertLeft?"left":"right")&&(l=i),i=="left"&&r==0)for(;v&&e[v-2]==e[v-3]&&e[v-1].insertLeft;)n=e[(v-=3)+2],l="left";if(i=="right"&&r==m-f)for(;v=0&&!((i=e[r]).left!=i.right);r--);return i}function Hs(e,t,i,n){var r=sa(t.map,i,n),s=r.node,l=r.start,f=r.end,m=r.collapse,v;if(s.nodeType==3){for(var B=0;B<4;B++){for(;l&&Re(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+f0&&(m=n="right");var V;e.options.lineWrapping&&(V=s.getClientRects()).length>1?v=V[n=="right"?V.length-1:0]:v=s.getBoundingClientRect()}if(_&&I<9&&!l&&(!v||!v.left&&!v.right)){var de=s.parentNode.getClientRects()[0];de?v={left:de.left,right:de.left+Qi(e.display),top:de.top,bottom:de.bottom}:v=aa}for(var ae=v.top-t.rect.top,De=v.bottom-t.rect.top,We=(ae+De)/2,$e=t.view.measure.heights,Qe=0;Qe<$e.length-1&&!(We<$e[Qe]);Qe++);var rt=Qe?$e[Qe-1]:0,qe=$e[Qe],lt={left:(m=="right"?v.right:v.left)-t.rect.left,right:(m=="left"?v.left:v.right)-t.rect.left,top:rt,bottom:qe};return!v.left&&!v.right&&(lt.bogus=!0),e.options.singleCursorHeightPerLine||(lt.rtop=ae,lt.rbottom=De),lt}function zs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Vt(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=n.text.length?(m=n.text.length,v="before"):m<=0&&(m=0,v="after"),!f)return l(v=="before"?m-1:m,v=="before");function B(De,We,$e){var Qe=f[We],rt=Qe.level==1;return l($e?De-1:De,rt!=$e)}var V=nt(f,m,v),de=et,ae=B(m,V,v=="before");return de!=null&&(ae.other=B(m,de,v!="before")),ae}function fa(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=Qi(e.display)*t.ch);var n=ct(e.doc,t.line),r=jn(n)+Hr(e.display);return{left:i,right:i,top:r,bottom:r+n.height}}function bo(e,t,i,n,r){var s=Ve(e,t,i);return s.xRel=r,n&&(s.outside=n),s}function xo(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return bo(n.first,0,null,-1,-1);var r=Kn(n,i),s=n.first+n.size-1;if(r>s)return bo(n.first+n.size-1,ct(n,s).text.length,null,1,1);t<0&&(t=0);for(var l=ct(n,r);;){var f=Ws(e,l,r,t,i),m=bi(l,f.ch+(f.xRel>0||f.outside>0?1:0));if(!m)return f;var v=m.find(1);if(v.line==r)return v;l=ct(n,r=v.line)}}function pa(e,t,i,n){n-=vo(t);var r=t.text.length,s=Ze(function(l){return ai(e,i,l-1).bottom<=n},r,0);return r=Ze(function(l){return ai(e,i,l).top>n},s,r),{begin:s,end:r}}function ma(e,t,i,n){i||(i=Ji(e,t));var r=zr(e,t,ai(e,i,n),"line").top;return pa(e,t,i,r)}function Co(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function Ws(e,t,i,n,r){r-=jn(t);var s=Ji(e,t),l=vo(t),f=0,m=t.text.length,v=!0,B=ut(t,e.doc.direction);if(B){var V=(e.options.lineWrapping?Vs:Gs)(e,t,i,s,B,n,r);v=V.level!=1,f=v?V.from:V.to-1,m=v?V.to:V.from-1}var de=null,ae=null,De=Ze(function(xt){var gt=ai(e,s,xt);return gt.top+=l,gt.bottom+=l,Co(gt,n,r,!1)?(gt.top<=r&>.left<=n&&(de=xt,ae=gt),!0):!1},f,m),We,$e,Qe=!1;if(ae){var rt=n-ae.left=lt.bottom?1:0}return De=Be(t.text,De,1),bo(i,De,$e,Qe,n-We)}function Gs(e,t,i,n,r,s,l){var f=Ze(function(V){var de=r[V],ae=de.level!=1;return Co(Qn(e,Ve(i,ae?de.to:de.from,ae?"before":"after"),"line",t,n),s,l,!0)},0,r.length-1),m=r[f];if(f>0){var v=m.level!=1,B=Qn(e,Ve(i,v?m.from:m.to,v?"after":"before"),"line",t,n);Co(B,s,l,!0)&&B.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,v=f.end;/\s/.test(t.text.charAt(v-1))&&v--;for(var B=null,V=null,de=0;de=v||ae.to<=m)continue;var De=ae.level!=1,We=ai(e,n,De?Math.min(v,ae.to)-1:Math.max(m,ae.from)).right,$e=We$e)&&(B=ae,V=$e)}return B||(B=r[r.length-1]),B.fromv&&(B={from:B.from,to:v,level:B.level}),B}var ji;function Zi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ji==null){ji=R("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ji.appendChild(document.createTextNode("x")),ji.appendChild(R("br"));ji.appendChild(document.createTextNode("x"))}ce(e.measure,ji);var i=ji.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),Se(e.measure),i||1}function Qi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=R("span","xxxxxxxxxx"),i=R("pre",[t],"CodeMirror-line-like");ce(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(Zn(e.doc,r))return 0;var s=0;if(r.widgets)for(var l=0;l0&&(v=ct(e.doc,m.line).text).length==m.ch){var B=E(v,v.length,e.options.tabSize)-v.length;m=Ve(m.line,Math.max(0,Math.round((s-ia(e.display).left)/Qi(e.display))-B))}return m}function Fi(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;nt)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)An&&Ci(e.doc,t)r.viewFrom?Si(e):(r.viewFrom+=n,r.viewTo+=n);else if(t<=r.viewFrom&&i>=r.viewTo)Si(e);else if(t<=r.viewFrom){var s=Wr(e,i,i+n,1);s?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=n):Si(e)}else if(i>=r.viewTo){var l=Wr(e,t,t,-1);l?(r.view=r.view.slice(0,l.index),r.viewTo=l.lineN):Si(e)}else{var f=Wr(e,t,t,-1),m=Wr(e,i,i+n,1);f&&m?(r.view=r.view.slice(0,f.index).concat(Jt(e,f.lineN,m.lineN)).concat(r.view.slice(m.index)),r.viewTo+=n):Si(e)}var v=r.externalMeasured;v&&(i=r.lineN&&t=n.viewTo)return;var s=n.view[Fi(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);$(l,i)==-1&&l.push(i)}function Si(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Wr(e,t,i,n){var r=Fi(e,t),s,l=e.display.view;if(!An||i==e.doc.first+e.doc.size)return{index:r,lineN:i};for(var f=e.display.viewFrom,m=0;m0){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=Jt(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=Jt(e,t,n.viewFrom).concat(n.view):n.viewFromi&&(n.view=n.view.slice(0,Fi(e,i)))),n.viewTo=i}function va(e){for(var t=e.display.view,i=0,n=0;n=e.display.viewTo||f.to().line0?t.blinker=setInterval(function(){e.hasFocus()||qi(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function xa(e){e.state.focused||(e.display.input.focus(),To(e))}function Ca(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,qi(e))},100)}function To(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Pe(e,"focus",e,t),e.state.focused=!0,P(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),k&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ko(e)}function qi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Pe(e,"blur",e,t),e.state.focused=!1,Le(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.005||B<-.005)&&(_n(r.line,l),wa(r.line),r.rest))for(var V=0;Ve.display.sizerWidth){var de=Math.ceil(f/Qi(e.display));de>e.display.maxLineLength&&(e.display.maxLineLength=de,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function wa(e){if(e.widgets)for(var t=0;t=l&&(s=Kn(t,jn(ct(t,m))-e.wrapper.clientHeight),l=m)}return{from:s,to:Math.max(l,s+1)}}function Ys(e,t){if(Xe(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),r=null;if(t.top+n.top<0?r=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),r!=null&&!U){var s=R("div","\u200B",null,`position: absolute; top: `+(t.top-i.viewOffset-Hr(e.display))+`px; height: `+(t.bottom-t.top+oi(e)+i.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(r),e.display.lineSpace.removeChild(s)}}function $s(e,t,i,n){n==null&&(n=0);var r;!e.options.lineWrapping&&t==i&&(t=t.ch?Ve(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?Ve(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,f=Qn(e,t),m=!i||i==t?f:Qn(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 v=_o(e,r),B=e.doc.scrollTop,V=e.doc.scrollLeft;if(v.scrollTop!=null&&(xr(e,v.scrollTop),Math.abs(e.doc.scrollTop-B)>1&&(l=!0)),v.scrollLeft!=null&&(Ui(e,v.scrollLeft),Math.abs(e.doc.scrollLeft-V)>1&&(l=!0)),!l)break}return r}function Js(e,t){var i=_o(e,t);i.scrollTop!=null&&xr(e,i.scrollTop),i.scrollLeft!=null&&Ui(e,i.scrollLeft)}function _o(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.topf-n;if(t.topr+s){var B=Math.min(t.top,(v?f:t.bottom)-s);B!=r&&(l.scrollTop=B)}var V=e.options.fixedGutter?0:i.gutters.offsetWidth,de=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-V,ae=Ii(e)-i.gutters.offsetWidth,De=t.right-t.left>ae;return De&&(t.right=t.left+ae),t.left<10?l.scrollLeft=0:t.leftae+de-3&&(l.scrollLeft=t.right+(De?0:10)-ae),l}function Ao(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=_o(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});br(e,r.scrollLeft,r.scrollTop)}function xr(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;ne||Mo(e,{top:t}),Sa(e,t,!0),ne&&Mo(e),Er(e,100)}function Sa(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 Ui(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,La(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function 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+oi(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Hi=function(e,t,i){this.cm=i;var n=this.vert=R("div",[R("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=R("div",[R("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=r.tabIndex=-1,e(n),e(r),Oe(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Oe(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,_&&I<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Hi.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}},Hi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Hi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Hi.prototype.zeroWidthHack=function(){var e=me&&!Q?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new H,this.disableVert=new H},Hi.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)},Hi.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;ka(e,t);for(var r=0;r<4&&i!=e.display.barWidth||n!=e.display.barHeight;r++)i!=e.display.barWidth&&e.options.lineWrapping&&Vr(e),ka(e,Cr(e)),i=e.display.barWidth,n=e.display.barHeight}function ka(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var Ta={native:Hi,null:wr};function _a(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Le(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ta[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Oe(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"?Ui(e,t):xr(e,t)},e),e.display.scrollbars.addClass&&P(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function zi(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Qs},Mt(e.curOp)}function Wi(e){var t=e.curOp;t&&Wt(t,function(i){for(var n=0;n=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Yr(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Lo(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Vr(t),e.barMeasure=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+oi(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Ii(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=pe(e,t.highlightFrontier),r=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(s){if(n.line>=e.display.viewFrom){var l=s.styles,f=s.text.length>e.options.maxHighlightLength?Tn(t.mode,n.state):null,m=X(e,s,n,!0);f&&(n.state=f),s.styles=m.styles;var v=s.styleClasses,B=m.classes;B?s.styleClasses=B:v&&(s.styleClasses=null);for(var V=!l||l.length!=s.styles.length||v!=B&&(!v||!B||v.bgClass!=B.bgClass||v.textClass!=B.textClass),de=0;!V&&dei)return Er(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),r.length&&Bn(e,function(){for(var s=0;s=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)&&(Si(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.viewFroml&&i.viewTo-l<20&&(l=Math.min(r,i.viewTo)),An&&(s=Ci(e.doc,s),l=Fr(e.doc,l));var f=s!=i.viewFrom||l!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Xs(e,s,l),i.viewOffset=jn(ct(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var m=va(e);if(!f&&m==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var v=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(v),Se(i.cursorDiv),Se(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 Aa(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(!Lo(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(Lo(e,i)){Vr(e),Aa(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 We=De.nextSibling;return k&&me&&e.display.currentWheelTarget==De?De.style.display="none":De.parentNode.removeChild(De),We}for(var m=n.view,v=n.viewFrom,B=0;B-1&&(ae=!1),pr(e,V,v,i)),ae&&(Se(V.lineNumber),V.lineNumber.appendChild(document.createTextNode(vi(e.options,v)))),l=V.node.nextSibling}v+=V.size}for(;l;)l=f(l)}function Ro(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Oo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+oi(e)+"px"}function La(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=Eo(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,s=n+"px",l=0;ll.clientWidth,m=l.scrollHeight>l.clientHeight;if(!(n&&f||r&&m))return;if(r&&me&&k){e:for(var v=t.target,B=s.view;v!=l;v=v.parentNode)for(var V=0;V=0&&Ct(e,n.to())<=0)return i}return-1};var Ut=function(e,t){this.anchor=e,this.head=t};Ut.prototype.from=function(){return Ri(this.anchor,this.head)},Ut.prototype.to=function(){return di(this.anchor,this.head)},Ut.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function qn(e,t,i){var n=e&&e.options.selectionsMayTouch,r=t[i];t.sort(function(de,ae){return Ct(de.from(),ae.from())}),i=$(t,r);for(var s=1;s0:m>=0){var v=Ri(f.from(),l.from()),B=di(f.to(),l.to()),V=f.empty()?l.from()==l.head:f.from()==f.head;s<=i&&--i,t.splice(--s,2,new Ut(V?B:v,V?v:B))}}return new Vn(t,i)}function ki(e,t){return new Vn([new Ut(e,t||e)],0)}function Ti(e){return e.text?Ve(e.from.line+e.text.length-1,b(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Pa(e,t){if(Ct(e,t.from)<0)return e;if(Ct(e,t.to)<=0)return Ti(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Ti(t).ch-t.to.ch),Ve(i,n)}function Po(e,t){for(var i=[],n=0;n1&&e.remove(f.line+1,De-1),e.insert(f.line+1,Qe)}Xt(e,"change",e,t)}function _i(e,t,i){function n(r,s,l){if(r.linked)for(var f=0;f1&&!e.done[e.done.length-2].ranges)return e.done.pop(),b(e.done)}function Ua(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),Ct(t.from,t.to)==0&&Ct(t.from,f.to)==0?f.to=Ti(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||Pe(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&&Fa(r.undone)}function Zr(e,t){var i=b(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Ha(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-1&&(b(f)[V]=v[V],delete v[V]))}}return n}function Bo(e,t,i,n){if(n){var r=e.anchor;if(i){var s=Ct(t,r)<0;s!=Ct(i,r)<0?(r=t,t=i):s!=Ct(t,i)<0&&(t=i)}return new Ut(r,t)}else return new Ut(i||t,t)}function Qr(e,t,i,n,r){r==null&&(r=e.cm&&(e.cm.display.shift||e.extend)),Cn(e,new Vn([Bo(e.sel.primary(),t,i,r)],0),n)}function Wa(e,t,i){for(var n=[],r=e.cm&&(e.cm.display.shift||e.extend),s=0;s=t.ch:f.to>t.ch))){if(r&&(Pe(m,"beforeCursorEnter"),m.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!m.atomic)continue;if(i){var V=m.find(n<0?1:-1),de=void 0;if((n<0?B:v)&&(V=$a(e,V,-n,V&&V.line==t.line?s:null)),V&&V.line==t.line&&(de=Ct(V,i))&&(n<0?de<0:de>0))return ir(e,V,t,n,r)}var ae=m.find(n<0?-1:1);return(n<0?v:B)&&(ae=$a(e,ae,n,ae.line==t.line?s:null)),ae?ir(e,ae,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,Ve(e.first,0))}function $a(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,Ve(t.line-1)):null:i>0&&t.ch==(n||ct(e,t.line)).text.length?t.line=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]==""&&Ct(t.from,t.to)==0)return;var i=Po(e,t);Ua(e,t,i,e.cm?e.cm.curOp.id:NaN),Tr(e,t,i,Nn(e,t));var n=[];_i(e,function(r,s){!s&&$(n,r.history)==-1&&(ns(r.history,t),n.push(r.history)),Tr(r,t,null,Nn(r,t))})}function to(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var r=e.history,s,l=e.sel,f=t=="undo"?r.done:r.undone,m=t=="undo"?r.undone:r.done,v=0;v=0;--ae){var De=de(ae);if(De)return De.v}}function qa(e,t){if(t==0)return;if(e.first+=t,e.sel=new Vn(W(e.sel.ranges,function(r){return new Ut(Ve(r.anchor.line+t,r.anchor.ch),Ve(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){Mn(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;ne.lastLine())return;if(t.from.lines&&(t={from:t.from,to:Ve(s,ct(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Un(e,t.from,t.to),i||(i=Po(e,t)),e.cm?xl(e.cm,t,n):Io(e,t,n),qr(e,i,be),e.cantEdit&&eo(e,Ve(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=Rt(on(ct(n,s.line))),n.iter(m,l.line+1,function(ae){if(ae==r.maxLine)return f=!0,!0})),n.sel.contains(t.from,t.to)>-1&&te(e),Io(n,t,i,ga(e)),e.options.lineWrapping||(n.iter(m,s.line+t.text.length,function(ae){var De=$i(ae);De>r.maxLineLength&&(r.maxLine=ae,r.maxLineLength=De,r.maxLineChanged=!0,f=!1)}),f&&(e.curOp.updateMaxLine=!0)),Yn(n,s.line),Er(e,400);var v=t.text.length-(l.line-s.line)-1;t.full?Mn(e):s.line==l.line&&t.text.length==1&&!Ia(e.doc,t)?Ei(e,s.line,"text"):Mn(e,s.line,l.line+1,v);var B=K(e,"changes"),V=K(e,"change");if(V||B){var de={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};V&&Xt(e,"change",e,de),B&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(de)}e.display.selForContextMenu=null}function or(e,t,i,n,r){var s;n||(n=i),Ct(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){i1||!(this.children[0]instanceof Ar))){var f=[];this.collapse(f),this.children=[new Ar(f)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var l=r.lines.length%25+25,f=l;f10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;ne.display.maxLineLength&&(e.display.maxLine=v,e.display.maxLineLength=B,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Mn(e,n,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ka(e.doc)),e&&Xt(e,"markerCleared",e,this,n,r),t&&Wi(e),this.parent&&this.parent.clear()},Ai.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,r=0;r0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=oe("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(rn(e,t.line,t,i,s)||t.line!=i.line&&rn(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");ni()}s.addToHistory&&Ua(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var f=t.line,m=e.cm,v;if(e.iter(f,i.line+1,function(V){m&&s.collapsed&&!m.options.lineWrapping&&on(V)==m.display.maxLine&&(v=!0),s.collapsed&&f!=t.line&&_n(V,0),Wn(V,new yi(s,f==t.line?t.ch:null,f==i.line?i.ch:null)),++f}),s.collapsed&&e.iter(t.line,i.line+1,function(V){Zn(e,V)&&_n(V,0)}),s.clearOnEnter&&Oe(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(Ln(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++rs,s.atomic=!0),m){if(v&&(m.curOp.updateMaxLine=!0),s.collapsed)Mn(m,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var B=t.line;B<=i.line;B++)Ei(m,B,"text");s.atomic&&Ka(m.doc),Xt(m,"markerAdded",m,s)}return s}var Rr=function(e,t){this.markers=e,this.primary=t;for(var i=0;i=0;m--)rr(this,n[m]);f?Va(this,f):this.cm&&er(this.cm)}),undo:dn(function(){to(this,"undo")}),redo:dn(function(){to(this,"redo")}),undoSelection:dn(function(){to(this,"undo",!0)}),redoSelection:dn(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.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=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;ne)return t=e,!0;e-=s,++i}),o(this,Ve(i,t))},indexFromPos:function(e){e=o(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var B=e.dataTransfer.getData("Text");if(B){var V;if(t.state.draggingText&&!t.state.draggingText.copy&&(V=t.listSelections()),qr(t.doc,ki(i,i)),V)for(var de=0;de=0;f--)or(e.doc,"",n[f].from,n[f].to,"+delete");er(e)})}function Uo(e,t,i){var n=Be(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Ho(e,t,i){var n=Uo(e,t.ch,i);return n==null?null:new Ve(t.line,n,i<0?"after":"before")}function zo(e,t,i,n,r){if(e){t.doc.direction=="rtl"&&(r=-r);var s=ut(i,t.doc.direction);if(s){var l=r<0?b(s):s[0],f=r<0==(l.level==1),m=f?"after":"before",v;if(l.level>0||t.doc.direction=="rtl"){var B=Ji(t,i);v=r<0?i.text.length-1:0;var V=ai(t,B,v).top;v=Ze(function(de){return ai(t,B,de).top==V},r<0==(l.level==1)?l.from:l.to-1,v),m=="before"&&(v=Uo(i,v,1))}else v=r<0?l.to:l.from;return new Ve(n,v,m)}}return new Ve(n,r<0?i.text.length:0,r<0?"before":"after")}function Pl(e,t,i,n){var r=ut(t,e.doc.direction);if(!r)return Ho(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=l.from&&de>=B.begin)){var ae=V?"before":"after";return new Ve(i.line,de,ae)}}var De=function(Qe,rt,qe){for(var lt=function(Yt,fn){return fn?new Ve(i.line,f(Yt,1),"before"):new Ve(i.line,Yt,"after")};Qe>=0&&Qe0==(xt.level!=1),_t=gt?qe.begin:f(qe.end,-1);if(xt.from<=_t&&_t0?B.end:f(B.begin,-1);return $e!=null&&!(n>0&&$e==t.text.length)&&(We=De(n>0?0:r.length-1,n,v($e)),We)?We:null}var Pr={selectAll:Ja,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),be)},killLine:function(e){return lr(e,function(t){if(t.empty()){var i=ct(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line0)r=new Ve(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),Ve(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var l=ct(e.doc,r.line-1).text;l&&(r=new Ve(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),Ve(r.line-1,l.length-1),r,"+transpose"))}}i.push(new Ut(r,r))}e.setSelections(i)})},newlineAndIndent:function(e){return Bn(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;ne&&Ct(t,this.pos)==0&&i==this.button};var Ir,jr;function Hl(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(Xe(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,pi(i,e)){k||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Vo(t,e))return;var n=Bi(t,e),r=Ae(e),s=n?Hl(n,r):"single";if(window.focus(),r==1&&t.state.selectingText&&t.state.selectingText(e),n&&zl(t,r,n,s,e))return;r==1?n?Gl(t,n,s,e):fe(e)==i.scroller&&y(e):r==2?(n&&Qr(t.doc,n),setTimeout(function(){return i.input.focus()},20)):r==3&&(Ue?t.display.input.onContextMenu(e):Ca(t))}function zl(e,t,i,n,r){var s="Click";return n=="double"?s="Double"+s:n=="triple"&&(s="Triple"+s),s=(t==1?"Left":t==2?"Middle":"Right")+s,Nr(e,cs(s,r),r,function(l){if(typeof l=="string"&&(l=Pr[l]),!l)return!1;var f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),f=l(e,i)!=Me}finally{e.state.suppressEdits=!1}return f})}function Wl(e,t,i){var n=e.getOption("configureMouse"),r=n?n(e,t,i):{};if(r.unit==null){var s=ze?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=me?i.metaKey:i.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(me?i.altKey:i.ctrlKey)),r}function Gl(e,t,i,n){_?setTimeout(p(xa,e),0):e.curOp.focus=N();var r=Wl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&Ke&&!e.isReadOnly()&&i=="single"&&(l=s.contains(t))>-1&&(Ct((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(Ct(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=cn(e,function(v){k&&(r.scroller.draggable=!1),e.state.draggingText=!1,st(r.wrapper.ownerDocument,"mouseup",l),st(r.wrapper.ownerDocument,"mousemove",f),st(r.scroller,"dragstart",m),st(r.scroller,"drop",l),s||(y(v),n.addNew||Qr(e.doc,i,null,null,n.extend),k&&!ee||_&&I==9?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),f=function(v){s=s||Math.abs(t.clientX-v.clientX)+Math.abs(t.clientY-v.clientY)>=10},m=function(){return s=!0};k&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),Oe(r.wrapper.ownerDocument,"mouseup",l),Oe(r.wrapper.ownerDocument,"mousemove",f),Oe(r.scroller,"dragstart",m),Oe(r.scroller,"drop",l),Ca(e),setTimeout(function(){return r.input.focus()},20)}function Cs(e,t,i){if(i=="char")return new Ut(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Ut(Ve(t.line,0),o(e.doc,Ve(t.line+1,0)));var n=i(e,t);return new Ut(n.from,n.to)}function Xl(e,t,i,n){var r=e.display,s=e.doc;y(t);var l,f,m=s.sel,v=m.ranges;if(n.addNew&&!n.extend?(f=s.sel.contains(i),f>-1?l=v[f]:l=new Ut(i,i)):(l=s.sel.primary(),f=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new Ut(i,i)),i=Bi(e,t,!0,!0),f=-1;else{var B=Cs(e,i,n.unit);n.extend?l=Bo(l,B.anchor,B.head,n.extend):l=B}n.addNew?f==-1?(f=v.length,Cn(s,qn(e,v.concat([l]),f),{scroll:!1,origin:"*mouse"})):v.length>1&&v[f].empty()&&n.unit=="char"&&!n.extend?(Cn(s,qn(e,v.slice(0,f).concat(v.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),m=s.sel):Fo(s,f,l,xe):(f=0,Cn(s,new Vn([l],0),xe),m=s.sel);var V=i;function de(qe){if(Ct(V,qe)==0)return;if(V=qe,n.unit=="rectangle"){for(var lt=[],xt=e.options.tabSize,gt=E(ct(s,i.line).text,i.ch,xt),_t=E(ct(s,qe.line).text,qe.ch,xt),Yt=Math.min(gt,_t),fn=Math.max(gt,_t),Zt=Math.min(i.line,qe.line),Fn=Math.min(e.lastLine(),Math.max(i.line,qe.line));Zt<=Fn;Zt++){var On=ct(s,Zt).text,tn=ve(On,Yt,xt);Yt==fn?lt.push(new Ut(Ve(Zt,tn),Ve(Zt,tn))):On.length>tn&<.push(new Ut(Ve(Zt,tn),Ve(Zt,ve(On,fn,xt))))}lt.length||lt.push(new Ut(i,i)),Cn(s,qn(e,m.ranges.slice(0,f).concat(lt),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(qe)}else{var Dn=l,xn=Cs(e,qe,n.unit),an=Dn.anchor,nn;Ct(xn.anchor,an)>0?(nn=xn.head,an=Ri(Dn.from(),xn.anchor)):(nn=xn.anchor,an=di(Dn.to(),xn.head));var Qt=m.ranges.slice(0);Qt[f]=Kl(e,new Ut(o(s,an),nn)),Cn(s,qn(e,Qt,f),xe)}}var ae=r.wrapper.getBoundingClientRect(),De=0;function We(qe){var lt=++De,xt=Bi(e,qe,!0,n.unit=="rectangle");if(!xt)return;if(Ct(xt,V)!=0){e.curOp.focus=N(),de(xt);var gt=Xr(r,s);(xt.line>=gt.to||xt.lineae.bottom?20:0;_t&&setTimeout(cn(e,function(){if(De!=lt)return;r.scroller.scrollTop+=_t,We(qe)}),50)}}function $e(qe){e.state.selectingText=!1,De=Infinity,qe&&(y(qe),r.input.focus()),st(r.wrapper.ownerDocument,"mousemove",Qe),st(r.wrapper.ownerDocument,"mouseup",rt),s.history.lastSelOrigin=null}var Qe=cn(e,function(qe){qe.buttons===0||!Ae(qe)?$e(qe):We(qe)}),rt=cn(e,$e);e.state.selectingText=rt,Oe(r.wrapper.ownerDocument,"mousemove",Qe),Oe(r.wrapper.ownerDocument,"mouseup",rt)}function Kl(e,t){var i=t.anchor,n=t.head,r=ct(e.doc,i.line);if(Ct(i,n)==0&&i.sticky==n.sticky)return t;var s=ut(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 v;if(n.line!=i.line)v=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var B=nt(s,n.ch,n.sticky),V=B-l||(n.ch-i.ch)*(f.level==1?-1:1);B==m-1||B==m?v=V<0:v=V>0}var de=s[m+(v?-1:0)],ae=v==(de.level==1),De=ae?de.from:de.to,We=ae?"after":"before";return i.ch==De&&i.sticky==We?t:new Ut(new Ve(i.line,De,We),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(de){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&y(t);var l=e.display,f=l.lineDiv.getBoundingClientRect();if(s>f.bottom||!K(e,i))return D(t);s-=f.top-l.viewOffset;for(var m=0;m=r){var B=Kn(e.doc,s),V=e.display.gutterSpecs[m];return Pe(e,i,e,B,V.className,t),D(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(Xe(e,t,"contextmenu"))return;Ue||e.display.input.onContextMenu(t)}function Yl(e,t){return K(e,"gutterContextMenu")?ws(e,t,"gutterContextMenu",!1):!1}function Ss(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vr(e)}var ur={toString:function(){return"CodeMirror.Init"}},ks={},oo={};function $l(e){var t=e.optionHandlers;function i(n,r,s,l){e.defaults[n]=r,s&&(t[n]=l?function(f,m,v){v!=ur&&s(f,m,v)}:s)}e.defineOption=i,e.Init=ur,i("value","",function(n,r){return n.setValue(r)},!0),i("mode",null,function(n,r){n.doc.modeOption=r,No(n)},!0),i("indentUnit",2,No,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){kr(n),vr(n),Mn(n)},!0),i("lineSeparator",null,function(n,r){if(n.doc.lineSep=r,!r)return;var s=[],l=n.doc.first;n.doc.iter(function(m){for(var v=0;;){var B=m.text.indexOf(r,v);if(B==-1)break;v=B+r.length,s.push(Ve(l,B))}l++});for(var f=s.length-1;f>=0;f--)or(n.doc,r,s[f],Ve(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",dt,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",he?"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",!Ye),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Ss(n),Sr(n)},!0),i("keyMap","default",function(n,r,s){var l=io(r),f=s!=ur&&io(s);f&&f.detach&&f.detach(n,l),l.attach&&l.attach(n,f||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(n,r){n.display.gutterSpecs=Do(r,n.options.lineNumbers),Sr(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){_a(n),tr(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,r){n.display.gutterSpecs=Do(n.options.gutters,r),Sr(n)},!0),i("firstLineNumber",1,Sr,!0),i("lineNumberFormatter",function(n){return n},Sr,!0),i("showCursorWhenSelecting",!1,yr,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,r){r=="nocursor"&&(qi(n),n.display.input.blur()),n.display.input.readOnlyChanged(r)}),i("screenReaderLabel",null,function(n,r){r=r===""?null:r,n.display.input.screenReaderLabelChanged(r)}),i("disableInput",!1,function(n,r){r||n.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,yr,!0),i("singleCursorHeightPerLine",!0,yr,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,kr,!0),i("addModeClass",!1,kr,!0),i("pollInterval",100),i("undoDepth",200,function(n,r){return n.doc.history.undoDepth=r}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,kr,!0),i("moveInputWithCursor",!0,function(n,r){r||n.display.input.resetPosition()}),i("tabindex",null,function(n,r){return n.display.input.getField().tabIndex=r||""}),i("autofocus",null),i("direction","ltr",function(n,r){return n.doc.setDirection(r)},!0),i("phrases",null)}function Jl(e,t,i){var n=i&&i!=ur;if(!t!=!n){var r=e.display.dragFunctions,s=t?Oe:st;s(e.display.scroller,"dragstart",r.start),s(e.display.scroller,"dragenter",r.enter),s(e.display.scroller,"dragover",r.over),s(e.display.scroller,"dragleave",r.leave),s(e.display.scroller,"drop",r.drop)}}function Zl(e){e.options.lineWrapping?(P(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Le(e.display.wrapper,"CodeMirror-wrap"),fi(e)),So(e),Mn(e),vr(e),setTimeout(function(){return tr(e)},100)}function $t(e,t){var i=this;if(!(this instanceof $t))return new $t(e,t);this.options=t=t?d(t):{},d(ks,t,!1);var n=t.value;typeof n=="string"?n=new Rn(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var r=new $t.inputStyles[t.inputStyle](this),s=this.display=new hl(e,n,r,t);s.wrapper.CodeMirror=this,Ss(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),_a(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 H,keySeq:null,specialChars:null},t.autofocus&&!he&&s.input.focus(),_&&I<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Ll(),zi(this),this.curOp.forceUpdate=!0,ja(this,n),t.autofocus&&!he||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&To(i)},20):qi(this);for(var l in oo)oo.hasOwnProperty(l)&&oo[l](this,t[l],ur);Ma(this),t.finishInit&&t.finishInit(this);for(var f=0;f20*20}Oe(t.scroller,"touchstart",function(m){if(!Xe(e,m)&&!s(m)&&!Vo(e,m)){t.input.ensurePolled(),clearTimeout(i);var v=+new Date;t.activeTouch={start:v,moved:!1,prev:v-n.end<=300?n:null},m.touches.length==1&&(t.activeTouch.left=m.touches[0].pageX,t.activeTouch.top=m.touches[0].pageY)}}),Oe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Oe(t.scroller,"touchend",function(m){var v=t.activeTouch;if(v&&!pi(t,m)&&v.left!=null&&!v.moved&&new Date-v.start<300){var B=e.coordsChar(t.activeTouch,"page"),V;!v.prev||l(v,v.prev)?V=new Ut(B,B):!v.prev.prev||l(v,v.prev.prev)?V=e.findWordAt(B):V=new Ut(Ve(B.line,0),o(e.doc,Ve(B.line+1,0))),e.setSelection(V.anchor,V.head),e.focus(),y(m)}r()}),Oe(t.scroller,"touchcancel",r),Oe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xr(e,t.scroller.scrollTop),Ui(e,t.scroller.scrollLeft,!0),Pe(e,"scroll",e))}),Oe(t.scroller,"mousewheel",function(m){return Da(e,m)}),Oe(t.scroller,"DOMMouseScroll",function(m){return Da(e,m)}),Oe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(m){Xe(e,m)||j(m)},over:function(m){Xe(e,m)||(Al(e,m),j(m))},start:function(m){return _l(e,m)},drop:cn(e,Tl),leave:function(m){Xe(e,m)||ss(e)}};var f=t.input.getField();Oe(f,"keyup",function(m){return ys.call(e,m)}),Oe(f,"keydown",cn(e,vs)),Oe(f,"keypress",cn(e,bs)),Oe(f,"focus",function(m){return To(e,m)}),Oe(f,"blur",function(m){return qi(e,m)})}var Xo=[];$t.defineInitHook=function(e){return Xo.push(e)};function Br(e,t,i,n){var r=e.doc,s;i==null&&(i="add"),i=="smart"&&(r.mode.indent?s=pe(e,t).state:i="prev");var l=e.options.tabSize,f=ct(r,t),m=E(f.text,null,l);f.stateAfter&&(f.stateAfter=null);var v=f.text.match(/^\s*/)[0],B;if(!n&&!/\S/.test(f.text))B=0,i="not";else if(i=="smart"&&(B=r.mode.indent(s,f.text.slice(v.length),f.text),B==Me||B>150)){if(!n)return;i="prev"}i=="prev"?t>r.first?B=E(ct(r,t-1).text,null,l):B=0:i=="add"?B=m+e.options.indentUnit:i=="subtract"?B=m-e.options.indentUnit:typeof i=="number"&&(B=m+i),B=Math.max(0,B);var V="",de=0;if(e.options.indentWithTabs)for(var ae=Math.floor(B/l);ae;--ae)de+=l,V+=" ";if(del,m=mt(t),v=null;if(f&&n.ranges.length>1)if(ei&&ei.text.join(` `)==t){if(n.ranges.length%ei.text.length==0){v=[];for(var B=0;B=0;de--){var ae=n.ranges[de],De=ae.from(),We=ae.to();ae.empty()&&(i&&i>0?De=Ve(De.line,De.ch-i):e.state.overwrite&&!f?We=Ve(We.line,Math.min(ct(s,We.line).text.length,We.ch+b(m).length)):f&&ei&&ei.lineWise&&ei.text.join(` `)==m.join(` `)&&(De=We=Ve(De.line,0)));var $e={from:De,to:We,text:v?v[de%v.length]:m,origin:r||(f?"paste":e.state.cutIncoming>l?"cut":"+input")};rr(e.doc,$e),Xt(e,"inputRead",e,$e)}t&&!f&&_s(e,t),er(e),e.curOp.updateInput<2&&(e.curOp.updateInput=V),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ts(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Bn(t,function(){return Ko(t,i,0,null,"paste")}),!0}function _s(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-1){l=Br(e,r.head.line,"smart");break}}else s.electricInput&&(s.electricInput.test(ct(e.doc,r.head.line).text.slice(0,r.head.ch))&&(l=Br(e,r.head.line,"smart")));l&&Xt(e,"electricInput",e,r.head.line)}}function As(e){for(var t=[],i=[],n=0;ns&&(Br(this,f.head.line,n,!0),s=f.head.line,l==this.doc.sel.primIndex&&er(this));else{var m=f.from(),v=f.to(),B=Math.max(s,m.line);s=Math.min(this.lastLine(),v.line-(v.ch?0:1))+1;for(var V=B;V0&&Fo(this.doc,l,new Ut(m,de[l].to()),be)}}}),getTokenAt:function(n,r){return Ht(this,n,r)},getLineTokens:function(n,r){return Ht(this,Ve(n),r,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var r=je(this,ct(this.doc,n.line)),s=0,l=(r.length-1)/2,f=n.ch,m;if(f==0)m=r[2];else for(;;){var v=s+l>>1;if((v?r[v*2-1]:0)>=f)l=v;else if(r[v*2+1]m&&(n=m,l=!0),f=ct(this.doc,n)}else f=n;return zr(this,f,{top:0,left:0},r||"page",s||l).top+(l?this.doc.height-jn(f):0)},defaultTextHeight:function(){return Zi(this.display)},defaultCharWidth:function(){return Qi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,r,s,l,f){var m=this.display;n=Qn(this,o(this.doc,n));var v=n.bottom,B=n.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),m.sizer.appendChild(r),l=="over")v=n.top;else if(l=="above"||l=="near"){var V=Math.max(m.wrapper.clientHeight,this.doc.height),de=Math.max(m.sizer.clientWidth,m.lineSpace.clientWidth);(l=="above"||n.bottom+r.offsetHeight>V)&&n.top>r.offsetHeight?v=n.top-r.offsetHeight:n.bottom+r.offsetHeight<=V&&(v=n.bottom),B+r.offsetWidth>de&&(B=de-r.offsetWidth)}r.style.top=v+"px",r.style.left=r.style.right="",f=="right"?(B=m.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(f=="left"?B=0:f=="middle"&&(B=(m.sizer.clientWidth-r.offsetWidth)/2),r.style.left=B+"px"),s&&Js(this,{left:B,top:v,right:B+r.offsetWidth,bottom:v+r.offsetHeight})},triggerOnKeyDown:Sn(vs),triggerOnKeyPress:Sn(bs),triggerOnKeyUp:ys,triggerOnMouseDown:Sn(xs),execCommand:function(n){if(Pr.hasOwnProperty(n))return Pr[n].call(null,this)},triggerElectric:Sn(function(n){_s(this,n)}),findPosH:function(n,r,s,l){var f=1;r<0&&(f=-1,r=-r);for(var m=o(this.doc,n),v=0;v0&&B(s.charAt(l-1));)--l;for(;f.5||this.options.lineWrapping)&&So(this),Pe(this,"refresh",this)}),swapDoc:Sn(function(n){var r=this.doc;return r.cm=null,this.state.selectingText&&this.state.selectingText(),ja(this,n),vr(this),this.display.input.reset(),br(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,Xt(this,"swapDoc",this,r),r}),phrase:function(n){var r=this.options.phrases;return r&&Object.prototype.hasOwnProperty.call(r,n)?r[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},q(e),e.registerHelper=function(n,r,s){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][r]=s},e.registerGlobalHelper=function(n,r,s,l){e.registerHelper(n,r,l),i[n]._global.push({pred:s,val:l})}}function Yo(e,t,i,n,r){var s=t,l=i,f=ct(e,t.line),m=r&&e.direction=="rtl"?-i:i;function v(){var rt=t.line+m;return rt=e.first+e.size?!1:(t=new Ve(rt,t.ch,t.sticky),f=ct(e,rt))}function B(rt){var qe;if(n=="codepoint"){var lt=f.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(lt)?qe=null:qe=new Ve(t.line,Math.max(0,Math.min(f.text.length,t.ch+i*(lt>=55296&<<56320?2:1))),-i)}else r?qe=Pl(e.cm,f,t,i):qe=Ho(f,t,i);if(qe==null)if(!rt&&v())t=zo(r,e.cm,f,t.line,m);else return!1;else t=qe;return!0}if(n=="char"||n=="codepoint")B();else if(n=="column")B(!0);else if(n=="word"||n=="group")for(var V=null,de=n=="group",ae=e.cm&&e.cm.getHelper(t,"wordChars"),De=!0;!(i<0&&!B(!De));De=!1){var We=f.text.charAt(t.ch)||` `,$e=Ne(We,ae)?"w":de&&We==` `?"n":!de||/\s/.test(We)?null:"p";if(de&&!De&&!$e&&($e="s"),V&&V!=$e){i<0&&(i=1,B(),t.sticky="after");break}if($e&&(V=$e),i>0&&!B(!De))break}var Qe=eo(e,t,s,l,!0);return ti(s,Qe)&&(Qe.hitSide=!0),Qe}function Rs(e,t,i,n){var r=e.doc,s=t.left,l;if(n=="page"){var f=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),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 v;!(v=xo(e,s,l),!v.outside);){if(i<0?l<=0:l>=r.height){v.hitSide=!0;break}l+=i*5}return v}var Gt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new H,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Gt.prototype.init=function(e){var t=this,i=this,n=i.cm,r=i.div=e.lineDiv;Ls(r,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function s(f){for(var m=f.target;m;m=m.parentNode){if(m==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(m.className))break}return!1}Oe(r,"paste",function(f){if(!s(f)||Xe(n,f)||Ts(f,n))return;I<=11&&setTimeout(cn(n,function(){return t.updateFromDOM()}),20)}),Oe(r,"compositionstart",function(f){t.composing={data:f.data,done:!1}}),Oe(r,"compositionupdate",function(f){t.composing||(t.composing={data:f.data,done:!1})}),Oe(r,"compositionend",function(f){t.composing&&(f.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Oe(r,"touchstart",function(){return i.forceCompositionEnd()}),Oe(r,"input",function(){t.composing||t.readFromDOMSoon()});function l(f){if(!s(f)||Xe(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=As(n);ao({lineWise:!0,text:m.text}),f.type=="cut"&&n.operation(function(){n.setSelections(m.ranges,0,be),n.replaceSelection("",null,"cut")})}else return;if(f.clipboardData){f.clipboardData.clearData();var v=ei.text.join(` `);if(f.clipboardData.setData("Text",v),f.clipboardData.getData("Text")==v){f.preventDefault();return}}var B=Ms(),V=B.firstChild;n.display.lineSpace.insertBefore(B,n.display.lineSpace.firstChild),V.value=ei.text.join(` `);var de=document.activeElement;L(V),setTimeout(function(){n.display.lineSpace.removeChild(B),de.focus(),de==r&&i.showPrimarySelection()},50)}Oe(r,"copy",l),Oe(r,"cut",l)},Gt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Gt.prototype.prepareSelection=function(){var e=ya(this.cm,!1);return e.focus=document.activeElement==this.div,e},Gt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Gt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Gt.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&&Os(t,n)||{node:f[0].measure.map[2],offset:0},v=r.linee.firstLine()&&(n=Ve(n.line-1,ct(e.doc,n.line-1).length)),r.ch==ct(e.doc,r.line).text.length&&r.linet.viewTo-1)return!1;var s,l,f;n.line==t.viewFrom||(s=Fi(e,n.line))==0?(l=Rt(t.view[0].line),f=t.view[0].node):(l=Rt(t.view[s].line),f=t.view[s-1].node.nextSibling);var m=Fi(e,r.line),v,B;if(m==t.view.length-1?(v=t.viewTo-1,B=t.lineDiv.lastChild):(v=Rt(t.view[m+1].line)-1,B=t.view[m+1].node.previousSibling),!f)return!1;for(var V=e.doc.splitLines(tu(e,f,B,l,v)),de=Un(e.doc,Ve(l,0),Ve(v,ct(e.doc,v).text.length));V.length>1&&de.length>1;)if(b(V)==b(de))V.pop(),de.pop(),v--;else if(V[0]==de[0])V.shift(),de.shift(),l++;else break;for(var ae=0,De=0,We=V[0],$e=de[0],Qe=Math.min(We.length,$e.length);aen.ch&&rt.charCodeAt(rt.length-De-1)==qe.charCodeAt(qe.length-De-1);)ae--,De++;V[V.length-1]=rt.slice(0,rt.length-De).replace(/^\u200b+/,""),V[0]=V[0].slice(ae).replace(/\u200b+$/,"");var xt=Ve(l,ae),gt=Ve(v,de.length?b(de).length-De:0);if(V.length>1||V[0]||Ct(xt,gt))return or(e.doc,V,xt,gt,"+input"),!0},Gt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Gt.prototype.reset=function(){this.forceCompositionEnd()},Gt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Gt.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)},Gt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Bn(this.cm,function(){return Mn(e.cm)})},Gt.prototype.setUneditable=function(e){e.contentEditable="false"},Gt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||cn(this.cm,Ko)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Gt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Gt.prototype.onContextMenu=function(){},Gt.prototype.resetPosition=function(){},Gt.prototype.needsContentAttribute=!0;function Os(e,t){var i=go(e,t.line);if(!i||i.hidden)return null;var n=ct(e.doc,t.line),r=ra(i,n,t.line),s=ut(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 hr(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 v(ae){return function(De){return De.id==ae}}function B(){l&&(s+=f,m&&(s+=f),l=m=!1)}function V(ae){ae&&(B(),s+=ae)}function de(ae){if(ae.nodeType==1){var De=ae.getAttribute("cm-text");if(De){V(De);return}var We=ae.getAttribute("cm-marker"),$e;if(We){var Qe=e.findMarks(Ve(n,0),Ve(r+1,0),v(+We));Qe.length&&($e=Qe[0].find(0))&&V(Un(e.doc,$e.from,$e.to).join(f));return}if(ae.getAttribute("contenteditable")=="false")return;var rt=/^(pre|div|p|li|table|br)$/i.test(ae.nodeName);if(!/^br$/i.test(ae.nodeName)&&ae.textContent.length==0)return;rt&&B();for(var qe=0;qe=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Oe(r,"paste",function(l){if(Xe(n,l)||Ts(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if(Xe(n,l))return;if(n.somethingSelected())ao({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var f=As(n);ao({lineWise:!0,text:f.text}),l.type=="cut"?n.setSelections(f.ranges,null,be):(i.prevInput="",r.value=f.text.join(` `),L(r))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}Oe(r,"cut",s),Oe(r,"copy",s),Oe(e.scroller,"paste",function(l){if(pi(e,l)||Xe(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)}),Oe(e.lineSpace,"selectstart",function(l){pi(e,l)||y(l)}),Oe(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"})}}),Oe(r,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},en.prototype.createField=function(e){this.wrapper=Ms(),this.textarea=this.wrapper.firstChild},en.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},en.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=ya(e);if(e.options.moveInputWithCursor){var r=Qn(e,i.sel.primary().head,"div"),s=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+l.top-s.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+l.left-s.left))}return n},en.prototype.showSelection=function(e){var t=this.cm,i=t.display;ce(i.cursorDiv,e.cursors),ce(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},en.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&&L(this.textarea),_&&I>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",_&&I>=9&&(this.hasSelection=null))},en.prototype.getField=function(){return this.textarea},en.prototype.supportsTouch=function(){return!1},en.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!he||N()!=this.textarea))try{this.textarea.focus()}catch(e){}},en.prototype.blur=function(){this.textarea.blur()},en.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},en.prototype.receivedFocus=function(){this.slowPoll()},en.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()})},en.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)},en.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||tt(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(_&&I>=9&&this.hasSelection===r||me&&/[\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);l1e3||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},en.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},en.prototype.onKeyPress=function(){_&&I>=9&&(this.hasSelection=null),this.fastPoll()},en.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||A)return;var f=i.options.resetSelectionOnContextMenu;f&&i.doc.sel.contains(s)==-1&&cn(i,Cn)(i.doc,ki(s),be);var m=r.style.cssText,v=t.wrapper.style.cssText,B=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-B.top-5)+"px; left: "+(e.clientX-B.left-5)+`px; z-index: 1000; background: `+(_?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var V;k&&(V=window.scrollY),n.input.focus(),k&&window.scrollTo(null,V),n.input.reset(),i.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=ae,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function de(){if(r.selectionStart!=null){var We=i.somethingSelected(),$e="\u200B"+(We?r.value:"");r.value="\u21DA",r.value=$e,t.prevInput=We?"":"\u200B",r.selectionStart=1,r.selectionEnd=$e.length,n.selForContextMenu=i.doc.sel}}function ae(){if(t.contextMenuPending!=ae)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=v,r.style.cssText=m,_&&I<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),r.selectionStart!=null){(!_||_&&I<9)&&de();var We=0,$e=function(){n.selForContextMenu==i.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?cn(i,Ja)(i):We++<10?n.detectingSelectAll=setTimeout($e,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout($e,200)}}if(_&&I>=9&&de(),Ue){j(e);var De=function(){st(window,"mouseup",De),setTimeout(ae,20)};Oe(window,"mouseup",De)}else setTimeout(ae,50)},en.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},en.prototype.setUneditable=function(){},en.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=N();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=f.getValue()}var r;if(e.form&&(Oe(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&&(st(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var f=$t(function(m){return e.parentNode.insertBefore(m,e.nextSibling)},t);return f}function ru(e){e.off=st,e.on=Oe,e.wheelEventPixels=cl,e.Doc=Rn,e.splitLines=mt,e.countColumn=E,e.findColumn=ve,e.isWordChar=Te,e.Pass=Me,e.signal=Pe,e.Line=wi,e.changeEnd=Ti,e.scrollbarModel=Ta,e.Pos=Ve,e.cmpPos=Ct,e.modes=jt,e.mimeModes=kt,e.resolveMode=ft,e.getMode=En,e.modeExtensions=ln,e.extendMode=gn,e.copyState=Tn,e.startState=Xn,e.innerMode=li,e.commands=Pr,e.keyMap=mi,e.keyName=ds,e.isModifierKey=hs,e.lookupKey=sr,e.normalizeKeyMap=Dl,e.StringStream=Nt,e.SharedTextMarker=Rr,e.TextMarker=Ai,e.LineWidget=Mr,e.e_preventDefault=y,e.e_stopPropagation=S,e.e_stop=j,e.addClass=P,e.contains=C,e.rmClass=Le,e.keyNames=Li}$l($t),ql($t);var ou="iter insert remove copy getEditor constructor".split(" ");for(var lo in Rn.prototype)Rn.prototype.hasOwnProperty(lo)&&$(ou,lo)<0&&($t.prototype[lo]=function(e){return function(){return e.apply(this.doc,arguments)}}(Rn.prototype[lo]));return q(Rn),$t.inputStyles={textarea:en,contenteditable:Gt},$t.defineMode=function(e){!$t.defaults.mode&&e!="null"&&($t.defaults.mode=e),mn.apply(this,arguments)},$t.defineMIME=sn,$t.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),$t.defineMIME("text/plain","null"),$t.defineExtension=function(e,t){$t.prototype[e]=t},$t.defineDocExtension=function(e,t){Rn.prototype[e]=t},$t.fromTextArea=iu,ru($t),$t.version="5.58.2",$t})},X0ci:function(ot,Je,x){},Y1PL:function(ot,Je,x){"use strict";x.r(Je),x.d(Je,"ResizableTextArea",function(){return $});var F=x("wx14"),le=x("1OyB"),ne=x("vuIU"),ge=x("Ji7U"),se=x("LK+K"),G=x("q1tI"),_=x("VTBJ"),I=x("rePB"),k=x("Zm9Q"),O=x("Kwbf"),T=x("c+Xe"),A=x("m+aA"),ee=x("bdgK"),Q=new Map;function U(be){be.forEach(function(xe){var ue,ve=xe.target;(ue=Q.get(ve))===null||ue===void 0||ue.forEach(function(Z){return Z(ve)})})}var J=new ee.default(U),Y=null,he=null;function me(be,xe){Q.has(be)||(Q.set(be,new Set),J.observe(be)),Q.get(be).add(xe)}function ze(be,xe){Q.has(be)&&(Q.get(be).delete(xe),Q.get(be).size||(J.unobserve(be),Q.delete(be)))}var Ye=function(be){Object(ge.a)(ue,be);var xe=Object(se.a)(ue);function ue(){return Object(le.a)(this,ue),xe.apply(this,arguments)}return Object(ne.a)(ue,[{key:"render",value:function(){return this.props.children}}]),ue}(G.Component),_e=G.createContext(null);function ke(be){var xe=be.children,ue=be.onBatchResize,ve=G.useRef(0),Z=G.useRef([]),z=G.useContext(_e),b=G.useCallback(function(W,M,ye){ve.current+=1;var we=ve.current;Z.current.push({size:W,element:M,data:ye}),Promise.resolve().then(function(){we===ve.current&&(ue==null||ue(Z.current),Z.current=[])}),z==null||z(W,M,ye)},[ue,z]);return G.createElement(_e.Provider,{value:b},xe)}function Ue(be){var xe=be.children,ue=be.disabled,ve=G.useRef(null),Z=G.useRef(null),z=G.useContext(_e),b=G.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),W=G.isValidElement(xe)&&Object(T.c)(xe),M=W?xe.ref:null,ye=G.useMemo(function(){return Object(T.a)(M,ve)},[M,ve]),we=G.useRef(be);we.current=be;var ie=G.useCallback(function(Te){var Ne=we.current,He=Ne.onResize,Ie=Ne.data,Re=Te.getBoundingClientRect(),Be=Re.width,Ze=Re.height,at=Te.offsetWidth,et=Te.offsetHeight,nt=Math.floor(Be),pt=Math.floor(Ze);if(b.current.width!==nt||b.current.height!==pt||b.current.offsetWidth!==at||b.current.offsetHeight!==et){var ut={width:nt,height:pt,offsetWidth:at,offsetHeight:et};b.current=ut;var it=at===Math.round(Be)?Be:at,Oe=et===Math.round(Ze)?Ze:et,vt=Object(_.a)(Object(_.a)({},ut),{},{offsetWidth:it,offsetHeight:Oe});z==null||z(vt,Te,Ie),He&&Promise.resolve().then(function(){He(vt,Te)})}},[]);return G.useEffect(function(){var Te=Object(A.a)(ve.current)||Object(A.a)(Z.current);return Te&&!ue&&me(Te,ie),function(){return ze(Te,ie)}},[ve.current,ue]),G.createElement(Ye,{ref:Z},W?G.cloneElement(xe,{ref:ye}):xe)}var Ee="rc-observer-key";function Le(be){var xe=be.children,ue=Object(k.a)(xe);return ue.map(function(ve,Z){var z=(ve==null?void 0:ve.key)||"".concat(Ee,"-").concat(Z);return G.createElement(Ue,Object(F.a)({},be,{key:z}),ve)})}Le.Collection=ke;var Se=Le,ce=x("bT9E"),R=x("TSYQ"),oe=x.n(R),re=` min-height:0 !important; max-height:none !important; height:0 !important; visibility:hidden !important; overflow:hidden !important; position:absolute !important; z-index:-1000 !important; top:0 !important; right:0 !important `,C=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],N={},P;function w(be){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ue=be.getAttribute("id")||be.getAttribute("data-reactid")||be.getAttribute("name");if(xe&&N[ue])return N[ue];var ve=window.getComputedStyle(be),Z=ve.getPropertyValue("box-sizing")||ve.getPropertyValue("-moz-box-sizing")||ve.getPropertyValue("-webkit-box-sizing"),z=parseFloat(ve.getPropertyValue("padding-bottom"))+parseFloat(ve.getPropertyValue("padding-top")),b=parseFloat(ve.getPropertyValue("border-bottom-width"))+parseFloat(ve.getPropertyValue("border-top-width")),W=C.map(function(ye){return"".concat(ye,":").concat(ve.getPropertyValue(ye))}).join(";"),M={sizingStyle:W,paddingSize:z,borderSize:b,boxSizing:Z};return xe&&ue&&(N[ue]=M),M}function L(be){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ve=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;P||(P=document.createElement("textarea"),P.setAttribute("tab-index","-1"),P.setAttribute("aria-hidden","true"),document.body.appendChild(P)),be.getAttribute("wrap")?P.setAttribute("wrap",be.getAttribute("wrap")):P.removeAttribute("wrap");var Z=w(be,xe),z=Z.paddingSize,b=Z.borderSize,W=Z.boxSizing,M=Z.sizingStyle;P.setAttribute("style","".concat(M,";").concat(re)),P.value=be.value||be.placeholder||"";var ye=Number.MIN_SAFE_INTEGER,we=Number.MAX_SAFE_INTEGER,ie=P.scrollHeight,Te;if(W==="border-box"?ie+=b:W==="content-box"&&(ie-=z),ue!==null||ve!==null){P.value=" ";var Ne=P.scrollHeight-z;ue!==null&&(ye=Ne*ue,W==="border-box"&&(ye=ye+z+b),ie=Math.max(ye,ie)),ve!==null&&(we=Ne*ve,W==="border-box"&&(we=we+z+b),Te=ie>we?"":"hidden",ie=Math.min(we,ie))}return{height:ie,minHeight:ye,maxHeight:we,overflowY:Te,resize:"none"}}var p=x("Gytx"),d=x.n(p),E;(function(be){be[be.NONE=0]="NONE",be[be.RESIZING=1]="RESIZING",be[be.RESIZED=2]="RESIZED"})(E||(E={}));var H=function(be){Object(ge.a)(ue,be);var xe=Object(se.a)(ue);function ue(ve){var Z;return Object(le.a)(this,ue),Z=xe.call(this,ve),Z.nextFrameActionId=void 0,Z.resizeFrameId=void 0,Z.textArea=void 0,Z.saveTextArea=function(z){Z.textArea=z},Z.handleResize=function(z){var b=Z.state.resizeStatus,W=Z.props,M=W.autoSize,ye=W.onResize;if(b!==E.NONE)return;typeof ye=="function"&&ye(z),M&&Z.resizeOnNextFrame()},Z.resizeOnNextFrame=function(){cancelAnimationFrame(Z.nextFrameActionId),Z.nextFrameActionId=requestAnimationFrame(Z.resizeTextarea)},Z.resizeTextarea=function(){var z=Z.props.autoSize;if(!z||!Z.textArea)return;var b=z.minRows,W=z.maxRows,M=L(Z.textArea,!1,b,W);Z.setState({textareaStyles:M,resizeStatus:E.RESIZING},function(){cancelAnimationFrame(Z.resizeFrameId),Z.resizeFrameId=requestAnimationFrame(function(){Z.setState({resizeStatus:E.RESIZED},function(){Z.resizeFrameId=requestAnimationFrame(function(){Z.setState({resizeStatus:E.NONE}),Z.fixFirefoxAutoScroll()})})})})},Z.renderTextArea=function(){var z=Z.props,b=z.prefixCls,W=b===void 0?"rc-textarea":b,M=z.autoSize,ye=z.onResize,we=z.className,ie=z.disabled,Te=Z.state,Ne=Te.textareaStyles,He=Te.resizeStatus,Ie=Object(ce.a)(Z.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Re=oe()(W,we,Object(I.a)({},"".concat(W,"-disabled"),ie));"value"in Ie&&(Ie.value=Ie.value||"");var Be=Object(_.a)(Object(_.a)(Object(_.a)({},Z.props.style),Ne),He===E.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return G.createElement(Se,{onResize:Z.handleResize,disabled:!(M||ye)},G.createElement("textarea",Object(F.a)({},Ie,{className:Re,style:Be,ref:Z.saveTextArea})))},Z.state={textareaStyles:{},resizeStatus:E.NONE},Z}return Object(ne.a)(ue,[{key:"componentDidUpdate",value:function(Z){(Z.value!==this.props.value||!d()(Z.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 Z=this.textArea.selectionStart,z=this.textArea.selectionEnd;this.textArea.setSelectionRange(Z,z)}}catch(b){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ue}(G.Component),$=H,Ce=function(be){Object(ge.a)(ue,be);var xe=Object(se.a)(ue);function ue(ve){var Z;Object(le.a)(this,ue),Z=xe.call(this,ve),Z.resizableTextArea=void 0,Z.focus=function(){Z.resizableTextArea.textArea.focus()},Z.saveTextArea=function(b){Z.resizableTextArea=b},Z.handleChange=function(b){var W=Z.props.onChange;Z.setValue(b.target.value,function(){Z.resizableTextArea.resizeTextarea()}),W&&W(b)},Z.handleKeyDown=function(b){var W=Z.props,M=W.onPressEnter,ye=W.onKeyDown;b.keyCode===13&&M&&M(b),ye&&ye(b)};var z=typeof ve.value=="undefined"||ve.value===null?ve.defaultValue:ve.value;return Z.state={value:z},Z}return Object(ne.a)(ue,[{key:"setValue",value:function(Z,z){"value"in this.props||this.setState({value:Z},z)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return G.createElement($,Object(F.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(Z){return"value"in Z?{value:Z.value}:null}}]),ue}(G.Component),Me=Je.default=Ce},ZW9T:function(ot,Je,x){"use strict";x.d(Je,"a",function(){return Ye});var F=x("k1fw"),le=x("miYZ"),ne=x("tsqr"),ge=x("rAM+"),se=x("tJVT"),G=x("PpiC"),_=x("q1tI"),I=x.n(_),k=x("bdgK");function O(_e,ke,Ue,Ee,Le){var Se=ke.getWordUntilPosition(Ue),ce={startLineNumber:Ue.lineNumber,endLineNumber:Ue.lineNumber,startColumn:Se.startColumn,endColumn:Se.endColumn},R=Ee.map(function(oe){return{label:oe,kind:_e.languages.CompletionItemKind.Keyword,insertText:oe,insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ce}});return Le.map(function(oe){R.push(Object(F.a)(Object(F.a)({},oe),{},{range:ce}))}),R}var T=function(_e){var ke={label:"ifelse",kind:_e.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(` `),insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet},Ue=["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"];_e.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(ce,R){var oe=O(_e,ce,R,Ue,[ke]);return{suggestions:oe}}});var Ee=["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"];_e.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(ce,R){var oe=[{label:"print",kind:_e.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(` `),insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet}],re=O(_e,ce,R,Ee,oe);return{suggestions:re}}});var Le=["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"];_e.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(ce,R){var oe=[ke,{label:"main",kind:_e.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(` `),insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:_e.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(` `),insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet}],re=O(_e,ce,R,Le,oe);return{suggestions:re}}})},A="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",ee=x("LvDl");function Q(_e){return/^\d+$/.test(_e)?"".concat(_e,"px"):_e}function U(){}var J=!1,Y={"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 he(){var _e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ke=_e;if(Array.isArray(_e)){for(var Ue=0;Ue<_e.length;Ue++){var Ee=Y[_e[Ue]];if(Ee)return Ee}return ke[0]}return Y[ke]||ke}var me=null,ze=Je.b=function(_e){var ke=_e.width,Ue=ke===void 0?"100%":ke,Ee=_e.height,Le=Ee===void 0?"100%":Ee,Se=_e.value,ce=_e.language,R=ce===void 0?"javascript":ce,oe=_e.style,re=oe===void 0?{}:oe,C=_e.options,N=C===void 0?{}:C,P=_e.overrideServices,w=P===void 0?{}:P,L=_e.theme,p=L===void 0?"vs-dark":L,d=_e.onEditBlur,E=_e.onSave,H=_e.autoHeight,$=H===void 0?!1:H,Ce=_e.forbidCopy,Me=Ce===void 0?!1:Ce,be=_e.onChange,xe=be===void 0?U:be,ue=_e.editorDidMount,ve=ue===void 0?U:ue,Z=_e.onFocus,z=Z===void 0?U:Z,b=_e.filename,W=b===void 0?"educoder.txt":b,M=Object(G.a)(_e,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),ye=Object(_.useRef)(),we=Object(_.useRef)({}),ie=Object(_.useRef)(),Te=Object(_.useRef)(!1),Ne=Object(_.useRef)(),He=Object(_.useState)(!1),Ie=Object(se.a)(He,2),Re=Ie[0],Be=Ie[1];function Ze(){var D;return ye.current&&(D=new k.default(function(j){var fe=Object(ge.a)(j),Ae;try{for(fe.s();!(Ae=fe.n()).done;){var Ke=Ae.value;(Ke.target.offsetHeight>0||Ke.target.offsetWidth>0)&&we.current.instance.layout()}}catch(yt){fe.e(yt)}finally{fe.f()}}),D.observe(ye.current)),D}function at(){ne.b.warn(decodeURIComponent(A))}var et=function(){var j=we.current.instance;if(Se!=null&&j&&Re){var fe=j.getModel();fe&&Se!==fe.getValue()&&(J=!0,fe.setValue(Se),j.layout(),J=!1)}};Object(_.useEffect)(function(){ie.current&&clearTimeout(ie.current),ie.current=setTimeout(function(){et()},500)},[Se,Re,we.current]);function nt(){var D=we.current.instance;if(D){var j=D.getSelection(),fe=we.current.pastePos||{},Ae=new me.Range(fe.startLineNumber||j.endLineNumber,fe.startColumn||j.endColumn,fe.endLineNumber||j.endLineNumber,fe.endColumn||j.endColumn);setTimeout(function(){D.executeEdits("",[{range:Ae,text:""}])},300)}}function pt(D){(window.navigator.platform.match("Mac")?D.metaKey:D.ctrlKey)&&D.keyCode==83&&(D.preventDefault(),E())}var ut=function(){if($&&we.current.instance){var j=we.current.instance.getContentHeight();y(j0||ue.target.offsetWidth>0)&&$.layout()}}catch(ve){be.e(ve)}finally{be.f()}}),Ce.observe(C.current)),Ce}Object(_.useEffect)(function(){C.current&&x.e(27).then(x.t.bind(null,"M/lh",7)).then(function($){me=$;var Ce=me.editor.createDiffEditor(C.current,Object(F.a)(Object(F.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},re),{},{wordWrap:!0}));L(Ce);var Me=p(Ce);return function(){Ce.dispose();var be=Ce.getModel();be&&be.dispose(),Me.unobserve(C.current)}})},[]),Object(_.useEffect)(function(){w&&w.setModel({original:me.editor.createModel(Se,R),modified:me.editor.createModel(ce,R)})},[Se,ce,R,w]);var d=Q(Ue),E=Q(Le),H={width:d,height:E};return I.a.createElement("div",{className:"my-diff-editor",ref:C,style:H})}},ZpRC:function(ot,Je,x){"use strict";function F(T){return typeof T=="object"&&T!=null&&T.nodeType===1}function le(T,A){return(!A||T!=="hidden")&&T!=="visible"&&T!=="clip"}function ne(T,A){if(T.clientHeightA||J>T&&Y=A&&he>=ee?J-T-Q:Y>A&&heee?Y-A+U:0}var se=function(T,A){var ee=window,Q=A.scrollMode,U=A.block,J=A.inline,Y=A.boundary,he=A.skipOverflowHiddenElements,me=typeof Y=="function"?Y:function(Ne){return Ne!==Y};if(!F(T))throw new TypeError("Invalid target");for(var ze=document.scrollingElement||document.documentElement,Ye=[],_e=T;F(_e)&&me(_e);){if((_e=_e.parentElement)===ze){Ye.push(_e);break}_e!=null&&_e===document.body&&ne(_e)&&!ne(document.documentElement)||_e!=null&&ne(_e,he)&&Ye.push(_e)}for(var ke=ee.visualViewport?ee.visualViewport.width:innerWidth,Ue=ee.visualViewport?ee.visualViewport.height:innerHeight,Ee=window.scrollX||pageXOffset,Le=window.scrollY||pageYOffset,Se=T.getBoundingClientRect(),ce=Se.height,R=Se.width,oe=Se.top,re=Se.right,C=Se.bottom,N=Se.left,P=U==="start"||U==="nearest"?oe:U==="end"?C:oe+ce/2,w=J==="center"?N+R/2:J==="end"?re:N,L=[],p=0;p=0&&N>=0&&C<=Ue&&re<=ke&&oe>=Ce&&C<=be&&N>=xe&&re<=Me)return L;var ue=getComputedStyle(d),ve=parseInt(ue.borderLeftWidth,10),Z=parseInt(ue.borderTopWidth,10),z=parseInt(ue.borderRightWidth,10),b=parseInt(ue.borderBottomWidth,10),W=0,M=0,ye="offsetWidth"in d?d.offsetWidth-d.clientWidth-ve-z:0,we="offsetHeight"in d?d.offsetHeight-d.clientHeight-Z-b:0;if(ze===d)W=U==="start"?P:U==="end"?P-Ue:U==="nearest"?ge(Le,Le+Ue,Ue,Z,b,Le+P,Le+P+ce,ce):P-Ue/2,M=J==="start"?w:J==="center"?w-ke/2:J==="end"?w-ke:ge(Ee,Ee+ke,ke,ve,z,Ee+w,Ee+w+R,R),W=Math.max(0,W+Le),M=Math.max(0,M+Ee);else{W=U==="start"?P-Ce-Z:U==="end"?P-be+b+we:U==="nearest"?ge(Ce,be,H,Z,b+we,P,P+ce,ce):P-(Ce+H/2)+we/2,M=J==="start"?w-xe-ve:J==="center"?w-(xe+$/2)+ye/2:J==="end"?w-Me+z+ye:ge(xe,Me,$,ve,z+ye,w,w+R,R);var ie=d.scrollLeft,Te=d.scrollTop;P+=Te-(W=Math.max(0,Math.min(Te+W,d.scrollHeight-H+we))),w+=ie-(M=Math.max(0,Math.min(ie+M,d.scrollWidth-$+ye)))}L.push({el:d,top:W,left:M})}return L};function G(T){return T===Object(T)&&Object.keys(T).length!==0}function _(T,A){A===void 0&&(A="auto");var ee="scrollBehavior"in document.body.style;T.forEach(function(Q){var U=Q.el,J=Q.top,Y=Q.left;U.scroll&&ee?U.scroll({top:J,left:Y,behavior:A}):(U.scrollTop=J,U.scrollLeft=Y)})}function I(T){return T===!1?{block:"end",inline:"nearest"}:G(T)?T:{block:"start",inline:"nearest"}}function k(T,A){var ee=!T.ownerDocument.documentElement.contains(T);if(G(A)&&typeof A.behavior=="function")return A.behavior(ee?[]:se(T,A));if(ee)return;var Q=I(A);return _(se(T,Q),Q.behavior)}var O=Je.a=k},Zss7:function(ot,Je,x){var F;(function(le){var ne=/^\s+/,ge=/\s+$/,se=0,G=le.round,_=le.min,I=le.max,k=le.random;function O(b,W){if(b=b||"",W=W||{},b instanceof O)return b;if(!(this instanceof O))return new O(b,W);var M=T(b);this._originalInput=b,this._r=M.r,this._g=M.g,this._b=M.b,this._a=M.a,this._roundA=G(100*this._a)/100,this._format=W.format||M.format,this._gradientType=W.gradientType,this._r<1&&(this._r=G(this._r)),this._g<1&&(this._g=G(this._g)),this._b<1&&(this._b=G(this._b)),this._ok=M.ok,this._tc_id=se++}O.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(),W,M,ye,we,ie,Te;return W=b.r/255,M=b.g/255,ye=b.b/255,W<=.03928?we=W/12.92:we=le.pow((W+.055)/1.055,2.4),M<=.03928?ie=M/12.92:ie=le.pow((M+.055)/1.055,2.4),ye<=.03928?Te=ye/12.92:Te=le.pow((ye+.055)/1.055,2.4),.2126*we+.7152*ie+.0722*Te},setAlpha:function(b){return this._a=L(b),this._roundA=G(100*this._a)/100,this},toHsv:function(){var b=U(this._r,this._g,this._b);return{h:b.h*360,s:b.s,v:b.v,a:this._a}},toHsvString:function(){var b=U(this._r,this._g,this._b),W=G(b.h*360),M=G(b.s*100),ye=G(b.v*100);return this._a==1?"hsv("+W+", "+M+"%, "+ye+"%)":"hsva("+W+", "+M+"%, "+ye+"%, "+this._roundA+")"},toHsl:function(){var b=ee(this._r,this._g,this._b);return{h:b.h*360,s:b.s,l:b.l,a:this._a}},toHslString:function(){var b=ee(this._r,this._g,this._b),W=G(b.h*360),M=G(b.s*100),ye=G(b.l*100);return this._a==1?"hsl("+W+", "+M+"%, "+ye+"%)":"hsla("+W+", "+M+"%, "+ye+"%, "+this._roundA+")"},toHex:function(b){return Y(this._r,this._g,this._b,b)},toHexString:function(b){return"#"+this.toHex(b)},toHex8:function(b){return he(this._r,this._g,this._b,this._a,b)},toHex8String:function(b){return"#"+this.toHex8(b)},toRgb:function(){return{r:G(this._r),g:G(this._g),b:G(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+G(this._r)+", "+G(this._g)+", "+G(this._b)+")":"rgba("+G(this._r)+", "+G(this._g)+", "+G(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:G(p(this._r,255)*100)+"%",g:G(p(this._g,255)*100)+"%",b:G(p(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+G(p(this._r,255)*100)+"%, "+G(p(this._g,255)*100)+"%, "+G(p(this._b,255)*100)+"%)":"rgba("+G(p(this._r,255)*100)+"%, "+G(p(this._g,255)*100)+"%, "+G(p(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:P[Y(this._r,this._g,this._b,!0)]||!1},toFilter:function(b){var W="#"+me(this._r,this._g,this._b,this._a),M=W,ye=this._gradientType?"GradientType = 1, ":"";if(b){var we=O(b);M="#"+me(we._r,we._g,we._b,we._a)}return"progid:DXImageTransform.Microsoft.gradient("+ye+"startColorstr="+W+",endColorstr="+M+")"},toString:function(b){var W=!!b;b=b||this._format;var M=!1,ye=this._a<1&&this._a>=0,we=!W&&ye&&(b==="hex"||b==="hex6"||b==="hex3"||b==="hex4"||b==="hex8"||b==="name");return we?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 O(this.toString())},_applyModification:function(b,W){var M=b.apply(null,[this].concat([].slice.call(W)));return this._r=M._r,this._g=M._g,this._b=M._b,this.setAlpha(M._a),this},lighten:function(){return this._applyModification(ke,arguments)},brighten:function(){return this._applyModification(Ue,arguments)},darken:function(){return this._applyModification(Ee,arguments)},desaturate:function(){return this._applyModification(ze,arguments)},saturate:function(){return this._applyModification(Ye,arguments)},greyscale:function(){return this._applyModification(_e,arguments)},spin:function(){return this._applyModification(Le,arguments)},_applyCombination:function(b,W){return b.apply(null,[this].concat([].slice.call(W)))},analogous:function(){return this._applyCombination(re,arguments)},complement:function(){return this._applyCombination(Se,arguments)},monochromatic:function(){return this._applyCombination(C,arguments)},splitcomplement:function(){return this._applyCombination(oe,arguments)},triad:function(){return this._applyCombination(ce,arguments)},tetrad:function(){return this._applyCombination(R,arguments)}},O.fromRatio=function(b,W){if(typeof b=="object"){var M={};for(var ye in b)b.hasOwnProperty(ye)&&(ye==="a"?M[ye]=b[ye]:M[ye]=Me(b[ye]));b=M}return O(b,W)};function T(b){var W={r:0,g:0,b:0},M=1,ye=null,we=null,ie=null,Te=!1,Ne=!1;return typeof b=="string"&&(b=Z(b)),typeof b=="object"&&(ve(b.r)&&ve(b.g)&&ve(b.b)?(W=A(b.r,b.g,b.b),Te=!0,Ne=String(b.r).substr(-1)==="%"?"prgb":"rgb"):ve(b.h)&&ve(b.s)&&ve(b.v)?(ye=Me(b.s),we=Me(b.v),W=J(b.h,ye,we),Te=!0,Ne="hsv"):ve(b.h)&&ve(b.s)&&ve(b.l)&&(ye=Me(b.s),ie=Me(b.l),W=Q(b.h,ye,ie),Te=!0,Ne="hsl"),b.hasOwnProperty("a")&&(M=b.a)),M=L(M),{ok:Te,format:b.format||Ne,r:_(255,I(W.r,0)),g:_(255,I(W.g,0)),b:_(255,I(W.b,0)),a:M}}function A(b,W,M){return{r:p(b,255)*255,g:p(W,255)*255,b:p(M,255)*255}}function ee(b,W,M){b=p(b,255),W=p(W,255),M=p(M,255);var ye=I(b,W,M),we=_(b,W,M),ie,Te,Ne=(ye+we)/2;if(ye==we)ie=Te=0;else{var He=ye-we;Te=Ne>.5?He/(2-ye-we):He/(ye+we);switch(ye){case b:ie=(W-M)/He+(W1&&(Be-=1),Be<1/6?Ie+(Re-Ie)*6*Be:Be<1/2?Re:Be<2/3?Ie+(Re-Ie)*(2/3-Be)*6:Ie}if(W===0)ye=we=ie=M;else{var Ne=M<.5?M*(1+W):M+W-M*W,He=2*M-Ne;ye=Te(He,Ne,b+1/3),we=Te(He,Ne,b),ie=Te(He,Ne,b-1/3)}return{r:ye*255,g:we*255,b:ie*255}}function U(b,W,M){b=p(b,255),W=p(W,255),M=p(M,255);var ye=I(b,W,M),we=_(b,W,M),ie,Te,Ne=ye,He=ye-we;if(Te=ye===0?0:He/ye,ye==we)ie=0;else{switch(ye){case b:ie=(W-M)/He+(W>1)+720)%360;--W;)ye.h=(ye.h+we)%360,ie.push(O(ye));return ie}function C(b,W){W=W||6;for(var M=O(b).toHsv(),ye=M.h,we=M.s,ie=M.v,Te=[],Ne=1/W;W--;)Te.push(O({h:ye,s:we,v:ie})),ie=(ie+Ne)%1;return Te}O.mix=function(b,W,M){M=M===0?0:M||50;var ye=O(b).toRgb(),we=O(W).toRgb(),ie=M/100,Te={r:(we.r-ye.r)*ie+ye.r,g:(we.g-ye.g)*ie+ye.g,b:(we.b-ye.b)*ie+ye.b,a:(we.a-ye.a)*ie+ye.a};return O(Te)},O.readability=function(b,W){var M=O(b),ye=O(W);return(le.max(M.getLuminance(),ye.getLuminance())+.05)/(le.min(M.getLuminance(),ye.getLuminance())+.05)},O.isReadable=function(b,W,M){var ye=O.readability(b,W),we,ie;ie=!1,we=z(M);switch(we.level+we.size){case"AAsmall":case"AAAlarge":ie=ye>=4.5;break;case"AAlarge":ie=ye>=3;break;case"AAAsmall":ie=ye>=7;break}return ie},O.mostReadable=function(b,W,M){var ye=null,we=0,ie,Te,Ne,He;M=M||{},Te=M.includeFallbackColors,Ne=M.level,He=M.size;for(var Ie=0;Iewe&&(we=ie,ye=O(W[Ie]));return O.isReadable(b,ye,{level:Ne,size:He})||!Te?ye:(M.includeFallbackColors=!1,O.mostReadable(b,["#fff","#000"],M))};var N=O.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},P=O.hexNames=w(N);function w(b){var W={};for(var M in b)b.hasOwnProperty(M)&&(W[b[M]]=M);return W}function L(b){return b=parseFloat(b),(isNaN(b)||b<0||b>1)&&(b=1),b}function p(b,W){H(b)&&(b="100%");var M=$(b);return b=_(W,I(0,parseFloat(b))),M&&(b=parseInt(b*W,10)/100),le.abs(b-W)<1e-6?1:b%W/parseFloat(W)}function d(b){return _(1,I(0,b))}function E(b){return parseInt(b,16)}function H(b){return typeof b=="string"&&b.indexOf(".")!=-1&&parseFloat(b)===1}function $(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 be(b){return le.round(parseFloat(b)*255).toString(16)}function xe(b){return E(b)/255}var ue=function(){var b="[-\\+]?\\d+%?",W="[-\\+]?\\d*\\.\\d+%?",M="(?:"+W+")|(?:"+b+")",ye="[\\s|\\(]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")\\s*\\)?",we="[\\s|\\(]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")\\s*\\)?";return{CSS_UNIT:new RegExp(M),rgb:new RegExp("rgb"+ye),rgba:new RegExp("rgba"+we),hsl:new RegExp("hsl"+ye),hsla:new RegExp("hsla"+we),hsv:new RegExp("hsv"+ye),hsva:new RegExp("hsva"+we),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 ve(b){return!!ue.CSS_UNIT.exec(b)}function Z(b){b=b.replace(ne,"").replace(ge,"").toLowerCase();var W=!1;if(N[b])b=N[b],W=!0;else if(b=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var M;return(M=ue.rgb.exec(b))?{r:M[1],g:M[2],b:M[3]}:(M=ue.rgba.exec(b))?{r:M[1],g:M[2],b:M[3],a:M[4]}:(M=ue.hsl.exec(b))?{h:M[1],s:M[2],l:M[3]}:(M=ue.hsla.exec(b))?{h:M[1],s:M[2],l:M[3],a:M[4]}:(M=ue.hsv.exec(b))?{h:M[1],s:M[2],v:M[3]}:(M=ue.hsva.exec(b))?{h:M[1],s:M[2],v:M[3],a:M[4]}:(M=ue.hex8.exec(b))?{r:E(M[1]),g:E(M[2]),b:E(M[3]),a:xe(M[4]),format:W?"name":"hex8"}:(M=ue.hex6.exec(b))?{r:E(M[1]),g:E(M[2]),b:E(M[3]),format:W?"name":"hex"}:(M=ue.hex4.exec(b))?{r:E(M[1]+""+M[1]),g:E(M[2]+""+M[2]),b:E(M[3]+""+M[3]),a:xe(M[4]+""+M[4]),format:W?"name":"hex8"}:(M=ue.hex3.exec(b))?{r:E(M[1]+""+M[1]),g:E(M[2]+""+M[2]),b:E(M[3]+""+M[3]),format:W?"name":"hex"}:!1}function z(b){var W,M;return b=b||{level:"AA",size:"small"},W=(b.level||"AA").toUpperCase(),M=(b.size||"small").toLowerCase(),W!=="AA"&&W!=="AAA"&&(W="AA"),M!=="small"&&M!=="large"&&(M="small"),{level:W,size:M}}ot.exports?ot.exports=O:!(F=function(){return O}.call(Je,x,Je,ot),F!==void 0&&(ot.exports=F))})(Math)},aRTE:function(ot,Je){ot.exports={L:1,M:0,Q:3,H:2}},bT9E:function(ot,Je,x){"use strict";x.d(Je,"a",function(){return le});var F=x("VTBJ");function le(ne,ge){var se=Object(F.a)({},ne);return Array.isArray(ge)&&ge.forEach(function(G){delete se[G]}),se}},c5Ni:function(ot,Je,x){},dQei:function(ot,Je){for(var x={glog:function(le){if(le<1)throw new Error("glog("+le+")");return x.LOG_TABLE[le]},gexp:function(le){for(;le<0;)le+=255;for(;le>=256;)le-=255;return x.EXP_TABLE[le]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},F=0;F<8;F++)x.EXP_TABLE[F]=1<1?$-1:0),Me=1;Me<$;Me++)Ce[Me-1]=arguments[Me];p.apply(void 0,[w].concat(Ce))}},C.onKeyUp=function(w){var L=C.props.onKeyUp;if(C.stop(),C.recordCursorPosition(),L){for(var p=arguments.length,d=new Array(p>1?p-1:0),E=1;E=0)return parseInt(L.slice(L.indexOf("e-")+2),10);var p=0;return L.indexOf(".")>=0&&(p=L.length-L.indexOf(".")-1),p},C.getInputDisplayValue=function(w){var L=w||C.state,p=L.focused,d=L.inputValue,E=L.value,H;p?H=d:H=C.toPrecisionAsStep(E),H==null&&(H="");var $=C.formatWrapper(H);return ke(C.props.decimalSeparator)&&($=$.toString().replace(".",C.props.decimalSeparator)),$},C.recordCursorPosition=function(){try{C.cursorStart=C.input.selectionStart,C.cursorEnd=C.input.selectionEnd,C.currentValue=C.input.value,C.cursorBefore=C.input.value.substring(0,C.cursorStart),C.cursorAfter=C.input.value.substring(C.cursorEnd)}catch(w){}},C.restoreByAfter=function(w){if(w===void 0)return!1;var L=C.input.value,p=L.lastIndexOf(w);if(p===-1)return!1;var d=C.cursorBefore.length;return C.lastKeyCode===A.a.DELETE&&C.cursorBefore.charAt(d-1)===w[0]?(C.fixCaret(d,d),!0):p+w.length===L.length?(C.fixCaret(p,p),!0):!1},C.partRestoreByAfter=function(w){return w===void 0?!1:Array.prototype.some.call(w,function(L,p){var d=w.substring(p);return C.restoreByAfter(d)})},C.isNotCompleteNumber=function(w){return isNaN(w)||w===""||w===null||w&&w.toString().indexOf(".")===w.toString().length-1},C.stop=function(){C.autoStepTimer&&clearTimeout(C.autoStepTimer)},C.down=function(w,L,p){C.pressingUpOrDown=!0,C.step("down",w,L,p)},C.up=function(w,L,p){C.pressingUpOrDown=!0,C.step("up",w,L,p)},C.saveInput=function(w){C.input=w};var N=re.value;N===void 0&&(N=re.defaultValue),C.state={focused:re.autoFocus};var P=C.getValidValue(C.toNumber(N));return C.state=Q(Q({},C.state),{},{inputValue:C.toPrecisionAsStep(P),value:P}),C}return Object(ge.a)(oe,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(C){var N=this.props,P=N.value,w=N.onChange,L=N.max,p=N.min,d=this.state.focused;if(C){if(!Ue(C.value,P)||!Ue(C.max,L)||!Ue(C.min,p)){var E=d?P:this.getValidValue(P),H;this.pressingUpOrDown?H=E:this.inputting?H=this.rawInput:H=this.toPrecisionAsStep(E),this.setState({value:E,inputValue:H})}var $="value"in this.props?P:this.state.value;"max"in this.props&&C.max!==L&&typeof $=="number"&&$>L&&w&&w(L),"min"in this.props&&C.min!==p&&typeof $=="number"&&$1&&arguments[1]!==void 0?arguments[1]:this.props.min,P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,w=parseFloat(C);return isNaN(w)?C:(wP&&(w=P),w)}},{key:"setValue",value:function(C,N){var P=this.props.precision,w=this.isNotCompleteNumber(parseFloat(C))?null:parseFloat(C),L=this.state.value,p=L===void 0?null:L,d=this.state.inputValue,E=d===void 0?null:d,H=typeof w=="number"?w.toFixed(P):"".concat(w),$=w!==p||H!=="".concat(E);return"value"in this.props?(E=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:E},N)):this.setState({value:w,inputValue:this.toPrecisionAsStep(C)},N),$&&this.props.onChange(w),w}},{key:"getMaxPrecision",value:function(C){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,P=this.props,w=P.precision,L=P.step;if(ke(w))return w;var p=this.getPrecision(N),d=this.getPrecision(L),E=this.getPrecision(C);return C?Math.max(E,p+d):p+d}},{key:"getPrecisionFactor",value:function(C){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,P=this.getMaxPrecision(C,N);return Math.pow(10,P)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(C){return this.props.formatter?this.props.formatter(C):C}},{key:"toPrecisionAsStep",value:function(C){if(this.isNotCompleteNumber(C)||C==="")return C;var N=Math.abs(this.getMaxPrecision(C));return isNaN(N)?C.toString():Number(C).toFixed(N)}},{key:"toNumber",value:function(C){var N=this.props.precision,P=this.state.focused,w=C&&C.length>16&&P;return this.isNotCompleteNumber(C)||w?C:ke(N)?Math.round(C*Math.pow(10,N))/Math.pow(10,N):Number(C)}},{key:"upStep",value:function(C,N){var P=this.props.step,w=this.getPrecisionFactor(C,N),L=Math.abs(this.getMaxPrecision(C,N)),p=((w*C+w*P*N)/w).toFixed(L);return this.toNumber(p)}},{key:"downStep",value:function(C,N){var P=this.props.step,w=this.getPrecisionFactor(C,N),L=Math.abs(this.getMaxPrecision(C,N)),p=((w*C-w*P*N)/w).toFixed(L);return this.toNumber(p)}},{key:"step",value:function(C,N){var P=this,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,L=arguments.length>3?arguments[3]:void 0;this.stop(),N&&(N.persist(),N.preventDefault());var p=this.props;if(p.disabled)return;var d=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(d))return;var E=this["".concat(C,"Step")](d,w),H=E>p.max||Ep.max?E=p.max:E=Ce),Xe=(pt||pt===0)&&(isNaN(pt)||Number(pt)<=Me),te=Pe||w||L,K=Xe||w||L,q=T()("".concat(P,"-handler"),"".concat(P,"-handler-up"),Object(le.a)({},"".concat(P,"-handler-up-disabled"),te)),y=T()("".concat(P,"-handler"),"".concat(P,"-handler-down"),Object(le.a)({},"".concat(P,"-handler-down-disabled"),K)),S=p?{onTouchStart:te?Y:this.up,onTouchEnd:this.stop}:{onMouseDown:te?Y:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},D=p?{onTouchStart:K?Y:this.down,onTouchEnd:this.stop}:{onMouseDown:K?Y:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return k.a.createElement("div",{className:it,style:be,title:xe,onMouseEnter:ue,onMouseLeave:ve,onMouseOver:Z,onMouseOut:z,onFocus:function(){return null},onBlur:function(){return null}},k.a.createElement("div",{className:"".concat(P,"-handler-wrap")},k.a.createElement("span",Object.assign({unselectable:"on"},S,{role:"button","aria-label":"Increase Value","aria-disabled":te,className:q}),E||k.a.createElement("span",{unselectable:"on",className:"".concat(P,"-handler-up-inner"),onClick:he})),k.a.createElement("span",Object.assign({unselectable:"on"},D,{role:"button","aria-label":"Decrease Value","aria-disabled":K,className:y}),H||k.a.createElement("span",{unselectable:"on",className:"".concat(P,"-handler-down-inner"),onClick:he}))),k.a.createElement("div",{className:"".concat(P,"-input-wrap")},k.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Me,"aria-valuemax":Ce,"aria-valuenow":pt,required:b,type:ye,placeholder:we,onPaste:Ze,onClick:W,onMouseUp:this.onMouseUp,className:"".concat(P,"-input"),tabIndex:M,autoComplete:d,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:vt?this.onKeyDown:Y,onKeyUp:vt?this.onKeyUp:Y,autoFocus:Re,maxLength:Ie,readOnly:L,disabled:w,max:Ce,min:Me,step:He,name:Be,title:xe,id:ie,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(st),pattern:Ne,inputMode:Te,onInput:at},Oe))))}}]),oe}(k.a.Component);Ee.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:_e,min:-_e,step:1,style:{},onChange:Y,onKeyDown:Y,onPressEnter:Y,onFocus:Y,onBlur:Y,parser:me,required:!1,autoComplete:"off"};var Le=Ee,Se=Je.a=Le},f4xo:function(ot,Je,x){var F=x("nVVt");function le(ne){this.mode=F.MODE_8BIT_BYTE,this.data=ne}le.prototype={getLength:function(ne){return this.data.length},write:function(ne){for(var ge=0;geP.length)&&(w=P.length);for(var L=0,p=new Array(w);L=0)continue;if(!Object.prototype.propertyIsEnumerable.call(P,p))continue;L[p]=P[p]}}return L}function U(P,w){if(P==null)return{};var L={},p=Object.keys(P),d,E;for(E=0;E=0)continue;L[d]=P[d]}return L}var J=function(w){var L=w.className,p=w.percent,d=w.prefixCls,E=w.strokeColor,H=w.strokeLinecap,$=w.strokeWidth,Ce=w.style,Me=w.trailColor,be=w.trailWidth,xe=w.transition,ue=Q(w,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete ue.gapPosition;var ve=Array.isArray(p)?p:[p],Z=Array.isArray(E)?E:[E],z=G(ve),b=I(z,1),W=b[0],M=$/2,ye=100-$/2,we="M ".concat(H==="round"?M:0,",").concat(M,` L `).concat(H==="round"?ye:100,",").concat(M),ie="0 0 100 ".concat($),Te=0;return le.a.createElement("svg",_({className:ge()("".concat(d,"-line"),L),viewBox:ie,preserveAspectRatio:"none",style:Ce},ue),le.a.createElement("path",{className:"".concat(d,"-line-trail"),d:we,strokeLinecap:H,stroke:Me,strokeWidth:be||$,fillOpacity:"0"}),ve.map(function(Ne,He){var Ie={strokeDasharray:"".concat(Ne,"px, 100px"),strokeDashoffset:"-".concat(Te,"px"),transition:xe||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Re=Z[He]||Z[Z.length-1];return Te+=Ne,le.a.createElement("path",{key:He,className:"".concat(d,"-line-path"),d:we,strokeLinecap:H,stroke:Re,strokeWidth:$,fillOpacity:"0",ref:W[He],style:Ie})}))};J.defaultProps=se;var Y=J;function he(){return he=Object.assign||function(P){for(var w=1;wP.length)&&(w=P.length);for(var L=0,p=new Array(w);L=0)continue;if(!Object.prototype.propertyIsEnumerable.call(P,p))continue;L[p]=P[p]}}return L}function Le(P,w){if(P==null)return{};var L={},p=Object.keys(P),d,E;for(E=0;E=0)continue;L[d]=P[d]}return L}var Se=0;function ce(P){return+P.replace("%","")}function R(P){return Array.isArray(P)?P:[P]}function oe(P,w,L,p){var d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,E=arguments.length>5?arguments[5]:void 0,H=50-p/2,$=0,Ce=-H,Me=0,be=-2*H;switch(E){case"left":$=-H,Ce=0,Me=2*H,be=0;break;case"right":$=H,Ce=0,Me=-2*H,be=0;break;case"bottom":Ce=H,be=2*H;break;default:}var xe="M 50,50 m ".concat($,",").concat(Ce,` a `).concat(H,",").concat(H," 0 1 1 ").concat(Me,",").concat(-be,` a `).concat(H,",").concat(H," 0 1 1 ").concat(-Me,",").concat(be),ue=Math.PI*2*H,ve={stroke:L,strokeDasharray:"".concat(w/100*(ue-d),"px ").concat(ue,"px"),strokeDashoffset:"-".concat(d/2+P/100*(ue-d),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:xe,pathStyle:ve}}var re=function(w){var L=w.prefixCls,p=w.strokeWidth,d=w.trailWidth,E=w.gapDegree,H=w.gapPosition,$=w.trailColor,Ce=w.strokeLinecap,Me=w.style,be=w.className,xe=w.strokeColor,ue=w.percent,ve=Ee(w,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),Z=Object(F.useMemo)(function(){return Se+=1,Se},[]),z=oe(0,100,$,p,E,H),b=z.pathString,W=z.pathStyle,M=R(ue),ye=R(xe),we=ye.find(function(Ie){return Object.prototype.toString.call(Ie)==="[object Object]"}),ie=G(M),Te=me(ie,1),Ne=Te[0],He=function(){var Re=0;return M.map(function(Be,Ze){var at=ye[Ze]||ye[ye.length-1],et=Object.prototype.toString.call(at)==="[object Object]"?"url(#".concat(L,"-gradient-").concat(Z,")"):"",nt=oe(Re,Be,at,p,E,H);return Re+=Be,le.a.createElement("path",{key:Ze,className:"".concat(L,"-circle-path"),d:nt.pathString,stroke:et,strokeLinecap:Ce,strokeWidth:p,opacity:Be===0?0:1,fillOpacity:"0",style:nt.pathStyle,ref:Ne[Ze]})})};return le.a.createElement("svg",he({className:ge()("".concat(L,"-circle"),be),viewBox:"0 0 100 100",style:Me},ve),we&&le.a.createElement("defs",null,le.a.createElement("linearGradient",{id:"".concat(L,"-gradient-").concat(Z),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(we).sort(function(Ie,Re){return ce(Ie)-ce(Re)}).map(function(Ie,Re){return le.a.createElement("stop",{key:Re,offset:Ie,stopColor:we[Ie]})}))),le.a.createElement("path",{className:"".concat(L,"-circle-trail"),d:b,stroke:$,strokeLinecap:Ce,strokeWidth:d||p,fillOpacity:"0",style:W}),He().reverse())};re.defaultProps=se;var C=re,N={Line:Y,Circle:C}},iIVh:function(ot,Je,x){},kSUc:function(ot,Je,x){},lZu9:function(ot,Je,x){(function(F){F(x("VrN/"),x("1eCo"),x("8EBN"))})(function(F){"use strict";F.defineMode("markdown",function(le,ne){var ge=F.getMode(le,"text/html"),se=ge.name=="null";function G(p){if(F.findModeByName){var d=F.findModeByName(p);d&&(p=d.mime||d.mimes[0])}var E=F.getMode(le,p);return E.name=="null"?null:E}ne.highlightFormatting===void 0&&(ne.highlightFormatting=!1),ne.maxBlockquoteDepth===void 0&&(ne.maxBlockquoteDepth=0),ne.taskLists===void 0&&(ne.taskLists=!1),ne.strikethrough===void 0&&(ne.strikethrough=!1),ne.emoji===void 0&&(ne.emoji=!1),ne.fencedCodeBlockHighlighting===void 0&&(ne.fencedCodeBlockHighlighting=!0),ne.fencedCodeBlockDefaultMode===void 0&&(ne.fencedCodeBlockDefaultMode="text/plain"),ne.xml===void 0&&(ne.xml=!0),ne.tokenTypeOverrides===void 0&&(ne.tokenTypeOverrides={});var _={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 I in _)_.hasOwnProperty(I)&&ne.tokenTypeOverrides[I]&&(_[I]=ne.tokenTypeOverrides[I]);var k=/^([*\-_])(?:\s*\1){2,}\s*$/,O=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,T=/^\[(x| )\](?=\s)/i,A=ne.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,ee=/^ {0,3}(?:\={1,}|-{2,})\s*$/,Q=/^[^#!\[\]*_\\<>` "'(~:]+/,U=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,J=/^\s*\[[^\]]+?\]:.*$/,Y=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,he=" ";function me(p,d,E){return d.f=d.inline=E,E(p,d)}function ze(p,d,E){return d.f=d.block=E,E(p,d)}function Ye(p){return!p||!/\S/.test(p.string)}function _e(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==Ue){var d=se;if(!d){var E=F.innerMode(ge,p.htmlState);d=E.mode.name=="xml"&&E.state.tagStart===null&&!E.state.context&&E.state.tokenize.isInText}d&&(p.f=ce,p.block=ke,p.htmlState=null)}return p.trailingSpace=0,p.trailingSpaceNewLine=!1,p.prevLine=p.thisLine,p.thisLine={stream:null},null}function ke(p,d){var E=p.column()===d.indentation,H=Ye(d.prevLine.stream),$=d.indentedCode,Ce=d.prevLine.hr,Me=d.list!==!1,be=(d.listStack[d.listStack.length-1]||0)+3;d.indentedCode=!1;var xe=d.indentation;if(d.indentationDiff===null&&(d.indentationDiff=d.indentation,Me)){for(d.list=null;xe=4&&($||d.prevLine.fencedCodeEnd||d.prevLine.header||H))return p.skipToEnd(),d.indentedCode=!0,_.code;if(p.eatSpace())return null;if(E&&d.indentation<=be&&(Z=p.match(A))&&Z[1].length<=6)return d.quote=0,d.header=Z[1].length,d.thisLine.header=!0,ne.highlightFormatting&&(d.formatting="header"),d.f=d.inline,Le(d);if(d.indentation<=be&&p.eat(">"))return d.quote=E?1:d.quote+1,ne.highlightFormatting&&(d.formatting="quote"),p.eatSpace(),Le(d);if(!ve&&!d.setext&&E&&d.indentation<=be&&(Z=p.match(O))){var z=Z[1]?"ol":"ul";return d.indentation=xe+p.current().length,d.list=!0,d.quote=0,d.listStack.push(d.indentation),d.em=!1,d.strong=!1,d.code=!1,d.strikethrough=!1,ne.taskLists&&p.match(T,!1)&&(d.taskList=!0),d.f=d.inline,ne.highlightFormatting&&(d.formatting=["list","list-"+z]),Le(d)}else{if(E&&d.indentation<=be&&(Z=p.match(U,!0)))return d.quote=0,d.fencedEndRE=new RegExp(Z[1]+"+ *$"),d.localMode=ne.fencedCodeBlockHighlighting&&G(Z[2]||ne.fencedCodeBlockDefaultMode),d.localMode&&(d.localState=F.startState(d.localMode)),d.f=d.block=Ee,ne.highlightFormatting&&(d.formatting="code-block"),d.code=-1,Le(d);if(d.setext||(!ue||!Me)&&!d.quote&&d.list===!1&&!d.code&&!ve&&!J.test(p.string)&&(Z=p.lookAhead(1))&&(Z=Z.match(ee)))return d.setext?(d.header=d.setext,d.setext=0,p.skipToEnd(),ne.highlightFormatting&&(d.formatting="header")):(d.header=Z[0].charAt(0)=="="?1:2,d.setext=d.header),d.thisLine.header=!0,d.f=d.inline,Le(d);if(ve)return p.skipToEnd(),d.hr=!0,d.thisLine.hr=!0,_.hr;if(p.peek()==="[")return me(p,d,N)}return me(p,d,d.inline)}function Ue(p,d){var E=ge.token(p,d.htmlState);if(!se){var H=F.innerMode(ge,d.htmlState);(H.mode.name=="xml"&&H.state.tagStart===null&&!H.state.context&&H.state.tokenize.isInText||d.md_inside&&p.current().indexOf(">")>-1)&&(d.f=ce,d.block=ke,d.htmlState=null)}return E}function Ee(p,d){var E=d.listStack[d.listStack.length-1]||0,H=d.indentation=p.quote?d.push(_.formatting+"-"+p.formatting[E]+"-"+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(_.linkHref,"url"):(p.strong&&d.push(_.strong),p.em&&d.push(_.em),p.strikethrough&&d.push(_.strikethrough),p.emoji&&d.push(_.emoji),p.linkText&&d.push(_.linkText),p.code&&d.push(_.code),p.image&&d.push(_.image),p.imageAltText&&d.push(_.imageAltText,"link"),p.imageMarker&&d.push(_.imageMarker)),p.header&&d.push(_.header,_.header+"-"+p.header),p.quote&&(d.push(_.quote),!ne.maxBlockquoteDepth||ne.maxBlockquoteDepth>=p.quote?d.push(_.quote+"-"+p.quote):d.push(_.quote+"-"+ne.maxBlockquoteDepth)),p.list!==!1){var H=(p.listStack.length-1)%3;H?H===1?d.push(_.list2):d.push(_.list3):d.push(_.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 Se(p,d){return p.match(Q,!0)?Le(d):void 0}function ce(p,d){var E=d.text(p,d);if(typeof E!="undefined")return E;if(d.list)return d.list=null,Le(d);if(d.taskList){var H=p.match(T,!0)[1]===" ";return H?d.taskOpen=!0:d.taskClosed=!0,ne.highlightFormatting&&(d.formatting="task"),d.taskList=!1,Le(d)}if(d.taskOpen=!1,d.taskClosed=!1,d.header&&p.match(/^#+$/,!0))return ne.highlightFormatting&&(d.formatting="header"),Le(d);var $=p.next();if(d.linkTitle){d.linkTitle=!1;var Ce=$;$==="("&&(Ce=")"),Ce=(Ce+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Me="^\\s*(?:[^"+Ce+"\\\\]+|\\\\\\\\|\\\\.)"+Ce;if(p.match(new RegExp(Me),!0))return _.linkHref}if($==="`"){var be=d.formatting;ne.highlightFormatting&&(d.formatting="code"),p.eatWhile("`");var xe=p.current().length;if(d.code==0&&(!d.quote||xe==1))return d.code=xe,Le(d);if(xe==d.code){var ue=Le(d);return d.code=0,ue}else return d.formatting=be,Le(d)}else if(d.code)return Le(d);if($==="\\"&&(p.next(),ne.highlightFormatting)){var ve=Le(d),Z=_.formatting+"-escape";return ve?ve+" "+Z:Z}if($==="!"&&p.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return d.imageMarker=!0,d.image=!0,ne.highlightFormatting&&(d.formatting="image"),Le(d);if($==="["&&d.imageMarker&&p.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return d.imageMarker=!1,d.imageAltText=!0,ne.highlightFormatting&&(d.formatting="image"),Le(d);if($==="]"&&d.imageAltText){ne.highlightFormatting&&(d.formatting="image");var ve=Le(d);return d.imageAltText=!1,d.image=!1,d.inline=d.f=oe,ve}if($==="["&&!d.image)return d.linkText&&p.match(/^.*?\]/)||(d.linkText=!0,ne.highlightFormatting&&(d.formatting="link")),Le(d);if($==="]"&&d.linkText){ne.highlightFormatting&&(d.formatting="link");var ve=Le(d);return d.linkText=!1,d.inline=d.f=p.match(/\(.*?\)| ?\[.*?\]/,!1)?oe:ce,ve}if($==="<"&&p.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=R,ne.highlightFormatting&&(d.formatting="link");var ve=Le(d);return ve?ve+=" ":ve="",ve+_.linkInline}if($==="<"&&p.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=R,ne.highlightFormatting&&(d.formatting="link");var ve=Le(d);return ve?ve+=" ":ve="",ve+_.linkEmail}if(ne.xml&&$==="<"&&p.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var z=p.string.indexOf(">",p.pos);if(z!=-1){var b=p.string.substring(p.start,z);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(d.md_inside=!0)}return p.backUp(1),d.htmlState=F.startState(ge),ze(p,d,Ue)}if(ne.xml&&$==="<"&&p.match(/^\/\w*?>/))return d.md_inside=!1,"tag";if($==="*"||$==="_"){for(var W=1,M=p.pos==1?" ":p.string.charAt(p.pos-2);W<3&&p.eat($);)W++;var ye=p.peek()||" ",we=!/\s/.test(ye)&&(!Y.test(ye)||/\s/.test(M)||Y.test(M)),ie=!/\s/.test(M)&&(!Y.test(M)||/\s/.test(ye)||Y.test(ye)),Te=null,Ne=null;if(W%2&&(!d.em&&we&&($==="*"||!ie||Y.test(M))?Te=!0:d.em==$&&ie&&($==="*"||!we||Y.test(ye))&&(Te=!1)),W>1&&(!d.strong&&we&&($==="*"||!ie||Y.test(M))?Ne=!0:d.strong==$&&ie&&($==="*"||!we||Y.test(ye))&&(Ne=!1)),Ne!=null||Te!=null){ne.highlightFormatting&&(d.formatting=Te==null?"strong":Ne==null?"em":"strong em"),Te===!0&&(d.em=$),Ne===!0&&(d.strong=$);var ue=Le(d);return Te===!1&&(d.em=!1),Ne===!1&&(d.strong=!1),ue}}else if($===" "&&(p.eat("*")||p.eat("_"))){if(p.peek()===" ")return Le(d);p.backUp(1)}if(ne.strikethrough){if($==="~"&&p.eatWhile($)){if(d.strikethrough){ne.highlightFormatting&&(d.formatting="strikethrough");var ue=Le(d);return d.strikethrough=!1,ue}else if(p.match(/^[^\s]/,!1))return d.strikethrough=!0,ne.highlightFormatting&&(d.formatting="strikethrough"),Le(d)}else if($===" "&&p.match(/^~~/,!0)){if(p.peek()===" ")return Le(d);p.backUp(2)}}if(ne.emoji&&$===":"&&p.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){d.emoji=!0,ne.highlightFormatting&&(d.formatting="emoji");var He=Le(d);return d.emoji=!1,He}return $===" "&&(p.match(/^ +$/,!1)?d.trailingSpace++:d.trailingSpace&&(d.trailingSpaceNewLine=!0)),Le(d)}function R(p,d){var E=p.next();if(E===">"){d.f=d.inline=ce,ne.highlightFormatting&&(d.formatting="link");var H=Le(d);return H?H+=" ":H="",H+_.linkInline}return p.match(/^[^>]+/,!0),_.linkInline}function oe(p,d){if(p.eatSpace())return null;var E=p.next();return E==="("||E==="["?(d.f=d.inline=C(E==="("?")":"]"),ne.highlightFormatting&&(d.formatting="link-string"),d.linkHref=!0,Le(d)):"error"}var re={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function C(p){return function(d,E){var H=d.next();if(H===p){E.f=E.inline=ce,ne.highlightFormatting&&(E.formatting="link-string");var $=Le(E);return E.linkHref=!1,$}return d.match(re[p]),E.linkHref=!0,Le(E)}}function N(p,d){return p.match(/^([^\]\\]|\\.)*\]:/,!1)?(d.f=P,p.next(),ne.highlightFormatting&&(d.formatting="link"),d.linkText=!0,Le(d)):me(p,d,ce)}function P(p,d){if(p.match(/^\]:/,!0)){d.f=d.inline=w,ne.highlightFormatting&&(d.formatting="link");var E=Le(d);return d.linkText=!1,E}return p.match(/^([^\]\\]|\\.)+/,!0),_.linkText}function w(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=ce,_.linkHref+" url")}var L={startState:function(){return{f:ke,prevLine:{stream:null},thisLine:{stream:null},block:ke,htmlState:null,indentation:0,inline:ce,text:Se,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&&F.copyState(ge,p.htmlState),indentation:p.indentation,localMode:p.localMode,localState:p.localMode?F.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 _e(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!=Ue)){var E=p.match(/^\s*/,!0)[0].replace(/\t/g,he).length;if(d.indentation=E,d.indentationDiff=null,E>0)return null}}return d.f(p,d)},innerMode:function(p){return p.block==Ue?{state:p.htmlState,mode:ge}:p.localState?{state:p.localState,mode:p.localMode}:{state:p,mode:L}},indent:function(p,d,E){return p.block==Ue&&ge.indent?ge.indent(p.htmlState,d,E):p.localState&&p.localMode.indent?p.localMode.indent(p.localState,d,E):F.Pass},blankLine:_e,getType:Le,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return L},"xml"),F.defineMIME("text/markdown","markdown"),F.defineMIME("text/x-markdown","markdown")})},nVVt:function(ot,Je){ot.exports={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3}},nojB:function(ot,Je,x){"use strict";x.r(Je);var F=x("T2oS"),le=x("W9HT"),ne=x("9og8"),ge=x("tJVT"),se=x("k1fw"),G=x("WmNS"),_=x.n(G),I=x("q1tI"),k=x.n(I),O=x("X0ci"),T=x("iIVh"),A=x("Ty5D"),ee=x("55Ip"),Q=x("+L6B"),U=x("2/Rp"),J=x("5NDa"),Y=x("5rEg"),he=x("2qtc"),me=x("kLXV"),ze=x("miYZ"),Ye=x("tsqr"),_e=x("PpiC"),ke=x("y8nQ"),Ue=x("Vl3Y"),Ee=x("DZo9"),Le=x("8z0m"),Se=x("sRBo"),ce=x("kaz8"),R=x("LtfV"),oe=x("m3rI"),re=x("Ot1p"),C=ce.a.Group,N=Le.a.Dragger;function P($,Ce){var Me=new FileReader;Me.addEventListener("load",function(){return Ce(Me.result)}),Me.readAsDataURL($)}var w=function($){var Ce=$.callback,Me=$.tags,be=Me===void 0?[]:Me,xe=$.initialValues,ue=xe===void 0?{}:xe,ve=$.removeAttachment,Z=Object(I.useState)(""),z=Object(ge.a)(Z,2),b=z[0],W=z[1],M=Ue.a.useForm(),ye=Object(ge.a)(M,1),we=ye[0];function ie(Re){var Be=Re.cover_id,Ze=Re.attachment_ids,at=Object(_e.a)(Re,["cover_id","attachment_ids"]);Ce(Object(se.a)(Object(se.a)({},at),{},{cover_id:Be==null?void 0:Be.map(function(et){return et.response?et.response.id:et.uid})[(Be==null?void 0:Be.length)-1],attachment_ids:Ze?Ze==null?void 0:Ze.map(function(et){return et.response?et.response.id:et.uid}):[]}))}function Te(Re){return Array.isArray(Re)?Re:Re&&Re.fileList}var Ne={multiple:!0,beforeUpload:function(Be){var Ze=Be.size/1024/1024<100;if(!Ze)return Ye.b.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(100MB),\u5EFA\u8BAE\u4E0A\u4F20\u5230\u767E\u5EA6\u4E91\u7B49\u5176\u5B83\u5171\u4EAB\u5DE5\u5177\u91CC\uFF0C\u7136\u540E\u518Dtxt\u6587\u6863\u91CC\u7ED9\u51FA\u94FE\u63A5\u4EE5\u53CA\u5171\u4EAB\u5BC6\u7801\u5E76\u4E0A\u4F20"),Ze},action:"".concat(oe.a.API_SERVER,"/api/attachments.json"),onRemove:function(Be){me.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664?",onOk:function(){return ve(Be.response?Be.response.id:Be.uid)},onCancel:function(){return!1}})}};function He(Re){Re.file.status==="done"&&P(Re.file.originFileObj,function(Be){return W(Be)})}var Ie={showUploadList:!1,withCredentials:!0,action:"".concat(oe.a.API_SERVER,"/api/attachments.json"),onChange:He};return Object(I.useEffect)(function(){ue.title&&(we.setFieldsValue(ue),ue.cover_id.length>0&&W(oe.a.IMG_SERVER+ue.cover_id[0].url))},[ue]),k.a.createElement(Ue.a,{form:we,initialValues:ue,className:"moop-panel",onFinish:ie},k.a.createElement(Ue.a.Item,{label:"\u6807\u9898",name:"title",extra:k.a.createElement("p",{className:"tip"},"\u7B80\u660E\u627C\u8981\u4ECB\u7ECD\u6587\u6863/\u89C6\u9891\u6240\u5305\u542B\u7684\u4E3B\u8981\u7684\u5185\u5BB9"),rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u9898"}]},k.a.createElement(Y.a,{placeholder:"\u4F8B\u5982\uFF1A\u8F6F\u4EF6\u5DE5\u7A0B\u6559\u5B66\u6848\u4F8B"})),k.a.createElement("div",{className:"flex-container"},k.a.createElement(Ue.a.Item,{label:"\u4F5C\u8005",name:"author_name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u8005\u540D\u79F0"}]},k.a.createElement(Y.a,{placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D",style:{marginRight:20,width:200}})),k.a.createElement(Ue.a.Item,{name:"author_school_name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u8005\u5355\u4F4D\u540D\u79F0"}]},k.a.createElement(Y.a,{placeholder:"\u8BF7\u8F93\u5165\u4F5C\u8005\u5355\u4F4D\u540D\u79F0",style:{width:200}}))),k.a.createElement(Ue.a.Item,{name:"tag_ids",label:"\u6807\u7B7E",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u4E00\u4E2A\u6807\u7B7E"}]},k.a.createElement(C,null,be.map(function(Re){return k.a.createElement(ce.a,{key:Re.id,value:Re.id}," ",Re.name," ")}))),k.a.createElement(Ue.a.Item,{name:"publish",valuePropName:"checked"},k.a.createElement(ce.a,null,"\u662F\u5426\u7533\u8BF7\u53D1\u5E03")),k.a.createElement(Ue.a.Item,{name:"content",label:"\u63CF\u8FF0",valuePropName:"defaultValue",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u63CF\u8FF0\u5185\u5BB9"}]},k.a.createElement(re.a,{id:"moop_cases_content",height:400})),k.a.createElement(Ue.a.Item,{name:"attachment_ids",valuePropName:"fileList",getValueFromEvent:Te},k.a.createElement(N,Ne,k.a.createElement("p",{className:"c-blue",style:{marginBottom:10,fontSize:18}},"\u4E0A\u4F20\u9644\u4EF6"),k.a.createElement("p",{className:"c-grey-c"},"\u4ECE\u6211\u7684\u7535\u8111\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u6863\uFF1A\u6309\u4F4FCTRL\u53EF\u4EE5\u4E0A\u4F20\u591A\u4EFD\u6587\u6863\u3002\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\uFF1A100MB"))),k.a.createElement(Ue.a.Item,{name:"cover_id",label:"\u5C01\u9762\u56FE",extra:"\u4E0A\u4F20\u5C3A\u5BF8\uFF1A120*90 px",getValueFromEvent:Te,valuePropName:"fileList",rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u5C01\u9762\u56FE"}]},k.a.createElement(Le.a,Ie,b?k.a.createElement("img",{src:b,width:120}):k.a.createElement("a",{title:"\u4E0A\u4F20\u5C01\u9762\u56FE",className:"upload-cover"}," ",k.a.createElement(R.a,null)," "))),k.a.createElement("div",{className:"desc"},k.a.createElement("h3",null,"\u5BA1\u6838\u8BF4\u660E"),k.a.createElement("p",null," \u5E73\u53F0\u7BA1\u7406\u5458\u5C06\u5BF9\u6BCF\u5929\u65B0\u4E0A\u4F20\u7684\u6587\u6863\u8FDB\u884C\u5BA1\u6838\uFF0C\u5BA1\u6838\u901A\u8FC7\u7684\u6587\u6863\u5C06\u516C\u5F00\u663E\u793A\uFF0C\u5426\u5219\u5C06\u79C1\u6709\u5316\u6216\u79FB\u9664 ")),k.a.createElement("div",{className:"desc"},k.a.createElement("h3",null,"\u6E29\u99A8\u63D0\u793A"),k.a.createElement("ul",{style:{padding:0}},k.a.createElement("li",null,"1.\u8BF7\u52FF\u4E0A\u4F20\u5DF2\u8BBE\u7F6E\u52A0\u5BC6\u53E3\u4EE4\u7684\u6587\u6863\u8D44\u6E90\uFF1B"),k.a.createElement("li",null,"2.\u53EF\u4EE5\u4E0A\u4F20\u7B26\u5408\u6559\u5B66\u6848\u4F8B\u6807\u51C6\u7684\u6587\u6863\u8D44\u6599\uFF0C\u5982",k.a.createElement("a",{href:"https://www.educoder.net/courses/1309/boards/5909/messages/34799",target:"_blank"}," \u6848\u4F8B\u5165\u5E93\u6807\u51C6 ")," \u3001",k.a.createElement("a",{href:"https://www.educoder.net/courses/1309/boards/5909/messages/34798",target:"_blank"},"\u6848\u4F8B\u4F7F\u7528\u8BF4\u660E\u4E66"),"\u4EE5\u53CA\u5176\u4ED6\u8D44\u6599\u7B49\uFF0C\u4E0A\u4F20\u652F\u6301\u7684\u6587\u4EF6\u6700\u5927\u5BB9\u91CF\uFF1A100MB\uFF1B"),k.a.createElement("li",null,"3.\u8BF7\u786E\u4FDD\u4E0A\u4F20\u5185\u5BB9\u65E0\u4FB5\u6743\u6216\u8FDD\u53CD\u56FD\u5BB6\u5173\u4E8E\u4E92\u8054\u7F51\u653F\u7B56\u7684\u4E0D\u826F\u884C\u4E3A\uFF1B"),k.a.createElement("li",null,"4.\u8BF7\u4F7F\u7528Chrome\uFF0CFirefox\uFF0CSafari\uFF0CIE11\uFF08\u53CA\u4EE5\u4E0A\u7248\u672C\uFF09\u6D4F\u89C8\u5668\uFF1B"))),k.a.createElement(Ue.a.Item,{style:{marginTop:10}},k.a.createElement(U.a,{type:"primary",htmlType:"submit"},"\u63D0\u4EA4")))},L=x("wzkS"),p={loading:!1,data:{},tags:[]},d;(function($){$[$.GET_DATA=0]="GET_DATA",$[$.SET_LOADING=1]="SET_LOADING",$[$.GET_TAGS=2]="GET_TAGS"})(d||(d={}));function E($,Ce){switch(Ce.type){case d.GET_DATA:return Object(se.a)(Object(se.a)({},$),Ce.payload);case d.GET_TAGS:return Object(se.a)(Object(se.a)({},$),{},{tags:Ce.payload});case d.SET_LOADING:return Object(se.a)(Object(se.a)({},$),{},{loading:Ce.payload});default:throw new Error}}var H=Je.default=function(){var $=Object(A.i)(),Ce=$.caseId,Me=Object(A.g)(),be=Object(I.useReducer)(E,p),xe=Object(ge.a)(be,2),ue=xe[0],ve=xe[1],Z=ue.loading,z=ue.tags,b=ue.data;Object(I.useEffect)(function(){function we(){return ie.apply(this,arguments)}function ie(){return ie=Object(ne.a)(_.a.mark(function Te(){var Ne;return _.a.wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:return Ie.next=2,Object(L.b)();case 2:Ne=Ie.sent,ve({type:d.GET_TAGS,payload:Ne.library_tags});case 4:case"end":return Ie.stop()}},Te)})),ie.apply(this,arguments)}we()},[]),Object(I.useEffect)(function(){var we=!1;function ie(){return Te.apply(this,arguments)}function Te(){return Te=Object(ne.a)(_.a.mark(function Ne(){var He,Ie,Re,Be,Ze,at,et,nt,pt;return _.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:return ve({type:d.SET_LOADING,payload:!1}),it.next=3,Object(L.c)(Ce);case 3:He=it.sent,Ie=He.author_name,Re=He.author_school_name,Be=He.content,Ze=He.cover,at=He.attachments,et=He.status,nt=He.title,pt=He.tags,we||(He.status===404?Me.push("/moop_cases"):ve({type:d.GET_DATA,payload:{data:{title:nt,author_name:Ie,author_school_name:Re,content:Be,tag_ids:pt.map(function(Oe){return Oe.id}),publish:et==="published",attachment_ids:at.map(function(Oe){return{uid:Oe.id,id:Oe.id,name:Oe.title,url:Oe.url,filesize:Oe.filesize,status:"done"}}),cover_id:Ze!=null&&Ze.id?[{uid:Ze==null?void 0:Ze.id,id:Ze==null?void 0:Ze.id,name:Ze==null?void 0:Ze.title,url:Ze==null?void 0:Ze.url,filesize:Ze==null?void 0:Ze.filesize,status:"done"}]:[]},loading:!1}}));case 6:case"end":return it.stop()}},Ne)})),Te.apply(this,arguments)}return!we&&Ce&&ie(),function(){we=!0}},[Ce]);function W(we){return M.apply(this,arguments)}function M(){return M=Object(ne.a)(_.a.mark(function we(ie){var Te,Ne;return _.a.wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:if(!Ce){Ie.next=6;break}return Ie.next=3,Object(L.e)(Ce,ie);case 3:Me.push("/moop_cases/".concat(Ce,"/publish-success")),Ie.next=11;break;case 6:return Ie.next=8,Object(L.a)(ie);case 8:Te=Ie.sent,Ne=Te.id,Ne&&Me.push("/moop_cases/".concat(Ne,"/publish-success"));case 11:case"end":return Ie.stop()}},we)})),M.apply(this,arguments)}var ye={initialValues:b,tags:z,removeAttachment:L.d,callback:W};return k.a.createElement(le.a,{spinning:Z,delay:500},k.a.createElement("div",{className:"moop-info"},k.a.createElement("div",{className:"crumb"},k.a.createElement(ee.a,{to:"/moop_cases"},"\u6559\u5B66\u6848\u4F8B > "),k.a.createElement("span",null,"\u65B0\u5EFA")),k.a.createElement("div",{className:"title"},k.a.createElement("h2",null,"\u4E0A\u4F20\u6559\u5B66\u6848\u4F8B"),k.a.createElement(ee.a,{to:"/moop_cases"},"\u8FD4\u56DE")),k.a.createElement(w,ye)))}},osHv:function(ot,Je,x){(function(F){F(x("VrN/"))})(function(F){"use strict";var le=F.Pos;function ne(Y,he){return Y.line-he.line||Y.ch-he.ch}var ge="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",se=ge+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",G=new RegExp("<(/?)(["+ge+"]["+se+"]*)","g");function _(Y,he,me,ze){this.line=he,this.ch=me,this.cm=Y,this.text=Y.getLine(he),this.min=ze?Math.max(ze.from,Y.firstLine()):Y.firstLine(),this.max=ze?Math.min(ze.to-1,Y.lastLine()):Y.lastLine()}function I(Y,he){var me=Y.cm.getTokenTypeAt(le(Y.line,he));return me&&/\btag\b/.test(me)}function k(Y){return Y.line>=Y.max?void 0:(Y.ch=0,Y.text=Y.cm.getLine(++Y.line),!0)}function O(Y){return Y.line<=Y.min?void 0:(Y.text=Y.cm.getLine(--Y.line),Y.ch=Y.text.length,!0)}function T(Y){for(;;){var he=Y.text.indexOf(">",Y.ch);if(he==-1){if(k(Y))continue;return}if(!I(Y,he+1)){Y.ch=he+1;continue}var me=Y.text.lastIndexOf("/",he),ze=me>-1&&!/\S/.test(Y.text.slice(me+1,he));return Y.ch=he+1,ze?"selfClose":"regular"}}function A(Y){for(;;){var he=Y.ch?Y.text.lastIndexOf("<",Y.ch-1):-1;if(he==-1){if(O(Y))continue;return}if(!I(Y,he+1)){Y.ch=he;continue}G.lastIndex=he,Y.ch=he;var me=G.exec(Y.text);if(me&&me.index==he)return me}}function ee(Y){for(;;){G.lastIndex=Y.ch;var he=G.exec(Y.text);if(!he){if(k(Y))continue;return}if(!I(Y,he.index+1)){Y.ch=he.index+1;continue}return Y.ch=he.index+he[0].length,he}}function Q(Y){for(;;){var he=Y.ch?Y.text.lastIndexOf(">",Y.ch-1):-1;if(he==-1){if(O(Y))continue;return}if(!I(Y,he+1)){Y.ch=he;continue}var me=Y.text.lastIndexOf("/",he),ze=me>-1&&!/\S/.test(Y.text.slice(me+1,he));return Y.ch=he+1,ze?"selfClose":"regular"}}function U(Y,he){for(var me=[];;){var ze=ee(Y),Ye,_e=Y.line,ke=Y.ch-(ze?ze[0].length:0);if(!ze||!(Ye=T(Y)))return;if(Ye=="selfClose")continue;if(ze[1]){for(var Ue=me.length-1;Ue>=0;--Ue)if(me[Ue]==ze[2]){me.length=Ue;break}if(Ue<0&&(!he||he==ze[2]))return{tag:ze[2],from:le(_e,ke),to:le(Y.line,Y.ch)}}else me.push(ze[2])}}function J(Y,he){for(var me=[];;){var ze=Q(Y);if(!ze)return;if(ze=="selfClose"){A(Y);continue}var Ye=Y.line,_e=Y.ch,ke=A(Y);if(!ke)return;if(ke[1])me.push(ke[2]);else{for(var Ue=me.length-1;Ue>=0;--Ue)if(me[Ue]==ke[2]){me.length=Ue;break}if(Ue<0&&(!he||he==ke[2]))return{tag:ke[2],from:le(Y.line,Y.ch),to:le(Ye,_e)}}}}F.registerHelper("fold","xml",function(Y,he){for(var me=new _(Y,he.line,0);;){var ze=ee(me);if(!ze||me.line!=he.line)return;var Ye=T(me);if(!Ye)return;if(!ze[1]&&Ye!="selfClose"){var _e=le(me.line,me.ch),ke=U(me,ze[2]);return ke&&ne(ke.from,_e)>0?{from:_e,to:ke.from}:null}}}),F.findMatchingTag=function(Y,he,me){var ze=new _(Y,he.line,he.ch,me);if(ze.text.indexOf(">")==-1&&ze.text.indexOf("<")==-1)return;var Ye=T(ze),_e=Ye&&le(ze.line,ze.ch),ke=Ye&&A(ze);if(!Ye||!ke||ne(ze,he)>0)return;var Ue={from:le(ze.line,ze.ch),to:_e,tag:ke[2]};return Ye=="selfClose"?{open:Ue,close:null,at:"open"}:ke[1]?{open:J(ze,ke[2]),close:Ue,at:"close"}:(ze=new _(Y,_e.line,_e.ch,me),{open:Ue,close:U(ze,ke[2]),at:"open"})},F.findEnclosingTag=function(Y,he,me,ze){for(var Ye=new _(Y,he.line,he.ch,me);;){var _e=J(Ye,ze);if(!_e)break;var ke=new _(Y,he.line,he.ch,me),Ue=U(ke,_e.tag);if(Ue)return{open:_e,close:Ue}}},F.scanForClosingTag=function(Y,he,me,ze){var Ye=new _(Y,he.line,he.ch,ze?{from:0,to:ze}:null);return U(Ye,me)}})},p5ED:function(ot,Je,x){"use strict";var F=x("+L6B"),le=x("2/Rp"),ne=x("5Dmo"),ge=x("3S7+"),se=x("k1fw"),G=x("9og8"),_=x("tJVT"),I=x("WmNS"),k=x.n(I),O=x("q1tI"),T=x.n(O),A=x("vHTk"),ee=x.n(A),Q=x("yEEn"),U=x("ZW9T"),J=x("1vsH"),Y=x("V0Rq"),he=x("m3rI"),me=function(Ye){var _e=Ye.name,ke=Ye.data,Ue=Ye.theme,Ee=Ye.type,Le=Ye.filename,Se=Ye.monacoEditor,ce=Ye.className,R=Ye.style,oe=Ye.close,re=Ye.onClose,C=Ye.hasMask,N=Ye.otherData,P=N===void 0?{}:N,w=Object(O.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),L=Object(_.a)(w,2),p=L[0],d=L[1],E=Object(O.useState)(""),H=Object(_.a)(E,2),$=H[0],Ce=H[1],Me=Object(O.useState)(),be=Object(_.a)(Me,2),xe=be[0],ue=be[1],ve,Z=1024*1024,z=10*Z,b=Object(O.useRef)();Ee==="office"&&(Ee="other",ve=Object(J.R)(ke).filesize,ve>z&&(Ee="other")),Le&&(Se.filename=Le),Object(O.useEffect)(function(){var we,ie,Te=(we=document.cookie)===null||we===void 0||((ie=we.replace(/\s/g,""))===null||ie===void 0)?void 0:ie.split(";");Te==null||Te.map(function(Ne){var He=Ne.split("=");He[0]==="_educoder_session"&&Ce(He[1])})},[]),Object(O.useEffect)(function(){Ee==="office"&&W()},[Ee]);var W=function(){var we=Object(G.a)(k.a.mark(function ie(){var Te,Ne,He;return k.a.wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:return console.log("data:",ke),Te=ke,ke.startsWith("http")||(Te=location.origin+Te),Ne=new URL(Te).pathname.split("/").pop(),Re.next=6,Object(Y.U)({attachment_id:Ne});case 6:He=Re.sent,ue(He);case 8:case"end":return Re.stop()}},ie)}));return function(){return we.apply(this,arguments)}}(),M=function(){if(ke.startsWith("http")||ke.startsWith("blob:")){ye();return}Object(J.x)(Le||"educoder",ke,Le)},ye=function(){Object(J.v)(Le||"educoder",decodeURIComponent(ke))};return T.a.createElement("div",{style:Object(se.a)({},R||{}),className:"".concat(C&&ee.a.bgBlack," ").concat(Ee?ee.a.wrp:"hide")},oe&&T.a.createElement("div",{className:ee.a.close,ref:b},T.a.createElement(ge.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return b.current}},T.a.createElement("span",{onClick:ye},T.a.createElement("i",{className:"icon-quxiaozhiding"}))),T.a.createElement(ge.a,{title:"\u5173\u95ED",getPopupContainer:function(){return b.current}},T.a.createElement("span",{className:"",onClick:function(){re(),ue(null)}},T.a.createElement("i",{className:"icon-guanbi1"})))),T.a.createElement("div",{className:"".concat(ee.a[ce]," ").concat(ce," ").concat(ee.a.monaco," ").concat(Ee==="txt"?"show":"hide")},Ee==="txt"&&T.a.createElement(U.b,Se)),Ee==="audio"&&T.a.createElement("audio",{src:"".concat((ke==null?void 0:ke.indexOf("http://"))>-1||(ke==null?void 0:ke.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(ke),autoPlay:!0}),Ee==="video"&&T.a.createElement(T.a.Fragment,null,(ke==null?void 0:ke.indexOf("http"))>-1?T.a.createElement("video",{controls:!0,src:"".concat(ke),autoPlay:!0}):T.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(ke),autoPlay:!0})),Ee==="office"&&xe&&T.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(xe.key,"&url=").concat(he.a.API_SERVER+xe.url,"&callbackUrl=").concat(he.a.API_SERVER+xe.callbackUrl,"&fileType=").concat(xe.fileType,"&title=").concat(xe.title,"&model=view")}),(Ee==="xlsx"||Ee==="doc"||Ee==="pptx"||Ee==="docx")&&T.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(P.key,"&url=").concat(he.a.API_SERVER+P.url,"&callbackUrl=").concat(he.a.API_SERVER+P.callbackUrl,"&fileType=").concat(P.fileType,"&title=").concat(P.title,"&model=").concat(P.model)}),Ee==="html"&&T.a.createElement("iframe",{src:ke+"&disposition=inline"}),Ee==="pdf"&&T.a.createElement("embed",{className:ee.a.embed,src:ke,type:"application/pdf"}),Ee==="image"&&T.a.createElement("img",{src:"".concat((ke==null?void 0:ke.indexOf("http://"))>-1||(ke==null?void 0:ke.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(ke)}),Ee==="other"&&T.a.createElement("div",null,T.a.createElement(le.a,{type:"primary",size:"large",onClick:M},T.a.createElement(Q.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),Ee==="download"&&T.a.createElement(le.a,{type:"primary",size:"large",onClick:M},T.a.createElement(Q.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))};Je.a=me},"p77/":function(ot,Je,x){},"rAM+":function(ot,Je,x){"use strict";x.d(Je,"a",function(){return le});var F=x("Qw5x");function le(ne,ge){var se;if(typeof Symbol=="undefined"||ne[Symbol.iterator]==null){if(Array.isArray(ne)||(se=Object(F.a)(ne))||ge&&ne&&typeof ne.length=="number"){se&&(ne=se);var G=0,_=function(){};return{s:_,n:function(){return G>=ne.length?{done:!0}:{done:!1,value:ne[G++]}},e:function(A){throw A},f:_}}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 I=!0,k=!1,O;return{s:function(){se=ne[Symbol.iterator]()},n:function(){var A=se.next();return I=A.done,A},e:function(A){k=!0,O=A},f:function(){try{!I&&se.return!=null&&se.return()}finally{if(k)throw O}}}}},rUJ1:function(ot,Je){const x=/[&<>"']/,F=/[&<>"']/g,le=/[<>"']|&(?!#?\w+;)/,ne=/[<>"']|&(?!#?\w+;)/g,ge={"&":"&","<":"<",">":">",'"':""","'":"'"},se=Ee=>ge[Ee];function G(Ee,Le){if(Le){if(x.test(Ee))return Ee.replace(F,se)}else if(le.test(Ee))return Ee.replace(ne,se);return Ee}const _=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function I(Ee){return Ee.replace(_,(Le,Se)=>(Se=Se.toLowerCase(),Se==="colon"?":":Se.charAt(0)==="#"?Se.charAt(1)==="x"?String.fromCharCode(parseInt(Se.substring(2),16)):String.fromCharCode(+Se.substring(1)):""))}const k=/(^|[^\[])\^/g;function O(Ee,Le){Ee=Ee.source||Ee,Le=Le||"";const Se={replace:(ce,R)=>(R=R.source||R,R=R.replace(k,"$1"),Ee=Ee.replace(ce,R),Se),getRegex:()=>new RegExp(Ee,Le)};return Se}const T=/[^\w:]/g,A=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ee(Ee,Le,Se){if(Ee){let ce;try{ce=decodeURIComponent(I(Se)).replace(T,"").toLowerCase()}catch(R){return null}if(ce.indexOf("javascript:")===0||ce.indexOf("vbscript:")===0||ce.indexOf("data:")===0)return null}Le&&!A.test(Se)&&(Se=he(Le,Se));try{Se=encodeURI(Se).replace(/%25/g,"%")}catch(ce){return null}return Se}const Q={},U=/^[^:]+:\/*[^/]*$/,J=/^([^:]+:)[\s\S]*$/,Y=/^([^:]+:\/*[^/]*)[\s\S]*$/;function he(Ee,Le){Q[" "+Ee]||(U.test(Ee)?Q[" "+Ee]=Ee+"/":Q[" "+Ee]=_e(Ee,"/",!0)),Ee=Q[" "+Ee];const Se=Ee.indexOf(":")===-1;return Le.substring(0,2)==="//"?Se?Le:Ee.replace(J,"$1")+Le:Le.charAt(0)==="/"?Se?Le:Ee.replace(Y,"$1")+Le:Ee+Le}const me={exec:function(){}};function ze(Ee){let Le=1,Se,ce;for(;Le{let N=!1,P=re;for(;--P>=0&&C[P]==="\\";)N=!N;return N?"|":" |"}),ce=Se.split(/ \|/);let R=0;if(ce.length>Le)ce.splice(Le);else for(;ce.length>>7-F%8&1)==1},put:function(F,le){for(var ne=0;ne>>le-ne-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(F){var le=Math.floor(this.length/8);this.buffer.length<=le&&this.buffer.push(0),F&&(this.buffer[le]|=128>>>this.length%8),this.length++}},ot.exports=x},wzkS:function(ot,Je,x){"use strict";x.d(Je,"c",function(){return se}),x.d(Je,"b",function(){return G}),x.d(Je,"d",function(){return _}),x.d(Je,"a",function(){return k}),x.d(Je,"e",function(){return O});var F=x("9og8"),le=x("WmNS"),ne=x.n(le),ge=x("ErOA");function se(T){return Object(ge.c)("libraries/".concat(T,".json"))}function G(){return Object(ge.c)("library_tags.json")}function _(T){return I.apply(this,arguments)}function I(){return I=Object(F.a)(ne.a.mark(function T(A){var ee;return ne.a.wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return U.next=2,Object(ge.b)("attachments/".concat(A,".json"));case 2:return ee=U.sent,U.abrupt("return",ee.status===0);case 4:case"end":return U.stop()}},T)})),I.apply(this,arguments)}function k(T){return Object(ge.f)("libraries.json",T)}function O(T,A){return Object(ge.g)("libraries/".concat(T,".json"),A)}}}]);