(window.webpackJsonp=window.webpackJsonp||[]).push([[233,5,6,7],{"+NIl":function(bt,De,q){(function(ue){ue(q("VrN/"))})(function(ue){"use strict";ue.defineMode("stex",function(J,O){"use strict";function $(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 j(p){for(var m=p.cmdState,g=m.length-1;g>=0;g--){var a=m[g];if(a.name=="DEFAULT")continue;return a}return{styleIdentifier:function(){return null}}}function U(p,m,g){return function(){this.name=p,this.bracketNo=0,this.style=m,this.styles=g,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 A(p,m){p.f=m}function d(p,m){var g;if(p.match(/^\\[a-zA-Z@]+/)){var a=p.current().slice(1);return g=P.hasOwnProperty(a)?P[a]:P.DEFAULT,g=new g,$(m,g),A(m,T),g.style}if(p.match(/^\\[$&%#{}_]/))return"tag";if(p.match(/^\\[,;!\/\\]/))return"tag";if(p.match("\\["))return A(m,function(s,l){return f(s,l,"\\]")}),"keyword";if(p.match("\\("))return A(m,function(s,l){return f(s,l,"\\)")}),"keyword";if(p.match("$$"))return A(m,function(s,l){return f(s,l,"$$")}),"keyword";if(p.match("$"))return A(m,function(s,l){return f(s,l,"$")}),"keyword";var i=p.next();if(i=="%")return p.skipToEnd(),"comment";if(i=="}"||i=="]"){if(g=F(m),g)g.closeBracket(i),A(m,T);else return"error";return"bracket"}else return i=="{"||i=="["?(g=P.DEFAULT,g=new g,$(m,g),"bracket"):/\d/.test(i)?(p.eatWhile(/[\w.%]/),"atom"):(p.eatWhile(/[\w\-_]/),g=j(m),g.name=="begin"&&(g.argument=p.current()),g.styleIdentifier())}function f(p,m,g){if(p.eatSpace())return null;if(g&&p.match(g))return A(m,d),"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 g=p.peek(),a;return g=="{"||g=="["?(a=F(m),a.openBracket(g),p.eat(g),A(m,d),"bracket"):/[ \t\r]/.test(g)?(p.eat(g),null):(A(m,d),M(m),d(p,m))}return{startState:function(){var p=O.inMathMode?function(m,g){return f(m,g)}:d;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=d,p.cmdState.length=0},lineComment:"%"}}),ue.defineMIME("text/x-stex","stex"),ue.defineMIME("text/x-latex","stex")})},"+ua5":function(bt,De,q){},"/cxE":function(bt,De,q){"use strict";q.d(De,"e",function(){return O}),q.d(De,"f",function(){return $}),q.d(De,"g",function(){return F}),q.d(De,"d",function(){return j}),q.d(De,"a",function(){return U}),q.d(De,"b",function(){return P}),q.d(De,"c",function(){return A});var ue=function(){function d(){this.listeners=[],this.unexpectedErrorHandler=function(f){setTimeout(function(){throw f.stack?new Error(f.message+`
`+f.stack):f},0)}}return d.prototype.emit=function(f){this.listeners.forEach(function(T){T(f)})},d.prototype.onUnexpectedError=function(f){this.unexpectedErrorHandler(f),this.emit(f)},d.prototype.onUnexpectedExternalError=function(f){this.unexpectedErrorHandler(f)},d}(),J=new ue;function O(d){j(d)||J.onUnexpectedError(d);return}function $(d){j(d)||J.onUnexpectedExternalError(d);return}function F(d){if(d instanceof Error){var f=d.name,T=d.message,p=d.stacktrace||d.stack;return{$isError:!0,name:f,message:T,stack:p}}return d}var M="Canceled";function j(d){return d instanceof Error&&d.name===M&&d.message===M}function U(){var d=new Error(M);return d.name=d.message,d}function P(d){return d?new Error("Illegal argument: "+d):new Error("Illegal argument")}function A(d){return d?new Error("Illegal state: "+d):new Error("Illegal state")}},"19Vz":function(bt,De,q){(function(ue){ue(q("VrN/"))})(function(ue){ue.defineOption("placeholder","",function(U,P,A){var d=A&&A!=ue.Init;if(P&&!d)U.on("blur",F),U.on("change",M),U.on("swapDoc",M),ue.on(U.getInputField(),"compositionupdate",U.state.placeholderCompose=function(){$(U)}),M(U);else if(!P&&d){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 A=U.getOption("placeholder");typeof A=="string"&&(A=document.createTextNode(A)),P.appendChild(A),U.display.lineSpace.insertBefore(P,U.display.lineSpace.firstChild)}function $(U){setTimeout(function(){var P=!1,A=U.getInputField();A.nodeName=="TEXTAREA"?P=!A.value:U.lineCount()==1&&(P=!/[^\u200b]/.test(A.querySelector(".CodeMirror-line").textContent)),P?O(U):J(U)},20)}function F(U){j(U)&&O(U)}function M(U){var P=U.getWrapperElement(),A=j(U);P.className=P.className.replace(" CodeMirror-empty","")+(A?" CodeMirror-empty":""),A?O(U):J(U)}function j(U){return U.lineCount()===1&&U.getLine(0)===""}})},"1eCo":function(bt,De,q){(function(ue){ue(q("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($,F){var M=$.indentUnit,j={},U=F.htmlMode?J:O;for(var P in U)j[P]=U[P];for(var P in F)j[P]=F[P];var A,d;function f(u,L){function S(B){return L.tokenize=B,B(u,L)}var D=u.next();if(D=="<")return u.eat("!")?u.eat("[")?u.match("CDATA[")?S(m("atom","]]>")):null:u.match("--")?S(m("comment","-->")):u.match("DOCTYPE",!0,!0)?(u.eatWhile(/[\w\._\-]/),S(g(1))):null:u.eat("?")?(u.eatWhile(/[\w\._\-]/),L.tokenize=m("meta","?>"),"meta"):(A=u.eat("/")?"closeTag":"openTag",L.tokenize=T,"tag bracket");if(D=="&"){var _;return u.eat("#")?u.eat("x")?_=u.eatWhile(/[a-fA-F\d]/)&&u.eat(";"):_=u.eatWhile(/[\d]/)&&u.eat(";"):_=u.eatWhile(/[\w\.\-:]/)&&u.eat(";"),_?"atom":"error"}else return u.eatWhile(/[^&<]/),null}f.isInText=!0;function T(u,L){var S=u.next();if(S==">"||S=="/"&&u.eat(">"))return L.tokenize=f,A=S==">"?"endTag":"selfcloseTag","tag bracket";if(S=="=")return A="equals",null;if(S=="<"){L.tokenize=f,L.state=l,L.tagName=L.tagStart=null;var D=L.tokenize(u,L);return D?D+" tag error":"tag error"}else return/[\'\"]/.test(S)?(L.tokenize=p(S),L.stringStartCol=u.column(),L.tokenize(u,L)):(u.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(u){var L=function(S,D){for(;!S.eol();)if(S.next()==u){D.tokenize=T;break}return"string"};return L.isInAttribute=!0,L}function m(u,L){return function(S,D){for(;!S.eol();){if(S.match(L)){D.tokenize=f;break}S.next()}return u}}function g(u){return function(L,S){for(var D;(D=L.next())!=null;){if(D=="<")return S.tokenize=g(u+1),S.tokenize(L,S);if(D==">")if(u==1){S.tokenize=f;break}else return S.tokenize=g(u-1),S.tokenize(L,S)}return"meta"}}function a(u,L,S){this.prev=u.context,this.tagName=L,this.indent=u.indented,this.startOfLine=S,(j.doNotIndent.hasOwnProperty(L)||u.context&&u.context.noIndent)&&(this.noIndent=!0)}function i(u){u.context&&(u.context=u.context.prev)}function s(u,L){for(var S;;){if(!u.context)return;if(S=u.context.tagName,!j.contextGrabbers.hasOwnProperty(S)||!j.contextGrabbers[S].hasOwnProperty(L))return;i(u)}}function l(u,L,S){return u=="openTag"?(S.tagStart=L.column(),x):u=="closeTag"?v:l}function x(u,L,S){return u=="word"?(S.tagName=L.current(),d="tag",w):j.allowMissingTagName&&u=="endTag"?(d="tag bracket",w(u,L,S)):(d="error",x)}function v(u,L,S){if(u=="word"){var D=L.current();return S.context&&S.context.tagName!=D&&j.implicitlyClosed.hasOwnProperty(S.context.tagName)&&i(S),S.context&&S.context.tagName==D||j.matchClosing===!1?(d="tag",y):(d="tag error",R)}else return j.allowMissingTagName&&u=="endTag"?(d="tag bracket",y(u,L,S)):(d="error",R)}function y(u,L,S){return u!="endTag"?(d="error",y):(i(S),l)}function R(u,L,S){return d="error",y(u,L,S)}function w(u,L,S){if(u=="word")return d="attribute",E;if(u=="endTag"||u=="selfcloseTag"){var D=S.tagName,_=S.tagStart;return S.tagName=S.tagStart=null,u=="selfcloseTag"||j.autoSelfClosers.hasOwnProperty(D)?s(S,D):(s(S,D),S.context=new a(S,D,_==S.indented)),l}return d="error",w}function E(u,L,S){return u=="equals"?C:(j.allowMissing||(d="error"),w(u,L,S))}function C(u,L,S){return u=="string"?c:u=="word"&&j.allowUnquoted?(d="string",w):(d="error",w(u,L,S))}function c(u,L,S){return u=="string"?c:w(u,L,S)}return{startState:function(u){var L={tokenize:f,state:l,indented:u||0,tagName:null,tagStart:null,context:null};return u!=null&&(L.baseIndent=u),L},token:function(u,L){if(!L.tagName&&u.sol()&&(L.indented=u.indentation()),u.eatSpace())return null;A=null;var S=L.tokenize(u,L);return(S||A)&&S!="comment"&&(d=null,L.state=L.state(A||S,u,L),d&&(S=d=="error"?S+" error":d)),S},indent:function(u,L,S){var D=u.context;if(u.tokenize.isInAttribute)return u.tagStart==u.indented?u.stringStartCol+1:u.indented+M;if(D&&D.noIndent)return ue.Pass;if(u.tokenize!=T&&u.tokenize!=f)return S?S.match(/^(\s*)/)[0].length:0;if(u.tagName)return j.multilineTagIndentPastTag!==!1?u.tagStart+u.tagName.length+2:u.tagStart+M*(j.multilineTagIndentFactor||1);if(j.alignCDATA&&/$/,blockCommentStart:"",configuration:j.htmlMode?"html":"xml",helperType:j.htmlMode?"html":"xml",skipAttribute:function(u){u.state==C&&(u.state=w)},xmlCurrentTag:function(u){return u.tagName?{name:u.tagName,close:u.type=="closeTag"}:null},xmlCurrentContext:function(u){for(var L=[],S=u.context;S;S=S.prev)S.tagName&&L.push(S.tagName);return L.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(bt,De,q){"use strict";q.d(De,"a",function(){return O});var ue=q("JYp7"),J=function(){function $(F){this.element=F,this.next=$.Undefined,this.prev=$.Undefined}return $.Undefined=new $(void 0),$}(),O=function(){function $(){this._first=J.Undefined,this._last=J.Undefined,this._size=0}return Object.defineProperty($.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),$.prototype.isEmpty=function(){return this._first===J.Undefined},$.prototype.clear=function(){this._first=J.Undefined,this._last=J.Undefined,this._size=0},$.prototype.unshift=function(F){return this._insert(F,!1)},$.prototype.push=function(F){return this._insert(F,!0)},$.prototype._insert=function(F,M){var j=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 A=this._first;this._first=U,U.next=A,A.prev=U}this._size+=1;var d=!1;return function(){d||(d=!0,j._remove(U))}},$.prototype.shift=function(){if(this._first===J.Undefined)return;var F=this._first.element;return this._remove(this._first),F},$.prototype.pop=function(){if(this._last===J.Undefined)return;var F=this._last.element;return this._remove(this._last),F},$.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},$.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)}}},$.prototype.toArray=function(){for(var F=[],M=this._first;M!==J.Undefined;M=M.next)F.push(M.element);return F},$}()},"746U":function(bt,De,q){"use strict";q.d(De,"d",function(){return J}),q.d(De,"j",function(){return O}),q.d(De,"i",function(){return $}),q.d(De,"h",function(){return F}),q.d(De,"e",function(){return M}),q.d(De,"k",function(){return j}),q.d(De,"l",function(){return U}),q.d(De,"a",function(){return P}),q.d(De,"f",function(){return d}),q.d(De,"g",function(){return f}),q.d(De,"m",function(){return T}),q.d(De,"c",function(){return g}),q.d(De,"b",function(){return a}),q.d(De,"n",function(){return i}),q.d(De,"o",function(){return s});var ue={number:"number",string:"string",undefined:"undefined",object:"object",function:"function"};function J(l){return Array.isArray?Array.isArray(l):!!(l&&typeof l.length===ue.number&&l.constructor===Array)}function O(l){return typeof l===ue.string||l instanceof String}function $(l){return typeof l===ue.object&&l!==null&&!Array.isArray(l)&&!(l instanceof RegExp)&&!(l instanceof Date)}function F(l){return(typeof l===ue.number||l instanceof Number)&&!isNaN(l)}function M(l){return l===!0||l===!1}function j(l){return typeof l===ue.undefined}function U(l){return j(l)||l===null}function P(l,x){if(!l)throw new Error(x?"Unexpected type, expected '"+x+"'":"Unexpected type")}var A=Object.prototype.hasOwnProperty;function d(l){if(!$(l))return!1;for(var x in l)if(A.call(l,x))return!1;return!0}function f(l){return typeof l===ue.function}function T(l,x){for(var v=Math.min(l.length,x.length),y=0;y1&&arguments[1]!==void 0?arguments[1]:0,m=(j[T[p+0]]+j[T[p+1]]+j[T[p+2]]+j[T[p+3]]+"-"+j[T[p+4]]+j[T[p+5]]+"-"+j[T[p+6]]+j[T[p+7]]+"-"+j[T[p+8]]+j[T[p+9]]+"-"+j[T[p+10]]+j[T[p+11]]+j[T[p+12]]+j[T[p+13]]+j[T[p+14]]+j[T[p+15]]).toLowerCase();if(!M(m))throw TypeError("Stringified UUID is invalid");return m}var A=P;function d(T,p,m){T=T||{};var g=T.random||(T.rng||O)();if(g[6]=g[6]&15|64,g[8]=g[8]&63|128,p){m=m||0;for(var a=0;a<16;++a)p[m+a]=g[a];return p}return A(g)}var f=De.a=d},"7ahc":function(bt,De,q){"use strict";q.d(De,"a",function(){return x});var ue=q("k1fw"),J=q("0Owb"),O=q("+L6B"),$=q("2/Rp"),F=q("y8nQ"),M=q("Vl3Y"),j=q("tJVT"),U=q("OaEy"),P=q("2fM7"),A=q("q1tI"),d=q.n(A),f=q("VrN/"),T=q.n(f),p=q("p77/"),m=q.n(p),g=q("c5Ni"),a=q.n(g),i=P.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},l={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"]};De.b=function(v){var y=v.callback,R=v.onCancel,w=Object(A.useState)("python"),E=Object(j.a)(w,2),C=E[0],c=E[1];function u(S){c(l[S][1])}function L(S){y(S)}return d.a.createElement(M.a,Object(J.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:L}),d.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},d.a.createElement(P.a,{onChange:u},Object.keys(l).map(function(S){return d.a.createElement(i,{key:S,value:S},l[S][0])}))),d.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},d.a.createElement(x,{mode:C})),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement($.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement($.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function x(v){var y=v.value,R=v.onChange,w=v.mode,E=v.options,C=E===void 0?{}:E,c=Object(A.useRef)(),u=Object(A.useState)(),L=Object(j.a)(u,2),S=L[0],D=L[1];return Object(A.useEffect)(function(){if(S){function _(B){var G=B.getValue();R&&R(G)}return S.on("change",_),function(){S.off("change",_)}}},[S,R]),Object(A.useEffect)(function(){S&&S.setOption("mode",w)},[S,w]),Object(A.useEffect)(function(){S&&((y!==S.getValue()||y==="")&&setTimeout(function(){S.setValue(y||" ")},300))},[S,y]),Object(A.useEffect)(function(){if(c.current&&!S){var _=T.a.fromTextArea(c.current,Object(ue.a)({mode:w,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},C));D(_)}},[c.current,S]),d.a.createElement("div",{className:"my-codemirror-container"},d.a.createElement("textarea",{ref:c}))}},"8EBN":function(bt,De,q){(function(ue){ue(q("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&&$.substring(j+1,$.length);if(U)return ue.findModeByExtension(U)},ue.findModeByName=function($){$=$.toLowerCase();for(var F=0;F0&&T[T.length-1])&&(a[0]===6||a[0]===2)){A=0;continue}if(a[0]===3&&(!T||a[1]>T[0]&&a[1]=H.length?X.slice(H.length):X}).join(`
`)}var a=[],i=[""],s=new p.a.Renderer,l=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function x(){a.length=0,i=[""]}var v={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function y(z,h,b,H){if(h>=z.length||z[h].level<=b)return h;var X=z[h];H.push("- "+X.text+""),h++;var K=[];return h=y(z,h,X.level,K),K.length>0&&(H.push("
"),K.forEach(function(xe){H.push(xe)}),H.push("
")),H.push(" "),h=y(z,h,b,H),h}function R(){return y(a,0,0,i),i.push("
"),i.join("")}var w={heading:function(h){var b=l.exec(h);if(b)return{type:"heading",raw:b[0],depth:b[1].length,text:b[2]}},fences:function(h){var b=this.rules.block.fences.exec(h);if(b){var H=b[0],X=g(H,b[3]||""),K=b[2]?b[2].trim():b[2];if(["latex","katex","math"].indexOf(K)>=0){var xe=c(),Ge=X;X=xe,u[xe]={type:"block",expression:Ge}}return{type:"code",raw:H,lang:K,text:X}}}},E=/(?:\${2})([^\n`]+?)(?:\${2})/gi,C=0,c=function(){return"__special_katext_id_".concat(C++,"__")},u={};function L(){return u}function S(){C=0,u={}}function D(z){return z=z.replace(E,function(h,b){var H=c();return u[H]={type:"inline",expression:b},H}),z}var _=s.listitem;s.listitem=function(z){return _(D(z))};var B=s.paragraph;s.paragraph=function(z){return B(D(z))};var G=s.tablecell;s.tablecell=function(z,h){return G(D(z),h)},s.code=function(z,h,b){var H=(h||"").match(/\S*/)[0];return H?["latex","katex","math"].indexOf(H)>=0?"".concat(z,"
"):'
').concat(b?z:Object(m.escape)(z,!0),`
`):''+(b?z:Object(m.escape)(z,!0))+"
"},s.heading=function(z,h,b){var H=this.options.headerPrefix+b.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return a.push({anchor:H,level:h,text:z}),"'+z+""},p.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),p.a.use({tokenizer:w,renderer:s});var V=p.a,I=q("SJMd"),N=q("ulZh"),Y=q.n(N),ee=q("m3rI"),le=q("Oy/b"),me=q("p5ED"),Ie=q("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 Te=function(z,h){return(Te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,H){b.__proto__=H}||function(b,H){for(var X in H)Object.prototype.hasOwnProperty.call(H,X)&&(b[X]=H[X])})(z,h)};function Oe(z,h){function b(){this.constructor=z}Te(z,h),z.prototype=h===null?Object.create(h):(b.prototype=h.prototype,new b)}function Re(z,h,b,H){return new(b||(b=Promise))(function(X,K){function xe(gt){try{nt(H.next(gt))}catch(Ke){K(Ke)}}function Ge(gt){try{nt(H.throw(gt))}catch(Ke){K(Ke)}}function nt(gt){var Ke;gt.done?X(gt.value):(Ke=gt.value,Ke instanceof b?Ke:new b(function(kt){kt(Ke)})).then(xe,Ge)}nt((H=H.apply(z,h||[])).next())})}function Ee(z,h){var b,H,X,K,xe={label:0,sent:function(){if(1&X[0])throw X[1];return X[1]},trys:[],ops:[]};return K={next:Ge(0),throw:Ge(1),return:Ge(2)},typeof Symbol=="function"&&(K[Symbol.iterator]=function(){return this}),K;function Ge(nt){return function(gt){return function(Ke){if(b)throw new TypeError("Generator is already executing.");for(;xe;)try{if(b=1,H&&(X=2&Ke[0]?H.return:Ke[0]?H.throw||((X=H.return)&&X.call(H),0):H.next)&&!(X=X.call(H,Ke[1])).done)return X;switch(H=0,X&&(Ke=[2&Ke[0],X.value]),Ke[0]){case 0:case 1:X=Ke;break;case 4:return xe.label++,{value:Ke[1],done:!1};case 5:xe.label++,H=Ke[1],Ke=[0];continue;case 7:Ke=xe.ops.pop(),xe.trys.pop();continue;default:if(!(X=xe.trys,(X=X.length>0&&X[X.length-1])||Ke[0]!==6&&Ke[0]!==2)){xe=0;continue}if(Ke[0]===3&&(!X||Ke[1]>X[0]&&Ke[1]',"select"),this.addActionButton(H,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(H,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(H,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(H,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(H,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(H,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(H,'',"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(K){var xe=document.createElement("div");xe.className=""+b.toolbarButtonStyleClass.name,xe.setAttribute("data-type-name",K.typeName),xe.innerHTML=K.icon,xe.addEventListener("click",function(){b.markerToolbarButtonClicked(xe,K)}),b.buttons.push(xe),b.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 X=document.createElement("div");X.className=this.toolbarBlockStyleClass.name,X.style.whiteSpace="nowrap",X.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(X),this.addActionButton(X,'',"render"),this.addActionButton(X,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},z.prototype.addButtonClickListener=function(h){this.buttonClickListeners.push(h)},z.prototype.removeButtonClickListener=function(h){this.buttonClickListeners.indexOf(h)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(h),1)},z.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},z.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var h=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var b=0;b0&&this.buttonClickListeners.forEach(function(H){return H("marker",b)}),this.markerButtonOverflowBlock.style.display="none"},z.prototype.actionToolbarButtonClicked=function(h,b){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(H){return H("action",b)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},z.prototype.setActiveButton=function(h){this.resetButtonStyles(),h.className=h.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),h.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},z.prototype.setActiveMarkerButton=function(h){var b=this.markerButtons.find(function(H){return H.getAttribute("data-type-name")===h});b&&this.setActiveButton(b)},z.prototype.setCurrentMarker=function(h){var b=this;this.currentMarker=h,this.buttons.filter(function(H){return/delete|notes/.test(H.getAttribute("data-action"))}).forEach(function(H){b.currentMarker===void 0?(H.style.fillOpacity="0.4",H.style.pointerEvents="none"):(H.style.fillOpacity="1",H.style.pointerEvents="all")})},z}(),we=function(){function z(h,b,H,X){this.panels=[],this.panelButtons=[],this.markerjsContainer=h,this.displayMode=b,this.uiStyleSettings=H,this.styles=X,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return z.prototype.addStyles=function(){var h;this.toolboxStyleClass=this.styles.addClass(new ae("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new ae("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var b=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ae("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ae("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ae("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new ae("toolbox-panel-row_colors",`
background-color: `+((h=this.uiStyleSettings.toolboxBackgroundColor)!==null&&h!==void 0?h:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ae("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*b)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*b)+`px;
padding: `+b+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ae("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ae("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new 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;
`))},z.prototype.show=function(h){var b;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=h,this.uiContainer.className=this.toolboxStyleClass.name+" "+((b=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&b!==void 0?b:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},z.prototype.setPanelButtons=function(h){var b,H,X=this;this.panels=h,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((b=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&b!==void 0?b:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((H=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&H!==void 0?H:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(K){var xe;K.uiStyleSettings=X.uiStyleSettings;var Ge=document.createElement("div");Ge.className=X.toolboxButtonStyleClass.name+" "+((xe=X.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&xe!==void 0?xe:X.toolboxButtonStyleColorsClass.name),Ge.innerHTML=K.icon,Ge.title=K.title,Ge.addEventListener("click",function(){X.panelButtonClick(K)}),X.panelButtons.push(Ge),X.buttonRow.appendChild(Ge)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},z.prototype.panelButtonClick=function(h){var b=this,H=-1;if(h!==this.activePanel){H=this.panels.indexOf(h),this.panelRow.innerHTML="";var X=h.getUi();X.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(X),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=h}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){b.displayMode==="inline"?b.panelRow.style.display="none":b.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(K,xe){var Ge,nt;K.className=b.toolboxButtonStyleClass.name+" "+(xe===H?""+((Ge=b.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ge!==void 0?Ge:b.toolboxActiveButtonStyleColorsClass.name):""+((nt=b.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&nt!==void 0?nt:b.toolboxButtonStyleColorsClass.name))})},z}(),_e=function(z,h){this.title=z,this.icon=h},Fe=function(z){function h(b,H,X,K){var xe=z.call(this,b,K||'')||this;return xe.colors=[],xe.addTransparent=!1,xe.colorBoxes=[],xe.colors=H,xe.currentColor=X,xe.setCurrentColor=xe.setCurrentColor.bind(xe),xe.getColorBox=xe.getColorBox.bind(xe),xe}return Oe(h,z),h.prototype.getUi=function(){var b=this,H=document.createElement("div");return H.style.overflow="hidden",H.style.whiteSpace="nowrap",this.colors.forEach(function(X){var K=b.getColorBox(X);H.appendChild(K),b.colorBoxes.push(K)}),H},h.prototype.getColorBox=function(b){var H=this,X=this.uiStyleSettings.toolbarHeight/4,K=this.uiStyleSettings.toolbarHeight-X,xe=document.createElement("div");xe.style.display="inline-block",xe.style.boxSizing="content-box",xe.style.width=K-2+"px",xe.style.height=K-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=(K+2)/2+"px",xe.style.borderColor=b===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",xe.addEventListener("click",function(){H.setCurrentColor(b,xe)});var Ge=document.createElement("div");return Ge.style.display="inline-block",Ge.style.width=K-2+"px",Ge.style.height=K-2+"px",Ge.style.backgroundColor=b,Ge.style.borderRadius=K/2+"px",b==="transparent"&&(Ge.style.fill=this.uiStyleSettings.toolboxAccentColor,Ge.innerHTML=``),xe.appendChild(Ge),xe},h.prototype.setCurrentColor=function(b,H){var X=this;this.currentColor=b,this.colorBoxes.forEach(function(K){K.style.borderColor=K===H?X.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(b)},h}(_e),Ue=function(){function z(h,b,H){this._state="new",this._isSelected=!1,this._container=h,this._overlayContainer=b,this.globalSettings=H,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(z.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),z.prototype.ownsTarget=function(h){return!1},Object.defineProperty(z.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),z.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},z.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},z.prototype.pointerDown=function(h,b){},z.prototype.dblClick=function(h,b){},z.prototype.manipulate=function(h){},z.prototype.pointerUp=function(h){this.stateChanged()},z.prototype.dispose=function(){},z.prototype.addMarkerVisualToContainer=function(h){this.container.childNodes.length>0?this.container.insertBefore(h,this.container.childNodes[0]):this.container.appendChild(h)},z.prototype.getState=function(){return{typeName:z.typeName,state:this.state,notes:this.notes}},z.prototype.restoreState=function(h){this._state=h.state,this.notes=h.notes},z.prototype.scale=function(h,b){},z.prototype.colorChanged=function(h){this.onColorChanged&&this.onColorChanged(h),this.stateChanged()},z.prototype.fillColorChanged=function(h){this.onFillColorChanged&&this.onFillColorChanged(h),this.stateChanged()},z.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var h=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),h.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(h)&&this.onStateChanged(this)}},z.typeName="MarkerBase",z}(),Be=function(){function z(){this.findGripByVisual=this.findGripByVisual.bind(this)}return z.prototype.findGripByVisual=function(h){return this.topLeft.ownsTarget(h)?this.topLeft:this.topCenter.ownsTarget(h)?this.topCenter:this.topRight.ownsTarget(h)?this.topRight:this.centerLeft.ownsTarget(h)?this.centerLeft:this.centerRight.ownsTarget(h)?this.centerRight:this.bottomLeft.ownsTarget(h)?this.bottomLeft:this.bottomCenter.ownsTarget(h)?this.bottomCenter:this.bottomRight.ownsTarget(h)?this.bottomRight:void 0},z}(),Ze=function(){function z(){this.GRIP_SIZE=10,this.visual=de.createGroup(),this.visual.appendChild(de.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(de.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return z.prototype.ownsTarget=function(h){return h===this.visual||h===this.visual.childNodes[0]||h===this.visual.childNodes[1]},z}(),et=function(){function z(){}return z.toITransformMatrix=function(h){return{a:h.a,b:h.b,c:h.c,d:h.d,e:h.e,f:h.f}},z.toSVGMatrix=function(h,b){return h.a=b.a,h.b=b.b,h.c=b.c,h.d=b.d,h.e=b.e,h.f=b.f,h},z}(),rt=function(z){function h(b,H,X){var K=z.call(this,b,H,X)||this;return K.left=0,K.top=0,K.width=0,K.height=0,K.defaultSize={x:50,y:20},K.offsetX=0,K.offsetY=0,K.rotationAngle=0,K.CB_DISTANCE=10,K._suppressMarkerCreateEvent=!1,K.container.transform.baseVal.appendItem(de.createTransform()),K.setupControlBox(),K}return Oe(h,z),Object.defineProperty(h.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"visual",{get:function(){return this._visual},set:function(b){this._visual=b;var H=de.createTransform();this._visual.transform.baseVal.appendItem(H)},enumerable:!1,configurable:!0}),h.prototype.ownsTarget=function(b){return!!z.prototype.ownsTarget.call(this,b)||!!(this.controlGrips.findGripByVisual(b)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(b))},h.prototype.pointerDown=function(b,H){z.prototype.pointerDown.call(this,b,H),this.state==="new"&&(this.left=b.x,this.top=b.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var X=this.unrotatePoint(b);if(this.manipulationStartX=X.x,this.manipulationStartY=X.y,this.offsetX=X.x-this.left,this.offsetY=X.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(H),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(H)){this.activeGrip=this.rotatorGrip;var K=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=K.x-this.width/2,this.top=K.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"},h.prototype.pointerUp=function(b){var H=this.state;z.prototype.pointerUp.call(this,b),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(b),this._state="select",H==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},h.prototype.moveVisual=function(b){this.visual.style.transform="translate("+b.x+"px, "+b.y+"px)"},h.prototype.manipulate=function(b){var H=this.unrotatePoint(b);this.state==="creating"?this.resize(b):this.state==="move"?(this.left=this.manipulationStartLeft+(H.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(H.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(H):this.state==="rotate"&&this.rotate(b)},h.prototype.resize=function(b){var H=this.manipulationStartLeft,X=this.manipulationStartWidth,K=this.manipulationStartTop,xe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:H=this.manipulationStartLeft+b.x-this.manipulationStartX,X=this.manipulationStartWidth+this.manipulationStartLeft-H;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:X=this.manipulationStartWidth+b.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:K=this.manipulationStartTop+b.y-this.manipulationStartY,xe=this.manipulationStartHeight+this.manipulationStartTop-K;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:xe=this.manipulationStartHeight+b.y-this.manipulationStartY}X>=0?(this.left=H,this.width=X):(this.left=H+X,this.width=-X),xe>=0?(this.top=K,this.height=xe):(this.top=K+xe,this.height=-xe),this.setSize()},h.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},h.prototype.rotate=function(b){if(Math.abs(b.x-this.centerX)>.1){var H=Math.sign(b.x-this.centerX);this.rotationAngle=180*Math.atan((b.y-this.centerY)/(b.x-this.centerX))/Math.PI+90*H,this.applyRotation()}},h.prototype.applyRotation=function(){var b=this.container.transform.baseVal.getItem(0);b.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(b,0)},h.prototype.rotatePoint=function(b){if(this.rotationAngle===0)return b;var H=this.container.getCTM(),X=de.createPoint(b.x,b.y);return{x:(X=X.matrixTransform(H)).x,y:X.y}},h.prototype.unrotatePoint=function(b){if(this.rotationAngle===0)return b;var H=this.container.getCTM();H=H.inverse();var X=de.createPoint(b.x,b.y);return{x:(X=X.matrixTransform(H)).x,y:X.y}},h.prototype.select=function(){z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},h.prototype.deselect=function(){z.prototype.deselect.call(this),this.controlBox.style.display="none"},h.prototype.setupControlBox=function(){this.controlBox=de.createGroup();var b=de.createTransform();b.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(b),this.container.appendChild(this.controlBox),this.controlRect=de.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=de.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Be,this.addControlGrips(),this.controlBox.style.display="none"},h.prototype.adjustControlBox=function(){var b=this.controlBox.transform.baseVal.getItem(0);b.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(b,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()},h.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()},h.prototype.createGrip=function(){var b=new Ze;return b.visual.transform.baseVal.appendItem(de.createTransform()),this.controlBox.appendChild(b.visual),b},h.prototype.positionGrips=function(){var b=this.controlGrips.topLeft.GRIP_SIZE,H=-b/2,X=H,K=(this.width+this.CB_DISTANCE)/2-b/2,xe=(this.height+this.CB_DISTANCE)/2-b/2,Ge=this.height+this.CB_DISTANCE-b/2,nt=this.width+this.CB_DISTANCE-b/2;this.positionGrip(this.controlGrips.topLeft.visual,H,X),this.positionGrip(this.controlGrips.topCenter.visual,K,X),this.positionGrip(this.controlGrips.topRight.visual,nt,X),this.positionGrip(this.controlGrips.centerLeft.visual,H,xe),this.positionGrip(this.controlGrips.centerRight.visual,nt,xe),this.positionGrip(this.controlGrips.bottomLeft.visual,H,Ge),this.positionGrip(this.controlGrips.bottomCenter.visual,K,Ge),this.positionGrip(this.controlGrips.bottomRight.visual,nt,Ge),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,K,X-3*this.CB_DISTANCE)},h.prototype.positionGrip=function(b,H,X){var K=b.transform.baseVal.getItem(0);K.setTranslate(H,X),b.transform.baseVal.replaceItem(K,0)},h.prototype.hideControlBox=function(){this.controlBox.style.display="none"},h.prototype.showControlBox=function(){this.controlBox.style.display=""},h.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:et.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:et.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},z.prototype.getState.call(this))},h.prototype.restoreState=function(b){z.prototype.restoreState.call(this,b);var H=b;this.left=H.left,this.top=H.top,this.width=H.width,this.height=H.height,this.rotationAngle=H.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(et.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,H.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(et.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,H.containerTransformMatrix))},h.prototype.scale=function(b,H){z.prototype.scale.call(this,b,H);var X=this.rotatePoint({x:this.left,y:this.top}),K=this.unrotatePoint({x:X.x*b,y:X.y*H});this.left=K.x,this.top=K.y,this.width=this.width*b,this.height=this.height*H,this.adjustControlBox()},h}(Ue),Ye=function(z){function h(b,H,X){var K=z.call(this,b,H,X)||this;return K.fillColor="transparent",K.strokeColor="transparent",K.strokeWidth=0,K.strokeDasharray="",K.opacity=1,K.setStrokeColor=K.setStrokeColor.bind(K),K.setFillColor=K.setFillColor.bind(K),K.setStrokeWidth=K.setStrokeWidth.bind(K),K.setStrokeDasharray=K.setStrokeDasharray.bind(K),K.createVisual=K.createVisual.bind(K),K}return Oe(h,z),h.prototype.ownsTarget=function(b){return!(!z.prototype.ownsTarget.call(this,b)&&b!==this.visual)},h.prototype.createVisual=function(){this.visual=de.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)},h.prototype.pointerDown=function(b,H){z.prototype.pointerDown.call(this,b,H),this.state==="new"&&(this.createVisual(),this.moveVisual(b),this._state="creating")},h.prototype.manipulate=function(b){z.prototype.manipulate.call(this,b)},h.prototype.resize=function(b){z.prototype.resize.call(this,b),this.setSize()},h.prototype.setSize=function(){z.prototype.setSize.call(this),de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},h.prototype.pointerUp=function(b){z.prototype.pointerUp.call(this,b),this.setSize()},h.prototype.setStrokeColor=function(b){this.strokeColor=b,this.visual&&de.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(b),this.stateChanged()},h.prototype.setFillColor=function(b){this.fillColor=b,this.visual&&de.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},h.prototype.setStrokeWidth=function(b){this.strokeWidth=b,this.visual&&de.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},h.prototype.setStrokeDasharray=function(b){this.strokeDasharray=b,this.visual&&de.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},h.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},z.prototype.getState.call(this))},h.prototype.restoreState=function(b){var H=b;this.fillColor=H.fillColor,this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.opacity=H.opacity,this.createVisual(),z.prototype.restoreState.call(this,b),this.setSize()},h.prototype.scale=function(b,H){z.prototype.scale.call(this,b,H),this.setSize()},h.title="Rectangle marker",h}(rt),st=function(z){function h(b,H,X,K){var xe=z.call(this,b,K||'')||this;return xe.widths=[],xe.widthBoxes=[],xe.widths=H,xe.currentWidth=X,xe.setCurrentWidth=xe.setCurrentWidth.bind(xe),xe}return Oe(h,z),h.prototype.getUi=function(){var b=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",this.widths.forEach(function(X){var K=document.createElement("div");K.style.display="flex",K.style.flexGrow="2",K.style.alignItems="center",K.style.justifyContent="space-between",K.style.padding="5px",K.style.borderWidth="2px",K.style.borderStyle="solid",K.style.borderColor=X===b.currentWidth?b.uiStyleSettings.toolboxAccentColor:"transparent",K.addEventListener("click",function(){b.setCurrentWidth(X,K)}),H.appendChild(K);var xe=document.createElement("div");xe.innerText=X.toString(),xe.style.marginRight="5px",K.appendChild(xe);var Ge=document.createElement("div");Ge.style.minHeight="20px",Ge.style.flexGrow="2",Ge.style.display="flex",Ge.style.alignItems="center";var nt=document.createElement("hr");nt.style.minWidth="20px",nt.style.border="0px",nt.style.borderTop=X+"px solid "+b.uiStyleSettings.toolboxColor,nt.style.flexGrow="2",Ge.appendChild(nt),K.appendChild(Ge),b.widthBoxes.push(K)}),H},h.prototype.setCurrentWidth=function(b,H){var X=this;this.currentWidth=b,this.widthBoxes.forEach(function(K){K.style.borderColor=K===H?X.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},h}(_e),Je=function(z){function h(b,H,X,K){var xe=z.call(this,b,K||'')||this;return xe.styles=[],xe.styleBoxes=[],xe.styles=H,xe.currentStyle=X,xe.setCurrentStyle=xe.setCurrentStyle.bind(xe),xe}return Oe(h,z),h.prototype.getUi=function(){var b=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",this.styles.forEach(function(X){var K=document.createElement("div");K.style.display="flex",K.style.alignItems="center",K.style.justifyContent="space-between",K.style.padding="5px",K.style.borderWidth="2px",K.style.borderStyle="solid",K.style.overflow="hidden",K.style.maxWidth=100/b.styles.length-5+"%",K.style.borderColor=X===b.currentStyle?b.uiStyleSettings.toolboxAccentColor:"transparent",K.addEventListener("click",function(){b.setCurrentStyle(X,K)}),H.appendChild(K);var xe=document.createElement("div");xe.style.minHeight="20px",xe.style.flexGrow="2",xe.style.overflow="hidden";var Ge=``;xe.innerHTML=Ge,K.appendChild(xe),b.styleBoxes.push(K)}),H},h.prototype.setCurrentStyle=function(b,H){var X=this;this.currentStyle=b,this.styleBoxes.forEach(function(K){K.style.borderColor=K===H?X.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},h}(_e),Qe=function(z){function h(b,H,X){var K=z.call(this,b,H,X)||this;return K.strokeColor=X.defaultColor,K.strokeWidth=X.defaultStrokeWidth,K.strokeDasharray=X.defaultStrokeDasharray,K.strokePanel=new Fe("Line color",X.defaultColorSet,X.defaultColor),K.strokePanel.onColorChanged=K.setStrokeColor,K.strokeWidthPanel=new st("Line width",X.defaultStrokeWidths,X.defaultStrokeWidth),K.strokeWidthPanel.onWidthChanged=K.setStrokeWidth,K.strokeStylePanel=new Je("Line style",X.defaultStrokeDasharrays,X.defaultStrokeDasharray),K.strokeStylePanel.onStyleChanged=K.setStrokeDasharray,K}return Oe(h,z),Object.defineProperty(h.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),h.prototype.getState=function(){var b=z.prototype.getState.call(this);return b.typeName=h.typeName,b},h.typeName="FrameMarker",h.title="Frame marker",h.icon='',h}(Ye),Me=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},$e=function(z){function h(b,H,X){var K=z.call(this,b,H,X)||this;return K.x1=0,K.y1=0,K.x2=0,K.y2=0,K.defaultLength=50,K.manipulationStartX=0,K.manipulationStartY=0,K.manipulationStartX1=0,K.manipulationStartY1=0,K.manipulationStartX2=0,K.manipulationStartY2=0,K.setupControlBox(),K}return Oe(h,z),h.prototype.ownsTarget=function(b){return!!z.prototype.ownsTarget.call(this,b)||!(!this.grip1.ownsTarget(b)&&!this.grip2.ownsTarget(b))},h.prototype.pointerDown=function(b,H){z.prototype.pointerDown.call(this,b,H),this.manipulationStartX=b.x,this.manipulationStartY=b.y,this.state==="new"&&(this.x1=b.x,this.y1=b.y,this.x2=b.x,this.y2=b.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(H)?this.activeGrip=this.grip1:this.grip2.ownsTarget(H)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},h.prototype.pointerUp=function(b){var H=this.state;z.prototype.pointerUp.call(this,b),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(b),this._state="select",H==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},h.prototype.adjustVisual=function(){},h.prototype.manipulate=function(b){this.state==="creating"?this.resize(b):this.state==="move"?(this.x1=this.manipulationStartX1+b.x-this.manipulationStartX,this.y1=this.manipulationStartY1+b.y-this.manipulationStartY,this.x2=this.manipulationStartX2+b.x-this.manipulationStartX,this.y2=this.manipulationStartY2+b.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(b)},h.prototype.resize=function(b){switch(this.activeGrip){case this.grip1:this.x1=b.x,this.y1=b.y;break;case this.grip2:case void 0:this.x2=b.x,this.y2=b.y}this.adjustVisual(),this.adjustControlBox()},h.prototype.select=function(){z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},h.prototype.deselect=function(){z.prototype.deselect.call(this),this.controlBox.style.display="none"},h.prototype.setupControlBox=function(){this.controlBox=de.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},h.prototype.adjustControlBox=function(){this.positionGrips()},h.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},h.prototype.createGrip=function(){var b=new Ze;return b.visual.transform.baseVal.appendItem(de.createTransform()),this.controlBox.appendChild(b.visual),b},h.prototype.positionGrips=function(){var b=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-b/2,this.y1-b/2),this.positionGrip(this.grip2.visual,this.x2-b/2,this.y2-b/2)},h.prototype.positionGrip=function(b,H,X){var K=b.transform.baseVal.getItem(0);K.setTranslate(H,X),b.transform.baseVal.replaceItem(K,0)},h.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},z.prototype.getState.call(this))},h.prototype.restoreState=function(b){z.prototype.restoreState.call(this,b);var H=b;this.x1=H.x1,this.y1=H.y1,this.x2=H.x2,this.y2=H.y2},h.prototype.scale=function(b,H){z.prototype.scale.call(this,b,H),this.x1=this.x1*b,this.y1=this.y1*H,this.x2=this.x2*b,this.y2=this.y2*H,this.adjustVisual(),this.adjustControlBox()},h}(Ue),ut=function(z){function h(b,H,X){var K=z.call(this,b,H,X)||this;return K.strokeColor="transparent",K.strokeWidth=0,K.strokeDasharray="",K.setStrokeColor=K.setStrokeColor.bind(K),K.setStrokeWidth=K.setStrokeWidth.bind(K),K.setStrokeDasharray=K.setStrokeDasharray.bind(K),K.strokeColor=X.defaultColor,K.strokeWidth=X.defaultStrokeWidth,K.strokeDasharray=X.defaultStrokeDasharray,K.strokePanel=new Fe("Line color",X.defaultColorSet,X.defaultColor),K.strokePanel.onColorChanged=K.setStrokeColor,K.strokeWidthPanel=new st("Line width",X.defaultStrokeWidths,X.defaultStrokeWidth),K.strokeWidthPanel.onWidthChanged=K.setStrokeWidth,K.strokeStylePanel=new Je("Line style",X.defaultStrokeDasharrays,X.defaultStrokeDasharray),K.strokeStylePanel.onStyleChanged=K.setStrokeDasharray,K}return Oe(h,z),h.prototype.ownsTarget=function(b){return!(!z.prototype.ownsTarget.call(this,b)&&b!==this.visual&&b!==this.selectorLine&&b!==this.visibleLine)},h.prototype.createVisual=function(){this.visual=de.createGroup(),this.selectorLine=de.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=de.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)},h.prototype.pointerDown=function(b,H){z.prototype.pointerDown.call(this,b,H),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},h.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()),de.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),de.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),de.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},h.prototype.setStrokeColor=function(b){this.strokeColor=b,this.adjustVisual(),this.colorChanged(b)},h.prototype.setStrokeWidth=function(b){this.strokeWidth=b,this.adjustVisual()},h.prototype.setStrokeDasharray=function(b){this.strokeDasharray=b,this.adjustVisual(),this.stateChanged()},Object.defineProperty(h.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),h.prototype.getState=function(){var b=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},z.prototype.getState.call(this));return b.typeName=h.typeName,b},h.prototype.restoreState=function(b){z.prototype.restoreState.call(this,b);var H=b;this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.createVisual(),this.adjustVisual()},h.typeName="LineMarker",h.title="Line marker",h.icon='',h}($e),je=function(z){function h(b,H,X,K){var xe=z.call(this,b,K||'')||this;return xe.fonts=[],xe.fontBoxes=[],xe.fonts=H,xe.currentFont=X,xe.setCurrentFont=xe.setCurrentFont.bind(xe),xe}return Oe(h,z),h.prototype.getUi=function(){var b=this,H=document.createElement("div");return H.style.overflow="hidden",H.style.flexGrow="2",this.fonts.forEach(function(X){var K=document.createElement("div");K.style.display="inline-block",K.style.alignItems="center",K.style.justifyContent="space-between",K.style.padding="5px",K.style.borderWidth="2px",K.style.borderStyle="solid",K.style.overflow="hidden",K.style.maxWidth=100/b.fonts.length-5+"%",K.style.borderColor=X===b.currentFont?b.uiStyleSettings.toolboxAccentColor:"transparent",K.addEventListener("click",function(){b.setCurrentFont(X,K)}),H.appendChild(K);var xe=document.createElement("div");xe.style.display="flex",xe.style.minHeight="20px",xe.style.flexGrow="2",xe.style.fontFamily=X,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),K.appendChild(xe),b.fontBoxes.push(K)}),H},h.prototype.setCurrentFont=function(b,H){var X=this;this.currentFont=b,this.fontBoxes.forEach(function(K){K.style.borderColor=K===H?X.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},h}(_e),Ve=function(z){function h(b,H,X){var K=z.call(this,b,H,X)||this;return K.color="transparent",K.padding=5,K.DEFAULT_TEXT="your text here",K.text=K.DEFAULT_TEXT,K.isMoved=!1,K.color=X.defaultColor,K.fontFamily=X.defaultFontFamily,K.defaultSize={x:100,y:30},K.setColor=K.setColor.bind(K),K.setFont=K.setFont.bind(K),K.renderText=K.renderText.bind(K),K.sizeText=K.sizeText.bind(K),K.textEditDivClicked=K.textEditDivClicked.bind(K),K.showTextEditor=K.showTextEditor.bind(K),K.setSize=K.setSize.bind(K),K.positionTextEditor=K.positionTextEditor.bind(K),K.colorPanel=new Fe("Color",X.defaultColorSet,X.defaultColor),K.colorPanel.onColorChanged=K.setColor,K.fontFamilyPanel=new je("Font",X.defaultFontFamilies,X.defaultFontFamily),K.fontFamilyPanel.onFontChanged=K.setFont,K}return Oe(h,z),h.prototype.ownsTarget=function(b){if(z.prototype.ownsTarget.call(this,b)||b===this.visual||b===this.textElement||b===this.bgRectangle)return!0;var H=!1;return this.textElement.childNodes.forEach(function(X){X===b&&(H=!0)}),H},h.prototype.createVisual=function(){this.visual=de.createGroup(),this.bgRectangle=de.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=de.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(de.createTransform()),this.textElement.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},h.prototype.pointerDown=function(b,H){z.prototype.pointerDown.call(this,b,H),this.isMoved=!1,this.pointerDownPoint=b,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(b),this._state="creating")},h.prototype.renderText=function(){var b=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(H){b.textElement.appendChild(de.createTSpan(H.trim()===""?" ":H.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},h.prototype.getTextScale=function(){var b=this.textElement.getBBox(),H=1;if(b.width>0&&b.height>0){var X=(1*this.width-this.width*this.padding*2/100)/b.width,K=(1*this.height-this.height*this.padding*2/100)/b.height;H=Math.min(X,K)}return H},h.prototype.getTextPosition=function(b){var H=this.textElement.getBBox(),X=0,K=0;return H.width>0&&H.height>0&&(X=(this.width-H.width*b)/2,K=this.height/2-H.height*b/2),{x:X,y:K}},h.prototype.sizeText=function(){var b=this.textElement.getBBox(),H=this.getTextScale(),X=this.getTextPosition(H);X.y-=b.y*H,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+X.x+"px, "+X.y+"px) scale("+H+", "+H+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(X.x,X.y),this.textElement.transform.baseVal.getItem(1).setScale(H,H))},h.prototype.manipulate=function(b){z.prototype.manipulate.call(this,b),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(b.x-this.pointerDownPoint.x)>5||Math.abs(b.y-this.pointerDownPoint.y)>5)},h.prototype.resize=function(b){z.prototype.resize.call(this,b),this.isMoved=!0,this.setSize(),this.sizeText()},h.prototype.setSize=function(){z.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},h.prototype.pointerUp=function(b){var H=this.state;H==="creating"&&(this._suppressMarkerCreateEvent=!0),z.prototype.pointerUp.call(this,b),this.setSize(),(H==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},h.prototype.showTextEditor=function(){var b=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(H){H.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var H=Number.parseFloat(b.textEditor.style.fontSize);b.textEditor.clientWidth>=Number.parseInt(b.textEditor.style.maxWidth)&&H>.9;)H-=.1,b.textEditor.style.fontSize=Math.max(H,.9)+"em"}),this.textEditor.addEventListener("keyup",function(H){H.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(H){if(H.clipboardData){var X=H.clipboardData.getData("text"),K=window.getSelection();if(!K.rangeCount)return!1;K.deleteFromDocument(),K.getRangeAt(0).insertNode(document.createTextNode(X)),H.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){b.textEditDivClicked(b.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},h.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var b=this.getTextScale(),H=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),X=this.textElement.getBBox(),K={x:X.width*b,y:X.height*b};H.x-=K.x/2,H.y-=K.y/2,this.textEditor.style.top=H.y+"px",this.textEditor.style.left=H.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-H.x+"px",this.textEditor.style.fontSize=Math.max(16*b,12)+"px",this.textElement.style.display="none"}},h.prototype.textEditDivClicked=function(b){this.text=b.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},h.prototype.select=function(){z.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},h.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),z.prototype.deselect.call(this)},h.prototype.dblClick=function(b,H){z.prototype.dblClick.call(this,b,H),this.showTextEditor()},h.prototype.setColor=function(b){this.textElement&&de.setAttributes(this.textElement,[["fill",b]]),this.color=b,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(b)},h.prototype.setFont=function(b){this.textElement&&de.setAttributes(this.textElement,[["font-family",b]]),this.fontFamily=b,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},h.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},h.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(h.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),h.prototype.getState=function(){var b=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},z.prototype.getState.call(this));return b.typeName=h.typeName,b},h.prototype.restoreState=function(b){var H=b;this.color=H.color,this.fontFamily=H.fontFamily,this.padding=H.padding,this.text=H.text,this.createVisual(),z.prototype.restoreState.call(this,b),this.setSize()},h.prototype.scale=function(b,H){z.prototype.scale.call(this,b,H),this.setSize(),this.sizeText(),this.positionTextEditor()},h.typeName="TextMarker",h.title="Text marker",h.icon='',h}(rt),Se=function(z){function h(b,H,X){var K=z.call(this,b,H,X)||this;return K.color="transparent",K.lineWidth=3,K.drawing=!1,K.pixelRatio=1,K.color=X.defaultColor,K.lineWidth=X.defaultStrokeWidth,K.pixelRatio=X.freehandPixelRatio,K.setColor=K.setColor.bind(K),K.addCanvas=K.addCanvas.bind(K),K.finishCreation=K.finishCreation.bind(K),K.setLineWidth=K.setLineWidth.bind(K),K.colorPanel=new Fe("Color",X.defaultColorSet,X.defaultColor),K.colorPanel.onColorChanged=K.setColor,K.lineWidthPanel=new st("Line width",X.defaultStrokeWidths,X.defaultStrokeWidth),K.lineWidthPanel.onWidthChanged=K.setLineWidth,K}return Oe(h,z),h.prototype.ownsTarget=function(b){return!(!z.prototype.ownsTarget.call(this,b)&&b!==this.visual&&b!==this.drawingImage)},h.prototype.createVisual=function(){this.visual=de.createGroup(),this.drawingImage=de.createImage(),this.visual.appendChild(this.drawingImage);var b=de.createTransform();this.visual.transform.baseVal.appendItem(b),this.addMarkerVisualToContainer(this.visual)},h.prototype.pointerDown=function(b,H){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(b.x,b.y),this.drawing=!0):z.prototype.pointerDown.call(this,b,H)},h.prototype.manipulate=function(b){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(b.x,b.y),this.canvasContext.stroke()):z.prototype.manipulate.call(this,b)},h.prototype.resize=function(b){z.prototype.resize.call(this,b),de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},h.prototype.pointerUp=function(b){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):z.prototype.pointerUp.call(this,b)},h.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)},h.prototype.select=function(){this.state==="creating"&&this.finishCreation(),z.prototype.select.call(this)},h.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),z.prototype.deselect.call(this)},h.prototype.finishCreation=function(){for(var b=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),H=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],X=H[0],K=H[1],xe=H[2],Ge=H[3],nt=!1,gt=0;gt0&&(nt=!0,gtGe&&(Ge=gt),Ke>xe&&(xe=Ke));if(nt){this.left=X/this.pixelRatio,this.top=K/this.pixelRatio,this.width=(xe-X)/this.pixelRatio,this.height=(Ge-K)/this.pixelRatio;var kt=document.createElement("canvas");kt.width=xe-X,kt.height=Ge-K,kt.getContext("2d").putImageData(this.canvasContext.getImageData(X,K,xe-X,Ge-K),0,0),this.drawingImgUrl=kt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},h.prototype.setDrawingImage=function(){de.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},h.prototype.setColor=function(b){this.color=b,this.colorChanged(b)},h.prototype.setLineWidth=function(b){this.lineWidth=b},Object.defineProperty(h.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),h.prototype.getState=function(){var b=Object.assign({drawingImgUrl:this.drawingImgUrl},z.prototype.getState.call(this));return b.typeName=h.typeName,b},h.prototype.restoreState=function(b){this.createVisual(),z.prototype.restoreState.call(this,b),this.drawingImgUrl=b.drawingImgUrl,this.setDrawingImage()},h.prototype.scale=function(b,H){z.prototype.scale.call(this,b,H),this.setDrawingImage()},h.typeName="FreehandMarker",h.title="Freehand marker",h.icon='',h}(rt),be=function(z){function h(b,H,X){var K=z.call(this,b,X||'')||this;return K.typeBoxes=[],K.currentType=H,K.setCurrentType=K.setCurrentType.bind(K),K}return Oe(h,z),h.prototype.getUi=function(){var b=this,H=document.createElement("div");H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2";for(var X=function(Ge){var nt="both";switch(Ge){case 0:nt="both";break;case 1:nt="start";break;case 2:nt="end";break;case 3:nt="none"}var gt=document.createElement("div");if(gt.style.display="flex",gt.style.flexGrow="2",gt.style.alignItems="center",gt.style.justifyContent="space-between",gt.style.padding="5px",gt.style.borderWidth="2px",gt.style.borderStyle="solid",gt.style.borderColor=nt===K.currentType?K.uiStyleSettings.toolboxAccentColor:"transparent",gt.addEventListener("click",function(){b.setCurrentType(nt,gt)}),H.appendChild(gt),nt==="both"||nt==="start"){var Ke=document.createElement("div");Ke.style.display="flex",Ke.style.alignItems="center",Ke.style.minHeight="20px",Ke.innerHTML=``,Ke.style.marginLeft="5px",gt.appendChild(Ke)}var kt=document.createElement("div");kt.style.display="flex",kt.style.alignItems="center",kt.style.minHeight="20px",kt.style.flexGrow="2";var Bt=document.createElement("hr");if(Bt.style.minWidth="20px",Bt.style.border="0px",Bt.style.borderTop="3px solid "+(K.uiStyleSettings!==void 0?K.uiStyleSettings.toolboxColor:"#eeeeee"),Bt.style.flexGrow="2",kt.appendChild(Bt),gt.appendChild(kt),nt==="both"||nt==="end"){var tr=document.createElement("div");tr.style.display="flex",tr.style.alignItems="center",tr.style.minHeight="20px",tr.innerHTML=``,tr.style.marginRight="5px",gt.appendChild(tr)}K.typeBoxes.push(gt)},K=this,xe=0;xe<4;xe++)X(xe);return H},h.prototype.setCurrentType=function(b,H){var X=this;this.currentType=b,this.typeBoxes.forEach(function(K){K.style.borderColor=K===H?X.uiStyleSettings!==void 0?X.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},h}(_e),Ce=function(z){function h(b,H,X){var K=z.call(this,b,H,X)||this;return K.arrowType="end",K.arrowBaseHeight=10,K.arrowBaseWidth=10,K.getArrowPoints=K.getArrowPoints.bind(K),K.setArrowType=K.setArrowType.bind(K),K.arrowTypePanel=new be("Arrow type","end"),K.arrowTypePanel.onArrowTypeChanged=K.setArrowType,K}return Oe(h,z),h.prototype.ownsTarget=function(b){return!(!z.prototype.ownsTarget.call(this,b)&&b!==this.arrow1&&b!==this.arrow2)},h.prototype.getArrowPoints=function(b,H){var X=this.arrowBaseWidth+2*this.strokeWidth,K=this.arrowBaseHeight+2*this.strokeWidth;return b-X/2+","+(H+K/2)+" "+b+","+(H-K/2)+" "+(b+X/2)+","+(H+K/2)},h.prototype.createTips=function(){this.arrow1=de.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=de.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.arrow2)},h.prototype.pointerDown=function(b,H){z.prototype.pointerDown.call(this,b,H),this.state==="creating"&&this.createTips()},h.prototype.adjustVisual=function(){if(z.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",de.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),de.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var b=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),H=this.arrow1.transform.baseVal.getItem(0);H.setRotate(b,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(H,0);var X=this.arrow2.transform.baseVal.getItem(0);X.setRotate(b+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(X,0)}},h.prototype.setArrowType=function(b){this.arrowType=b,this.adjustVisual(),this.stateChanged()},Object.defineProperty(h.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),h.prototype.getState=function(){var b=Object.assign({arrowType:this.arrowType},z.prototype.getState.call(this));return b.typeName=h.typeName,b},h.prototype.restoreState=function(b){z.prototype.restoreState.call(this,b);var H=b;this.arrowType=H.arrowType,this.createTips(),this.adjustVisual()},h.typeName="ArrowMarker",h.title="Arrow marker",h.icon='',h}(ut),ne=function(z){function h(b,H,X){var K=z.call(this,b,H,X)||this;return K.fillColor=X.defaultFillColor,K.strokeWidth=0,K.fillPanel=new Fe("Color",X.defaultColorSet,X.defaultFillColor),K.fillPanel.onColorChanged=K.setFillColor,K}return Oe(h,z),Object.defineProperty(h.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),h.prototype.getState=function(){var b=z.prototype.getState.call(this);return b.typeName=h.typeName,b},h.typeName="CoverMarker",h.title="Cover marker",h.icon='',h}(Ye),oe=function(z){function h(b,H,X,K){var xe=z.call(this,b,K||'')||this;return xe.opacities=[],xe.opacityBoxes=[],xe.opacities=H,xe.currentOpacity=X,xe.setCurrentOpacity=xe.setCurrentOpacity.bind(xe),xe}return Oe(h,z),h.prototype.getUi=function(){var b=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",H.style.justifyContent="space-between",this.opacities.forEach(function(X){var K=document.createElement("div");K.style.display="flex",K.style.alignItems="center",K.style.justifyContent="center",K.style.padding="5px",K.style.borderWidth="2px",K.style.borderStyle="solid",K.style.borderColor=X===b.currentOpacity?b.uiStyleSettings.toolboxAccentColor:"transparent",K.addEventListener("click",function(){b.setCurrentOpacity(X,K)}),H.appendChild(K);var xe=document.createElement("div");xe.innerText=100*X+"%",K.appendChild(xe),b.opacityBoxes.push(K)}),H},h.prototype.setCurrentOpacity=function(b,H){var X=this;this.currentOpacity=b,this.opacityBoxes.forEach(function(K){K.style.borderColor=K===H?X.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},h}(_e),ce=function(z){function h(b,H,X){var K=z.call(this,b,H,X)||this;return K.setOpacity=K.setOpacity.bind(K),K.fillColor=X.defaultHighlightColor,K.strokeWidth=0,K.opacity=X.defaultHighlightOpacity,K.fillPanel=new Fe("Color",X.defaultColorSet,K.fillColor),K.fillPanel.onColorChanged=K.setFillColor,K.opacityPanel=new oe("Opacity",X.defaultOpacitySteps,K.opacity),K.opacityPanel.onOpacityChanged=K.setOpacity,K}return Oe(h,z),h.prototype.setOpacity=function(b){this.opacity=b,this.visual&&de.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(h.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),h.prototype.getState=function(){var b=z.prototype.getState.call(this);return b.typeName=h.typeName,b},h.typeName="HighlightMarker",h.title="Highlight marker",h.icon='',h}(ne),ve='',Ne=function(z){function h(b,H,X){var K=z.call(this,b,H,X)||this;return K.bgColor="transparent",K.tipPosition={x:0,y:0},K.tipBase1Position={x:0,y:0},K.tipBase2Position={x:0,y:0},K.tipMoving=!1,K.color=X.defaultStrokeColor,K.bgColor=X.defaultFillColor,K.fontFamily=X.defaultFontFamily,K.defaultSize={x:100,y:30},K.setBgColor=K.setBgColor.bind(K),K.getTipPoints=K.getTipPoints.bind(K),K.positionTip=K.positionTip.bind(K),K.setTipPoints=K.setTipPoints.bind(K),K.colorPanel=new Fe("Text color",X.defaultColorSet,K.color,''),K.colorPanel.onColorChanged=K.setColor,K.bgColorPanel=new Fe("Fill color",X.defaultColorSet,K.bgColor,ve),K.bgColorPanel.onColorChanged=K.setBgColor,K.fontFamilyPanel=new je("Font",X.defaultFontFamilies,X.defaultFontFamily),K.fontFamilyPanel.onFontChanged=K.setFont,K.tipGrip=new Ze,K.tipGrip.visual.transform.baseVal.appendItem(de.createTransform()),K.controlBox.appendChild(K.tipGrip.visual),K}return Oe(h,z),h.prototype.ownsTarget=function(b){return z.prototype.ownsTarget.call(this,b)||this.tipGrip.ownsTarget(b)||this.tip===b},h.prototype.createTip=function(){de.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=de.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},h.prototype.pointerDown=function(b,H){this.state==="new"&&z.prototype.pointerDown.call(this,b,H),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(H)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):z.prototype.pointerDown.call(this,b,H)},h.prototype.pointerUp=function(b){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,z.prototype.pointerUp.call(this,b);else{var H=this.state==="creating";z.prototype.pointerUp.call(this,b),this.setTipPoints(H),this.positionTip()}},h.prototype.manipulate=function(b){if(this.tipMoving){var H=this.unrotatePoint(b);this.tipPosition={x:H.x-this.manipulationStartLeft,y:H.y-this.manipulationStartTop},this.positionTip()}else z.prototype.manipulate.call(this,b)},h.prototype.setBgColor=function(b){this.bgRectangle&&this.tip&&(de.setAttributes(this.bgRectangle,[["fill",b]]),de.setAttributes(this.tip,[["fill",b]])),this.bgColor=b,this.fillColorChanged(b)},h.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},h.prototype.setTipPoints=function(b){b===void 0&&(b=!1);var H=Math.min(this.height/2,15),X=this.height/5;b&&(this.tipPosition={x:H+X/2,y:this.height+20});var K=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?K',h}(Ve),Le=function(z){function h(b,H,X){var K=z.call(this,b,H,X)||this;return K.fillColor="transparent",K.strokeColor="transparent",K.strokeWidth=0,K.strokeDasharray="",K.opacity=1,K.strokeColor=X.defaultColor,K.strokeWidth=X.defaultStrokeWidth,K.strokeDasharray=X.defaultStrokeDasharray,K.fillColor=X.defaultFillColor,K.setStrokeColor=K.setStrokeColor.bind(K),K.setFillColor=K.setFillColor.bind(K),K.setStrokeWidth=K.setStrokeWidth.bind(K),K.setStrokeDasharray=K.setStrokeDasharray.bind(K),K.setOpacity=K.setOpacity.bind(K),K.createVisual=K.createVisual.bind(K),K.strokePanel=new Fe("Line color",pe(X.defaultColorSet,["transparent"]),X.defaultColor),K.strokePanel.onColorChanged=K.setStrokeColor,K.fillPanel=new Fe("Fill color",pe(X.defaultColorSet,["transparent"]),K.fillColor,ve),K.fillPanel.onColorChanged=K.setFillColor,K.strokeWidthPanel=new st("Line width",X.defaultStrokeWidths,X.defaultStrokeWidth),K.strokeWidthPanel.onWidthChanged=K.setStrokeWidth,K.strokeStylePanel=new Je("Line style",X.defaultStrokeDasharrays,X.defaultStrokeDasharray),K.strokeStylePanel.onStyleChanged=K.setStrokeDasharray,K.opacityPanel=new oe("Opacity",X.defaultOpacitySteps,K.opacity),K.opacityPanel.onOpacityChanged=K.setOpacity,K}return Oe(h,z),h.prototype.ownsTarget=function(b){return!(!z.prototype.ownsTarget.call(this,b)&&b!==this.visual)},h.prototype.createVisual=function(){this.visual=de.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)},h.prototype.pointerDown=function(b,H){z.prototype.pointerDown.call(this,b,H),this.state==="new"&&(this.createVisual(),this.moveVisual(b),this._state="creating")},h.prototype.manipulate=function(b){z.prototype.manipulate.call(this,b)},h.prototype.resize=function(b){z.prototype.resize.call(this,b),this.setSize()},h.prototype.setSize=function(){z.prototype.setSize.call(this),de.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},h.prototype.pointerUp=function(b){z.prototype.pointerUp.call(this,b),this.setSize()},h.prototype.setStrokeColor=function(b){this.strokeColor=b,this.visual&&de.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(b),this.stateChanged()},h.prototype.setFillColor=function(b){this.fillColor=b,this.visual&&de.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(b),this.stateChanged()},h.prototype.setStrokeWidth=function(b){this.strokeWidth=b,this.visual&&de.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},h.prototype.setStrokeDasharray=function(b){this.strokeDasharray=b,this.visual&&de.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},h.prototype.setOpacity=function(b){this.opacity=b,this.visual&&de.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(h.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),h.prototype.getState=function(){var b=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},z.prototype.getState.call(this));return b.typeName=h.typeName,b},h.prototype.restoreState=function(b){var H=b;this.fillColor=H.fillColor,this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.opacity=H.opacity,this.createVisual(),z.prototype.restoreState.call(this,b),this.setSize()},h.prototype.scale=function(b,H){z.prototype.scale.call(this,b,H),this.setSize()},h.typeName="EllipseMarker",h.title="Ellipse marker",h.icon='',h}(rt),ze=function(z){function h(b,H,X){return z.call(this,b,H,X)||this}return Oe(h,z),Object.defineProperty(h.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),h.prototype.ownsTarget=function(b){return!(!z.prototype.ownsTarget.call(this,b)&&b!==this.tip1&&b!==this.tip2)},h.prototype.createTips=function(){this.tip1=de.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(de.createTransform()),this.visual.appendChild(this.tip1),this.tip2=de.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(de.createTransform()),this.visual.appendChild(this.tip2)},h.prototype.pointerDown=function(b,H){z.prototype.pointerDown.call(this,b,H),this.state==="creating"&&this.createTips()},h.prototype.adjustVisual=function(){if(z.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(de.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()]]),de.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 b=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),H=this.tip1.transform.baseVal.getItem(0);H.setRotate(b,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(H,0);var X=this.tip2.transform.baseVal.getItem(0);X.setRotate(b+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(X,0)}},Object.defineProperty(h.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),h.prototype.getState=function(){var b=z.prototype.getState.call(this);return b.typeName=h.typeName,b},h.prototype.restoreState=function(b){z.prototype.restoreState.call(this,b),this.createTips(),this.adjustVisual()},h.typeName="MeasurementMarker",h.title="Measurement marker",h.icon='',h}(ut),it=function(z){function h(b,H,X){var K=z.call(this,b,H,X)||this;return K.strokePanel.colors=X.defaultColorSet,K.fillColor="transparent",K}return Oe(h,z),Object.defineProperty(h.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),h.prototype.getState=function(){var b=z.prototype.getState.call(this);return b.typeName=h.typeName,b},h.typeName="EllipseFrameMarker",h.title="Ellipse frame marker",h.icon='',h}(Le),ct=function(){function z(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(z.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),z.prototype.addUndoStep=function(h){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(h)||(this.undoStack.push(h),JSON.stringify(this.lastRedoStep)!==JSON.stringify(h)&&this.redoStack.splice(0,this.redoStack.length))},z.prototype.replaceLastUndoStep=function(h){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=h)},z.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},z.prototype.undo=function(){if(this.undoStack.length>1){var h=this.undoStack.pop();return h!==void 0&&this.redoStack.push(h),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},z.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},z}(),dt=function(z){function h(b,H,X){var K=z.call(this,b,H,X)||this;return K.strokeColor="transparent",K.strokeWidth=0,K.strokeDasharray="",K.curveX=0,K.curveY=0,K.manipulationStartCurveX=0,K.manipulationStartCurveY=0,K.setStrokeColor=K.setStrokeColor.bind(K),K.setStrokeWidth=K.setStrokeWidth.bind(K),K.setStrokeDasharray=K.setStrokeDasharray.bind(K),K.positionGrips=K.positionGrips.bind(K),K.addControlGrips=K.addControlGrips.bind(K),K.adjustVisual=K.adjustVisual.bind(K),K.setupControlBox=K.setupControlBox.bind(K),K.resize=K.resize.bind(K),K.strokeColor=X.defaultColor,K.strokeWidth=X.defaultStrokeWidth,K.strokeDasharray=X.defaultStrokeDasharray,K.strokePanel=new Fe("Line color",X.defaultColorSet,X.defaultColor),K.strokePanel.onColorChanged=K.setStrokeColor,K.strokeWidthPanel=new st("Line width",X.defaultStrokeWidths,X.defaultStrokeWidth),K.strokeWidthPanel.onWidthChanged=K.setStrokeWidth,K.strokeStylePanel=new Je("Line style",X.defaultStrokeDasharrays,X.defaultStrokeDasharray),K.strokeStylePanel.onStyleChanged=K.setStrokeDasharray,K}return Oe(h,z),h.prototype.ownsTarget=function(b){return!(!z.prototype.ownsTarget.call(this,b)&&b!==this.visual&&b!==this.selectorCurve&&b!==this.visibleCurve&&!this.curveGrip.ownsTarget(b))},h.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},h.prototype.createVisual=function(){this.visual=de.createGroup(),this.selectorCurve=de.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=de.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)},h.prototype.pointerDown=function(b,H){z.prototype.pointerDown.call(this,b,H),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=b.x,this.curveY=b.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(H)&&(this.activeGrip=this.curveGrip,this._state="resize")},h.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),de.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),de.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),de.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},h.prototype.setupControlBox=function(){z.prototype.setupControlBox.call(this),this.curveControlLine1=de.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=de.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)},h.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,z.prototype.addControlGrips.call(this)},h.prototype.positionGrips=function(){z.prototype.positionGrips.call(this);var b=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-b/2,this.curveY-b/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()))},h.prototype.manipulate=function(b){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+b.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+b.y-this.manipulationStartY),z.prototype.manipulate.call(this,b)},h.prototype.resize=function(b){this.activeGrip===this.curveGrip&&(this.curveX=b.x,this.curveY=b.y),z.prototype.resize.call(this,b),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},h.prototype.setStrokeColor=function(b){this.strokeColor=b,this.adjustVisual(),this.colorChanged(b)},h.prototype.setStrokeWidth=function(b){this.strokeWidth=b,this.adjustVisual()},h.prototype.setStrokeDasharray=function(b){this.strokeDasharray=b,this.adjustVisual()},h.prototype.scale=function(b,H){this.curveX=this.curveX*b,this.curveY=this.curveY*H,z.prototype.scale.call(this,b,H)},Object.defineProperty(h.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),h.prototype.getState=function(){var b=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},z.prototype.getState.call(this));return b.typeName=h.typeName,b},h.prototype.restoreState=function(b){z.prototype.restoreState.call(this,b);var H=b;this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.curveX=H.curveX,this.curveY=H.curveY,this.createVisual(),this.adjustVisual()},h.typeName="CurveMarker",h.title="Curve marker",h.icon='',h}($e),Dt=function(){function z(h,b){b===void 0&&(b=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=h,this.cancelable=b}return Object.defineProperty(z.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),z.prototype.preventDefault=function(){this._defaultPrevented=!0},z}(),At=function(z){function h(b,H,X){var K=z.call(this,b,!1)||this;return K.dataUrl=H,K.state=X,K}return Oe(h,z),h}(Dt),pt=function(z){function h(b,H,X){X===void 0&&(X=!1);var K=z.call(this,b,X)||this;return K.marker=H,K}return Oe(h,z),h}(Dt),jt=function(){function z(){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 z.prototype.addEventListener=function(h,b){this[h].push(b)},z.prototype.removeEventListener=function(h,b){var H=this[h].indexOf(b);H>-1&&this[h].splice(H,1)},z}(),Et=function(){function z(h){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Me,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 jt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=z.instanceCounter++,this.styles=new Ae(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=h,this.targetRoot=document.body,this.width=h.clientWidth,this.height=h.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(z.prototype,"ALL_MARKER_TYPES",{get:function(){return[Qe,Se,Ce,Ve,it,Le,ce,Ne,ze,ne,ut,dt]},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Qe,Se,Ce,Ve,Le,ce,Ne]},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Qe,Se,Ce,Ve,ce]},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(h){var b=this;this._availableMarkerTypes.splice(0),h.forEach(function(H){if(typeof H=="string"){var X=b.ALL_MARKER_TYPES.find(function(K){return K.typeName===H});X!==void 0&&b._availableMarkerTypes.push(X)}else b._availableMarkerTypes.push(H)})},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(h){this._zoomLevel=h,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(z.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),z.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},z.prototype.show=function(){var h=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(b){return b(new Dt(h))})},z.prototype.render=function(){return Re(this,void 0,void 0,function(){var h;return Ee(this,function(b){switch(b.label){case 0:return this.setCurrentMarker(),(h=new he).naturalSize=this.renderAtNaturalSize,h.imageType=this.renderImageType,h.imageQuality=this.renderImageQuality,h.markersOnly=this.renderMarkersOnly,h.width=this.renderWidth,h.height=this.renderHeight,[4,h.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return b.sent(),[4,h.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,b.sent()]}})})},z.prototype.close=function(h){var b=this;if(h===void 0&&(h=!1),this.isOpen){var H=!1;h||this.eventListeners.beforeclose.forEach(function(X){var K=new Dt(b,!0);X(K),K.defaultPrevented&&(H=!0)}),H||(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(X){return X(new Dt(b))}),this.detachEvents(),this._isOpen=!1)}},z.prototype.addMarkersToToolbar=function(){for(var h,b=[],H=0;Hthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*h:this.editorCanvas.clientWidth,H=b',h.title="Powered by marker.js",h.style.display="grid",h.style.alignItems="center",h.style.justifyItems="center",h.style.padding="3px",h.style.width="20px",h.style.height="20px",this.logoUI.appendChild(h),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},z.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")},z.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"},z.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},z.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 h=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=h+"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 ge(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(h),1),h.dispose()},z.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())},z.prototype.toolbarButtonClicked=function(h,b){if(h==="marker"&&b!==void 0)this.createNewMarker(b);else if(h==="action")switch(b){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()}},z.prototype.deleteSelectedMarker=function(){var h=this;if(this._currentMarker!==void 0){var b=!1;if(this.eventListeners.markerbeforedelete.forEach(function(X){var K=new pt(h,h._currentMarker,!0);X(K),K.defaultPrevented&&(b=!0)}),!b){var H=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(X){return X(new pt(h,H))})}}},z.prototype.clear=function(){var h=this,b=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(xe){var Ge=new pt(h,void 0,!0);xe(Ge),Ge.defaultPrevented&&(b=!0)}),!b)){this.setCurrentMarker();for(var H=function(xe){var Ge=X.markers[xe];X.setCurrentMarker(X.markers[xe]),X._currentMarker.dispose(),X.markerImage.removeChild(X._currentMarker.container),X.markers.splice(X.markers.indexOf(X._currentMarker),1),X.eventListeners.markerdelete.forEach(function(nt){return nt(new pt(h,Ge))})},X=this,K=this.markers.length-1;K>=0;K--)H(K);this.addUndoStep()}},Object.defineProperty(z.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),z.prototype.showNotesEditor=function(){var h;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=(h=this._currentMarker.notes)!==null&&h!==void 0?h:"",this.overlayContainer.appendChild(this.notesArea))},z.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)},z.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},z.prototype.addUndoStep=function(){var h=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var b=this.getState(),H=this.undoRedoManager.getLastUndoStep();if(!H||H.width===b.width&&H.height===b.height){var X=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(b),X1&&this.panTo({x:h.clientX,y:h.clientY}))},z.prototype.onPointerUp=function(h){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(h.clientX,h.clientY)),this.isDragging=!1,this.addUndoStep()},z.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},z.prototype.onKeyUp=function(h){this._currentMarker===void 0||this.notesArea!==void 0||h.key!=="Delete"&&h.key!=="Backspace"||this.deleteSelectedMarker()},z.prototype.clientToLocalCoordinates=function(h,b){var H=this.markerImage.getBoundingClientRect();return{x:(h-H.left)/this.zoomLevel,y:(b-H.top)/this.zoomLevel}},z.prototype.onWindowResize=function(){this.positionUI()},z.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var h=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=h+"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()},z.prototype.addLicenseKey=function(h){re.addKey(h)},z.prototype.addEventListener=function(h,b){this.eventListeners.addEventListener(h,b)},z.prototype.removeEventListener=function(h,b){this.eventListeners.removeEventListener(h,b)},z.prototype.renderState=function(h){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(h),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(z.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),z.prototype.focus=function(){var h=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(b){return b(new Dt(h))}))},z.prototype.blur=function(){var h=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(b){return b(new Dt(h))}))},z.instanceCounter=0,z}();/* **********************************
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 Rt=function(z,h){return(Rt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,H){b.__proto__=H}||function(b,H){for(var X in H)Object.prototype.hasOwnProperty.call(H,X)&&(b[X]=H[X])})(z,h)};function Ot(z,h){if(typeof h!="function"&&h!==null)throw new TypeError("Class extends value "+String(h)+" is not a constructor or null");function b(){this.constructor=z}Rt(z,h),z.prototype=h===null?Object.create(h):(b.prototype=h.prototype,new b)}function tt(z,h,b,H){return new(b||(b=Promise))(function(X,K){function xe(gt){try{nt(H.next(gt))}catch(Ke){K(Ke)}}function Ge(gt){try{nt(H.throw(gt))}catch(Ke){K(Ke)}}function nt(gt){var Ke;gt.done?X(gt.value):(Ke=gt.value,Ke instanceof b?Ke:new b(function(kt){kt(Ke)})).then(xe,Ge)}nt((H=H.apply(z,h||[])).next())})}function Tr(z,h){var b,H,X,K,xe={label:0,sent:function(){if(1&X[0])throw X[1];return X[1]},trys:[],ops:[]};return K={next:Ge(0),throw:Ge(1),return:Ge(2)},typeof Symbol=="function"&&(K[Symbol.iterator]=function(){return this}),K;function Ge(nt){return function(gt){return function(Ke){if(b)throw new TypeError("Generator is already executing.");for(;xe;)try{if(b=1,H&&(X=2&Ke[0]?H.return:Ke[0]?H.throw||((X=H.return)&&X.call(H),0):H.next)&&!(X=X.call(H,Ke[1])).done)return X;switch(H=0,X&&(Ke=[2&Ke[0],X.value]),Ke[0]){case 0:case 1:X=Ke;break;case 4:return xe.label++,{value:Ke[1],done:!1};case 5:xe.label++,H=Ke[1],Ke=[0];continue;case 7:Ke=xe.ops.pop(),xe.trys.pop();continue;default:if(!(X=xe.trys,(X=X.length>0&&X[X.length-1])||Ke[0]!==6&&Ke[0]!==2)){xe=0;continue}if(Ke[0]===3&&(!X||Ke[1]>X[0]&&Ke[1]0&&b>0){var H=new Mr(h,b),X=H.ratio>=1?20:H.getHorizontalLength(20),K=H.ratio<1?20:H.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=St.createDefs();xe.appendChild(Ge);var nt=St.createElement("clipPath",[["id","text-bg-clip"]]);Ge.appendChild(nt);var gt=St.createPath(St.getHollowRectanglePath((24-X)/2,(24-K)/2,X,K,(24-X)/2+2,(24-K)/2+2,X-4,K-4));xe.appendChild(gt);var Ke=St.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ke.appendChild(St.createTSpan(h+":"+b)),xe.appendChild(Ke);var kt=Ke.getBBox();St.setAttributes(Ke,[["x",((24-kt.width)/2).toString()],["y",((24-kt.height)/2-kt.y).toString()]]);var Bt=St.createPath(St.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(kt.width))/2,(24-Math.ceil(kt.height))/2,Math.ceil(kt.width),Math.ceil(kt.height)));return nt.appendChild(Bt),St.setAttributes(gt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(xe),xe.outerHTML}return''},z}(),Ar=function(z){function h(b,H,X){var K=z.call(this,b,H)||this;return K.isDropdownOpen=!1,K.onClick=K.dropdownButtonClicked,K.dropdownButtons=X,K}return Ot(h,z),h.prototype.setupDropdown=function(){var b=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(H){H.className=b.className,H.colorsClassName=b.colorsClassName,b.dropdownBlock.appendChild(H.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},h.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},h.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},h.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},h.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},h.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},h}(Pt),It=function(){function z(h,b){this.GRIP_SIZE=10,this.color=h,this.fillColor=b,this.visual=St.createGroup(),this.visual.appendChild(St.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(St.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return z.prototype.ownsTarget=function(h){return h===this.visual||h===this.visual.childNodes[0]||h===this.visual.childNodes[1]},z.prototype.setCenter=function(h,b){this.visual.childNodes.forEach(function(H){return St.setAttributes(H,[["cx",h.toString()],["cy",b.toString()]])})},z}(),kr=function(){function z(h,b,H,X){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=h,this.canvasHeight=b,this.margin=H,this.container=X,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(z.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(h){this._aspectRatio=h,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(h){this._isGridVisible=h,this.gridContainer&&St.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(h){this._zoomFactor=h,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),z.prototype.open=function(){var h=this;this.cropShadeElement=St.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=St.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var b=0;bthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-b.height/2),St.setAttributes(this.cropRectElement,[["x",b.x.toString()],["y",b.y.toString()],["width",b.width.toString()],["height",b.height.toString()]]);var H=b.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(K,xe){var Ge=b.y+H*(xe+1);St.setAttributes(K,[["x1",""+b.x],["y1",""+Ge],["x2",""+(b.x+b.width)],["y2",""+Ge]])});var X=b.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(K,xe){var Ge=b.x+X*(xe+1);St.setAttributes(K,[["x1",""+Ge],["y1",""+b.y],["x2",""+Ge],["y2",""+(b.y+b.height)]])}),St.setAttributes(this.cropShadeElement,[["d",St.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,b.x,b.y,b.width,b.height)]]),this.topLeftGrip.setCenter(b.x,b.y),this.topRightGrip.setCenter(b.x+b.width,b.y),this.bottomLeftGrip.setCenter(b.x,b.y+b.height),this.bottomRightGrip.setCenter(b.x+b.width,b.y+b.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},z.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)},z.prototype.clientToLocalCoordinates=function(h,b){var H=this.container.getBoundingClientRect();return{x:h-H.left+this.margin,y:b-H.top+this.margin}},z.prototype.onPointerDown=function(h){this.container.setPointerCapture(h.pointerId),this.previousPoint=this.clientToLocalCoordinates(h.clientX,h.clientY),this.cropRectElement===h.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(h.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(h.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(h.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(h.target)&&(this.activeGrip=this.bottomRightGrip)},z.prototype.onPointerMove=function(h){if(this.isMoving)this.move(this.clientToLocalCoordinates(h.clientX,h.clientY));else if(this.activeGrip){var b=this.clientToLocalCoordinates(h.clientX,h.clientY);this.resize(b)}h.preventDefault()},z.prototype.onPointerUp=function(h){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(h.pointerId)},z.prototype.move=function(h){var b=h.x-this.previousPoint.x,H=h.y-this.previousPoint.y;this.zoomFactor!==1&&(b=-b/this.zoomFactor,H=-H/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+b),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+H),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=h},z.prototype.resize=function(h){var b=Object.assign({},this.cropRect),H=h.x-this.previousPoint.x,X=h.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:b.x+Hthis.canvasWidth*this.zoomFactor&&(H=this.canvasWidth*this.zoomFactor-b.width),b.width+=H}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(b.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(H),b.height=this.aspectRatio.getVerticalLength(b.width)):(b.y+=X,b.height=this.cropRect.y+this.cropRect.height-b.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?b.height=this.aspectRatio.getVerticalLength(b.width):b.height+=X}b.width<10&&(b.x=this.cropRect.x,b.width=10),b.height<10&&(b.y=this.cropRect.y,b.height=10),this.previousPoint=h,b.x>=this.margin&&b.y>=this.margin&&b.x-this.margin+b.width<=this.canvasWidth&&b.y-this.margin+b.height<=this.canvasHeight&&(this.cropRect=b,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},z.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var h=this.cropRect.x+this.cropRect.width/2,b=this.cropRect.y+this.cropRect.height/2,H=this.aspectRatio.getHorizontalLength(this.cropRect.height),X=this.aspectRatio.getVerticalLength(this.cropRect.width);H/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=h-this.cropRect.width/2,this.cropRect.y=b-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)}},z.prototype.getRescaledRect=function(h,b,H,X,K,xe){var Ge=H/h,nt=X/b;return{x:(K.x-xe)*Ge+xe,y:(K.y-xe)*nt+xe,width:K.width*Ge,height:K.height*nt}},z.prototype.scaleCanvas=function(h,b){var H=this.getRescaledRect(this.canvasWidth,this.canvasHeight,h,b,this.cropRect,this.margin);this.canvasWidth=h,this.canvasHeight=b,this.onCropChange&&this.onCropChange(H),this.setCropRectangle(H)},z}(),Kr=function(){function z(h){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=h,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(z.prototype,"angle",{get:function(){return this._angle},set:function(h){this._angle=h,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),z.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},z.prototype.onPointerDown=function(h){this.controlContainer.setPointerCapture(h.pointerId),this.isDragging=!0,this.previousPoint={x:h.clientX,y:h.clientY}},z.prototype.onPointerMove=function(h){this.isDragging&&(this.onAngleChange&&this.onAngleChange((h.clientX-this.previousPoint.x)/5),this.previousPoint.x=h.clientX)},z.prototype.onPointerUp=function(h){this.isDragging&&this.onAngleChange&&this.onAngleChange((h.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(h.pointerId)},z.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var h=this.angleLabelText.getBBox();St.setAttributes(this.angleLabelElement,[["x",((this.width-h.width)/2).toString()],["y",(this.height/2).toString()]])}},z.prototype.positionScaleShape=function(){if(this.scaleShape){var h=this.scaleShape.transform.baseVal.getItem(0);h.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(h,0)}},z.prototype.getVisual=function(){var h=document.createElementNS("http://www.w3.org/2000/svg","svg");h.setAttribute("xmlns","http://www.w3.org/2000/svg"),h.setAttribute("width",this.width+"px"),h.setAttribute("height",this.height+"px"),h.setAttribute("viewBox","0 0 "+this.width+" "+this.height),h.style.flexShrink="0",document.body.appendChild(h);for(var b="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,H=1;H<=this.width/5+10;H++){var X=H%5==0?this.height/3:this.height/6;b+="h4v"+-X+"h1v"+X}b+="v1H0Z",this.scaleShape=St.createPath(b);var K=St.createTransform();this.scaleShape.transform.baseVal.appendItem(K),h.appendChild(this.scaleShape),this.angleLabelElement=St.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=St.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var xe=St.createTSpan("");return xe.innerHTML="°",this.angleLabelElement.appendChild(xe),h.appendChild(this.angleLabelElement),document.body.removeChild(h),h},z}(),rn=function(){function z(){this.naturalSize=!1,this.imageType="image/png"}return z.prototype.rasterize=function(h,b,H,X,K,xe,Ge){var nt=this;return new Promise(function(gt){var Ke=document.createElement("canvas");Ke.width=h.width.baseVal.value-2*X,Ke.height=h.height.baseVal.value-2*X;var kt=1,Bt=1;nt.naturalSize===!0?(kt=b.naturalWidth/(h.width.baseVal.value-2*X)/xe,Bt=b.naturalHeight/(h.height.baseVal.value-2*X)/Ge,Ke.width=b.naturalWidth/xe,Ke.height=b.naturalHeight/Ge):nt.width!==void 0&&nt.height!==void 0&&(kt=nt.width/H.width,Bt=nt.height/H.height,Ke.width*=kt,Ke.height*=Bt);var tr=Ke.getContext("2d");tr.translate(Ke.width/2,Ke.height/2),tr.rotate(K*Math.PI/180),tr.scale(xe,Ge),tr.translate(-Ke.width/2,-Ke.height/2),tr.drawImage(b,0,0,Ke.width,Ke.height);var Vr=document.createElement("canvas");Vr.width=H.width*kt,Vr.height=H.height*Bt,Vr.getContext("2d").putImageData(tr.getImageData((H.x-X)*kt,(H.y-X)*Bt,H.width*kt,H.height*Bt),0,0),gt(Vr.toDataURL(nt.imageType,nt.imageQuality))})},z}(),He=function(){function z(h){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=z.instanceCounter++,this.styles=new mt(this.instanceNo),this.target=h,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(z.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(h){this._zoomToCropEnabled=h,h?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(h){this._isGridVisible=h,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"gridLines",{get:function(){return this._gridLines},set:function(h){this._gridLines=h,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(h){this._rotationAngle=h,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"aspectRatio",{get:function(){var h;return(h=this._aspectRatio)!==null&&h!==void 0?h:this.aspectRatios[0]},set:function(h){this._aspectRatio=h},enumerable:!1,configurable:!0}),z.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},z.prototype.show=function(){this.showUI(),this.open()},z.prototype.close=function(h){h===void 0&&(h=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),h||this.closeEventListeners.forEach(function(b){return b()}),this._isOpen=!1)},z.prototype.addRenderEventListener=function(h){this.renderEventListeners.push(h)},z.prototype.removeRenderEventListener=function(h){this.renderEventListeners.indexOf(h)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(h),1)},z.prototype.addCloseEventListener=function(h){this.closeEventListeners.push(h)},z.prototype.removeCloseEventListener=function(h){this.closeEventListeners.indexOf(h)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(h),1)},z.prototype.setupResizeObserver=function(){var h=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){h.resize(h.target.clientWidth,h.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))},z.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var h=1*this.target.clientWidth/this.target.clientHeight,b=this.contentDiv.clientWidth/h>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*h:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,H=b+2*this.CANVAS_MARGINh+this.CANVAS_MARGIN?this.target.offsetTop-(h+this.CANVAS_MARGIN):0;this.coverDiv.style.top=b+"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},z.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},z.prototype.addTopToolbar=function(){var h=this;this.topToolbar=new $t,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 b=new nr;b.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(b);var H=[];this.aspectRatios.forEach(function(Bt){var tr=new Pt(tn.getIcon(Bt.horizontal,Bt.vertical),Bt.horizontal===0&&Bt.vertical===0?"FREE":Bt.horizontal+":"+Bt.vertical);tr.onClick=function(){return h.ratioButtonClicked(Bt)},H.push(tr)}),this.aspectRatioButton=new Ar(tn.getIcon(0,0),"Aspect ratio",H),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,b.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var X=new Pt('',"Toggle grid");X.isActive=this.isGridVisible,X.onClick=function(){h.isGridVisible=!h.isGridVisible,X.isActive=h.isGridVisible},b.addButton(X);var K=new Pt('',"Zoom to selection");if(K.isActive=this.zoomToCropEnabled,K.onClick=function(){h.zoomToCropEnabled=!h.zoomToCropEnabled,K.isActive=h.zoomToCropEnabled},b.addButton(K),!wr.isLicensed){var xe=new yt;this.topToolbar.addElementBlock(xe);var Ge=document.createElement("div");Ge.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var nt=document.createElement("a");nt.style.color="currentColor",nt.href="https://markerjs.com/products/cropro",nt.target="_blank",nt.innerHTML='',Ge.appendChild(nt),xe.addElement(Ge)}var gt=new nr;gt.minWidth=3*this.toolbarHeight+"px",gt.contentAlign="end",this.topToolbar.addButtonBlock(gt);var Ke=new Pt('',"OK");Ke.onClick=this.startRenderAndClose,gt.addButton(Ke),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ke.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var kt=new Pt('',"Close");kt.onClick=this.close,gt.addButton(kt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(kt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},z.prototype.addBottomToolbar=function(){var h=this;this.bottomToolbar=new $t,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 b=new nr;b.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(b);var H=new Pt('',"Rotate left");H.onClick=this.rotateLeftButtonClicked,b.addButton(H);var X=new Pt('',"Rotate right");X.onClick=this.rotateRightButtonClicked,b.addButton(X);var K=new yt;K.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(K),this.straightener=new Kr("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(gt){h.rotateBy(gt),h.straightener.angle=h.rotationAngle},K.addElement(this.straightener.getUI());var xe=new nr;xe.minWidth=2*this.toolbarHeight+"px",xe.contentAlign="end",this.bottomToolbar.addButtonBlock(xe);var Ge=new Pt('',"Flip horizontal");Ge.onClick=this.flipHorizontallyButtonClicked,xe.addButton(Ge);var nt=new Pt('',"Flip vertical");nt.onClick=this.flipVerticallyButtonClicked,xe.addButton(nt)},z.prototype.ratioButtonClicked=function(h){this.aspectRatio=h,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},z.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=tn.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},z.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Mr(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},z.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},z.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},z.prototype.restoreState=function(h){if(h){var b=this.cropLayer.getRescaledRect(h.width,h.height,this.imageWidth,this.imageHeight,h.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(b),this.cropRectChanged(b),this.flippedHorizontally=h.flippedHorizontally,this.flippedVertically=h.flippedVertically,this.applyFlip(),this.rotationAngle=h.rotationAngle,this.applyRotation()}},z.prototype.clientToLocalCoordinates=function(h,b){var H=this.cropImage.getBoundingClientRect();return{x:h-H.left,y:b-H.top}},z.prototype.onWindowResize=function(){this.positionUI()},z.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var h=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=h+"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()},z.prototype.rotateLeftButtonClicked=function(){var h=this.rotationAngle-90;this.rotationAngle%90!=0&&(h+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(h)},z.prototype.rotateRightButtonClicked=function(){var h=this.rotationAngle+90;this.rotationAngle%90!=0&&(h-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(h)},z.prototype.rotateTo=function(h){h=(h=h>180?h-360:h)<=-180?h+360:h,this.rotationAngle=h,this.applyRotation()},z.prototype.rotateBy=function(h){this.rotateTo((this.rotationAngle+h)%360)},z.prototype.applyRotation=function(){var h=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var b=this.editingTargetRotationContainer.transform.baseVal.getItem(0);b.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(b,0);var H=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/H.width,this.imageHeight/H.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=h},z.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},z.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},z.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},z.prototype.startRenderAndClose=function(){return tt(this,void 0,void 0,function(){var h,b;return Tr(this,function(H){switch(H.label){case 0:return[4,this.render()];case 1:return h=H.sent(),b=this.getState(),this.renderEventListeners.forEach(function(X){return X(h,b)}),this.close(!0),[2]}})})},z.prototype.render=function(){return tt(this,void 0,void 0,function(){var h;return Tr(this,function(b){switch(b.label){case 0:return(h=new rn).naturalSize=this.renderAtNaturalSize,h.imageType=this.renderImageType,h.imageQuality=this.renderImageQuality,h.width=this.renderWidth,h.height=this.renderHeight,this.unzoomFromCrop(),St.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,h.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 b.sent(),[4,h.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,b.sent()]}})})},z.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ct("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 Ct("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ct("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var h=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ct("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*h)+`px;
height: `+(this.toolbarHeight-2*h)+`px;
padding: `+h+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ct("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ct("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 Ct("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 Ct("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Ct("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 Ct("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*h)+`px;
padding: `+h+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Ct("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},z.instanceCounter=0,z}(),ht=q("8hTe"),Nt=q.n(ht),Vt=/]*>/g;function Qt(z){var h=document.createElement("div");return h.innerHTML=z,h.childNodes.length===0?"":h.childNodes[0].nodeValue}var er=De.a=function(z){var h=z.value,b=h===void 0?"":h,H=z.edit,X=H===void 0?!1:H,K=z.className,xe=z.showTextOnly,Ge=z.showLines,nt=z.replaces,gt=z.zoomImg,Ke=z.hasMask,kt=z.style,Bt=kt===void 0?{}:kt,tr=z.stylesPrev,Vr=tr===void 0?{}:tr,Xr=String(b),pr=Object(A.useRef)(),Zr=Object(A.useRef)(),Gn=Object(A.useState)(""),Pr=Object(j.a)(Gn,2),Yr=Pr[0],Wr=Pr[1],bn=Object(A.useState)("office"),nn=Object(j.a)(bn,2),mn=nn[0],dn=nn[1],hi=function(){var Gt=new He(Zr.current);Gt.displayMode="popup",Gt.addRenderEventListener(function(){var Er=Object(M.a)(P.a.mark(function Ht(dr){var Xt;return P.a.wrap(function(lr){for(;;)switch(lr.prev=lr.next){case 0:return pr.current.style.display="none",lr.next=3,Object(Ie.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:dr}});case 3:Xt=lr.sent,Xt!=null&&Xt.id&&nt(Zr.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(Xt==null?void 0:Xt.id,"?type=").concat(Xt.content_type));case 5:case"end":return lr.stop()}},Ht)}));return function(Ht){return Er.apply(this,arguments)}}()),Gt.show()},zn=function(){var Gt=new Et(Zr.current);Gt.settings.displayMode="popup",Gt.addEventListener("render",function(){var Er=Object(M.a)(P.a.mark(function Ht(dr){var Xt;return P.a.wrap(function(lr){for(;;)switch(lr.prev=lr.next){case 0:if(pr.current.style.display="none",!Zr.current){lr.next=6;break}return lr.next=4,Object(Ie.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:dr.dataUrl}});case 4:Xt=lr.sent,Xt!=null&&Xt.id&&nt(Zr.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(Xt==null?void 0:Xt.id,"?type=").concat(Xt.content_type));case 6:case"end":return lr.stop()}},Ht)}));return function(Ht){return Er.apply(this,arguments)}}()),Gt.show(),window.markerArea=Gt},an=Object(A.useMemo)(function(){try{var or=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Gt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Er=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Xr=Xr.replace(or,"("+ee.a.API_SERVER+"/api/attachments/").replace(Gt,'"'+ee.a.API_SERVER+"/api/attachments/").replace(Er,'"'+ee.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`),Xr=Xr.replace(new RegExp("(?[TOC]
",R()),x()),Ht=Ht.replace(/(__special_katext_id_\d+__)/g,function(hn,lr){var Ir=dr[lr],Kn=Ir.type,Vn=Ir.expression;return Object(le.renderToString)(Qt(Vn)||"",{displayMode:Kn==="block",throwOnError:!1,output:"html"})}),Ht=Ht.replace(/▁/g,"\u2581\u2581\u2581"),S(),xe){var Xt=document.createElement("div");return Xt.innerHTML=Ht,Xt.innerText}return setTimeout(function(){return On()},500),Ht},[Xr]),$r=Object(A.useRef)();v.WebkitLineClamp=Ge,Ge&&(Bt=Object(F.a)(Object(F.a)({},Bt),v));function Rn(or){var Gt=or.target;if(Gt.tagName.toUpperCase()==="IMG"){if(gt){var Er=Gt.getAttribute("src");Wr(Er),dn("image")}}else if(Gt.tagName.toUpperCase()==="A"){var Ht=Gt.getAttribute("href");if(Ht.indexOf("office")>-1)or.preventDefault(),Wr(Ht),dn("office");else if(Ht.indexOf("application/pdf")>-1)or.preventDefault(),Wr(Ht),dn("pdf");else if(Ht.indexOf("type=text")>-1)or.preventDefault(),Wr(Ht),dn("html");else if(Ht.startsWith("#")){or.preventDefault();var dr=document.getElementById(Ht.replace("#",""));dr&&dr.scrollIntoView(!0)}}}var On=function(){var Gt,Er=(Gt=$r.current)===null||Gt===void 0?void 0:Gt.querySelectorAll("video");Er==null||Er.forEach(function(Ht){if(Ht.oncontextmenu=function(){return!1},Ht.src.indexOf(".m3u8")>-1&&!Ht.canPlayType("application/vnd.apple.mpegurl")){if(Y.a.isSupported()){var dr=new Y.a;dr.loadSource(Ht.src),dr.attachMedia(Ht)}}})};Object(A.useEffect)(function(){if($r.current&&an&&(an.match(Vt)&&window.PR.prettyPrint()),$r.current)return $r.current.addEventListener("click",Rn),function(){$r.current.removeEventListener("click",Rn),S(),x()}},[an,$r.current,Rn]);var ci=function(Gt){if(!X)return;Gt.target.nodeName==="IMG"?(pr.current.style.display="flex",pr.current.style.width=Gt.target.clientWidth+"px",pr.current.style.height=Gt.target.clientHeight+"px",pr.current.style.top=Gt.target.offsetTop+"px",pr.current.style.left=Gt.target.offsetLeft+"px",Zr.current.src=Gt.target.getAttribute("src")):pr.current.style.display="none"};return d.a.createElement("div",{style:{position:"relative"}},d.a.createElement("div",{ref:$r,style:Object(F.a)({},Bt),className:"".concat(K||""," markdown-body ").concat(Nt.a.mdBody),onMouseOver:ci,dangerouslySetInnerHTML:{__html:an}}),d.a.createElement("div",{ref:pr,className:Nt.a.button},d.a.createElement(J.a,null,d.a.createElement($.a,{onClick:function(){return hi()}},"\u88C1\u526A"),d.a.createElement($.a,{onClick:function(){return zn()}},"\u7F16\u8F91"))),d.a.createElement("img",{ref:Zr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),d.a.createElement(me.a,{close:!0,data:Yr,hasMask:Ke,type:Yr!=null&&Yr.length?mn:"",style:Object(F.a)({},Vr),onClose:function(){return Wr("")}}))}},"9VGf":function(bt,De,q){"use strict";q.d(De,"a",function(){return O});var ue=q("q1tI"),J=q.n(ue);function O($,F){var M=Object(ue.useRef)();Object(ue.useEffect)(function(){M.current=$}),Object(ue.useEffect)(function(){function j(){M.current()}if(F!==null){var U=setInterval(j,F);return function(){return clearInterval(U)}}},[F])}},BU3w:function(bt,De,q){"use strict";q.d(De,"a",function(){return M});var ue=q("MNnm"),J="rc-util-key";function O(j){if(j.attachTo)return j.attachTo;var U=document.querySelector("head");return U||document.body}function $(j){var U,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ue.a)())return null;var A=document.createElement("style");if((U=P.csp)===null||U===void 0?void 0:U.nonce){var d;A.nonce=(d=P.csp)===null||d===void 0?void 0:d.nonce}A.innerHTML=j;var f=O(P),T=f.firstChild;return P.prepend&&f.prepend?f.prepend(A):P.prepend&&T?f.insertBefore(A,T):f.appendChild(A),A}var F=new Map;function M(j,U){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},A=O(P);if(!F.has(A)){var d=$("",P),f=d.parentNode;F.set(A,f),f.removeChild(d)}var T=Array.from(F.get(A).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 g;T.nonce=(g=P.csp)===null||g===void 0?void 0:g.nonce}return T.innerHTML!==j&&(T.innerHTML=j),T}var a=$(j,P);return a[J]=U,a}},Bd2K:function(bt,De,q){(function(ue){ue(q("VrN/"),q("osHv"))})(function(ue){ue.defineOption("autoCloseTags",!1,function(P,A,d){if(d!=ue.Init&&d&&P.removeKeyMap("autoCloseTags"),!A)return;var f={name:"autoCloseTags"};(typeof A!="object"||A.whenClosing!==!1)&&(f["'/'"]=function(T){return M(T)}),(typeof A!="object"||A.whenOpening!==!1)&&(f["'>'"]=function(T){return $(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 $(P){if(P.getOption("disableInput"))return ue.Pass;for(var A=P.listSelections(),d=[],f=P.getOption("autoCloseTags"),T=0;Tp.ch&&(s=s.slice(0,s.length-m.end+p.ch));var y=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||x&&j(x,y)>-1||U(P,g.mode.xmlCurrentContext&&g.mode.xmlCurrentContext(a)||[],s,p,!0))return ue.Pass;var R=typeof f=="object"&&f.emptyTags;if(R&&j(R,s)>-1){d[T]={text:"/>",newPos:ue.Pos(p.line,p.ch+2)};continue}var w=v&&j(v,y)>-1;d[T]={indent:w,text:">"+(w?`
`:"")+""+s+">",newPos:w?ue.Pos(p.line+1,0):ue.Pos(p.line,p.ch+1)}}for(var E=typeof f=="object"&&f.dontIndentOnAutoClose,T=A.length-1;T>=0;T--){var C=d[T];P.replaceRange(C.text,A[T].head,A[T].anchor,"+insert");var c=P.listSelections().slice(0);c[T]={head:C.newPos,anchor:C.newPos},P.setSelections(c),!E&&C.indent&&(P.indentLine(C.newPos.line,null,!0),P.indentLine(C.newPos.line+1,null,!0))}}function F(P,A){for(var d=P.listSelections(),f=[],T=A?"/":"",p=P.getOption("autoCloseTags"),m=typeof p=="object"&&p.dontIndentOnSlash,g=0;g"&&(x+=">"),f[g]=x}if(P.replaceSelections(f),d=P.listSelections(),!m)for(var g=0;g=0&&A[a]==d;a--)++g;f=m.to;for(var a=1;a0){for(var A=0;A1&&arguments[1]!==void 0?arguments[1]:"",A=[],d=0;dSe.length)&&(be=Se.length);for(var Ce=0,ne=new Array(be);Ce=Se.length?{done:!0}:{done:!1,value:Se[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 Ce=Se[Symbol.iterator](),Ce.next.bind(Ce)}function M(Se,be){return be={exports:{}},Se(be,be.exports),be.exports}var j=M(function(Se){function be(){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 Ce(ne){Se.exports.defaults=ne}Se.exports={defaults:be(),getDefaults:be,changeDefaults:Ce}}),U=j.defaults,P=j.getDefaults,A=j.changeDefaults,d=/[&<>"']/,f=/[&<>"']/g,T=/[<>"']|&(?!#?\w+;)/,p=/[<>"']|&(?!#?\w+;)/g,m={"&":"&","<":"<",">":">",'"':""","'":"'"},g=function(be){return m[be]};function a(Se,be){if(be){if(d.test(Se))return Se.replace(f,g)}else if(T.test(Se))return Se.replace(p,g);return Se}var i=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(Se){return Se.replace(i,function(be,Ce){return Ce=Ce.toLowerCase(),Ce==="colon"?":":Ce.charAt(0)==="#"?Ce.charAt(1)==="x"?String.fromCharCode(parseInt(Ce.substring(2),16)):String.fromCharCode(+Ce.substring(1)):""})}var l=/(^|[^\[])\^/g;function x(Se,be){Se=Se.source||Se,be=be||"";var Ce={replace:function(oe,ce){return ce=ce.source||ce,ce=ce.replace(l,"$1"),Se=Se.replace(oe,ce),Ce},getRegex:function(){return new RegExp(Se,be)}};return Ce}var v=/[^\w:]/g,y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(Se,be,Ce){if(Se){var ne;try{ne=decodeURIComponent(s(Ce)).replace(v,"").toLowerCase()}catch(oe){return null}if(ne.indexOf("javascript:")===0||ne.indexOf("vbscript:")===0||ne.indexOf("data:")===0)return null}be&&!y.test(Ce)&&(Ce=u(be,Ce));try{Ce=encodeURI(Ce).replace(/%25/g,"%")}catch(oe){return null}return Ce}var w={},E=/^[^:]+:\/*[^/]*$/,C=/^([^:]+:)[\s\S]*$/,c=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(Se,be){w[" "+Se]||(E.test(Se)?w[" "+Se]=Se+"/":w[" "+Se]=_(Se,"/",!0)),Se=w[" "+Se];var Ce=Se.indexOf(":")===-1;return be.substring(0,2)==="//"?Ce?be:Se.replace(C,"$1")+be:be.charAt(0)==="/"?Ce?be:Se.replace(c,"$1")+be:Se+be}var L={exec:function(){}};function S(Se){for(var be=1,Ce,ne;be=0&&Ne[ze]==="\\";)Le=!Le;return Le?"|":" |"}),ne=Ce.split(/ \|/),oe=0;if(ne.length>be)ne.splice(be);else for(;ne.length=ne.length?oe.slice(ne.length):oe}).join(`
`)}var Te=function(){function Se(Ce){this.options=Ce||I}var be=Se.prototype;return be.space=function(ne){var oe=this.rules.block.newline.exec(ne);if(oe)return oe[0].length>1?{type:"space",raw:oe[0]}:{raw:`
`}},be.code=function(ne,oe){var ce=this.rules.block.code.exec(ne);if(ce){var ve=oe[oe.length-1];if(ve&&ve.type==="paragraph")return{raw:ce[0],text:ce[0].trimRight()};var Ne=ce[0].replace(/^ {4}/gm,"");return{type:"code",raw:ce[0],codeBlockStyle:"indented",text:this.options.pedantic?Ne:N(Ne,`
`)}}},be.fences=function(ne){var oe=this.rules.block.fences.exec(ne);if(oe){var ce=oe[0],ve=Ie(ce,oe[3]||"");return{type:"code",raw:ce,lang:oe[2]?oe[2].trim():oe[2],text:ve}}},be.heading=function(ne){var oe=this.rules.block.heading.exec(ne);if(oe)return{type:"heading",raw:oe[0],depth:oe[1].length,text:oe[2]}},be.nptable=function(ne){var oe=this.rules.block.nptable.exec(ne);if(oe){var ce={type:"table",header:Y(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(`
`):[],raw:oe[0]};if(ce.header.length===ce.align.length){var ve=ce.align.length,Ne;for(Ne=0;Ne ?/gm,"");return{type:"blockquote",raw:oe[0],text:ce}}},be.list=function(ne){var oe=this.rules.block.list.exec(ne);if(oe){for(var ce=oe[0],ve=oe[2],Ne=ve.length>1,Le=ve[ve.length-1]===")",ze={type:"list",raw:ce,ordered:Ne,start:Ne?+ve.slice(0,-1):"",loose:!1,items:[]},it=oe[0].match(this.rules.block.item),ct=!1,dt,Dt,At,pt,jt,Et,Rt,Ot=it.length,tt=0;tt1||this.options.smartLists&&At!==ve)&&(pt=it.slice(tt+1).join(`
`),ze.raw=ze.raw.substring(0,ze.raw.length-pt.length),tt=Ot-1)),jt=ct||/\n\n(?!\s*$)/.test(dt),tt!==Ot-1&&(ct=dt.charAt(dt.length-1)===`
`,jt||(jt=ct)),jt&&(ze.loose=!0),Et=/^\[[ xX]\] /.test(dt),Rt=void 0,Et&&(Rt=dt[1]!==" ",dt=dt.replace(/^\[[ xX]\] +/,"")),ze.items.push({type:"list_item",raw:ce,task:Et,checked:Rt,loose:jt,text:dt});return ze}},be.html=function(ne){var oe=this.rules.block.html.exec(ne);if(oe)return{type:this.options.sanitize?"paragraph":"html",raw:oe[0],pre:!this.options.sanitizer&&(oe[1]==="pre"||oe[1]==="script"||oe[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):ee(oe[0]):oe[0]}},be.def=function(ne){var oe=this.rules.block.def.exec(ne);if(oe){oe[3]&&(oe[3]=oe[3].substring(1,oe[3].length-1));var ce=oe[1].toLowerCase().replace(/\s+/g," ");return{tag:ce,raw:oe[0],href:oe[2],title:oe[3]}}},be.table=function(ne){var oe=this.rules.block.table.exec(ne);if(oe){var ce={type:"table",header:Y(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(`
`):[]};if(ce.header.length===ce.align.length){ce.raw=oe[0];var ve=ce.align.length,Ne;for(Ne=0;Ne/i.test(ve[0])&&(oe=!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:oe,inRawBlock:ce,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ve[0]):ee(ve[0]):ve[0]}},be.link=function(ne){var oe=this.rules.inline.link.exec(ne);if(oe){var ce=le(oe[2],"()");if(ce>-1){var ve=oe[0].indexOf("!")===0?5:4,Ne=ve+oe[1].length+ce;oe[2]=oe[2].substring(0,ce),oe[0]=oe[0].substring(0,Ne).trim(),oe[3]=""}var Le=oe[2],ze="";if(this.options.pedantic){var it=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Le);it?(Le=it[1],ze=it[3]):ze=""}else ze=oe[3]?oe[3].slice(1,-1):"";Le=Le.trim().replace(/^<([\s\S]*)>$/,"$1");var ct=me(oe,{href:Le&&Le.replace(this.rules.inline._escapes,"$1"),title:ze&&ze.replace(this.rules.inline._escapes,"$1")},oe[0]);return ct}},be.reflink=function(ne,oe){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=oe[ve.toLowerCase()],!ve||!ve.href){var Ne=ce[0].charAt(0);return{type:"text",raw:Ne,text:Ne}}var Le=me(ce,ve,ce[0]);return Le}},be.strong=function(ne,oe,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)))){oe=oe.slice(-1*ne.length);var Ne=ve[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ne.lastIndex=0;for(var Le;(ve=Ne.exec(oe))!=null;)if(Le=this.rules.inline.strong.middle.exec(oe.slice(0,ve.index+3)),Le)return{type:"strong",raw:ne.slice(0,Le[0].length),text:ne.slice(2,Le[0].length-2)}}},be.em=function(ne,oe,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)))){oe=oe.slice(-1*ne.length);var Ne=ve[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ne.lastIndex=0;for(var Le;(ve=Ne.exec(oe))!=null;)if(Le=this.rules.inline.em.middle.exec(oe.slice(0,ve.index+2)),Le)return{type:"em",raw:ne.slice(0,Le[0].length),text:ne.slice(1,Le[0].length-1)}}},be.codespan=function(ne){var oe=this.rules.inline.code.exec(ne);if(oe){var ce=oe[2].replace(/\n/g," "),ve=/[^ ]/.test(ce),Ne=ce.startsWith(" ")&&ce.endsWith(" ");return ve&&Ne&&(ce=ce.substring(1,ce.length-1)),ce=ee(ce,!0),{type:"codespan",raw:oe[0],text:ce}}},be.br=function(ne){var oe=this.rules.inline.br.exec(ne);if(oe)return{type:"br",raw:oe[0]}},be.del=function(ne){var oe=this.rules.inline.del.exec(ne);if(oe)return{type:"del",raw:oe[0],text:oe[1]}},be.autolink=function(ne,oe){var ce=this.rules.inline.autolink.exec(ne);if(ce){var ve,Ne;return ce[2]==="@"?(ve=ee(this.options.mangle?oe(ce[1]):ce[1]),Ne="mailto:"+ve):(ve=ee(ce[1]),Ne=ve),{type:"link",raw:ce[0],text:ve,href:Ne,tokens:[{type:"text",raw:ve,text:ve}]}}},be.url=function(ne,oe){var ce;if(ce=this.rules.inline.url.exec(ne)){var ve,Ne;if(ce[2]==="@")ve=ee(this.options.mangle?oe(ce[0]):ce[0]),Ne="mailto:"+ve;else{var Le;do Le=ce[0],ce[0]=this.rules.inline._backpedal.exec(ce[0])[0];while(Le!==ce[0]);ve=ee(ce[0]),ce[1]==="www."?Ne="http://"+ve:Ne=ve}return{type:"link",raw:ce[0],text:ve,href:Ne,tokens:[{type:"text",raw:ve,text:ve}]}}},be.inlineText=function(ne,oe,ce){var ve=this.rules.inline.text.exec(ne);if(ve){var Ne;return oe?Ne=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ve[0]):ee(ve[0]):ve[0]:Ne=ee(this.options.smartypants?ce(ve[0]):ve[0]),{type:"text",raw:ve[0],text:Ne}}},Se}(),Oe=V.noopTest,Re=V.edit,Ee=V.merge,pe={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Oe,table:Oe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};pe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,pe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,pe.def=Re(pe.def).replace("label",pe._label).replace("title",pe._title).getRegex(),pe.bullet=/(?:[*+-]|\d{1,9}[.)])/,pe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,pe.item=Re(pe.item,"gm").replace(/bull/g,pe.bullet).getRegex(),pe.list=Re(pe.list).replace(/bull/g,pe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+pe.def.source+")").getRegex(),pe._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",pe._comment=//,pe.html=Re(pe.html,"i").replace("comment",pe._comment).replace("tag",pe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pe.paragraph=Re(pe._paragraph).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",pe._tag).getRegex(),pe.blockquote=Re(pe.blockquote).replace("paragraph",pe.paragraph).getRegex(),pe.normal=Ee({},pe),pe.gfm=Ee({},pe.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),pe.gfm.nptable=Re(pe.gfm.nptable).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",pe._tag).getRegex(),pe.gfm.table=Re(pe.gfm.table).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",pe._tag).getRegex(),pe.pedantic=Ee({},pe.normal,{html:Re(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pe._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Oe,paragraph:Re(pe.normal._paragraph).replace("hr",pe.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",pe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var de={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Oe,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:Oe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",de.punctuation=Re(de.punctuation).replace(/punctuation/g,de._punctuation).getRegex(),de._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",de._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",de.em.start=Re(de.em.start).replace(/punctuation/g,de._punctuation).getRegex(),de.em.middle=Re(de.em.middle).replace(/punctuation/g,de._punctuation).replace(/overlapSkip/g,de._overlapSkip).getRegex(),de.em.endAst=Re(de.em.endAst,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.em.endUnd=Re(de.em.endUnd,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.strong.start=Re(de.strong.start).replace(/punctuation/g,de._punctuation).getRegex(),de.strong.middle=Re(de.strong.middle).replace(/punctuation/g,de._punctuation).replace(/blockSkip/g,de._blockSkip).getRegex(),de.strong.endAst=Re(de.strong.endAst,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.strong.endUnd=Re(de.strong.endUnd,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.blockSkip=Re(de._blockSkip,"g").getRegex(),de.overlapSkip=Re(de._overlapSkip,"g").getRegex(),de._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,de._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,de._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])?)+(?![-_])/,de.autolink=Re(de.autolink).replace("scheme",de._scheme).replace("email",de._email).getRegex(),de._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,de.tag=Re(de.tag).replace("comment",pe._comment).replace("attribute",de._attribute).getRegex(),de._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,de._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,de._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,de.link=Re(de.link).replace("label",de._label).replace("href",de._href).replace("title",de._title).getRegex(),de.reflink=Re(de.reflink).replace("label",de._label).getRegex(),de.reflinkSearch=Re(de.reflinkSearch,"g").replace("reflink",de.reflink).replace("nolink",de.nolink).getRegex(),de.normal=Ee({},de),de.pedantic=Ee({},de.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:Re(/^!?\[(label)\]\((.*?)\)/).replace("label",de._label).getRegex(),reflink:Re(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",de._label).getRegex()}),de.gfm=Ee({},de.normal,{escape:Re(de.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)),be+=""+ne+";";return be}var ge=function(){function Se(Ce){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ce||he,this.options.tokenizer=this.options.tokenizer||new Te,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ne={block:se.normal,inline:Ae.normal};this.options.pedantic?(ne.block=se.pedantic,ne.inline=Ae.pedantic):this.options.gfm&&(ne.block=se.gfm,this.options.breaks?ne.inline=Ae.breaks:ne.inline=Ae.gfm),this.tokenizer.rules=ne}Se.lex=function(ne,oe){var ce=new Se(oe);return ce.lex(ne)};var be=Se.prototype;return be.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},be.blockTokens=function(ne,oe,ce){oe===void 0&&(oe=[]),ce===void 0&&(ce=!0),ne=ne.replace(/^ +$/gm,"");for(var ve,Ne,Le,ze;ne;){if(ve=this.tokenizer.space(ne)){ne=ne.substring(ve.raw.length),ve.type&&oe.push(ve);continue}if(ve=this.tokenizer.code(ne,oe)){ne=ne.substring(ve.raw.length),ve.type?oe.push(ve):(ze=oe[oe.length-1],ze.raw+=`
`+ve.raw,ze.text+=`
`+ve.text);continue}if(ve=this.tokenizer.fences(ne)){ne=ne.substring(ve.raw.length),oe.push(ve);continue}if(ve=this.tokenizer.heading(ne)){ne=ne.substring(ve.raw.length),oe.push(ve);continue}if(ve=this.tokenizer.nptable(ne)){ne=ne.substring(ve.raw.length),oe.push(ve);continue}if(ve=this.tokenizer.hr(ne)){ne=ne.substring(ve.raw.length),oe.push(ve);continue}if(ve=this.tokenizer.blockquote(ne)){ne=ne.substring(ve.raw.length),ve.tokens=this.blockTokens(ve.text,[],ce),oe.push(ve);continue}if(ve=this.tokenizer.list(ne)){for(ne=ne.substring(ve.raw.length),Le=ve.items.length,Ne=0;Ne0)for(;(it=this.tokenizer.rules.inline.reflinkSearch.exec(ze))!=null;)ct.includes(it[0].slice(it[0].lastIndexOf("[")+1,-1))&&(ze=ze.slice(0,it.index)+"["+"a".repeat(it[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(it=this.tokenizer.rules.inline.blockSkip.exec(ze))!=null;)ze=ze.slice(0,it.index)+"["+"a".repeat(it[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ne;){if(Le=this.tokenizer.escape(ne)){ne=ne.substring(Le.raw.length),oe.push(Le);continue}if(Le=this.tokenizer.tag(ne,ce,ve)){ne=ne.substring(Le.raw.length),ce=Le.inLink,ve=Le.inRawBlock,oe.push(Le);continue}if(Le=this.tokenizer.link(ne)){ne=ne.substring(Le.raw.length),Le.type==="link"&&(Le.tokens=this.inlineTokens(Le.text,[],!0,ve)),oe.push(Le);continue}if(Le=this.tokenizer.reflink(ne,this.tokens.links)){ne=ne.substring(Le.raw.length),Le.type==="link"&&(Le.tokens=this.inlineTokens(Le.text,[],!0,ve)),oe.push(Le);continue}if(Le=this.tokenizer.strong(ne,ze,Ne)){ne=ne.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],ce,ve),oe.push(Le);continue}if(Le=this.tokenizer.em(ne,ze,Ne)){ne=ne.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],ce,ve),oe.push(Le);continue}if(Le=this.tokenizer.codespan(ne)){ne=ne.substring(Le.raw.length),oe.push(Le);continue}if(Le=this.tokenizer.br(ne)){ne=ne.substring(Le.raw.length),oe.push(Le);continue}if(Le=this.tokenizer.del(ne)){ne=ne.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],ce,ve),oe.push(Le);continue}if(Le=this.tokenizer.autolink(ne,ae)){ne=ne.substring(Le.raw.length),oe.push(Le);continue}if(!ce&&(Le=this.tokenizer.url(ne,ae))){ne=ne.substring(Le.raw.length),oe.push(Le);continue}if(Le=this.tokenizer.inlineText(ne,ve,ie)){ne=ne.substring(Le.raw.length),Ne=Le.raw.slice(-1),oe.push(Le);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 oe},J(Se,null,[{key:"rules",get:function(){return{block:se,inline:Ae}}}]),Se}(),we=j.defaults,_e=V.cleanUrl,Fe=V.escape,Ue=function(){function Se(Ce){this.options=Ce||we}var be=Se.prototype;return be.code=function(ne,oe,ce){var ve=(oe||"").match(/\S*/)[0];if(this.options.highlight){var Ne=this.options.highlight(ne,ve);Ne!=null&&Ne!==ne&&(ce=!0,ne=Ne)}return ve?''+(ce?ne:Fe(ne,!0))+`
`:""+(ce?ne:Fe(ne,!0))+`
`},be.blockquote=function(ne){return`
`+ne+`
`},be.html=function(ne){return ne},be.heading=function(ne,oe,ce,ve){return this.options.headerIds?"
`:""+ne+"
`},be.hr=function(){return this.options.xhtml?`
`:`
`},be.list=function(ne,oe,ce){var ve=oe?"ol":"ul",Ne=oe&&ce!==1?' start="'+ce+'"':"";return"<"+ve+Ne+`>
`+ne+""+ve+`>
`},be.listitem=function(ne){return""+ne+`
`},be.checkbox=function(ne){return" "},be.paragraph=function(ne){return""+ne+`
`},be.table=function(ne,oe){return oe&&(oe=""+oe+""),`
`},be.tablerow=function(ne){return`
`+ne+`
`},be.tablecell=function(ne,oe){var ce=oe.header?"th":"td",ve=oe.align?"<"+ce+' align="'+oe.align+'">':"<"+ce+">";return ve+ne+""+ce+`>
`},be.strong=function(ne){return""+ne+""},be.em=function(ne){return""+ne+""},be.codespan=function(ne){return""+ne+""},be.br=function(){return this.options.xhtml?"
":"
"},be.del=function(ne){return""+ne+""},be.link=function(ne,oe,ce){if(ne=_e(this.options.sanitize,this.options.baseUrl,ne),ne===null)return ce;var ve='"+ce+"",ve},be.image=function(ne,oe,ce){if(ne=_e(this.options.sanitize,this.options.baseUrl,ne),ne===null)return ce;var ve='
":">",ve},be.text=function(ne){return ne},Se}(),Be=function(){function Se(){}var be=Se.prototype;return be.strong=function(ne){return ne},be.em=function(ne){return ne},be.codespan=function(ne){return ne},be.del=function(ne){return ne},be.html=function(ne){return ne},be.text=function(ne){return ne},be.link=function(ne,oe,ce){return""+ce},be.image=function(ne,oe,ce){return""+ce},be.br=function(){return""},Se}(),Ze=function(){function Se(){this.seen={}}var be=Se.prototype;return be.slug=function(ne){var oe=ne.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(oe)){var ce=oe;do this.seen[ce]++,oe=ce+"-"+this.seen[ce];while(this.seen.hasOwnProperty(oe))}return this.seen[oe]=0,oe},Se}(),et=j.defaults,rt=V.unescape,Ye=function(){function Se(Ce){this.options=Ce||et,this.options.renderer=this.options.renderer||new Ue,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Be,this.slugger=new Ze}Se.parse=function(ne,oe){var ce=new Se(oe);return ce.parse(ne)};var be=Se.prototype;return be.parse=function(ne,oe){oe===void 0&&(oe=!0);var ce="",ve,Ne,Le,ze,it,ct,dt,Dt,At,pt,jt,Et,Rt,Ot,tt,Tr,wr,St,mt=ne.length;for(ve=0;ve0&&tt.tokens[0].type==="text"?(tt.tokens[0].text=St+" "+tt.tokens[0].text,tt.tokens[0].tokens&&tt.tokens[0].tokens.length>0&&tt.tokens[0].tokens[0].type==="text"&&(tt.tokens[0].tokens[0].text=St+" "+tt.tokens[0].tokens[0].text)):tt.tokens.unshift({type:"text",text:St}):Ot+=St),Ot+=this.parse(tt.tokens,Rt),At+=this.renderer.listitem(Ot,wr,Tr);ce+=this.renderer.list(At,jt,Et);continue}case"html":{ce+=this.renderer.html(pt.text);continue}case"paragraph":{ce+=this.renderer.paragraph(this.parseInline(pt.tokens));continue}case"text":{for(At=pt.tokens?this.parseInline(pt.tokens):pt.text;ve+1An error occurred:"+Qe(Le.message+"",!0)+"
";throw Le}}je.options=je.setOptions=function(Se){return st(je.defaults,Se),$e(je.defaults),je},je.getDefaults=Me,je.defaults=ut,je.use=function(Se){var be=st({},Se);if(Se.renderer&&function(){var ne=je.defaults.renderer||new Ue,oe=function(Ne){var Le=ne[Ne];ne[Ne]=function(){for(var ze=arguments.length,it=new Array(ze),ct=0;ct`,triples:"",explode:"[]{}"},O=ue.Pos;ue.defineOption("autoCloseBrackets",!1,function(m,g,a){a&&a!=ue.Init&&(m.removeKeyMap(F),m.state.closeBrackets=null),g&&(M($(g,"pairs")),m.state.closeBrackets=g,m.addKeyMap(F))});function $(m,g){return g=="pairs"&&typeof m=="string"?m:typeof m=="object"&&m[g]!=null?m[g]:J[g]}var F={Backspace:P,Enter:A};function M(m){for(var g=0;g=0;s--){var x=i[s].head;m.replaceRange("",O(x.line,x.ch-1),O(x.line,x.ch+1),"+delete")}}function A(m){var g=U(m),a=g&&$(g,"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+(g?-1:1)),head:new O(m.head.line,m.head.ch+(g?1:-1))}}function f(m,g){var a=U(m);if(!a||m.getOption("disableInput"))return ue.Pass;var i=$(a,"pairs"),s=i.indexOf(g);if(s==-1)return ue.Pass;for(var l=$(a,"closeBefore"),x=$(a,"triples"),v=i.charAt(s+1)==g,y=m.listSelections(),R=s%2==0,w,E=0;E=0&&m.getRange(c,O(c.line,c.ch+3))==g+g+g?u="skipThree":u="skip";else if(v&&c.ch>1&&x.indexOf(g)>=0&&m.getRange(O(c.line,c.ch-2),c)==g+g){if(c.ch>2&&/\bstring/.test(m.getTokenTypeAt(O(c.line,c.ch-2))))return ue.Pass;u="addFour"}else if(v){var S=c.ch==0?" ":m.getRange(O(c.line,c.ch-1),c);if(!ue.isWordChar(L)&&S!=g&&!ue.isWordChar(S))u="both";else return ue.Pass}else if(R&&(L.length===0||/\s/.test(L)||l.indexOf(L)>-1))u="both";else return ue.Pass;if(!w)w=u;else if(w!=u)return ue.Pass}var D=s%2?i.charAt(s-1):g,_=s%2?g: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 G=m.getSelections(),B=0;B0&&(le.percent=le.loaded/le.total*100),V.onProgress(le)});var N=new FormData;V.data&&Object.keys(V.data).forEach(function(ee){var le=V.data[ee];if(Array.isArray(le)){le.forEach(function(me){N.append(ee+"[]",me)});return}N.append(ee,V.data[ee])}),V.file instanceof Blob?N.append(V.filename,V.file,V.file.name):N.append(V.filename,V.file),I.onerror=function(le){V.onError(le)},I.onload=function(){return I.status<200||I.status>=300?V.onError(F(V,I),M(I)):V.onSuccess(M(I),I)},I.open(V.method,V.action,!0),V.withCredentials&&"withCredentials"in I&&(I.withCredentials=!0);var Y=V.headers||{};return Y["X-Requested-With"]!==null&&I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(Y).forEach(function(ee){Y[ee]!==null&&I.setRequestHeader(ee,Y[ee])}),I.send(N),{abort:function(){I.abort()}}}var U=+new Date,P=0;function A(){return"rc-upload-"+U+"-"+ ++P}function d(V,I){return V.indexOf(I,V.length-I.length)!==-1}var f=function(V,I){if(V&&I){var N=Array.isArray(I)?I:I.split(","),Y=V.name||"",ee=V.type||"",le=ee.replace(/\/.*$/,"");return N.some(function(me){var Ie=me.trim();return Ie.charAt(0)==="."?d(Y.toLowerCase(),Ie.toLowerCase()):/\/\*$/.test(Ie)?le===Ie.replace(/\/.*$/,""):ee===Ie})}return!0};function T(V,I){var N=V.createReader(),Y=[];function ee(){N.readEntries(function(le){var me=Array.prototype.slice.apply(le);Y=Y.concat(me);var Ie=!me.length;Ie?I(Y):ee()})}ee()}var p=function(I,N,Y){var ee=function le(me,Ie){Ie=Ie||"",me.isFile?me.file(function(Te){Y(Te)&&(me.fullPath&&!Te.webkitRelativePath&&(Object.defineProperties(Te,{webkitRelativePath:{writable:!0}}),Te.webkitRelativePath=me.fullPath.replace(/^\//,""),Object.defineProperties(Te,{webkitRelativePath:{writable:!1}})),N([Te]))}):me.isDirectory&&T(me,function(Te){Te.forEach(function(Oe){le(Oe,""+Ie+me.name+"/")})})};I.forEach(function(le){ee(le.webkitGetAsEntry())})},m=p,g=Object.assign||function(V){for(var I=1;I=0)continue;if(!Object.prototype.hasOwnProperty.call(V,Y))continue;N[Y]=V[Y]}return N}function x(V,I){if(!(V instanceof I))throw new TypeError("Cannot call a class as a function")}function v(V,I){if(!V)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:V}function y(V,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);V.prototype=Object.create(I&&I.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(V,I):V.__proto__=I)}var R=function(I){return Object.keys(I).reduce(function(N,Y){return(Y.substr(0,5)==="data-"||Y.substr(0,5)==="aria-"||Y==="role")&&(N[Y]=I[Y]),N},{})},w=function(V){y(I,V);function I(){var N,Y,ee,le;x(this,I);for(var me=arguments.length,Ie=Array(me),Te=0;Te=R?J:{done:!1,value:v[y++]}}}}P.fromArray=T;function p(v){return{next:function(){var y=v.next();return y.done?J:{done:!1,value:y.value}}}}P.fromNativeIterator=p;function m(v){return v?Array.isArray(v)?P.fromArray(v):v:P.empty()}P.from=m;function g(v,y){return{next:function(){var R=v.next();return R.done?J:{done:!1,value:y(R.value)}}}}P.map=g;function a(v,y){return{next:function(){for(;;){var R=v.next();if(R.done)return J;if(y(R.value))return{done:!1,value:R.value}}}}}P.filter=a;function i(v,y){for(var R=v.next();!R.done;R=v.next())y(R.value)}P.forEach=i;function s(v,y){y===void 0&&(y=Number.POSITIVE_INFINITY);var R=[];if(y===0)return R;for(var w=0,E=v.next();!E.done&&!(R.push(E.value),++w>=y);E=v.next());return R}P.collect=s;function l(){for(var v=[],y=0;y=v.length)return J;var w=v[R],E=w.next();return E.done?(R++,this.next()):E}}}P.concat=l;function x(v){return new $(v)}P.chain=x})(O||(O={}));var $=function(){function P(A){this.it=A}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(A,d,f,T){d===void 0&&(d=0),f===void 0&&(f=A.length),T===void 0&&(T=d-1),this.items=A,this.start=d,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}(),j=function(P){ue(A,P);function A(d,f,T,p){return f===void 0&&(f=0),T===void 0&&(T=d.length),p===void 0&&(p=f-1),P.call(this,d,f,T,p)||this}return A.prototype.current=function(){return P.prototype.current.call(this)},A.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},A.prototype.first=function(){return this.index=this.start,this.current()},A.prototype.last=function(){return this.index=this.end-1,this.current()},A.prototype.parent=function(){return null},A}(M),U=function(){function P(A,d){this.iterator=A,this.fn=d}return P.prototype.next=function(){return this.fn(this.iterator.next())},P}()},LdHM:function(bt,De,q){"use strict";q.d(De,"b",function(){return l}),q.d(De,"a",function(){return v});var ue=q("1OyB"),J=q("vuIU"),O=q("Ji7U"),$=q("LK+K"),F=q("q1tI"),M=q("rePB"),j=q("Ff2n"),U=q("ODXe"),P=q("4IlW"),A=q("bX4T"),d=q("YrtM"),f=q("TSYQ"),T=q.n(f),p=q("+nKL"),m=q("8OUc"),g=function(Y,ee){var le=Y.prefixCls,me=Y.id,Ie=Y.flattenOptions,Te=Y.childrenAsData,Oe=Y.values,Re=Y.searchValue,Ee=Y.multiple,pe=Y.defaultActiveFirstOption,de=Y.height,re=Y.itemHeight,he=Y.notFoundContent,se=Y.open,Ae=Y.menuItemSelectedIcon,ie=Y.virtual,ae=Y.onSelect,ge=Y.onToggleOpen,we=Y.onActiveValue,_e=Y.onScroll,Fe=Y.onMouseEnter,Ue="".concat(le,"-item"),Be=Object(d.a)(function(){return Ie},[se,Ie],function(Ve,Se){return Se[0]&&Ve[1]!==Se[1]}),Ze=F.useRef(null),et=function(Se){Se.preventDefault()},rt=function(Se){Ze.current&&Ze.current.scrollTo({index:Se})},Ye=function(Se){for(var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ce=Be.length,ne=0;ne1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(N).map(function(ee,le){if(!F.isValidElement(ee)||!ee.type)return null;var me=ee.type.isSelectOptGroup,Ie=ee.key,Te=ee.props,Oe=Te.children,Re=Object(j.a)(Te,["children"]);return Y||!me?w(ee):Object(y.a)(Object(y.a)({key:"__RC_SELECT_GRP__".concat(Ie===null?le:Ie,"__"),label:Ie},Re),{},{options:E(Oe)})}).filter(function(ee){return ee})}var C=q("2Qr1"),c=q("qNPg"),u=q("U8pU"),L=q("Kwbf"),S=q("WKfj");function D(N){var Y=N.mode,ee=N.options,le=N.children,me=N.backfill,Ie=N.allowClear,Te=N.placeholder,Oe=N.getInputElement,Re=N.showSearch,Ee=N.onSearch,pe=N.defaultOpen,de=N.autoFocus,re=N.labelInValue,he=N.value,se=N.inputValue,Ae=N.optionLabelProp,ie=Y==="multiple"||Y==="tags",ae=Re!==void 0?Re:ie||Y==="combobox",ge=ee||E(le);if(Object(L.a)(Y!=="tags"||ge.every(function(Ue){return!Ue.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Y==="tags"||Y==="combobox"){var we=ge.some(function(Ue){return Ue.options?Ue.options.some(function(Be){return typeof("value"in Be?Be.value:Be.key)=="number"}):typeof("value"in Ue?Ue.value:Ue.key)=="number"});Object(L.a)(!we,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(L.a)(Y!=="combobox"||!Ae,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(L.a)(Y==="combobox"||!me,"`backfill` only works with `combobox` mode."),Object(L.a)(Y==="combobox"||!Oe,"`getInputElement` only work with `combobox` mode."),Object(L.b)(Y!=="combobox"||!Oe||!Ie||!Te,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ee&&!ae&&Y!=="combobox"&&Y!=="tags"&&Object(L.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(L.b)(!pe||de,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),he!=null){var _e=Object(S.d)(he);Object(L.a)(!re||_e.every(function(Ue){return Object(u.a)(Ue)==="object"&&("key"in Ue||"value"in Ue)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(L.a)(!ie||Array.isArray(he),"`value` should be array when `mode` is `multiple` or `tags`")}if(le){var Fe=null;Object(R.a)(le).some(function(Ue){if(!F.isValidElement(Ue)||!Ue.type)return!1;var Be=Ue.type;if(Be.isSelectOption)return!1;if(Be.isSelectOptGroup){var Ze=Object(R.a)(Ue.props.children).every(function(et){return!F.isValidElement(et)||!Ue.type||et.type.isSelectOption?!0:(Fe=et.type,!1)});return!Ze}return Fe=Be,!0}),Fe&&Object(L.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Fe.displayName||Fe.name||Fe,"`.")),Object(L.a)(se===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var _=D,B=Object(c.a)({prefixCls:"rc-select",components:{optionList:i},convertChildrenToData:E,flattenOptions:C.d,getLabeledValue:C.e,filterOptions:C.b,isValueDisabled:C.g,findValueOption:C.c,warningProps:_,fillOptionsWithMissingValue:C.a}),G=function(N){Object(O.a)(ee,N);var Y=Object($.a)(ee);function ee(){var le;return Object(ue.a)(this,ee),le=Y.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)(ee,[{key:"render",value:function(){return F.createElement(B,Object.assign({ref:this.selectRef},this.props))}}]),ee}(F.Component);G.Option=l,G.OptGroup=v;var V=G,I=De.c=V},M8RZ:function(bt,De,q){"use strict";q.d(De,"a",function(){return P});var ue=q("fWQN"),J=q("mtLc"),O=q("yKVA"),$=q("879j"),F=q("q1tI"),M=q.n(F),j=q("i8i4"),U=q.n(j),P=function(A){Object(O.a)(f,A);var d=Object($.a)(f);function f(T){var p;Object(ue.a)(this,f),p=d.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(j.createPortal)(p,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),f}(M.a.Component)},MI8n:function(bt,De,q){"use strict";q.d(De,"b",function(){return M}),q.d(De,"a",function(){return P}),q.d(De,"e",function(){return A}),q.d(De,"d",function(){return d}),q.d(De,"c",function(){return f}),q.d(De,"f",function(){return T});var ue=q("/cxE"),J=q("C/vA"),O=q("pmY6"),$=q("24hK"),F=function(){var p=function(m,g){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,g)};return function(m,g){p(m,g);function a(){this.constructor=m}m.prototype=g===null?Object.create(g):(a.prototype=g.prototype,new a)}}(),M;(function(p){p.None=function(){return O.a.None};function m(_){return function(B,G,V){G===void 0&&(G=null);var I=!1,N;return N=_(function(Y){return I?void 0:(N?N.dispose():I=!0,B.call(G,Y))},null,V),I&&N.dispose(),N}}p.once=m;function g(_,B){return v(function(G,V,I){return V===void 0&&(V=null),_(function(N){return G.call(V,B(N))},null,I)})}p.map=g;function a(_,B){return v(function(G,V,I){return V===void 0&&(V=null),_(function(N){B(N),G.call(V,N)},null,I)})}p.forEach=a;function i(_,B){return v(function(G,V,I){return V===void 0&&(V=null),_(function(N){return B(N)&&G.call(V,N)},null,I)})}p.filter=i;function s(_){return _}p.signal=s;function l(){for(var _=[],B=0;B1)&&me.fire(Te),le=0},G)})},onLastListenerRemove:function(){N.dispose()}});return me.event}p.debounce=y;function R(_){var B=new Date().getTime();return g(m(_),function(G){return new Date().getTime()-B})}p.stopwatch=R;function w(_){var B=!0,G;return i(_,function(V){var I=B||V!==G;return B=!1,G=V,I})}p.latch=w;function E(_,B,G){B===void 0&&(B=!1),G===void 0&&(G=[]);var V=G.slice(),I=_(function(ee){V?V.push(ee):Y.fire(ee)}),N=function(){V&&V.forEach(function(ee){return Y.fire(ee)}),V=null},Y=new P({onFirstListenerAdd:function(){I||(I=_(function(ee){return Y.fire(ee)}))},onFirstListenerDidAdd:function(){V&&(B?setTimeout(N):N())},onLastListenerRemove:function(){I&&I.dispose(),I=null}});return Y.event}p.buffer=E;var C=function(){function _(B){this.event=B}return _.prototype.map=function(B){return new _(g(this.event,B))},_.prototype.forEach=function(B){return new _(a(this.event,B))},_.prototype.filter=function(B){return new _(i(this.event,B))},_.prototype.reduce=function(B,G){return new _(x(this.event,B,G))},_.prototype.latch=function(){return new _(w(this.event))},_.prototype.debounce=function(B,G,V,I){return G===void 0&&(G=100),V===void 0&&(V=!1),new _(y(this.event,B,G,V,I))},_.prototype.on=function(B,G,V){return this.event(B,G,V)},_.prototype.once=function(B,G,V){return m(this.event)(B,G,V)},_}();function c(_){return new C(_)}p.chain=c;function u(_,B,G){G===void 0&&(G=function(ee){return ee});var V=function(){for(var ee=[],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(g,a,i){m._listeners||(m._listeners=new $.a);var s=m._listeners.isEmpty();s&&m._options&&m._options.onFirstListenerAdd&&m._options.onFirstListenerAdd(m);var l=m._listeners.push(a?[g,a]:g);s&&m._options&&m._options.onFirstListenerDidAdd&&m._options.onFirstListenerDidAdd(m),m._options&&m._options.onListenerDidAdd&&m._options.onListenerDidAdd(m,g,a);var x;m._leakageMon&&(x=m._leakageMon.check(m._listeners.size));var v;return v={dispose:function(){if(x&&x(),v.dispose=p._noop,!m._disposed&&(l(),m._options&&m._options.onLastListenerRemove)){var y=m._listeners&&!m._listeners.isEmpty();y||m._options.onLastListenerRemove(m)}}},i instanceof O.b?i.add(v):Array.isArray(i)&&i.push(v),v}),this._event},enumerable:!0,configurable:!0}),p.prototype.fire=function(m){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new $.a);for(var g=this._listeners.iterator(),a=g.next();!a.done;a=g.next())this._deliveryQueue.push([a.value,m]);for(;this._deliveryQueue.size>0;){var i=this._deliveryQueue.shift(),s=i[0],l=i[1];try{typeof s=="function"?s.call(void 0,l):s[0].call(s[1],l)}catch(x){Object(ue.e)(x)}}}},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}(),A=function(p){F(m,p);function m(g){var a=p.call(this,g)||this;return a._isPaused=0,a._eventQueue=new $.a,a._mergeFn=g&&g.merge,a}return m.prototype.pause=function(){this._isPaused++},m.prototype.resume=function(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){var g=this._eventQueue.toArray();this._eventQueue.clear(),p.prototype.fire.call(this,this._mergeFn(g))}else for(;!this._isPaused&&this._eventQueue.size!==0;)p.prototype.fire.call(this,this._eventQueue.shift())},m.prototype.fire=function(g){this._listeners&&(this._isPaused!==0?this._eventQueue.push(g):p.prototype.fire.call(this,g))},m}(P),d=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 g=this,a={event:m,listener:null};this.events.push(a),this.hasListeners&&this.hook(a);var i=function(){g.hasListeners&&g.unhook(a);var s=g.events.indexOf(a);g.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(g){return m.hook(g)})},p.prototype.onLastListenerRemove=function(){var m=this;this.hasListeners=!1,this.events.forEach(function(g){return m.unhook(g)})},p.prototype.hook=function(m){var g=this;m.listener=m.event(function(a){return g.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 g=this;return function(a,i,s){return m(function(l){var x=g.buffers[g.buffers.length-1];x?x.push(function(){return a.call(i,l)}):a.call(i,l)},void 0,s)}},p.prototype.bufferEvents=function(m){var g=[];this.buffers.push(g);var a=m();return this.buffers.pop(),g.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(bt,De,q){"use strict";q.d(De,"x",function(){return ue}),q.d(De,"F",function(){return J}),q.d(De,"r",function(){return $}),q.d(De,"o",function(){return F}),q.d(De,"p",function(){return M}),q.d(De,"Q",function(){return j}),q.d(De,"K",function(){return P}),q.d(De,"k",function(){return A}),q.d(De,"N",function(){return d}),q.d(De,"m",function(){return f}),q.d(De,"l",function(){return T}),q.d(De,"I",function(){return p}),q.d(De,"H",function(){return m}),q.d(De,"q",function(){return g}),q.d(De,"t",function(){return a}),q.d(De,"D",function(){return i}),q.d(De,"e",function(){return s}),q.d(De,"f",function(){return l}),q.d(De,"B",function(){return x}),q.d(De,"C",function(){return v}),q.d(De,"n",function(){return R}),q.d(De,"O",function(){return E}),q.d(De,"c",function(){return C}),q.d(De,"d",function(){return c}),q.d(De,"z",function(){return u}),q.d(De,"A",function(){return L}),q.d(De,"u",function(){return S}),q.d(De,"E",function(){return _}),q.d(De,"G",function(){return B}),q.d(De,"i",function(){return V}),q.d(De,"g",function(){return N}),q.d(De,"v",function(){return ee}),q.d(De,"h",function(){return le}),q.d(De,"y",function(){return me}),q.d(De,"w",function(){return Ie}),q.d(De,"a",function(){return Te}),q.d(De,"P",function(){return Oe}),q.d(De,"L",function(){return Re}),q.d(De,"J",function(){return Ee}),q.d(De,"j",function(){return pe}),q.d(De,"M",function(){return de}),q.d(De,"s",function(){return re}),q.d(De,"b",function(){return he});function ue(ie){return!ie||typeof ie!="string"?!0:ie.trim().length===0}function J(ie,ae,ge){ge===void 0&&(ge="0");for(var we=""+ie,_e=[we],Fe=we.length;Fe=ae.length?we:ae[Fe]})}function F(ie){return ie.replace(/[<>&]/g,function(ae){switch(ae){case"<":return"<";case">":return">";case"&":return"&";default:return ae}})}function M(ie){return ie.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function j(ie,ae){ae===void 0&&(ae=" ");var ge=U(ie,ae);return P(ge,ae)}function U(ie,ae){if(!ie||!ae)return ie;var ge=ae.length;if(ge===0||ie.length===0)return ie;for(var we=0;ie.indexOf(ae,we)===we;)we=we+ge;return ie.substring(we)}function P(ie,ae){if(!ie||!ae)return ie;var ge=ae.length,we=ie.length;if(ge===0||we===0)return ie;for(var _e=we,Fe=-1;!(Fe=ie.lastIndexOf(ae,_e-1),Fe===-1||Fe+ge!==_e);){if(Fe===0)return"";_e=Fe}return ie.substring(0,_e)}function A(ie){return ie.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function d(ie,ae){if(ie.length0?ie.indexOf(ae,ge)===ge:ge===0?ie===ae:!1}function T(ie,ae,ge){if(ge===void 0&&(ge={}),!ie)throw new Error("Cannot create regex from empty string");ae||(ie=M(ie)),ge.wholeWord&&(/\B/.test(ie.charAt(0))||(ie="\\b"+ie),/\B/.test(ie.charAt(ie.length-1))||(ie=ie+"\\b"));var we="";return ge.global&&(we+="g"),ge.matchCase||(we+="i"),ge.multiline&&(we+="m"),ge.unicode&&(we+="u"),new RegExp(ie,we)}function p(ie){if(ie.source==="^"||ie.source==="^$"||ie.source==="$"||ie.source==="^\\s*$")return!1;var ae=ie.exec("");return!!(ae&&ie.lastIndex===0)}function m(ie){return(ie.global?"g":"")+(ie.ignoreCase?"i":"")+(ie.multiline?"m":"")+(ie.unicode?"u":"")}function g(ie){for(var ae=0,ge=ie.length;ae=0;ge--){var we=ie.charCodeAt(ge);if(we!==32&&we!==9)return ge}return-1}function s(ie,ae){return ieae?1:0}function l(ie,ae){for(var ge=Math.min(ie.length,ae.length),we=0;weae.length?1:0}function x(ie){return ie>=97&&ie<=122}function v(ie){return ie>=65&&ie<=90}function y(ie){return x(ie)||v(ie)}function R(ie,ae){return ie.length===ae.length&&w(ie,ae)}function w(ie,ae,ge){ge===void 0&&(ge=ie.length);for(var we=0;weie.length?!1:w(ie,ae,ge)}function C(ie,ae){var ge,we=Math.min(ie.length,ae.length);for(ge=0;ge1){var we=ie.charCodeAt(ae-2);if(u(we))return(we-55296<<10)+(ge-56320)+65536}return ge}function _(ie,ae){var ge=se.getInstance(),we=ae,_e=ie.length,Fe=S(ie,_e,ae);ae+=Fe>=65536?2:1;for(var Ue=ge.getGraphemeBreakType(Fe);ae<_e;){var Be=S(ie,_e,ae),Ze=ge.getGraphemeBreakType(Be);if(he(Ue,Ze))break;ae+=Be>=65536?2:1,Ue=Ze}return ae-we}function B(ie,ae){var ge=se.getInstance(),we=ae,_e=D(ie,ae);ae-=_e>=65536?2:1;for(var Fe=ge.getGraphemeBreakType(_e);ae>0;){var Ue=D(ie,ae),Be=ge.getGraphemeBreakType(Ue);if(he(Be,Fe))break;ae-=Ue>=65536?2:1,Fe=Be}return we-ae}var G=/(?:[\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 V(ie){return G.test(ie)}var I=/(?:[\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 I.test(ie)}var Y=/^[\t\n\r\x20-\x7E]*$/;function ee(ie){return Y.test(ie)}function le(ie){for(var ae=0,ge=ie.length;ae=11904&&ie<=55215||ie>=63744&&ie<=64255||ie>=65281&&ie<=65374}function Ie(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 Te=String.fromCharCode(65279);function Oe(ie){return!!(ie&&ie.length>0&&ie.charCodeAt(0)===65279)}function Re(ie){return btoa(encodeURIComponent(ie))}function Ee(ie,ae){for(var ge="",we=0;wege[3*_e+1])_e=2*_e+1;else return ge[3*_e+2];return 0},ie._INSTANCE=null,ie}();function Ae(){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(bt,De,q){"use strict";var ue=q("2qtc"),J=q("kLXV"),O=q("rAM+"),$=q("miYZ"),F=q("tsqr"),M=q("9og8"),j=q("tJVT"),U=q("jrin"),P=q("WmNS"),A=q.n(P),d=q("q1tI"),f=q.n(d),T=q("VrN/"),p=q.n(T),m=q("bdgK"),g=q("p77/"),a=q("Bd2K"),i=q("ELLl"),s=q("19Vz"),l=q("lZu9"),x=q("+NIl"),v=q("kSUc"),y=q("9Bee"),R=function(Le){var ze=Le.value,it=ze===void 0?"":ze,ct=Le.className,dt=Le.showTextOnly,Dt=Le.showLines,At=Le.style,pt=At===void 0?{}:At,jt=Object(d.useMemo)(function(){return""},[it]);return f.a.createElement(f.a.Fragment,null,f.a.createElement("div",{dangerouslySetInnerHTML:{__html:jt}}))},w=q("0Owb"),E=q("dejd"),C=q("C+DQ"),c=q("1vsH"),u=q("m3rI"),L=[{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(Le){var ze=Le.onActionCallback,it=Le.title,ct=Le.icon,dt=Le.actionName,Dt=Le.className,At=Dt===void 0?"":Dt,pt=Le.children;function jt(){ze(dt)}return f.a.createElement("a",{title:it,className:At,onClick:jt},f.a.createElement("i",{className:"md-iconfont ".concat(ct)}),pt)}var D=function(Le){var ze=Le.watch,it=Le.showNullButton,ct=Le.onActionCallback,dt=Le.fullScreen,Dt=Le.insertTemp,At=Le.hidetoolBar,pt=Le.uuid,jt=Le.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(c.D)("_educoder_session_login"),"&_educoder_session=").concat(Object(c.D)("_educoder_session"),"&key=").concat(pt,"&api=").concat(encodeURIComponent(u.a.PROXY_SERVER)));var Et=[].concat(L,[{title:"".concat(ze?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(ze?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return f.a.createElement("ul",{className:"markdown-toolbar-container"},!At&&Et.map(function(Rt,Ot){return f.a.createElement("li",{key:Ot},Rt.actionName?f.a.createElement(S,Object(w.a)({},Rt,{onActionCallback:ct})):f.a.createElement("span",{className:"v-line"}))}),it?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,Dt&&f.a.createElement("li",null,f.a.createElement(S,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Dt),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})))},_=q("M8RZ"),B=q("+L6B"),G=q("2/Rp"),V=q("y8nQ"),I=q("Vl3Y"),N=q("5NDa"),Y=q("5rEg"),ee={labelCol:{span:4},wrapperCol:{span:20}},le=function(Le){var ze=Le.callback,it=Le.onCancel;function ct(dt){ze(dt)}return f.a.createElement(I.a,Object(w.a)({},ee,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ct}),f.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},f.a.createElement(Y.a,null)),f.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},f.a.createElement(Y.a,null)),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(G.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(G.a,{type:"ghost",onClick:it},"\u53D6\u6D88")))},me=q("7ahc"),Ie=q("k1fw"),Te=q("HmJG"),Oe=q("BjJ7"),Re=I.a.useForm,Ee={width:280,marginRight:10},pe={labelCol:{span:5},wrapperCol:{span:19}},de=function(Le){var ze=Le.callback,it=Le.onCancel,ct=Re(),dt=Object(j.a)(ct,1),Dt=dt[0],At=Object(d.useRef)();function pt(Rt){ze(Object(Ie.a)(Object(Ie.a)({},Rt),{},{name:At.current}))}function jt(Rt,Ot){Dt.setFieldsValue({src:"/api/attachments/".concat(Rt.id,"?type=").concat(Rt.content_type),type:Ot.type})}function Et(Rt){var Ot=Rt.target.files[0];At.current=Ot.name,he(Ot,jt)}return f.a.createElement(I.a,Object(w.a)({form:Dt},pe,{className:"upload-image-panel",onFinish:pt}),f.a.createElement(I.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},f.a.createElement("div",{className:"flex-container"},f.a.createElement(I.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},f.a.createElement(Y.a,{style:Ee})),f.a.createElement(re,{onFileChange:Et}))),f.a.createElement(I.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},f.a.createElement(Y.a,{style:{width:264}})),f.a.createElement(I.a.Item,{style:{textAlign:"right"}},f.a.createElement(G.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(G.a,{type:"ghost",onClick:it},"\u53D6\u6D88")))};function re(Le){var ze=Le.onFileChange;return f.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",f.a.createElement("input",{type:"file",onChange:ze}))}function he(Le,ze){if(!Le)throw new String("\u6CA1\u6709\u6587\u4EF6");var it=new FormData;it.append("editormd-image-file",Le),it.append("file_param_name","editormd-image-file"),it.append("byxhr","true");var ct=new window.XMLHttpRequest;ct.withCredentials=!0,ct.addEventListener("load",function(dt){ze(JSON.parse(dt.target.responseText),Le)},!1),ct.addEventListener("error",function(dt){console.error(dt)},!1),ct.open("POST","".concat(Oe.a,"/api/attachments.json")),ct.send(it)}var se=q("giR+"),Ae=q("fyUT"),ie=q("7Kak"),ae=q("9yH6"),ge=ae.a.Group,we={margin:"0 8px"},_e=function(Le){var ze=Le.callback,it=Le.onCancel;function ct(dt){ze(dt)}return f.a.createElement(I.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:we},"\u5355\u5143\u683C\u6570\uFF1A"),f.a.createElement("span",{style:we},"\u884C\u6570"),f.a.createElement(I.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},f.a.createElement(Ae.a,null)),f.a.createElement("span",{style:we},"\u5217\u6570"),f.a.createElement(I.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},f.a.createElement(Ae.a,null))),f.a.createElement("div",{className:"flex-container",style:{marginTop:12}},f.a.createElement("span",{style:we},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),f.a.createElement(I.a.Item,{name:"align"},f.a.createElement(ge,null,f.a.createElement(ae.a,{value:"default"},f.a.createElement("i",{className:"fa fa-align-justify"})),f.a.createElement(ae.a,{value:"left"},f.a.createElement("i",{className:"fa fa-align-left"})),f.a.createElement(ae.a,{value:"center"},f.a.createElement("i",{className:"fa fa-align-center"})),f.a.createElement(ae.a,{value:"right"},f.a.createElement("i",{className:"fa fa-align-right"}))))),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(G.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(G.a,{type:"ghost",onClick:it},"\u53D6\u6D88")))},Fe=q("ErOA"),Ue=q("7Cbv"),Be="link",Ze="upload-image",et="code-block",rt="add-table",Ye="------------",st={default:Ye,left:":".concat(Ye),center:":".concat(Ye,":"),right:"".concat(Ye,":")},Je=q("9VGf"),Qe,Me;function $e(){}var ut=0,je=1e4,Ve="\u2581",Se=`
**\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 be(Le){return/^\d+$/.test(Le)?"".concat(Le,"px"):Le}var Ce=navigator.platform.toUpperCase().indexOf("MAC")>=0,ne=Ce?"Cmd":"Ctrl",oe=["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=(Qe={},Object(U.a)(Qe,ne+"-B","bold"),Object(U.a)(Qe,ne+"-I","italic"),Qe),ve=(Me={},Object(U.a)(Me,Be,"\u6DFB\u52A0\u94FE\u63A5"),Object(U.a)(Me,et,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(U.a)(Me,Ze,"\u6DFB\u52A0\u6587\u4EF6"),Object(U.a)(Me,rt,"\u6DFB\u52A0\u8868\u683C"),Me),Ne=De.a=function(Le){var ze=Le.defaultValue,it=ze===void 0?"":ze,ct=Le.onChange,dt=Le.width,Dt=dt===void 0?"100%":dt,At=Le.height,pt=At===void 0?400:At,jt=Le.miniToolbar,Et=jt===void 0?!1:jt,Rt=Le.isFocus,Ot=Rt===void 0?!1:Rt,tt=Le.watch,Tr=Le.insertTemp,wr=Le.mode,St=wr===void 0?"markdown":wr,mt=Le.id,lt=mt===void 0?"markdown-editor-id":mt,Ct=Le.showResizeBar,$t=Ct===void 0?!1:Ct,Jt=Le.noStorage,nr=Jt===void 0?!1:Jt,Pt=Le.showNullButton,yt=Pt===void 0?!1:Pt,Mr=Le.hidetoolBar,tn=Mr===void 0?!1:Mr,Ar=Le.fullScreen,It=Ar===void 0?!1:Ar,kr=Le.onBlur,Kr=Le.onCMBeforeChange,rn=Le.onFullScreen,He=Le.className,ht=He===void 0?"":He,Nt=Le.disablePaste,Vt=Nt===void 0?!1:Nt,Qt=Le.placeholder,er=Qt===void 0?"":Qt,z=Le.values,h=z===void 0?"":z,b=Object(d.useState)(null),H=Object(j.a)(b,2),X=H[0],K=H[1],xe=Object(d.useState)(it),Ge=Object(j.a)(xe,2),nt=Ge[0],gt=Ge[1],Ke=Object(d.useState)(tt),kt=Object(j.a)(Ke,2),Bt=kt[0],tr=kt[1],Vr=Object(d.useState)(It),Xr=Object(j.a)(Vr,2),pr=Xr[0],Zr=Xr[1],Gn=Object(d.useState)(""),Pr=Object(j.a)(Gn,2),Yr=Pr[0],Wr=Pr[1],bn=Object(d.useState)(0),nn=Object(j.a)(bn,2),mn=nn[0],dn=nn[1],hi=Object(d.useState)(pt),zn=Object(j.a)(hi,2),an=zn[0],$r=zn[1],Rn=Object(d.useState)(!1),On=Object(j.a)(Rn,2),ci=On[0],or=On[1],Gt=Object(d.useRef)(Object(Ue.a)()),Er=Object(d.useRef)(!1),Ht=Object(d.useRef)(),dr=Object(d.useRef)(),Xt=Object(d.useRef)(),hn=Object(d.useRef)(),lr=Object(d.useRef)(),Ir=function(){var xt=Object(M.a)(A.a.mark(function Mt(){var wt,Ft;return A.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Zt.next=2,Object(Fe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Gt.current}});case 2:Ft=Zt.sent,Ft!=null&&(wt=Ft.attachments)!==null&&wt!==void 0&&wt.length&&(console.log("cm:",X,dr),Ft.attachments.map(function(Wt){Wt.content_type.indexOf("image")>-1?X.replaceSelection(".concat(Wt.content_type,")")):Wt.content_type.indexOf("video")>-1?X.replaceSelection('')):Wt.content_type.indexOf("pdf")>-1?X.replaceSelection('').concat(Wt.name,"")):X.replaceSelection("[".concat(Wt.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}));case 4:case"end":return Zt.stop()}},Mt)}));return function(){return xt.apply(this,arguments)}}();Object(d.useEffect)(function(){gt(h),X==null||X.setValue(h)},[h]),Object(d.useEffect)(function(){rn==null||rn(pr)},[pr]),Object(d.useEffect)(function(){if(dr.current){var xt=p.a.fromTextArea(dr.current,{mode:St,lineNumbers:!Et,lineWrapping:!0,value:it,autoCloseTags:!0,autoCloseBrackets:!0});Ot&&xt.focus();function Mt(wt,Ft){if(Vt){Ft.preventDefault();return}var zt=Ft.clipboardData;if(zt){var Zt=zt.types.toString(),Wt=zt.items;if(Zt==="Files"||zt.types.indexOf("Files")>-1){if(Ft.preventDefault(),St=="stex")return;try{var hr,_r=Wt[1];((hr=Wt[0])===null||hr===void 0?void 0:hr.kind)==="file"&&(_r=Wt[0]);var Ut=_r.getAsFile(),En=Ut.name.split(".").pop();he(Ut,function(Kt){if(Kt.id){var gr,qr,en;(Ut==null||((gr=Ut.type)===null||gr===void 0)?void 0:gr.indexOf("image"))>-1?xt.replaceSelection(".concat(Kt.content_type,")")):(Ut==null||((qr=Ut.type)===null||qr===void 0)?void 0:qr.indexOf("video"))>-1?xt.replaceSelection('')):(Ut==null||((en=Ut.type)===null||en===void 0)?void 0:en.indexOf("pdf"))>-1?xt.replaceSelection('').concat(Ut.name,"")):oe.includes(En)?xt.replaceSelection('').concat(Ut.name,"")):xt.replaceSelection("[".concat(Ut.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(Kt.id,"?type=").concat(Kt.content_type,")"))}else(Kt==null?void 0:Kt.status)===401&&(document.location.href="/user/login")})}catch(Kt){F.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return xt.on("paste",Mt),xt.on("dragleave",function(wt,Ft){Xt.current.classList.remove("mouse-hover-md")}),xt.on("dragover",function(wt,Ft){Xt.current.classList.add("mouse-hover-md")}),xt.on("drop",function(wt,Ft){Xt.current.classList.add("mouse-hover-md");var zt;if(zt=Ft.dataTransfer.files,zt.length>0){Ft.preventDefault(),Ft.stopPropagation();for(var Zt=function(_r){var Ut=zt[_r],En=Ut.name.split(".").pop();he(Ut,function(Kt){if(Kt.id){var gr,qr,en;(Ut==null||((gr=Ut.type)===null||gr===void 0)?void 0:gr.indexOf("image"))>-1?xt.replaceSelection(".concat(Kt.content_type,")")):(Ut==null||((qr=Ut.type)===null||qr===void 0)?void 0:qr.indexOf("video"))>-1?xt.replaceSelection('')):(Ut==null||((en=Ut.type)===null||en===void 0)?void 0:en.indexOf("pdf"))>-1?xt.replaceSelection('').concat(Ut.name,"")):oe.includes(En)?xt.replaceSelection('').concat(Ut.name,"")):xt.replaceSelection("[".concat(Ut.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(Kt.id,"?type=").concat(Kt.content_type,")"))}else(Kt==null?void 0:Kt.status)===401&&(document.location.href="/user/login")})},Wt=0;Wt0||Wt.target.offsetWidth>0)&&(Kn(),X.setSize("100%","100%"),X.refresh())}}catch(hr){zt.e(hr)}finally{zt.f()}});return wt.observe(dr.current.parentElement),wt}if(X){var Mt=xt();return function(){Mt.unobserve(dr.current.parentElement)}}},[X,Kn]),Object(d.useEffect)(function(){if(X){for(var xt=[],Mt=function(){var Wt=Ft[wt];zt=Object(j.a)(Wt,2);var hr=zt[0],_r=zt[1],Ut=Object(U.a)({},hr,function(){Vn(_r)});xt.push(Ut),X.addKeyMap(Ut)},wt=0,Ft=Object.entries(ce);wt0){var xt=new Date().getTime(),Mt=window.sessionStorage.getItem(lt);xt>=mn+je&&(!Mt||Mt!==nt)&&(window.sessionStorage.setItem(lt,nt),or(!0))}},je),Object(d.useEffect)(function(){tr(tt)},[X,tt]),Object(d.useEffect)(function(){X&&(Ot&&X.focus())},[X,Ot]),Object(d.useEffect)(function(){if(Bt&&X){var xt=X.getScrollerElement();function Mt(wt){var Ft=wt.target;if(lr.current){var zt=Ft.scrollTop/Ft.scrollHeight;lr.current.scrollTop=lr.current.scrollHeight*zt}}return xt.addEventListener("scroll",Mt),function(){xt.removeEventListener("scroll",Mt)}}},[X,Bt]),Object(d.useEffect)(function(){if(X&&Kr){function xt(Mt,wt){Kr(Mt,wt)}return X.on("beforeChange",xt),function(){X.off("beforeChange",xt)}}},[X,Kr]),Object(d.useEffect)(function(){if(X&&kr){function xt(){kr(X.getValue())}return X.on("blur",xt),function(){X.off("blur",xt)}}},[X,kr]),Object(d.useEffect)(function(){if(X){function xt(Mt){var wt=Mt.getValue();gt(wt),dn(new Date().getTime()),Mt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ct&&ct(wt)}return X.on("change",xt),function(){X.off("change",xt)}}},[X,ct]),Object(d.useEffect)(function(){X&&(it==null?(X.setValue(""),gt("")):it!==X.getValue()&&(X.setValue(it),gt(it),X.setCursor(X.lineCount(),0)))},[X,it]);var Vn=Object(d.useCallback)(function(xt){var Mt=X.getCursor(),wt=X.getSelection(),Ft=wt.split(`
`);switch(xt){case"bold":return X.replaceSelection("**"+wt+"**"),wt===""&&X.setCursor(Mt.line,Mt.ch+2),X.focus();case"italic":return X.replaceSelection("*"+wt+"*"),wt===""&&X.setCursor(Mt.line,Mt.ch+1),X.focus();case"code":return X.replaceSelection("`"+wt+"`"),wt===""&&X.setCursor(Mt.line,Mt.ch+1),X.focus();case"inline-latex":return X.replaceSelection("`$$"+wt+"$$`"),wt===""&&X.setCursor(Mt.line,Mt.ch+3),X.focus();case"latex":return X.replaceSelection("```latex\n"+wt+"\n```"),X.setCursor(Mt.line+1,wt.length+1),X.focus();case"line-break":return X.replaceSelection(`
`),X.focus();case"list-ul":return wt===""?X.replaceSelection("- "+wt):X.replaceSelection(Ft.map(function(zt){return zt===""?"":"- ".concat(zt)}).join(`
`)),X.focus();case"list-ol":return wt===""?X.replaceSelection("1. "+wt):X.replaceSelection(Ft.map(function(zt,Zt){return zt===""?"":"".concat(Zt+1,". ").concat(zt)}).join(`
`)),X.focus();case"add-null-ch":return wt===""&&X.setCursor(Mt.line,Mt.ch+1),X.replaceSelection(Ve),X.focus();case"inster-template-1":return wt===""&&X.setCursor(Mt.line,Mt.ch),X.replaceSelection(Se),X.focus();case"eraser":return X.setValue(""),X.focus();case"trigger-watch":return tr(!Bt),X.focus();case"trigger-full-screen":return Zr(!pr),X.focus();case Be:Wr(Be);return;case et:Wr(et);return;case Ze:Wr(Ze);return;case rt:Wr(rt);return;default:throw new Error}},[X,Bt,pr]),xn=Object(d.useCallback)(function(xt){Wr("");switch(Yr){case Be:var Mt=xt.title,wt=xt.link;return X.replaceSelection("[".concat(Mt,"](").concat(wt,")")),X.focus();case et:var Ft=xt.language,zt=xt.content;return X.replaceSelection(["```"+Ft,zt,"```"].join(`
`)),X.focus();case Ze:var Zt=xt.src,Wt=xt.alt,hr=xt.name;return Zt.indexOf("type=image")>-1?X.replaceSelection(".concat(Zt,' "').concat(Wt||"",'" )')):Zt.indexOf("type=application/pdf")>-1?X.replaceSelection('').concat(hr,"")):X.replaceSelection('').concat(hr,"")),X.focus();case rt:for(var _r=xt.row,Ut=xt.col,En=xt.align,Kt=`
`,gr=0;gr<_r;gr++){for(var qr=[],en=[],Wi=0;Wi300&&(hr=300);var _r=pt+hr+"px";$r(_r)}}return xt.addEventListener("mousedown",Ft),document.addEventListener("mousemove",Zt),document.addEventListener("mouseup",zt),function(){xt.removeEventListener("mousedown",Ft),document.removeEventListener("mousemove",Zt),document.removeEventListener("mouseup",zt)}}},[X,hn]),Object(d.useEffect)(function(){$r(pt)},[pt]);var fi=be(Dt),on=be(an),Xn={width:fi,height:on},ji=Object(d.useMemo)(function(){if(mn){var xt=new Date(mn),Mt=xt.getHours(),wt=xt.getMinutes(),Ft=xt.getSeconds();return Mt=Mt<10?"0"+Mt:Mt,wt=wt<10?"0"+wt:wt,Ft=Ft<10?"0"+Ft:Ft,"".concat(Mt,":").concat(wt,":").concat(Ft)}return 0},[mn]);function Mn(){window.sessionStorage.removeItem(lt),or(!1),dn(0)}function $a(){or(!1),dn(0),X.setValue(window.sessionStorage.getItem(lt))}function da(xt,Mt){var wt=X.getValue();wt=wt.replace(xt,Mt),gt(wt),X==null||X.setValue(wt)}return f.a.createElement(d.Fragment,null,f.a.createElement("div",{className:"markdown-editor-wrapper",ref:Xt},f.a.createElement("div",{className:"markdown-editor-container ".concat(ht," ").concat(Bt?"on-preview":""," ").concat(Et?"mini":""," ").concat(pr?"full-screen":""),style:Xn},f.a.createElement(D,{insertTemp:Tr,watch:Bt,fullScreen:pr,showNullButton:yt,onActionCallback:Vn,hidetoolBar:tn,uuid:Gt.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:dr,placeholder:er})),Bt?f.a.createElement("div",{ref:lr,className:"preview-container"},St==="stex"&&f.a.createElement(R,{value:nt}),St!=="stex"&&f.a.createElement(y.a,{edit:!0,value:nt,replaces:da})):null))),$t?f.a.createElement("a",{ref:hn,className:"editor-resize"}):null,f.a.createElement(_.a,null,ve[Yr]?f.a.createElement(J.a,{centered:!0,title:ve[Yr],visible:!0,onCancel:Hr,footer:null},Ui):null))}},QDVR:function(bt,De,q){"use strict";q.d(De,"e",function(){return J}),q.d(De,"d",function(){return O}),q.d(De,"c",function(){return j}),q.d(De,"b",function(){return U}),q.d(De,"a",function(){return A});var ue=function(){var d=function(f,T){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,m){p.__proto__=m}||function(p,m){for(var g in m)m.hasOwnProperty(g)&&(p[g]=m[g])},d(f,T)};return function(f,T){d(f,T);function p(){this.constructor=f}f.prototype=T===null?Object.create(T):(p.prototype=T.prototype,new p)}}();function J(d){var f=[];return d.forEach(function(T){return f.push(T)}),f}function O(d){var f=[];return d.forEach(function(T,p){return f.push(p)}),f}var $=function(){function d(){this._value="",this._pos=0}return d.prototype.reset=function(f){return this._value=f,this._pos=0,this},d.prototype.next=function(){return this._pos+=1,this},d.prototype.hasNext=function(){return this._pos0)m.left||(m.left=new M,m.left.segment=p.value()),m=m.left;else if(g<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},d.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},d.prototype.findSubstr=function(f){for(var T=this._iter.reset(f),p=this._root,m=void 0;p;){var g=T.cmp(p.segment);if(g>0)p=p.left;else if(g<0)p=p.right;else if(T.hasNext())T.next(),m=p.value||m,p=p.mid;else break}return p&&p.value||m},d.prototype.forEach=function(f){this._forEach(this._root,f)},d.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))},d}(),U=function(){function d(){this.map=new Map,this.ignoreCase=!1}return d.prototype.set=function(f,T){this.map.set(this.toKey(f),T)},d.prototype.get=function(f){return this.map.get(this.toKey(f))},d.prototype.toKey=function(f){var T=f.toString();return this.ignoreCase&&(T=T.toLowerCase()),T},d}(),P=function(){function d(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}return d.prototype.clear=function(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0},Object.defineProperty(d.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),d.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},d.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++}},d.prototype.delete=function(f){return!!this.remove(f)},d.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},d.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},d.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)},d.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},d.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},d.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},d.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}},d.prototype.toJSON=function(){var f=[];return this.forEach(function(T,p){f.push([p,T])}),f},d}(),A=function(d){ue(f,d);function f(T,p){p===void 0&&(p=1);var m=d.call(this)||this;return m._limit=T,m._ratio=Math.min(Math.max(0,p),1),m}return f.prototype.get=function(T){return d.prototype.get.call(this,T,2)},f.prototype.peek=function(T){return d.prototype.get.call(this,T,0)},f.prototype.set=function(T,p){d.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)},SJMd:function(bt,De){/**
* @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 q,ue,J,O=!1,$,F;window.PR_SHOULD_USE_CONTINUATION=!0;var M,j;(function(){var U=window,P=["break,continue,do,else,for,if,return,while"],A=[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"],d=[A,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],f=[d,"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=[d,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],p=[d,"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",g=[d,"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"],l=[P,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],x=[f,p,T,g,a,i,s,l],v=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,y="str",R="kwd",w="com",E="typ",C="lit",c="pun",u="pln",L="tag",S="dec",D="src",_="atn",B="atv",G="nocode",V="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function I(ae){for(var ge=0,we=!1,_e=!1,Fe=0,Ue=ae.length;Fe122||(ne<65||Ce>90||$e.push([Math.max(65,Ce)|32,Math.min(ne,90)|32]),ne<97||Ce>122||$e.push([Math.max(97,Ce)&~32,Math.min(ne,122)&~32]))}}$e.sort(function(Ne,Le){return Ne[0]-Le[0]||Le[1]-Ne[1]});for(var oe=[],ce=[],Ve=0;Ve<$e.length;++Ve){var ve=$e[Ve];ve[0]<=ce[1]+1?ce[1]=Math.max(ce[1],ve[1]):oe.push(ce=ve)}for(var Ve=0;Veve[0]&&(ve[1]+1>ve[0]&&je.push("-"),je.push(rt(ve[1])))}return je.push("]"),je.join("")}function st(Qe){for(var Me=Qe.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),$e=Me.length,ut=[],je=0,Ve=0;je<$e;++je){var Se=Me[je];if(Se==="(")++Ve;else if(Se.charAt(0)==="\\"){var be=+Se.substring(1);be&&(be<=Ve?ut[be]=-1:Me[je]=rt(be))}}for(var je=1;je=2&&Ce==="["?Me[je]=Ye(Se):Ce!=="\\"&&(Me[je]=Se.replace(/[a-zA-Z]/g,function(ce){var ve=ce.charCodeAt(0);return"["+String.fromCharCode(ve&~32,ve|32)+"]"}))}return Me.join("")}for(var Je=[],Fe=0,Ue=ae.length;Fe=0;)we[Je.charAt(Qe)]=st;var Me=st[1],$e=""+Me;et.hasOwnProperty($e)||(Ze.push(Me),et[$e]=null)}Ze.push(/[\0-\uffff]/),_e=I(Ze)})();var Fe=ge.length,Ue=function(Be){for(var Ze=Be.sourceCode,et=Be.basePos,rt=Be.sourceNode,Ye=[et,u],st=0,Je=Ze.match(_e)||[],Qe={},Me=0,$e=Je.length;Me<$e;++Me){var ut=Je[Me],je=Qe[ut],Ve=void 0,Se;if(typeof je=="string")Se=!1;else{var be=we[ut.charAt(0)];if(be)Ve=ut.match(be[1]),je=be[0];else{for(var Ce=0;Ce=5&&je.substring(0,5)==="lang-",Se&&!(Ve&&typeof Ve[1]=="string")&&(Se=!1,je=D),Se||(Qe[ut]=je)}var ne=st;if(st+=ut.length,!Se)Ye.push(et+ne,je);else{var oe=Ve[1],ce=ut.indexOf(oe),ve=ce+oe.length;Ve[2]&&(ve=ut.length-Ve[2].length,ce=ve-oe.length);var Ne=je.substring(5);Y(rt,et+ne,ut.substring(0,ce),Ue,Ye),Y(rt,et+ne+ce,oe,de(Ne,oe),Ye),Y(rt,et+ne+ve,ut.substring(ve),Ue,Ye)}}Be.decorations=Ye};return Ue}function Ie(ae){var ge=[],we=[];ae.tripleQuotedStrings?ge.push([y,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ae.multiLineStrings?ge.push([y,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):ge.push([y,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ae.verbatimStrings&&we.push([y,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var _e=ae.hashComments;_e&&(ae.cStyleComments?(_e>1?ge.push([w,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):ge.push([w,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),we.push([y,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):ge.push([w,/^#[^\r\n]*/,null,"#"])),ae.cStyleComments&&(we.push([w,/^\/\/[^\r\n]*/,null]),we.push([w,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Fe=ae.regexLiterals;if(Fe){var Ue=Fe>1?"":`
\r`,Be=Ue?".":"[\\S\\s]",Ze="/(?=[^/*"+Ue+"])(?:[^/\\x5B\\x5C"+Ue+"]|\\x5C"+Be+"|\\x5B(?:[^\\x5C\\x5D"+Ue+"]|\\x5C"+Be+")*(?:\\x5D|$))+/";we.push(["lang-regex",RegExp("^"+V+"("+Ze+")")])}var et=ae.types;et&&we.push([E,et]);var rt=(""+ae.keywords).replace(/^ | $/g,"");rt.length&&we.push([R,new RegExp("^(?:"+rt.replace(/[\s,]+/g,"|")+")\\b"),null]),ge.push([u,/^\s+/,null,` \r
\xA0`]);var Ye="^.[^\\s\\w.$@'\"`/\\\\]*";return ae.regexLiterals&&(Ye+="(?!s*/)"),we.push([C,/^@[a-z_$][a-z_$@0-9]*/i,null],[E,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[u,/^[a-z_$][a-z_$@0-9]*/i,null],[C,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[u,/^\\[\s\S]?/,null],[c,new RegExp(Ye),null]),me(ge,we)}var Te=Ie({keywords:x,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Oe(ae,ge,we){for(var _e=/(?:^|\s)nocode(?:\s|$)/,Fe=/\r\n?|\n/,Ue=ae.ownerDocument,Be=Ue.createElement("li");ae.firstChild;)Be.appendChild(ae.firstChild);var Ze=[Be];function et(Me){var $e=Me.nodeType;if($e==1&&!_e.test(Me.className))if(Me.nodeName==="br")rt(Me),Me.parentNode&&Me.parentNode.removeChild(Me);else for(var ut=Me.firstChild;ut;ut=ut.nextSibling)et(ut);else if(($e==3||$e==4)&&we){var je=Me.nodeValue,Ve=je.match(Fe);if(Ve){var Se=je.substring(0,Ve.index);Me.nodeValue=Se;var be=je.substring(Ve.index+Ve[0].length);if(be){var Ce=Me.parentNode;Ce.insertBefore(Ue.createTextNode(be),Me.nextSibling)}rt(Me),Se||Me.parentNode.removeChild(Me)}}}function rt(Me){for(;!Me.nextSibling;)if(Me=Me.parentNode,!Me)return;function $e(Ve,Se){var be=Se?Ve.cloneNode(!1):Ve,Ce=Ve.parentNode;if(Ce){var ne=$e(Ce,1),oe=Ve.nextSibling;ne.appendChild(be);for(var ce=oe;ce;ce=oe)oe=ce.nextSibling,ne.appendChild(ce)}return be}for(var ut=$e(Me.nextSibling,0),je;(je=ut.parentNode)&&je.nodeType===1;)ut=je;Ze.push(ut)}for(var Ye=0;Ye=Ce&&(et+=2),Ue>=ne&&(st+=2)}}finally{je&&(je.style.display=Ve)}}var Ee={};function pe(ae,ge){for(var we=ge.length;--we>=0;){var _e=ge[we];Ee.hasOwnProperty(_e)?U.console&&console.warn("cannot override language handler %s",_e):Ee[_e]=ae}}function de(ae,ge){return ae&&Ee.hasOwnProperty(ae)||(ae=/^\s*]*(?:>|$)/],[w,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[c,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^