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