(window.webpackJsonp=window.webpackJsonp||[]).push([[252,5,6,7],{"+NIl":function(vt,Le,ee){(function(ue){ue(ee("VrN/"))})(function(ue){"use strict";ue.defineMode("stex",function(J,O){"use strict";function X(p,m){p.cmdState.push(m)}function F(p){return p.cmdState.length>0?p.cmdState[p.cmdState.length-1]:null}function M(p){var m=p.cmdState.pop();m&&m.closeBracket()}function H(p){for(var m=p.cmdState,b=m.length-1;b>=0;b--){var a=m[b];if(a.name=="DEFAULT")continue;return a}return{styleIdentifier:function(){return null}}}function U(p,m,b){return function(){this.name=p,this.bracketNo=0,this.style=m,this.styles=b,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var P={};P.importmodule=U("importmodule","tag",["string","builtin"]),P.documentclass=U("documentclass","tag",["","atom"]),P.usepackage=U("usepackage","tag",["atom"]),P.begin=U("begin","tag",["atom"]),P.end=U("end","tag",["atom"]),P.label=U("label","tag",["atom"]),P.ref=U("ref","tag",["atom"]),P.eqref=U("eqref","tag",["atom"]),P.cite=U("cite","tag",["atom"]),P.bibitem=U("bibitem","tag",["atom"]),P.Bibitem=U("Bibitem","tag",["atom"]),P.RBibitem=U("RBibitem","tag",["atom"]),P.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function L(p,m){p.f=m}function h(p,m){var b;if(p.match(/^\\[a-zA-Z@]+/)){var a=p.current().slice(1);return b=P.hasOwnProperty(a)?P[a]:P.DEFAULT,b=new b,X(m,b),L(m,T),b.style}if(p.match(/^\\[$&%#{}_]/))return"tag";if(p.match(/^\\[,;!\/\\]/))return"tag";if(p.match("\\["))return L(m,function(s,u){return f(s,u,"\\]")}),"keyword";if(p.match("\\("))return L(m,function(s,u){return f(s,u,"\\)")}),"keyword";if(p.match("$$"))return L(m,function(s,u){return f(s,u,"$$")}),"keyword";if(p.match("$"))return L(m,function(s,u){return f(s,u,"$")}),"keyword";var i=p.next();if(i=="%")return p.skipToEnd(),"comment";if(i=="}"||i=="]"){if(b=F(m),b)b.closeBracket(i),L(m,T);else return"error";return"bracket"}else return i=="{"||i=="["?(b=P.DEFAULT,b=new b,X(m,b),"bracket"):/\d/.test(i)?(p.eatWhile(/[\w.%]/),"atom"):(p.eatWhile(/[\w\-_]/),b=H(m),b.name=="begin"&&(b.argument=p.current()),b.styleIdentifier())}function f(p,m,b){if(p.eatSpace())return null;if(b&&p.match(b))return L(m,h),"keyword";if(p.match(/^\\[a-zA-Z@]+/))return"tag";if(p.match(/^[a-zA-Z]+/))return"variable-2";if(p.match(/^\\[$&%#{}_]/))return"tag";if(p.match(/^\\[,;!\/]/))return"tag";if(p.match(/^[\^_&]/))return"tag";if(p.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(p.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var a=p.next();return a=="{"||a=="}"||a=="["||a=="]"||a=="("||a==")"?"bracket":a=="%"?(p.skipToEnd(),"comment"):"error"}function T(p,m){var b=p.peek(),a;return b=="{"||b=="["?(a=F(m),a.openBracket(b),p.eat(b),L(m,h),"bracket"):/[ \t\r]/.test(b)?(p.eat(b),null):(L(m,h),M(m),h(p,m))}return{startState:function(){var p=O.inMathMode?function(m,b){return f(m,b)}:h;return{cmdState:[],f:p}},copyState:function(p){return{cmdState:p.cmdState.slice(),f:p.f}},token:function(p,m){return m.f(p,m)},blankLine:function(p){p.f=h,p.cmdState.length=0},lineComment:"%"}}),ue.defineMIME("text/x-stex","stex"),ue.defineMIME("text/x-latex","stex")})},"+ua5":function(vt,Le,ee){},"/cxE":function(vt,Le,ee){"use strict";ee.d(Le,"e",function(){return O}),ee.d(Le,"f",function(){return X}),ee.d(Le,"g",function(){return F}),ee.d(Le,"d",function(){return H}),ee.d(Le,"a",function(){return U}),ee.d(Le,"b",function(){return P}),ee.d(Le,"c",function(){return L});var ue=function(){function h(){this.listeners=[],this.unexpectedErrorHandler=function(f){setTimeout(function(){throw f.stack?new Error(f.message+`
`+f.stack):f},0)}}return h.prototype.emit=function(f){this.listeners.forEach(function(T){T(f)})},h.prototype.onUnexpectedError=function(f){this.unexpectedErrorHandler(f),this.emit(f)},h.prototype.onUnexpectedExternalError=function(f){this.unexpectedErrorHandler(f)},h}(),J=new ue;function O(h){H(h)||J.onUnexpectedError(h);return}function X(h){H(h)||J.onUnexpectedExternalError(h);return}function F(h){if(h instanceof Error){var f=h.name,T=h.message,p=h.stacktrace||h.stack;return{$isError:!0,name:f,message:T,stack:p}}return h}var M="Canceled";function H(h){return h instanceof Error&&h.name===M&&h.message===M}function U(){var h=new Error(M);return h.name=h.message,h}function P(h){return h?new Error("Illegal argument: "+h):new Error("Illegal argument")}function L(h){return h?new Error("Illegal state: "+h):new Error("Illegal state")}},"19Vz":function(vt,Le,ee){(function(ue){ue(ee("VrN/"))})(function(ue){ue.defineOption("placeholder","",function(U,P,L){var h=L&&L!=ue.Init;if(P&&!h)U.on("blur",F),U.on("change",M),U.on("swapDoc",M),ue.on(U.getInputField(),"compositionupdate",U.state.placeholderCompose=function(){X(U)}),M(U);else if(!P&&h){U.off("blur",F),U.off("change",M),U.off("swapDoc",M),ue.off(U.getInputField(),"compositionupdate",U.state.placeholderCompose),J(U);var f=U.getWrapperElement();f.className=f.className.replace(" CodeMirror-empty","")}P&&!U.hasFocus()&&F(U)});function J(U){U.state.placeholder&&(U.state.placeholder.parentNode.removeChild(U.state.placeholder),U.state.placeholder=null)}function O(U){J(U);var P=U.state.placeholder=document.createElement("pre");P.style.cssText="height: 0; overflow: visible",P.style.direction=U.getOption("direction"),P.className="CodeMirror-placeholder CodeMirror-line-like";var L=U.getOption("placeholder");typeof L=="string"&&(L=document.createTextNode(L)),P.appendChild(L),U.display.lineSpace.insertBefore(P,U.display.lineSpace.firstChild)}function X(U){setTimeout(function(){var P=!1,L=U.getInputField();L.nodeName=="TEXTAREA"?P=!L.value:U.lineCount()==1&&(P=!/[^\u200b]/.test(L.querySelector(".CodeMirror-line").textContent)),P?O(U):J(U)},20)}function F(U){H(U)&&O(U)}function M(U){var P=U.getWrapperElement(),L=H(U);P.className=P.className.replace(" CodeMirror-empty","")+(L?" CodeMirror-empty":""),L?O(U):J(U)}function H(U){return U.lineCount()===1&&U.getLine(0)===""}})},"1eCo":function(vt,Le,ee){(function(ue){ue(ee("VrN/"))})(function(ue){"use strict";var J={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},O={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ue.defineMode("xml",function(X,F){var M=X.indentUnit,H={},U=F.htmlMode?J:O;for(var P in U)H[P]=U[P];for(var P in F)H[P]=F[P];var L,h;function f(l,A){function S(B){return A.tokenize=B,B(l,A)}var D=l.next();if(D=="<")return l.eat("!")?l.eat("[")?l.match("CDATA[")?S(m("atom","]]>")):null:l.match("--")?S(m("comment","-->")):l.match("DOCTYPE",!0,!0)?(l.eatWhile(/[\w\._\-]/),S(b(1))):null:l.eat("?")?(l.eatWhile(/[\w\._\-]/),A.tokenize=m("meta","?>"),"meta"):(L=l.eat("/")?"closeTag":"openTag",A.tokenize=T,"tag bracket");if(D=="&"){var I;return l.eat("#")?l.eat("x")?I=l.eatWhile(/[a-fA-F\d]/)&&l.eat(";"):I=l.eatWhile(/[\d]/)&&l.eat(";"):I=l.eatWhile(/[\w\.\-:]/)&&l.eat(";"),I?"atom":"error"}else return l.eatWhile(/[^&<]/),null}f.isInText=!0;function T(l,A){var S=l.next();if(S==">"||S=="/"&&l.eat(">"))return A.tokenize=f,L=S==">"?"endTag":"selfcloseTag","tag bracket";if(S=="=")return L="equals",null;if(S=="<"){A.tokenize=f,A.state=u,A.tagName=A.tagStart=null;var D=A.tokenize(l,A);return D?D+" tag error":"tag error"}else return/[\'\"]/.test(S)?(A.tokenize=p(S),A.stringStartCol=l.column(),A.tokenize(l,A)):(l.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(l){var A=function(S,D){for(;!S.eol();)if(S.next()==l){D.tokenize=T;break}return"string"};return A.isInAttribute=!0,A}function m(l,A){return function(S,D){for(;!S.eol();){if(S.match(A)){D.tokenize=f;break}S.next()}return l}}function b(l){return function(A,S){for(var D;(D=A.next())!=null;){if(D=="<")return S.tokenize=b(l+1),S.tokenize(A,S);if(D==">")if(l==1){S.tokenize=f;break}else return S.tokenize=b(l-1),S.tokenize(A,S)}return"meta"}}function a(l,A,S){this.prev=l.context,this.tagName=A,this.indent=l.indented,this.startOfLine=S,(H.doNotIndent.hasOwnProperty(A)||l.context&&l.context.noIndent)&&(this.noIndent=!0)}function i(l){l.context&&(l.context=l.context.prev)}function s(l,A){for(var S;;){if(!l.context)return;if(S=l.context.tagName,!H.contextGrabbers.hasOwnProperty(S)||!H.contextGrabbers[S].hasOwnProperty(A))return;i(l)}}function u(l,A,S){return l=="openTag"?(S.tagStart=A.column(),y):l=="closeTag"?g:u}function y(l,A,S){return l=="word"?(S.tagName=A.current(),h="tag",w):H.allowMissingTagName&&l=="endTag"?(h="tag bracket",w(l,A,S)):(h="error",y)}function g(l,A,S){if(l=="word"){var D=A.current();return S.context&&S.context.tagName!=D&&H.implicitlyClosed.hasOwnProperty(S.context.tagName)&&i(S),S.context&&S.context.tagName==D||H.matchClosing===!1?(h="tag",v):(h="tag error",R)}else return H.allowMissingTagName&&l=="endTag"?(h="tag bracket",v(l,A,S)):(h="error",R)}function v(l,A,S){return l!="endTag"?(h="error",v):(i(S),u)}function R(l,A,S){return h="error",v(l,A,S)}function w(l,A,S){if(l=="word")return h="attribute",C;if(l=="endTag"||l=="selfcloseTag"){var D=S.tagName,I=S.tagStart;return S.tagName=S.tagStart=null,l=="selfcloseTag"||H.autoSelfClosers.hasOwnProperty(D)?s(S,D):(s(S,D),S.context=new a(S,D,I==S.indented)),u}return h="error",w}function C(l,A,S){return l=="equals"?x:(H.allowMissing||(h="error"),w(l,A,S))}function x(l,A,S){return l=="string"?d:l=="word"&&H.allowUnquoted?(h="string",w):(h="error",w(l,A,S))}function d(l,A,S){return l=="string"?d:w(l,A,S)}return{startState:function(l){var A={tokenize:f,state:u,indented:l||0,tagName:null,tagStart:null,context:null};return l!=null&&(A.baseIndent=l),A},token:function(l,A){if(!A.tagName&&l.sol()&&(A.indented=l.indentation()),l.eatSpace())return null;L=null;var S=A.tokenize(l,A);return(S||L)&&S!="comment"&&(h=null,A.state=A.state(L||S,l,A),h&&(S=h=="error"?S+" error":h)),S},indent:function(l,A,S){var D=l.context;if(l.tokenize.isInAttribute)return l.tagStart==l.indented?l.stringStartCol+1:l.indented+M;if(D&&D.noIndent)return ue.Pass;if(l.tokenize!=T&&l.tokenize!=f)return S?S.match(/^(\s*)/)[0].length:0;if(l.tagName)return H.multilineTagIndentPastTag!==!1?l.tagStart+l.tagName.length+2:l.tagStart+M*(H.multilineTagIndentFactor||1);if(H.alignCDATA&&/$/,blockCommentStart:"",configuration:H.htmlMode?"html":"xml",helperType:H.htmlMode?"html":"xml",skipAttribute:function(l){l.state==x&&(l.state=w)},xmlCurrentTag:function(l){return l.tagName?{name:l.tagName,close:l.type=="closeTag"}:null},xmlCurrentContext:function(l){for(var A=[],S=l.context;S;S=S.prev)S.tagName&&A.push(S.tagName);return A.reverse()}}}),ue.defineMIME("text/xml","xml"),ue.defineMIME("application/xml","xml"),ue.mimeModes.hasOwnProperty("text/html")||ue.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(vt,Le,ee){"use strict";ee.d(Le,"a",function(){return O});var ue=ee("JYp7"),J=function(){function X(F){this.element=F,this.next=X.Undefined,this.prev=X.Undefined}return X.Undefined=new X(void 0),X}(),O=function(){function X(){this._first=J.Undefined,this._last=J.Undefined,this._size=0}return Object.defineProperty(X.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),X.prototype.isEmpty=function(){return this._first===J.Undefined},X.prototype.clear=function(){this._first=J.Undefined,this._last=J.Undefined,this._size=0},X.prototype.unshift=function(F){return this._insert(F,!1)},X.prototype.push=function(F){return this._insert(F,!0)},X.prototype._insert=function(F,M){var H=this,U=new J(F);if(this._first===J.Undefined)this._first=U,this._last=U;else if(M){var P=this._last;this._last=U,U.prev=P,P.next=U}else{var L=this._first;this._first=U,U.next=L,L.prev=U}this._size+=1;var h=!1;return function(){h||(h=!0,H._remove(U))}},X.prototype.shift=function(){if(this._first===J.Undefined)return;var F=this._first.element;return this._remove(this._first),F},X.prototype.pop=function(){if(this._last===J.Undefined)return;var F=this._last.element;return this._remove(this._last),F},X.prototype._remove=function(F){if(F.prev!==J.Undefined&&F.next!==J.Undefined){var M=F.prev;M.next=F.next,F.next.prev=M}else F.prev===J.Undefined&&F.next===J.Undefined?(this._first=J.Undefined,this._last=J.Undefined):F.next===J.Undefined?(this._last=this._last.prev,this._last.next=J.Undefined):F.prev===J.Undefined&&(this._first=this._first.next,this._first.prev=J.Undefined);this._size-=1},X.prototype.iterator=function(){var F,M=this._first;return{next:function(){return M===J.Undefined?ue.c:(F?F.value=M.element:F={done:!1,value:M.element},M=M.next,F)}}},X.prototype.toArray=function(){for(var F=[],M=this._first;M!==J.Undefined;M=M.next)F.push(M.element);return F},X}()},"55Ip":function(vt,Le,ee){"use strict";ee.d(Le,"a",function(){return s}),ee.d(Le,"b",function(){return w});var ue=ee("Ty5D"),J=ee("dI71"),O=ee("q1tI"),X=ee.n(O),F=ee("YS25"),M=ee("17x9"),H=ee.n(M),U=ee("wx14"),P=ee("zLVn"),L=ee("9R94"),h=function(x){Object(J.a)(d,x);function d(){for(var A,S=arguments.length,D=new Array(S),I=0;I1&&arguments[1]!==void 0?arguments[1]:0,m=(H[T[p+0]]+H[T[p+1]]+H[T[p+2]]+H[T[p+3]]+"-"+H[T[p+4]]+H[T[p+5]]+"-"+H[T[p+6]]+H[T[p+7]]+"-"+H[T[p+8]]+H[T[p+9]]+"-"+H[T[p+10]]+H[T[p+11]]+H[T[p+12]]+H[T[p+13]]+H[T[p+14]]+H[T[p+15]]).toLowerCase();if(!M(m))throw TypeError("Stringified UUID is invalid");return m}var L=P;function h(T,p,m){T=T||{};var b=T.random||(T.rng||O)();if(b[6]=b[6]&15|64,b[8]=b[8]&63|128,p){m=m||0;for(var a=0;a<16;++a)p[m+a]=b[a];return p}return L(b)}var f=Le.a=h},"7ahc":function(vt,Le,ee){"use strict";ee.d(Le,"a",function(){return y});var ue=ee("k1fw"),J=ee("0Owb"),O=ee("+L6B"),X=ee("2/Rp"),F=ee("y8nQ"),M=ee("Vl3Y"),H=ee("tJVT"),U=ee("OaEy"),P=ee("2fM7"),L=ee("q1tI"),h=ee.n(L),f=ee("VrN/"),T=ee.n(f),p=ee("p77/"),m=ee.n(p),b=ee("c5Ni"),a=ee.n(b),i=P.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},u={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"]};Le.b=function(g){var v=g.callback,R=g.onCancel,w=Object(L.useState)("python"),C=Object(H.a)(w,2),x=C[0],d=C[1];function l(S){d(u[S][1])}function A(S){v(S)}return h.a.createElement(M.a,Object(J.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:A}),h.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},h.a.createElement(P.a,{onChange:l},Object.keys(u).map(function(S){return h.a.createElement(i,{key:S,value:S},u[S][0])}))),h.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},h.a.createElement(y,{mode:x})),h.a.createElement("div",{className:"flex-container flex-end"},h.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(X.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function y(g){var v=g.value,R=g.onChange,w=g.mode,C=g.options,x=C===void 0?{}:C,d=Object(L.useRef)(),l=Object(L.useState)(),A=Object(H.a)(l,2),S=A[0],D=A[1];return Object(L.useEffect)(function(){if(S){function I(B){var j=B.getValue();R&&R(j)}return S.on("change",I),function(){S.off("change",I)}}},[S,R]),Object(L.useEffect)(function(){S&&S.setOption("mode",w)},[S,w]),Object(L.useEffect)(function(){S&&((v!==S.getValue()||v==="")&&setTimeout(function(){S.setValue(v||" ")},300))},[S,v]),Object(L.useEffect)(function(){if(d.current&&!S){var I=T.a.fromTextArea(d.current,Object(ue.a)({mode:w,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},x));D(I)}},[d.current,S]),h.a.createElement("div",{className:"my-codemirror-container"},h.a.createElement("textarea",{ref:d}))}},"8EBN":function(vt,Le,ee){(function(ue){ue(ee("VrN/"))})(function(ue){"use strict";ue.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 J=0;J-1&&X.substring(H+1,X.length);if(U)return ue.findModeByExtension(U)},ue.findModeByName=function(X){X=X.toLowerCase();for(var F=0;F0&&T[T.length-1])&&(a[0]===6||a[0]===2)){L=0;continue}if(a[0]===3&&(!T||a[1]>T[0]&&a[1]=G.length?Y.slice(G.length):Y}).join(`
`)}var a=[],i=[""],s=new p.a.Renderer,u=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function y(){a.length=0,i=[""]}var g={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function v(K,c,E,G){if(c>=K.length||K[c].level<=E)return c;var Y=K[c];G.push("- "+Y.text+""),c++;var V=[];return c=v(K,c,Y.level,V),V.length>0&&(G.push("
"),V.forEach(function(xe){G.push(xe)}),G.push("
")),G.push(" "),c=v(K,c,E,G),c}function R(){return v(a,0,0,i),i.push("
"),i.join("")}var w={heading:function(c){var E=u.exec(c);if(E)return{type:"heading",raw:E[0],depth:E[1].length,text:E[2]}},fences:function(c){var E=this.rules.block.fences.exec(c);if(E){var G=E[0],Y=b(G,E[3]||""),V=E[2]?E[2].trim():E[2];if(["latex","katex","math"].indexOf(V)>=0){var xe=d(),Ge=Y;Y=xe,l[xe]={type:"block",expression:Ge}}return{type:"code",raw:G,lang:V,text:Y}}}},C=/(?:\${2})([^\n`]+?)(?:\${2})/gi,x=0,d=function(){return"__special_katext_id_".concat(x++,"__")},l={};function A(){return l}function S(){x=0,l={}}function D(K){return K=K.replace(C,function(c,E){var G=d();return l[G]={type:"inline",expression:E},G}),K}var I=s.listitem;s.listitem=function(K){return I(D(K))};var B=s.paragraph;s.paragraph=function(K){return B(D(K))};var j=s.tablecell;s.tablecell=function(K,c){return j(D(K),c)},s.code=function(K,c,E){var G=(c||"").match(/\S*/)[0];return G?["latex","katex","math"].indexOf(G)>=0?"".concat(K,"
"):'
').concat(E?K:Object(m.escape)(K,!0),`
`):''+(E?K:Object(m.escape)(K,!0))+"
"},s.heading=function(K,c,E){var G=this.options.headerPrefix+E.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return a.push({anchor:G,level:c,text:K}),"'+K+""},p.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),p.a.use({tokenizer:w,renderer:s});var z=p.a,_=ee("SJMd"),N=ee("ulZh"),$=ee.n(N),q=ee("m3rI"),le=ee("Oy/b"),pe=ee("p5ED"),Pe=ee("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Se=function(K,c){return(Se=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,G){E.__proto__=G}||function(E,G){for(var Y in G)Object.prototype.hasOwnProperty.call(G,Y)&&(E[Y]=G[Y])})(K,c)};function ke(K,c){function E(){this.constructor=K}Se(K,c),K.prototype=c===null?Object.create(c):(E.prototype=c.prototype,new E)}function Ae(K,c,E,G){return new(E||(E=Promise))(function(Y,V){function xe(pt){try{tt(G.next(pt))}catch(Ve){V(Ve)}}function Ge(pt){try{tt(G.throw(pt))}catch(Ve){V(Ve)}}function tt(pt){var Ve;pt.done?Y(pt.value):(Ve=pt.value,Ve instanceof E?Ve:new E(function(At){At(Ve)})).then(xe,Ge)}tt((G=G.apply(K,c||[])).next())})}function Te(K,c){var E,G,Y,V,xe={label:0,sent:function(){if(1&Y[0])throw Y[1];return Y[1]},trys:[],ops:[]};return V={next:Ge(0),throw:Ge(1),return:Ge(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function Ge(tt){return function(pt){return function(Ve){if(E)throw new TypeError("Generator is already executing.");for(;xe;)try{if(E=1,G&&(Y=2&Ve[0]?G.return:Ve[0]?G.throw||((Y=G.return)&&Y.call(G),0):G.next)&&!(Y=Y.call(G,Ve[1])).done)return Y;switch(G=0,Y&&(Ve=[2&Ve[0],Y.value]),Ve[0]){case 0:case 1:Y=Ve;break;case 4:return xe.label++,{value:Ve[1],done:!1};case 5:xe.label++,G=Ve[1],Ve=[0];continue;case 7:Ve=xe.ops.pop(),xe.trys.pop();continue;default:if(!(Y=xe.trys,(Y=Y.length>0&&Y[Y.length-1])||Ve[0]!==6&&Ve[0]!==2)){xe=0;continue}if(Ve[0]===3&&(!Y||Ve[1]>Y[0]&&Ve[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(V){var xe=document.createElement("div");xe.className=""+E.toolbarButtonStyleClass.name,xe.setAttribute("data-type-name",V.typeName),xe.innerHTML=V.icon,xe.addEventListener("click",function(){E.markerToolbarButtonClicked(xe,V)}),E.buttons.push(xe),E.markerButtons.push(xe)}),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 Y=document.createElement("div");Y.className=this.toolbarBlockStyleClass.name,Y.style.whiteSpace="nowrap",Y.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(Y),this.addActionButton(Y,'',"render"),this.addActionButton(Y,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},K.prototype.addButtonClickListener=function(c){this.buttonClickListeners.push(c)},K.prototype.removeButtonClickListener=function(c){this.buttonClickListeners.indexOf(c)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(c),1)},K.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},K.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var c=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var E=0;E0&&this.buttonClickListeners.forEach(function(G){return G("marker",E)}),this.markerButtonOverflowBlock.style.display="none"},K.prototype.actionToolbarButtonClicked=function(c,E){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(G){return G("action",E)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},K.prototype.setActiveButton=function(c){this.resetButtonStyles(),c.className=c.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),c.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},K.prototype.setActiveMarkerButton=function(c){var E=this.markerButtons.find(function(G){return G.getAttribute("data-type-name")===c});E&&this.setActiveButton(E)},K.prototype.setCurrentMarker=function(c){var E=this;this.currentMarker=c,this.buttons.filter(function(G){return/delete|notes/.test(G.getAttribute("data-action"))}).forEach(function(G){E.currentMarker===void 0?(G.style.fillOpacity="0.4",G.style.pointerEvents="none"):(G.style.fillOpacity="1",G.style.pointerEvents="all")})},K}(),De=function(){function K(c,E,G,Y){this.panels=[],this.panelButtons=[],this.markerjsContainer=c,this.displayMode=E,this.uiStyleSettings=G,this.styles=Y,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return K.prototype.addStyles=function(){var c;this.toolboxStyleClass=this.styles.addClass(new oe("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 oe("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var E=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new oe("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new oe("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new oe("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 oe("toolbox-panel-row_colors",`
background-color: `+((c=this.uiStyleSettings.toolboxBackgroundColor)!==null&&c!==void 0?c:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new oe("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*E)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*E)+`px;
padding: `+E+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new oe("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new oe("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new ie("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new ie("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},K.prototype.show=function(c){var E;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=c,this.uiContainer.className=this.toolboxStyleClass.name+" "+((E=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&E!==void 0?E:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},K.prototype.setPanelButtons=function(c){var E,G,Y=this;this.panels=c,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((E=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&E!==void 0?E: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(V){var xe;V.uiStyleSettings=Y.uiStyleSettings;var Ge=document.createElement("div");Ge.className=Y.toolboxButtonStyleClass.name+" "+((xe=Y.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&xe!==void 0?xe:Y.toolboxButtonStyleColorsClass.name),Ge.innerHTML=V.icon,Ge.title=V.title,Ge.addEventListener("click",function(){Y.panelButtonClick(V)}),Y.panelButtons.push(Ge),Y.buttonRow.appendChild(Ge)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},K.prototype.panelButtonClick=function(c){var E=this,G=-1;if(c!==this.activePanel){G=this.panels.indexOf(c),this.panelRow.innerHTML="";var Y=c.getUi();Y.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(Y),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=c}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){E.displayMode==="inline"?E.panelRow.style.display="none":E.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(V,xe){var Ge,tt;V.className=E.toolboxButtonStyleClass.name+" "+(xe===G?""+((Ge=E.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ge!==void 0?Ge:E.toolboxActiveButtonStyleColorsClass.name):""+((tt=E.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&tt!==void 0?tt:E.toolboxButtonStyleColorsClass.name))})},K}(),Ne=function(K,c){this.title=K,this.icon=c},Fe=function(K){function c(E,G,Y,V){var xe=K.call(this,E,V||'')||this;return xe.colors=[],xe.addTransparent=!1,xe.colorBoxes=[],xe.colors=G,xe.currentColor=Y,xe.setCurrentColor=xe.setCurrentColor.bind(xe),xe.getColorBox=xe.getColorBox.bind(xe),xe}return ke(c,K),c.prototype.getUi=function(){var E=this,G=document.createElement("div");return G.style.overflow="hidden",G.style.whiteSpace="nowrap",this.colors.forEach(function(Y){var V=E.getColorBox(Y);G.appendChild(V),E.colorBoxes.push(V)}),G},c.prototype.getColorBox=function(E){var G=this,Y=this.uiStyleSettings.toolbarHeight/4,V=this.uiStyleSettings.toolbarHeight-Y,xe=document.createElement("div");xe.style.display="inline-block",xe.style.boxSizing="content-box",xe.style.width=V-2+"px",xe.style.height=V-2+"px",xe.style.padding="1px",xe.style.marginRight="2px",xe.style.marginBottom="2px",xe.style.borderWidth="2px",xe.style.borderStyle="solid",xe.style.borderRadius=(V+2)/2+"px",xe.style.borderColor=E===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",xe.addEventListener("click",function(){G.setCurrentColor(E,xe)});var Ge=document.createElement("div");return Ge.style.display="inline-block",Ge.style.width=V-2+"px",Ge.style.height=V-2+"px",Ge.style.backgroundColor=E,Ge.style.borderRadius=V/2+"px",E==="transparent"&&(Ge.style.fill=this.uiStyleSettings.toolboxAccentColor,Ge.innerHTML=``),xe.appendChild(Ge),xe},c.prototype.setCurrentColor=function(E,G){var Y=this;this.currentColor=E,this.colorBoxes.forEach(function(V){V.style.borderColor=V===G?Y.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(E)},c}(Ne),je=function(){function K(c,E,G){this._state="new",this._isSelected=!1,this._container=c,this._overlayContainer=E,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(c){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(c,E){},K.prototype.dblClick=function(c,E){},K.prototype.manipulate=function(c){},K.prototype.pointerUp=function(c){this.stateChanged()},K.prototype.dispose=function(){},K.prototype.addMarkerVisualToContainer=function(c){this.container.childNodes.length>0?this.container.insertBefore(c,this.container.childNodes[0]):this.container.appendChild(c)},K.prototype.getState=function(){return{typeName:K.typeName,state:this.state,notes:this.notes}},K.prototype.restoreState=function(c){this._state=c.state,this.notes=c.notes},K.prototype.scale=function(c,E){},K.prototype.colorChanged=function(c){this.onColorChanged&&this.onColorChanged(c),this.stateChanged()},K.prototype.fillColorChanged=function(c){this.onFillColorChanged&&this.onFillColorChanged(c),this.stateChanged()},K.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var c=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),c.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(c)&&this.onStateChanged(this)}},K.typeName="MarkerBase",K}(),Ue=function(){function K(){this.findGripByVisual=this.findGripByVisual.bind(this)}return K.prototype.findGripByVisual=function(c){return this.topLeft.ownsTarget(c)?this.topLeft:this.topCenter.ownsTarget(c)?this.topCenter:this.topRight.ownsTarget(c)?this.topRight:this.centerLeft.ownsTarget(c)?this.centerLeft:this.centerRight.ownsTarget(c)?this.centerRight:this.bottomLeft.ownsTarget(c)?this.bottomLeft:this.bottomCenter.ownsTarget(c)?this.bottomCenter:this.bottomRight.ownsTarget(c)?this.bottomRight:void 0},K}(),rt=function(){function K(){this.GRIP_SIZE=10,this.visual=he.createGroup(),this.visual.appendChild(he.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(he.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return K.prototype.ownsTarget=function(c){return c===this.visual||c===this.visual.childNodes[0]||c===this.visual.childNodes[1]},K}(),Qe=function(){function K(){}return K.toITransformMatrix=function(c){return{a:c.a,b:c.b,c:c.c,d:c.d,e:c.e,f:c.f}},K.toSVGMatrix=function(c,E){return c.a=E.a,c.b=E.b,c.c=E.c,c.d=E.d,c.e=E.e,c.f=E.f,c},K}(),qe=function(K){function c(E,G,Y){var V=K.call(this,E,G,Y)||this;return V.left=0,V.top=0,V.width=0,V.height=0,V.defaultSize={x:50,y:20},V.offsetX=0,V.offsetY=0,V.rotationAngle=0,V.CB_DISTANCE=10,V._suppressMarkerCreateEvent=!1,V.container.transform.baseVal.appendItem(he.createTransform()),V.setupControlBox(),V}return ke(c,K),Object.defineProperty(c.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"visual",{get:function(){return this._visual},set:function(E){this._visual=E;var G=he.createTransform();this._visual.transform.baseVal.appendItem(G)},enumerable:!1,configurable:!0}),c.prototype.ownsTarget=function(E){return!!K.prototype.ownsTarget.call(this,E)||!!(this.controlGrips.findGripByVisual(E)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(E))},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.state==="new"&&(this.left=E.x,this.top=E.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var Y=this.unrotatePoint(E);if(this.manipulationStartX=Y.x,this.manipulationStartY=Y.y,this.offsetX=Y.x-this.left,this.offsetY=Y.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 V=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=V.x-this.width/2,this.top=V.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var xe=this.container.transform.baseVal.getItem(0);xe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(xe,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},c.prototype.pointerUp=function(E){var G=this.state;K.prototype.pointerUp.call(this,E),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(E),this._state="select",G==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},c.prototype.moveVisual=function(E){this.visual.style.transform="translate("+E.x+"px, "+E.y+"px)"},c.prototype.manipulate=function(E){var G=this.unrotatePoint(E);this.state==="creating"?this.resize(E):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(E)},c.prototype.resize=function(E){var G=this.manipulationStartLeft,Y=this.manipulationStartWidth,V=this.manipulationStartTop,xe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:G=this.manipulationStartLeft+E.x-this.manipulationStartX,Y=this.manipulationStartWidth+this.manipulationStartLeft-G;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:Y=this.manipulationStartWidth+E.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:V=this.manipulationStartTop+E.y-this.manipulationStartY,xe=this.manipulationStartHeight+this.manipulationStartTop-V;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:xe=this.manipulationStartHeight+E.y-this.manipulationStartY}Y>=0?(this.left=G,this.width=Y):(this.left=G+Y,this.width=-Y),xe>=0?(this.top=V,this.height=xe):(this.top=V+xe,this.height=-xe),this.setSize()},c.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},c.prototype.rotate=function(E){if(Math.abs(E.x-this.centerX)>.1){var G=Math.sign(E.x-this.centerX);this.rotationAngle=180*Math.atan((E.y-this.centerY)/(E.x-this.centerX))/Math.PI+90*G,this.applyRotation()}},c.prototype.applyRotation=function(){var E=this.container.transform.baseVal.getItem(0);E.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(E,0)},c.prototype.rotatePoint=function(E){if(this.rotationAngle===0)return E;var G=this.container.getCTM(),Y=he.createPoint(E.x,E.y);return{x:(Y=Y.matrixTransform(G)).x,y:Y.y}},c.prototype.unrotatePoint=function(E){if(this.rotationAngle===0)return E;var G=this.container.getCTM();G=G.inverse();var Y=he.createPoint(E.x,E.y);return{x:(Y=Y.matrixTransform(G)).x,y:Y.y}},c.prototype.select=function(){K.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},c.prototype.deselect=function(){K.prototype.deselect.call(this),this.controlBox.style.display="none"},c.prototype.setupControlBox=function(){this.controlBox=he.createGroup();var E=he.createTransform();E.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(E),this.container.appendChild(this.controlBox),this.controlRect=he.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=he.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"},c.prototype.adjustControlBox=function(){var E=this.controlBox.transform.baseVal.getItem(0);E.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(E,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()},c.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()},c.prototype.createGrip=function(){var E=new rt;return E.visual.transform.baseVal.appendItem(he.createTransform()),this.controlBox.appendChild(E.visual),E},c.prototype.positionGrips=function(){var E=this.controlGrips.topLeft.GRIP_SIZE,G=-E/2,Y=G,V=(this.width+this.CB_DISTANCE)/2-E/2,xe=(this.height+this.CB_DISTANCE)/2-E/2,Ge=this.height+this.CB_DISTANCE-E/2,tt=this.width+this.CB_DISTANCE-E/2;this.positionGrip(this.controlGrips.topLeft.visual,G,Y),this.positionGrip(this.controlGrips.topCenter.visual,V,Y),this.positionGrip(this.controlGrips.topRight.visual,tt,Y),this.positionGrip(this.controlGrips.centerLeft.visual,G,xe),this.positionGrip(this.controlGrips.centerRight.visual,tt,xe),this.positionGrip(this.controlGrips.bottomLeft.visual,G,Ge),this.positionGrip(this.controlGrips.bottomCenter.visual,V,Ge),this.positionGrip(this.controlGrips.bottomRight.visual,tt,Ge),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,V,Y-3*this.CB_DISTANCE)},c.prototype.positionGrip=function(E,G,Y){var V=E.transform.baseVal.getItem(0);V.setTranslate(G,Y),E.transform.baseVal.replaceItem(V,0)},c.prototype.hideControlBox=function(){this.controlBox.style.display="none"},c.prototype.showControlBox=function(){this.controlBox.style.display=""},c.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Qe.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Qe.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},K.prototype.getState.call(this))},c.prototype.restoreState=function(E){K.prototype.restoreState.call(this,E);var G=E;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(Qe.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,G.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Qe.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,G.containerTransformMatrix))},c.prototype.scale=function(E,G){K.prototype.scale.call(this,E,G);var Y=this.rotatePoint({x:this.left,y:this.top}),V=this.unrotatePoint({x:Y.x*E,y:Y.y*G});this.left=V.x,this.top=V.y,this.width=this.width*E,this.height=this.height*G,this.adjustControlBox()},c}(je),Ye=function(K){function c(E,G,Y){var V=K.call(this,E,G,Y)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.createVisual=V.createVisual.bind(V),V}return ke(c,K),c.prototype.ownsTarget=function(E){return!(!K.prototype.ownsTarget.call(this,E)&&E!==this.visual)},c.prototype.createVisual=function(){this.visual=he.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)},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.state==="new"&&(this.createVisual(),this.moveVisual(E),this._state="creating")},c.prototype.manipulate=function(E){K.prototype.manipulate.call(this,E)},c.prototype.resize=function(E){K.prototype.resize.call(this,E),this.setSize()},c.prototype.setSize=function(){K.prototype.setSize.call(this),he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},c.prototype.pointerUp=function(E){K.prototype.pointerUp.call(this,E),this.setSize()},c.prototype.setStrokeColor=function(E){this.strokeColor=E,this.visual&&he.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(E),this.stateChanged()},c.prototype.setFillColor=function(E){this.fillColor=E,this.visual&&he.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},c.prototype.setStrokeWidth=function(E){this.strokeWidth=E,this.visual&&he.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},c.prototype.setStrokeDasharray=function(E){this.strokeDasharray=E,this.visual&&he.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},c.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))},c.prototype.restoreState=function(E){var G=E;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,E),this.setSize()},c.prototype.scale=function(E,G){K.prototype.scale.call(this,E,G),this.setSize()},c.title="Rectangle marker",c}(qe),nt=function(K){function c(E,G,Y,V){var xe=K.call(this,E,V||'')||this;return xe.widths=[],xe.widthBoxes=[],xe.widths=G,xe.currentWidth=Y,xe.setCurrentWidth=xe.setCurrentWidth.bind(xe),xe}return ke(c,K),c.prototype.getUi=function(){var E=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",this.widths.forEach(function(Y){var V=document.createElement("div");V.style.display="flex",V.style.flexGrow="2",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=Y===E.currentWidth?E.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){E.setCurrentWidth(Y,V)}),G.appendChild(V);var xe=document.createElement("div");xe.innerText=Y.toString(),xe.style.marginRight="5px",V.appendChild(xe);var Ge=document.createElement("div");Ge.style.minHeight="20px",Ge.style.flexGrow="2",Ge.style.display="flex",Ge.style.alignItems="center";var tt=document.createElement("hr");tt.style.minWidth="20px",tt.style.border="0px",tt.style.borderTop=Y+"px solid "+E.uiStyleSettings.toolboxColor,tt.style.flexGrow="2",Ge.appendChild(tt),V.appendChild(Ge),E.widthBoxes.push(V)}),G},c.prototype.setCurrentWidth=function(E,G){var Y=this;this.currentWidth=E,this.widthBoxes.forEach(function(V){V.style.borderColor=V===G?Y.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},c}(Ne),$e=function(K){function c(E,G,Y,V){var xe=K.call(this,E,V||'')||this;return xe.styles=[],xe.styleBoxes=[],xe.styles=G,xe.currentStyle=Y,xe.setCurrentStyle=xe.setCurrentStyle.bind(xe),xe}return ke(c,K),c.prototype.getUi=function(){var E=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",this.styles.forEach(function(Y){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/E.styles.length-5+"%",V.style.borderColor=Y===E.currentStyle?E.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){E.setCurrentStyle(Y,V)}),G.appendChild(V);var xe=document.createElement("div");xe.style.minHeight="20px",xe.style.flexGrow="2",xe.style.overflow="hidden";var Ge=``;xe.innerHTML=Ge,V.appendChild(xe),E.styleBoxes.push(V)}),G},c.prototype.setCurrentStyle=function(E,G){var Y=this;this.currentStyle=E,this.styleBoxes.forEach(function(V){V.style.borderColor=V===G?Y.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},c}(Ne),et=function(K){function c(E,G,Y){var V=K.call(this,E,G,Y)||this;return V.strokeColor=Y.defaultColor,V.strokeWidth=Y.defaultStrokeWidth,V.strokeDasharray=Y.defaultStrokeDasharray,V.strokePanel=new Fe("Line color",Y.defaultColorSet,Y.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new nt("Line width",Y.defaultStrokeWidths,Y.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new $e("Line style",Y.defaultStrokeDasharrays,Y.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return ke(c,K),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=K.prototype.getState.call(this);return E.typeName=c.typeName,E},c.typeName="FrameMarker",c.title="Frame marker",c.icon='',c}(Ye),_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},Je=function(K){function c(E,G,Y){var V=K.call(this,E,G,Y)||this;return V.x1=0,V.y1=0,V.x2=0,V.y2=0,V.defaultLength=50,V.manipulationStartX=0,V.manipulationStartY=0,V.manipulationStartX1=0,V.manipulationStartY1=0,V.manipulationStartX2=0,V.manipulationStartY2=0,V.setupControlBox(),V}return ke(c,K),c.prototype.ownsTarget=function(E){return!!K.prototype.ownsTarget.call(this,E)||!(!this.grip1.ownsTarget(E)&&!this.grip2.ownsTarget(E))},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.manipulationStartX=E.x,this.manipulationStartY=E.y,this.state==="new"&&(this.x1=E.x,this.y1=E.y,this.x2=E.x,this.y2=E.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")},c.prototype.pointerUp=function(E){var G=this.state;K.prototype.pointerUp.call(this,E),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(E),this._state="select",G==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},c.prototype.adjustVisual=function(){},c.prototype.manipulate=function(E){this.state==="creating"?this.resize(E):this.state==="move"?(this.x1=this.manipulationStartX1+E.x-this.manipulationStartX,this.y1=this.manipulationStartY1+E.y-this.manipulationStartY,this.x2=this.manipulationStartX2+E.x-this.manipulationStartX,this.y2=this.manipulationStartY2+E.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(E)},c.prototype.resize=function(E){switch(this.activeGrip){case this.grip1:this.x1=E.x,this.y1=E.y;break;case this.grip2:case void 0:this.x2=E.x,this.y2=E.y}this.adjustVisual(),this.adjustControlBox()},c.prototype.select=function(){K.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},c.prototype.deselect=function(){K.prototype.deselect.call(this),this.controlBox.style.display="none"},c.prototype.setupControlBox=function(){this.controlBox=he.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},c.prototype.adjustControlBox=function(){this.positionGrips()},c.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},c.prototype.createGrip=function(){var E=new rt;return E.visual.transform.baseVal.appendItem(he.createTransform()),this.controlBox.appendChild(E.visual),E},c.prototype.positionGrips=function(){var E=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-E/2,this.y1-E/2),this.positionGrip(this.grip2.visual,this.x2-E/2,this.y2-E/2)},c.prototype.positionGrip=function(E,G,Y){var V=E.transform.baseVal.getItem(0);V.setTranslate(G,Y),E.transform.baseVal.replaceItem(V,0)},c.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},K.prototype.getState.call(this))},c.prototype.restoreState=function(E){K.prototype.restoreState.call(this,E);var G=E;this.x1=G.x1,this.y1=G.y1,this.x2=G.x2,this.y2=G.y2},c.prototype.scale=function(E,G){K.prototype.scale.call(this,E,G),this.x1=this.x1*E,this.y1=this.y1*G,this.x2=this.x2*E,this.y2=this.y2*G,this.adjustVisual(),this.adjustControlBox()},c}(je),st=function(K){function c(E,G,Y){var V=K.call(this,E,G,Y)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.strokeColor=Y.defaultColor,V.strokeWidth=Y.defaultStrokeWidth,V.strokeDasharray=Y.defaultStrokeDasharray,V.strokePanel=new Fe("Line color",Y.defaultColorSet,Y.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new nt("Line width",Y.defaultStrokeWidths,Y.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new $e("Line style",Y.defaultStrokeDasharrays,Y.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return ke(c,K),c.prototype.ownsTarget=function(E){return!(!K.prototype.ownsTarget.call(this,E)&&E!==this.visual&&E!==this.selectorLine&&E!==this.visibleLine)},c.prototype.createVisual=function(){this.visual=he.createGroup(),this.selectorLine=he.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=he.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)},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},c.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()),he.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),he.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),he.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},c.prototype.setStrokeColor=function(E){this.strokeColor=E,this.adjustVisual(),this.colorChanged(E)},c.prototype.setStrokeWidth=function(E){this.strokeWidth=E,this.adjustVisual()},c.prototype.setStrokeDasharray=function(E){this.strokeDasharray=E,this.adjustVisual(),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},K.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){K.prototype.restoreState.call(this,E);var G=E;this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.createVisual(),this.adjustVisual()},c.typeName="LineMarker",c.title="Line marker",c.icon='',c}(Je),Be=function(K){function c(E,G,Y,V){var xe=K.call(this,E,V||'')||this;return xe.fonts=[],xe.fontBoxes=[],xe.fonts=G,xe.currentFont=Y,xe.setCurrentFont=xe.setCurrentFont.bind(xe),xe}return ke(c,K),c.prototype.getUi=function(){var E=this,G=document.createElement("div");return G.style.overflow="hidden",G.style.flexGrow="2",this.fonts.forEach(function(Y){var V=document.createElement("div");V.style.display="inline-block",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/E.fonts.length-5+"%",V.style.borderColor=Y===E.currentFont?E.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){E.setCurrentFont(Y,V)}),G.appendChild(V);var xe=document.createElement("div");xe.style.display="flex",xe.style.minHeight="20px",xe.style.flexGrow="2",xe.style.fontFamily=Y,xe.style.overflow="hidden";var Ge=document.createElement("div");Ge.style.whiteSpace="nowrap",Ge.style.overflow="hidden",Ge.style.textOverflow="ellipsis",Ge.innerHTML="The quick brown fox jumps over the lazy dog",xe.appendChild(Ge),V.appendChild(xe),E.fontBoxes.push(V)}),G},c.prototype.setCurrentFont=function(E,G){var Y=this;this.currentFont=E,this.fontBoxes.forEach(function(V){V.style.borderColor=V===G?Y.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},c}(Ne),ze=function(K){function c(E,G,Y){var V=K.call(this,E,G,Y)||this;return V.color="transparent",V.padding=5,V.DEFAULT_TEXT="your text here",V.text=V.DEFAULT_TEXT,V.isMoved=!1,V.color=Y.defaultColor,V.fontFamily=Y.defaultFontFamily,V.defaultSize={x:100,y:30},V.setColor=V.setColor.bind(V),V.setFont=V.setFont.bind(V),V.renderText=V.renderText.bind(V),V.sizeText=V.sizeText.bind(V),V.textEditDivClicked=V.textEditDivClicked.bind(V),V.showTextEditor=V.showTextEditor.bind(V),V.setSize=V.setSize.bind(V),V.positionTextEditor=V.positionTextEditor.bind(V),V.colorPanel=new Fe("Color",Y.defaultColorSet,Y.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.fontFamilyPanel=new Be("Font",Y.defaultFontFamilies,Y.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V}return ke(c,K),c.prototype.ownsTarget=function(E){if(K.prototype.ownsTarget.call(this,E)||E===this.visual||E===this.textElement||E===this.bgRectangle)return!0;var G=!1;return this.textElement.childNodes.forEach(function(Y){Y===E&&(G=!0)}),G},c.prototype.createVisual=function(){this.visual=he.createGroup(),this.bgRectangle=he.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=he.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(he.createTransform()),this.textElement.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.isMoved=!1,this.pointerDownPoint=E,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(E),this._state="creating")},c.prototype.renderText=function(){var E=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){E.textElement.appendChild(he.createTSpan(G.trim()===""?" ":G.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},c.prototype.getTextScale=function(){var E=this.textElement.getBBox(),G=1;if(E.width>0&&E.height>0){var Y=(1*this.width-this.width*this.padding*2/100)/E.width,V=(1*this.height-this.height*this.padding*2/100)/E.height;G=Math.min(Y,V)}return G},c.prototype.getTextPosition=function(E){var G=this.textElement.getBBox(),Y=0,V=0;return G.width>0&&G.height>0&&(Y=(this.width-G.width*E)/2,V=this.height/2-G.height*E/2),{x:Y,y:V}},c.prototype.sizeText=function(){var E=this.textElement.getBBox(),G=this.getTextScale(),Y=this.getTextPosition(G);Y.y-=E.y*G,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+Y.x+"px, "+Y.y+"px) scale("+G+", "+G+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(Y.x,Y.y),this.textElement.transform.baseVal.getItem(1).setScale(G,G))},c.prototype.manipulate=function(E){K.prototype.manipulate.call(this,E),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(E.x-this.pointerDownPoint.x)>5||Math.abs(E.y-this.pointerDownPoint.y)>5)},c.prototype.resize=function(E){K.prototype.resize.call(this,E),this.isMoved=!0,this.setSize(),this.sizeText()},c.prototype.setSize=function(){K.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},c.prototype.pointerUp=function(E){var G=this.state;G==="creating"&&(this._suppressMarkerCreateEvent=!0),K.prototype.pointerUp.call(this,E),this.setSize(),(G==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},c.prototype.showTextEditor=function(){var E=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(E.textEditor.style.fontSize);E.textEditor.clientWidth>=Number.parseInt(E.textEditor.style.maxWidth)&&G>.9;)G-=.1,E.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 Y=G.clipboardData.getData("text"),V=window.getSelection();if(!V.rangeCount)return!1;V.deleteFromDocument(),V.getRangeAt(0).insertNode(document.createTextNode(Y)),G.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){E.textEditDivClicked(E.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},c.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var E=this.getTextScale(),G=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),Y=this.textElement.getBBox(),V={x:Y.width*E,y:Y.height*E};G.x-=V.x/2,G.y-=V.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*E,12)+"px",this.textElement.style.display="none"}},c.prototype.textEditDivClicked=function(E){this.text=E.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},c.prototype.select=function(){K.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},c.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),K.prototype.deselect.call(this)},c.prototype.dblClick=function(E,G){K.prototype.dblClick.call(this,E,G),this.showTextEditor()},c.prototype.setColor=function(E){this.textElement&&he.setAttributes(this.textElement,[["fill",E]]),this.color=E,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(E)},c.prototype.setFont=function(E){this.textElement&&he.setAttributes(this.textElement,[["font-family",E]]),this.fontFamily=E,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},c.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},c.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},K.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){var G=E;this.color=G.color,this.fontFamily=G.fontFamily,this.padding=G.padding,this.text=G.text,this.createVisual(),K.prototype.restoreState.call(this,E),this.setSize()},c.prototype.scale=function(E,G){K.prototype.scale.call(this,E,G),this.setSize(),this.sizeText(),this.positionTextEditor()},c.typeName="TextMarker",c.title="Text marker",c.icon='',c}(qe),Ce=function(K){function c(E,G,Y){var V=K.call(this,E,G,Y)||this;return V.color="transparent",V.lineWidth=3,V.drawing=!1,V.pixelRatio=1,V.color=Y.defaultColor,V.lineWidth=Y.defaultStrokeWidth,V.pixelRatio=Y.freehandPixelRatio,V.setColor=V.setColor.bind(V),V.addCanvas=V.addCanvas.bind(V),V.finishCreation=V.finishCreation.bind(V),V.setLineWidth=V.setLineWidth.bind(V),V.colorPanel=new Fe("Color",Y.defaultColorSet,Y.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.lineWidthPanel=new nt("Line width",Y.defaultStrokeWidths,Y.defaultStrokeWidth),V.lineWidthPanel.onWidthChanged=V.setLineWidth,V}return ke(c,K),c.prototype.ownsTarget=function(E){return!(!K.prototype.ownsTarget.call(this,E)&&E!==this.visual&&E!==this.drawingImage)},c.prototype.createVisual=function(){this.visual=he.createGroup(),this.drawingImage=he.createImage(),this.visual.appendChild(this.drawingImage);var E=he.createTransform();this.visual.transform.baseVal.appendItem(E),this.addMarkerVisualToContainer(this.visual)},c.prototype.pointerDown=function(E,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(E.x,E.y),this.drawing=!0):K.prototype.pointerDown.call(this,E,G)},c.prototype.manipulate=function(E){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(E.x,E.y),this.canvasContext.stroke()):K.prototype.manipulate.call(this,E)},c.prototype.resize=function(E){K.prototype.resize.call(this,E),he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},c.prototype.pointerUp=function(E){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):K.prototype.pointerUp.call(this,E)},c.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)},c.prototype.select=function(){this.state==="creating"&&this.finishCreation(),K.prototype.select.call(this)},c.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),K.prototype.deselect.call(this)},c.prototype.finishCreation=function(){for(var E=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),G=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],Y=G[0],V=G[1],xe=G[2],Ge=G[3],tt=!1,pt=0;pt0&&(tt=!0,ptGe&&(Ge=pt),Ve>xe&&(xe=Ve));if(tt){this.left=Y/this.pixelRatio,this.top=V/this.pixelRatio,this.width=(xe-Y)/this.pixelRatio,this.height=(Ge-V)/this.pixelRatio;var At=document.createElement("canvas");At.width=xe-Y,At.height=Ge-V,At.getContext("2d").putImageData(this.canvasContext.getImageData(Y,V,xe-Y,Ge-V),0,0),this.drawingImgUrl=At.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},c.prototype.setDrawingImage=function(){he.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},c.prototype.setColor=function(E){this.color=E,this.colorChanged(E)},c.prototype.setLineWidth=function(E){this.lineWidth=E},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({drawingImgUrl:this.drawingImgUrl},K.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){this.createVisual(),K.prototype.restoreState.call(this,E),this.drawingImgUrl=E.drawingImgUrl,this.setDrawingImage()},c.prototype.scale=function(E,G){K.prototype.scale.call(this,E,G),this.setDrawingImage()},c.typeName="FreehandMarker",c.title="Freehand marker",c.icon='',c}(qe),me=function(K){function c(E,G,Y){var V=K.call(this,E,Y||'')||this;return V.typeBoxes=[],V.currentType=G,V.setCurrentType=V.setCurrentType.bind(V),V}return ke(c,K),c.prototype.getUi=function(){var E=this,G=document.createElement("div");G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2";for(var Y=function(Ge){var tt="both";switch(Ge){case 0:tt="both";break;case 1:tt="start";break;case 2:tt="end";break;case 3:tt="none"}var pt=document.createElement("div");if(pt.style.display="flex",pt.style.flexGrow="2",pt.style.alignItems="center",pt.style.justifyContent="space-between",pt.style.padding="5px",pt.style.borderWidth="2px",pt.style.borderStyle="solid",pt.style.borderColor=tt===V.currentType?V.uiStyleSettings.toolboxAccentColor:"transparent",pt.addEventListener("click",function(){E.setCurrentType(tt,pt)}),G.appendChild(pt),tt==="both"||tt==="start"){var Ve=document.createElement("div");Ve.style.display="flex",Ve.style.alignItems="center",Ve.style.minHeight="20px",Ve.innerHTML=``,Ve.style.marginLeft="5px",pt.appendChild(Ve)}var At=document.createElement("div");At.style.display="flex",At.style.alignItems="center",At.style.minHeight="20px",At.style.flexGrow="2";var It=document.createElement("hr");if(It.style.minWidth="20px",It.style.border="0px",It.style.borderTop="3px solid "+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee"),It.style.flexGrow="2",At.appendChild(It),pt.appendChild(At),tt==="both"||tt==="end"){var er=document.createElement("div");er.style.display="flex",er.style.alignItems="center",er.style.minHeight="20px",er.innerHTML=``,er.style.marginRight="5px",pt.appendChild(er)}V.typeBoxes.push(pt)},V=this,xe=0;xe<4;xe++)Y(xe);return G},c.prototype.setCurrentType=function(E,G){var Y=this;this.currentType=E,this.typeBoxes.forEach(function(V){V.style.borderColor=V===G?Y.uiStyleSettings!==void 0?Y.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},c}(Ne),Ee=function(K){function c(E,G,Y){var V=K.call(this,E,G,Y)||this;return V.arrowType="end",V.arrowBaseHeight=10,V.arrowBaseWidth=10,V.getArrowPoints=V.getArrowPoints.bind(V),V.setArrowType=V.setArrowType.bind(V),V.arrowTypePanel=new me("Arrow type","end"),V.arrowTypePanel.onArrowTypeChanged=V.setArrowType,V}return ke(c,K),c.prototype.ownsTarget=function(E){return!(!K.prototype.ownsTarget.call(this,E)&&E!==this.arrow1&&E!==this.arrow2)},c.prototype.getArrowPoints=function(E,G){var Y=this.arrowBaseWidth+2*this.strokeWidth,V=this.arrowBaseHeight+2*this.strokeWidth;return E-Y/2+","+(G+V/2)+" "+E+","+(G-V/2)+" "+(E+Y/2)+","+(G+V/2)},c.prototype.createTips=function(){this.arrow1=he.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=he.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.arrow2)},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.state==="creating"&&this.createTips()},c.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",he.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),he.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var E=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(E,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(G,0);var Y=this.arrow2.transform.baseVal.getItem(0);Y.setRotate(E+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(Y,0)}},c.prototype.setArrowType=function(E){this.arrowType=E,this.adjustVisual(),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({arrowType:this.arrowType},K.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){K.prototype.restoreState.call(this,E);var G=E;this.arrowType=G.arrowType,this.createTips(),this.adjustVisual()},c.typeName="ArrowMarker",c.title="Arrow marker",c.icon='',c}(st),ne=function(K){function c(E,G,Y){var V=K.call(this,E,G,Y)||this;return V.fillColor=Y.defaultFillColor,V.strokeWidth=0,V.fillPanel=new Fe("Color",Y.defaultColorSet,Y.defaultFillColor),V.fillPanel.onColorChanged=V.setFillColor,V}return ke(c,K),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=K.prototype.getState.call(this);return E.typeName=c.typeName,E},c.typeName="CoverMarker",c.title="Cover marker",c.icon='',c}(Ye),ae=function(K){function c(E,G,Y,V){var xe=K.call(this,E,V||'')||this;return xe.opacities=[],xe.opacityBoxes=[],xe.opacities=G,xe.currentOpacity=Y,xe.setCurrentOpacity=xe.setCurrentOpacity.bind(xe),xe}return ke(c,K),c.prototype.getUi=function(){var E=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(Y){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="center",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=Y===E.currentOpacity?E.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){E.setCurrentOpacity(Y,V)}),G.appendChild(V);var xe=document.createElement("div");xe.innerText=100*Y+"%",V.appendChild(xe),E.opacityBoxes.push(V)}),G},c.prototype.setCurrentOpacity=function(E,G){var Y=this;this.currentOpacity=E,this.opacityBoxes.forEach(function(V){V.style.borderColor=V===G?Y.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},c}(Ne),ce=function(K){function c(E,G,Y){var V=K.call(this,E,G,Y)||this;return V.setOpacity=V.setOpacity.bind(V),V.fillColor=Y.defaultHighlightColor,V.strokeWidth=0,V.opacity=Y.defaultHighlightOpacity,V.fillPanel=new Fe("Color",Y.defaultColorSet,V.fillColor),V.fillPanel.onColorChanged=V.setFillColor,V.opacityPanel=new ae("Opacity",Y.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return ke(c,K),c.prototype.setOpacity=function(E){this.opacity=E,this.visual&&he.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=K.prototype.getState.call(this);return E.typeName=c.typeName,E},c.typeName="HighlightMarker",c.title="Highlight marker",c.icon='',c}(ne),ve='',Ie=function(K){function c(E,G,Y){var V=K.call(this,E,G,Y)||this;return V.bgColor="transparent",V.tipPosition={x:0,y:0},V.tipBase1Position={x:0,y:0},V.tipBase2Position={x:0,y:0},V.tipMoving=!1,V.color=Y.defaultStrokeColor,V.bgColor=Y.defaultFillColor,V.fontFamily=Y.defaultFontFamily,V.defaultSize={x:100,y:30},V.setBgColor=V.setBgColor.bind(V),V.getTipPoints=V.getTipPoints.bind(V),V.positionTip=V.positionTip.bind(V),V.setTipPoints=V.setTipPoints.bind(V),V.colorPanel=new Fe("Text color",Y.defaultColorSet,V.color,''),V.colorPanel.onColorChanged=V.setColor,V.bgColorPanel=new Fe("Fill color",Y.defaultColorSet,V.bgColor,ve),V.bgColorPanel.onColorChanged=V.setBgColor,V.fontFamilyPanel=new Be("Font",Y.defaultFontFamilies,Y.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V.tipGrip=new rt,V.tipGrip.visual.transform.baseVal.appendItem(he.createTransform()),V.controlBox.appendChild(V.tipGrip.visual),V}return ke(c,K),c.prototype.ownsTarget=function(E){return K.prototype.ownsTarget.call(this,E)||this.tipGrip.ownsTarget(E)||this.tip===E},c.prototype.createTip=function(){he.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=he.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},c.prototype.pointerDown=function(E,G){this.state==="new"&&K.prototype.pointerDown.call(this,E,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,E,G)},c.prototype.pointerUp=function(E){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,K.prototype.pointerUp.call(this,E);else{var G=this.state==="creating";K.prototype.pointerUp.call(this,E),this.setTipPoints(G),this.positionTip()}},c.prototype.manipulate=function(E){if(this.tipMoving){var G=this.unrotatePoint(E);this.tipPosition={x:G.x-this.manipulationStartLeft,y:G.y-this.manipulationStartTop},this.positionTip()}else K.prototype.manipulate.call(this,E)},c.prototype.setBgColor=function(E){this.bgRectangle&&this.tip&&(he.setAttributes(this.bgRectangle,[["fill",E]]),he.setAttributes(this.tip,[["fill",E]])),this.bgColor=E,this.fillColorChanged(E)},c.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},c.prototype.setTipPoints=function(E){E===void 0&&(E=!1);var G=Math.min(this.height/2,15),Y=this.height/5;E&&(this.tipPosition={x:G+Y/2,y:this.height+20});var V=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?V',c}(ze),we=function(K){function c(E,G,Y){var V=K.call(this,E,G,Y)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.strokeColor=Y.defaultColor,V.strokeWidth=Y.defaultStrokeWidth,V.strokeDasharray=Y.defaultStrokeDasharray,V.fillColor=Y.defaultFillColor,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.setOpacity=V.setOpacity.bind(V),V.createVisual=V.createVisual.bind(V),V.strokePanel=new Fe("Line color",ge(Y.defaultColorSet,["transparent"]),Y.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.fillPanel=new Fe("Fill color",ge(Y.defaultColorSet,["transparent"]),V.fillColor,ve),V.fillPanel.onColorChanged=V.setFillColor,V.strokeWidthPanel=new nt("Line width",Y.defaultStrokeWidths,Y.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new $e("Line style",Y.defaultStrokeDasharrays,Y.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V.opacityPanel=new ae("Opacity",Y.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return ke(c,K),c.prototype.ownsTarget=function(E){return!(!K.prototype.ownsTarget.call(this,E)&&E!==this.visual)},c.prototype.createVisual=function(){this.visual=he.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)},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.state==="new"&&(this.createVisual(),this.moveVisual(E),this._state="creating")},c.prototype.manipulate=function(E){K.prototype.manipulate.call(this,E)},c.prototype.resize=function(E){K.prototype.resize.call(this,E),this.setSize()},c.prototype.setSize=function(){K.prototype.setSize.call(this),he.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},c.prototype.pointerUp=function(E){K.prototype.pointerUp.call(this,E),this.setSize()},c.prototype.setStrokeColor=function(E){this.strokeColor=E,this.visual&&he.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(E),this.stateChanged()},c.prototype.setFillColor=function(E){this.fillColor=E,this.visual&&he.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(E),this.stateChanged()},c.prototype.setStrokeWidth=function(E){this.strokeWidth=E,this.visual&&he.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},c.prototype.setStrokeDasharray=function(E){this.strokeDasharray=E,this.visual&&he.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},c.prototype.setOpacity=function(E){this.opacity=E,this.visual&&he.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},K.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){var G=E;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,E),this.setSize()},c.prototype.scale=function(E,G){K.prototype.scale.call(this,E,G),this.setSize()},c.typeName="EllipseMarker",c.title="Ellipse marker",c.icon='',c}(qe),Ke=function(K){function c(E,G,Y){return K.call(this,E,G,Y)||this}return ke(c,K),Object.defineProperty(c.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),c.prototype.ownsTarget=function(E){return!(!K.prototype.ownsTarget.call(this,E)&&E!==this.tip1&&E!==this.tip2)},c.prototype.createTips=function(){this.tip1=he.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(he.createTransform()),this.visual.appendChild(this.tip1),this.tip2=he.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(he.createTransform()),this.visual.appendChild(this.tip2)},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.state==="creating"&&this.createTips()},c.prototype.adjustVisual=function(){if(K.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(he.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()]]),he.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 E=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(E,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(G,0);var Y=this.tip2.transform.baseVal.getItem(0);Y.setRotate(E+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(Y,0)}},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=K.prototype.getState.call(this);return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){K.prototype.restoreState.call(this,E),this.createTips(),this.adjustVisual()},c.typeName="MeasurementMarker",c.title="Measurement marker",c.icon='',c}(st),ot=function(K){function c(E,G,Y){var V=K.call(this,E,G,Y)||this;return V.strokePanel.colors=Y.defaultColorSet,V.fillColor="transparent",V}return ke(c,K),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=K.prototype.getState.call(this);return E.typeName=c.typeName,E},c.typeName="EllipseFrameMarker",c.title="Ellipse frame marker",c.icon='',c}(we),ct=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(c){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(c)||(this.undoStack.push(c),JSON.stringify(this.lastRedoStep)!==JSON.stringify(c)&&this.redoStack.splice(0,this.redoStack.length))},K.prototype.replaceLastUndoStep=function(c){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=c)},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 c=this.undoStack.pop();return c!==void 0&&this.redoStack.push(c),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}(),dt=function(K){function c(E,G,Y){var V=K.call(this,E,G,Y)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.curveX=0,V.curveY=0,V.manipulationStartCurveX=0,V.manipulationStartCurveY=0,V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.positionGrips=V.positionGrips.bind(V),V.addControlGrips=V.addControlGrips.bind(V),V.adjustVisual=V.adjustVisual.bind(V),V.setupControlBox=V.setupControlBox.bind(V),V.resize=V.resize.bind(V),V.strokeColor=Y.defaultColor,V.strokeWidth=Y.defaultStrokeWidth,V.strokeDasharray=Y.defaultStrokeDasharray,V.strokePanel=new Fe("Line color",Y.defaultColorSet,Y.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new nt("Line width",Y.defaultStrokeWidths,Y.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new $e("Line style",Y.defaultStrokeDasharrays,Y.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return ke(c,K),c.prototype.ownsTarget=function(E){return!(!K.prototype.ownsTarget.call(this,E)&&E!==this.visual&&E!==this.selectorCurve&&E!==this.visibleCurve&&!this.curveGrip.ownsTarget(E))},c.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},c.prototype.createVisual=function(){this.visual=he.createGroup(),this.selectorCurve=he.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=he.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)},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=E.x,this.curveY=E.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(G)&&(this.activeGrip=this.curveGrip,this._state="resize")},c.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),he.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),he.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),he.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},c.prototype.setupControlBox=function(){K.prototype.setupControlBox.call(this),this.curveControlLine1=he.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=he.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)},c.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,K.prototype.addControlGrips.call(this)},c.prototype.positionGrips=function(){K.prototype.positionGrips.call(this);var E=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-E/2,this.curveY-E/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()))},c.prototype.manipulate=function(E){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+E.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+E.y-this.manipulationStartY),K.prototype.manipulate.call(this,E)},c.prototype.resize=function(E){this.activeGrip===this.curveGrip&&(this.curveX=E.x,this.curveY=E.y),K.prototype.resize.call(this,E),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},c.prototype.setStrokeColor=function(E){this.strokeColor=E,this.adjustVisual(),this.colorChanged(E)},c.prototype.setStrokeWidth=function(E){this.strokeWidth=E,this.adjustVisual()},c.prototype.setStrokeDasharray=function(E){this.strokeDasharray=E,this.adjustVisual()},c.prototype.scale=function(E,G){this.curveX=this.curveX*E,this.curveY=this.curveY*G,K.prototype.scale.call(this,E,G)},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},K.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){K.prototype.restoreState.call(this,E);var G=E;this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.curveX=G.curveX,this.curveY=G.curveY,this.createVisual(),this.adjustVisual()},c.typeName="CurveMarker",c.title="Curve marker",c.icon='',c}(Je),Lt=function(){function K(c,E){E===void 0&&(E=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=c,this.cancelable=E}return Object.defineProperty(K.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),K.prototype.preventDefault=function(){this._defaultPrevented=!0},K}(),wt=function(K){function c(E,G,Y){var V=K.call(this,E,!1)||this;return V.dataUrl=G,V.state=Y,V}return ke(c,K),c}(Lt),ft=function(K){function c(E,G,Y){Y===void 0&&(Y=!1);var V=K.call(this,E,Y)||this;return V.marker=G,V}return ke(c,K),c}(Lt),zt=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(c,E){this[c].push(E)},K.prototype.removeEventListener=function(c,E){var G=this[c].indexOf(E);G>-1&&this[c].splice(G,1)},K}(),Ft=function(){function K(c){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 ct,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new zt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=K.instanceCounter++,this.styles=new Oe(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=c,this.targetRoot=document.body,this.width=c.clientWidth,this.height=c.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[et,Ce,Ee,ze,ot,we,ce,Ie,Ke,ne,st,dt]},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[et,Ce,Ee,ze,we,ce,Ie]},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"BASIC_MARKER_TYPES",{get:function(){return[et,Ce,Ee,ze,ce]},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(c){var E=this;this._availableMarkerTypes.splice(0),c.forEach(function(G){if(typeof G=="string"){var Y=E.ALL_MARKER_TYPES.find(function(V){return V.typeName===G});Y!==void 0&&E._availableMarkerTypes.push(Y)}else E._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(c){this._zoomLevel=c,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(),re.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},K.prototype.show=function(){var c=this;this.styles.styleSheetRoot===void 0&&se.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=se.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(E){return E(new Lt(c))})},K.prototype.render=function(){return Ae(this,void 0,void 0,function(){var c;return Te(this,function(E){switch(E.label){case 0:return this.setCurrentMarker(),(c=new de).naturalSize=this.renderAtNaturalSize,c.imageType=this.renderImageType,c.imageQuality=this.renderImageQuality,c.markersOnly=this.renderMarkersOnly,c.width=this.renderWidth,c.height=this.renderHeight,[4,c.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return E.sent(),[4,c.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,E.sent()]}})})},K.prototype.close=function(c){var E=this;if(c===void 0&&(c=!1),this.isOpen){var G=!1;c||this.eventListeners.beforeclose.forEach(function(Y){var V=new Lt(E,!0);Y(V),V.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(Y){return Y(new Lt(E))}),this.detachEvents(),this._isOpen=!1)}},K.prototype.addMarkersToToolbar=function(){for(var c,E=[],G=0;Gthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*c:this.editorCanvas.clientWidth,G=E',c.title="Powered by marker.js",c.style.display="grid",c.style.alignItems="center",c.style.justifyItems="center",c.style.padding="3px",c.style.width="20px",c.style.height="20px",this.logoUI.appendChild(c),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 c=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=c+"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 be(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(c),1),c.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(c,E){if(c==="marker"&&E!==void 0)this.createNewMarker(E);else if(c==="action")switch(E){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 c=this;if(this._currentMarker!==void 0){var E=!1;if(this.eventListeners.markerbeforedelete.forEach(function(Y){var V=new ft(c,c._currentMarker,!0);Y(V),V.defaultPrevented&&(E=!0)}),!E){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(Y){return Y(new ft(c,G))})}}},K.prototype.clear=function(){var c=this,E=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(xe){var Ge=new ft(c,void 0,!0);xe(Ge),Ge.defaultPrevented&&(E=!0)}),!E)){this.setCurrentMarker();for(var G=function(xe){var Ge=Y.markers[xe];Y.setCurrentMarker(Y.markers[xe]),Y._currentMarker.dispose(),Y.markerImage.removeChild(Y._currentMarker.container),Y.markers.splice(Y.markers.indexOf(Y._currentMarker),1),Y.eventListeners.markerdelete.forEach(function(tt){return tt(new ft(c,Ge))})},Y=this,V=this.markers.length-1;V>=0;V--)G(V);this.addUndoStep()}},Object.defineProperty(K.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),K.prototype.showNotesEditor=function(){var c;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=(c=this._currentMarker.notes)!==null&&c!==void 0?c:"",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 c=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var E=this.getState(),G=this.undoRedoManager.getLastUndoStep();if(!G||G.width===E.width&&G.height===E.height){var Y=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(E),Y1&&this.panTo({x:c.clientX,y:c.clientY}))},K.prototype.onPointerUp=function(c){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(c.clientX,c.clientY)),this.isDragging=!1,this.addUndoStep()},K.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},K.prototype.onKeyUp=function(c){this._currentMarker===void 0||this.notesArea!==void 0||c.key!=="Delete"&&c.key!=="Backspace"||this.deleteSelectedMarker()},K.prototype.clientToLocalCoordinates=function(c,E){var G=this.markerImage.getBoundingClientRect();return{x:(c-G.left)/this.zoomLevel,y:(E-G.top)/this.zoomLevel}},K.prototype.onWindowResize=function(){this.positionUI()},K.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var c=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=c+"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(c){re.addKey(c)},K.prototype.addEventListener=function(c,E){this.eventListeners.addEventListener(c,E)},K.prototype.removeEventListener=function(c,E){this.eventListeners.removeEventListener(c,E)},K.prototype.renderState=function(c){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(c),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(K.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),K.prototype.focus=function(){var c=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(E){return E(new Lt(c))}))},K.prototype.blur=function(){var c=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(E){return E(new Lt(c))}))},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 Jt=function(K,c){return(Jt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,G){E.__proto__=G}||function(E,G){for(var Y in G)Object.prototype.hasOwnProperty.call(G,Y)&&(E[Y]=G[Y])})(K,c)};function Ht(K,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");function E(){this.constructor=K}Jt(K,c),K.prototype=c===null?Object.create(c):(E.prototype=c.prototype,new E)}function Rt(K,c,E,G){return new(E||(E=Promise))(function(Y,V){function xe(pt){try{tt(G.next(pt))}catch(Ve){V(Ve)}}function Ge(pt){try{tt(G.throw(pt))}catch(Ve){V(Ve)}}function tt(pt){var Ve;pt.done?Y(pt.value):(Ve=pt.value,Ve instanceof E?Ve:new E(function(At){At(Ve)})).then(xe,Ge)}tt((G=G.apply(K,c||[])).next())})}function Ur(K,c){var E,G,Y,V,xe={label:0,sent:function(){if(1&Y[0])throw Y[1];return Y[1]},trys:[],ops:[]};return V={next:Ge(0),throw:Ge(1),return:Ge(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function Ge(tt){return function(pt){return function(Ve){if(E)throw new TypeError("Generator is already executing.");for(;xe;)try{if(E=1,G&&(Y=2&Ve[0]?G.return:Ve[0]?G.throw||((Y=G.return)&&Y.call(G),0):G.next)&&!(Y=Y.call(G,Ve[1])).done)return Y;switch(G=0,Y&&(Ve=[2&Ve[0],Y.value]),Ve[0]){case 0:case 1:Y=Ve;break;case 4:return xe.label++,{value:Ve[1],done:!1};case 5:xe.label++,G=Ve[1],Ve=[0];continue;case 7:Ve=xe.ops.pop(),xe.trys.pop();continue;default:if(!(Y=xe.trys,(Y=Y.length>0&&Y[Y.length-1])||Ve[0]!==6&&Ve[0]!==2)){xe=0;continue}if(Ve[0]===3&&(!Y||Ve[1]>Y[0]&&Ve[1]0&&E>0){var G=new Rr(c,E),Y=G.ratio>=1?20:G.getHorizontalLength(20),V=G.ratio<1?20:G.getVerticalLength(20),xe=document.createElementNS("http://www.w3.org/2000/svg","svg");xe.setAttribute("xmlns","http://www.w3.org/2000/svg"),xe.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(xe);var Ge=bt.createDefs();xe.appendChild(Ge);var tt=bt.createElement("clipPath",[["id","text-bg-clip"]]);Ge.appendChild(tt);var pt=bt.createPath(bt.getHollowRectanglePath((24-Y)/2,(24-V)/2,Y,V,(24-Y)/2+2,(24-V)/2+2,Y-4,V-4));xe.appendChild(pt);var Ve=bt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ve.appendChild(bt.createTSpan(c+":"+E)),xe.appendChild(Ve);var At=Ve.getBBox();bt.setAttributes(Ve,[["x",((24-At.width)/2).toString()],["y",((24-At.height)/2-At.y).toString()]]);var It=bt.createPath(bt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(At.width))/2,(24-Math.ceil(At.height))/2,Math.ceil(At.width),Math.ceil(At.height)));return tt.appendChild(It),bt.setAttributes(pt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(xe),xe.outerHTML}return''},K}(),Tr=function(K){function c(E,G,Y){var V=K.call(this,E,G)||this;return V.isDropdownOpen=!1,V.onClick=V.dropdownButtonClicked,V.dropdownButtons=Y,V}return Ht(c,K),c.prototype.setupDropdown=function(){var E=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=E.className,G.colorsClassName=E.colorsClassName,E.dropdownBlock.appendChild(G.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},c.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},c.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},c.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},c.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},c.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},c}(kt),Ot=function(){function K(c,E){this.GRIP_SIZE=10,this.color=c,this.fillColor=E,this.visual=bt.createGroup(),this.visual.appendChild(bt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(bt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return K.prototype.ownsTarget=function(c){return c===this.visual||c===this.visual.childNodes[0]||c===this.visual.childNodes[1]},K.prototype.setCenter=function(c,E){this.visual.childNodes.forEach(function(G){return bt.setAttributes(G,[["cx",c.toString()],["cy",E.toString()]])})},K}(),Lr=function(){function K(c,E,G,Y){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=c,this.canvasHeight=E,this.margin=G,this.container=Y,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(c){this._aspectRatio=c,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(c){this._isGridVisible=c,this.gridContainer&&bt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(c){this._zoomFactor=c,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),K.prototype.open=function(){var c=this;this.cropShadeElement=bt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=bt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var E=0;Ethis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-E.height/2),bt.setAttributes(this.cropRectElement,[["x",E.x.toString()],["y",E.y.toString()],["width",E.width.toString()],["height",E.height.toString()]]);var G=E.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(V,xe){var Ge=E.y+G*(xe+1);bt.setAttributes(V,[["x1",""+E.x],["y1",""+Ge],["x2",""+(E.x+E.width)],["y2",""+Ge]])});var Y=E.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(V,xe){var Ge=E.x+Y*(xe+1);bt.setAttributes(V,[["x1",""+Ge],["y1",""+E.y],["x2",""+Ge],["y2",""+(E.y+E.height)]])}),bt.setAttributes(this.cropShadeElement,[["d",bt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,E.x,E.y,E.width,E.height)]]),this.topLeftGrip.setCenter(E.x,E.y),this.topRightGrip.setCenter(E.x+E.width,E.y),this.bottomLeftGrip.setCenter(E.x,E.y+E.height),this.bottomRightGrip.setCenter(E.x+E.width,E.y+E.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(c,E){var G=this.container.getBoundingClientRect();return{x:c-G.left+this.margin,y:E-G.top+this.margin}},K.prototype.onPointerDown=function(c){this.container.setPointerCapture(c.pointerId),this.previousPoint=this.clientToLocalCoordinates(c.clientX,c.clientY),this.cropRectElement===c.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(c.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(c.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(c.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(c.target)&&(this.activeGrip=this.bottomRightGrip)},K.prototype.onPointerMove=function(c){if(this.isMoving)this.move(this.clientToLocalCoordinates(c.clientX,c.clientY));else if(this.activeGrip){var E=this.clientToLocalCoordinates(c.clientX,c.clientY);this.resize(E)}c.preventDefault()},K.prototype.onPointerUp=function(c){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(c.pointerId)},K.prototype.move=function(c){var E=c.x-this.previousPoint.x,G=c.y-this.previousPoint.y;this.zoomFactor!==1&&(E=-E/this.zoomFactor,G=-G/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+E),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=c},K.prototype.resize=function(c){var E=Object.assign({},this.cropRect),G=c.x-this.previousPoint.x,Y=c.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:E.x+Gthis.canvasWidth*this.zoomFactor&&(G=this.canvasWidth*this.zoomFactor-E.width),E.width+=G}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(E.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(G),E.height=this.aspectRatio.getVerticalLength(E.width)):(E.y+=Y,E.height=this.cropRect.y+this.cropRect.height-E.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?E.height=this.aspectRatio.getVerticalLength(E.width):E.height+=Y}E.width<10&&(E.x=this.cropRect.x,E.width=10),E.height<10&&(E.y=this.cropRect.y,E.height=10),this.previousPoint=c,E.x>=this.margin&&E.y>=this.margin&&E.x-this.margin+E.width<=this.canvasWidth&&E.y-this.margin+E.height<=this.canvasHeight&&(this.cropRect=E,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 c=this.cropRect.x+this.cropRect.width/2,E=this.cropRect.y+this.cropRect.height/2,G=this.aspectRatio.getHorizontalLength(this.cropRect.height),Y=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=c-this.cropRect.width/2,this.cropRect.y=E-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(c,E,G,Y,V,xe){var Ge=G/c,tt=Y/E;return{x:(V.x-xe)*Ge+xe,y:(V.y-xe)*tt+xe,width:V.width*Ge,height:V.height*tt}},K.prototype.scaleCanvas=function(c,E){var G=this.getRescaledRect(this.canvasWidth,this.canvasHeight,c,E,this.cropRect,this.margin);this.canvasWidth=c,this.canvasHeight=E,this.onCropChange&&this.onCropChange(G),this.setCropRectangle(G)},K}(),zr=function(){function K(c){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=c,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(c){this._angle=c,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(c){this.controlContainer.setPointerCapture(c.pointerId),this.isDragging=!0,this.previousPoint={x:c.clientX,y:c.clientY}},K.prototype.onPointerMove=function(c){this.isDragging&&(this.onAngleChange&&this.onAngleChange((c.clientX-this.previousPoint.x)/5),this.previousPoint.x=c.clientX)},K.prototype.onPointerUp=function(c){this.isDragging&&this.onAngleChange&&this.onAngleChange((c.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(c.pointerId)},K.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var c=this.angleLabelText.getBBox();bt.setAttributes(this.angleLabelElement,[["x",((this.width-c.width)/2).toString()],["y",(this.height/2).toString()]])}},K.prototype.positionScaleShape=function(){if(this.scaleShape){var c=this.scaleShape.transform.baseVal.getItem(0);c.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(c,0)}},K.prototype.getVisual=function(){var c=document.createElementNS("http://www.w3.org/2000/svg","svg");c.setAttribute("xmlns","http://www.w3.org/2000/svg"),c.setAttribute("width",this.width+"px"),c.setAttribute("height",this.height+"px"),c.setAttribute("viewBox","0 0 "+this.width+" "+this.height),c.style.flexShrink="0",document.body.appendChild(c);for(var E="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,G=1;G<=this.width/5+10;G++){var Y=G%5==0?this.height/3:this.height/6;E+="h4v"+-Y+"h1v"+Y}E+="v1H0Z",this.scaleShape=bt.createPath(E);var V=bt.createTransform();this.scaleShape.transform.baseVal.appendItem(V),c.appendChild(this.scaleShape),this.angleLabelElement=bt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=bt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var xe=bt.createTSpan("");return xe.innerHTML="°",this.angleLabelElement.appendChild(xe),c.appendChild(this.angleLabelElement),document.body.removeChild(c),c},K}(),rn=function(){function K(){this.naturalSize=!1,this.imageType="image/png"}return K.prototype.rasterize=function(c,E,G,Y,V,xe,Ge){var tt=this;return new Promise(function(pt){var Ve=document.createElement("canvas");Ve.width=c.width.baseVal.value-2*Y,Ve.height=c.height.baseVal.value-2*Y;var At=1,It=1;tt.naturalSize===!0?(At=E.naturalWidth/(c.width.baseVal.value-2*Y)/xe,It=E.naturalHeight/(c.height.baseVal.value-2*Y)/Ge,Ve.width=E.naturalWidth/xe,Ve.height=E.naturalHeight/Ge):tt.width!==void 0&&tt.height!==void 0&&(At=tt.width/G.width,It=tt.height/G.height,Ve.width*=At,Ve.height*=It);var er=Ve.getContext("2d");er.translate(Ve.width/2,Ve.height/2),er.rotate(V*Math.PI/180),er.scale(xe,Ge),er.translate(-Ve.width/2,-Ve.height/2),er.drawImage(E,0,0,Ve.width,Ve.height);var Kr=document.createElement("canvas");Kr.width=G.width*At,Kr.height=G.height*It,Kr.getContext("2d").putImageData(er.getImageData((G.x-Y)*At,(G.y-Y)*It,G.width*At,G.height*It),0,0),pt(Kr.toDataURL(tt.imageType,tt.imageQuality))})},K}(),He=function(){function K(c){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 Ct(this.instanceNo),this.target=c,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(c){this._zoomToCropEnabled=c,c?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(c){this._isGridVisible=c,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"gridLines",{get:function(){return this._gridLines},set:function(c){this._gridLines=c,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(c){this._rotationAngle=c,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 c;return(c=this._aspectRatio)!==null&&c!==void 0?c:this.aspectRatios[0]},set:function(c){this._aspectRatio=c},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(c){c===void 0&&(c=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),c||this.closeEventListeners.forEach(function(E){return E()}),this._isOpen=!1)},K.prototype.addRenderEventListener=function(c){this.renderEventListeners.push(c)},K.prototype.removeRenderEventListener=function(c){this.renderEventListeners.indexOf(c)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(c),1)},K.prototype.addCloseEventListener=function(c){this.closeEventListeners.push(c)},K.prototype.removeCloseEventListener=function(c){this.closeEventListeners.indexOf(c)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(c),1)},K.prototype.setupResizeObserver=function(){var c=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){c.resize(c.target.clientWidth,c.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 c=1*this.target.clientWidth/this.target.clientHeight,E=this.contentDiv.clientWidth/c>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*c:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,G=E+2*this.CANVAS_MARGINc+this.CANVAS_MARGIN?this.target.offsetTop-(c+this.CANVAS_MARGIN):0;this.coverDiv.style.top=E+"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 c=this;this.topToolbar=new Zt,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 E=new rr;E.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(E);var G=[];this.aspectRatios.forEach(function(It){var er=new kt(tn.getIcon(It.horizontal,It.vertical),It.horizontal===0&&It.vertical===0?"FREE":It.horizontal+":"+It.vertical);er.onClick=function(){return c.ratioButtonClicked(It)},G.push(er)}),this.aspectRatioButton=new Tr(tn.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,E.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var Y=new kt('',"Toggle grid");Y.isActive=this.isGridVisible,Y.onClick=function(){c.isGridVisible=!c.isGridVisible,Y.isActive=c.isGridVisible},E.addButton(Y);var V=new kt('',"Zoom to selection");if(V.isActive=this.zoomToCropEnabled,V.onClick=function(){c.zoomToCropEnabled=!c.zoomToCropEnabled,V.isActive=c.zoomToCropEnabled},E.addButton(V),!Zr.isLicensed){var xe=new gt;this.topToolbar.addElementBlock(xe);var Ge=document.createElement("div");Ge.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var tt=document.createElement("a");tt.style.color="currentColor",tt.href="https://markerjs.com/products/cropro",tt.target="_blank",tt.innerHTML='',Ge.appendChild(tt),xe.addElement(Ge)}var pt=new rr;pt.minWidth=3*this.toolbarHeight+"px",pt.contentAlign="end",this.topToolbar.addButtonBlock(pt);var Ve=new kt('',"OK");Ve.onClick=this.startRenderAndClose,pt.addButton(Ve),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ve.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var At=new kt('',"Close");At.onClick=this.close,pt.addButton(At),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(At.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},K.prototype.addBottomToolbar=function(){var c=this;this.bottomToolbar=new Zt,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 E=new rr;E.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(E);var G=new kt('',"Rotate left");G.onClick=this.rotateLeftButtonClicked,E.addButton(G);var Y=new kt('',"Rotate right");Y.onClick=this.rotateRightButtonClicked,E.addButton(Y);var V=new gt;V.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(V),this.straightener=new zr("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(pt){c.rotateBy(pt),c.straightener.angle=c.rotationAngle},V.addElement(this.straightener.getUI());var xe=new rr;xe.minWidth=2*this.toolbarHeight+"px",xe.contentAlign="end",this.bottomToolbar.addButtonBlock(xe);var Ge=new kt('',"Flip horizontal");Ge.onClick=this.flipHorizontallyButtonClicked,xe.addButton(Ge);var tt=new kt('',"Flip vertical");tt.onClick=this.flipVerticallyButtonClicked,xe.addButton(tt)},K.prototype.ratioButtonClicked=function(c){this.aspectRatio=c,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},K.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=tn.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 Rr(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(c){if(c){var E=this.cropLayer.getRescaledRect(c.width,c.height,this.imageWidth,this.imageHeight,c.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(E),this.cropRectChanged(E),this.flippedHorizontally=c.flippedHorizontally,this.flippedVertically=c.flippedVertically,this.applyFlip(),this.rotationAngle=c.rotationAngle,this.applyRotation()}},K.prototype.clientToLocalCoordinates=function(c,E){var G=this.cropImage.getBoundingClientRect();return{x:c-G.left,y:E-G.top}},K.prototype.onWindowResize=function(){this.positionUI()},K.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var c=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=c+"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 c=this.rotationAngle-90;this.rotationAngle%90!=0&&(c+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(c)},K.prototype.rotateRightButtonClicked=function(){var c=this.rotationAngle+90;this.rotationAngle%90!=0&&(c-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(c)},K.prototype.rotateTo=function(c){c=(c=c>180?c-360:c)<=-180?c+360:c,this.rotationAngle=c,this.applyRotation()},K.prototype.rotateBy=function(c){this.rotateTo((this.rotationAngle+c)%360)},K.prototype.applyRotation=function(){var c=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var E=this.editingTargetRotationContainer.transform.baseVal.getItem(0);E.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(E,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=c},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 Rt(this,void 0,void 0,function(){var c,E;return Ur(this,function(G){switch(G.label){case 0:return[4,this.render()];case 1:return c=G.sent(),E=this.getState(),this.renderEventListeners.forEach(function(Y){return Y(c,E)}),this.close(!0),[2]}})})},K.prototype.render=function(){return Rt(this,void 0,void 0,function(){var c;return Ur(this,function(E){switch(E.label){case 0:return(c=new rn).naturalSize=this.renderAtNaturalSize,c.imageType=this.renderImageType,c.imageQuality=this.renderImageQuality,c.width=this.renderWidth,c.height=this.renderHeight,this.unzoomFromCrop(),bt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,c.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 E.sent(),[4,c.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,E.sent()]}})})},K.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new xt("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 xt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new xt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var c=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new xt("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*c)+`px;
height: `+(this.toolbarHeight-2*c)+`px;
padding: `+c+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new xt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new xt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new lt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new lt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new xt("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 xt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new xt("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 xt("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*c)+`px;
padding: `+c+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new xt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},K.instanceCounter=0,K}(),ut=ee("8hTe"),Mt=ee.n(ut),Kt=/]*>/g;function Yt(K){var c=document.createElement("div");return c.innerHTML=K,c.childNodes.length===0?"":c.childNodes[0].nodeValue}var qt=Le.a=function(K){var c=K.value,E=c===void 0?"":c,G=K.edit,Y=G===void 0?!1:G,V=K.className,xe=K.showTextOnly,Ge=K.showLines,tt=K.replaces,pt=K.zoomImg,Ve=K.hasMask,At=K.style,It=At===void 0?{}:At,er=K.stylesPrev,Kr=er===void 0?{}:er,Vr=String(E),pr=Object(L.useRef)(),Qr=Object(L.useRef)(),Gn=Object(L.useState)(""),Or=Object(H.a)(Gn,2),Xr=Or[0],jr=Or[1],bn=Object(L.useState)("office"),nn=Object(H.a)(bn,2),mn=nn[0],hn=nn[1],di=function(){var jt=new He(Qr.current);jt.displayMode="popup",jt.addRenderEventListener(function(){var Er=Object(M.a)(P.a.mark(function Ut(hr){var Vt;return P.a.wrap(function(lr){for(;;)switch(lr.prev=lr.next){case 0:return pr.current.style.display="none",lr.next=3,Object(Pe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:hr}});case 3:Vt=lr.sent,Vt!=null&&Vt.id&&tt(Qr.current.getAttribute("src").replace(q.a.API_SERVER,""),"/api/attachments/".concat(Vt==null?void 0:Vt.id,"?type=").concat(Vt.content_type));case 5:case"end":return lr.stop()}},Ut)}));return function(Ut){return Er.apply(this,arguments)}}()),jt.show()},zn=function(){var jt=new Ft(Qr.current);jt.settings.displayMode="popup",jt.addEventListener("render",function(){var Er=Object(M.a)(P.a.mark(function Ut(hr){var Vt;return P.a.wrap(function(lr){for(;;)switch(lr.prev=lr.next){case 0:if(pr.current.style.display="none",!Qr.current){lr.next=6;break}return lr.next=4,Object(Pe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:hr.dataUrl}});case 4:Vt=lr.sent,Vt!=null&&Vt.id&&tt(Qr.current.getAttribute("src").replace(q.a.API_SERVER,""),"/api/attachments/".concat(Vt==null?void 0:Vt.id,"?type=").concat(Vt.content_type));case 6:case"end":return lr.stop()}},Ut)}));return function(Ut){return Er.apply(this,arguments)}}()),jt.show(),window.markerArea=jt},an=Object(L.useMemo)(function(){try{var or=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,jt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Er=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Vr=Vr.replace(or,"("+q.a.API_SERVER+"/api/attachments/").replace(jt,'"'+q.a.API_SERVER+"/api/attachments/").replace(Er,'"'+q.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,`
`),Vr=Vr.replace(new RegExp("(?[TOC]
",R()),y()),Ut=Ut.replace(/(__special_katext_id_\d+__)/g,function(dn,lr){var Pr=hr[lr],Kn=Pr.type,Vn=Pr.expression;return Object(le.renderToString)(Yt(Vn)||"",{displayMode:Kn==="block",throwOnError:!1,output:"html"})}),Ut=Ut.replace(/▁/g,"\u2581\u2581\u2581"),S(),xe){var Vt=document.createElement("div");return Vt.innerHTML=Ut,Vt.innerText}return setTimeout(function(){return On()},500),Ut},[Vr]),Yr=Object(L.useRef)();g.WebkitLineClamp=Ge,Ge&&(It=Object(F.a)(Object(F.a)({},It),g));function Rn(or){var jt=or.target;if(jt.tagName.toUpperCase()==="IMG"){if(pt){var Er=jt.getAttribute("src");jr(Er),hn("image")}}else if(jt.tagName.toUpperCase()==="A"){var Ut=jt.getAttribute("href");if(Ut.indexOf("office")>-1)or.preventDefault(),jr(Ut),hn("office");else if(Ut.indexOf("application/pdf")>-1)or.preventDefault(),jr(Ut),hn("pdf");else if(Ut.indexOf("type=text")>-1)or.preventDefault(),jr(Ut),hn("html");else if(Ut.startsWith("#")){or.preventDefault();var hr=document.getElementById(Ut.replace("#",""));hr&&hr.scrollIntoView(!0)}}}var On=function(){var jt,Er=(jt=Yr.current)===null||jt===void 0?void 0:jt.querySelectorAll("video");Er==null||Er.forEach(function(Ut){if(Ut.oncontextmenu=function(){return!1},Ut.src.indexOf(".m3u8")>-1&&!Ut.canPlayType("application/vnd.apple.mpegurl")){if($.a.isSupported()){var hr=new $.a;hr.loadSource(Ut.src),hr.attachMedia(Ut)}}})};Object(L.useEffect)(function(){if(Yr.current&&an&&(an.match(Kt)&&window.PR.prettyPrint()),Yr.current)return Yr.current.addEventListener("click",Rn),function(){Yr.current.removeEventListener("click",Rn),S(),y()}},[an,Yr.current,Rn]);var ci=function(jt){if(!Y)return;jt.target.nodeName==="IMG"?(pr.current.style.display="flex",pr.current.style.width=jt.target.clientWidth+"px",pr.current.style.height=jt.target.clientHeight+"px",pr.current.style.top=jt.target.offsetTop+"px",pr.current.style.left=jt.target.offsetLeft+"px",Qr.current.src=jt.target.getAttribute("src")):pr.current.style.display="none"};return h.a.createElement("div",{style:{position:"relative"}},h.a.createElement("div",{ref:Yr,style:Object(F.a)({},It),className:"".concat(V||""," markdown-body ").concat(Mt.a.mdBody),onMouseOver:ci,dangerouslySetInnerHTML:{__html:an}}),h.a.createElement("div",{ref:pr,className:Mt.a.button},h.a.createElement(J.a,null,h.a.createElement(X.a,{onClick:function(){return di()}},"\u88C1\u526A"),h.a.createElement(X.a,{onClick:function(){return zn()}},"\u7F16\u8F91"))),h.a.createElement("img",{ref:Qr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),h.a.createElement(pe.a,{close:!0,data:Xr,hasMask:Ve,type:Xr!=null&&Xr.length?mn:"",style:Object(F.a)({},Kr),onClose:function(){return jr("")}}))}},"9VGf":function(vt,Le,ee){"use strict";ee.d(Le,"a",function(){return O});var ue=ee("q1tI"),J=ee.n(ue);function O(X,F){var M=Object(ue.useRef)();Object(ue.useEffect)(function(){M.current=X}),Object(ue.useEffect)(function(){function H(){M.current()}if(F!==null){var U=setInterval(H,F);return function(){return clearInterval(U)}}},[F])}},BU3w:function(vt,Le,ee){"use strict";ee.d(Le,"a",function(){return M});var ue=ee("MNnm"),J="rc-util-key";function O(H){if(H.attachTo)return H.attachTo;var U=document.querySelector("head");return U||document.body}function X(H){var U,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ue.a)())return null;var L=document.createElement("style");if((U=P.csp)===null||U===void 0?void 0:U.nonce){var h;L.nonce=(h=P.csp)===null||h===void 0?void 0:h.nonce}L.innerHTML=H;var f=O(P),T=f.firstChild;return P.prepend&&f.prepend?f.prepend(L):P.prepend&&T?f.insertBefore(L,T):f.appendChild(L),L}var F=new Map;function M(H,U){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},L=O(P);if(!F.has(L)){var h=X("",P),f=h.parentNode;F.set(L,f),f.removeChild(h)}var T=Array.from(F.get(L).children).find(function(i){return i.tagName==="STYLE"&&i[J]===U});if(T){var p,m;if(((p=P.csp)===null||p===void 0?void 0:p.nonce)&&T.nonce!==((m=P.csp)===null||m===void 0?void 0:m.nonce)){var b;T.nonce=(b=P.csp)===null||b===void 0?void 0:b.nonce}return T.innerHTML!==H&&(T.innerHTML=H),T}var a=X(H,P);return a[J]=U,a}},Bd2K:function(vt,Le,ee){(function(ue){ue(ee("VrN/"),ee("osHv"))})(function(ue){ue.defineOption("autoCloseTags",!1,function(P,L,h){if(h!=ue.Init&&h&&P.removeKeyMap("autoCloseTags"),!L)return;var f={name:"autoCloseTags"};(typeof L!="object"||L.whenClosing!==!1)&&(f["'/'"]=function(T){return M(T)}),(typeof L!="object"||L.whenOpening!==!1)&&(f["'>'"]=function(T){return X(T)}),P.addKeyMap(f)});var J=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],O=["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 X(P){if(P.getOption("disableInput"))return ue.Pass;for(var L=P.listSelections(),h=[],f=P.getOption("autoCloseTags"),T=0;Tp.ch&&(s=s.slice(0,s.length-m.end+p.ch));var v=s.toLowerCase();if(!s||m.type=="string"&&(m.end!=p.ch||!/[\"\']/.test(m.string.charAt(m.string.length-1))||m.string.length==1)||m.type=="tag"&&i.close||m.string.indexOf("/")==p.ch-m.start-1||y&&H(y,v)>-1||U(P,b.mode.xmlCurrentContext&&b.mode.xmlCurrentContext(a)||[],s,p,!0))return ue.Pass;var R=typeof f=="object"&&f.emptyTags;if(R&&H(R,s)>-1){h[T]={text:"/>",newPos:ue.Pos(p.line,p.ch+2)};continue}var w=g&&H(g,v)>-1;h[T]={indent:w,text:">"+(w?`
`:"")+""+s+">",newPos:w?ue.Pos(p.line+1,0):ue.Pos(p.line,p.ch+1)}}for(var C=typeof f=="object"&&f.dontIndentOnAutoClose,T=L.length-1;T>=0;T--){var x=h[T];P.replaceRange(x.text,L[T].head,L[T].anchor,"+insert");var d=P.listSelections().slice(0);d[T]={head:x.newPos,anchor:x.newPos},P.setSelections(d),!C&&x.indent&&(P.indentLine(x.newPos.line,null,!0),P.indentLine(x.newPos.line+1,null,!0))}}function F(P,L){for(var h=P.listSelections(),f=[],T=L?"/":"",p=P.getOption("autoCloseTags"),m=typeof p=="object"&&p.dontIndentOnSlash,b=0;b"&&(y+=">"),f[b]=y}if(P.replaceSelections(f),h=P.listSelections(),!m)for(var b=0;b=0&&L[a]==h;a--)++b;f=m.to;for(var a=1;a0){for(var L=0;L1&&arguments[1]!==void 0?arguments[1]:"",L=[],h=0;hCe.length)&&(me=Ce.length);for(var Ee=0,ne=new Array(me);Ee=Ce.length?{done:!0}:{done:!1,value:Ce[ne++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return Ee=Ce[Symbol.iterator](),Ee.next.bind(Ee)}function M(Ce,me){return me={exports:{}},Ce(me,me.exports),me.exports}var H=M(function(Ce){function me(){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 Ee(ne){Ce.exports.defaults=ne}Ce.exports={defaults:me(),getDefaults:me,changeDefaults:Ee}}),U=H.defaults,P=H.getDefaults,L=H.changeDefaults,h=/[&<>"']/,f=/[&<>"']/g,T=/[<>"']|&(?!#?\w+;)/,p=/[<>"']|&(?!#?\w+;)/g,m={"&":"&","<":"<",">":">",'"':""","'":"'"},b=function(me){return m[me]};function a(Ce,me){if(me){if(h.test(Ce))return Ce.replace(f,b)}else if(T.test(Ce))return Ce.replace(p,b);return Ce}var i=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(Ce){return Ce.replace(i,function(me,Ee){return Ee=Ee.toLowerCase(),Ee==="colon"?":":Ee.charAt(0)==="#"?Ee.charAt(1)==="x"?String.fromCharCode(parseInt(Ee.substring(2),16)):String.fromCharCode(+Ee.substring(1)):""})}var u=/(^|[^\[])\^/g;function y(Ce,me){Ce=Ce.source||Ce,me=me||"";var Ee={replace:function(ae,ce){return ce=ce.source||ce,ce=ce.replace(u,"$1"),Ce=Ce.replace(ae,ce),Ee},getRegex:function(){return new RegExp(Ce,me)}};return Ee}var g=/[^\w:]/g,v=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(Ce,me,Ee){if(Ce){var ne;try{ne=decodeURIComponent(s(Ee)).replace(g,"").toLowerCase()}catch(ae){return null}if(ne.indexOf("javascript:")===0||ne.indexOf("vbscript:")===0||ne.indexOf("data:")===0)return null}me&&!v.test(Ee)&&(Ee=l(me,Ee));try{Ee=encodeURI(Ee).replace(/%25/g,"%")}catch(ae){return null}return Ee}var w={},C=/^[^:]+:\/*[^/]*$/,x=/^([^:]+:)[\s\S]*$/,d=/^([^:]+:\/*[^/]*)[\s\S]*$/;function l(Ce,me){w[" "+Ce]||(C.test(Ce)?w[" "+Ce]=Ce+"/":w[" "+Ce]=I(Ce,"/",!0)),Ce=w[" "+Ce];var Ee=Ce.indexOf(":")===-1;return me.substring(0,2)==="//"?Ee?me:Ce.replace(x,"$1")+me:me.charAt(0)==="/"?Ee?me:Ce.replace(d,"$1")+me:Ce+me}var A={exec:function(){}};function S(Ce){for(var me=1,Ee,ne;me=0&&Ie[Ke]==="\\";)we=!we;return we?"|":" |"}),ne=Ee.split(/ \|/),ae=0;if(ne.length>me)ne.splice(me);else for(;ne.length=ne.length?ae.slice(ne.length):ae}).join(`
`)}var Se=function(){function Ce(Ee){this.options=Ee||_}var me=Ce.prototype;return me.space=function(ne){var ae=this.rules.block.newline.exec(ne);if(ae)return ae[0].length>1?{type:"space",raw:ae[0]}:{raw:`
`}},me.code=function(ne,ae){var ce=this.rules.block.code.exec(ne);if(ce){var ve=ae[ae.length-1];if(ve&&ve.type==="paragraph")return{raw:ce[0],text:ce[0].trimRight()};var Ie=ce[0].replace(/^ {4}/gm,"");return{type:"code",raw:ce[0],codeBlockStyle:"indented",text:this.options.pedantic?Ie:N(Ie,`
`)}}},me.fences=function(ne){var ae=this.rules.block.fences.exec(ne);if(ae){var ce=ae[0],ve=Pe(ce,ae[3]||"");return{type:"code",raw:ce,lang:ae[2]?ae[2].trim():ae[2],text:ve}}},me.heading=function(ne){var ae=this.rules.block.heading.exec(ne);if(ae)return{type:"heading",raw:ae[0],depth:ae[1].length,text:ae[2]}},me.nptable=function(ne){var ae=this.rules.block.nptable.exec(ne);if(ae){var ce={type:"table",header:$(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
`):[],raw:ae[0]};if(ce.header.length===ce.align.length){var ve=ce.align.length,Ie;for(Ie=0;Ie ?/gm,"");return{type:"blockquote",raw:ae[0],text:ce}}},me.list=function(ne){var ae=this.rules.block.list.exec(ne);if(ae){for(var ce=ae[0],ve=ae[2],Ie=ve.length>1,we=ve[ve.length-1]===")",Ke={type:"list",raw:ce,ordered:Ie,start:Ie?+ve.slice(0,-1):"",loose:!1,items:[]},ot=ae[0].match(this.rules.block.item),ct=!1,dt,Lt,wt,ft,zt,Ft,Jt,Ht=ot.length,Rt=0;Rt1||this.options.smartLists&&wt!==ve)&&(ft=ot.slice(Rt+1).join(`
`),Ke.raw=Ke.raw.substring(0,Ke.raw.length-ft.length),Rt=Ht-1)),zt=ct||/\n\n(?!\s*$)/.test(dt),Rt!==Ht-1&&(ct=dt.charAt(dt.length-1)===`
`,zt||(zt=ct)),zt&&(Ke.loose=!0),Ft=/^\[[ xX]\] /.test(dt),Jt=void 0,Ft&&(Jt=dt[1]!==" ",dt=dt.replace(/^\[[ xX]\] +/,"")),Ke.items.push({type:"list_item",raw:ce,task:Ft,checked:Jt,loose:zt,text:dt});return Ke}},me.html=function(ne){var ae=this.rules.block.html.exec(ne);if(ae)return{type:this.options.sanitize?"paragraph":"html",raw:ae[0],pre:!this.options.sanitizer&&(ae[1]==="pre"||ae[1]==="script"||ae[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ae[0]):q(ae[0]):ae[0]}},me.def=function(ne){var ae=this.rules.block.def.exec(ne);if(ae){ae[3]&&(ae[3]=ae[3].substring(1,ae[3].length-1));var ce=ae[1].toLowerCase().replace(/\s+/g," ");return{tag:ce,raw:ae[0],href:ae[2],title:ae[3]}}},me.table=function(ne){var ae=this.rules.block.table.exec(ne);if(ae){var ce={type:"table",header:$(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
`):[]};if(ce.header.length===ce.align.length){ce.raw=ae[0];var ve=ce.align.length,Ie;for(Ie=0;Ie/i.test(ve[0])&&(ae=!1),!ce&&/^<(pre|code|kbd|script)(\s|>)/i.test(ve[0])?ce=!0:ce&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ve[0])&&(ce=!1),{type:this.options.sanitize?"text":"html",raw:ve[0],inLink:ae,inRawBlock:ce,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ve[0]):q(ve[0]):ve[0]}},me.link=function(ne){var ae=this.rules.inline.link.exec(ne);if(ae){var ce=le(ae[2],"()");if(ce>-1){var ve=ae[0].indexOf("!")===0?5:4,Ie=ve+ae[1].length+ce;ae[2]=ae[2].substring(0,ce),ae[0]=ae[0].substring(0,Ie).trim(),ae[3]=""}var we=ae[2],Ke="";if(this.options.pedantic){var ot=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(we);ot?(we=ot[1],Ke=ot[3]):Ke=""}else Ke=ae[3]?ae[3].slice(1,-1):"";we=we.trim().replace(/^<([\s\S]*)>$/,"$1");var ct=pe(ae,{href:we&&we.replace(this.rules.inline._escapes,"$1"),title:Ke&&Ke.replace(this.rules.inline._escapes,"$1")},ae[0]);return ct}},me.reflink=function(ne,ae){var ce;if((ce=this.rules.inline.reflink.exec(ne))||(ce=this.rules.inline.nolink.exec(ne))){var ve=(ce[2]||ce[1]).replace(/\s+/g," ");if(ve=ae[ve.toLowerCase()],!ve||!ve.href){var Ie=ce[0].charAt(0);return{type:"text",raw:Ie,text:Ie}}var we=pe(ce,ve,ce[0]);return we}},me.strong=function(ne,ae,ce){ce===void 0&&(ce="");var ve=this.rules.inline.strong.start.exec(ne);if(ve&&(!ve[1]||ve[1]&&(ce===""||this.rules.inline.punctuation.exec(ce)))){ae=ae.slice(-1*ne.length);var Ie=ve[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ie.lastIndex=0;for(var we;(ve=Ie.exec(ae))!=null;)if(we=this.rules.inline.strong.middle.exec(ae.slice(0,ve.index+3)),we)return{type:"strong",raw:ne.slice(0,we[0].length),text:ne.slice(2,we[0].length-2)}}},me.em=function(ne,ae,ce){ce===void 0&&(ce="");var ve=this.rules.inline.em.start.exec(ne);if(ve&&(!ve[1]||ve[1]&&(ce===""||this.rules.inline.punctuation.exec(ce)))){ae=ae.slice(-1*ne.length);var Ie=ve[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ie.lastIndex=0;for(var we;(ve=Ie.exec(ae))!=null;)if(we=this.rules.inline.em.middle.exec(ae.slice(0,ve.index+2)),we)return{type:"em",raw:ne.slice(0,we[0].length),text:ne.slice(1,we[0].length-1)}}},me.codespan=function(ne){var ae=this.rules.inline.code.exec(ne);if(ae){var ce=ae[2].replace(/\n/g," "),ve=/[^ ]/.test(ce),Ie=ce.startsWith(" ")&&ce.endsWith(" ");return ve&&Ie&&(ce=ce.substring(1,ce.length-1)),ce=q(ce,!0),{type:"codespan",raw:ae[0],text:ce}}},me.br=function(ne){var ae=this.rules.inline.br.exec(ne);if(ae)return{type:"br",raw:ae[0]}},me.del=function(ne){var ae=this.rules.inline.del.exec(ne);if(ae)return{type:"del",raw:ae[0],text:ae[1]}},me.autolink=function(ne,ae){var ce=this.rules.inline.autolink.exec(ne);if(ce){var ve,Ie;return ce[2]==="@"?(ve=q(this.options.mangle?ae(ce[1]):ce[1]),Ie="mailto:"+ve):(ve=q(ce[1]),Ie=ve),{type:"link",raw:ce[0],text:ve,href:Ie,tokens:[{type:"text",raw:ve,text:ve}]}}},me.url=function(ne,ae){var ce;if(ce=this.rules.inline.url.exec(ne)){var ve,Ie;if(ce[2]==="@")ve=q(this.options.mangle?ae(ce[0]):ce[0]),Ie="mailto:"+ve;else{var we;do we=ce[0],ce[0]=this.rules.inline._backpedal.exec(ce[0])[0];while(we!==ce[0]);ve=q(ce[0]),ce[1]==="www."?Ie="http://"+ve:Ie=ve}return{type:"link",raw:ce[0],text:ve,href:Ie,tokens:[{type:"text",raw:ve,text:ve}]}}},me.inlineText=function(ne,ae,ce){var ve=this.rules.inline.text.exec(ne);if(ve){var Ie;return ae?Ie=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ve[0]):q(ve[0]):ve[0]:Ie=q(this.options.smartypants?ce(ve[0]):ve[0]),{type:"text",raw:ve[0],text:Ie}}},Ce}(),ke=z.noopTest,Ae=z.edit,Te=z.merge,ge={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ke,table:ke,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ge._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ge._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ge.def=Ae(ge.def).replace("label",ge._label).replace("title",ge._title).getRegex(),ge.bullet=/(?:[*+-]|\d{1,9}[.)])/,ge.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ge.item=Ae(ge.item,"gm").replace(/bull/g,ge.bullet).getRegex(),ge.list=Ae(ge.list).replace(/bull/g,ge.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ge.def.source+")").getRegex(),ge._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ge._comment=//,ge.html=Ae(ge.html,"i").replace("comment",ge._comment).replace("tag",ge._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ge.paragraph=Ae(ge._paragraph).replace("hr",ge.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ge._tag).getRegex(),ge.blockquote=Ae(ge.blockquote).replace("paragraph",ge.paragraph).getRegex(),ge.normal=Te({},ge),ge.gfm=Te({},ge.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ge.gfm.nptable=Ae(ge.gfm.nptable).replace("hr",ge.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ge._tag).getRegex(),ge.gfm.table=Ae(ge.gfm.table).replace("hr",ge.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ge._tag).getRegex(),ge.pedantic=Te({},ge.normal,{html:Ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ge._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:ke,paragraph:Ae(ge.normal._paragraph).replace("hr",ge.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ge.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var he={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ke,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:ke,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",he.punctuation=Ae(he.punctuation).replace(/punctuation/g,he._punctuation).getRegex(),he._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",he._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",he.em.start=Ae(he.em.start).replace(/punctuation/g,he._punctuation).getRegex(),he.em.middle=Ae(he.em.middle).replace(/punctuation/g,he._punctuation).replace(/overlapSkip/g,he._overlapSkip).getRegex(),he.em.endAst=Ae(he.em.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.em.endUnd=Ae(he.em.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.start=Ae(he.strong.start).replace(/punctuation/g,he._punctuation).getRegex(),he.strong.middle=Ae(he.strong.middle).replace(/punctuation/g,he._punctuation).replace(/blockSkip/g,he._blockSkip).getRegex(),he.strong.endAst=Ae(he.strong.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.endUnd=Ae(he.strong.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.blockSkip=Ae(he._blockSkip,"g").getRegex(),he.overlapSkip=Ae(he._overlapSkip,"g").getRegex(),he._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,he._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,he._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])?)+(?![-_])/,he.autolink=Ae(he.autolink).replace("scheme",he._scheme).replace("email",he._email).getRegex(),he._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,he.tag=Ae(he.tag).replace("comment",ge._comment).replace("attribute",he._attribute).getRegex(),he._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,he._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,he._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,he.link=Ae(he.link).replace("label",he._label).replace("href",he._href).replace("title",he._title).getRegex(),he.reflink=Ae(he.reflink).replace("label",he._label).getRegex(),he.reflinkSearch=Ae(he.reflinkSearch,"g").replace("reflink",he.reflink).replace("nolink",he.nolink).getRegex(),he.normal=Te({},he),he.pedantic=Te({},he.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:Ae(/^!?\[(label)\]\((.*?)\)/).replace("label",he._label).getRegex(),reflink:Ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",he._label).getRegex()}),he.gfm=Te({},he.normal,{escape:Ae(he.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&&(ne="x"+ne.toString(16)),me+=""+ne+";";return me}var be=function(){function Ce(Ee){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ee||de,this.options.tokenizer=this.options.tokenizer||new Se,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ne={block:se.normal,inline:Oe.normal};this.options.pedantic?(ne.block=se.pedantic,ne.inline=Oe.pedantic):this.options.gfm&&(ne.block=se.gfm,this.options.breaks?ne.inline=Oe.breaks:ne.inline=Oe.gfm),this.tokenizer.rules=ne}Ce.lex=function(ne,ae){var ce=new Ce(ae);return ce.lex(ne)};var me=Ce.prototype;return me.lex=function(ne){return ne=ne.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ne,this.tokens,!0),this.inline(this.tokens),this.tokens},me.blockTokens=function(ne,ae,ce){ae===void 0&&(ae=[]),ce===void 0&&(ce=!0),ne=ne.replace(/^ +$/gm,"");for(var ve,Ie,we,Ke;ne;){if(ve=this.tokenizer.space(ne)){ne=ne.substring(ve.raw.length),ve.type&&ae.push(ve);continue}if(ve=this.tokenizer.code(ne,ae)){ne=ne.substring(ve.raw.length),ve.type?ae.push(ve):(Ke=ae[ae.length-1],Ke.raw+=`
`+ve.raw,Ke.text+=`
`+ve.text);continue}if(ve=this.tokenizer.fences(ne)){ne=ne.substring(ve.raw.length),ae.push(ve);continue}if(ve=this.tokenizer.heading(ne)){ne=ne.substring(ve.raw.length),ae.push(ve);continue}if(ve=this.tokenizer.nptable(ne)){ne=ne.substring(ve.raw.length),ae.push(ve);continue}if(ve=this.tokenizer.hr(ne)){ne=ne.substring(ve.raw.length),ae.push(ve);continue}if(ve=this.tokenizer.blockquote(ne)){ne=ne.substring(ve.raw.length),ve.tokens=this.blockTokens(ve.text,[],ce),ae.push(ve);continue}if(ve=this.tokenizer.list(ne)){for(ne=ne.substring(ve.raw.length),we=ve.items.length,Ie=0;Ie0)for(;(ot=this.tokenizer.rules.inline.reflinkSearch.exec(Ke))!=null;)ct.includes(ot[0].slice(ot[0].lastIndexOf("[")+1,-1))&&(Ke=Ke.slice(0,ot.index)+"["+"a".repeat(ot[0].length-2)+"]"+Ke.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ot=this.tokenizer.rules.inline.blockSkip.exec(Ke))!=null;)Ke=Ke.slice(0,ot.index)+"["+"a".repeat(ot[0].length-2)+"]"+Ke.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ne;){if(we=this.tokenizer.escape(ne)){ne=ne.substring(we.raw.length),ae.push(we);continue}if(we=this.tokenizer.tag(ne,ce,ve)){ne=ne.substring(we.raw.length),ce=we.inLink,ve=we.inRawBlock,ae.push(we);continue}if(we=this.tokenizer.link(ne)){ne=ne.substring(we.raw.length),we.type==="link"&&(we.tokens=this.inlineTokens(we.text,[],!0,ve)),ae.push(we);continue}if(we=this.tokenizer.reflink(ne,this.tokens.links)){ne=ne.substring(we.raw.length),we.type==="link"&&(we.tokens=this.inlineTokens(we.text,[],!0,ve)),ae.push(we);continue}if(we=this.tokenizer.strong(ne,Ke,Ie)){ne=ne.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],ce,ve),ae.push(we);continue}if(we=this.tokenizer.em(ne,Ke,Ie)){ne=ne.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],ce,ve),ae.push(we);continue}if(we=this.tokenizer.codespan(ne)){ne=ne.substring(we.raw.length),ae.push(we);continue}if(we=this.tokenizer.br(ne)){ne=ne.substring(we.raw.length),ae.push(we);continue}if(we=this.tokenizer.del(ne)){ne=ne.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],ce,ve),ae.push(we);continue}if(we=this.tokenizer.autolink(ne,oe)){ne=ne.substring(we.raw.length),ae.push(we);continue}if(!ce&&(we=this.tokenizer.url(ne,oe))){ne=ne.substring(we.raw.length),ae.push(we);continue}if(we=this.tokenizer.inlineText(ne,ve,ie)){ne=ne.substring(we.raw.length),Ie=we.raw.slice(-1),ae.push(we);continue}if(ne){var dt="Infinite loop on byte: "+ne.charCodeAt(0);if(this.options.silent){console.error(dt);break}else throw new Error(dt)}}return ae},J(Ce,null,[{key:"rules",get:function(){return{block:se,inline:Oe}}}]),Ce}(),De=H.defaults,Ne=z.cleanUrl,Fe=z.escape,je=function(){function Ce(Ee){this.options=Ee||De}var me=Ce.prototype;return me.code=function(ne,ae,ce){var ve=(ae||"").match(/\S*/)[0];if(this.options.highlight){var Ie=this.options.highlight(ne,ve);Ie!=null&&Ie!==ne&&(ce=!0,ne=Ie)}return ve?''+(ce?ne:Fe(ne,!0))+`
`:""+(ce?ne:Fe(ne,!0))+`
`},me.blockquote=function(ne){return`
`+ne+`
`},me.html=function(ne){return ne},me.heading=function(ne,ae,ce,ve){return this.options.headerIds?"
`:""+ne+"
`},me.hr=function(){return this.options.xhtml?`
`:`
`},me.list=function(ne,ae,ce){var ve=ae?"ol":"ul",Ie=ae&&ce!==1?' start="'+ce+'"':"";return"<"+ve+Ie+`>
`+ne+""+ve+`>
`},me.listitem=function(ne){return""+ne+`
`},me.checkbox=function(ne){return" "},me.paragraph=function(ne){return""+ne+`
`},me.table=function(ne,ae){return ae&&(ae=""+ae+""),`
`},me.tablerow=function(ne){return`
`+ne+`
`},me.tablecell=function(ne,ae){var ce=ae.header?"th":"td",ve=ae.align?"<"+ce+' align="'+ae.align+'">':"<"+ce+">";return ve+ne+""+ce+`>
`},me.strong=function(ne){return""+ne+""},me.em=function(ne){return""+ne+""},me.codespan=function(ne){return""+ne+""},me.br=function(){return this.options.xhtml?"
":"
"},me.del=function(ne){return""+ne+""},me.link=function(ne,ae,ce){if(ne=Ne(this.options.sanitize,this.options.baseUrl,ne),ne===null)return ce;var ve='"+ce+"",ve},me.image=function(ne,ae,ce){if(ne=Ne(this.options.sanitize,this.options.baseUrl,ne),ne===null)return ce;var ve='
":">",ve},me.text=function(ne){return ne},Ce}(),Ue=function(){function Ce(){}var me=Ce.prototype;return me.strong=function(ne){return ne},me.em=function(ne){return ne},me.codespan=function(ne){return ne},me.del=function(ne){return ne},me.html=function(ne){return ne},me.text=function(ne){return ne},me.link=function(ne,ae,ce){return""+ce},me.image=function(ne,ae,ce){return""+ce},me.br=function(){return""},Ce}(),rt=function(){function Ce(){this.seen={}}var me=Ce.prototype;return me.slug=function(ne){var ae=ne.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ae)){var ce=ae;do this.seen[ce]++,ae=ce+"-"+this.seen[ce];while(this.seen.hasOwnProperty(ae))}return this.seen[ae]=0,ae},Ce}(),Qe=H.defaults,qe=z.unescape,Ye=function(){function Ce(Ee){this.options=Ee||Qe,this.options.renderer=this.options.renderer||new je,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ue,this.slugger=new rt}Ce.parse=function(ne,ae){var ce=new Ce(ae);return ce.parse(ne)};var me=Ce.prototype;return me.parse=function(ne,ae){ae===void 0&&(ae=!0);var ce="",ve,Ie,we,Ke,ot,ct,dt,Lt,wt,ft,zt,Ft,Jt,Ht,Rt,Ur,Zr,bt,Ct=ne.length;for(ve=0;ve0&&Rt.tokens[0].type==="text"?(Rt.tokens[0].text=bt+" "+Rt.tokens[0].text,Rt.tokens[0].tokens&&Rt.tokens[0].tokens.length>0&&Rt.tokens[0].tokens[0].type==="text"&&(Rt.tokens[0].tokens[0].text=bt+" "+Rt.tokens[0].tokens[0].text)):Rt.tokens.unshift({type:"text",text:bt}):Ht+=bt),Ht+=this.parse(Rt.tokens,Jt),wt+=this.renderer.listitem(Ht,Zr,Ur);ce+=this.renderer.list(wt,zt,Ft);continue}case"html":{ce+=this.renderer.html(ft.text);continue}case"paragraph":{ce+=this.renderer.paragraph(this.parseInline(ft.tokens));continue}case"text":{for(wt=ft.tokens?this.parseInline(ft.tokens):ft.text;ve+1An error occurred:"+et(we.message+"",!0)+"
";throw we}}Be.options=Be.setOptions=function(Ce){return nt(Be.defaults,Ce),Je(Be.defaults),Be},Be.getDefaults=_e,Be.defaults=st,Be.use=function(Ce){var me=nt({},Ce);if(Ce.renderer&&function(){var ne=Be.defaults.renderer||new je,ae=function(Ie){var we=ne[Ie];ne[Ie]=function(){for(var Ke=arguments.length,ot=new Array(Ke),ct=0;ct`,triples:"",explode:"[]{}"},O=ue.Pos;ue.defineOption("autoCloseBrackets",!1,function(m,b,a){a&&a!=ue.Init&&(m.removeKeyMap(F),m.state.closeBrackets=null),b&&(M(X(b,"pairs")),m.state.closeBrackets=b,m.addKeyMap(F))});function X(m,b){return b=="pairs"&&typeof m=="string"?m:typeof m=="object"&&m[b]!=null?m[b]:J[b]}var F={Backspace:P,Enter:L};function M(m){for(var b=0;b=0;s--){var y=i[s].head;m.replaceRange("",O(y.line,y.ch-1),O(y.line,y.ch+1),"+delete")}}function L(m){var b=U(m),a=b&&X(b,"explode");if(!a||m.getOption("disableInput"))return ue.Pass;for(var i=m.listSelections(),s=0;s0;return{anchor:new O(m.anchor.line,m.anchor.ch+(b?-1:1)),head:new O(m.head.line,m.head.ch+(b?1:-1))}}function f(m,b){var a=U(m);if(!a||m.getOption("disableInput"))return ue.Pass;var i=X(a,"pairs"),s=i.indexOf(b);if(s==-1)return ue.Pass;for(var u=X(a,"closeBefore"),y=X(a,"triples"),g=i.charAt(s+1)==b,v=m.listSelections(),R=s%2==0,w,C=0;C=0&&m.getRange(d,O(d.line,d.ch+3))==b+b+b?l="skipThree":l="skip";else if(g&&d.ch>1&&y.indexOf(b)>=0&&m.getRange(O(d.line,d.ch-2),d)==b+b){if(d.ch>2&&/\bstring/.test(m.getTokenTypeAt(O(d.line,d.ch-2))))return ue.Pass;l="addFour"}else if(g){var S=d.ch==0?" ":m.getRange(O(d.line,d.ch-1),d);if(!ue.isWordChar(A)&&S!=b&&!ue.isWordChar(S))l="both";else return ue.Pass}else if(R&&(A.length===0||/\s/.test(A)||u.indexOf(A)>-1))l="both";else return ue.Pass;if(!w)w=l;else if(w!=l)return ue.Pass}var D=s%2?i.charAt(s-1):b,I=s%2?b:i.charAt(s+1);m.operation(function(){if(w=="skip")m.execCommand("goCharRight");else if(w=="skipThree")for(var B=0;B<3;B++)m.execCommand("goCharRight");else if(w=="surround"){for(var j=m.getSelections(),B=0;B0&&(le.percent=le.loaded/le.total*100),z.onProgress(le)});var N=new FormData;z.data&&Object.keys(z.data).forEach(function(q){var le=z.data[q];if(Array.isArray(le)){le.forEach(function(pe){N.append(q+"[]",pe)});return}N.append(q,z.data[q])}),z.file instanceof Blob?N.append(z.filename,z.file,z.file.name):N.append(z.filename,z.file),_.onerror=function(le){z.onError(le)},_.onload=function(){return _.status<200||_.status>=300?z.onError(F(z,_),M(_)):z.onSuccess(M(_),_)},_.open(z.method,z.action,!0),z.withCredentials&&"withCredentials"in _&&(_.withCredentials=!0);var $=z.headers||{};return $["X-Requested-With"]!==null&&_.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys($).forEach(function(q){$[q]!==null&&_.setRequestHeader(q,$[q])}),_.send(N),{abort:function(){_.abort()}}}var U=+new Date,P=0;function L(){return"rc-upload-"+U+"-"+ ++P}function h(z,_){return z.indexOf(_,z.length-_.length)!==-1}var f=function(z,_){if(z&&_){var N=Array.isArray(_)?_:_.split(","),$=z.name||"",q=z.type||"",le=q.replace(/\/.*$/,"");return N.some(function(pe){var Pe=pe.trim();return Pe.charAt(0)==="."?h($.toLowerCase(),Pe.toLowerCase()):/\/\*$/.test(Pe)?le===Pe.replace(/\/.*$/,""):q===Pe})}return!0};function T(z,_){var N=z.createReader(),$=[];function q(){N.readEntries(function(le){var pe=Array.prototype.slice.apply(le);$=$.concat(pe);var Pe=!pe.length;Pe?_($):q()})}q()}var p=function(_,N,$){var q=function le(pe,Pe){Pe=Pe||"",pe.isFile?pe.file(function(Se){$(Se)&&(pe.fullPath&&!Se.webkitRelativePath&&(Object.defineProperties(Se,{webkitRelativePath:{writable:!0}}),Se.webkitRelativePath=pe.fullPath.replace(/^\//,""),Object.defineProperties(Se,{webkitRelativePath:{writable:!1}})),N([Se]))}):pe.isDirectory&&T(pe,function(Se){Se.forEach(function(ke){le(ke,""+Pe+pe.name+"/")})})};_.forEach(function(le){q(le.webkitGetAsEntry())})},m=p,b=Object.assign||function(z){for(var _=1;_=0)continue;if(!Object.prototype.hasOwnProperty.call(z,$))continue;N[$]=z[$]}return N}function y(z,_){if(!(z instanceof _))throw new TypeError("Cannot call a class as a function")}function g(z,_){if(!z)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:z}function v(z,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);z.prototype=Object.create(_&&_.prototype,{constructor:{value:z,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(z,_):z.__proto__=_)}var R=function(_){return Object.keys(_).reduce(function(N,$){return($.substr(0,5)==="data-"||$.substr(0,5)==="aria-"||$==="role")&&(N[$]=_[$]),N},{})},w=function(z){v(_,z);function _(){var N,$,q,le;y(this,_);for(var pe=arguments.length,Pe=Array(pe),Se=0;Se=R?J:{done:!1,value:g[v++]}}}}P.fromArray=T;function p(g){return{next:function(){var v=g.next();return v.done?J:{done:!1,value:v.value}}}}P.fromNativeIterator=p;function m(g){return g?Array.isArray(g)?P.fromArray(g):g:P.empty()}P.from=m;function b(g,v){return{next:function(){var R=g.next();return R.done?J:{done:!1,value:v(R.value)}}}}P.map=b;function a(g,v){return{next:function(){for(;;){var R=g.next();if(R.done)return J;if(v(R.value))return{done:!1,value:R.value}}}}}P.filter=a;function i(g,v){for(var R=g.next();!R.done;R=g.next())v(R.value)}P.forEach=i;function s(g,v){v===void 0&&(v=Number.POSITIVE_INFINITY);var R=[];if(v===0)return R;for(var w=0,C=g.next();!C.done&&!(R.push(C.value),++w>=v);C=g.next());return R}P.collect=s;function u(){for(var g=[],v=0;v=g.length)return J;var w=g[R],C=w.next();return C.done?(R++,this.next()):C}}}P.concat=u;function y(g){return new X(g)}P.chain=y})(O||(O={}));var X=function(){function P(L){this.it=L}return P.prototype.next=function(){return this.it.next()},P}();function F(P){return Array.isArray(P)?O.fromArray(P):P||O.empty()}var M=function(){function P(L,h,f,T){h===void 0&&(h=0),f===void 0&&(f=L.length),T===void 0&&(T=h-1),this.items=L,this.start=h,this.end=f,this.index=T}return P.prototype.first=function(){return this.index=this.start,this.current()},P.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},P.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},P}(),H=function(P){ue(L,P);function L(h,f,T,p){return f===void 0&&(f=0),T===void 0&&(T=h.length),p===void 0&&(p=f-1),P.call(this,h,f,T,p)||this}return L.prototype.current=function(){return P.prototype.current.call(this)},L.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},L.prototype.first=function(){return this.index=this.start,this.current()},L.prototype.last=function(){return this.index=this.end-1,this.current()},L.prototype.parent=function(){return null},L}(M),U=function(){function P(L,h){this.iterator=L,this.fn=h}return P.prototype.next=function(){return this.fn(this.iterator.next())},P}()},LdHM:function(vt,Le,ee){"use strict";ee.d(Le,"b",function(){return u}),ee.d(Le,"a",function(){return g});var ue=ee("1OyB"),J=ee("vuIU"),O=ee("Ji7U"),X=ee("LK+K"),F=ee("q1tI"),M=ee("rePB"),H=ee("Ff2n"),U=ee("ODXe"),P=ee("4IlW"),L=ee("bX4T"),h=ee("YrtM"),f=ee("TSYQ"),T=ee.n(f),p=ee("+nKL"),m=ee("8OUc"),b=function($,q){var le=$.prefixCls,pe=$.id,Pe=$.flattenOptions,Se=$.childrenAsData,ke=$.values,Ae=$.searchValue,Te=$.multiple,ge=$.defaultActiveFirstOption,he=$.height,re=$.itemHeight,de=$.notFoundContent,se=$.open,Oe=$.menuItemSelectedIcon,ie=$.virtual,oe=$.onSelect,be=$.onToggleOpen,De=$.onActiveValue,Ne=$.onScroll,Fe=$.onMouseEnter,je="".concat(le,"-item"),Ue=Object(h.a)(function(){return Pe},[se,Pe],function(ze,Ce){return Ce[0]&&ze[1]!==Ce[1]}),rt=F.useRef(null),Qe=function(Ce){Ce.preventDefault()},qe=function(Ce){rt.current&&rt.current.scrollTo({index:Ce})},Ye=function(Ce){for(var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ee=Ue.length,ne=0;ne1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(N).map(function(q,le){if(!F.isValidElement(q)||!q.type)return null;var pe=q.type.isSelectOptGroup,Pe=q.key,Se=q.props,ke=Se.children,Ae=Object(H.a)(Se,["children"]);return $||!pe?w(q):Object(v.a)(Object(v.a)({key:"__RC_SELECT_GRP__".concat(Pe===null?le:Pe,"__"),label:Pe},Ae),{},{options:C(ke)})}).filter(function(q){return q})}var x=ee("2Qr1"),d=ee("qNPg"),l=ee("U8pU"),A=ee("Kwbf"),S=ee("WKfj");function D(N){var $=N.mode,q=N.options,le=N.children,pe=N.backfill,Pe=N.allowClear,Se=N.placeholder,ke=N.getInputElement,Ae=N.showSearch,Te=N.onSearch,ge=N.defaultOpen,he=N.autoFocus,re=N.labelInValue,de=N.value,se=N.inputValue,Oe=N.optionLabelProp,ie=$==="multiple"||$==="tags",oe=Ae!==void 0?Ae:ie||$==="combobox",be=q||C(le);if(Object(A.a)($!=="tags"||be.every(function(je){return!je.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),$==="tags"||$==="combobox"){var De=be.some(function(je){return je.options?je.options.some(function(Ue){return typeof("value"in Ue?Ue.value:Ue.key)=="number"}):typeof("value"in je?je.value:je.key)=="number"});Object(A.a)(!De,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(A.a)($!=="combobox"||!Oe,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(A.a)($==="combobox"||!pe,"`backfill` only works with `combobox` mode."),Object(A.a)($==="combobox"||!ke,"`getInputElement` only work with `combobox` mode."),Object(A.b)($!=="combobox"||!ke||!Pe||!Se,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Te&&!oe&&$!=="combobox"&&$!=="tags"&&Object(A.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(A.b)(!ge||he,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),de!=null){var Ne=Object(S.d)(de);Object(A.a)(!re||Ne.every(function(je){return Object(l.a)(je)==="object"&&("key"in je||"value"in je)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(A.a)(!ie||Array.isArray(de),"`value` should be array when `mode` is `multiple` or `tags`")}if(le){var Fe=null;Object(R.a)(le).some(function(je){if(!F.isValidElement(je)||!je.type)return!1;var Ue=je.type;if(Ue.isSelectOption)return!1;if(Ue.isSelectOptGroup){var rt=Object(R.a)(je.props.children).every(function(Qe){return!F.isValidElement(Qe)||!je.type||Qe.type.isSelectOption?!0:(Fe=Qe.type,!1)});return!rt}return Fe=Ue,!0}),Fe&&Object(A.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Fe.displayName||Fe.name||Fe,"`.")),Object(A.a)(se===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var I=D,B=Object(d.a)({prefixCls:"rc-select",components:{optionList:i},convertChildrenToData:C,flattenOptions:x.d,getLabeledValue:x.e,filterOptions:x.b,isValueDisabled:x.g,findValueOption:x.c,warningProps:I,fillOptionsWithMissingValue:x.a}),j=function(N){Object(O.a)(q,N);var $=Object(X.a)(q);function q(){var le;return Object(ue.a)(this,q),le=$.apply(this,arguments),le.selectRef=F.createRef(),le.focus=function(){le.selectRef.current.focus()},le.blur=function(){le.selectRef.current.blur()},le}return Object(J.a)(q,[{key:"render",value:function(){return F.createElement(B,Object.assign({ref:this.selectRef},this.props))}}]),q}(F.Component);j.Option=u,j.OptGroup=g;var z=j,_=Le.c=z},M8RZ:function(vt,Le,ee){"use strict";ee.d(Le,"a",function(){return P});var ue=ee("fWQN"),J=ee("mtLc"),O=ee("yKVA"),X=ee("879j"),F=ee("q1tI"),M=ee.n(F),H=ee("i8i4"),U=ee.n(H),P=function(L){Object(O.a)(f,L);var h=Object(X.a)(f);function f(T){var p;Object(ue.a)(this,f),p=h.call(this,T);var m=window.document;return p.node=m.createElement("div"),m.body.appendChild(p.node),p}return Object(J.a)(f,[{key:"render",value:function(){var p=this.props.children;return Object(H.createPortal)(p,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),f}(M.a.Component)},MI8n:function(vt,Le,ee){"use strict";ee.d(Le,"b",function(){return M}),ee.d(Le,"a",function(){return P}),ee.d(Le,"e",function(){return L}),ee.d(Le,"d",function(){return h}),ee.d(Le,"c",function(){return f}),ee.d(Le,"f",function(){return T});var ue=ee("/cxE"),J=ee("C/vA"),O=ee("pmY6"),X=ee("24hK"),F=function(){var p=function(m,b){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,i){a.__proto__=i}||function(a,i){for(var s in i)i.hasOwnProperty(s)&&(a[s]=i[s])},p(m,b)};return function(m,b){p(m,b);function a(){this.constructor=m}m.prototype=b===null?Object.create(b):(a.prototype=b.prototype,new a)}}(),M;(function(p){p.None=function(){return O.a.None};function m(I){return function(B,j,z){j===void 0&&(j=null);var _=!1,N;return N=I(function($){return _?void 0:(N?N.dispose():_=!0,B.call(j,$))},null,z),_&&N.dispose(),N}}p.once=m;function b(I,B){return g(function(j,z,_){return z===void 0&&(z=null),I(function(N){return j.call(z,B(N))},null,_)})}p.map=b;function a(I,B){return g(function(j,z,_){return z===void 0&&(z=null),I(function(N){B(N),j.call(z,N)},null,_)})}p.forEach=a;function i(I,B){return g(function(j,z,_){return z===void 0&&(z=null),I(function(N){return B(N)&&j.call(z,N)},null,_)})}p.filter=i;function s(I){return I}p.signal=s;function u(){for(var I=[],B=0;B1)&&pe.fire(Se),le=0},j)})},onLastListenerRemove:function(){N.dispose()}});return pe.event}p.debounce=v;function R(I){var B=new Date().getTime();return b(m(I),function(j){return new Date().getTime()-B})}p.stopwatch=R;function w(I){var B=!0,j;return i(I,function(z){var _=B||z!==j;return B=!1,j=z,_})}p.latch=w;function C(I,B,j){B===void 0&&(B=!1),j===void 0&&(j=[]);var z=j.slice(),_=I(function(q){z?z.push(q):$.fire(q)}),N=function(){z&&z.forEach(function(q){return $.fire(q)}),z=null},$=new P({onFirstListenerAdd:function(){_||(_=I(function(q){return $.fire(q)}))},onFirstListenerDidAdd:function(){z&&(B?setTimeout(N):N())},onLastListenerRemove:function(){_&&_.dispose(),_=null}});return $.event}p.buffer=C;var x=function(){function I(B){this.event=B}return I.prototype.map=function(B){return new I(b(this.event,B))},I.prototype.forEach=function(B){return new I(a(this.event,B))},I.prototype.filter=function(B){return new I(i(this.event,B))},I.prototype.reduce=function(B,j){return new I(y(this.event,B,j))},I.prototype.latch=function(){return new I(w(this.event))},I.prototype.debounce=function(B,j,z,_){return j===void 0&&(j=100),z===void 0&&(z=!1),new I(v(this.event,B,j,z,_))},I.prototype.on=function(B,j,z){return this.event(B,j,z)},I.prototype.once=function(B,j,z){return m(this.event)(B,j,z)},I}();function d(I){return new x(I)}p.chain=d;function l(I,B,j){j===void 0&&(j=function(q){return q});var z=function(){for(var q=[],le=0;le0?new U(this._options&&this._options.leakWarningThreshold):void 0}return Object.defineProperty(p.prototype,"event",{get:function(){var m=this;return this._event||(this._event=function(b,a,i){m._listeners||(m._listeners=new X.a);var s=m._listeners.isEmpty();s&&m._options&&m._options.onFirstListenerAdd&&m._options.onFirstListenerAdd(m);var u=m._listeners.push(a?[b,a]:b);s&&m._options&&m._options.onFirstListenerDidAdd&&m._options.onFirstListenerDidAdd(m),m._options&&m._options.onListenerDidAdd&&m._options.onListenerDidAdd(m,b,a);var y;m._leakageMon&&(y=m._leakageMon.check(m._listeners.size));var g;return g={dispose:function(){if(y&&y(),g.dispose=p._noop,!m._disposed&&(u(),m._options&&m._options.onLastListenerRemove)){var v=m._listeners&&!m._listeners.isEmpty();v||m._options.onLastListenerRemove(m)}}},i instanceof O.b?i.add(g):Array.isArray(i)&&i.push(g),g}),this._event},enumerable:!0,configurable:!0}),p.prototype.fire=function(m){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new X.a);for(var b=this._listeners.iterator(),a=b.next();!a.done;a=b.next())this._deliveryQueue.push([a.value,m]);for(;this._deliveryQueue.size>0;){var i=this._deliveryQueue.shift(),s=i[0],u=i[1];try{typeof s=="function"?s.call(void 0,u):s[0].call(s[1],u)}catch(y){Object(ue.e)(y)}}}},p.prototype.dispose=function(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0},p._noop=function(){},p}(),L=function(p){F(m,p);function m(b){var a=p.call(this,b)||this;return a._isPaused=0,a._eventQueue=new X.a,a._mergeFn=b&&b.merge,a}return m.prototype.pause=function(){this._isPaused++},m.prototype.resume=function(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){var b=this._eventQueue.toArray();this._eventQueue.clear(),p.prototype.fire.call(this,this._mergeFn(b))}else for(;!this._isPaused&&this._eventQueue.size!==0;)p.prototype.fire.call(this,this._eventQueue.shift())},m.prototype.fire=function(b){this._listeners&&(this._isPaused!==0?this._eventQueue.push(b):p.prototype.fire.call(this,b))},m}(P),h=function(){function p(){var m=this;this.hasListeners=!1,this.events=[],this.emitter=new P({onFirstListenerAdd:function(){return m.onFirstListenerAdd()},onLastListenerRemove:function(){return m.onLastListenerRemove()}})}return Object.defineProperty(p.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),p.prototype.add=function(m){var b=this,a={event:m,listener:null};this.events.push(a),this.hasListeners&&this.hook(a);var i=function(){b.hasListeners&&b.unhook(a);var s=b.events.indexOf(a);b.events.splice(s,1)};return Object(O.h)(Object(J.a)(i))},p.prototype.onFirstListenerAdd=function(){var m=this;this.hasListeners=!0,this.events.forEach(function(b){return m.hook(b)})},p.prototype.onLastListenerRemove=function(){var m=this;this.hasListeners=!1,this.events.forEach(function(b){return m.unhook(b)})},p.prototype.hook=function(m){var b=this;m.listener=m.event(function(a){return b.emitter.fire(a)})},p.prototype.unhook=function(m){m.listener&&m.listener.dispose(),m.listener=null},p.prototype.dispose=function(){this.emitter.dispose()},p}(),f=function(){function p(){this.buffers=[]}return p.prototype.wrapEvent=function(m){var b=this;return function(a,i,s){return m(function(u){var y=b.buffers[b.buffers.length-1];y?y.push(function(){return a.call(i,u)}):a.call(i,u)},void 0,s)}},p.prototype.bufferEvents=function(m){var b=[];this.buffers.push(b);var a=m();return this.buffers.pop(),b.forEach(function(i){return i()}),a},p}(),T=function(){function p(){var m=this;this.listening=!1,this.inputEvent=M.None,this.inputEventListener=O.a.None,this.emitter=new P({onFirstListenerDidAdd:function(){m.listening=!0,m.inputEventListener=m.inputEvent(m.emitter.fire,m.emitter)},onLastListenerRemove:function(){m.listening=!1,m.inputEventListener.dispose()}}),this.event=this.emitter.event}return Object.defineProperty(p.prototype,"input",{set:function(m){this.inputEvent=m,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=m(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),p.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()},p}()},N0LK:function(vt,Le,ee){"use strict";ee.d(Le,"x",function(){return ue}),ee.d(Le,"F",function(){return J}),ee.d(Le,"r",function(){return X}),ee.d(Le,"o",function(){return F}),ee.d(Le,"p",function(){return M}),ee.d(Le,"Q",function(){return H}),ee.d(Le,"K",function(){return P}),ee.d(Le,"k",function(){return L}),ee.d(Le,"N",function(){return h}),ee.d(Le,"m",function(){return f}),ee.d(Le,"l",function(){return T}),ee.d(Le,"I",function(){return p}),ee.d(Le,"H",function(){return m}),ee.d(Le,"q",function(){return b}),ee.d(Le,"t",function(){return a}),ee.d(Le,"D",function(){return i}),ee.d(Le,"e",function(){return s}),ee.d(Le,"f",function(){return u}),ee.d(Le,"B",function(){return y}),ee.d(Le,"C",function(){return g}),ee.d(Le,"n",function(){return R}),ee.d(Le,"O",function(){return C}),ee.d(Le,"c",function(){return x}),ee.d(Le,"d",function(){return d}),ee.d(Le,"z",function(){return l}),ee.d(Le,"A",function(){return A}),ee.d(Le,"u",function(){return S}),ee.d(Le,"E",function(){return I}),ee.d(Le,"G",function(){return B}),ee.d(Le,"i",function(){return z}),ee.d(Le,"g",function(){return N}),ee.d(Le,"v",function(){return q}),ee.d(Le,"h",function(){return le}),ee.d(Le,"y",function(){return pe}),ee.d(Le,"w",function(){return Pe}),ee.d(Le,"a",function(){return Se}),ee.d(Le,"P",function(){return ke}),ee.d(Le,"L",function(){return Ae}),ee.d(Le,"J",function(){return Te}),ee.d(Le,"j",function(){return ge}),ee.d(Le,"M",function(){return he}),ee.d(Le,"s",function(){return re}),ee.d(Le,"b",function(){return de});function ue(ie){return!ie||typeof ie!="string"?!0:ie.trim().length===0}function J(ie,oe,be){be===void 0&&(be="0");for(var De=""+ie,Ne=[De],Fe=De.length;Fe=oe.length?De:oe[Fe]})}function F(ie){return ie.replace(/[<>&]/g,function(oe){switch(oe){case"<":return"<";case">":return">";case"&":return"&";default:return oe}})}function M(ie){return ie.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function H(ie,oe){oe===void 0&&(oe=" ");var be=U(ie,oe);return P(be,oe)}function U(ie,oe){if(!ie||!oe)return ie;var be=oe.length;if(be===0||ie.length===0)return ie;for(var De=0;ie.indexOf(oe,De)===De;)De=De+be;return ie.substring(De)}function P(ie,oe){if(!ie||!oe)return ie;var be=oe.length,De=ie.length;if(be===0||De===0)return ie;for(var Ne=De,Fe=-1;!(Fe=ie.lastIndexOf(oe,Ne-1),Fe===-1||Fe+be!==Ne);){if(Fe===0)return"";Ne=Fe}return ie.substring(0,Ne)}function L(ie){return ie.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function h(ie,oe){if(ie.length0?ie.indexOf(oe,be)===be:be===0?ie===oe:!1}function T(ie,oe,be){if(be===void 0&&(be={}),!ie)throw new Error("Cannot create regex from empty string");oe||(ie=M(ie)),be.wholeWord&&(/\B/.test(ie.charAt(0))||(ie="\\b"+ie),/\B/.test(ie.charAt(ie.length-1))||(ie=ie+"\\b"));var De="";return be.global&&(De+="g"),be.matchCase||(De+="i"),be.multiline&&(De+="m"),be.unicode&&(De+="u"),new RegExp(ie,De)}function p(ie){if(ie.source==="^"||ie.source==="^$"||ie.source==="$"||ie.source==="^\\s*$")return!1;var oe=ie.exec("");return!!(oe&&ie.lastIndex===0)}function m(ie){return(ie.global?"g":"")+(ie.ignoreCase?"i":"")+(ie.multiline?"m":"")+(ie.unicode?"u":"")}function b(ie){for(var oe=0,be=ie.length;oe=0;be--){var De=ie.charCodeAt(be);if(De!==32&&De!==9)return be}return-1}function s(ie,oe){return ieoe?1:0}function u(ie,oe){for(var be=Math.min(ie.length,oe.length),De=0;Deoe.length?1:0}function y(ie){return ie>=97&&ie<=122}function g(ie){return ie>=65&&ie<=90}function v(ie){return y(ie)||g(ie)}function R(ie,oe){return ie.length===oe.length&&w(ie,oe)}function w(ie,oe,be){be===void 0&&(be=ie.length);for(var De=0;Deie.length?!1:w(ie,oe,be)}function x(ie,oe){var be,De=Math.min(ie.length,oe.length);for(be=0;be1){var De=ie.charCodeAt(oe-2);if(l(De))return(De-55296<<10)+(be-56320)+65536}return be}function I(ie,oe){var be=se.getInstance(),De=oe,Ne=ie.length,Fe=S(ie,Ne,oe);oe+=Fe>=65536?2:1;for(var je=be.getGraphemeBreakType(Fe);oe=65536?2:1,je=rt}return oe-De}function B(ie,oe){var be=se.getInstance(),De=oe,Ne=D(ie,oe);oe-=Ne>=65536?2:1;for(var Fe=be.getGraphemeBreakType(Ne);oe>0;){var je=D(ie,oe),Ue=be.getGraphemeBreakType(je);if(de(Ue,Fe))break;oe-=je>=65536?2:1,Fe=Ue}return De-oe}var j=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function z(ie){return j.test(ie)}var _=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDE73\uDE78-\uDE82\uDE90-\uDE95])/;function N(ie){return _.test(ie)}var $=/^[\t\n\r\x20-\x7E]*$/;function q(ie){return $.test(ie)}function le(ie){for(var oe=0,be=ie.length;oe=11904&&ie<=55215||ie>=63744&&ie<=64255||ie>=65281&&ie<=65374}function Pe(ie){return ie>=127462&&ie<=127487||ie>=9728&&ie<=10175||ie>=127744&&ie<=128591||ie>=128640&&ie<=128764||ie>=128992&&ie<=129003||ie>=129280&&ie<=129535||ie>=129648&&ie<=129651||ie>=129656&&ie<=129666||ie>=129680&&ie<=129685}var Se=String.fromCharCode(65279);function ke(ie){return!!(ie&&ie.length>0&&ie.charCodeAt(0)===65279)}function Ae(ie){return btoa(encodeURIComponent(ie))}function Te(ie,oe){for(var be="",De=0;Debe[3*Ne+1])Ne=2*Ne+1;else return be[3*Ne+2];return 0},ie._INSTANCE=null,ie}();function Oe(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}},Ot1p:function(vt,Le,ee){"use strict";var ue=ee("2qtc"),J=ee("kLXV"),O=ee("rAM+"),X=ee("miYZ"),F=ee("tsqr"),M=ee("9og8"),H=ee("tJVT"),U=ee("jrin"),P=ee("WmNS"),L=ee.n(P),h=ee("q1tI"),f=ee.n(h),T=ee("VrN/"),p=ee.n(T),m=ee("bdgK"),b=ee("p77/"),a=ee("Bd2K"),i=ee("ELLl"),s=ee("19Vz"),u=ee("lZu9"),y=ee("+NIl"),g=ee("kSUc"),v=ee("9Bee"),R=function(we){var Ke=we.value,ot=Ke===void 0?"":Ke,ct=we.className,dt=we.showTextOnly,Lt=we.showLines,wt=we.style,ft=wt===void 0?{}:wt,zt=Object(h.useMemo)(function(){return""},[ot]);return f.a.createElement(f.a.Fragment,null,f.a.createElement("div",{dangerouslySetInnerHTML:{__html:zt}}))},w=ee("0Owb"),C=ee("dejd"),x=ee("C+DQ"),d=ee("1vsH"),l=ee("m3rI"),A=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function S(we){var Ke=we.onActionCallback,ot=we.title,ct=we.icon,dt=we.actionName,Lt=we.className,wt=Lt===void 0?"":Lt,ft=we.children;function zt(){Ke(dt)}return f.a.createElement("a",{title:ot,className:wt,onClick:zt},f.a.createElement("i",{className:"md-iconfont ".concat(ct)}),ft)}var D=function(we){var Ke=we.watch,ot=we.showNullButton,ct=we.onActionCallback,dt=we.fullScreen,Lt=we.insertTemp,wt=we.hidetoolBar,ft=we.uuid,zt=we.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(d.D)("_educoder_session_login"),"&_educoder_session=").concat(Object(d.D)("_educoder_session"),"&key=").concat(ft,"&api=").concat(encodeURIComponent(l.a.PROXY_SERVER)));var Ft=[].concat(A,[{title:"".concat(Ke?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ke?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return f.a.createElement("ul",{className:"markdown-toolbar-container"},!wt&&Ft.map(function(Jt,Ht){return f.a.createElement("li",{key:Ht},Jt.actionName?f.a.createElement(S,Object(w.a)({},Jt,{onActionCallback:ct})):f.a.createElement("span",{className:"v-line"}))}),ot?f.a.createElement("li",null,f.a.createElement(S,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ct},f.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Lt&&f.a.createElement("li",null,f.a.createElement(S,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Lt),onActionCallback:ct},f.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),f.a.createElement("li",{className:"btn-full-screen"},f.a.createElement(S,{icon:"".concat(dt?"icon-shrink":"icon-enlarge"),title:dt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ct})))},I=ee("M8RZ"),B=ee("+L6B"),j=ee("2/Rp"),z=ee("y8nQ"),_=ee("Vl3Y"),N=ee("5NDa"),$=ee("5rEg"),q={labelCol:{span:4},wrapperCol:{span:20}},le=function(we){var Ke=we.callback,ot=we.onCancel;function ct(dt){Ke(dt)}return f.a.createElement(_.a,Object(w.a)({},q,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ct}),f.a.createElement(_.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},f.a.createElement($.a,null)),f.a.createElement(_.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},f.a.createElement($.a,null)),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(j.a,{type:"ghost",onClick:ot},"\u53D6\u6D88")))},pe=ee("7ahc"),Pe=ee("k1fw"),Se=ee("HmJG"),ke=ee("BjJ7"),Ae=_.a.useForm,Te={width:280,marginRight:10},ge={labelCol:{span:5},wrapperCol:{span:19}},he=function(we){var Ke=we.callback,ot=we.onCancel,ct=Ae(),dt=Object(H.a)(ct,1),Lt=dt[0],wt=Object(h.useRef)();function ft(Jt){Ke(Object(Pe.a)(Object(Pe.a)({},Jt),{},{name:wt.current}))}function zt(Jt,Ht){Lt.setFieldsValue({src:"/api/attachments/".concat(Jt.id,"?type=").concat(Jt.content_type),type:Ht.type})}function Ft(Jt){var Ht=Jt.target.files[0];wt.current=Ht.name,de(Ht,zt)}return f.a.createElement(_.a,Object(w.a)({form:Lt},ge,{className:"upload-image-panel",onFinish:ft}),f.a.createElement(_.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},f.a.createElement("div",{className:"flex-container"},f.a.createElement(_.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},f.a.createElement($.a,{style:Te})),f.a.createElement(re,{onFileChange:Ft}))),f.a.createElement(_.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},f.a.createElement($.a,{style:{width:264}})),f.a.createElement(_.a.Item,{style:{textAlign:"right"}},f.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(j.a,{type:"ghost",onClick:ot},"\u53D6\u6D88")))};function re(we){var Ke=we.onFileChange;return f.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",f.a.createElement("input",{type:"file",onChange:Ke}))}function de(we,Ke){if(!we)throw new String("\u6CA1\u6709\u6587\u4EF6");var ot=new FormData;ot.append("editormd-image-file",we),ot.append("file_param_name","editormd-image-file"),ot.append("byxhr","true");var ct=new window.XMLHttpRequest;ct.withCredentials=!0,ct.addEventListener("load",function(dt){Ke(JSON.parse(dt.target.responseText),we)},!1),ct.addEventListener("error",function(dt){console.error(dt)},!1),ct.open("POST","".concat(ke.a,"/api/attachments.json")),ct.send(ot)}var se=ee("giR+"),Oe=ee("fyUT"),ie=ee("7Kak"),oe=ee("9yH6"),be=oe.a.Group,De={margin:"0 8px"},Ne=function(we){var Ke=we.callback,ot=we.onCancel;function ct(dt){Ke(dt)}return f.a.createElement(_.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ct},f.a.createElement("div",{className:"flex-container"},f.a.createElement("span",{style:De},"\u5355\u5143\u683C\u6570\uFF1A"),f.a.createElement("span",{style:De},"\u884C\u6570"),f.a.createElement(_.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},f.a.createElement(Oe.a,null)),f.a.createElement("span",{style:De},"\u5217\u6570"),f.a.createElement(_.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},f.a.createElement(Oe.a,null))),f.a.createElement("div",{className:"flex-container",style:{marginTop:12}},f.a.createElement("span",{style:De},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),f.a.createElement(_.a.Item,{name:"align"},f.a.createElement(be,null,f.a.createElement(oe.a,{value:"default"},f.a.createElement("i",{className:"fa fa-align-justify"})),f.a.createElement(oe.a,{value:"left"},f.a.createElement("i",{className:"fa fa-align-left"})),f.a.createElement(oe.a,{value:"center"},f.a.createElement("i",{className:"fa fa-align-center"})),f.a.createElement(oe.a,{value:"right"},f.a.createElement("i",{className:"fa fa-align-right"}))))),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(j.a,{type:"ghost",onClick:ot},"\u53D6\u6D88")))},Fe=ee("ErOA"),je=ee("7Cbv"),Ue="link",rt="upload-image",Qe="code-block",qe="add-table",Ye="------------",nt={default:Ye,left:":".concat(Ye),center:":".concat(Ye,":"),right:"".concat(Ye,":")},$e=ee("9VGf"),et,_e;function Je(){}var st=0,Be=1e4,ze="\u2581",Ce=`
**\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 me(we){return/^\d+$/.test(we)?"".concat(we,"px"):we}var Ee=navigator.platform.toUpperCase().indexOf("MAC")>=0,ne=Ee?"Cmd":"Ctrl",ae=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],ce=(et={},Object(U.a)(et,ne+"-B","bold"),Object(U.a)(et,ne+"-I","italic"),et),ve=(_e={},Object(U.a)(_e,Ue,"\u6DFB\u52A0\u94FE\u63A5"),Object(U.a)(_e,Qe,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(U.a)(_e,rt,"\u6DFB\u52A0\u6587\u4EF6"),Object(U.a)(_e,qe,"\u6DFB\u52A0\u8868\u683C"),_e),Ie=Le.a=function(we){var Ke=we.defaultValue,ot=Ke===void 0?"":Ke,ct=we.onChange,dt=we.width,Lt=dt===void 0?"100%":dt,wt=we.height,ft=wt===void 0?400:wt,zt=we.miniToolbar,Ft=zt===void 0?!1:zt,Jt=we.isFocus,Ht=Jt===void 0?!1:Jt,Rt=we.watch,Ur=we.insertTemp,Zr=we.mode,bt=Zr===void 0?"markdown":Zr,Ct=we.id,lt=Ct===void 0?"markdown-editor-id":Ct,xt=we.showResizeBar,Zt=xt===void 0?!1:xt,nr=we.noStorage,rr=nr===void 0?!1:nr,kt=we.showNullButton,gt=kt===void 0?!1:kt,Rr=we.hidetoolBar,tn=Rr===void 0?!1:Rr,Tr=we.fullScreen,Ot=Tr===void 0?!1:Tr,Lr=we.onBlur,zr=we.onCMBeforeChange,rn=we.onFullScreen,He=we.className,ut=He===void 0?"":He,Mt=we.disablePaste,Kt=Mt===void 0?!1:Mt,Yt=we.placeholder,qt=Yt===void 0?"":Yt,K=we.values,c=K===void 0?"":K,E=Object(h.useState)(null),G=Object(H.a)(E,2),Y=G[0],V=G[1],xe=Object(h.useState)(ot),Ge=Object(H.a)(xe,2),tt=Ge[0],pt=Ge[1],Ve=Object(h.useState)(Rt),At=Object(H.a)(Ve,2),It=At[0],er=At[1],Kr=Object(h.useState)(Ot),Vr=Object(H.a)(Kr,2),pr=Vr[0],Qr=Vr[1],Gn=Object(h.useState)(""),Or=Object(H.a)(Gn,2),Xr=Or[0],jr=Or[1],bn=Object(h.useState)(0),nn=Object(H.a)(bn,2),mn=nn[0],hn=nn[1],di=Object(h.useState)(ft),zn=Object(H.a)(di,2),an=zn[0],Yr=zn[1],Rn=Object(h.useState)(!1),On=Object(H.a)(Rn,2),ci=On[0],or=On[1],jt=Object(h.useRef)(Object(je.a)()),Er=Object(h.useRef)(!1),Ut=Object(h.useRef)(),hr=Object(h.useRef)(),Vt=Object(h.useRef)(),dn=Object(h.useRef)(),lr=Object(h.useRef)(),Pr=function(){var yt=Object(M.a)(L.a.mark(function Dt(){var St,_t;return L.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return $t.next=2,Object(Fe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:jt.current}});case 2:_t=$t.sent,_t!=null&&(St=_t.attachments)!==null&&St!==void 0&&St.length&&(console.log("cm:",Y,hr),_t.attachments.map(function(Bt){Bt.content_type.indexOf("image")>-1?Y.replaceSelection(".concat(Bt.content_type,")")):Bt.content_type.indexOf("video")>-1?Y.replaceSelection('')):Bt.content_type.indexOf("pdf")>-1?Y.replaceSelection('').concat(Bt.name,"")):Y.replaceSelection("[".concat(Bt.name,"](").concat(l.a.API_SERVER,"/api/attachments/").concat(Bt.id,"?type=").concat(Bt.content_type,")"))}));case 4:case"end":return $t.stop()}},Dt)}));return function(){return yt.apply(this,arguments)}}();Object(h.useEffect)(function(){pt(c),Y==null||Y.setValue(c)},[c]),Object(h.useEffect)(function(){rn==null||rn(pr)},[pr]),Object(h.useEffect)(function(){if(hr.current){var yt=p.a.fromTextArea(hr.current,{mode:bt,lineNumbers:!Ft,lineWrapping:!0,value:ot,autoCloseTags:!0,autoCloseBrackets:!0});Ht&&yt.focus();function Dt(St,_t){if(Kt){_t.preventDefault();return}var Wt=_t.clipboardData;if(Wt){var $t=Wt.types.toString(),Bt=Wt.items;if($t==="Files"||Wt.types.indexOf("Files")>-1){if(_t.preventDefault(),bt=="stex")return;try{var dr,Mr=Bt[1];((dr=Bt[0])===null||dr===void 0?void 0:dr.kind)==="file"&&(Mr=Bt[0]);var Nt=Mr.getAsFile(),En=Nt.name.split(".").pop();de(Nt,function(Gt){if(Gt.id){var gr,qr,en;(Nt==null||((gr=Nt.type)===null||gr===void 0)?void 0:gr.indexOf("image"))>-1?yt.replaceSelection(".concat(Gt.content_type,")")):(Nt==null||((qr=Nt.type)===null||qr===void 0)?void 0:qr.indexOf("video"))>-1?yt.replaceSelection('')):(Nt==null||((en=Nt.type)===null||en===void 0)?void 0:en.indexOf("pdf"))>-1?yt.replaceSelection('').concat(Nt.name,"")):ae.includes(En)?yt.replaceSelection('').concat(Nt.name,"")):yt.replaceSelection("[".concat(Nt.name,"](").concat(l.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Gt.content_type,")"))}else(Gt==null?void 0:Gt.status)===401&&(document.location.href="/user/login")})}catch(Gt){F.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return yt.on("paste",Dt),yt.on("dragleave",function(St,_t){Vt.current.classList.remove("mouse-hover-md")}),yt.on("dragover",function(St,_t){Vt.current.classList.add("mouse-hover-md")}),yt.on("drop",function(St,_t){Vt.current.classList.add("mouse-hover-md");var Wt;if(Wt=_t.dataTransfer.files,Wt.length>0){_t.preventDefault(),_t.stopPropagation();for(var $t=function(Mr){var Nt=Wt[Mr],En=Nt.name.split(".").pop();de(Nt,function(Gt){if(Gt.id){var gr,qr,en;(Nt==null||((gr=Nt.type)===null||gr===void 0)?void 0:gr.indexOf("image"))>-1?yt.replaceSelection(".concat(Gt.content_type,")")):(Nt==null||((qr=Nt.type)===null||qr===void 0)?void 0:qr.indexOf("video"))>-1?yt.replaceSelection('')):(Nt==null||((en=Nt.type)===null||en===void 0)?void 0:en.indexOf("pdf"))>-1?yt.replaceSelection('').concat(Nt.name,"")):ae.includes(En)?yt.replaceSelection('').concat(Nt.name,"")):yt.replaceSelection("[".concat(Nt.name,"](").concat(l.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Gt.content_type,")"))}else(Gt==null?void 0:Gt.status)===401&&(document.location.href="/user/login")})},Bt=0;Bt0||Bt.target.offsetWidth>0)&&(Kn(),Y.setSize("100%","100%"),Y.refresh())}}catch(dr){Wt.e(dr)}finally{Wt.f()}});return St.observe(hr.current.parentElement),St}if(Y){var Dt=yt();return function(){Dt.unobserve(hr.current.parentElement)}}},[Y,Kn]),Object(h.useEffect)(function(){if(Y){for(var yt=[],Dt=function(){var Bt=_t[St];Wt=Object(H.a)(Bt,2);var dr=Wt[0],Mr=Wt[1],Nt=Object(U.a)({},dr,function(){Vn(Mr)});yt.push(Nt),Y.addKeyMap(Nt)},St=0,_t=Object.entries(ce);St<_t.length;St++){var Wt;Dt()}return Ut.current=setInterval(function(){Er.current&&Pr()},4e3),function(){clearInterval(Ut.current);var $t=Object(O.a)(yt),Bt;try{for($t.s();!(Bt=$t.n()).done;){var dr=Bt.value;Y.removeKeyMap(dr)}}catch(Mr){$t.e(Mr)}finally{$t.f()}}}},[Y]),Object(h.useEffect)(function(){Ot!==pr&&Qr(Ot)},[Ot]),Object($e.a)(function(){if(!rr&&mn>0){var yt=new Date().getTime(),Dt=window.sessionStorage.getItem(lt);yt>=mn+Be&&(!Dt||Dt!==tt)&&(window.sessionStorage.setItem(lt,tt),or(!0))}},Be),Object(h.useEffect)(function(){er(Rt)},[Y,Rt]),Object(h.useEffect)(function(){Y&&(Ht&&Y.focus())},[Y,Ht]),Object(h.useEffect)(function(){if(It&&Y){var yt=Y.getScrollerElement();function Dt(St){var _t=St.target;if(lr.current){var Wt=_t.scrollTop/_t.scrollHeight;lr.current.scrollTop=lr.current.scrollHeight*Wt}}return yt.addEventListener("scroll",Dt),function(){yt.removeEventListener("scroll",Dt)}}},[Y,It]),Object(h.useEffect)(function(){if(Y&&zr){function yt(Dt,St){zr(Dt,St)}return Y.on("beforeChange",yt),function(){Y.off("beforeChange",yt)}}},[Y,zr]),Object(h.useEffect)(function(){if(Y&&Lr){function yt(){Lr(Y.getValue())}return Y.on("blur",yt),function(){Y.off("blur",yt)}}},[Y,Lr]),Object(h.useEffect)(function(){if(Y){function yt(Dt){var St=Dt.getValue();pt(St),hn(new Date().getTime()),Dt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ct&&ct(St)}return Y.on("change",yt),function(){Y.off("change",yt)}}},[Y,ct]),Object(h.useEffect)(function(){Y&&(ot==null?(Y.setValue(""),pt("")):ot!==Y.getValue()&&(Y.setValue(ot),pt(ot),Y.setCursor(Y.lineCount(),0)))},[Y,ot]);var Vn=Object(h.useCallback)(function(yt){var Dt=Y.getCursor(),St=Y.getSelection(),_t=St.split(`
`);switch(yt){case"bold":return Y.replaceSelection("**"+St+"**"),St===""&&Y.setCursor(Dt.line,Dt.ch+2),Y.focus();case"italic":return Y.replaceSelection("*"+St+"*"),St===""&&Y.setCursor(Dt.line,Dt.ch+1),Y.focus();case"code":return Y.replaceSelection("`"+St+"`"),St===""&&Y.setCursor(Dt.line,Dt.ch+1),Y.focus();case"inline-latex":return Y.replaceSelection("`$$"+St+"$$`"),St===""&&Y.setCursor(Dt.line,Dt.ch+3),Y.focus();case"latex":return Y.replaceSelection("```latex\n"+St+"\n```"),Y.setCursor(Dt.line+1,St.length+1),Y.focus();case"line-break":return Y.replaceSelection(`
`),Y.focus();case"list-ul":return St===""?Y.replaceSelection("- "+St):Y.replaceSelection(_t.map(function(Wt){return Wt===""?"":"- ".concat(Wt)}).join(`
`)),Y.focus();case"list-ol":return St===""?Y.replaceSelection("1. "+St):Y.replaceSelection(_t.map(function(Wt,$t){return Wt===""?"":"".concat($t+1,". ").concat(Wt)}).join(`
`)),Y.focus();case"add-null-ch":return St===""&&Y.setCursor(Dt.line,Dt.ch+1),Y.replaceSelection(ze),Y.focus();case"inster-template-1":return St===""&&Y.setCursor(Dt.line,Dt.ch),Y.replaceSelection(Ce),Y.focus();case"eraser":return Y.setValue(""),Y.focus();case"trigger-watch":return er(!It),Y.focus();case"trigger-full-screen":return Qr(!pr),Y.focus();case Ue:jr(Ue);return;case Qe:jr(Qe);return;case rt:jr(rt);return;case qe:jr(qe);return;default:throw new Error}},[Y,It,pr]),xn=Object(h.useCallback)(function(yt){jr("");switch(Xr){case Ue:var Dt=yt.title,St=yt.link;return Y.replaceSelection("[".concat(Dt,"](").concat(St,")")),Y.focus();case Qe:var _t=yt.language,Wt=yt.content;return Y.replaceSelection(["```"+_t,Wt,"```"].join(`
`)),Y.focus();case rt:var $t=yt.src,Bt=yt.alt,dr=yt.name;return $t.indexOf("type=image")>-1?Y.replaceSelection(".concat($t,' "').concat(Bt||"",'" )')):$t.indexOf("type=application/pdf")>-1?Y.replaceSelection('').concat(dr,"")):Y.replaceSelection('').concat(dr,"")),Y.focus();case qe:for(var Mr=yt.row,Nt=yt.col,En=yt.align,Gt=`
`,gr=0;gr300&&(dr=300);var Mr=ft+dr+"px";Yr(Mr)}}return yt.addEventListener("mousedown",_t),document.addEventListener("mousemove",$t),document.addEventListener("mouseup",Wt),function(){yt.removeEventListener("mousedown",_t),document.removeEventListener("mousemove",$t),document.removeEventListener("mouseup",Wt)}}},[Y,dn]),Object(h.useEffect)(function(){Yr(ft)},[ft]);var fi=me(Lt),on=me(an),Xn={width:fi,height:on},ji=Object(h.useMemo)(function(){if(mn){var yt=new Date(mn),Dt=yt.getHours(),St=yt.getMinutes(),_t=yt.getSeconds();return Dt=Dt<10?"0"+Dt:Dt,St=St<10?"0"+St:St,_t=_t<10?"0"+_t:_t,"".concat(Dt,":").concat(St,":").concat(_t)}return 0},[mn]);function Pn(){window.sessionStorage.removeItem(lt),or(!1),hn(0)}function $a(){or(!1),hn(0),Y.setValue(window.sessionStorage.getItem(lt))}function ha(yt,Dt){var St=Y.getValue();St=St.replace(yt,Dt),pt(St),Y==null||Y.setValue(St)}return f.a.createElement(h.Fragment,null,f.a.createElement("div",{className:"markdown-editor-wrapper",ref:Vt},f.a.createElement("div",{className:"markdown-editor-container ".concat(ut," ").concat(It?"on-preview":""," ").concat(Ft?"mini":""," ").concat(pr?"full-screen":""),style:Xn},f.a.createElement(D,{insertTemp:Ur,watch:It,fullScreen:pr,showNullButton:gt,onActionCallback:Vn,hidetoolBar:tn,uuid:jt.current,setOpenPhones:function(){Er.current=!0}}),f.a.createElement("div",{className:"markdown-editor-body"},f.a.createElement("div",{className:"codemirror-container"},f.a.createElement("textarea",{ref:hr,placeholder:qt})),It?f.a.createElement("div",{ref:lr,className:"preview-container"},bt==="stex"&&f.a.createElement(R,{value:tt}),bt!=="stex"&&f.a.createElement(v.a,{edit:!0,value:tt,replaces:ha})):null))),Zt?f.a.createElement("a",{ref:dn,className:"editor-resize"}):null,f.a.createElement(I.a,null,ve[Xr]?f.a.createElement(J.a,{centered:!0,title:ve[Xr],visible:!0,onCancel:Wr,footer:null},Ui):null))}},QDVR:function(vt,Le,ee){"use strict";ee.d(Le,"e",function(){return J}),ee.d(Le,"d",function(){return O}),ee.d(Le,"c",function(){return H}),ee.d(Le,"b",function(){return U}),ee.d(Le,"a",function(){return L});var ue=function(){var h=function(f,T){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,m){p.__proto__=m}||function(p,m){for(var b in m)m.hasOwnProperty(b)&&(p[b]=m[b])},h(f,T)};return function(f,T){h(f,T);function p(){this.constructor=f}f.prototype=T===null?Object.create(T):(p.prototype=T.prototype,new p)}}();function J(h){var f=[];return h.forEach(function(T){return f.push(T)}),f}function O(h){var f=[];return h.forEach(function(T,p){return f.push(p)}),f}var X=function(){function h(){this._value="",this._pos=0}return h.prototype.reset=function(f){return this._value=f,this._pos=0,this},h.prototype.next=function(){return this._pos+=1,this},h.prototype.hasNext=function(){return this._pos0)m.left||(m.left=new M,m.left.segment=p.value()),m=m.left;else if(b<0)m.right||(m.right=new M,m.right.segment=p.value()),m=m.right;else if(p.hasNext())p.next(),m.mid||(m.mid=new M,m.mid.segment=p.value()),m=m.mid;else break}var a=m.value;return m.value=T,m.key=f,a},h.prototype.get=function(f){for(var T=this._iter.reset(f),p=this._root;p;){var m=T.cmp(p.segment);if(m>0)p=p.left;else if(m<0)p=p.right;else if(T.hasNext())T.next(),p=p.mid;else break}return p?p.value:void 0},h.prototype.findSubstr=function(f){for(var T=this._iter.reset(f),p=this._root,m=void 0;p;){var b=T.cmp(p.segment);if(b>0)p=p.left;else if(b<0)p=p.right;else if(T.hasNext())T.next(),m=p.value||m,p=p.mid;else break}return p&&p.value||m},h.prototype.forEach=function(f){this._forEach(this._root,f)},h.prototype._forEach=function(f,T){f&&(this._forEach(f.left,T),f.value&&T(f.value,f.key),this._forEach(f.mid,T),this._forEach(f.right,T))},h}(),U=function(){function h(){this.map=new Map,this.ignoreCase=!1}return h.prototype.set=function(f,T){this.map.set(this.toKey(f),T)},h.prototype.get=function(f){return this.map.get(this.toKey(f))},h.prototype.toKey=function(f){var T=f.toString();return this.ignoreCase&&(T=T.toLowerCase()),T},h}(),P=function(){function h(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}return h.prototype.clear=function(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0},Object.defineProperty(h.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),h.prototype.get=function(f,T){T===void 0&&(T=0);var p=this._map.get(f);return p?(T!==0&&this.touch(p,T),p.value):void 0},h.prototype.set=function(f,T,p){p===void 0&&(p=0);var m=this._map.get(f);if(m)m.value=T,p!==0&&this.touch(m,p);else{m={key:f,value:T,next:void 0,previous:void 0};switch(p){case 0:this.addItemLast(m);break;case 1:this.addItemFirst(m);break;case 2:this.addItemLast(m);break;default:this.addItemLast(m);break}this._map.set(f,m),this._size++}},h.prototype.delete=function(f){return!!this.remove(f)},h.prototype.remove=function(f){var T=this._map.get(f);return T?(this._map.delete(f),this.removeItem(T),this._size--,T.value):void 0},h.prototype.forEach=function(f,T){for(var p=this._head;p;)T?f.bind(T)(p.value,p.key,this):f(p.value,p.key,this),p=p.next},h.prototype.trimOld=function(f){if(f>=this.size)return;if(f===0){this.clear();return}for(var T=this._head,p=this.size;T&&p>f;)this._map.delete(T.key),T=T.next,p--;this._head=T,this._size=p,T&&(T.previous=void 0)},h.prototype.addItemFirst=function(f){if(!this._head&&!this._tail)this._tail=f;else if(this._head)f.next=this._head,this._head.previous=f;else throw new Error("Invalid list");this._head=f},h.prototype.addItemLast=function(f){if(!this._head&&!this._tail)this._head=f;else if(this._tail)f.previous=this._tail,this._tail.next=f;else throw new Error("Invalid list");this._tail=f},h.prototype.removeItem=function(f){if(f===this._head&&f===this._tail)this._head=void 0,this._tail=void 0;else if(f===this._head){if(!f.next)throw new Error("Invalid list");f.next.previous=void 0,this._head=f.next}else if(f===this._tail){if(!f.previous)throw new Error("Invalid list");f.previous.next=void 0,this._tail=f.previous}else{var T=f.next,p=f.previous;if(!T||!p)throw new Error("Invalid list");T.previous=p,p.next=T}f.next=void 0,f.previous=void 0},h.prototype.touch=function(f,T){if(!this._head||!this._tail)throw new Error("Invalid list");if(T!==1&&T!==2)return;if(T===1){if(f===this._head)return;var p=f.next,m=f.previous;f===this._tail?(m.next=void 0,this._tail=m):(p.previous=m,m.next=p),f.previous=void 0,f.next=this._head,this._head.previous=f,this._head=f}else if(T===2){if(f===this._tail)return;var p=f.next,m=f.previous;f===this._head?(p.previous=void 0,this._head=p):(p.previous=m,m.next=p),f.next=void 0,f.previous=this._tail,this._tail.next=f,this._tail=f}},h.prototype.toJSON=function(){var f=[];return this.forEach(function(T,p){f.push([p,T])}),f},h}(),L=function(h){ue(f,h);function f(T,p){p===void 0&&(p=1);var m=h.call(this)||this;return m._limit=T,m._ratio=Math.min(Math.max(0,p),1),m}return f.prototype.get=function(T){return h.prototype.get.call(this,T,2)},f.prototype.peek=function(T){return h.prototype.get.call(this,T,0)},f.prototype.set=function(T,p){h.prototype.set.call(this,T,p,2),this.checkTrim()},f.prototype.checkTrim=function(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))},f}(P)},R7cW:function(vt,Le,ee){"use strict";ee.r(Le);var ue=ee("+L6B"),J=ee("2/Rp"),O=ee("DZo9"),X=ee("8z0m"),F=ee("0Owb"),M=ee("5NDa"),H=ee("5rEg"),U=ee("sPJy"),P=ee("bE4q"),L=ee("k1fw"),h=ee("oBTY"),f=ee("9og8"),T=ee("miYZ"),p=ee("tsqr"),m=ee("y8nQ"),b=ee("Vl3Y"),a=ee("tJVT"),i=ee("WmNS"),s=ee.n(i),u=ee("q1tI"),y=ee.n(u),g=ee("Ty5D"),v=ee("9kvl"),R=ee("55Ip"),w=ee("Ot1p"),C=ee("XYT7"),x=ee("m3rI"),d=ee("YiJy"),l=ee.n(d),A=function(D){var I,B=D.shixunHomeworks,j=D.newCourse,z=D.globalSetting,_=D.loading,N=D.dispatch,$=D.match,q=Object(g.i)(),le=b.a.useForm(),pe=Object(a.a)(le,1),Pe=pe[0],Se=Object(u.useState)({}),ke=Object(a.a)(Se,2),Ae=ke[0],Te=ke[1],ge=Object(u.useState)(!1),he=Object(a.a)(ge,2),re=he[0],de=he[1],se=Object(u.useState)([]),Oe=Object(a.a)(se,2),ie=Oe[0],oe=Oe[1],be=Object(u.useState)([]),De=Object(a.a)(be,2),Ne=De[0],Fe=De[1],je=B.commonHomeWorkEditDefaultData,Ue={name:"file",multiple:!0,action:x.a.API_SERVER+"/api/attachments.json",defaultFileList:ie,onChange:function(nt){var $e=nt.file.status;$e!=="uploading",$e==="done"?p.b.success("".concat(nt.file.name," \u6587\u4EF6\u4E0A\u4F20\u6210\u529F")):$e==="error"&&p.b.error("".concat(nt.file.name," \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25"))}};Object(u.useEffect)(function(){Qe()},[q.topicId]);var rt=function(nt){return nt==null?void 0:nt.map(function($e){return{uid:$e.id,response:{id:$e.id},name:$e.title,status:"done",url:$e.url}})},Qe=function(){var Ye=Object(f.a)(s.a.mark(function nt(){var $e;return s.a.wrap(function(_e){for(;;)switch(_e.prev=_e.next){case 0:return _e.next=2,N({type:"shixunHomeworks/editCommonHomeWorkDefaultBankData",payload:{id:q.topicId}});case 2:$e=_e.sent,$e&&(Pe.setFieldsValue({name:$e.name}),Pe.setFieldsValue({description:$e.description}),Pe.setFieldsValue({reference_answer:$e.reference_answer}),oe(Object(h.a)(rt($e.attachments))),Fe(Object(h.a)(rt($e.reference_attachments))),de(!0));case 4:case"end":return _e.stop()}},nt)}));return function(){return Ye.apply(this,arguments)}}(),qe=function(){var Ye=Object(f.a)(s.a.mark(function nt($e){var et,_e,Je,st;return s.a.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:return et=Object(L.a)({},Ae),et.attachment_ids&&(et.attachment_ids=et==null||((_e=et.attachment_ids.fileList)===null||_e===void 0)?void 0:_e.map(function(Ce){var me;return(me=Ce.response)===null||me===void 0?void 0:me.id})),et.reference_attachment_ids&&(et.reference_attachment_ids=et==null||((Je=et.reference_attachment_ids.fileList)===null||Je===void 0)?void 0:Je.map(function(Ce){var me;return(me=Ce.response)===null||me===void 0?void 0:me.id})),ze.next=5,Object(C.n)(Object(L.a)(Object(L.a)({id:q.topicId},et),{},{base_on_project:null,type:1}));case 5:st=ze.sent,st&&v.d.push("/users/".concat(q.username,"/topics/").concat(q.topicId,"/").concat(q.topictype,"/normal/detail"));case 7:case"end":return ze.stop()}},nt)}));return function($e){return Ye.apply(this,arguments)}}();return y.a.createElement("section",{className:l.a.bg},y.a.createElement("section",{className:"animated fadeIn"},y.a.createElement("aside",{className:"mt10"},y.a.createElement(P.a,{separator:">"},y.a.createElement(P.a.Item,null,y.a.createElement(R.a,{to:"/users/".concat(q.username,"/").concat(q.topictype==="personal"?"topics":"topicbank","/").concat(q.topictype)},q.topictype==="personal"?"\u6211\u7684\u8BFE\u5802\u8D44\u6E90":"\u516C\u5171\u9898\u5E93")),y.a.createElement(P.a.Item,null,y.a.createElement(R.a,{to:"/users/".concat(q.username,"/topics/").concat(q.topicId,"/").concat(q.topictype,"/normal/detail")},"\u8BE6\u60C5")),y.a.createElement(P.a.Item,null,"\u7F16\u8F91")))),y.a.createElement("aside",{className:"font24 bold mt20 mb20"},"\u7F16\u8F91"),y.a.createElement(b.a,{form:Pe,className:l.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(){Te(Object(L.a)({},Pe.getFieldsValue()))},onFinish:qe},y.a.createElement("div",{className:l.a.fieldWrap},y.a.createElement(b.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u9898"}]},y.a.createElement(H.a,{maxLength:60,suffix:"".concat(((I=Ae.name)===null||I===void 0?void 0:I.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),y.a.createElement("div",{className:l.a.mdWrap},y.a.createElement(b.a.Item,{name:"description",label:"\u7B80\u4ECB:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:5e3,message:"\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"}]},y.a.createElement(w.a,{id:"topic-normal-description",watch:!0,defaultValue:je.description})),y.a.createElement("div",null,y.a.createElement(b.a.Item,{name:"attachment_ids"},re&&y.a.createElement(X.a,Object(F.a)({defaultFileList:ie},Ue),y.a.createElement("span",{className:"c-blue"},"\u4E0A\u4F20\u9644\u4EF6")," \uFF08\u5355\u4E2A\u6587\u4EF6150MB\u4EE5\u5185\uFF09")))),y.a.createElement("div",{className:l.a.mdWrap},y.a.createElement(b.a.Item,{name:"reference_answer",label:"\u53C2\u8003\u7B54\u6848:"},y.a.createElement(w.a,{id:"topic-normal-reference_answer",defaultValue:je.reference_answer,watch:!0})),y.a.createElement("div",null,y.a.createElement(b.a.Item,{name:"reference_attachment_ids"},re&&y.a.createElement(X.a,Object(F.a)({},Ue,{defaultFileList:Ne}),y.a.createElement("span",{className:"c-blue"},"\u4E0A\u4F20\u9644\u4EF6")," \uFF08\u5355\u4E2A\u6587\u4EF6150MB\u4EE5\u5185\uFF09")))),y.a.createElement("div",{className:l.a.backgroundFa},y.a.createElement("div",{className:"pt40 mb30"},y.a.createElement(b.a.Item,null,y.a.createElement(J.a,{size:"large",type:"primary",className:"".concat(l.a.button," mr20"),htmlType:"submit"},"\u63D0\u4EA4"),y.a.createElement(J.a,{size:"large",type:"primary",ghost:!0,className:l.a.button,onClick:function(){return v.d.push("/users/".concat(q.username,"/topics/").concat(q.topicId,"/").concat(q.topictype,"/normal/detail"))}},"\u53D6\u6D88"))))))};Le.default=Object(v.a)(function(S){var D=S.shixunHomeworks,I=S.newCourse,B=S.loading,j=S.globalSetting;return{shixunHomeworks:D,newCourse:I,globalSetting:j,loading:B.effects}})(A)},SJMd:function(vt,Le){/**
* @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 ee,ue,J,O=!1,X,F;window.PR_SHOULD_USE_CONTINUATION=!0;var M,H;(function(){var U=window,P=["break,continue,do,else,for,if,return,while"],L=[P,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],h=[L,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],f=[h,"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"],T=[h,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],p=[h,"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"],m="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",b=[h,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],a="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",i=[P,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],s=[P,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],u=[P,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],y=[f,p,T,b,a,i,s,u],g=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,v="str",R="kwd",w="com",C="typ",x="lit",d="pun",l="pln",A="tag",S="dec",D="src",I="atn",B="atv",j="nocode",z="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function _(oe){for(var be=0,De=!1,Ne=!1,Fe=0,je=oe.length;Fe122||(ne<65||Ee>90||Je.push([Math.max(65,Ee)|32,Math.min(ne,90)|32]),ne<97||Ee>122||Je.push([Math.max(97,Ee)&~32,Math.min(ne,122)&~32]))}}Je.sort(function(Ie,we){return Ie[0]-we[0]||we[1]-Ie[1]});for(var ae=[],ce=[],ze=0;zeve[0]&&(ve[1]+1>ve[0]&&Be.push("-"),Be.push(qe(ve[1])))}return Be.push("]"),Be.join("")}function nt(et){for(var _e=et.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")),Je=_e.length,st=[],Be=0,ze=0;Be=2&&Ee==="["?_e[Be]=Ye(Ce):Ee!=="\\"&&(_e[Be]=Ce.replace(/[a-zA-Z]/g,function(ce){var ve=ce.charCodeAt(0);return"["+String.fromCharCode(ve&~32,ve|32)+"]"}))}return _e.join("")}for(var $e=[],Fe=0,je=oe.length;Fe=0;)De[$e.charAt(et)]=nt;var _e=nt[1],Je=""+_e;Qe.hasOwnProperty(Je)||(rt.push(_e),Qe[Je]=null)}rt.push(/[\0-\uffff]/),Ne=_(rt)})();var Fe=be.length,je=function(Ue){for(var rt=Ue.sourceCode,Qe=Ue.basePos,qe=Ue.sourceNode,Ye=[Qe,l],nt=0,$e=rt.match(Ne)||[],et={},_e=0,Je=$e.length;_e=5&&Be.substring(0,5)==="lang-",Ce&&!(ze&&typeof ze[1]=="string")&&(Ce=!1,Be=D),Ce||(et[st]=Be)}var ne=nt;if(nt+=st.length,!Ce)Ye.push(Qe+ne,Be);else{var ae=ze[1],ce=st.indexOf(ae),ve=ce+ae.length;ze[2]&&(ve=st.length-ze[2].length,ce=ve-ae.length);var Ie=Be.substring(5);$(qe,Qe+ne,st.substring(0,ce),je,Ye),$(qe,Qe+ne+ce,ae,he(Ie,ae),Ye),$(qe,Qe+ne+ve,st.substring(ve),je,Ye)}}Ue.decorations=Ye};return je}function Pe(oe){var be=[],De=[];oe.tripleQuotedStrings?be.push([v,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):oe.multiLineStrings?be.push([v,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):be.push([v,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),oe.verbatimStrings&&De.push([v,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ne=oe.hashComments;Ne&&(oe.cStyleComments?(Ne>1?be.push([w,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):be.push([w,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),De.push([v,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):be.push([w,/^#[^\r\n]*/,null,"#"])),oe.cStyleComments&&(De.push([w,/^\/\/[^\r\n]*/,null]),De.push([w,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Fe=oe.regexLiterals;if(Fe){var je=Fe>1?"":`
\r`,Ue=je?".":"[\\S\\s]",rt="/(?=[^/*"+je+"])(?:[^/\\x5B\\x5C"+je+"]|\\x5C"+Ue+"|\\x5B(?:[^\\x5C\\x5D"+je+"]|\\x5C"+Ue+")*(?:\\x5D|$))+/";De.push(["lang-regex",RegExp("^"+z+"("+rt+")")])}var Qe=oe.types;Qe&&De.push([C,Qe]);var qe=(""+oe.keywords).replace(/^ | $/g,"");qe.length&&De.push([R,new RegExp("^(?:"+qe.replace(/[\s,]+/g,"|")+")\\b"),null]),be.push([l,/^\s+/,null,` \r
\xA0`]);var Ye="^.[^\\s\\w.$@'\"`/\\\\]*";return oe.regexLiterals&&(Ye+="(?!s*/)"),De.push([x,/^@[a-z_$][a-z_$@0-9]*/i,null],[C,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[l,/^[a-z_$][a-z_$@0-9]*/i,null],[x,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[l,/^\\[\s\S]?/,null],[d,new RegExp(Ye),null]),pe(be,De)}var Se=Pe({keywords:y,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ke(oe,be,De){for(var Ne=/(?:^|\s)nocode(?:\s|$)/,Fe=/\r\n?|\n/,je=oe.ownerDocument,Ue=je.createElement("li");oe.firstChild;)Ue.appendChild(oe.firstChild);var rt=[Ue];function Qe(_e){var Je=_e.nodeType;if(Je==1&&!Ne.test(_e.className))if(_e.nodeName==="br")qe(_e),_e.parentNode&&_e.parentNode.removeChild(_e);else for(var st=_e.firstChild;st;st=st.nextSibling)Qe(st);else if((Je==3||Je==4)&&De){var Be=_e.nodeValue,ze=Be.match(Fe);if(ze){var Ce=Be.substring(0,ze.index);_e.nodeValue=Ce;var me=Be.substring(ze.index+ze[0].length);if(me){var Ee=_e.parentNode;Ee.insertBefore(je.createTextNode(me),_e.nextSibling)}qe(_e),Ce||_e.parentNode.removeChild(_e)}}}function qe(_e){for(;!_e.nextSibling;)if(_e=_e.parentNode,!_e)return;function Je(ze,Ce){var me=Ce?ze.cloneNode(!1):ze,Ee=ze.parentNode;if(Ee){var ne=Je(Ee,1),ae=ze.nextSibling;ne.appendChild(me);for(var ce=ae;ce;ce=ae)ae=ce.nextSibling,ne.appendChild(ce)}return me}for(var st=Je(_e.nextSibling,0),Be;(Be=st.parentNode)&&Be.nodeType===1;)st=Be;rt.push(st)}for(var Ye=0;Ye=Ee&&(Qe+=2),je>=ne&&(nt+=2)}}finally{Be&&(Be.style.display=ze)}}var Te={};function ge(oe,be){for(var De=be.length;--De>=0;){var Ne=be[De];Te.hasOwnProperty(Ne)?U.console&&console.warn("cannot override language handler %s",Ne):Te[Ne]=oe}}function he(oe,be){return oe&&Te.hasOwnProperty(oe)||(oe=/^\s*]*(?:>|$)/],[w,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[d,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^