(window.webpackJsonp=window.webpackJsonp||[]).push([[187,6,7],{"+NIl":function(xt,it,se){(function(oe){oe(se("VrN/"))})(function(oe){"use strict";oe.defineMode("stex",function(Z,D){"use strict";function $(L,C){L.cmdState.push(C)}function B(L){return L.cmdState.length>0?L.cmdState[L.cmdState.length-1]:null}function M(L){var C=L.cmdState.pop();C&&C.closeBracket()}function z(L){for(var C=L.cmdState,T=C.length-1;T>=0;T--){var h=C[T];if(h.name=="DEFAULT")continue;return h}return{styleIdentifier:function(){return null}}}function W(L,C,T){return function(){this.name=L,this.bracketNo=0,this.style=C,this.styles=T,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var P={};P.importmodule=W("importmodule","tag",["string","builtin"]),P.documentclass=W("documentclass","tag",["","atom"]),P.usepackage=W("usepackage","tag",["atom"]),P.begin=W("begin","tag",["atom"]),P.end=W("end","tag",["atom"]),P.label=W("label","tag",["atom"]),P.ref=W("ref","tag",["atom"]),P.eqref=W("eqref","tag",["atom"]),P.cite=W("cite","tag",["atom"]),P.bibitem=W("bibitem","tag",["atom"]),P.Bibitem=W("Bibitem","tag",["atom"]),P.RBibitem=W("RBibitem","tag",["atom"]),P.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function R(L,C){L.f=C}function y(L,C){var T;if(L.match(/^\\[a-zA-Z@]+/)){var h=L.current().slice(1);return T=P.hasOwnProperty(h)?P[h]:P.DEFAULT,T=new T,$(C,T),R(C,O),T.style}if(L.match(/^\\[$&%#{}_]/))return"tag";if(L.match(/^\\[,;!\/\\]/))return"tag";if(L.match("\\["))return R(C,function(l,d){return A(l,d,"\\]")}),"keyword";if(L.match("\\("))return R(C,function(l,d){return A(l,d,"\\)")}),"keyword";if(L.match("$$"))return R(C,function(l,d){return A(l,d,"$$")}),"keyword";if(L.match("$"))return R(C,function(l,d){return A(l,d,"$")}),"keyword";var o=L.next();if(o=="%")return L.skipToEnd(),"comment";if(o=="}"||o=="]"){if(T=B(C),T)T.closeBracket(o),R(C,O);else return"error";return"bracket"}else return o=="{"||o=="["?(T=P.DEFAULT,T=new T,$(C,T),"bracket"):/\d/.test(o)?(L.eatWhile(/[\w.%]/),"atom"):(L.eatWhile(/[\w\-_]/),T=z(C),T.name=="begin"&&(T.argument=L.current()),T.styleIdentifier())}function A(L,C,T){if(L.eatSpace())return null;if(T&&L.match(T))return R(C,y),"keyword";if(L.match(/^\\[a-zA-Z@]+/))return"tag";if(L.match(/^[a-zA-Z]+/))return"variable-2";if(L.match(/^\\[$&%#{}_]/))return"tag";if(L.match(/^\\[,;!\/]/))return"tag";if(L.match(/^[\^_&]/))return"tag";if(L.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(L.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var h=L.next();return h=="{"||h=="}"||h=="["||h=="]"||h=="("||h==")"?"bracket":h=="%"?(L.skipToEnd(),"comment"):"error"}function O(L,C){var T=L.peek(),h;return T=="{"||T=="["?(h=B(C),h.openBracket(T),L.eat(T),R(C,y),"bracket"):/[ \t\r]/.test(T)?(L.eat(T),null):(R(C,y),M(C),y(L,C))}return{startState:function(){var L=D.inMathMode?function(C,T){return A(C,T)}:y;return{cmdState:[],f:L}},copyState:function(L){return{cmdState:L.cmdState.slice(),f:L.f}},token:function(L,C){return C.f(L,C)},blankLine:function(L){L.f=y,L.cmdState.length=0},lineComment:"%"}}),oe.defineMIME("text/x-stex","stex"),oe.defineMIME("text/x-latex","stex")})},"19Vz":function(xt,it,se){(function(oe){oe(se("VrN/"))})(function(oe){oe.defineOption("placeholder","",function(W,P,R){var y=R&&R!=oe.Init;if(P&&!y)W.on("blur",B),W.on("change",M),W.on("swapDoc",M),oe.on(W.getInputField(),"compositionupdate",W.state.placeholderCompose=function(){$(W)}),M(W);else if(!P&&y){W.off("blur",B),W.off("change",M),W.off("swapDoc",M),oe.off(W.getInputField(),"compositionupdate",W.state.placeholderCompose),Z(W);var A=W.getWrapperElement();A.className=A.className.replace(" CodeMirror-empty","")}P&&!W.hasFocus()&&B(W)});function Z(W){W.state.placeholder&&(W.state.placeholder.parentNode.removeChild(W.state.placeholder),W.state.placeholder=null)}function D(W){Z(W);var P=W.state.placeholder=document.createElement("pre");P.style.cssText="height: 0; overflow: visible",P.style.direction=W.getOption("direction"),P.className="CodeMirror-placeholder CodeMirror-line-like";var R=W.getOption("placeholder");typeof R=="string"&&(R=document.createTextNode(R)),P.appendChild(R),W.display.lineSpace.insertBefore(P,W.display.lineSpace.firstChild)}function $(W){setTimeout(function(){var P=!1,R=W.getInputField();R.nodeName=="TEXTAREA"?P=!R.value:W.lineCount()==1&&(P=!/[^\u200b]/.test(R.querySelector(".CodeMirror-line").textContent)),P?D(W):Z(W)},20)}function B(W){z(W)&&D(W)}function M(W){var P=W.getWrapperElement(),R=z(W);P.className=P.className.replace(" CodeMirror-empty","")+(R?" CodeMirror-empty":""),R?D(W):Z(W)}function z(W){return W.lineCount()===1&&W.getLine(0)===""}})},"1eCo":function(xt,it,se){(function(oe){oe(se("VrN/"))})(function(oe){"use strict";var Z={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},D={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};oe.defineMode("xml",function($,B){var M=$.indentUnit,z={},W=B.htmlMode?Z:D;for(var P in W)z[P]=W[P];for(var P in B)z[P]=B[P];var R,y;function A(a,b){function m(U){return b.tokenize=U,U(a,b)}var x=a.next();if(x=="<")return a.eat("!")?a.eat("[")?a.match("CDATA[")?m(C("atom","]]>")):null:a.match("--")?m(C("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),m(T(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),b.tokenize=C("meta","?>"),"meta"):(R=a.eat("/")?"closeTag":"openTag",b.tokenize=O,"tag bracket");if(x=="&"){var F;return a.eat("#")?a.eat("x")?F=a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):F=a.eatWhile(/[\d]/)&&a.eat(";"):F=a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),F?"atom":"error"}else return a.eatWhile(/[^&<]/),null}A.isInText=!0;function O(a,b){var m=a.next();if(m==">"||m=="/"&&a.eat(">"))return b.tokenize=A,R=m==">"?"endTag":"selfcloseTag","tag bracket";if(m=="=")return R="equals",null;if(m=="<"){b.tokenize=A,b.state=d,b.tagName=b.tagStart=null;var x=b.tokenize(a,b);return x?x+" tag error":"tag error"}else return/[\'\"]/.test(m)?(b.tokenize=L(m),b.stringStartCol=a.column(),b.tokenize(a,b)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function L(a){var b=function(m,x){for(;!m.eol();)if(m.next()==a){x.tokenize=O;break}return"string"};return b.isInAttribute=!0,b}function C(a,b){return function(m,x){for(;!m.eol();){if(m.match(b)){x.tokenize=A;break}m.next()}return a}}function T(a){return function(b,m){for(var x;(x=b.next())!=null;){if(x=="<")return m.tokenize=T(a+1),m.tokenize(b,m);if(x==">")if(a==1){m.tokenize=A;break}else return m.tokenize=T(a-1),m.tokenize(b,m)}return"meta"}}function h(a,b,m){this.prev=a.context,this.tagName=b,this.indent=a.indented,this.startOfLine=m,(z.doNotIndent.hasOwnProperty(b)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function o(a){a.context&&(a.context=a.context.prev)}function l(a,b){for(var m;;){if(!a.context)return;if(m=a.context.tagName,!z.contextGrabbers.hasOwnProperty(m)||!z.contextGrabbers[m].hasOwnProperty(b))return;o(a)}}function d(a,b,m){return a=="openTag"?(m.tagStart=b.column(),w):a=="closeTag"?v:d}function w(a,b,m){return a=="word"?(m.tagName=b.current(),y="tag",E):z.allowMissingTagName&&a=="endTag"?(y="tag bracket",E(a,b,m)):(y="error",w)}function v(a,b,m){if(a=="word"){var x=b.current();return m.context&&m.context.tagName!=x&&z.implicitlyClosed.hasOwnProperty(m.context.tagName)&&o(m),m.context&&m.context.tagName==x||z.matchClosing===!1?(y="tag",g):(y="tag error",k)}else return z.allowMissingTagName&&a=="endTag"?(y="tag bracket",g(a,b,m)):(y="error",k)}function g(a,b,m){return a!="endTag"?(y="error",g):(o(m),d)}function k(a,b,m){return y="error",g(a,b,m)}function E(a,b,m){if(a=="word")return y="attribute",p;if(a=="endTag"||a=="selfcloseTag"){var x=m.tagName,F=m.tagStart;return m.tagName=m.tagStart=null,a=="selfcloseTag"||z.autoSelfClosers.hasOwnProperty(x)?l(m,x):(l(m,x),m.context=new h(m,x,F==m.indented)),d}return y="error",E}function p(a,b,m){return a=="equals"?c:(z.allowMissing||(y="error"),E(a,b,m))}function c(a,b,m){return a=="string"?u:a=="word"&&z.allowUnquoted?(y="string",E):(y="error",E(a,b,m))}function u(a,b,m){return a=="string"?u:E(a,b,m)}return{startState:function(a){var b={tokenize:A,state:d,indented:a||0,tagName:null,tagStart:null,context:null};return a!=null&&(b.baseIndent=a),b},token:function(a,b){if(!b.tagName&&a.sol()&&(b.indented=a.indentation()),a.eatSpace())return null;R=null;var m=b.tokenize(a,b);return(m||R)&&m!="comment"&&(y=null,b.state=b.state(R||m,a,b),y&&(m=y=="error"?m+" error":y)),m},indent:function(a,b,m){var x=a.context;if(a.tokenize.isInAttribute)return a.tagStart==a.indented?a.stringStartCol+1:a.indented+M;if(x&&x.noIndent)return oe.Pass;if(a.tokenize!=O&&a.tokenize!=A)return m?m.match(/^(\s*)/)[0].length:0;if(a.tagName)return z.multilineTagIndentPastTag!==!1?a.tagStart+a.tagName.length+2:a.tagStart+M*(z.multilineTagIndentFactor||1);if(z.alignCDATA&&/$/,blockCommentStart:"",configuration:z.htmlMode?"html":"xml",helperType:z.htmlMode?"html":"xml",skipAttribute:function(a){a.state==c&&(a.state=E)},xmlCurrentTag:function(a){return a.tagName?{name:a.tagName,close:a.type=="closeTag"}:null},xmlCurrentContext:function(a){for(var b=[],m=a.context;m;m=m.prev)m.tagName&&b.push(m.tagName);return b.reverse()}}}),oe.defineMIME("text/xml","xml"),oe.defineMIME("application/xml","xml"),oe.mimeModes.hasOwnProperty("text/html")||oe.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"55Ip":function(xt,it,se){"use strict";se.d(it,"a",function(){return l});var oe=se("Ty5D"),Z=se("dI71"),D=se("q1tI"),$=se.n(D),B=se("YS25"),M=se("17x9"),z=se.n(M),W=se("wx14"),P=se("zLVn"),R=se("9R94"),y=function(c){Object(Z.a)(u,c);function u(){for(var b,m=arguments.length,x=new Array(m),F=0;F1&&arguments[1]!==void 0?arguments[1]:0,C=(z[O[L+0]]+z[O[L+1]]+z[O[L+2]]+z[O[L+3]]+"-"+z[O[L+4]]+z[O[L+5]]+"-"+z[O[L+6]]+z[O[L+7]]+"-"+z[O[L+8]]+z[O[L+9]]+"-"+z[O[L+10]]+z[O[L+11]]+z[O[L+12]]+z[O[L+13]]+z[O[L+14]]+z[O[L+15]]).toLowerCase();if(!M(C))throw TypeError("Stringified UUID is invalid");return C}var R=P;function y(O,L,C){O=O||{};var T=O.random||(O.rng||D)();if(T[6]=T[6]&15|64,T[8]=T[8]&63|128,L){C=C||0;for(var h=0;h<16;++h)L[C+h]=T[h];return L}return R(T)}var A=it.a=y},"7ahc":function(xt,it,se){"use strict";se.d(it,"a",function(){return w});var oe=se("k1fw"),Z=se("0Owb"),D=se("+L6B"),$=se("2/Rp"),B=se("y8nQ"),M=se("Vl3Y"),z=se("tJVT"),W=se("OaEy"),P=se("2fM7"),R=se("q1tI"),y=se.n(R),A=se("VrN/"),O=se.n(A),L=se("p77/"),C=se.n(L),T=se("c5Ni"),h=se.n(T),o=P.a.Option,l={labelCol:{span:4},wrapperCol:{span:20}},d={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"]};it.b=function(v){var g=v.callback,k=v.onCancel,E=Object(R.useState)("python"),p=Object(z.a)(E,2),c=p[0],u=p[1];function a(m){u(d[m][1])}function b(m){g(m)}return y.a.createElement(M.a,Object(Z.a)({},l,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:b}),y.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},y.a.createElement(P.a,{onChange:a},Object.keys(d).map(function(m){return y.a.createElement(o,{key:m,value:m},d[m][0])}))),y.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},y.a.createElement(w,{mode:c})),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement($.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement($.a,{type:"ghost",onClick:k},"\u53D6\u6D88")))};function w(v){var g=v.value,k=v.onChange,E=v.mode,p=v.options,c=p===void 0?{}:p,u=Object(R.useRef)(),a=Object(R.useState)(),b=Object(z.a)(a,2),m=b[0],x=b[1];return Object(R.useEffect)(function(){if(m){function F(U){var K=U.getValue();k&&k(K)}return m.on("change",F),function(){m.off("change",F)}}},[m,k]),Object(R.useEffect)(function(){m&&m.setOption("mode",E)},[m,E]),Object(R.useEffect)(function(){m&&((g!==m.getValue()||g==="")&&setTimeout(function(){m.setValue(g||" ")},300))},[m,g]),Object(R.useEffect)(function(){if(u.current&&!m){var F=O.a.fromTextArea(u.current,Object(oe.a)({mode:E,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},c));x(F)}},[u.current,m]),y.a.createElement("div",{className:"my-codemirror-container"},y.a.createElement("textarea",{ref:u}))}},"7ixt":function(xt,it,se){"use strict";se.d(it,"a",function(){return D});var oe={adjustX:1,adjustY:1},Z=[0,0],D={left:{points:["cr","cl"],overflow:oe,offset:[-4,0],targetOffset:Z},right:{points:["cl","cr"],overflow:oe,offset:[4,0],targetOffset:Z},top:{points:["bc","tc"],overflow:oe,offset:[0,-4],targetOffset:Z},bottom:{points:["tc","bc"],overflow:oe,offset:[0,4],targetOffset:Z},topLeft:{points:["bl","tl"],overflow:oe,offset:[0,-4],targetOffset:Z},leftTop:{points:["tr","tl"],overflow:oe,offset:[-4,0],targetOffset:Z},topRight:{points:["br","tr"],overflow:oe,offset:[0,-4],targetOffset:Z},rightTop:{points:["tl","tr"],overflow:oe,offset:[4,0],targetOffset:Z},bottomRight:{points:["tr","br"],overflow:oe,offset:[0,4],targetOffset:Z},rightBottom:{points:["bl","br"],overflow:oe,offset:[4,0],targetOffset:Z},bottomLeft:{points:["tl","bl"],overflow:oe,offset:[0,4],targetOffset:Z},leftBottom:{points:["br","bl"],overflow:oe,offset:[-4,0],targetOffset:Z}},$=D},"8EBN":function(xt,it,se){(function(oe){oe(se("VrN/"))})(function(oe){"use strict";oe.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 Z=0;Z-1&&$.substring(z+1,$.length);if(W)return oe.findModeByExtension(W)},oe.findModeByName=function($){$=$.toLowerCase();for(var B=0;B=N.length?Q.slice(N.length):Q}).join(`
`)}var h=[],o=[""],l=new L.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function w(){h.length=0,o=[""]}var v={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function g(G,s,f,N){if(s>=G.length||G[s].level<=f)return s;var Q=G[s];N.push("- "+Q.text+""),s++;var H=[];return s=g(G,s,Q.level,H),H.length>0&&(N.push("
"),H.forEach(function(me){N.push(me)}),N.push("
")),N.push(" "),s=g(G,s,f,N),s}function k(){return g(h,0,0,o),o.push("
"),o.join("")}var E={heading:function(s){var f=d.exec(s);if(f)return{type:"heading",raw:f[0],depth:f[1].length,text:f[2]}},fences:function(s){var f=this.rules.block.fences.exec(s);if(f){var N=f[0],Q=T(N,f[3]||""),H=f[2]?f[2].trim():f[2];if(["latex","katex","math"].indexOf(H)>=0){var me=u(),We=Q;Q=me,a[me]={type:"block",expression:We}}return{type:"code",raw:N,lang:H,text:Q}}}},p=/(?:\${2})([^\n`]+?)(?:\${2})/gi,c=0,u=function(){return"__special_katext_id_".concat(c++,"__")},a={};function b(){return a}function m(){c=0,a={}}function x(G){return G=G.replace(p,function(s,f){var N=u();return a[N]={type:"inline",expression:f},N}),G}var F=l.listitem;l.listitem=function(G){return F(x(G))};var U=l.paragraph;l.paragraph=function(G){return U(x(G))};var K=l.tablecell;l.tablecell=function(G,s){return K(x(G),s)},l.code=function(G,s,f){var N=(s||"").match(/\S*/)[0];return N?["latex","katex","math"].indexOf(N)>=0?"".concat(G,"
"):'
').concat(f?G:Object(C.escape)(G,!0),`
`):''+(f?G:Object(C.escape)(G,!0))+"
"},l.heading=function(G,s,f){var N=this.options.headerPrefix+f.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return h.push({anchor:N,level:s,text:G}),"'+G+""},L.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),L.a.use({tokenizer:E,renderer:l});var V=L.a,_=se("SJMd"),I=se("ulZh"),Y=se.n(I),ee=se("m3rI"),ae=se("Oy/b"),de=se("p5ED"),De=se("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Se=function(G,s){return(Se=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,N){f.__proto__=N}||function(f,N){for(var Q in N)Object.prototype.hasOwnProperty.call(N,Q)&&(f[Q]=N[Q])})(G,s)};function we(G,s){function f(){this.constructor=G}Se(G,s),G.prototype=s===null?Object.create(s):(f.prototype=s.prototype,new f)}function Ce(G,s,f,N){return new(f||(f=Promise))(function(Q,H){function me(ct){try{Je(N.next(ct))}catch(Ge){H(Ge)}}function We(ct){try{Je(N.throw(ct))}catch(Ge){H(Ge)}}function Je(ct){var Ge;ct.done?Q(ct.value):(Ge=ct.value,Ge instanceof f?Ge:new f(function(vt){vt(Ge)})).then(me,We)}Je((N=N.apply(G,s||[])).next())})}function Te(G,s){var f,N,Q,H,me={label:0,sent:function(){if(1&Q[0])throw Q[1];return Q[1]},trys:[],ops:[]};return H={next:We(0),throw:We(1),return:We(2)},typeof Symbol=="function"&&(H[Symbol.iterator]=function(){return this}),H;function We(Je){return function(ct){return function(Ge){if(f)throw new TypeError("Generator is already executing.");for(;me;)try{if(f=1,N&&(Q=2&Ge[0]?N.return:Ge[0]?N.throw||((Q=N.return)&&Q.call(N),0):N.next)&&!(Q=Q.call(N,Ge[1])).done)return Q;switch(N=0,Q&&(Ge=[2&Ge[0],Q.value]),Ge[0]){case 0:case 1:Q=Ge;break;case 4:return me.label++,{value:Ge[1],done:!1};case 5:me.label++,N=Ge[1],Ge=[0];continue;case 7:Ge=me.ops.pop(),me.trys.pop();continue;default:if(!(Q=me.trys,(Q=Q.length>0&&Q[Q.length-1])||Ge[0]!==6&&Ge[0]!==2)){me=0;continue}if(Ge[0]===3&&(!Q||Ge[1]>Q[0]&&Ge[1]',"select"),this.addActionButton(N,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(N,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(N,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(N,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(N,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(N,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(N,'',"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 me=document.createElement("div");me.className=""+f.toolbarButtonStyleClass.name,me.setAttribute("data-type-name",H.typeName),me.innerHTML=H.icon,me.addEventListener("click",function(){f.markerToolbarButtonClicked(me,H)}),f.buttons.push(me),f.markerButtons.push(me)}),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 Q=document.createElement("div");Q.className=this.toolbarBlockStyleClass.name,Q.style.whiteSpace="nowrap",Q.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(Q),this.addActionButton(Q,'',"render"),this.addActionButton(Q,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},G.prototype.addButtonClickListener=function(s){this.buttonClickListeners.push(s)},G.prototype.removeButtonClickListener=function(s){this.buttonClickListeners.indexOf(s)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(s),1)},G.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},G.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var s=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var f=0;f0&&this.buttonClickListeners.forEach(function(N){return N("marker",f)}),this.markerButtonOverflowBlock.style.display="none"},G.prototype.actionToolbarButtonClicked=function(s,f){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(N){return N("action",f)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},G.prototype.setActiveButton=function(s){this.resetButtonStyles(),s.className=s.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),s.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},G.prototype.setActiveMarkerButton=function(s){var f=this.markerButtons.find(function(N){return N.getAttribute("data-type-name")===s});f&&this.setActiveButton(f)},G.prototype.setCurrentMarker=function(s){var f=this;this.currentMarker=s,this.buttons.filter(function(N){return/delete|notes/.test(N.getAttribute("data-action"))}).forEach(function(N){f.currentMarker===void 0?(N.style.fillOpacity="0.4",N.style.pointerEvents="none"):(N.style.fillOpacity="1",N.style.pointerEvents="all")})},G}(),Ne=function(){function G(s,f,N,Q){this.panels=[],this.panelButtons=[],this.markerjsContainer=s,this.displayMode=f,this.uiStyleSettings=N,this.styles=Q,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return G.prototype.addStyles=function(){var s;this.toolboxStyleClass=this.styles.addClass(new Ee("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 Ee("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var f=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ee("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ee("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ee("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 Ee("toolbox-panel-row_colors",`
background-color: `+((s=this.uiStyleSettings.toolboxBackgroundColor)!==null&&s!==void 0?s:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ee("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*f)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*f)+`px;
padding: `+f+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ee("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ee("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Oe("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Oe("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},G.prototype.show=function(s){var f;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=s,this.uiContainer.className=this.toolboxStyleClass.name+" "+((f=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&f!==void 0?f:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},G.prototype.setPanelButtons=function(s){var f,N,Q=this;this.panels=s,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((f=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&f!==void 0?f:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((N=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&N!==void 0?N:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(H){var me;H.uiStyleSettings=Q.uiStyleSettings;var We=document.createElement("div");We.className=Q.toolboxButtonStyleClass.name+" "+((me=Q.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&me!==void 0?me:Q.toolboxButtonStyleColorsClass.name),We.innerHTML=H.icon,We.title=H.title,We.addEventListener("click",function(){Q.panelButtonClick(H)}),Q.panelButtons.push(We),Q.buttonRow.appendChild(We)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},G.prototype.panelButtonClick=function(s){var f=this,N=-1;if(s!==this.activePanel){N=this.panels.indexOf(s),this.panelRow.innerHTML="";var Q=s.getUi();Q.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(Q),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=s}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){f.displayMode==="inline"?f.panelRow.style.display="none":f.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(H,me){var We,Je;H.className=f.toolboxButtonStyleClass.name+" "+(me===N?""+((We=f.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&We!==void 0?We:f.toolboxActiveButtonStyleColorsClass.name):""+((Je=f.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Je!==void 0?Je:f.toolboxButtonStyleColorsClass.name))})},G}(),je=function(G,s){this.title=G,this.icon=s},Ue=function(G){function s(f,N,Q,H){var me=G.call(this,f,H||'')||this;return me.colors=[],me.addTransparent=!1,me.colorBoxes=[],me.colors=N,me.currentColor=Q,me.setCurrentColor=me.setCurrentColor.bind(me),me.getColorBox=me.getColorBox.bind(me),me}return we(s,G),s.prototype.getUi=function(){var f=this,N=document.createElement("div");return N.style.overflow="hidden",N.style.whiteSpace="nowrap",this.colors.forEach(function(Q){var H=f.getColorBox(Q);N.appendChild(H),f.colorBoxes.push(H)}),N},s.prototype.getColorBox=function(f){var N=this,Q=this.uiStyleSettings.toolbarHeight/4,H=this.uiStyleSettings.toolbarHeight-Q,me=document.createElement("div");me.style.display="inline-block",me.style.boxSizing="content-box",me.style.width=H-2+"px",me.style.height=H-2+"px",me.style.padding="1px",me.style.marginRight="2px",me.style.marginBottom="2px",me.style.borderWidth="2px",me.style.borderStyle="solid",me.style.borderRadius=(H+2)/2+"px",me.style.borderColor=f===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",me.addEventListener("click",function(){N.setCurrentColor(f,me)});var We=document.createElement("div");return We.style.display="inline-block",We.style.width=H-2+"px",We.style.height=H-2+"px",We.style.backgroundColor=f,We.style.borderRadius=H/2+"px",f==="transparent"&&(We.style.fill=this.uiStyleSettings.toolboxAccentColor,We.innerHTML=``),me.appendChild(We),me},s.prototype.setCurrentColor=function(f,N){var Q=this;this.currentColor=f,this.colorBoxes.forEach(function(H){H.style.borderColor=H===N?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(f)},s}(je),Ie=function(){function G(s,f,N){this._state="new",this._isSelected=!1,this._container=s,this._overlayContainer=f,this.globalSettings=N,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(G.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),G.prototype.ownsTarget=function(s){return!1},Object.defineProperty(G.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),G.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},G.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},G.prototype.pointerDown=function(s,f){},G.prototype.dblClick=function(s,f){},G.prototype.manipulate=function(s){},G.prototype.pointerUp=function(s){this.stateChanged()},G.prototype.dispose=function(){},G.prototype.addMarkerVisualToContainer=function(s){this.container.childNodes.length>0?this.container.insertBefore(s,this.container.childNodes[0]):this.container.appendChild(s)},G.prototype.getState=function(){return{typeName:G.typeName,state:this.state,notes:this.notes}},G.prototype.restoreState=function(s){this._state=s.state,this.notes=s.notes},G.prototype.scale=function(s,f){},G.prototype.colorChanged=function(s){this.onColorChanged&&this.onColorChanged(s),this.stateChanged()},G.prototype.fillColorChanged=function(s){this.onFillColorChanged&&this.onFillColorChanged(s),this.stateChanged()},G.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var s=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),s.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(s)&&this.onStateChanged(this)}},G.typeName="MarkerBase",G}(),Me=function(){function G(){this.findGripByVisual=this.findGripByVisual.bind(this)}return G.prototype.findGripByVisual=function(s){return this.topLeft.ownsTarget(s)?this.topLeft:this.topCenter.ownsTarget(s)?this.topCenter:this.topRight.ownsTarget(s)?this.topRight:this.centerLeft.ownsTarget(s)?this.centerLeft:this.centerRight.ownsTarget(s)?this.centerRight:this.bottomLeft.ownsTarget(s)?this.bottomLeft:this.bottomCenter.ownsTarget(s)?this.bottomCenter:this.bottomRight.ownsTarget(s)?this.bottomRight:void 0},G}(),Ke=function(){function G(){this.GRIP_SIZE=10,this.visual=le.createGroup(),this.visual.appendChild(le.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(le.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return G.prototype.ownsTarget=function(s){return s===this.visual||s===this.visual.childNodes[0]||s===this.visual.childNodes[1]},G}(),Ze=function(){function G(){}return G.toITransformMatrix=function(s){return{a:s.a,b:s.b,c:s.c,d:s.d,e:s.e,f:s.f}},G.toSVGMatrix=function(s,f){return s.a=f.a,s.b=f.b,s.c=f.c,s.d=f.d,s.e=f.e,s.f=f.f,s},G}(),$e=function(G){function s(f,N,Q){var H=G.call(this,f,N,Q)||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(le.createTransform()),H.setupControlBox(),H}return we(s,G),Object.defineProperty(s.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"visual",{get:function(){return this._visual},set:function(f){this._visual=f;var N=le.createTransform();this._visual.transform.baseVal.appendItem(N)},enumerable:!1,configurable:!0}),s.prototype.ownsTarget=function(f){return!!G.prototype.ownsTarget.call(this,f)||!!(this.controlGrips.findGripByVisual(f)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(f))},s.prototype.pointerDown=function(f,N){G.prototype.pointerDown.call(this,f,N),this.state==="new"&&(this.left=f.x,this.top=f.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var Q=this.unrotatePoint(f);if(this.manipulationStartX=Q.x,this.manipulationStartY=Q.y,this.offsetX=Q.x-this.left,this.offsetY=Q.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(N),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(N)){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 me=this.container.transform.baseVal.getItem(0);me.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(me,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},s.prototype.pointerUp=function(f){var N=this.state;G.prototype.pointerUp.call(this,f),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(f),this._state="select",N==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},s.prototype.moveVisual=function(f){this.visual.style.transform="translate("+f.x+"px, "+f.y+"px)"},s.prototype.manipulate=function(f){var N=this.unrotatePoint(f);this.state==="creating"?this.resize(f):this.state==="move"?(this.left=this.manipulationStartLeft+(N.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(N.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(N):this.state==="rotate"&&this.rotate(f)},s.prototype.resize=function(f){var N=this.manipulationStartLeft,Q=this.manipulationStartWidth,H=this.manipulationStartTop,me=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:N=this.manipulationStartLeft+f.x-this.manipulationStartX,Q=this.manipulationStartWidth+this.manipulationStartLeft-N;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:Q=this.manipulationStartWidth+f.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:H=this.manipulationStartTop+f.y-this.manipulationStartY,me=this.manipulationStartHeight+this.manipulationStartTop-H;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:me=this.manipulationStartHeight+f.y-this.manipulationStartY}Q>=0?(this.left=N,this.width=Q):(this.left=N+Q,this.width=-Q),me>=0?(this.top=H,this.height=me):(this.top=H+me,this.height=-me),this.setSize()},s.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},s.prototype.rotate=function(f){if(Math.abs(f.x-this.centerX)>.1){var N=Math.sign(f.x-this.centerX);this.rotationAngle=180*Math.atan((f.y-this.centerY)/(f.x-this.centerX))/Math.PI+90*N,this.applyRotation()}},s.prototype.applyRotation=function(){var f=this.container.transform.baseVal.getItem(0);f.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(f,0)},s.prototype.rotatePoint=function(f){if(this.rotationAngle===0)return f;var N=this.container.getCTM(),Q=le.createPoint(f.x,f.y);return{x:(Q=Q.matrixTransform(N)).x,y:Q.y}},s.prototype.unrotatePoint=function(f){if(this.rotationAngle===0)return f;var N=this.container.getCTM();N=N.inverse();var Q=le.createPoint(f.x,f.y);return{x:(Q=Q.matrixTransform(N)).x,y:Q.y}},s.prototype.select=function(){G.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},s.prototype.deselect=function(){G.prototype.deselect.call(this),this.controlBox.style.display="none"},s.prototype.setupControlBox=function(){this.controlBox=le.createGroup();var f=le.createTransform();f.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(f),this.container.appendChild(this.controlBox),this.controlRect=le.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=le.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 Me,this.addControlGrips(),this.controlBox.style.display="none"},s.prototype.adjustControlBox=function(){var f=this.controlBox.transform.baseVal.getItem(0);f.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(f,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()},s.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()},s.prototype.createGrip=function(){var f=new Ke;return f.visual.transform.baseVal.appendItem(le.createTransform()),this.controlBox.appendChild(f.visual),f},s.prototype.positionGrips=function(){var f=this.controlGrips.topLeft.GRIP_SIZE,N=-f/2,Q=N,H=(this.width+this.CB_DISTANCE)/2-f/2,me=(this.height+this.CB_DISTANCE)/2-f/2,We=this.height+this.CB_DISTANCE-f/2,Je=this.width+this.CB_DISTANCE-f/2;this.positionGrip(this.controlGrips.topLeft.visual,N,Q),this.positionGrip(this.controlGrips.topCenter.visual,H,Q),this.positionGrip(this.controlGrips.topRight.visual,Je,Q),this.positionGrip(this.controlGrips.centerLeft.visual,N,me),this.positionGrip(this.controlGrips.centerRight.visual,Je,me),this.positionGrip(this.controlGrips.bottomLeft.visual,N,We),this.positionGrip(this.controlGrips.bottomCenter.visual,H,We),this.positionGrip(this.controlGrips.bottomRight.visual,Je,We),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,H,Q-3*this.CB_DISTANCE)},s.prototype.positionGrip=function(f,N,Q){var H=f.transform.baseVal.getItem(0);H.setTranslate(N,Q),f.transform.baseVal.replaceItem(H,0)},s.prototype.hideControlBox=function(){this.controlBox.style.display="none"},s.prototype.showControlBox=function(){this.controlBox.style.display=""},s.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Ze.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Ze.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},G.prototype.getState.call(this))},s.prototype.restoreState=function(f){G.prototype.restoreState.call(this,f);var N=f;this.left=N.left,this.top=N.top,this.width=N.width,this.height=N.height,this.rotationAngle=N.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Ze.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,N.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Ze.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,N.containerTransformMatrix))},s.prototype.scale=function(f,N){G.prototype.scale.call(this,f,N);var Q=this.rotatePoint({x:this.left,y:this.top}),H=this.unrotatePoint({x:Q.x*f,y:Q.y*N});this.left=H.x,this.top=H.y,this.width=this.width*f,this.height=this.height*N,this.adjustControlBox()},s}(Ie),Qe=function(G){function s(f,N,Q){var H=G.call(this,f,N,Q)||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 we(s,G),s.prototype.ownsTarget=function(f){return!(!G.prototype.ownsTarget.call(this,f)&&f!==this.visual)},s.prototype.createVisual=function(){this.visual=le.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)},s.prototype.pointerDown=function(f,N){G.prototype.pointerDown.call(this,f,N),this.state==="new"&&(this.createVisual(),this.moveVisual(f),this._state="creating")},s.prototype.manipulate=function(f){G.prototype.manipulate.call(this,f)},s.prototype.resize=function(f){G.prototype.resize.call(this,f),this.setSize()},s.prototype.setSize=function(){G.prototype.setSize.call(this),le.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},s.prototype.pointerUp=function(f){G.prototype.pointerUp.call(this,f),this.setSize()},s.prototype.setStrokeColor=function(f){this.strokeColor=f,this.visual&&le.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(f),this.stateChanged()},s.prototype.setFillColor=function(f){this.fillColor=f,this.visual&&le.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},s.prototype.setStrokeWidth=function(f){this.strokeWidth=f,this.visual&&le.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},s.prototype.setStrokeDasharray=function(f){this.strokeDasharray=f,this.visual&&le.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},s.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},G.prototype.getState.call(this))},s.prototype.restoreState=function(f){var N=f;this.fillColor=N.fillColor,this.strokeColor=N.strokeColor,this.strokeWidth=N.strokeWidth,this.strokeDasharray=N.strokeDasharray,this.opacity=N.opacity,this.createVisual(),G.prototype.restoreState.call(this,f),this.setSize()},s.prototype.scale=function(f,N){G.prototype.scale.call(this,f,N),this.setSize()},s.title="Rectangle marker",s}($e),lt=function(G){function s(f,N,Q,H){var me=G.call(this,f,H||'')||this;return me.widths=[],me.widthBoxes=[],me.widths=N,me.currentWidth=Q,me.setCurrentWidth=me.setCurrentWidth.bind(me),me}return we(s,G),s.prototype.getUi=function(){var f=this,N=document.createElement("div");return N.style.display="flex",N.style.overflow="hidden",N.style.flexGrow="2",this.widths.forEach(function(Q){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=Q===f.currentWidth?f.uiStyleSettings.toolboxAccentColor:"transparent",H.addEventListener("click",function(){f.setCurrentWidth(Q,H)}),N.appendChild(H);var me=document.createElement("div");me.innerText=Q.toString(),me.style.marginRight="5px",H.appendChild(me);var We=document.createElement("div");We.style.minHeight="20px",We.style.flexGrow="2",We.style.display="flex",We.style.alignItems="center";var Je=document.createElement("hr");Je.style.minWidth="20px",Je.style.border="0px",Je.style.borderTop=Q+"px solid "+f.uiStyleSettings.toolboxColor,Je.style.flexGrow="2",We.appendChild(Je),H.appendChild(We),f.widthBoxes.push(H)}),N},s.prototype.setCurrentWidth=function(f,N){var Q=this;this.currentWidth=f,this.widthBoxes.forEach(function(H){H.style.borderColor=H===N?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},s}(je),tt=function(G){function s(f,N,Q,H){var me=G.call(this,f,H||'')||this;return me.styles=[],me.styleBoxes=[],me.styles=N,me.currentStyle=Q,me.setCurrentStyle=me.setCurrentStyle.bind(me),me}return we(s,G),s.prototype.getUi=function(){var f=this,N=document.createElement("div");return N.style.display="flex",N.style.overflow="hidden",N.style.flexGrow="2",this.styles.forEach(function(Q){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/f.styles.length-5+"%",H.style.borderColor=Q===f.currentStyle?f.uiStyleSettings.toolboxAccentColor:"transparent",H.addEventListener("click",function(){f.setCurrentStyle(Q,H)}),N.appendChild(H);var me=document.createElement("div");me.style.minHeight="20px",me.style.flexGrow="2",me.style.overflow="hidden";var We=``;me.innerHTML=We,H.appendChild(me),f.styleBoxes.push(H)}),N},s.prototype.setCurrentStyle=function(f,N){var Q=this;this.currentStyle=f,this.styleBoxes.forEach(function(H){H.style.borderColor=H===N?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},s}(je),rt=function(G){function s(f,N,Q){var H=G.call(this,f,N,Q)||this;return H.strokeColor=Q.defaultColor,H.strokeWidth=Q.defaultStrokeWidth,H.strokeDasharray=Q.defaultStrokeDasharray,H.strokePanel=new Ue("Line color",Q.defaultColorSet,Q.defaultColor),H.strokePanel.onColorChanged=H.setStrokeColor,H.strokeWidthPanel=new lt("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),H.strokeWidthPanel.onWidthChanged=H.setStrokeWidth,H.strokeStylePanel=new tt("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),H.strokeStylePanel.onStyleChanged=H.setStrokeDasharray,H}return we(s,G),Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var f=G.prototype.getState.call(this);return f.typeName=s.typeName,f},s.typeName="FrameMarker",s.title="Frame marker",s.icon='',s}(Qe),Pe=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},ht=function(G){function s(f,N,Q){var H=G.call(this,f,N,Q)||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 we(s,G),s.prototype.ownsTarget=function(f){return!!G.prototype.ownsTarget.call(this,f)||!(!this.grip1.ownsTarget(f)&&!this.grip2.ownsTarget(f))},s.prototype.pointerDown=function(f,N){G.prototype.pointerDown.call(this,f,N),this.manipulationStartX=f.x,this.manipulationStartY=f.y,this.state==="new"&&(this.x1=f.x,this.y1=f.y,this.x2=f.x,this.y2=f.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(N)?this.activeGrip=this.grip1:this.grip2.ownsTarget(N)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},s.prototype.pointerUp=function(f){var N=this.state;G.prototype.pointerUp.call(this,f),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(f),this._state="select",N==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},s.prototype.adjustVisual=function(){},s.prototype.manipulate=function(f){this.state==="creating"?this.resize(f):this.state==="move"?(this.x1=this.manipulationStartX1+f.x-this.manipulationStartX,this.y1=this.manipulationStartY1+f.y-this.manipulationStartY,this.x2=this.manipulationStartX2+f.x-this.manipulationStartX,this.y2=this.manipulationStartY2+f.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(f)},s.prototype.resize=function(f){switch(this.activeGrip){case this.grip1:this.x1=f.x,this.y1=f.y;break;case this.grip2:case void 0:this.x2=f.x,this.y2=f.y}this.adjustVisual(),this.adjustControlBox()},s.prototype.select=function(){G.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},s.prototype.deselect=function(){G.prototype.deselect.call(this),this.controlBox.style.display="none"},s.prototype.setupControlBox=function(){this.controlBox=le.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},s.prototype.adjustControlBox=function(){this.positionGrips()},s.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},s.prototype.createGrip=function(){var f=new Ke;return f.visual.transform.baseVal.appendItem(le.createTransform()),this.controlBox.appendChild(f.visual),f},s.prototype.positionGrips=function(){var f=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-f/2,this.y1-f/2),this.positionGrip(this.grip2.visual,this.x2-f/2,this.y2-f/2)},s.prototype.positionGrip=function(f,N,Q){var H=f.transform.baseVal.getItem(0);H.setTranslate(N,Q),f.transform.baseVal.replaceItem(H,0)},s.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},G.prototype.getState.call(this))},s.prototype.restoreState=function(f){G.prototype.restoreState.call(this,f);var N=f;this.x1=N.x1,this.y1=N.y1,this.x2=N.x2,this.y2=N.y2},s.prototype.scale=function(f,N){G.prototype.scale.call(this,f,N),this.x1=this.x1*f,this.y1=this.y1*N,this.x2=this.x2*f,this.y2=this.y2*N,this.adjustVisual(),this.adjustControlBox()},s}(Ie),at=function(G){function s(f,N,Q){var H=G.call(this,f,N,Q)||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=Q.defaultColor,H.strokeWidth=Q.defaultStrokeWidth,H.strokeDasharray=Q.defaultStrokeDasharray,H.strokePanel=new Ue("Line color",Q.defaultColorSet,Q.defaultColor),H.strokePanel.onColorChanged=H.setStrokeColor,H.strokeWidthPanel=new lt("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),H.strokeWidthPanel.onWidthChanged=H.setStrokeWidth,H.strokeStylePanel=new tt("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),H.strokeStylePanel.onStyleChanged=H.setStrokeDasharray,H}return we(s,G),s.prototype.ownsTarget=function(f){return!(!G.prototype.ownsTarget.call(this,f)&&f!==this.visual&&f!==this.selectorLine&&f!==this.visibleLine)},s.prototype.createVisual=function(){this.visual=le.createGroup(),this.selectorLine=le.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=le.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)},s.prototype.pointerDown=function(f,N){G.prototype.pointerDown.call(this,f,N),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},s.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()),le.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),le.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),le.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},s.prototype.setStrokeColor=function(f){this.strokeColor=f,this.adjustVisual(),this.colorChanged(f)},s.prototype.setStrokeWidth=function(f){this.strokeWidth=f,this.adjustVisual()},s.prototype.setStrokeDasharray=function(f){this.strokeDasharray=f,this.adjustVisual(),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var f=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},G.prototype.getState.call(this));return f.typeName=s.typeName,f},s.prototype.restoreState=function(f){G.prototype.restoreState.call(this,f);var N=f;this.strokeColor=N.strokeColor,this.strokeWidth=N.strokeWidth,this.strokeDasharray=N.strokeDasharray,this.createVisual(),this.adjustVisual()},s.typeName="LineMarker",s.title="Line marker",s.icon='',s}(ht),Fe=function(G){function s(f,N,Q,H){var me=G.call(this,f,H||'')||this;return me.fonts=[],me.fontBoxes=[],me.fonts=N,me.currentFont=Q,me.setCurrentFont=me.setCurrentFont.bind(me),me}return we(s,G),s.prototype.getUi=function(){var f=this,N=document.createElement("div");return N.style.overflow="hidden",N.style.flexGrow="2",this.fonts.forEach(function(Q){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/f.fonts.length-5+"%",H.style.borderColor=Q===f.currentFont?f.uiStyleSettings.toolboxAccentColor:"transparent",H.addEventListener("click",function(){f.setCurrentFont(Q,H)}),N.appendChild(H);var me=document.createElement("div");me.style.display="flex",me.style.minHeight="20px",me.style.flexGrow="2",me.style.fontFamily=Q,me.style.overflow="hidden";var We=document.createElement("div");We.style.whiteSpace="nowrap",We.style.overflow="hidden",We.style.textOverflow="ellipsis",We.innerHTML="The quick brown fox jumps over the lazy dog",me.appendChild(We),H.appendChild(me),f.fontBoxes.push(H)}),N},s.prototype.setCurrentFont=function(f,N){var Q=this;this.currentFont=f,this.fontBoxes.forEach(function(H){H.style.borderColor=H===N?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},s}(je),Ve=function(G){function s(f,N,Q){var H=G.call(this,f,N,Q)||this;return H.color="transparent",H.padding=5,H.DEFAULT_TEXT="your text here",H.text=H.DEFAULT_TEXT,H.isMoved=!1,H.color=Q.defaultColor,H.fontFamily=Q.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 Ue("Color",Q.defaultColorSet,Q.defaultColor),H.colorPanel.onColorChanged=H.setColor,H.fontFamilyPanel=new Fe("Font",Q.defaultFontFamilies,Q.defaultFontFamily),H.fontFamilyPanel.onFontChanged=H.setFont,H}return we(s,G),s.prototype.ownsTarget=function(f){if(G.prototype.ownsTarget.call(this,f)||f===this.visual||f===this.textElement||f===this.bgRectangle)return!0;var N=!1;return this.textElement.childNodes.forEach(function(Q){Q===f&&(N=!0)}),N},s.prototype.createVisual=function(){this.visual=le.createGroup(),this.bgRectangle=le.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=le.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(le.createTransform()),this.textElement.transform.baseVal.appendItem(le.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},s.prototype.pointerDown=function(f,N){G.prototype.pointerDown.call(this,f,N),this.isMoved=!1,this.pointerDownPoint=f,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(f),this._state="creating")},s.prototype.renderText=function(){var f=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(N){f.textElement.appendChild(le.createTSpan(N.trim()===""?" ":N.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},s.prototype.getTextScale=function(){var f=this.textElement.getBBox(),N=1;if(f.width>0&&f.height>0){var Q=(1*this.width-this.width*this.padding*2/100)/f.width,H=(1*this.height-this.height*this.padding*2/100)/f.height;N=Math.min(Q,H)}return N},s.prototype.getTextPosition=function(f){var N=this.textElement.getBBox(),Q=0,H=0;return N.width>0&&N.height>0&&(Q=(this.width-N.width*f)/2,H=this.height/2-N.height*f/2),{x:Q,y:H}},s.prototype.sizeText=function(){var f=this.textElement.getBBox(),N=this.getTextScale(),Q=this.getTextPosition(N);Q.y-=f.y*N,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+Q.x+"px, "+Q.y+"px) scale("+N+", "+N+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(Q.x,Q.y),this.textElement.transform.baseVal.getItem(1).setScale(N,N))},s.prototype.manipulate=function(f){G.prototype.manipulate.call(this,f),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(f.x-this.pointerDownPoint.x)>5||Math.abs(f.y-this.pointerDownPoint.y)>5)},s.prototype.resize=function(f){G.prototype.resize.call(this,f),this.isMoved=!0,this.setSize(),this.sizeText()},s.prototype.setSize=function(){G.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(le.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),le.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},s.prototype.pointerUp=function(f){var N=this.state;N==="creating"&&(this._suppressMarkerCreateEvent=!0),G.prototype.pointerUp.call(this,f),this.setSize(),(N==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},s.prototype.showTextEditor=function(){var f=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(N){N.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var N=Number.parseFloat(f.textEditor.style.fontSize);f.textEditor.clientWidth>=Number.parseInt(f.textEditor.style.maxWidth)&&N>.9;)N-=.1,f.textEditor.style.fontSize=Math.max(N,.9)+"em"}),this.textEditor.addEventListener("keyup",function(N){N.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(N){if(N.clipboardData){var Q=N.clipboardData.getData("text"),H=window.getSelection();if(!H.rangeCount)return!1;H.deleteFromDocument(),H.getRangeAt(0).insertNode(document.createTextNode(Q)),N.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){f.textEditDivClicked(f.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},s.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var f=this.getTextScale(),N=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),Q=this.textElement.getBBox(),H={x:Q.width*f,y:Q.height*f};N.x-=H.x/2,N.y-=H.y/2,this.textEditor.style.top=N.y+"px",this.textEditor.style.left=N.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-N.x+"px",this.textEditor.style.fontSize=Math.max(16*f,12)+"px",this.textElement.style.display="none"}},s.prototype.textEditDivClicked=function(f){this.text=f.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},s.prototype.select=function(){G.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},s.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),G.prototype.deselect.call(this)},s.prototype.dblClick=function(f,N){G.prototype.dblClick.call(this,f,N),this.showTextEditor()},s.prototype.setColor=function(f){this.textElement&&le.setAttributes(this.textElement,[["fill",f]]),this.color=f,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(f)},s.prototype.setFont=function(f){this.textElement&&le.setAttributes(this.textElement,[["font-family",f]]),this.fontFamily=f,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},s.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},s.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var f=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},G.prototype.getState.call(this));return f.typeName=s.typeName,f},s.prototype.restoreState=function(f){var N=f;this.color=N.color,this.fontFamily=N.fontFamily,this.padding=N.padding,this.text=N.text,this.createVisual(),G.prototype.restoreState.call(this,f),this.setSize()},s.prototype.scale=function(f,N){G.prototype.scale.call(this,f,N),this.setSize(),this.sizeText(),this.positionTextEditor()},s.typeName="TextMarker",s.title="Text marker",s.icon='',s}($e),xe=function(G){function s(f,N,Q){var H=G.call(this,f,N,Q)||this;return H.color="transparent",H.lineWidth=3,H.drawing=!1,H.pixelRatio=1,H.color=Q.defaultColor,H.lineWidth=Q.defaultStrokeWidth,H.pixelRatio=Q.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 Ue("Color",Q.defaultColorSet,Q.defaultColor),H.colorPanel.onColorChanged=H.setColor,H.lineWidthPanel=new lt("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),H.lineWidthPanel.onWidthChanged=H.setLineWidth,H}return we(s,G),s.prototype.ownsTarget=function(f){return!(!G.prototype.ownsTarget.call(this,f)&&f!==this.visual&&f!==this.drawingImage)},s.prototype.createVisual=function(){this.visual=le.createGroup(),this.drawingImage=le.createImage(),this.visual.appendChild(this.drawingImage);var f=le.createTransform();this.visual.transform.baseVal.appendItem(f),this.addMarkerVisualToContainer(this.visual)},s.prototype.pointerDown=function(f,N){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(f.x,f.y),this.drawing=!0):G.prototype.pointerDown.call(this,f,N)},s.prototype.manipulate=function(f){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(f.x,f.y),this.canvasContext.stroke()):G.prototype.manipulate.call(this,f)},s.prototype.resize=function(f){G.prototype.resize.call(this,f),le.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),le.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},s.prototype.pointerUp=function(f){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):G.prototype.pointerUp.call(this,f)},s.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)},s.prototype.select=function(){this.state==="creating"&&this.finishCreation(),G.prototype.select.call(this)},s.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),G.prototype.deselect.call(this)},s.prototype.finishCreation=function(){for(var f=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),N=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],Q=N[0],H=N[1],me=N[2],We=N[3],Je=!1,ct=0;ct0&&(Je=!0,ctWe&&(We=ct),Ge>me&&(me=Ge));if(Je){this.left=Q/this.pixelRatio,this.top=H/this.pixelRatio,this.width=(me-Q)/this.pixelRatio,this.height=(We-H)/this.pixelRatio;var vt=document.createElement("canvas");vt.width=me-Q,vt.height=We-H,vt.getContext("2d").putImageData(this.canvasContext.getImageData(Q,H,me-Q,We-H),0,0),this.drawingImgUrl=vt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},s.prototype.setDrawingImage=function(){le.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),le.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},s.prototype.setColor=function(f){this.color=f,this.colorChanged(f)},s.prototype.setLineWidth=function(f){this.lineWidth=f},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var f=Object.assign({drawingImgUrl:this.drawingImgUrl},G.prototype.getState.call(this));return f.typeName=s.typeName,f},s.prototype.restoreState=function(f){this.createVisual(),G.prototype.restoreState.call(this,f),this.drawingImgUrl=f.drawingImgUrl,this.setDrawingImage()},s.prototype.scale=function(f,N){G.prototype.scale.call(this,f,N),this.setDrawingImage()},s.typeName="FreehandMarker",s.title="Freehand marker",s.icon='',s}($e),ve=function(G){function s(f,N,Q){var H=G.call(this,f,Q||'')||this;return H.typeBoxes=[],H.currentType=N,H.setCurrentType=H.setCurrentType.bind(H),H}return we(s,G),s.prototype.getUi=function(){var f=this,N=document.createElement("div");N.style.display="flex",N.style.overflow="hidden",N.style.flexGrow="2";for(var Q=function(We){var Je="both";switch(We){case 0:Je="both";break;case 1:Je="start";break;case 2:Je="end";break;case 3:Je="none"}var ct=document.createElement("div");if(ct.style.display="flex",ct.style.flexGrow="2",ct.style.alignItems="center",ct.style.justifyContent="space-between",ct.style.padding="5px",ct.style.borderWidth="2px",ct.style.borderStyle="solid",ct.style.borderColor=Je===H.currentType?H.uiStyleSettings.toolboxAccentColor:"transparent",ct.addEventListener("click",function(){f.setCurrentType(Je,ct)}),N.appendChild(ct),Je==="both"||Je==="start"){var Ge=document.createElement("div");Ge.style.display="flex",Ge.style.alignItems="center",Ge.style.minHeight="20px",Ge.innerHTML=``,Ge.style.marginLeft="5px",ct.appendChild(Ge)}var vt=document.createElement("div");vt.style.display="flex",vt.style.alignItems="center",vt.style.minHeight="20px",vt.style.flexGrow="2";var Nt=document.createElement("hr");if(Nt.style.minWidth="20px",Nt.style.border="0px",Nt.style.borderTop="3px solid "+(H.uiStyleSettings!==void 0?H.uiStyleSettings.toolboxColor:"#eeeeee"),Nt.style.flexGrow="2",vt.appendChild(Nt),ct.appendChild(vt),Je==="both"||Je==="end"){var Kt=document.createElement("div");Kt.style.display="flex",Kt.style.alignItems="center",Kt.style.minHeight="20px",Kt.innerHTML=``,Kt.style.marginRight="5px",ct.appendChild(Kt)}H.typeBoxes.push(ct)},H=this,me=0;me<4;me++)Q(me);return N},s.prototype.setCurrentType=function(f,N){var Q=this;this.currentType=f,this.typeBoxes.forEach(function(H){H.style.borderColor=H===N?Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},s}(je),ye=function(G){function s(f,N,Q){var H=G.call(this,f,N,Q)||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 ve("Arrow type","end"),H.arrowTypePanel.onArrowTypeChanged=H.setArrowType,H}return we(s,G),s.prototype.ownsTarget=function(f){return!(!G.prototype.ownsTarget.call(this,f)&&f!==this.arrow1&&f!==this.arrow2)},s.prototype.getArrowPoints=function(f,N){var Q=this.arrowBaseWidth+2*this.strokeWidth,H=this.arrowBaseHeight+2*this.strokeWidth;return f-Q/2+","+(N+H/2)+" "+f+","+(N-H/2)+" "+(f+Q/2)+","+(N+H/2)},s.prototype.createTips=function(){this.arrow1=le.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(le.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=le.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(le.createTransform()),this.visual.appendChild(this.arrow2)},s.prototype.pointerDown=function(f,N){G.prototype.pointerDown.call(this,f,N),this.state==="creating"&&this.createTips()},s.prototype.adjustVisual=function(){if(G.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",le.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),le.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var f=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),N=this.arrow1.transform.baseVal.getItem(0);N.setRotate(f,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(N,0);var Q=this.arrow2.transform.baseVal.getItem(0);Q.setRotate(f+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(Q,0)}},s.prototype.setArrowType=function(f){this.arrowType=f,this.adjustVisual(),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var f=Object.assign({arrowType:this.arrowType},G.prototype.getState.call(this));return f.typeName=s.typeName,f},s.prototype.restoreState=function(f){G.prototype.restoreState.call(this,f);var N=f;this.arrowType=N.arrowType,this.createTips(),this.adjustVisual()},s.typeName="ArrowMarker",s.title="Arrow marker",s.icon='',s}(at),re=function(G){function s(f,N,Q){var H=G.call(this,f,N,Q)||this;return H.fillColor=Q.defaultFillColor,H.strokeWidth=0,H.fillPanel=new Ue("Color",Q.defaultColorSet,Q.defaultFillColor),H.fillPanel.onColorChanged=H.setFillColor,H}return we(s,G),Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var f=G.prototype.getState.call(this);return f.typeName=s.typeName,f},s.typeName="CoverMarker",s.title="Cover marker",s.icon='',s}(Qe),ie=function(G){function s(f,N,Q,H){var me=G.call(this,f,H||'')||this;return me.opacities=[],me.opacityBoxes=[],me.opacities=N,me.currentOpacity=Q,me.setCurrentOpacity=me.setCurrentOpacity.bind(me),me}return we(s,G),s.prototype.getUi=function(){var f=this,N=document.createElement("div");return N.style.display="flex",N.style.overflow="hidden",N.style.flexGrow="2",N.style.justifyContent="space-between",this.opacities.forEach(function(Q){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=Q===f.currentOpacity?f.uiStyleSettings.toolboxAccentColor:"transparent",H.addEventListener("click",function(){f.setCurrentOpacity(Q,H)}),N.appendChild(H);var me=document.createElement("div");me.innerText=100*Q+"%",H.appendChild(me),f.opacityBoxes.push(H)}),N},s.prototype.setCurrentOpacity=function(f,N){var Q=this;this.currentOpacity=f,this.opacityBoxes.forEach(function(H){H.style.borderColor=H===N?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},s}(je),ue=function(G){function s(f,N,Q){var H=G.call(this,f,N,Q)||this;return H.setOpacity=H.setOpacity.bind(H),H.fillColor=Q.defaultHighlightColor,H.strokeWidth=0,H.opacity=Q.defaultHighlightOpacity,H.fillPanel=new Ue("Color",Q.defaultColorSet,H.fillColor),H.fillPanel.onColorChanged=H.setFillColor,H.opacityPanel=new ie("Opacity",Q.defaultOpacitySteps,H.opacity),H.opacityPanel.onOpacityChanged=H.setOpacity,H}return we(s,G),s.prototype.setOpacity=function(f){this.opacity=f,this.visual&&le.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var f=G.prototype.getState.call(this);return f.typeName=s.typeName,f},s.typeName="HighlightMarker",s.title="Highlight marker",s.icon='',s}(re),pe='',be=function(G){function s(f,N,Q){var H=G.call(this,f,N,Q)||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=Q.defaultStrokeColor,H.bgColor=Q.defaultFillColor,H.fontFamily=Q.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 Ue("Text color",Q.defaultColorSet,H.color,''),H.colorPanel.onColorChanged=H.setColor,H.bgColorPanel=new Ue("Fill color",Q.defaultColorSet,H.bgColor,pe),H.bgColorPanel.onColorChanged=H.setBgColor,H.fontFamilyPanel=new Fe("Font",Q.defaultFontFamilies,Q.defaultFontFamily),H.fontFamilyPanel.onFontChanged=H.setFont,H.tipGrip=new Ke,H.tipGrip.visual.transform.baseVal.appendItem(le.createTransform()),H.controlBox.appendChild(H.tipGrip.visual),H}return we(s,G),s.prototype.ownsTarget=function(f){return G.prototype.ownsTarget.call(this,f)||this.tipGrip.ownsTarget(f)||this.tip===f},s.prototype.createTip=function(){le.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=le.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},s.prototype.pointerDown=function(f,N){this.state==="new"&&G.prototype.pointerDown.call(this,f,N),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(N)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):G.prototype.pointerDown.call(this,f,N)},s.prototype.pointerUp=function(f){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,G.prototype.pointerUp.call(this,f);else{var N=this.state==="creating";G.prototype.pointerUp.call(this,f),this.setTipPoints(N),this.positionTip()}},s.prototype.manipulate=function(f){if(this.tipMoving){var N=this.unrotatePoint(f);this.tipPosition={x:N.x-this.manipulationStartLeft,y:N.y-this.manipulationStartTop},this.positionTip()}else G.prototype.manipulate.call(this,f)},s.prototype.setBgColor=function(f){this.bgRectangle&&this.tip&&(le.setAttributes(this.bgRectangle,[["fill",f]]),le.setAttributes(this.tip,[["fill",f]])),this.bgColor=f,this.fillColorChanged(f)},s.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},s.prototype.setTipPoints=function(f){f===void 0&&(f=!1);var N=Math.min(this.height/2,15),Q=this.height/5;f&&(this.tipPosition={x:N+Q/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',s}(Ve),_e=function(G){function s(f,N,Q){var H=G.call(this,f,N,Q)||this;return H.fillColor="transparent",H.strokeColor="transparent",H.strokeWidth=0,H.strokeDasharray="",H.opacity=1,H.strokeColor=Q.defaultColor,H.strokeWidth=Q.defaultStrokeWidth,H.strokeDasharray=Q.defaultStrokeDasharray,H.fillColor=Q.defaultFillColor,H.setStrokeColor=H.setStrokeColor.bind(H),H.setFillColor=H.setFillColor.bind(H),H.setStrokeWidth=H.setStrokeWidth.bind(H),H.setStrokeDasharray=H.setStrokeDasharray.bind(H),H.setOpacity=H.setOpacity.bind(H),H.createVisual=H.createVisual.bind(H),H.strokePanel=new Ue("Line color",ge(Q.defaultColorSet,["transparent"]),Q.defaultColor),H.strokePanel.onColorChanged=H.setStrokeColor,H.fillPanel=new Ue("Fill color",ge(Q.defaultColorSet,["transparent"]),H.fillColor,pe),H.fillPanel.onColorChanged=H.setFillColor,H.strokeWidthPanel=new lt("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),H.strokeWidthPanel.onWidthChanged=H.setStrokeWidth,H.strokeStylePanel=new tt("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),H.strokeStylePanel.onStyleChanged=H.setStrokeDasharray,H.opacityPanel=new ie("Opacity",Q.defaultOpacitySteps,H.opacity),H.opacityPanel.onOpacityChanged=H.setOpacity,H}return we(s,G),s.prototype.ownsTarget=function(f){return!(!G.prototype.ownsTarget.call(this,f)&&f!==this.visual)},s.prototype.createVisual=function(){this.visual=le.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},s.prototype.pointerDown=function(f,N){G.prototype.pointerDown.call(this,f,N),this.state==="new"&&(this.createVisual(),this.moveVisual(f),this._state="creating")},s.prototype.manipulate=function(f){G.prototype.manipulate.call(this,f)},s.prototype.resize=function(f){G.prototype.resize.call(this,f),this.setSize()},s.prototype.setSize=function(){G.prototype.setSize.call(this),le.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},s.prototype.pointerUp=function(f){G.prototype.pointerUp.call(this,f),this.setSize()},s.prototype.setStrokeColor=function(f){this.strokeColor=f,this.visual&&le.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(f),this.stateChanged()},s.prototype.setFillColor=function(f){this.fillColor=f,this.visual&&le.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(f),this.stateChanged()},s.prototype.setStrokeWidth=function(f){this.strokeWidth=f,this.visual&&le.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},s.prototype.setStrokeDasharray=function(f){this.strokeDasharray=f,this.visual&&le.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},s.prototype.setOpacity=function(f){this.opacity=f,this.visual&&le.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var f=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},G.prototype.getState.call(this));return f.typeName=s.typeName,f},s.prototype.restoreState=function(f){var N=f;this.fillColor=N.fillColor,this.strokeColor=N.strokeColor,this.strokeWidth=N.strokeWidth,this.strokeDasharray=N.strokeDasharray,this.opacity=N.opacity,this.createVisual(),G.prototype.restoreState.call(this,f),this.setSize()},s.prototype.scale=function(f,N){G.prototype.scale.call(this,f,N),this.setSize()},s.typeName="EllipseMarker",s.title="Ellipse marker",s.icon='',s}($e),He=function(G){function s(f,N,Q){return G.call(this,f,N,Q)||this}return we(s,G),Object.defineProperty(s.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),s.prototype.ownsTarget=function(f){return!(!G.prototype.ownsTarget.call(this,f)&&f!==this.tip1&&f!==this.tip2)},s.prototype.createTips=function(){this.tip1=le.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(le.createTransform()),this.visual.appendChild(this.tip1),this.tip2=le.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(le.createTransform()),this.visual.appendChild(this.tip2)},s.prototype.pointerDown=function(f,N){G.prototype.pointerDown.call(this,f,N),this.state==="creating"&&this.createTips()},s.prototype.adjustVisual=function(){if(G.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(le.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),le.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var f=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),N=this.tip1.transform.baseVal.getItem(0);N.setRotate(f,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(N,0);var Q=this.tip2.transform.baseVal.getItem(0);Q.setRotate(f+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(Q,0)}},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var f=G.prototype.getState.call(this);return f.typeName=s.typeName,f},s.prototype.restoreState=function(f){G.prototype.restoreState.call(this,f),this.createTips(),this.adjustVisual()},s.typeName="MeasurementMarker",s.title="Measurement marker",s.icon='',s}(at),nt=function(G){function s(f,N,Q){var H=G.call(this,f,N,Q)||this;return H.strokePanel.colors=Q.defaultColorSet,H.fillColor="transparent",H}return we(s,G),Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var f=G.prototype.getState.call(this);return f.typeName=s.typeName,f},s.typeName="EllipseFrameMarker",s.title="Ellipse frame marker",s.icon='',s}(_e),mt=function(){function G(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(G.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),G.prototype.addUndoStep=function(s){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(s)||(this.undoStack.push(s),JSON.stringify(this.lastRedoStep)!==JSON.stringify(s)&&this.redoStack.splice(0,this.redoStack.length))},G.prototype.replaceLastUndoStep=function(s){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=s)},G.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},G.prototype.undo=function(){if(this.undoStack.length>1){var s=this.undoStack.pop();return s!==void 0&&this.redoStack.push(s),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},G.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},G}(),ft=function(G){function s(f,N,Q){var H=G.call(this,f,N,Q)||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=Q.defaultColor,H.strokeWidth=Q.defaultStrokeWidth,H.strokeDasharray=Q.defaultStrokeDasharray,H.strokePanel=new Ue("Line color",Q.defaultColorSet,Q.defaultColor),H.strokePanel.onColorChanged=H.setStrokeColor,H.strokeWidthPanel=new lt("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),H.strokeWidthPanel.onWidthChanged=H.setStrokeWidth,H.strokeStylePanel=new tt("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),H.strokeStylePanel.onStyleChanged=H.setStrokeDasharray,H}return we(s,G),s.prototype.ownsTarget=function(f){return!(!G.prototype.ownsTarget.call(this,f)&&f!==this.visual&&f!==this.selectorCurve&&f!==this.visibleCurve&&!this.curveGrip.ownsTarget(f))},s.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},s.prototype.createVisual=function(){this.visual=le.createGroup(),this.selectorCurve=le.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=le.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)},s.prototype.pointerDown=function(f,N){G.prototype.pointerDown.call(this,f,N),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=f.x,this.curveY=f.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(N)&&(this.activeGrip=this.curveGrip,this._state="resize")},s.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),le.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),le.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),le.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},s.prototype.setupControlBox=function(){G.prototype.setupControlBox.call(this),this.curveControlLine1=le.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=le.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)},s.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,G.prototype.addControlGrips.call(this)},s.prototype.positionGrips=function(){G.prototype.positionGrips.call(this);var f=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-f/2,this.curveY-f/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()))},s.prototype.manipulate=function(f){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+f.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+f.y-this.manipulationStartY),G.prototype.manipulate.call(this,f)},s.prototype.resize=function(f){this.activeGrip===this.curveGrip&&(this.curveX=f.x,this.curveY=f.y),G.prototype.resize.call(this,f),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},s.prototype.setStrokeColor=function(f){this.strokeColor=f,this.adjustVisual(),this.colorChanged(f)},s.prototype.setStrokeWidth=function(f){this.strokeWidth=f,this.adjustVisual()},s.prototype.setStrokeDasharray=function(f){this.strokeDasharray=f,this.adjustVisual()},s.prototype.scale=function(f,N){this.curveX=this.curveX*f,this.curveY=this.curveY*N,G.prototype.scale.call(this,f,N)},Object.defineProperty(s.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),s.prototype.getState=function(){var f=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},G.prototype.getState.call(this));return f.typeName=s.typeName,f},s.prototype.restoreState=function(f){G.prototype.restoreState.call(this,f);var N=f;this.strokeColor=N.strokeColor,this.strokeWidth=N.strokeWidth,this.strokeDasharray=N.strokeDasharray,this.curveX=N.curveX,this.curveY=N.curveY,this.createVisual(),this.adjustVisual()},s.typeName="CurveMarker",s.title="Curve marker",s.icon='',s}(ht),wt=function(){function G(s,f){f===void 0&&(f=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=s,this.cancelable=f}return Object.defineProperty(G.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),G.prototype.preventDefault=function(){this._defaultPrevented=!0},G}(),Tt=function(G){function s(f,N,Q){var H=G.call(this,f,!1)||this;return H.dataUrl=N,H.state=Q,H}return we(s,G),s}(wt),ut=function(G){function s(f,N,Q){Q===void 0&&(Q=!1);var H=G.call(this,f,Q)||this;return H.marker=N,H}return we(s,G),s}(wt),Bt=function(){function G(){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 G.prototype.addEventListener=function(s,f){this[s].push(f)},G.prototype.removeEventListener=function(s,f){var N=this[s].indexOf(f);N>-1&&this[s].splice(N,1)},G}(),_t=function(){function G(s){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Pe,this._isOpen=!1,this.undoRedoManager=new mt,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 Bt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=G.instanceCounter++,this.styles=new Le(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=s,this.targetRoot=document.body,this.width=s.clientWidth,this.height=s.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(G.prototype,"ALL_MARKER_TYPES",{get:function(){return[rt,xe,ye,Ve,nt,_e,ue,be,He,re,at,ft]},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[rt,xe,ye,Ve,_e,ue,be]},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"BASIC_MARKER_TYPES",{get:function(){return[rt,xe,ye,Ve,ue]},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(s){var f=this;this._availableMarkerTypes.splice(0),s.forEach(function(N){if(typeof N=="string"){var Q=f.ALL_MARKER_TYPES.find(function(H){return H.typeName===N});Q!==void 0&&f._availableMarkerTypes.push(Q)}else f._availableMarkerTypes.push(N)})},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(s){this._zoomLevel=s,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(G.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),G.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),te.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},G.prototype.show=function(){var s=this;this.styles.styleSheetRoot===void 0&&ne.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ne.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(f){return f(new wt(s))})},G.prototype.render=function(){return Ce(this,void 0,void 0,function(){var s;return Te(this,function(f){switch(f.label){case 0:return this.setCurrentMarker(),(s=new ce).naturalSize=this.renderAtNaturalSize,s.imageType=this.renderImageType,s.imageQuality=this.renderImageQuality,s.markersOnly=this.renderMarkersOnly,s.width=this.renderWidth,s.height=this.renderHeight,[4,s.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return f.sent(),[4,s.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,f.sent()]}})})},G.prototype.close=function(s){var f=this;if(s===void 0&&(s=!1),this.isOpen){var N=!1;s||this.eventListeners.beforeclose.forEach(function(Q){var H=new wt(f,!0);Q(H),H.defaultPrevented&&(N=!0)}),N||(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(Q){return Q(new wt(f))}),this.detachEvents(),this._isOpen=!1)}},G.prototype.addMarkersToToolbar=function(){for(var s,f=[],N=0;Nthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*s:this.editorCanvas.clientWidth,N=f',s.title="Powered by marker.js",s.style.display="grid",s.style.alignItems="center",s.style.justifyItems="center",s.style.padding="3px",s.style.width="20px",s.style.height="20px",this.logoUI.appendChild(s),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},G.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")},G.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"},G.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},G.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 s=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=s+"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 Re(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(s),1),s.dispose()},G.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())},G.prototype.toolbarButtonClicked=function(s,f){if(s==="marker"&&f!==void 0)this.createNewMarker(f);else if(s==="action")switch(f){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()}},G.prototype.deleteSelectedMarker=function(){var s=this;if(this._currentMarker!==void 0){var f=!1;if(this.eventListeners.markerbeforedelete.forEach(function(Q){var H=new ut(s,s._currentMarker,!0);Q(H),H.defaultPrevented&&(f=!0)}),!f){var N=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(Q){return Q(new ut(s,N))})}}},G.prototype.clear=function(){var s=this,f=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(me){var We=new ut(s,void 0,!0);me(We),We.defaultPrevented&&(f=!0)}),!f)){this.setCurrentMarker();for(var N=function(me){var We=Q.markers[me];Q.setCurrentMarker(Q.markers[me]),Q._currentMarker.dispose(),Q.markerImage.removeChild(Q._currentMarker.container),Q.markers.splice(Q.markers.indexOf(Q._currentMarker),1),Q.eventListeners.markerdelete.forEach(function(Je){return Je(new ut(s,We))})},Q=this,H=this.markers.length-1;H>=0;H--)N(H);this.addUndoStep()}},Object.defineProperty(G.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),G.prototype.showNotesEditor=function(){var s;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=(s=this._currentMarker.notes)!==null&&s!==void 0?s:"",this.overlayContainer.appendChild(this.notesArea))},G.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)},G.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},G.prototype.addUndoStep=function(){var s=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var f=this.getState(),N=this.undoRedoManager.getLastUndoStep();if(!N||N.width===f.width&&N.height===f.height){var Q=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(f),Q1&&this.panTo({x:s.clientX,y:s.clientY}))},G.prototype.onPointerUp=function(s){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(s.clientX,s.clientY)),this.isDragging=!1,this.addUndoStep()},G.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},G.prototype.onKeyUp=function(s){this._currentMarker===void 0||this.notesArea!==void 0||s.key!=="Delete"&&s.key!=="Backspace"||this.deleteSelectedMarker()},G.prototype.clientToLocalCoordinates=function(s,f){var N=this.markerImage.getBoundingClientRect();return{x:(s-N.left)/this.zoomLevel,y:(f-N.top)/this.zoomLevel}},G.prototype.onWindowResize=function(){this.positionUI()},G.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var s=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=s+"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()},G.prototype.addLicenseKey=function(s){te.addKey(s)},G.prototype.addEventListener=function(s,f){this.eventListeners.addEventListener(s,f)},G.prototype.removeEventListener=function(s,f){this.eventListeners.removeEventListener(s,f)},G.prototype.renderState=function(s){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(s),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(G.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),G.prototype.focus=function(){var s=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(f){return f(new wt(s))}))},G.prototype.blur=function(){var s=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(f){return f(new wt(s))}))},G.instanceCounter=0,G}();/* **********************************
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 Zt=function(G,s){return(Zt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,N){f.__proto__=N}||function(f,N){for(var Q in N)Object.prototype.hasOwnProperty.call(N,Q)&&(f[Q]=N[Q])})(G,s)};function Xt(G,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function f(){this.constructor=G}Zt(G,s),G.prototype=s===null?Object.create(s):(f.prototype=s.prototype,new f)}function Ot(G,s,f,N){return new(f||(f=Promise))(function(Q,H){function me(ct){try{Je(N.next(ct))}catch(Ge){H(Ge)}}function We(ct){try{Je(N.throw(ct))}catch(Ge){H(Ge)}}function Je(ct){var Ge;ct.done?Q(ct.value):(Ge=ct.value,Ge instanceof f?Ge:new f(function(vt){vt(Ge)})).then(me,We)}Je((N=N.apply(G,s||[])).next())})}function Ir(G,s){var f,N,Q,H,me={label:0,sent:function(){if(1&Q[0])throw Q[1];return Q[1]},trys:[],ops:[]};return H={next:We(0),throw:We(1),return:We(2)},typeof Symbol=="function"&&(H[Symbol.iterator]=function(){return this}),H;function We(Je){return function(ct){return function(Ge){if(f)throw new TypeError("Generator is already executing.");for(;me;)try{if(f=1,N&&(Q=2&Ge[0]?N.return:Ge[0]?N.throw||((Q=N.return)&&Q.call(N),0):N.next)&&!(Q=Q.call(N,Ge[1])).done)return Q;switch(N=0,Q&&(Ge=[2&Ge[0],Q.value]),Ge[0]){case 0:case 1:Q=Ge;break;case 4:return me.label++,{value:Ge[1],done:!1};case 5:me.label++,N=Ge[1],Ge=[0];continue;case 7:Ge=me.ops.pop(),me.trys.pop();continue;default:if(!(Q=me.trys,(Q=Q.length>0&&Q[Q.length-1])||Ge[0]!==6&&Ge[0]!==2)){me=0;continue}if(Ge[0]===3&&(!Q||Ge[1]>Q[0]&&Ge[1]0&&f>0){var N=new Hr(s,f),Q=N.ratio>=1?20:N.getHorizontalLength(20),H=N.ratio<1?20:N.getVerticalLength(20),me=document.createElementNS("http://www.w3.org/2000/svg","svg");me.setAttribute("xmlns","http://www.w3.org/2000/svg"),me.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(me);var We=bt.createDefs();me.appendChild(We);var Je=bt.createElement("clipPath",[["id","text-bg-clip"]]);We.appendChild(Je);var ct=bt.createPath(bt.getHollowRectanglePath((24-Q)/2,(24-H)/2,Q,H,(24-Q)/2+2,(24-H)/2+2,Q-4,H-4));me.appendChild(ct);var Ge=bt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ge.appendChild(bt.createTSpan(s+":"+f)),me.appendChild(Ge);var vt=Ge.getBBox();bt.setAttributes(Ge,[["x",((24-vt.width)/2).toString()],["y",((24-vt.height)/2-vt.y).toString()]]);var Nt=bt.createPath(bt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(vt.width))/2,(24-Math.ceil(vt.height))/2,Math.ceil(vt.width),Math.ceil(vt.height)));return Je.appendChild(Nt),bt.setAttributes(ct,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(me),me.outerHTML}return''},G}(),mr=function(G){function s(f,N,Q){var H=G.call(this,f,N)||this;return H.isDropdownOpen=!1,H.onClick=H.dropdownButtonClicked,H.dropdownButtons=Q,H}return Xt(s,G),s.prototype.setupDropdown=function(){var f=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(N){N.className=f.className,N.colorsClassName=f.colorsClassName,f.dropdownBlock.appendChild(N.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},s.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},s.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},s.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},s.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},s.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},s}(It),kt=function(){function G(s,f){this.GRIP_SIZE=10,this.color=s,this.fillColor=f,this.visual=bt.createGroup(),this.visual.appendChild(bt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(bt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return G.prototype.ownsTarget=function(s){return s===this.visual||s===this.visual.childNodes[0]||s===this.visual.childNodes[1]},G.prototype.setCenter=function(s,f){this.visual.childNodes.forEach(function(N){return bt.setAttributes(N,[["cx",s.toString()],["cy",f.toString()]])})},G}(),Br=function(){function G(s,f,N,Q){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=s,this.canvasHeight=f,this.margin=N,this.container=Q,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(G.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(s){this._aspectRatio=s,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(s){this._isGridVisible=s,this.gridContainer&&bt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(s){this._zoomFactor=s,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),G.prototype.open=function(){var s=this;this.cropShadeElement=bt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=bt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var f=0;fthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-f.height/2),bt.setAttributes(this.cropRectElement,[["x",f.x.toString()],["y",f.y.toString()],["width",f.width.toString()],["height",f.height.toString()]]);var N=f.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(H,me){var We=f.y+N*(me+1);bt.setAttributes(H,[["x1",""+f.x],["y1",""+We],["x2",""+(f.x+f.width)],["y2",""+We]])});var Q=f.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(H,me){var We=f.x+Q*(me+1);bt.setAttributes(H,[["x1",""+We],["y1",""+f.y],["x2",""+We],["y2",""+(f.y+f.height)]])}),bt.setAttributes(this.cropShadeElement,[["d",bt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,f.x,f.y,f.width,f.height)]]),this.topLeftGrip.setCenter(f.x,f.y),this.topRightGrip.setCenter(f.x+f.width,f.y),this.bottomLeftGrip.setCenter(f.x,f.y+f.height),this.bottomRightGrip.setCenter(f.x+f.width,f.y+f.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},G.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)},G.prototype.clientToLocalCoordinates=function(s,f){var N=this.container.getBoundingClientRect();return{x:s-N.left+this.margin,y:f-N.top+this.margin}},G.prototype.onPointerDown=function(s){this.container.setPointerCapture(s.pointerId),this.previousPoint=this.clientToLocalCoordinates(s.clientX,s.clientY),this.cropRectElement===s.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(s.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(s.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(s.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(s.target)&&(this.activeGrip=this.bottomRightGrip)},G.prototype.onPointerMove=function(s){if(this.isMoving)this.move(this.clientToLocalCoordinates(s.clientX,s.clientY));else if(this.activeGrip){var f=this.clientToLocalCoordinates(s.clientX,s.clientY);this.resize(f)}s.preventDefault()},G.prototype.onPointerUp=function(s){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(s.pointerId)},G.prototype.move=function(s){var f=s.x-this.previousPoint.x,N=s.y-this.previousPoint.y;this.zoomFactor!==1&&(f=-f/this.zoomFactor,N=-N/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+f),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+N),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=s},G.prototype.resize=function(s){var f=Object.assign({},this.cropRect),N=s.x-this.previousPoint.x,Q=s.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:f.x+Nthis.canvasWidth*this.zoomFactor&&(N=this.canvasWidth*this.zoomFactor-f.width),f.width+=N}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(f.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(N),f.height=this.aspectRatio.getVerticalLength(f.width)):(f.y+=Q,f.height=this.cropRect.y+this.cropRect.height-f.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?f.height=this.aspectRatio.getVerticalLength(f.width):f.height+=Q}f.width<10&&(f.x=this.cropRect.x,f.width=10),f.height<10&&(f.y=this.cropRect.y,f.height=10),this.previousPoint=s,f.x>=this.margin&&f.y>=this.margin&&f.x-this.margin+f.width<=this.canvasWidth&&f.y-this.margin+f.height<=this.canvasHeight&&(this.cropRect=f,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},G.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var s=this.cropRect.x+this.cropRect.width/2,f=this.cropRect.y+this.cropRect.height/2,N=this.aspectRatio.getHorizontalLength(this.cropRect.height),Q=this.aspectRatio.getVerticalLength(this.cropRect.width);N/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=s-this.cropRect.width/2,this.cropRect.y=f-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)}},G.prototype.getRescaledRect=function(s,f,N,Q,H,me){var We=N/s,Je=Q/f;return{x:(H.x-me)*We+me,y:(H.y-me)*Je+me,width:H.width*We,height:H.height*Je}},G.prototype.scaleCanvas=function(s,f){var N=this.getRescaledRect(this.canvasWidth,this.canvasHeight,s,f,this.cropRect,this.margin);this.canvasWidth=s,this.canvasHeight=f,this.onCropChange&&this.onCropChange(N),this.setCropRectangle(N)},G}(),Vr=function(){function G(s){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=s,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(G.prototype,"angle",{get:function(){return this._angle},set:function(s){this._angle=s,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),G.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},G.prototype.onPointerDown=function(s){this.controlContainer.setPointerCapture(s.pointerId),this.isDragging=!0,this.previousPoint={x:s.clientX,y:s.clientY}},G.prototype.onPointerMove=function(s){this.isDragging&&(this.onAngleChange&&this.onAngleChange((s.clientX-this.previousPoint.x)/5),this.previousPoint.x=s.clientX)},G.prototype.onPointerUp=function(s){this.isDragging&&this.onAngleChange&&this.onAngleChange((s.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(s.pointerId)},G.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var s=this.angleLabelText.getBBox();bt.setAttributes(this.angleLabelElement,[["x",((this.width-s.width)/2).toString()],["y",(this.height/2).toString()]])}},G.prototype.positionScaleShape=function(){if(this.scaleShape){var s=this.scaleShape.transform.baseVal.getItem(0);s.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(s,0)}},G.prototype.getVisual=function(){var s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("xmlns","http://www.w3.org/2000/svg"),s.setAttribute("width",this.width+"px"),s.setAttribute("height",this.height+"px"),s.setAttribute("viewBox","0 0 "+this.width+" "+this.height),s.style.flexShrink="0",document.body.appendChild(s);for(var f="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,N=1;N<=this.width/5+10;N++){var Q=N%5==0?this.height/3:this.height/6;f+="h4v"+-Q+"h1v"+Q}f+="v1H0Z",this.scaleShape=bt.createPath(f);var H=bt.createTransform();this.scaleShape.transform.baseVal.appendItem(H),s.appendChild(this.scaleShape),this.angleLabelElement=bt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=bt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var me=bt.createTSpan("");return me.innerHTML="°",this.angleLabelElement.appendChild(me),s.appendChild(this.angleLabelElement),document.body.removeChild(s),s},G}(),fi=function(){function G(){this.naturalSize=!1,this.imageType="image/png"}return G.prototype.rasterize=function(s,f,N,Q,H,me,We){var Je=this;return new Promise(function(ct){var Ge=document.createElement("canvas");Ge.width=s.width.baseVal.value-2*Q,Ge.height=s.height.baseVal.value-2*Q;var vt=1,Nt=1;Je.naturalSize===!0?(vt=f.naturalWidth/(s.width.baseVal.value-2*Q)/me,Nt=f.naturalHeight/(s.height.baseVal.value-2*Q)/We,Ge.width=f.naturalWidth/me,Ge.height=f.naturalHeight/We):Je.width!==void 0&&Je.height!==void 0&&(vt=Je.width/N.width,Nt=Je.height/N.height,Ge.width*=vt,Ge.height*=Nt);var Kt=Ge.getContext("2d");Kt.translate(Ge.width/2,Ge.height/2),Kt.rotate(H*Math.PI/180),Kt.scale(me,We),Kt.translate(-Ge.width/2,-Ge.height/2),Kt.drawImage(f,0,0,Ge.width,Ge.height);var Or=document.createElement("canvas");Or.width=N.width*vt,Or.height=N.height*Nt,Or.getContext("2d").putImageData(Kt.getImageData((N.x-Q)*vt,(N.y-Q)*Nt,N.width*vt,N.height*Nt),0,0),ct(Or.toDataURL(Je.imageType,Je.imageQuality))})},G}(),Xe=function(){function G(s){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=G.instanceCounter++,this.styles=new Nr(this.instanceNo),this.target=s,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(G.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(s){this._zoomToCropEnabled=s,s?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(s){this._isGridVisible=s,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"gridLines",{get:function(){return this._gridLines},set:function(s){this._gridLines=s,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(s){this._rotationAngle=s,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"aspectRatio",{get:function(){var s;return(s=this._aspectRatio)!==null&&s!==void 0?s:this.aspectRatios[0]},set:function(s){this._aspectRatio=s},enumerable:!1,configurable:!0}),G.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},G.prototype.show=function(){this.showUI(),this.open()},G.prototype.close=function(s){s===void 0&&(s=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),s||this.closeEventListeners.forEach(function(f){return f()}),this._isOpen=!1)},G.prototype.addRenderEventListener=function(s){this.renderEventListeners.push(s)},G.prototype.removeRenderEventListener=function(s){this.renderEventListeners.indexOf(s)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(s),1)},G.prototype.addCloseEventListener=function(s){this.closeEventListeners.push(s)},G.prototype.removeCloseEventListener=function(s){this.closeEventListeners.indexOf(s)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(s),1)},G.prototype.setupResizeObserver=function(){var s=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){s.resize(s.target.clientWidth,s.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))},G.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var s=1*this.target.clientWidth/this.target.clientHeight,f=this.contentDiv.clientWidth/s>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*s:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,N=f+2*this.CANVAS_MARGINs+this.CANVAS_MARGIN?this.target.offsetTop-(s+this.CANVAS_MARGIN):0;this.coverDiv.style.top=f+"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},G.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},G.prototype.addTopToolbar=function(){var s=this;this.topToolbar=new Fr,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 f=new qr;f.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(f);var N=[];this.aspectRatios.forEach(function(Nt){var Kt=new It(ei.getIcon(Nt.horizontal,Nt.vertical),Nt.horizontal===0&&Nt.vertical===0?"FREE":Nt.horizontal+":"+Nt.vertical);Kt.onClick=function(){return s.ratioButtonClicked(Nt)},N.push(Kt)}),this.aspectRatioButton=new mr(ei.getIcon(0,0),"Aspect ratio",N),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,f.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var Q=new It('',"Toggle grid");Q.isActive=this.isGridVisible,Q.onClick=function(){s.isGridVisible=!s.isGridVisible,Q.isActive=s.isGridVisible},f.addButton(Q);var H=new It('',"Zoom to selection");if(H.isActive=this.zoomToCropEnabled,H.onClick=function(){s.zoomToCropEnabled=!s.zoomToCropEnabled,H.isActive=s.zoomToCropEnabled},f.addButton(H),!Kr.isLicensed){var me=new dt;this.topToolbar.addElementBlock(me);var We=document.createElement("div");We.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Je=document.createElement("a");Je.style.color="currentColor",Je.href="https://markerjs.com/products/cropro",Je.target="_blank",Je.innerHTML='',We.appendChild(Je),me.addElement(We)}var ct=new qr;ct.minWidth=3*this.toolbarHeight+"px",ct.contentAlign="end",this.topToolbar.addButtonBlock(ct);var Ge=new It('',"OK");Ge.onClick=this.startRenderAndClose,ct.addButton(Ge),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ge.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var vt=new It('',"Close");vt.onClick=this.close,ct.addButton(vt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(vt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},G.prototype.addBottomToolbar=function(){var s=this;this.bottomToolbar=new Fr,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 f=new qr;f.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(f);var N=new It('',"Rotate left");N.onClick=this.rotateLeftButtonClicked,f.addButton(N);var Q=new It('',"Rotate right");Q.onClick=this.rotateRightButtonClicked,f.addButton(Q);var H=new dt;H.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(H),this.straightener=new Vr("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(ct){s.rotateBy(ct),s.straightener.angle=s.rotationAngle},H.addElement(this.straightener.getUI());var me=new qr;me.minWidth=2*this.toolbarHeight+"px",me.contentAlign="end",this.bottomToolbar.addButtonBlock(me);var We=new It('',"Flip horizontal");We.onClick=this.flipHorizontallyButtonClicked,me.addButton(We);var Je=new It('',"Flip vertical");Je.onClick=this.flipVerticallyButtonClicked,me.addButton(Je)},G.prototype.ratioButtonClicked=function(s){this.aspectRatio=s,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},G.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ei.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},G.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Hr(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},G.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},G.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},G.prototype.restoreState=function(s){if(s){var f=this.cropLayer.getRescaledRect(s.width,s.height,this.imageWidth,this.imageHeight,s.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(f),this.cropRectChanged(f),this.flippedHorizontally=s.flippedHorizontally,this.flippedVertically=s.flippedVertically,this.applyFlip(),this.rotationAngle=s.rotationAngle,this.applyRotation()}},G.prototype.clientToLocalCoordinates=function(s,f){var N=this.cropImage.getBoundingClientRect();return{x:s-N.left,y:f-N.top}},G.prototype.onWindowResize=function(){this.positionUI()},G.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var s=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=s+"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()},G.prototype.rotateLeftButtonClicked=function(){var s=this.rotationAngle-90;this.rotationAngle%90!=0&&(s+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(s)},G.prototype.rotateRightButtonClicked=function(){var s=this.rotationAngle+90;this.rotationAngle%90!=0&&(s-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(s)},G.prototype.rotateTo=function(s){s=(s=s>180?s-360:s)<=-180?s+360:s,this.rotationAngle=s,this.applyRotation()},G.prototype.rotateBy=function(s){this.rotateTo((this.rotationAngle+s)%360)},G.prototype.applyRotation=function(){var s=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var f=this.editingTargetRotationContainer.transform.baseVal.getItem(0);f.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(f,0);var N=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/N.width,this.imageHeight/N.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=s},G.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},G.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},G.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},G.prototype.startRenderAndClose=function(){return Ot(this,void 0,void 0,function(){var s,f;return Ir(this,function(N){switch(N.label){case 0:return[4,this.render()];case 1:return s=N.sent(),f=this.getState(),this.renderEventListeners.forEach(function(Q){return Q(s,f)}),this.close(!0),[2]}})})},G.prototype.render=function(){return Ot(this,void 0,void 0,function(){var s;return Ir(this,function(f){switch(f.label){case 0:return(s=new fi).naturalSize=this.renderAtNaturalSize,s.imageType=this.renderImageType,s.imageQuality=this.renderImageQuality,s.width=this.renderWidth,s.height=this.renderHeight,this.unzoomFromCrop(),bt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,s.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 f.sent(),[4,s.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,f.sent()]}})})},G.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new pr("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 pr("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new pr("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var s=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new pr("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*s)+`px;
height: `+(this.toolbarHeight-2*s)+`px;
padding: `+s+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new pr("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new pr("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new hr("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new hr("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new pr("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 pr("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new pr("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 pr("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*s)+`px;
padding: `+s+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new pr("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},G.instanceCounter=0,G}(),St=se("8hTe"),pi=se.n(St),mi=/]*>/g;function gi(G){var s=document.createElement("div");return s.innerHTML=G,s.childNodes.length===0?"":s.childNodes[0].nodeValue}var vi=it.a=function(G){var s=G.value,f=s===void 0?"":s,N=G.edit,Q=N===void 0?!1:N,H=G.className,me=G.showTextOnly,We=G.showLines,Je=G.replaces,ct=G.zoomImg,Ge=G.hasMask,vt=G.style,Nt=vt===void 0?{}:vt,Kt=G.stylesPrev,Or=Kt===void 0?{}:Kt,gr=String(f),vr=Object(R.useRef)(),Xr=Object(R.useRef)(),Oi=Object(R.useState)(""),nr=Object(z.a)(Oi,2),Ur=nr[0],oi=nr[1],si=Object(R.useState)("office"),_r=Object(z.a)(si,2),_i=_r[0],yi=_r[1],zi=function(){var Ft=new Xe(Xr.current);Ft.displayMode="popup",Ft.addRenderEventListener(function(){var dr=Object(M.a)(P.a.mark(function Dt(qt){var Wt;return P.a.wrap(function(ar){for(;;)switch(ar.prev=ar.next){case 0:return vr.current.style.display="none",ar.next=3,Object(De.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:qt}});case 3:Wt=ar.sent,Wt!=null&&Wt.id&&Je(Xr.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(Wt==null?void 0:Wt.id,"?type=").concat(Wt.content_type));case 5:case"end":return ar.stop()}},Dt)}));return function(Dt){return dr.apply(this,arguments)}}()),Ft.show()},Ki=function(){var Ft=new _t(Xr.current);Ft.settings.displayMode="popup",Ft.addEventListener("render",function(){var dr=Object(M.a)(P.a.mark(function Dt(qt){var Wt;return P.a.wrap(function(ar){for(;;)switch(ar.prev=ar.next){case 0:if(vr.current.style.display="none",!Xr.current){ar.next=6;break}return ar.next=4,Object(De.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:qt.dataUrl}});case 4:Wt=ar.sent,Wt!=null&&Wt.id&&Je(Xr.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(Wt==null?void 0:Wt.id,"?type=").concat(Wt.content_type));case 6:case"end":return ar.stop()}},Dt)}));return function(Dt){return dr.apply(this,arguments)}}()),Ft.show(),window.markerArea=Ft},Yr=Object(R.useMemo)(function(){vr.current&&(vr.current.style.zIndex=-1);try{var Jt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ft=/\"\/api\/attachments\/|\"\/attachments\/download\//g,dr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;gr=gr.replace(Jt,"("+ee.a.API_SERVER+"/api/attachments/").replace(Ft,'"'+ee.a.API_SERVER+"/api/attachments/").replace(dr,'"'+ee.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,`
`)}catch(ti){}var Dt=V(gr),qt=b();if(gr.match(/\[TOC\]/)&&(Dt=Dt.replace("[TOC]
",k()),w()),Dt=Dt.replace(/(__special_katext_id_\d+__)/g,function(ti,ar){var Er=qt[ar],Vi=Er.type,Ei=Er.expression;return Object(ae.renderToString)(gi(Ei)||"",{displayMode:Vi==="block",throwOnError:!1,output:"html"})}),Dt=Dt.replace(/▁/g,"\u2581\u2581\u2581"),m(),me){var Wt=document.createElement("div");return Wt.innerHTML=Dt,Wt.innerText}return setTimeout(function(){return dn()},500),Dt},[gr]),Gr=Object(R.useRef)();v.WebkitLineClamp=We,We&&(Nt=Object(B.a)(Object(B.a)({},Nt),v));function bi(Jt){var Ft=Jt.target;if(Ft.tagName.toUpperCase()==="IMG"){if(ct){var dr=Ft.getAttribute("src");oi(dr),yi("image")}}else if(Ft.tagName.toUpperCase()==="A"){var Dt=Ft.getAttribute("href");if(Dt.indexOf("office")>-1)Jt.preventDefault(),oi(Dt),yi("office");else if(Dt.indexOf("application/pdf")>-1)Jt.preventDefault(),oi(Dt),yi("pdf");else if(Dt.indexOf("text/html")>-1)Jt.preventDefault(),oi(Dt),yi("html");else if(Dt.startsWith("#")){Jt.preventDefault();var qt=document.getElementById(Dt.replace("#",""));qt&&qt.scrollIntoView(!0)}}}var dn=function(){var Ft,dr=(Ft=Gr.current)===null||Ft===void 0?void 0:Ft.querySelectorAll("video");dr==null||dr.forEach(function(Dt){if(Dt.oncontextmenu=function(){return!1},Dt.src.indexOf(".m3u8")>-1&&!Dt.canPlayType("application/vnd.apple.mpegurl")){if(Y.a.isSupported()){var qt=new Y.a;qt.loadSource(Dt.src),qt.attachMedia(Dt)}}})};Object(R.useEffect)(function(){if(Gr.current&&Yr&&(Yr.match(mi)&&window.PR.prettyPrint()),Gr.current)return Gr.current.addEventListener("click",bi),function(){Gr.current.removeEventListener("click",bi),m(),w()}},[Yr,Gr.current,bi]);var xi=function(Ft){if(!Q)return;Ft.target.nodeName==="IMG"?(vr.current.style.zIndex=1,vr.current.style.display="flex",vr.current.style.width=Ft.target.clientWidth+"px",vr.current.style.height=Ft.target.clientHeight+"px",vr.current.style.top=Ft.target.offsetTop+"px",vr.current.style.left=Ft.target.offsetLeft+"px",Xr.current.src=Ft.target.getAttribute("src")):vr.current.style.display="none"};return y.a.createElement("div",{style:{position:"relative"}},y.a.createElement("div",{ref:Gr,style:Object(B.a)({},Nt),className:"".concat(H||""," markdown-body ").concat(pi.a.mdBody),onMouseOver:xi,dangerouslySetInnerHTML:{__html:Yr}}),y.a.createElement("div",{ref:vr,className:pi.a.button},y.a.createElement(Z.a,null,y.a.createElement($.a,{onClick:function(){return zi()}},"\u88C1\u526A"),y.a.createElement($.a,{onClick:function(){return Ki()}},"\u7F16\u8F91"))),y.a.createElement("img",{ref:Xr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),y.a.createElement(de.a,{close:!0,data:Ur,type:Ur!=null&&Ur.length?_i:"",style:Object(B.a)({},Or),onClose:function(){return oi("")}}))}},"9VGf":function(xt,it,se){"use strict";se.d(it,"a",function(){return D});var oe=se("q1tI"),Z=se.n(oe);function D($,B){var M=Object(oe.useRef)();Object(oe.useEffect)(function(){M.current=$}),Object(oe.useEffect)(function(){function z(){M.current()}if(B!==null){var W=setInterval(z,B);return function(){return clearInterval(W)}}},[B])}},Bd2K:function(xt,it,se){(function(oe){oe(se("VrN/"),se("osHv"))})(function(oe){oe.defineOption("autoCloseTags",!1,function(P,R,y){if(y!=oe.Init&&y&&P.removeKeyMap("autoCloseTags"),!R)return;var A={name:"autoCloseTags"};(typeof R!="object"||R.whenClosing!==!1)&&(A["'/'"]=function(O){return M(O)}),(typeof R!="object"||R.whenOpening!==!1)&&(A["'>'"]=function(O){return $(O)}),P.addKeyMap(A)});var Z=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],D=["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 $(P){if(P.getOption("disableInput"))return oe.Pass;for(var R=P.listSelections(),y=[],A=P.getOption("autoCloseTags"),O=0;OL.ch&&(l=l.slice(0,l.length-C.end+L.ch));var g=l.toLowerCase();if(!l||C.type=="string"&&(C.end!=L.ch||!/[\"\']/.test(C.string.charAt(C.string.length-1))||C.string.length==1)||C.type=="tag"&&o.close||C.string.indexOf("/")==L.ch-C.start-1||w&&z(w,g)>-1||W(P,T.mode.xmlCurrentContext&&T.mode.xmlCurrentContext(h)||[],l,L,!0))return oe.Pass;var k=typeof A=="object"&&A.emptyTags;if(k&&z(k,l)>-1){y[O]={text:"/>",newPos:oe.Pos(L.line,L.ch+2)};continue}var E=v&&z(v,g)>-1;y[O]={indent:E,text:">"+(E?`
`:"")+""+l+">",newPos:E?oe.Pos(L.line+1,0):oe.Pos(L.line,L.ch+1)}}for(var p=typeof A=="object"&&A.dontIndentOnAutoClose,O=R.length-1;O>=0;O--){var c=y[O];P.replaceRange(c.text,R[O].head,R[O].anchor,"+insert");var u=P.listSelections().slice(0);u[O]={head:c.newPos,anchor:c.newPos},P.setSelections(u),!p&&c.indent&&(P.indentLine(c.newPos.line,null,!0),P.indentLine(c.newPos.line+1,null,!0))}}function B(P,R){for(var y=P.listSelections(),A=[],O=R?"/":"",L=P.getOption("autoCloseTags"),C=typeof L=="object"&&L.dontIndentOnSlash,T=0;T"&&(w+=">"),A[T]=w}if(P.replaceSelections(A),y=P.listSelections(),!C)for(var T=0;T=0&&R[h]==y;h--)++T;A=C.to;for(var h=1;h0){for(var R=0;R1&&arguments[1]!==void 0?arguments[1]:"",R=[],y=0;yxe.length)&&(ve=xe.length);for(var ye=0,re=new Array(ve);ye=xe.length?{done:!0}:{done:!1,value:xe[re++]}}}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 ye=xe[Symbol.iterator](),ye.next.bind(ye)}function M(xe,ve){return ve={exports:{}},xe(ve,ve.exports),ve.exports}var z=M(function(xe){function ve(){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 ye(re){xe.exports.defaults=re}xe.exports={defaults:ve(),getDefaults:ve,changeDefaults:ye}}),W=z.defaults,P=z.getDefaults,R=z.changeDefaults,y=/[&<>"']/,A=/[&<>"']/g,O=/[<>"']|&(?!#?\w+;)/,L=/[<>"']|&(?!#?\w+;)/g,C={"&":"&","<":"<",">":">",'"':""","'":"'"},T=function(ve){return C[ve]};function h(xe,ve){if(ve){if(y.test(xe))return xe.replace(A,T)}else if(O.test(xe))return xe.replace(L,T);return xe}var o=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function l(xe){return xe.replace(o,function(ve,ye){return ye=ye.toLowerCase(),ye==="colon"?":":ye.charAt(0)==="#"?ye.charAt(1)==="x"?String.fromCharCode(parseInt(ye.substring(2),16)):String.fromCharCode(+ye.substring(1)):""})}var d=/(^|[^\[])\^/g;function w(xe,ve){xe=xe.source||xe,ve=ve||"";var ye={replace:function(ie,ue){return ue=ue.source||ue,ue=ue.replace(d,"$1"),xe=xe.replace(ie,ue),ye},getRegex:function(){return new RegExp(xe,ve)}};return ye}var v=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function k(xe,ve,ye){if(xe){var re;try{re=decodeURIComponent(l(ye)).replace(v,"").toLowerCase()}catch(ie){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}ve&&!g.test(ye)&&(ye=a(ve,ye));try{ye=encodeURI(ye).replace(/%25/g,"%")}catch(ie){return null}return ye}var E={},p=/^[^:]+:\/*[^/]*$/,c=/^([^:]+:)[\s\S]*$/,u=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(xe,ve){E[" "+xe]||(p.test(xe)?E[" "+xe]=xe+"/":E[" "+xe]=F(xe,"/",!0)),xe=E[" "+xe];var ye=xe.indexOf(":")===-1;return ve.substring(0,2)==="//"?ye?ve:xe.replace(c,"$1")+ve:ve.charAt(0)==="/"?ye?ve:xe.replace(u,"$1")+ve:xe+ve}var b={exec:function(){}};function m(xe){for(var ve=1,ye,re;ve=0&&be[He]==="\\";)_e=!_e;return _e?"|":" |"}),re=ye.split(/ \|/),ie=0;if(re.length>ve)re.splice(ve);else for(;re.length=re.length?ie.slice(re.length):ie}).join(`
`)}var Se=function(){function xe(ye){this.options=ye||_}var ve=xe.prototype;return ve.space=function(re){var ie=this.rules.block.newline.exec(re);if(ie)return ie[0].length>1?{type:"space",raw:ie[0]}:{raw:`
`}},ve.code=function(re,ie){var ue=this.rules.block.code.exec(re);if(ue){var pe=ie[ie.length-1];if(pe&&pe.type==="paragraph")return{raw:ue[0],text:ue[0].trimRight()};var be=ue[0].replace(/^ {4}/gm,"");return{type:"code",raw:ue[0],codeBlockStyle:"indented",text:this.options.pedantic?be:I(be,`
`)}}},ve.fences=function(re){var ie=this.rules.block.fences.exec(re);if(ie){var ue=ie[0],pe=De(ue,ie[3]||"");return{type:"code",raw:ue,lang:ie[2]?ie[2].trim():ie[2],text:pe}}},ve.heading=function(re){var ie=this.rules.block.heading.exec(re);if(ie)return{type:"heading",raw:ie[0],depth:ie[1].length,text:ie[2]}},ve.nptable=function(re){var ie=this.rules.block.nptable.exec(re);if(ie){var ue={type:"table",header:Y(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
`):[],raw:ie[0]};if(ue.header.length===ue.align.length){var pe=ue.align.length,be;for(be=0;be ?/gm,"");return{type:"blockquote",raw:ie[0],text:ue}}},ve.list=function(re){var ie=this.rules.block.list.exec(re);if(ie){for(var ue=ie[0],pe=ie[2],be=pe.length>1,_e=pe[pe.length-1]===")",He={type:"list",raw:ue,ordered:be,start:be?+pe.slice(0,-1):"",loose:!1,items:[]},nt=ie[0].match(this.rules.block.item),mt=!1,ft,wt,Tt,ut,Bt,_t,Zt,Xt=nt.length,Ot=0;Ot1||this.options.smartLists&&Tt!==pe)&&(ut=nt.slice(Ot+1).join(`
`),He.raw=He.raw.substring(0,He.raw.length-ut.length),Ot=Xt-1)),Bt=mt||/\n\n(?!\s*$)/.test(ft),Ot!==Xt-1&&(mt=ft.charAt(ft.length-1)===`
`,Bt||(Bt=mt)),Bt&&(He.loose=!0),_t=/^\[[ xX]\] /.test(ft),Zt=void 0,_t&&(Zt=ft[1]!==" ",ft=ft.replace(/^\[[ xX]\] +/,"")),He.items.push({type:"list_item",raw:ue,task:_t,checked:Zt,loose:Bt,text:ft});return He}},ve.html=function(re){var ie=this.rules.block.html.exec(re);if(ie)return{type:this.options.sanitize?"paragraph":"html",raw:ie[0],pre:!this.options.sanitizer&&(ie[1]==="pre"||ie[1]==="script"||ie[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ie[0]):ee(ie[0]):ie[0]}},ve.def=function(re){var ie=this.rules.block.def.exec(re);if(ie){ie[3]&&(ie[3]=ie[3].substring(1,ie[3].length-1));var ue=ie[1].toLowerCase().replace(/\s+/g," ");return{tag:ue,raw:ie[0],href:ie[2],title:ie[3]}}},ve.table=function(re){var ie=this.rules.block.table.exec(re);if(ie){var ue={type:"table",header:Y(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
`):[]};if(ue.header.length===ue.align.length){ue.raw=ie[0];var pe=ue.align.length,be;for(be=0;be/i.test(pe[0])&&(ie=!1),!ue&&/^<(pre|code|kbd|script)(\s|>)/i.test(pe[0])?ue=!0:ue&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(pe[0])&&(ue=!1),{type:this.options.sanitize?"text":"html",raw:pe[0],inLink:ie,inRawBlock:ue,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(pe[0]):ee(pe[0]):pe[0]}},ve.link=function(re){var ie=this.rules.inline.link.exec(re);if(ie){var ue=ae(ie[2],"()");if(ue>-1){var pe=ie[0].indexOf("!")===0?5:4,be=pe+ie[1].length+ue;ie[2]=ie[2].substring(0,ue),ie[0]=ie[0].substring(0,be).trim(),ie[3]=""}var _e=ie[2],He="";if(this.options.pedantic){var nt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(_e);nt?(_e=nt[1],He=nt[3]):He=""}else He=ie[3]?ie[3].slice(1,-1):"";_e=_e.trim().replace(/^<([\s\S]*)>$/,"$1");var mt=de(ie,{href:_e&&_e.replace(this.rules.inline._escapes,"$1"),title:He&&He.replace(this.rules.inline._escapes,"$1")},ie[0]);return mt}},ve.reflink=function(re,ie){var ue;if((ue=this.rules.inline.reflink.exec(re))||(ue=this.rules.inline.nolink.exec(re))){var pe=(ue[2]||ue[1]).replace(/\s+/g," ");if(pe=ie[pe.toLowerCase()],!pe||!pe.href){var be=ue[0].charAt(0);return{type:"text",raw:be,text:be}}var _e=de(ue,pe,ue[0]);return _e}},ve.strong=function(re,ie,ue){ue===void 0&&(ue="");var pe=this.rules.inline.strong.start.exec(re);if(pe&&(!pe[1]||pe[1]&&(ue===""||this.rules.inline.punctuation.exec(ue)))){ie=ie.slice(-1*re.length);var be=pe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;be.lastIndex=0;for(var _e;(pe=be.exec(ie))!=null;)if(_e=this.rules.inline.strong.middle.exec(ie.slice(0,pe.index+3)),_e)return{type:"strong",raw:re.slice(0,_e[0].length),text:re.slice(2,_e[0].length-2)}}},ve.em=function(re,ie,ue){ue===void 0&&(ue="");var pe=this.rules.inline.em.start.exec(re);if(pe&&(!pe[1]||pe[1]&&(ue===""||this.rules.inline.punctuation.exec(ue)))){ie=ie.slice(-1*re.length);var be=pe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;be.lastIndex=0;for(var _e;(pe=be.exec(ie))!=null;)if(_e=this.rules.inline.em.middle.exec(ie.slice(0,pe.index+2)),_e)return{type:"em",raw:re.slice(0,_e[0].length),text:re.slice(1,_e[0].length-1)}}},ve.codespan=function(re){var ie=this.rules.inline.code.exec(re);if(ie){var ue=ie[2].replace(/\n/g," "),pe=/[^ ]/.test(ue),be=ue.startsWith(" ")&&ue.endsWith(" ");return pe&&be&&(ue=ue.substring(1,ue.length-1)),ue=ee(ue,!0),{type:"codespan",raw:ie[0],text:ue}}},ve.br=function(re){var ie=this.rules.inline.br.exec(re);if(ie)return{type:"br",raw:ie[0]}},ve.del=function(re){var ie=this.rules.inline.del.exec(re);if(ie)return{type:"del",raw:ie[0],text:ie[1]}},ve.autolink=function(re,ie){var ue=this.rules.inline.autolink.exec(re);if(ue){var pe,be;return ue[2]==="@"?(pe=ee(this.options.mangle?ie(ue[1]):ue[1]),be="mailto:"+pe):(pe=ee(ue[1]),be=pe),{type:"link",raw:ue[0],text:pe,href:be,tokens:[{type:"text",raw:pe,text:pe}]}}},ve.url=function(re,ie){var ue;if(ue=this.rules.inline.url.exec(re)){var pe,be;if(ue[2]==="@")pe=ee(this.options.mangle?ie(ue[0]):ue[0]),be="mailto:"+pe;else{var _e;do _e=ue[0],ue[0]=this.rules.inline._backpedal.exec(ue[0])[0];while(_e!==ue[0]);pe=ee(ue[0]),ue[1]==="www."?be="http://"+pe:be=pe}return{type:"link",raw:ue[0],text:pe,href:be,tokens:[{type:"text",raw:pe,text:pe}]}}},ve.inlineText=function(re,ie,ue){var pe=this.rules.inline.text.exec(re);if(pe){var be;return ie?be=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(pe[0]):ee(pe[0]):pe[0]:be=ee(this.options.smartypants?ue(pe[0]):pe[0]),{type:"text",raw:pe[0],text:be}}},xe}(),we=V.noopTest,Ce=V.edit,Te=V.merge,ge={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:we,table:we,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ge._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ge._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ge.def=Ce(ge.def).replace("label",ge._label).replace("title",ge._title).getRegex(),ge.bullet=/(?:[*+-]|\d{1,9}[.)])/,ge.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ge.item=Ce(ge.item,"gm").replace(/bull/g,ge.bullet).getRegex(),ge.list=Ce(ge.list).replace(/bull/g,ge.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ge.def.source+")").getRegex(),ge._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",ge._comment=//,ge.html=Ce(ge.html,"i").replace("comment",ge._comment).replace("tag",ge._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ge.paragraph=Ce(ge._paragraph).replace("hr",ge.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ge._tag).getRegex(),ge.blockquote=Ce(ge.blockquote).replace("paragraph",ge.paragraph).getRegex(),ge.normal=Te({},ge),ge.gfm=Te({},ge.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*|$)"}),ge.gfm.nptable=Ce(ge.gfm.nptable).replace("hr",ge.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ge._tag).getRegex(),ge.gfm.table=Ce(ge.gfm.table).replace("hr",ge.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ge._tag).getRegex(),ge.pedantic=Te({},ge.normal,{html:Ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ge._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:we,paragraph:Ce(ge.normal._paragraph).replace("hr",ge.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ge.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var le={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:we,tag:"^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[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:we,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",le.punctuation=Ce(le.punctuation).replace(/punctuation/g,le._punctuation).getRegex(),le._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",le._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",le.em.start=Ce(le.em.start).replace(/punctuation/g,le._punctuation).getRegex(),le.em.middle=Ce(le.em.middle).replace(/punctuation/g,le._punctuation).replace(/overlapSkip/g,le._overlapSkip).getRegex(),le.em.endAst=Ce(le.em.endAst,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.em.endUnd=Ce(le.em.endUnd,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.strong.start=Ce(le.strong.start).replace(/punctuation/g,le._punctuation).getRegex(),le.strong.middle=Ce(le.strong.middle).replace(/punctuation/g,le._punctuation).replace(/blockSkip/g,le._blockSkip).getRegex(),le.strong.endAst=Ce(le.strong.endAst,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.strong.endUnd=Ce(le.strong.endUnd,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.blockSkip=Ce(le._blockSkip,"g").getRegex(),le.overlapSkip=Ce(le._overlapSkip,"g").getRegex(),le._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,le._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,le._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])?)+(?![-_])/,le.autolink=Ce(le.autolink).replace("scheme",le._scheme).replace("email",le._email).getRegex(),le._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,le.tag=Ce(le.tag).replace("comment",ge._comment).replace("attribute",le._attribute).getRegex(),le._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,le._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,le._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,le.link=Ce(le.link).replace("label",le._label).replace("href",le._href).replace("title",le._title).getRegex(),le.reflink=Ce(le.reflink).replace("label",le._label).getRegex(),le.reflinkSearch=Ce(le.reflinkSearch,"g").replace("reflink",le.reflink).replace("nolink",le.nolink).getRegex(),le.normal=Te({},le),le.pedantic=Te({},le.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:Ce(/^!?\[(label)\]\((.*?)\)/).replace("label",le._label).getRegex(),reflink:Ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",le._label).getRegex()}),le.gfm=Te({},le.normal,{escape:Ce(le.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&&(re="x"+re.toString(16)),ve+=""+re+";";return ve}var Re=function(){function xe(ye){this.tokens=[],this.tokens.links=Object.create(null),this.options=ye||ce,this.options.tokenizer=this.options.tokenizer||new Se,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var re={block:ne.normal,inline:Le.normal};this.options.pedantic?(re.block=ne.pedantic,re.inline=Le.pedantic):this.options.gfm&&(re.block=ne.gfm,this.options.breaks?re.inline=Le.breaks:re.inline=Le.gfm),this.tokenizer.rules=re}xe.lex=function(re,ie){var ue=new xe(ie);return ue.lex(re)};var ve=xe.prototype;return ve.lex=function(re){return re=re.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(re,this.tokens,!0),this.inline(this.tokens),this.tokens},ve.blockTokens=function(re,ie,ue){ie===void 0&&(ie=[]),ue===void 0&&(ue=!0),re=re.replace(/^ +$/gm,"");for(var pe,be,_e,He;re;){if(pe=this.tokenizer.space(re)){re=re.substring(pe.raw.length),pe.type&&ie.push(pe);continue}if(pe=this.tokenizer.code(re,ie)){re=re.substring(pe.raw.length),pe.type?ie.push(pe):(He=ie[ie.length-1],He.raw+=`
`+pe.raw,He.text+=`
`+pe.text);continue}if(pe=this.tokenizer.fences(re)){re=re.substring(pe.raw.length),ie.push(pe);continue}if(pe=this.tokenizer.heading(re)){re=re.substring(pe.raw.length),ie.push(pe);continue}if(pe=this.tokenizer.nptable(re)){re=re.substring(pe.raw.length),ie.push(pe);continue}if(pe=this.tokenizer.hr(re)){re=re.substring(pe.raw.length),ie.push(pe);continue}if(pe=this.tokenizer.blockquote(re)){re=re.substring(pe.raw.length),pe.tokens=this.blockTokens(pe.text,[],ue),ie.push(pe);continue}if(pe=this.tokenizer.list(re)){for(re=re.substring(pe.raw.length),_e=pe.items.length,be=0;be<_e;be++)pe.items[be].tokens=this.blockTokens(pe.items[be].text,[],!1);ie.push(pe);continue}if(pe=this.tokenizer.html(re)){re=re.substring(pe.raw.length),ie.push(pe);continue}if(ue&&(pe=this.tokenizer.def(re))){re=re.substring(pe.raw.length),this.tokens.links[pe.tag]||(this.tokens.links[pe.tag]={href:pe.href,title:pe.title});continue}if(pe=this.tokenizer.table(re)){re=re.substring(pe.raw.length),ie.push(pe);continue}if(pe=this.tokenizer.lheading(re)){re=re.substring(pe.raw.length),ie.push(pe);continue}if(ue&&(pe=this.tokenizer.paragraph(re))){re=re.substring(pe.raw.length),ie.push(pe);continue}if(pe=this.tokenizer.text(re,ie)){re=re.substring(pe.raw.length),pe.type?ie.push(pe):(He=ie[ie.length-1],He.raw+=`
`+pe.raw,He.text+=`
`+pe.text);continue}if(re){var nt="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(nt);break}else throw new Error(nt)}}return ie},ve.inline=function(re){var ie,ue,pe,be,_e,He,nt=re.length;for(ie=0;ie0)for(;(nt=this.tokenizer.rules.inline.reflinkSearch.exec(He))!=null;)mt.includes(nt[0].slice(nt[0].lastIndexOf("[")+1,-1))&&(He=He.slice(0,nt.index)+"["+"a".repeat(nt[0].length-2)+"]"+He.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(nt=this.tokenizer.rules.inline.blockSkip.exec(He))!=null;)He=He.slice(0,nt.index)+"["+"a".repeat(nt[0].length-2)+"]"+He.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;re;){if(_e=this.tokenizer.escape(re)){re=re.substring(_e.raw.length),ie.push(_e);continue}if(_e=this.tokenizer.tag(re,ue,pe)){re=re.substring(_e.raw.length),ue=_e.inLink,pe=_e.inRawBlock,ie.push(_e);continue}if(_e=this.tokenizer.link(re)){re=re.substring(_e.raw.length),_e.type==="link"&&(_e.tokens=this.inlineTokens(_e.text,[],!0,pe)),ie.push(_e);continue}if(_e=this.tokenizer.reflink(re,this.tokens.links)){re=re.substring(_e.raw.length),_e.type==="link"&&(_e.tokens=this.inlineTokens(_e.text,[],!0,pe)),ie.push(_e);continue}if(_e=this.tokenizer.strong(re,He,be)){re=re.substring(_e.raw.length),_e.tokens=this.inlineTokens(_e.text,[],ue,pe),ie.push(_e);continue}if(_e=this.tokenizer.em(re,He,be)){re=re.substring(_e.raw.length),_e.tokens=this.inlineTokens(_e.text,[],ue,pe),ie.push(_e);continue}if(_e=this.tokenizer.codespan(re)){re=re.substring(_e.raw.length),ie.push(_e);continue}if(_e=this.tokenizer.br(re)){re=re.substring(_e.raw.length),ie.push(_e);continue}if(_e=this.tokenizer.del(re)){re=re.substring(_e.raw.length),_e.tokens=this.inlineTokens(_e.text,[],ue,pe),ie.push(_e);continue}if(_e=this.tokenizer.autolink(re,Ee)){re=re.substring(_e.raw.length),ie.push(_e);continue}if(!ue&&(_e=this.tokenizer.url(re,Ee))){re=re.substring(_e.raw.length),ie.push(_e);continue}if(_e=this.tokenizer.inlineText(re,pe,Oe)){re=re.substring(_e.raw.length),be=_e.raw.slice(-1),ie.push(_e);continue}if(re){var ft="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(ft);break}else throw new Error(ft)}}return ie},Z(xe,null,[{key:"rules",get:function(){return{block:ne,inline:Le}}}]),xe}(),Ne=z.defaults,je=V.cleanUrl,Ue=V.escape,Ie=function(){function xe(ye){this.options=ye||Ne}var ve=xe.prototype;return ve.code=function(re,ie,ue){var pe=(ie||"").match(/\S*/)[0];if(this.options.highlight){var be=this.options.highlight(re,pe);be!=null&&be!==re&&(ue=!0,re=be)}return pe?''+(ue?re:Ue(re,!0))+`
`:""+(ue?re:Ue(re,!0))+`
`},ve.blockquote=function(re){return`
`+re+`
`},ve.html=function(re){return re},ve.heading=function(re,ie,ue,pe){return this.options.headerIds?"
`:""+re+"
`},ve.hr=function(){return this.options.xhtml?`
`:`
`},ve.list=function(re,ie,ue){var pe=ie?"ol":"ul",be=ie&&ue!==1?' start="'+ue+'"':"";return"<"+pe+be+`>
`+re+""+pe+`>
`},ve.listitem=function(re){return""+re+`
`},ve.checkbox=function(re){return" "},ve.paragraph=function(re){return""+re+`
`},ve.table=function(re,ie){return ie&&(ie=""+ie+""),`
`},ve.tablerow=function(re){return`
`+re+`
`},ve.tablecell=function(re,ie){var ue=ie.header?"th":"td",pe=ie.align?"<"+ue+' align="'+ie.align+'">':"<"+ue+">";return pe+re+""+ue+`>
`},ve.strong=function(re){return""+re+""},ve.em=function(re){return""+re+""},ve.codespan=function(re){return""+re+""},ve.br=function(){return this.options.xhtml?"
":"
"},ve.del=function(re){return""+re+""},ve.link=function(re,ie,ue){if(re=je(this.options.sanitize,this.options.baseUrl,re),re===null)return ue;var pe='"+ue+"",pe},ve.image=function(re,ie,ue){if(re=je(this.options.sanitize,this.options.baseUrl,re),re===null)return ue;var pe='
":">",pe},ve.text=function(re){return re},xe}(),Me=function(){function xe(){}var ve=xe.prototype;return ve.strong=function(re){return re},ve.em=function(re){return re},ve.codespan=function(re){return re},ve.del=function(re){return re},ve.html=function(re){return re},ve.text=function(re){return re},ve.link=function(re,ie,ue){return""+ue},ve.image=function(re,ie,ue){return""+ue},ve.br=function(){return""},xe}(),Ke=function(){function xe(){this.seen={}}var ve=xe.prototype;return ve.slug=function(re){var ie=re.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ie)){var ue=ie;do this.seen[ue]++,ie=ue+"-"+this.seen[ue];while(this.seen.hasOwnProperty(ie))}return this.seen[ie]=0,ie},xe}(),Ze=z.defaults,$e=V.unescape,Qe=function(){function xe(ye){this.options=ye||Ze,this.options.renderer=this.options.renderer||new Ie,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Me,this.slugger=new Ke}xe.parse=function(re,ie){var ue=new xe(ie);return ue.parse(re)};var ve=xe.prototype;return ve.parse=function(re,ie){ie===void 0&&(ie=!0);var ue="",pe,be,_e,He,nt,mt,ft,wt,Tt,ut,Bt,_t,Zt,Xt,Ot,Ir,Kr,bt,Nr=re.length;for(pe=0;pe0&&Ot.tokens[0].type==="text"?(Ot.tokens[0].text=bt+" "+Ot.tokens[0].text,Ot.tokens[0].tokens&&Ot.tokens[0].tokens.length>0&&Ot.tokens[0].tokens[0].type==="text"&&(Ot.tokens[0].tokens[0].text=bt+" "+Ot.tokens[0].tokens[0].text)):Ot.tokens.unshift({type:"text",text:bt}):Xt+=bt),Xt+=this.parse(Ot.tokens,Zt),Tt+=this.renderer.listitem(Xt,Kr,Ir);ue+=this.renderer.list(Tt,Bt,_t);continue}case"html":{ue+=this.renderer.html(ut.text);continue}case"paragraph":{ue+=this.renderer.paragraph(this.parseInline(ut.tokens));continue}case"text":{for(Tt=ut.tokens?this.parseInline(ut.tokens):ut.text;pe+1An error occurred:
"+rt(_e.message+"",!0)+"
";throw _e}}Fe.options=Fe.setOptions=function(xe){return lt(Fe.defaults,xe),ht(Fe.defaults),Fe},Fe.getDefaults=Pe,Fe.defaults=at,Fe.use=function(xe){var ve=lt({},xe);if(xe.renderer&&function(){var re=Fe.defaults.renderer||new Ie,ie=function(be){var _e=re[be];re[be]=function(){for(var He=arguments.length,nt=new Array(He),mt=0;mt`,triples:"",explode:"[]{}"},D=oe.Pos;oe.defineOption("autoCloseBrackets",!1,function(C,T,h){h&&h!=oe.Init&&(C.removeKeyMap(B),C.state.closeBrackets=null),T&&(M($(T,"pairs")),C.state.closeBrackets=T,C.addKeyMap(B))});function $(C,T){return T=="pairs"&&typeof C=="string"?C:typeof C=="object"&&C[T]!=null?C[T]:Z[T]}var B={Backspace:P,Enter:R};function M(C){for(var T=0;T=0;l--){var w=o[l].head;C.replaceRange("",D(w.line,w.ch-1),D(w.line,w.ch+1),"+delete")}}function R(C){var T=W(C),h=T&&$(T,"explode");if(!h||C.getOption("disableInput"))return oe.Pass;for(var o=C.listSelections(),l=0;l0;return{anchor:new D(C.anchor.line,C.anchor.ch+(T?-1:1)),head:new D(C.head.line,C.head.ch+(T?1:-1))}}function A(C,T){var h=W(C);if(!h||C.getOption("disableInput"))return oe.Pass;var o=$(h,"pairs"),l=o.indexOf(T);if(l==-1)return oe.Pass;for(var d=$(h,"closeBefore"),w=$(h,"triples"),v=o.charAt(l+1)==T,g=C.listSelections(),k=l%2==0,E,p=0;p=0&&C.getRange(u,D(u.line,u.ch+3))==T+T+T?a="skipThree":a="skip";else if(v&&u.ch>1&&w.indexOf(T)>=0&&C.getRange(D(u.line,u.ch-2),u)==T+T){if(u.ch>2&&/\bstring/.test(C.getTokenTypeAt(D(u.line,u.ch-2))))return oe.Pass;a="addFour"}else if(v){var m=u.ch==0?" ":C.getRange(D(u.line,u.ch-1),u);if(!oe.isWordChar(b)&&m!=T&&!oe.isWordChar(m))a="both";else return oe.Pass}else if(k&&(b.length===0||/\s/.test(b)||d.indexOf(b)>-1))a="both";else return oe.Pass;if(!E)E=a;else if(E!=a)return oe.Pass}var x=l%2?o.charAt(l-1):T,F=l%2?T:o.charAt(l+1);C.operation(function(){if(E=="skip")C.execCommand("goCharRight");else if(E=="skipThree")for(var U=0;U<3;U++)C.execCommand("goCharRight");else if(E=="surround"){for(var K=C.getSelections(),U=0;U0&&(ae.percent=ae.loaded/ae.total*100),V.onProgress(ae)});var I=new FormData;V.data&&Object.keys(V.data).forEach(function(ee){var ae=V.data[ee];if(Array.isArray(ae)){ae.forEach(function(de){I.append(ee+"[]",de)});return}I.append(ee,V.data[ee])}),V.file instanceof Blob?I.append(V.filename,V.file,V.file.name):I.append(V.filename,V.file),_.onerror=function(ae){V.onError(ae)},_.onload=function(){return _.status<200||_.status>=300?V.onError(B(V,_),M(_)):V.onSuccess(M(_),_)},_.open(V.method,V.action,!0),V.withCredentials&&"withCredentials"in _&&(_.withCredentials=!0);var Y=V.headers||{};return Y["X-Requested-With"]!==null&&_.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(Y).forEach(function(ee){Y[ee]!==null&&_.setRequestHeader(ee,Y[ee])}),_.send(I),{abort:function(){_.abort()}}}var W=+new Date,P=0;function R(){return"rc-upload-"+W+"-"+ ++P}function y(V,_){return V.indexOf(_,V.length-_.length)!==-1}var A=function(V,_){if(V&&_){var I=Array.isArray(_)?_:_.split(","),Y=V.name||"",ee=V.type||"",ae=ee.replace(/\/.*$/,"");return I.some(function(de){var De=de.trim();return De.charAt(0)==="."?y(Y.toLowerCase(),De.toLowerCase()):/\/\*$/.test(De)?ae===De.replace(/\/.*$/,""):ee===De})}return!0};function O(V,_){var I=V.createReader(),Y=[];function ee(){I.readEntries(function(ae){var de=Array.prototype.slice.apply(ae);Y=Y.concat(de);var De=!de.length;De?_(Y):ee()})}ee()}var L=function(_,I,Y){var ee=function ae(de,De){De=De||"",de.isFile?de.file(function(Se){Y(Se)&&(de.fullPath&&!Se.webkitRelativePath&&(Object.defineProperties(Se,{webkitRelativePath:{writable:!0}}),Se.webkitRelativePath=de.fullPath.replace(/^\//,""),Object.defineProperties(Se,{webkitRelativePath:{writable:!1}})),I([Se]))}):de.isDirectory&&O(de,function(Se){Se.forEach(function(we){ae(we,""+De+de.name+"/")})})};_.forEach(function(ae){ee(ae.webkitGetAsEntry())})},C=L,T=Object.assign||function(V){for(var _=1;_=0)continue;if(!Object.prototype.hasOwnProperty.call(V,Y))continue;I[Y]=V[Y]}return I}function w(V,_){if(!(V instanceof _))throw new TypeError("Cannot call a class as a function")}function v(V,_){if(!V)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:V}function g(V,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);V.prototype=Object.create(_&&_.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(V,_):V.__proto__=_)}var k=function(_){return Object.keys(_).reduce(function(I,Y){return(Y.substr(0,5)==="data-"||Y.substr(0,5)==="aria-"||Y==="role")&&(I[Y]=_[Y]),I},{})},E=function(V){g(_,V);function _(){var I,Y,ee,ae;w(this,_);for(var de=arguments.length,De=Array(de),Se=0;Se1&&arguments[1]!==void 0?arguments[1]:1,ye=Me.length,re=0;re1&&arguments[1]!==void 0?arguments[1]:!1;return Object(k.a)(I).map(function(ee,ae){if(!B.isValidElement(ee)||!ee.type)return null;var de=ee.type.isSelectOptGroup,De=ee.key,Se=ee.props,we=Se.children,Ce=Object(z.a)(Se,["children"]);return Y||!de?E(ee):Object(g.a)(Object(g.a)({key:"__RC_SELECT_GRP__".concat(De===null?ae:De,"__"),label:De},Ce),{},{options:p(we)})}).filter(function(ee){return ee})}var c=se("2Qr1"),u=se("qNPg"),a=se("U8pU"),b=se("Kwbf"),m=se("WKfj");function x(I){var Y=I.mode,ee=I.options,ae=I.children,de=I.backfill,De=I.allowClear,Se=I.placeholder,we=I.getInputElement,Ce=I.showSearch,Te=I.onSearch,ge=I.defaultOpen,le=I.autoFocus,te=I.labelInValue,ce=I.value,ne=I.inputValue,Le=I.optionLabelProp,Oe=Y==="multiple"||Y==="tags",Ee=Ce!==void 0?Ce:Oe||Y==="combobox",Re=ee||p(ae);if(Object(b.a)(Y!=="tags"||Re.every(function(Ie){return!Ie.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Y==="tags"||Y==="combobox"){var Ne=Re.some(function(Ie){return Ie.options?Ie.options.some(function(Me){return typeof("value"in Me?Me.value:Me.key)=="number"}):typeof("value"in Ie?Ie.value:Ie.key)=="number"});Object(b.a)(!Ne,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(b.a)(Y!=="combobox"||!Le,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(b.a)(Y==="combobox"||!de,"`backfill` only works with `combobox` mode."),Object(b.a)(Y==="combobox"||!we,"`getInputElement` only work with `combobox` mode."),Object(b.b)(Y!=="combobox"||!we||!De||!Se,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Te&&!Ee&&Y!=="combobox"&&Y!=="tags"&&Object(b.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(b.b)(!ge||le,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ce!=null){var je=Object(m.d)(ce);Object(b.a)(!te||je.every(function(Ie){return Object(a.a)(Ie)==="object"&&("key"in Ie||"value"in Ie)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(b.a)(!Oe||Array.isArray(ce),"`value` should be array when `mode` is `multiple` or `tags`")}if(ae){var Ue=null;Object(k.a)(ae).some(function(Ie){if(!B.isValidElement(Ie)||!Ie.type)return!1;var Me=Ie.type;if(Me.isSelectOption)return!1;if(Me.isSelectOptGroup){var Ke=Object(k.a)(Ie.props.children).every(function(Ze){return!B.isValidElement(Ze)||!Ie.type||Ze.type.isSelectOption?!0:(Ue=Ze.type,!1)});return!Ke}return Ue=Me,!0}),Ue&&Object(b.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ue.displayName||Ue.name||Ue,"`.")),Object(b.a)(ne===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var F=x,U=Object(u.a)({prefixCls:"rc-select",components:{optionList:o},convertChildrenToData:p,flattenOptions:c.d,getLabeledValue:c.e,filterOptions:c.b,isValueDisabled:c.g,findValueOption:c.c,warningProps:F,fillOptionsWithMissingValue:c.a}),K=function(I){Object(D.a)(ee,I);var Y=Object($.a)(ee);function ee(){var ae;return Object(oe.a)(this,ee),ae=Y.apply(this,arguments),ae.selectRef=B.createRef(),ae.focus=function(){ae.selectRef.current.focus()},ae.blur=function(){ae.selectRef.current.blur()},ae}return Object(Z.a)(ee,[{key:"render",value:function(){return B.createElement(U,Object.assign({ref:this.selectRef},this.props))}}]),ee}(B.Component);K.Option=d,K.OptGroup=v;var V=K,_=it.c=V},M8RZ:function(xt,it,se){"use strict";se.d(it,"a",function(){return P});var oe=se("fWQN"),Z=se("mtLc"),D=se("yKVA"),$=se("879j"),B=se("q1tI"),M=se.n(B),z=se("i8i4"),W=se.n(z),P=function(R){Object(D.a)(A,R);var y=Object($.a)(A);function A(O){var L;Object(oe.a)(this,A),L=y.call(this,O);var C=window.document;return L.node=C.createElement("div"),C.body.appendChild(L.node),L}return Object(Z.a)(A,[{key:"render",value:function(){var L=this.props.children;return Object(z.createPortal)(L,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),A}(M.a.Component)},OLES:function(xt,it,se){"use strict";var oe=se("U8pU"),Z=se("VTBJ"),D=se("Ff2n"),$=se("q1tI"),B=se("uciX"),M=se("7ixt"),z=function(O){var L=O.overlay,C=O.prefixCls,T=O.id,h=O.overlayInnerStyle;return $.createElement("div",{className:"".concat(C,"-inner"),id:T,role:"tooltip",style:h},typeof L=="function"?L():L)},W=z,P=function(O,L){var C=O.overlayClassName,T=O.trigger,h=T===void 0?["hover"]:T,o=O.mouseEnterDelay,l=o===void 0?0:o,d=O.mouseLeaveDelay,w=d===void 0?.1:d,v=O.overlayStyle,g=O.prefixCls,k=g===void 0?"rc-tooltip":g,E=O.children,p=O.onVisibleChange,c=O.afterVisibleChange,u=O.transitionName,a=O.animation,b=O.placement,m=b===void 0?"right":b,x=O.align,F=x===void 0?{}:x,U=O.destroyTooltipOnHide,K=U===void 0?!1:U,V=O.defaultVisible,_=O.getTooltipContainer,I=O.overlayInnerStyle,Y=Object(D.a)(O,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),ee=Object($.useRef)(null);Object($.useImperativeHandle)(L,function(){return ee.current});var ae=Object(Z.a)({},Y);"visible"in O&&(ae.popupVisible=O.visible);var de=function(){var Te=O.arrowContent,ge=Te===void 0?null:Te,le=O.overlay,te=O.id;return[$.createElement("div",{className:"".concat(k,"-arrow"),key:"arrow"},ge),$.createElement(W,{key:"content",prefixCls:k,id:te,overlay:le,overlayInnerStyle:I})]},De=!1,Se=!1;if(typeof K=="boolean")De=K;else if(K&&Object(oe.a)(K)==="object"){var we=K.keepParent;De=we===!0,Se=we===!1}return $.createElement(B.a,Object.assign({popupClassName:C,prefixCls:k,popup:de,action:h,builtinPlacements:M.a,popupPlacement:m,ref:ee,popupAlign:F,getPopupContainer:_,onPopupVisibleChange:p,afterPopupVisibleChange:c,popupTransitionName:u,popupAnimation:a,defaultPopupVisible:V,destroyPopupOnHide:De,autoDestroy:Se,mouseLeaveDelay:w,popupStyle:v,mouseEnterDelay:l},ae),E)},R=Object($.forwardRef)(P),y=it.a=R},Ot1p:function(xt,it,se){"use strict";var oe=se("2qtc"),Z=se("kLXV"),D=se("rAM+"),$=se("miYZ"),B=se("tsqr"),M=se("9og8"),z=se("tJVT"),W=se("jrin"),P=se("WmNS"),R=se.n(P),y=se("q1tI"),A=se.n(y),O=se("VrN/"),L=se.n(O),C=se("bdgK"),T=se("p77/"),h=se("Bd2K"),o=se("ELLl"),l=se("19Vz"),d=se("lZu9"),w=se("+NIl"),v=se("kSUc"),g=se("9Bee"),k=function(be){var _e=be.value,He=_e===void 0?"":_e,nt=be.className,mt=be.showTextOnly,ft=be.showLines,wt=be.style,Tt=wt===void 0?{}:wt,ut=Object(y.useMemo)(function(){return""},[He]);return A.a.createElement(A.a.Fragment,null,A.a.createElement("div",{dangerouslySetInnerHTML:{__html:ut}}))},E=se("0Owb"),p=se("dejd"),c=se("C+DQ"),u=se("1vsH"),a=se("m3rI"),b=[{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 m(be){var _e=be.onActionCallback,He=be.title,nt=be.icon,mt=be.actionName,ft=be.className,wt=ft===void 0?"":ft,Tt=be.children;function ut(){_e(mt)}return A.a.createElement("a",{title:He,className:wt,onClick:ut},A.a.createElement("i",{className:"md-iconfont ".concat(nt)}),Tt)}var x=function(be){var _e=be.watch,He=be.showNullButton,nt=be.onActionCallback,mt=be.fullScreen,ft=be.insertTemp,wt=be.hidetoolBar,Tt=be.uuid,ut=be.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(u.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(u.F)("_educoder_session"),"&key=").concat(Tt,"&api=").concat(encodeURIComponent(a.a.PROXY_SERVER)));var Bt=[].concat(b,[{title:"".concat(_e?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(_e?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return A.a.createElement("ul",{className:"markdown-toolbar-container"},!wt&&Bt.map(function(_t,Zt){return A.a.createElement("li",{key:Zt},_t.actionName?A.a.createElement(m,Object(E.a)({},_t,{onActionCallback:nt})):A.a.createElement("span",{className:"v-line"}))}),He?A.a.createElement("li",null,A.a.createElement(m,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:nt},A.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ft&&A.a.createElement("li",null,A.a.createElement(m,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ft),onActionCallback:nt},A.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),A.a.createElement("li",{className:"btn-full-screen"},A.a.createElement(m,{icon:"".concat(mt?"icon-shrink":"icon-enlarge"),title:mt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:nt})))},F=se("M8RZ"),U=se("+L6B"),K=se("2/Rp"),V=se("y8nQ"),_=se("Vl3Y"),I=se("5NDa"),Y=se("5rEg"),ee={labelCol:{span:4},wrapperCol:{span:20}},ae=function(be){var _e=be.callback,He=be.onCancel;function nt(mt){_e(mt)}return A.a.createElement(_.a,Object(E.a)({},ee,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:nt}),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(Y.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(Y.a,null)),A.a.createElement("div",{className:"flex-container flex-end"},A.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(K.a,{type:"ghost",onClick:He},"\u53D6\u6D88")))},de=se("7ahc"),De=se("HmJG"),Se=se("BjJ7"),we=_.a.useForm,Ce={width:280,marginRight:10},Te={labelCol:{span:5},wrapperCol:{span:19}},ge=function(be){var _e=be.callback,He=be.onCancel,nt=we(),mt=Object(z.a)(nt,1),ft=mt[0];function wt(Bt){_e(Bt)}function Tt(Bt,_t){if(Bt.status===-1){B.b.error(Bt.message);return}ft.setFieldsValue({src:"/api/attachments/".concat(Bt.id),type:_t.type})}function ut(Bt){var _t=Bt.target.files[0];te(_t,Tt)}return A.a.createElement(_.a,Object(E.a)({form:ft},Te,{className:"upload-image-panel",onFinish:wt}),A.a.createElement(_.a.Item,{label:"\u56FE\u7247\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\u56FE\u7247\u5730\u5740"}]},A.a.createElement(Y.a,{style:Ce})),A.a.createElement(le,{onFileChange:ut}))),A.a.createElement(_.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},A.a.createElement(Y.a,{style:{width:264}})),A.a.createElement(_.a.Item,{style:{textAlign:"right"}},A.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(K.a,{type:"ghost",onClick:He},"\u53D6\u6D88")))};function le(be){var _e=be.onFileChange;return A.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",A.a.createElement("input",{type:"file",onChange:_e}))}function te(be,_e){if(!be)throw new String("\u6CA1\u6709\u6587\u4EF6");var He=new FormData;He.append("editormd-image-file",be),He.append("file_param_name","editormd-image-file"),He.append("byxhr","true");var nt=new window.XMLHttpRequest;nt.withCredentials=!0,nt.addEventListener("load",function(mt){_e(JSON.parse(mt.target.responseText),be)},!1),nt.addEventListener("error",function(mt){console.error(mt)},!1),nt.open("POST","".concat(Se.a,"/api/attachments.json")),nt.send(He)}var ce=se("giR+"),ne=se("fyUT"),Le=se("7Kak"),Oe=se("9yH6"),Ee=Oe.a.Group,Re={margin:"0 8px"},Ne=function(be){var _e=be.callback,He=be.onCancel;function nt(mt){_e(mt)}return A.a.createElement(_.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:nt},A.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},A.a.createElement("span",{style:Re},"\u5355\u5143\u683C\u6570\uFF1A"),A.a.createElement("span",{style:Re},"\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:Re},"\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,alignItems:"baseline"}},A.a.createElement("span",{style:Re},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),A.a.createElement(_.a.Item,{name:"align"},A.a.createElement(Ee,null,A.a.createElement(Oe.a,{value:"default"},A.a.createElement("i",{className:"fa fa-align-justify"})),A.a.createElement(Oe.a,{value:"left"},A.a.createElement("i",{className:"fa fa-align-left"})),A.a.createElement(Oe.a,{value:"center"},A.a.createElement("i",{className:"fa fa-align-center"})),A.a.createElement(Oe.a,{value:"right"},A.a.createElement("i",{className:"fa fa-align-right"}))))),A.a.createElement("div",{className:"flex-container flex-end"},A.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(K.a,{type:"ghost",onClick:He},"\u53D6\u6D88")))},je=se("ErOA"),Ue=se("7Cbv"),Ie="link",Me="upload-image",Ke="code-block",Ze="add-table",$e="------------",Qe={default:$e,left:":".concat($e),center:":".concat($e,":"),right:"".concat($e,":")},lt=se("9VGf"),tt,rt;function Pe(){}var ht=0,at=1e4,Fe="\u2581",Ve=`
**\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 xe(be){return/^\d+$/.test(be)?"".concat(be,"px"):be}var ve=navigator.platform.toUpperCase().indexOf("MAC")>=0,ye=ve?"Cmd":"Ctrl",re=["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"],ie=(tt={},Object(W.a)(tt,ye+"-B","bold"),Object(W.a)(tt,ye+"-I","italic"),tt),ue=(rt={},Object(W.a)(rt,Ie,"\u6DFB\u52A0\u94FE\u63A5"),Object(W.a)(rt,Ke,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(W.a)(rt,Me,"\u6DFB\u52A0\u6587\u4EF6"),Object(W.a)(rt,Ze,"\u6DFB\u52A0\u8868\u683C"),rt),pe=it.a=function(be){var _e=be.defaultValue,He=_e===void 0?"":_e,nt=be.onChange,mt=be.width,ft=mt===void 0?"100%":mt,wt=be.height,Tt=wt===void 0?400:wt,ut=be.miniToolbar,Bt=ut===void 0?!1:ut,_t=be.isFocus,Zt=_t===void 0?!1:_t,Xt=be.watch,Ot=be.insertTemp,Ir=be.mode,Kr=Ir===void 0?"markdown":Ir,bt=be.id,Nr=bt===void 0?"markdown-editor-id":bt,hr=be.showResizeBar,pr=hr===void 0?!1:hr,Fr=be.noStorage,ci=Fr===void 0?!1:Fr,qr=be.showNullButton,It=qr===void 0?!1:qr,dt=be.hidetoolBar,Hr=dt===void 0?!1:dt,ei=be.fullScreen,mr=ei===void 0?!1:ei,kt=be.onBlur,Br=be.onCMBeforeChange,Vr=be.onFullScreen,fi=be.className,Xe=fi===void 0?"":fi,St=be.disablePaste,pi=St===void 0?!1:St,mi=be.placeholder,gi=mi===void 0?"":mi,vi=be.values,G=vi===void 0?"":vi,s=Object(y.useState)(null),f=Object(z.a)(s,2),N=f[0],Q=f[1],H=Object(y.useState)(He),me=Object(z.a)(H,2),We=me[0],Je=me[1],ct=Object(y.useState)(Xt),Ge=Object(z.a)(ct,2),vt=Ge[0],Nt=Ge[1],Kt=Object(y.useState)(mr),Or=Object(z.a)(Kt,2),gr=Or[0],vr=Or[1],Xr=Object(y.useState)(""),Oi=Object(z.a)(Xr,2),nr=Oi[0],Ur=Oi[1],oi=Object(y.useState)(0),si=Object(z.a)(oi,2),_r=si[0],_i=si[1],yi=Object(y.useState)(Tt),zi=Object(z.a)(yi,2),Ki=zi[0],Yr=zi[1],Gr=Object(y.useState)(!1),bi=Object(z.a)(Gr,2),dn=bi[0],xi=bi[1],Jt=Object(y.useRef)(Object(Ue.a)()),Ft=Object(y.useRef)(!1),dr=Object(y.useRef)(),Dt=Object(y.useRef)(),qt=Object(y.useRef)(),Wt=Object(y.useRef)(),ti=Object(y.useRef)(),ar=function(){var pt=Object(M.a)(R.a.mark(function Ct(){var yt,Lt;return R.a.wrap(function(Gt){for(;;)switch(Gt.prev=Gt.next){case 0:return Gt.next=2,Object(je.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Jt.current}});case 2:Lt=Gt.sent,Lt!=null&&(yt=Lt.attachments)!==null&&yt!==void 0&&yt.length&&(console.log("cm:",N,Dt),Lt.attachments.map(function(Pt){Pt.content_type.indexOf("image")>-1?N.replaceSelection(".concat(Pt.content_type,")")):Pt.content_type.indexOf("video")>-1?N.replaceSelection('')):Pt.content_type.indexOf("pdf")>-1?N.replaceSelection('').concat(Pt.name,"")):N.replaceSelection("[".concat(Pt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Pt.id,"?type=").concat(Pt.content_type,")"))}));case 4:case"end":return Gt.stop()}},Ct)}));return function(){return pt.apply(this,arguments)}}();Object(y.useEffect)(function(){Je(G),N==null||N.setValue(G)},[G]),Object(y.useEffect)(function(){Vr==null||Vr(gr)},[gr]),Object(y.useEffect)(function(){if(Dt.current){var pt=L.a.fromTextArea(Dt.current,{mode:Kr,lineNumbers:!Bt,lineWrapping:!0,value:He,autoCloseTags:!0,autoCloseBrackets:!0});Zt&&pt.focus();function Ct(yt,Lt){if(pi){Lt.preventDefault();return}var Mt=Lt.clipboardData;if(Mt){var Gt=Mt.types.toString(),Pt=Mt.items;if(Gt==="Files"||Mt.types.indexOf("Files")>-1){if(Lt.preventDefault(),Kr=="stex")return;try{var rr,Cr=Pt[1];((rr=Pt[0])===null||rr===void 0?void 0:rr.kind)==="file"&&(Cr=Pt[0]);var Rt=Cr.getAsFile(),li=Rt.name.split(".").pop();te(Rt,function(Ut){if(Ut.id){var wr,yr,zr;(Rt==null||((wr=Rt.type)===null||wr===void 0)?void 0:wr.indexOf("image"))>-1?pt.replaceSelection(".concat(Ut.content_type,")")):(Rt==null||((yr=Rt.type)===null||yr===void 0)?void 0:yr.indexOf("video"))>-1?pt.replaceSelection('')):(Rt==null||((zr=Rt.type)===null||zr===void 0)?void 0:zr.indexOf("pdf"))>-1?pt.replaceSelection('').concat(Rt.name,"")):re.includes(li)?pt.replaceSelection('').concat(Rt.name,"")):pt.replaceSelection("[".concat(Rt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Ut.id,"?type=").concat(Ut.content_type,")"))}else(Ut==null?void 0:Ut.status)===401&&(document.location.href="/user/login")})}catch(Ut){B.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return pt.on("paste",Ct),pt.on("dragleave",function(yt,Lt){qt.current.classList.remove("mouse-hover-md")}),pt.on("dragover",function(yt,Lt){qt.current.classList.add("mouse-hover-md")}),pt.on("drop",function(yt,Lt){qt.current.classList.add("mouse-hover-md");var Mt;if(Mt=Lt.dataTransfer.files,Mt.length>0){Lt.preventDefault(),Lt.stopPropagation();for(var Gt=function(Cr){var Rt=Mt[Cr],li=Rt.name.split(".").pop();te(Rt,function(Ut){if(Ut.id){var wr,yr,zr;(Rt==null||((wr=Rt.type)===null||wr===void 0)?void 0:wr.indexOf("image"))>-1?pt.replaceSelection(".concat(Ut.content_type,")")):(Rt==null||((yr=Rt.type)===null||yr===void 0)?void 0:yr.indexOf("video"))>-1?pt.replaceSelection('')):(Rt==null||((zr=Rt.type)===null||zr===void 0)?void 0:zr.indexOf("pdf"))>-1?pt.replaceSelection('').concat(Rt.name,"")):re.includes(li)?pt.replaceSelection('').concat(Rt.name,"")):pt.replaceSelection("[".concat(Rt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Ut.id,"?type=").concat(Ut.content_type,")"))}else(Ut==null?void 0:Ut.status)===401&&(document.location.href="/user/login")})},Pt=0;Pt0||Pt.target.offsetWidth>0)&&(Er(),N.setSize("100%","100%"),N.refresh())}}catch(rr){Mt.e(rr)}finally{Mt.f()}});return yt.observe(Dt.current.parentElement),yt}if(N){var Ct=pt();return function(){Ct.unobserve(Dt.current.parentElement)}}},[N,Er]),Object(y.useEffect)(function(){if(N){for(var pt=[],Ct=function(){var Pt=Lt[yt];Mt=Object(z.a)(Pt,2);var rr=Mt[0],Cr=Mt[1],Rt=Object(W.a)({},rr,function(){Vi(Cr)});pt.push(Rt),N.addKeyMap(Rt)},yt=0,Lt=Object.entries(ie);yt0){var pt=new Date().getTime(),Ct=window.sessionStorage.getItem(Nr);pt>=_r+at&&(!Ct||Ct!==We)&&(window.sessionStorage.setItem(Nr,We),xi(!0))}},at),Object(y.useEffect)(function(){Nt(Xt)},[N,Xt]),Object(y.useEffect)(function(){N&&(Zt&&N.focus())},[N,Zt]),Object(y.useEffect)(function(){if(vt&&N){var pt=N.getScrollerElement();function Ct(yt){var Lt=yt.target;if(ti.current){var Mt=Lt.scrollTop/Lt.scrollHeight;ti.current.scrollTop=ti.current.scrollHeight*Mt}}return pt.addEventListener("scroll",Ct),function(){pt.removeEventListener("scroll",Ct)}}},[N,vt]),Object(y.useEffect)(function(){if(N&&Br){function pt(Ct,yt){Br(Ct,yt)}return N.on("beforeChange",pt),function(){N.off("beforeChange",pt)}}},[N,Br]),Object(y.useEffect)(function(){if(N&&kt){function pt(){kt(N.getValue())}return N.on("blur",pt),function(){N.off("blur",pt)}}},[N,kt]),Object(y.useEffect)(function(){if(N){function pt(Ct){var yt=Ct.getValue();Je(yt),_i(new Date().getTime()),Ct.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),nt&&nt(yt)}return N.on("change",pt),function(){N.off("change",pt)}}},[N,nt]),Object(y.useEffect)(function(){N&&(He==null?(N.setValue(""),Je("")):He!==N.getValue()&&(N.setValue(He),Je(He),N.setCursor(N.lineCount(),0)))},[N,He]);var Vi=Object(y.useCallback)(function(pt){var Ct=N.getCursor(),yt=N.getSelection(),Lt=yt.split(`
`);switch(pt){case"bold":return N.replaceSelection("**"+yt+"**"),yt===""&&N.setCursor(Ct.line,Ct.ch+2),N.focus();case"italic":return N.replaceSelection("*"+yt+"*"),yt===""&&N.setCursor(Ct.line,Ct.ch+1),N.focus();case"code":return N.replaceSelection("`"+yt+"`"),yt===""&&N.setCursor(Ct.line,Ct.ch+1),N.focus();case"inline-latex":return N.replaceSelection("`$$"+yt+"$$`"),yt===""&&N.setCursor(Ct.line,Ct.ch+3),N.focus();case"latex":return N.replaceSelection("```latex\n"+yt+"\n```"),N.setCursor(Ct.line+1,yt.length+1),N.focus();case"line-break":return N.replaceSelection(`
`),N.focus();case"list-ul":return yt===""?N.replaceSelection("- "+yt):N.replaceSelection(Lt.map(function(Mt){return Mt===""?"":"- ".concat(Mt)}).join(`
`)),N.focus();case"list-ol":return yt===""?N.replaceSelection("1. "+yt):N.replaceSelection(Lt.map(function(Mt,Gt){return Mt===""?"":"".concat(Gt+1,". ").concat(Mt)}).join(`
`)),N.focus();case"add-null-ch":return yt===""&&N.setCursor(Ct.line,Ct.ch+1),N.replaceSelection(Fe),N.focus();case"inster-template-1":return yt===""&&N.setCursor(Ct.line,Ct.ch),N.replaceSelection(Ve),N.focus();case"eraser":return N.setValue(""),N.focus();case"trigger-watch":return Nt(!vt),N.focus();case"trigger-full-screen":return vr(!gr),N.focus();case Ie:Ur(Ie);return;case Ke:Ur(Ke);return;case Me:Ur(Me);return;case Ze:Ur(Ze);return;default:throw new Error}},[N,vt,gr]),Ei=Object(y.useCallback)(function(pt){Ur("");switch(nr){case Ie:var Ct=pt.title,yt=pt.link;return N.replaceSelection("[".concat(Ct,"](").concat(yt,")")),N.focus();case Ke:var Lt=pt.language,Mt=pt.content;return N.replaceSelection(["```"+Lt,Mt,"```"].join(`
`)),N.focus();case Me:var Gt=pt.src,Pt=pt.alt;return Pt?N.replaceSelection(".concat(Gt,' "').concat(Pt,'" )')):N.replaceSelection("")),N.focus();case Ze:for(var rr=pt.row,Cr=pt.col,Rt=pt.align,li=`
`,Ut=0;Ut300&&(rr=300);var Cr=Tt+rr+"px";Yr(Cr)}}return pt.addEventListener("mousedown",Lt),document.addEventListener("mousemove",Gt),document.addEventListener("mouseup",Mt),function(){pt.removeEventListener("mousedown",Lt),document.removeEventListener("mousemove",Gt),document.removeEventListener("mouseup",Mt)}}},[N,Wt]),Object(y.useEffect)(function(){Yr(Tt)},[Tt]);var ri=xe(ft),fn=xe(Ki),$r={width:ri,height:fn},pn=Object(y.useMemo)(function(){if(_r){var pt=new Date(_r),Ct=pt.getHours(),yt=pt.getMinutes(),Lt=pt.getSeconds();return Ct=Ct<10?"0"+Ct:Ct,yt=yt<10?"0"+yt:yt,Lt=Lt<10?"0"+Lt:Lt,"".concat(Ct,":").concat(yt,":").concat(Lt)}return 0},[_r]);function jn(){window.sessionStorage.removeItem(Nr),xi(!1),_i(0)}function Pi(){xi(!1),_i(0),N.setValue(window.sessionStorage.getItem(Nr))}function ua(pt,Ct){var yt=N.getValue();yt=yt.replace(pt,Ct),Je(yt),N==null||N.setValue(yt)}return A.a.createElement(y.Fragment,null,A.a.createElement("div",{className:"markdown-editor-wrapper",ref:qt},A.a.createElement("div",{className:"markdown-editor-container ".concat(Xe," ").concat(vt?"on-preview":""," ").concat(Bt?"mini":""," ").concat(gr?"full-screen":""),style:$r},A.a.createElement(x,{insertTemp:Ot,watch:vt,fullScreen:gr,showNullButton:It,onActionCallback:Vi,hidetoolBar:Hr,uuid:Jt.current,setOpenPhones:function(){Ft.current=!0}}),A.a.createElement("div",{className:"markdown-editor-body"},A.a.createElement("div",{className:"codemirror-container"},A.a.createElement("textarea",{ref:Dt,placeholder:gi})),vt?A.a.createElement("div",{ref:ti,className:"preview-container"},Kr==="stex"&&A.a.createElement(k,{value:We}),Kr!=="stex"&&A.a.createElement(g.a,{edit:!0,value:We,replaces:ua})):null))),pr?A.a.createElement("a",{ref:Wt,className:"editor-resize"}):null,A.a.createElement(F.a,null,ue[nr]?A.a.createElement(Z.a,{centered:!0,title:ue[nr],visible:!0,onCancel:Si,footer:null,className:"markdown-popup-form"},cn):null))}},SJMd:function(xt,it){/**
* @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 se,oe,Z,D=!1,$,B;window.PR_SHOULD_USE_CONTINUATION=!0;var M,z;(function(){var W=window,P=["break,continue,do,else,for,if,return,while"],R=[P,"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"],y=[R,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],A=[y,"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"],O=[y,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],L=[y,"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"],C="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",T=[y,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],h="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",o=[P,"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"],l=[P,"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"],d=[P,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],w=[A,L,O,T,h,o,l,d],v=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,g="str",k="kwd",E="com",p="typ",c="lit",u="pun",a="pln",b="tag",m="dec",x="src",F="atn",U="atv",K="nocode",V="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function _(Ee){for(var Re=0,Ne=!1,je=!1,Ue=0,Ie=Ee.length;Ue122||(re<65||ye>90||ht.push([Math.max(65,ye)|32,Math.min(re,90)|32]),re<97||ye>122||ht.push([Math.max(97,ye)&~32,Math.min(re,122)&~32]))}}ht.sort(function(be,_e){return be[0]-_e[0]||_e[1]-be[1]});for(var ie=[],ue=[],Ve=0;Vepe[0]&&(pe[1]+1>pe[0]&&Fe.push("-"),Fe.push($e(pe[1])))}return Fe.push("]"),Fe.join("")}function lt(rt){for(var Pe=rt.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")),ht=Pe.length,at=[],Fe=0,Ve=0;Fe=2&&ye==="["?Pe[Fe]=Qe(xe):ye!=="\\"&&(Pe[Fe]=xe.replace(/[a-zA-Z]/g,function(ue){var pe=ue.charCodeAt(0);return"["+String.fromCharCode(pe&~32,pe|32)+"]"}))}return Pe.join("")}for(var tt=[],Ue=0,Ie=Ee.length;Ue=0;)Ne[tt.charAt(rt)]=lt;var Pe=lt[1],ht=""+Pe;Ze.hasOwnProperty(ht)||(Ke.push(Pe),Ze[ht]=null)}Ke.push(/[\0-\uffff]/),je=_(Ke)})();var Ue=Re.length,Ie=function(Me){for(var Ke=Me.sourceCode,Ze=Me.basePos,$e=Me.sourceNode,Qe=[Ze,a],lt=0,tt=Ke.match(je)||[],rt={},Pe=0,ht=tt.length;Pe=5&&Fe.substring(0,5)==="lang-",xe&&!(Ve&&typeof Ve[1]=="string")&&(xe=!1,Fe=x),xe||(rt[at]=Fe)}var re=lt;if(lt+=at.length,!xe)Qe.push(Ze+re,Fe);else{var ie=Ve[1],ue=at.indexOf(ie),pe=ue+ie.length;Ve[2]&&(pe=at.length-Ve[2].length,ue=pe-ie.length);var be=Fe.substring(5);Y($e,Ze+re,at.substring(0,ue),Ie,Qe),Y($e,Ze+re+ue,ie,le(be,ie),Qe),Y($e,Ze+re+pe,at.substring(pe),Ie,Qe)}}Me.decorations=Qe};return Ie}function De(Ee){var Re=[],Ne=[];Ee.tripleQuotedStrings?Re.push([g,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ee.multiLineStrings?Re.push([g,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Re.push([g,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ee.verbatimStrings&&Ne.push([g,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var je=Ee.hashComments;je&&(Ee.cStyleComments?(je>1?Re.push([E,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Re.push([E,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ne.push([g,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Re.push([E,/^#[^\r\n]*/,null,"#"])),Ee.cStyleComments&&(Ne.push([E,/^\/\/[^\r\n]*/,null]),Ne.push([E,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ue=Ee.regexLiterals;if(Ue){var Ie=Ue>1?"":`
\r`,Me=Ie?".":"[\\S\\s]",Ke="/(?=[^/*"+Ie+"])(?:[^/\\x5B\\x5C"+Ie+"]|\\x5C"+Me+"|\\x5B(?:[^\\x5C\\x5D"+Ie+"]|\\x5C"+Me+")*(?:\\x5D|$))+/";Ne.push(["lang-regex",RegExp("^"+V+"("+Ke+")")])}var Ze=Ee.types;Ze&&Ne.push([p,Ze]);var $e=(""+Ee.keywords).replace(/^ | $/g,"");$e.length&&Ne.push([k,new RegExp("^(?:"+$e.replace(/[\s,]+/g,"|")+")\\b"),null]),Re.push([a,/^\s+/,null,` \r
\xA0`]);var Qe="^.[^\\s\\w.$@'\"`/\\\\]*";return Ee.regexLiterals&&(Qe+="(?!s*/)"),Ne.push([c,/^@[a-z_$][a-z_$@0-9]*/i,null],[p,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[a,/^[a-z_$][a-z_$@0-9]*/i,null],[c,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[a,/^\\[\s\S]?/,null],[u,new RegExp(Qe),null]),de(Re,Ne)}var Se=De({keywords:w,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function we(Ee,Re,Ne){for(var je=/(?:^|\s)nocode(?:\s|$)/,Ue=/\r\n?|\n/,Ie=Ee.ownerDocument,Me=Ie.createElement("li");Ee.firstChild;)Me.appendChild(Ee.firstChild);var Ke=[Me];function Ze(Pe){var ht=Pe.nodeType;if(ht==1&&!je.test(Pe.className))if(Pe.nodeName==="br")$e(Pe),Pe.parentNode&&Pe.parentNode.removeChild(Pe);else for(var at=Pe.firstChild;at;at=at.nextSibling)Ze(at);else if((ht==3||ht==4)&&Ne){var Fe=Pe.nodeValue,Ve=Fe.match(Ue);if(Ve){var xe=Fe.substring(0,Ve.index);Pe.nodeValue=xe;var ve=Fe.substring(Ve.index+Ve[0].length);if(ve){var ye=Pe.parentNode;ye.insertBefore(Ie.createTextNode(ve),Pe.nextSibling)}$e(Pe),xe||Pe.parentNode.removeChild(Pe)}}}function $e(Pe){for(;!Pe.nextSibling;)if(Pe=Pe.parentNode,!Pe)return;function ht(Ve,xe){var ve=xe?Ve.cloneNode(!1):Ve,ye=Ve.parentNode;if(ye){var re=ht(ye,1),ie=Ve.nextSibling;re.appendChild(ve);for(var ue=ie;ue;ue=ie)ie=ue.nextSibling,re.appendChild(ue)}return ve}for(var at=ht(Pe.nextSibling,0),Fe;(Fe=at.parentNode)&&Fe.nodeType===1;)at=Fe;Ke.push(at)}for(var Qe=0;Qe=ye&&(Ze+=2),Ie>=re&&(lt+=2)}}finally{Fe&&(Fe.style.display=Ve)}}var Te={};function ge(Ee,Re){for(var Ne=Re.length;--Ne>=0;){var je=Re[Ne];Te.hasOwnProperty(je)?W.console&&console.warn("cannot override language handler %s",je):Te[je]=Ee}}function le(Ee,Re){return Ee&&Te.hasOwnProperty(Ee)||(Ee=/^\s*]*(?:>|$)/],[E,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[u,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^