(window.webpackJsonp=window.webpackJsonp||[]).push([[191,5,6,7,8,10,17],{"+NIl":function(I,J,P){(function(L){L(P("VrN/"))})(function(L){"use strict";L.defineMode("stex",function(u,S){"use strict";function R(f,b){f.cmdState.push(b)}function h(f){return f.cmdState.length>0?f.cmdState[f.cmdState.length-1]:null}function o(f){var b=f.cmdState.pop();b&&b.closeBracket()}function C(f){for(var b=f.cmdState,v=b.length-1;v>=0;v--){var m=b[v];if(m.name=="DEFAULT")continue;return m}return{styleIdentifier:function(){return null}}}function c(f,b,v){return function(){this.name=f,this.bracketNo=0,this.style=b,this.styles=v,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var a={};a.importmodule=c("importmodule","tag",["string","builtin"]),a.documentclass=c("documentclass","tag",["","atom"]),a.usepackage=c("usepackage","tag",["atom"]),a.begin=c("begin","tag",["atom"]),a.end=c("end","tag",["atom"]),a.label=c("label","tag",["atom"]),a.ref=c("ref","tag",["atom"]),a.eqref=c("eqref","tag",["atom"]),a.cite=c("cite","tag",["atom"]),a.bibitem=c("bibitem","tag",["atom"]),a.Bibitem=c("Bibitem","tag",["atom"]),a.RBibitem=c("RBibitem","tag",["atom"]),a.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function i(f,b){f.f=b}function r(f,b){var v;if(f.match(/^\\[a-zA-Z@]+/)){var m=f.current().slice(1);return v=a.hasOwnProperty(m)?a[m]:a.DEFAULT,v=new v,R(b,v),i(b,p),v.style}if(f.match(/^\\[$&%#{}_]/))return"tag";if(f.match(/^\\[,;!\/\\]/))return"tag";if(f.match("\\["))return i(b,function(d,g){return l(d,g,"\\]")}),"keyword";if(f.match("\\("))return i(b,function(d,g){return l(d,g,"\\)")}),"keyword";if(f.match("$$"))return i(b,function(d,g){return l(d,g,"$$")}),"keyword";if(f.match("$"))return i(b,function(d,g){return l(d,g,"$")}),"keyword";var n=f.next();if(n=="%")return f.skipToEnd(),"comment";if(n=="}"||n=="]"){if(v=h(b),v)v.closeBracket(n),i(b,p);else return"error";return"bracket"}else return n=="{"||n=="["?(v=a.DEFAULT,v=new v,R(b,v),"bracket"):/\d/.test(n)?(f.eatWhile(/[\w.%]/),"atom"):(f.eatWhile(/[\w\-_]/),v=C(b),v.name=="begin"&&(v.argument=f.current()),v.styleIdentifier())}function l(f,b,v){if(f.eatSpace())return null;if(v&&f.match(v))return i(b,r),"keyword";if(f.match(/^\\[a-zA-Z@]+/))return"tag";if(f.match(/^[a-zA-Z]+/))return"variable-2";if(f.match(/^\\[$&%#{}_]/))return"tag";if(f.match(/^\\[,;!\/]/))return"tag";if(f.match(/^[\^_&]/))return"tag";if(f.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(f.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var m=f.next();return m=="{"||m=="}"||m=="["||m=="]"||m=="("||m==")"?"bracket":m=="%"?(f.skipToEnd(),"comment"):"error"}function p(f,b){var v=f.peek(),m;return v=="{"||v=="["?(m=h(b),m.openBracket(v),f.eat(v),i(b,r),"bracket"):/[ \t\r]/.test(v)?(f.eat(v),null):(i(b,r),o(b),r(f,b))}return{startState:function(){var f=S.inMathMode?function(b,v){return l(b,v)}:r;return{cmdState:[],f}},copyState:function(f){return{cmdState:f.cmdState.slice(),f:f.f}},token:function(f,b){return b.f(f,b)},blankLine:function(f){f.f=r,f.cmdState.length=0},lineComment:"%"}}),L.defineMIME("text/x-stex","stex"),L.defineMIME("text/x-latex","stex")})},"19Vz":function(I,J,P){(function(L){L(P("VrN/"))})(function(L){L.defineOption("placeholder","",function(c,a,i){var r=i&&i!=L.Init;if(a&&!r)c.on("blur",h),c.on("change",o),c.on("swapDoc",o),L.on(c.getInputField(),"compositionupdate",c.state.placeholderCompose=function(){R(c)}),o(c);else if(!a&&r){c.off("blur",h),c.off("change",o),c.off("swapDoc",o),L.off(c.getInputField(),"compositionupdate",c.state.placeholderCompose),u(c);var l=c.getWrapperElement();l.className=l.className.replace(" CodeMirror-empty","")}a&&!c.hasFocus()&&h(c)});function u(c){c.state.placeholder&&(c.state.placeholder.parentNode.removeChild(c.state.placeholder),c.state.placeholder=null)}function S(c){u(c);var a=c.state.placeholder=document.createElement("pre");a.style.cssText="height: 0; overflow: visible",a.style.direction=c.getOption("direction"),a.className="CodeMirror-placeholder CodeMirror-line-like";var i=c.getOption("placeholder");typeof i=="string"&&(i=document.createTextNode(i)),a.appendChild(i),c.display.lineSpace.insertBefore(a,c.display.lineSpace.firstChild)}function R(c){setTimeout(function(){var a=!1,i=c.getInputField();i.nodeName=="TEXTAREA"?a=!i.value:c.lineCount()==1&&(a=!/[^\u200b]/.test(i.querySelector(".CodeMirror-line").textContent)),a?S(c):u(c)},20)}function h(c){C(c)&&S(c)}function o(c){var a=c.getWrapperElement(),i=C(c);a.className=a.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?S(c):u(c)}function C(c){return c.lineCount()===1&&c.getLine(0)===""}})},"1T2W":function(I,J,P){I.exports={"code-panel-container":"code-panel-container___1BMQ9","action-oj-bar":"action-oj-bar___1PRBr",active:"active___2710v"}},"1eCo":function(I,J,P){(function(L){L(P("VrN/"))})(function(L){"use strict";var u={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},S={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};L.defineMode("xml",function(R,h){var o=R.indentUnit,C={},c=h.htmlMode?u:S;for(var a in c)C[a]=c[a];for(var a in h)C[a]=h[a];var i,r;function l(_,N){function j(H){return N.tokenize=H,H(_,N)}var k=_.next();if(k=="<")return _.eat("!")?_.eat("[")?_.match("CDATA[")?j(b("atom","]]>")):null:_.match("--")?j(b("comment","-->")):_.match("DOCTYPE",!0,!0)?(_.eatWhile(/[\w\._\-]/),j(v(1))):null:_.eat("?")?(_.eatWhile(/[\w\._\-]/),N.tokenize=b("meta","?>"),"meta"):(i=_.eat("/")?"closeTag":"openTag",N.tokenize=p,"tag bracket");if(k=="&"){var z;return _.eat("#")?_.eat("x")?z=_.eatWhile(/[a-fA-F\d]/)&&_.eat(";"):z=_.eatWhile(/[\d]/)&&_.eat(";"):z=_.eatWhile(/[\w\.\-:]/)&&_.eat(";"),z?"atom":"error"}else return _.eatWhile(/[^&<]/),null}l.isInText=!0;function p(_,N){var j=_.next();if(j==">"||j=="/"&&_.eat(">"))return N.tokenize=l,i=j==">"?"endTag":"selfcloseTag","tag bracket";if(j=="=")return i="equals",null;if(j=="<"){N.tokenize=l,N.state=g,N.tagName=N.tagStart=null;var k=N.tokenize(_,N);return k?k+" tag error":"tag error"}else return/[\'\"]/.test(j)?(N.tokenize=f(j),N.stringStartCol=_.column(),N.tokenize(_,N)):(_.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(_){var N=function(j,k){for(;!j.eol();)if(j.next()==_){k.tokenize=p;break}return"string"};return N.isInAttribute=!0,N}function b(_,N){return function(j,k){for(;!j.eol();){if(j.match(N)){k.tokenize=l;break}j.next()}return _}}function v(_){return function(N,j){for(var k;(k=N.next())!=null;){if(k=="<")return j.tokenize=v(_+1),j.tokenize(N,j);if(k==">")if(_==1){j.tokenize=l;break}else return j.tokenize=v(_-1),j.tokenize(N,j)}return"meta"}}function m(_,N,j){this.prev=_.context,this.tagName=N,this.indent=_.indented,this.startOfLine=j,(C.doNotIndent.hasOwnProperty(N)||_.context&&_.context.noIndent)&&(this.noIndent=!0)}function n(_){_.context&&(_.context=_.context.prev)}function d(_,N){for(var j;;){if(!_.context)return;if(j=_.context.tagName,!C.contextGrabbers.hasOwnProperty(j)||!C.contextGrabbers[j].hasOwnProperty(N))return;n(_)}}function g(_,N,j){return _=="openTag"?(j.tagStart=N.column(),T):_=="closeTag"?y:g}function T(_,N,j){return _=="word"?(j.tagName=N.current(),r="tag",A):C.allowMissingTagName&&_=="endTag"?(r="tag bracket",A(_,N,j)):(r="error",T)}function y(_,N,j){if(_=="word"){var k=N.current();return j.context&&j.context.tagName!=k&&C.implicitlyClosed.hasOwnProperty(j.context.tagName)&&n(j),j.context&&j.context.tagName==k||C.matchClosing===!1?(r="tag",s):(r="tag error",M)}else return C.allowMissingTagName&&_=="endTag"?(r="tag bracket",s(_,N,j)):(r="error",M)}function s(_,N,j){return _!="endTag"?(r="error",s):(n(j),g)}function M(_,N,j){return r="error",s(_,N,j)}function A(_,N,j){if(_=="word")return r="attribute",x;if(_=="endTag"||_=="selfcloseTag"){var k=j.tagName,z=j.tagStart;return j.tagName=j.tagStart=null,_=="selfcloseTag"||C.autoSelfClosers.hasOwnProperty(k)?d(j,k):(d(j,k),j.context=new m(j,k,z==j.indented)),g}return r="error",A}function x(_,N,j){return _=="equals"?E:(C.allowMissing||(r="error"),A(_,N,j))}function E(_,N,j){return _=="string"?w:_=="word"&&C.allowUnquoted?(r="string",A):(r="error",A(_,N,j))}function w(_,N,j){return _=="string"?w:A(_,N,j)}return{startState:function(_){var N={tokenize:l,state:g,indented:_||0,tagName:null,tagStart:null,context:null};return _!=null&&(N.baseIndent=_),N},token:function(_,N){if(!N.tagName&&_.sol()&&(N.indented=_.indentation()),_.eatSpace())return null;i=null;var j=N.tokenize(_,N);return(j||i)&&j!="comment"&&(r=null,N.state=N.state(i||j,_,N),r&&(j=r=="error"?j+" error":r)),j},indent:function(_,N,j){var k=_.context;if(_.tokenize.isInAttribute)return _.tagStart==_.indented?_.stringStartCol+1:_.indented+o;if(k&&k.noIndent)return L.Pass;if(_.tokenize!=p&&_.tokenize!=l)return j?j.match(/^(\s*)/)[0].length:0;if(_.tagName)return C.multilineTagIndentPastTag!==!1?_.tagStart+_.tagName.length+2:_.tagStart+o*(C.multilineTagIndentFactor||1);if(C.alignCDATA&&/$/,blockCommentStart:"",configuration:C.htmlMode?"html":"xml",helperType:C.htmlMode?"html":"xml",skipAttribute:function(_){_.state==E&&(_.state=A)},xmlCurrentTag:function(_){return _.tagName?{name:_.tagName,close:_.type=="closeTag"}:null},xmlCurrentContext:function(_){for(var N=[],j=_.context;j;j=j.prev)j.tagName&&N.push(j.tagName);return N.reverse()}}}),L.defineMIME("text/xml","xml"),L.defineMIME("application/xml","xml"),L.mimeModes.hasOwnProperty("text/html")||L.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1uat":function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("MlIO"))})(this,function(L){return function(){var u=L,S=u.lib,R=S.Hasher,h=u.x64,o=h.Word,C=h.WordArray,c=u.algo;function a(){return o.create.apply(o,arguments)}var i=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],r=[];(function(){for(var p=0;p<80;p++)r[p]=a()})();var l=c.SHA512=R.extend({_doReset:function(){this._hash=new C.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(p,f){for(var b=this._hash.words,v=b[0],m=b[1],n=b[2],d=b[3],g=b[4],T=b[5],y=b[6],s=b[7],M=v.high,A=v.low,x=m.high,E=m.low,w=n.high,_=n.low,N=d.high,j=d.low,k=g.high,z=g.low,H=T.high,F=T.low,G=y.high,B=y.low,W=s.high,K=s.low,q=M,re=A,ee=x,Ce=E,xe=w,he=_,ke=N,_e=j,de=k,ce=z,ae=H,Se=F,te=G,ue=B,Oe=W,le=K,Q=0;Q<80;Q++){var Y,Z,be=r[Q];if(Q<16)Z=be.high=p[f+Q*2]|0,Y=be.low=p[f+Q*2+1]|0;else{var ge=r[Q-15],De=ge.high,Qe=ge.low,Ze=(De>>>1|Qe<<31)^(De>>>8|Qe<<24)^De>>>7,nt=(Qe>>>1|De<<31)^(Qe>>>8|De<<24)^(Qe>>>7|De<<25),tt=r[Q-2],lt=tt.high,st=tt.low,je=(lt>>>19|st<<13)^(lt<<3|st>>>29)^lt>>>6,Re=(st>>>19|lt<<13)^(st<<3|lt>>>29)^(st>>>6|lt<<26),et=r[Q-7],ct=et.high,$e=et.low,qe=r[Q-16],Ue=qe.high,Me=qe.low;Y=nt+$e,Z=Ze+ct+(Y>>>0>>0?1:0),Y=Y+Re,Z=Z+je+(Y>>>0>>0?1:0),Y=Y+Me,Z=Z+Ue+(Y>>>0>>0?1:0),be.high=Z,be.low=Y}var Ie=de&ae^~de&te,ye=ce&Se^~ce&ue,Te=q&ee^q&xe^ee&xe,Ae=re&Ce^re&he^Ce&he,Pe=(q>>>28|re<<4)^(q<<30|re>>>2)^(q<<25|re>>>7),Xe=(re>>>28|q<<4)^(re<<30|q>>>2)^(re<<25|q>>>7),rt=(de>>>14|ce<<18)^(de>>>18|ce<<14)^(de<<23|ce>>>9),ft=(ce>>>14|de<<18)^(ce>>>18|de<<14)^(ce<<23|de>>>9),St=i[Q],Pt=St.high,dt=St.low,At=le+ft,Ot=Oe+rt+(At>>>0>>0?1:0),At=At+ye,Ot=Ot+Ie+(At>>>0>>0?1:0),At=At+dt,Ot=Ot+Pt+(At>>>0>>0?1:0),At=At+Y,Ot=Ot+Z+(At>>>0>>0?1:0),bt=Xe+Ae,Vt=Pe+Te+(bt>>>0>>0?1:0);Oe=te,le=ue,te=ae,ue=Se,ae=de,Se=ce,ce=_e+At|0,de=ke+Ot+(ce>>>0<_e>>>0?1:0)|0,ke=xe,_e=he,xe=ee,he=Ce,ee=q,Ce=re,re=At+bt|0,q=Ot+Vt+(re>>>0>>0?1:0)|0}A=v.low=A+re,v.high=M+q+(A>>>0>>0?1:0),E=m.low=E+Ce,m.high=x+ee+(E>>>0>>0?1:0),_=n.low=_+he,n.high=w+xe+(_>>>0>>0?1:0),j=d.low=j+_e,d.high=N+ke+(j>>>0<_e>>>0?1:0),z=g.low=z+ce,g.high=k+de+(z>>>0>>0?1:0),F=T.low=F+Se,T.high=H+ae+(F>>>0>>0?1:0),B=y.low=B+ue,y.high=G+te+(B>>>0>>0?1:0),K=s.low=K+le,s.high=W+Oe+(K>>>0>>0?1:0)},_doFinalize:function(){var p=this._data,f=p.words,b=this._nDataBytes*8,v=p.sigBytes*8;f[v>>>5]|=128<<24-v%32,f[(v+128>>>10<<5)+30]=Math.floor(b/4294967296),f[(v+128>>>10<<5)+31]=b,p.sigBytes=f.length*4,this._process();var m=this._hash.toX32();return m},clone:function(){var p=R.clone.call(this);return p._hash=this._hash.clone(),p},blockSize:1024/32});u.SHA512=R._createHelper(l),u.HmacSHA512=R._createHmacHelper(l)}(),L.SHA512})},"3y9D":function(I,J,P){(function(L,u){I.exports=J=u(P("Ib8C"))})(this,function(L){return function(){var u=L,S=u.lib,R=S.WordArray,h=S.Hasher,o=u.algo,C=[],c=o.SHA1=h.extend({_doReset:function(){this._hash=new R.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(a,i){for(var r=this._hash.words,l=r[0],p=r[1],f=r[2],b=r[3],v=r[4],m=0;m<80;m++){if(m<16)C[m]=a[i+m]|0;else{var n=C[m-3]^C[m-8]^C[m-14]^C[m-16];C[m]=n<<1|n>>>31}var d=(l<<5|l>>>27)+v+C[m];m<20?d+=(p&f|~p&b)+1518500249:m<40?d+=(p^f^b)+1859775393:m<60?d+=(p&f|p&b|f&b)-1894007588:d+=(p^f^b)-899497514,v=b,b=f,f=p<<30|p>>>2,p=l,l=d}r[0]=r[0]+l|0,r[1]=r[1]+p|0,r[2]=r[2]+f|0,r[3]=r[3]+b|0,r[4]=r[4]+v|0},_doFinalize:function(){var a=this._data,i=a.words,r=this._nDataBytes*8,l=a.sigBytes*8;return i[l>>>5]|=128<<24-l%32,i[(l+64>>>9<<4)+14]=Math.floor(r/4294967296),i[(l+64>>>9<<4)+15]=r,a.sigBytes=i.length*4,this._process(),this._hash},clone:function(){var a=h.clone.call(this);return a._hash=this._hash.clone(),a}});u.SHA1=h._createHelper(c),u.HmacSHA1=h._createHmacHelper(c)}(),L.SHA1})},4:function(I,J){},"5hvy":function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("MlIO"))})(this,function(L){return function(u){var S=L,R=S.lib,h=R.WordArray,o=R.Hasher,C=S.x64,c=C.Word,a=S.algo,i=[],r=[],l=[];(function(){for(var b=1,v=0,m=0;m<24;m++){i[b+5*v]=(m+1)*(m+2)/2%64;var n=v%5,d=(2*b+3*v)%5;b=n,v=d}for(var b=0;b<5;b++)for(var v=0;v<5;v++)r[b+5*v]=v+(2*b+3*v)%5*5;for(var g=1,T=0;T<24;T++){for(var y=0,s=0,M=0;M<7;M++){if(g&1){var A=(1<>>24)&16711935|(g<<24|g>>>8)&4278255360,T=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360;var y=m[d];y.high^=T,y.low^=g}for(var s=0;s<24;s++){for(var M=0;M<5;M++){for(var A=0,x=0,E=0;E<5;E++){var y=m[M+5*E];A^=y.high,x^=y.low}var w=p[M];w.high=A,w.low=x}for(var M=0;M<5;M++)for(var _=p[(M+4)%5],N=p[(M+1)%5],j=N.high,k=N.low,A=_.high^(j<<1|k>>>31),x=_.low^(k<<1|j>>>31),E=0;E<5;E++){var y=m[M+5*E];y.high^=A,y.low^=x}for(var z=1;z<25;z++){var A,x,y=m[z],H=y.high,F=y.low,G=i[z];G<32?(A=H<>>32-G,x=F<>>32-G):(A=F<>>64-G,x=H<>>64-G);var B=p[r[z]];B.high=A,B.low=x}var W=p[0],K=m[0];W.high=K.high,W.low=K.low;for(var M=0;M<5;M++)for(var E=0;E<5;E++){var z=M+5*E,y=m[z],q=p[z],re=p[(M+1)%5+5*E],ee=p[(M+2)%5+5*E];y.high=q.high^~re.high&ee.high,y.low=q.low^~re.low&ee.low}var y=m[0],Ce=l[s];y.high^=Ce.high,y.low^=Ce.low}},_doFinalize:function(){var b=this._data,v=b.words,m=this._nDataBytes*8,n=b.sigBytes*8,d=this.blockSize*32;v[n>>>5]|=1<<24-n%32,v[(u.ceil((n+1)/d)*d>>>5)-1]|=128,b.sigBytes=v.length*4,this._process();for(var g=this._state,T=this.cfg.outputLength/8,y=T/8,s=[],M=0;M>>24)&16711935|(x<<24|x>>>8)&4278255360,E=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,s.push(E),s.push(x)}return new h.init(s,T)},clone:function(){for(var b=o.clone.call(this),v=b._state=this._state.slice(0),m=0;m<25;m++)v[m]=v[m].clone();return b}});S.SHA3=o._createHelper(f),S.HmacSHA3=o._createHmacHelper(f)}(Math),L.SHA3})},"5nXd":function(I,J,P){var L=P("MFOe"),u=L.slice,S=L.pluck,R=L.each,h=L.bind,o=L.create,C=L.isList,c=L.isFunction,a=L.isObject;I.exports={createStore:l};var i={version:"2.0.12",enabled:!1,get:function(p,f){var b=this.storage.read(this._namespacePrefix+p);return this._deserialize(b,f)},set:function(p,f){return f===void 0?this.remove(p):(this.storage.write(this._namespacePrefix+p,this._serialize(f)),f)},remove:function(p){this.storage.remove(this._namespacePrefix+p)},each:function(p){var f=this;this.storage.each(function(b,v){p.call(f,f._deserialize(b),(v||"").replace(f._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(p){return this._namespacePrefix=="__storejs_"+p+"_"},createStore:function(){return l.apply(this,arguments)},addPlugin:function(p){this._addPlugin(p)},namespace:function(p){return l(this.storage,this.plugins,p)}};function r(){var p=typeof console=="undefined"?null:console;if(!p)return;var f=p.warn?p.warn:p.log;f.apply(p,arguments)}function l(p,f,b){b||(b=""),p&&!C(p)&&(p=[p]),f&&!C(f)&&(f=[f]);var v=b?"__storejs_"+b+"_":"",m=b?new RegExp("^"+v):null,n=/^[a-zA-Z0-9_\-]*$/;if(!n.test(b))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var d={_namespacePrefix:v,_namespaceRegexp:m,_testStorage:function(T){try{var y="__storejs__test__";T.write(y,y);var s=T.read(y)===y;return T.remove(y),s}catch(M){return!1}},_assignPluginFnProp:function(T,y){var s=this[y];this[y]=function(){var A=u(arguments,0),x=this;function E(){return s?(R(arguments,function(_,N){A[N]=_}),s.apply(x,A)):void 0}var w=[E].concat(A);return T.apply(x,w)}},_serialize:function(T){return JSON.stringify(T)},_deserialize:function(T,y){if(!T)return y;var s="";try{s=JSON.parse(T)}catch(M){s=T}return s!==void 0?s:y},_addStorage:function(T){if(this.enabled)return;this._testStorage(T)&&(this.storage=T,this.enabled=!0)},_addPlugin:function(T){var y=this;if(C(T)){R(T,function(A){y._addPlugin(A)});return}var s=S(this.plugins,function(A){return T===A});if(s)return;if(this.plugins.push(T),!c(T))throw new Error("Plugins must be function values that return objects");var M=T.call(this);if(!a(M))throw new Error("Plugins must return an object of function properties");R(M,function(A,x){if(!c(A))throw new Error("Bad plugin property: "+x+" from plugin "+T.name+". Plugins should only return functions.");y._assignPluginFnProp(A,x)})},addStorage:function(T){r("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(T)}},g=o(d,i,{plugins:[]});return g.raw={},R(g,function(T,y){c(T)&&(g.raw[y]=h(g,T))}),R(p,function(T){g._addStorage(T)}),R(f,function(T){g._addPlugin(T)}),g}},"6+eU":function(I,J,P){"use strict";P.d(J,"a",function(){return s});var L=P("wx14"),u=P("rePB"),S=P("VTBJ"),R=P("1OyB"),h=P("vuIU"),o=P("Ji7U"),C=P("LK+K"),c=P("q1tI"),a=P.n(c),i=P("TSYQ"),r=P.n(i),l=function(A){var x,E="".concat(A.rootPrefixCls,"-item"),w=r()(E,"".concat(E,"-").concat(A.page),(x={},Object(u.a)(x,"".concat(E,"-active"),A.active),Object(u.a)(x,A.className,!!A.className),Object(u.a)(x,"".concat(E,"-disabled"),!A.page),x)),_=function(){A.onClick(A.page)},N=function(k){A.onKeyPress(k,A.onClick,A.page)};return a.a.createElement("li",{title:A.showTitle?A.page:null,className:w,onClick:_,onKeyPress:N,tabIndex:"0"},A.itemRender(A.page,"page",a.a.createElement("a",{rel:"nofollow"},A.page)))},p=l,f={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},b=function(M){Object(o.a)(x,M);var A=Object(C.a)(x);function x(){var E;Object(R.a)(this,x);for(var w=arguments.length,_=new Array(w),N=0;N=0||j.relatedTarget.className.indexOf("".concat(F,"-next"))>=0))return;E.setState({goInputText:""}),H(E.getValidValue())},E.go=function(j){var k=E.state.goInputText;if(k==="")return;(j.keyCode===f.ENTER||j.type==="click")&&(E.setState({goInputText:""}),E.props.quickGo(E.getValidValue()))},E}return Object(h.a)(x,[{key:"getValidValue",value:function(){var w=this.state,_=w.goInputText,N=w.current;return!_||isNaN(_)?N:Number(_)}},{key:"getPageSizeOptions",value:function(){var w=this.props,_=w.pageSize,N=w.pageSizeOptions;return N.some(function(j){return j.toString()===_.toString()})?N:N.concat([_.toString()]).sort(function(j,k){var z=isNaN(Number(j))?0:Number(j),H=isNaN(Number(k))?0:Number(k);return z-H})}},{key:"render",value:function(){var w=this,_=this.props,N=_.pageSize,j=_.locale,k=_.rootPrefixCls,z=_.changeSize,H=_.quickGo,F=_.goButton,G=_.selectComponentClass,B=_.buildOptionText,W=_.selectPrefixCls,K=_.disabled,q=this.state.goInputText,re="".concat(k,"-options"),ee=G,Ce=null,xe=null,he=null;if(!z&&!H)return null;var ke=this.getPageSizeOptions();if(z&&ee){var _e=ke.map(function(de,ce){return a.a.createElement(ee.Option,{key:ce,value:de.toString()},(B||w.buildOptionText)(de))});Ce=a.a.createElement(ee,{disabled:K,prefixCls:W,showSearch:!1,className:"".concat(re,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(N||ke[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ce){return ce.parentNode}},_e)}return H&&(F&&(he=typeof F=="boolean"?a.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:K,className:"".concat(re,"-quick-jumper-button")},j.jump_to_confirm):a.a.createElement("span",{onClick:this.go,onKeyUp:this.go},F)),xe=a.a.createElement("div",{className:"".concat(re,"-quick-jumper")},j.jump_to,a.a.createElement("input",{disabled:K,type:"text",value:q,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),j.page,he)),a.a.createElement("li",{className:"".concat(re)},Ce,xe)}}]),x}(a.a.Component);b.defaultProps={pageSizeOptions:["10","20","50","100"]};var v=b,m=P("N2Kk");function n(){}function d(M){return typeof M=="number"&&isFinite(M)&&Math.floor(M)===M}function g(M,A,x){return x}function T(M,A,x){var E=typeof M=="undefined"?A.pageSize:M;return Math.floor((x.total-1)/E)+1}var y=function(M){Object(o.a)(x,M);var A=Object(C.a)(x);function x(E){var w;Object(R.a)(this,x),w=A.call(this,E),w.getJumpPrevPage=function(){return Math.max(1,w.state.current-(w.props.showLessItems?3:5))},w.getJumpNextPage=function(){return Math.min(T(void 0,w.state,w.props),w.state.current+(w.props.showLessItems?3:5))},w.getItemIcon=function(z,H){var F=w.props.prefixCls,G=z||a.a.createElement("button",{type:"button","aria-label":H,className:"".concat(F,"-item-link")});return typeof z=="function"&&(G=a.a.createElement(z,Object(S.a)({},w.props))),G},w.savePaginationNode=function(z){w.paginationNode=z},w.isValid=function(z){return d(z)&&z!==w.state.current},w.shouldDisplayQuickJumper=function(){var z=w.props,H=z.showQuickJumper,F=z.pageSize,G=z.total;return G<=F?!1:H},w.handleKeyDown=function(z){(z.keyCode===f.ARROW_UP||z.keyCode===f.ARROW_DOWN)&&z.preventDefault()},w.handleKeyUp=function(z){var H=w.getValidValue(z),F=w.state.currentInputValue;H!==F&&w.setState({currentInputValue:H}),z.keyCode===f.ENTER?w.handleChange(H):z.keyCode===f.ARROW_UP?w.handleChange(H-1):z.keyCode===f.ARROW_DOWN&&w.handleChange(H+1)},w.changePageSize=function(z){var H=w.state.current,F=T(z,w.state,w.props);H=H>F?F:H,F===0&&(H=w.state.current),typeof z=="number"&&("pageSize"in w.props||w.setState({pageSize:z}),"current"in w.props||w.setState({current:H,currentInputValue:H})),w.props.onShowSizeChange(H,z),"onChange"in w.props&&w.props.onChange&&w.props.onChange(H,z)},w.handleChange=function(z){var H=w.props.disabled,F=z;if(w.isValid(F)&&!H){var G=T(void 0,w.state,w.props);F>G?F=G:F<1&&(F=1),"current"in w.props||w.setState({current:F,currentInputValue:F});var B=w.state.pageSize;return w.props.onChange(F,B),F}return w.state.current},w.prev=function(){w.hasPrev()&&w.handleChange(w.state.current-1)},w.next=function(){w.hasNext()&&w.handleChange(w.state.current+1)},w.jumpPrev=function(){w.handleChange(w.getJumpPrevPage())},w.jumpNext=function(){w.handleChange(w.getJumpNextPage())},w.hasPrev=function(){return w.state.current>1},w.hasNext=function(){return w.state.current2?F-2:0),B=2;B=N?k=N:k=Number(_),k}},{key:"getShowSizeChanger",value:function(){var w=this.props,_=w.showSizeChanger,N=w.total,j=w.totalBoundaryShowSizeChanger;return typeof _!="undefined"?_:N>j}},{key:"renderPrev",value:function(w){var _=this.props,N=_.prevIcon,j=_.itemRender,k=j(w,"prev",this.getItemIcon(N,"prev page")),z=!this.hasPrev();return Object(c.isValidElement)(k)?Object(c.cloneElement)(k,{disabled:z}):k}},{key:"renderNext",value:function(w){var _=this.props,N=_.nextIcon,j=_.itemRender,k=j(w,"next",this.getItemIcon(N,"next page")),z=!this.hasNext();return Object(c.isValidElement)(k)?Object(c.cloneElement)(k,{disabled:z}):k}},{key:"render",value:function(){var w=this,_=this.props,N=_.prefixCls,j=_.className,k=_.style,z=_.disabled,H=_.hideOnSinglePage,F=_.total,G=_.locale,B=_.showQuickJumper,W=_.showLessItems,K=_.showTitle,q=_.showTotal,re=_.simple,ee=_.itemRender,Ce=_.showPrevNextJumpers,xe=_.jumpPrevIcon,he=_.jumpNextIcon,ke=_.selectComponentClass,_e=_.selectPrefixCls,de=_.pageSizeOptions,ce=this.state,ae=ce.current,Se=ce.pageSize,te=ce.currentInputValue;if(H===!0&&F<=Se)return null;var ue=T(void 0,this.state,this.props),Oe=[],le=null,Q=null,Y=null,Z=null,be=null,ge=B&&B.goButton,De=W?1:2,Qe=ae-1>0?ae-1:0,Ze=ae+1=De*2&&ae!==1+2&&(Oe[0]=Object(c.cloneElement)(Oe[0],{className:"".concat(N,"-item-after-jump-prev")}),Oe.unshift(le)),ue-ae>=De*2&&ae!==ue-2&&(Oe[Oe.length-1]=Object(c.cloneElement)(Oe[Oe.length-1],{className:"".concat(N,"-item-before-jump-next")}),Oe.push(Q)),et!==1&&Oe.unshift(Y),ct!==ue&&Oe.push(Z)}var Ue=null;q&&(Ue=a.a.createElement("li",{className:"".concat(N,"-total-text")},q(F,[F===0?0:(ae-1)*Se+1,ae*Se>F?F:ae*Se])));var Me=!this.hasPrev()||!ue,Ie=!this.hasNext()||!ue;return a.a.createElement("ul",Object(L.a)({className:r()(N,j,Object(u.a)({},"".concat(N,"-disabled"),z)),style:k,unselectable:"unselectable",ref:this.savePaginationNode},nt),Ue,a.a.createElement("li",{title:K?G.prev_page:null,onClick:this.prev,tabIndex:Me?null:0,onKeyPress:this.runIfEnterPrev,className:r()("".concat(N,"-prev"),Object(u.a)({},"".concat(N,"-disabled"),Me)),"aria-disabled":Me},this.renderPrev(Qe)),Oe,a.a.createElement("li",{title:K?G.next_page:null,onClick:this.next,tabIndex:Ie?null:0,onKeyPress:this.runIfEnterNext,className:r()("".concat(N,"-next"),Object(u.a)({},"".concat(N,"-disabled"),Ie)),"aria-disabled":Ie},this.renderNext(Ze)),a.a.createElement(v,{disabled:z,locale:G,rootPrefixCls:N,selectComponentClass:ke,selectPrefixCls:_e,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:ae,pageSize:Se,pageSizeOptions:de,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:ge}))}}],[{key:"getDerivedStateFromProps",value:function(w,_){var N={};if("current"in w&&(N.current=w.current,w.current!==_.current&&(N.currentInputValue=N.current)),"pageSize"in w&&w.pageSize!==_.pageSize){var j=_.current,k=T(w.pageSize,_,w);j=j>k?k:j,"current"in w||(N.current=j,N.currentInputValue=j),N.pageSize=w.pageSize}return N}}]),x}(a.a.Component);y.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:n,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:n,locale:m.a,style:{},itemRender:g,totalBoundaryShowSizeChanger:50};var s=y},"6RRn":function(I,J,P){"use strict";var L=P("wCXF"),u=P("n6Qo");P.d(J,"b",function(){return u.a});var S=P("IBYe"),R=P("6eGT"),h=P("hW8S");P.d(J,"a",function(){return h.a}),J.c=L.b},"6eGT":function(I,J,P){"use strict";function L(u){return null}J.a=L},"7Cbv":function(I,J,P){"use strict";var L=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),u=new Uint8Array(16);function S(){if(!L)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return L(u)}var R=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function h(p){return typeof p=="string"&&R.test(p)}for(var o=h,C=[],c=0;c<256;++c)C.push((c+256).toString(16).substr(1));function a(p){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,b=(C[p[f+0]]+C[p[f+1]]+C[p[f+2]]+C[p[f+3]]+"-"+C[p[f+4]]+C[p[f+5]]+"-"+C[p[f+6]]+C[p[f+7]]+"-"+C[p[f+8]]+C[p[f+9]]+"-"+C[p[f+10]]+C[p[f+11]]+C[p[f+12]]+C[p[f+13]]+C[p[f+14]]+C[p[f+15]]).toLowerCase();if(!o(b))throw TypeError("Stringified UUID is invalid");return b}var i=a;function r(p,f,b){p=p||{};var v=p.random||(p.rng||S)();if(v[6]=v[6]&15|64,v[8]=v[8]&63|128,f){b=b||0;for(var m=0;m<16;++m)f[b+m]=v[m];return f}return i(v)}var l=J.a=r},"7ahc":function(I,J,P){"use strict";P.d(J,"a",function(){return T});var L=P("k1fw"),u=P("0Owb"),S=P("+L6B"),R=P("2/Rp"),h=P("y8nQ"),o=P("Vl3Y"),C=P("tJVT"),c=P("OaEy"),a=P("2fM7"),i=P("q1tI"),r=P.n(i),l=P("VrN/"),p=P.n(l),f=P("p77/"),b=P.n(f),v=P("c5Ni"),m=P.n(v),n=a.a.Option,d={labelCol:{span:4},wrapperCol:{span:20}},g={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"]};J.b=function(y){var s=y.callback,M=y.onCancel,A=Object(i.useState)("python"),x=Object(C.a)(A,2),E=x[0],w=x[1];function _(j){w(g[j][1])}function N(j){s(j)}return r.a.createElement(o.a,Object(u.a)({},d,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:N}),r.a.createElement(o.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},r.a.createElement(a.a,{onChange:_},Object.keys(g).map(function(j){return r.a.createElement(n,{key:j,value:j},g[j][0])}))),r.a.createElement(o.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},r.a.createElement(T,{mode:E})),r.a.createElement("div",{className:"flex-container flex-end"},r.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),r.a.createElement(R.a,{type:"ghost",onClick:M},"\u53D6\u6D88")))};function T(y){var s=y.value,M=y.onChange,A=y.mode,x=y.options,E=x===void 0?{}:x,w=Object(i.useRef)(),_=Object(i.useState)(),N=Object(C.a)(_,2),j=N[0],k=N[1];return Object(i.useEffect)(function(){if(j){function z(H){var F=H.getValue();M&&M(F)}return j.on("change",z),function(){j.off("change",z)}}},[j,M]),Object(i.useEffect)(function(){j&&j.setOption("mode",A)},[j,A]),Object(i.useEffect)(function(){j&&((s!==j.getValue()||s==="")&&setTimeout(function(){j.setValue(s||" ")},300))},[j,s]),Object(i.useEffect)(function(){if(w.current&&!j){var z=p.a.fromTextArea(w.current,Object(L.a)({mode:A,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},E));k(z)}},[w.current,j]),r.a.createElement("div",{className:"my-codemirror-container"},r.a.createElement("textarea",{ref:w}))}},"815F":function(I,J,P){"use strict";P.d(J,"e",function(){return C}),P.d(J,"c",function(){return a}),P.d(J,"d",function(){return i}),P.d(J,"a",function(){return l}),P.d(J,"f",function(){return p}),P.d(J,"b",function(){return f});var L=P("KQm4"),u=P("VTBJ"),S=P("Ff2n"),R=P("Zm9Q"),h=P("Kwbf"),o=P("OZM5");function C(b,v){return b!=null?b:v}function c(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],v=new Map;function m(n){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(n||[]).forEach(function(g){var T=g.key,y=g.children;Object(h.a)(T!=null,"Tree node must have a certain key: [".concat(d).concat(T,"]"));var s=String(T);Object(h.a)(!v.has(s)||T===null||T===void 0,"Same 'key' exist in the Tree: ".concat(s)),v.set(s,!0),m(y,"".concat(d).concat(s," > "))})}m(b)}function a(b){function v(m){var n=Object(R.a)(m);return n.map(function(d){if(!Object(o.i)(d))return Object(h.a)(!d,"Tree/TreeNode can only accept TreeNode as children."),null;var g=d.key,T=d.props,y=T.children,s=Object(S.a)(T,["children"]),M=Object(u.a)({key:g},s),A=v(y);return A.length&&(M.children=A),M}).filter(function(d){return d})}return v(b)}function i(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],m=new Set(v===!0?[]:v),n=[];function d(g){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return g.map(function(y,s){var M=Object(o.h)(T?T.pos:"0",s),A=C(y.key,M),x=Object(u.a)(Object(u.a)({},y),{},{parent:T,pos:M,children:null,data:y,isStart:[].concat(Object(L.a)(T?T.isStart:[]),[s===0]),isEnd:[].concat(Object(L.a)(T?T.isEnd:[]),[s===g.length-1])});return n.push(x),v===!0||m.has(A)?x.children=d(y.children||[],x):x.children=[],x})}return d(b),n}function r(b,v,m){var n;m?typeof m=="string"?n=function(T){return T[m]}:typeof m=="function"&&(n=function(T){return m(T)}):n=function(T,y){return C(T.key,y)};function d(g,T,y){var s=g?g.children:b,M=g?Object(o.h)(y.pos,T):"0";if(g){var A=n(g,M),x={node:g,index:T,pos:M,key:A,parentPos:y.node?y.pos:null,level:y.level+1};v(x)}s&&s.forEach(function(E,w){d(E,w,{node:g,pos:M,level:y?y.level+1:-1})})}d(null)}function l(b){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=v.initWrapper,n=v.processEntity,d=v.onProcessFinished,g=arguments.length>2?arguments[2]:void 0,T={},y={},s={posEntities:T,keyEntities:y};return m&&(s=m(s)||s),r(b,function(M){var A=M.node,x=M.index,E=M.pos,w=M.key,_=M.parentPos,N=M.level,j={node:A,index:x,key:w,pos:E,level:N},k=C(w,E);T[E]=j,y[k]=j,j.parent=T[_],j.parent&&(j.parent.children=j.parent.children||[],j.parent.children.push(j)),n&&n(j,s)},g),d&&d(s),s}function p(b,v){var m=v.expandedKeys,n=v.selectedKeys,d=v.loadedKeys,g=v.loadingKeys,T=v.checkedKeys,y=v.halfCheckedKeys,s=v.dragOverNodeKey,M=v.dropPosition,A=v.keyEntities,x=A[b],E={eventKey:b,expanded:m.indexOf(b)!==-1,selected:n.indexOf(b)!==-1,loaded:d.indexOf(b)!==-1,loading:g.indexOf(b)!==-1,checked:T.indexOf(b)!==-1,halfChecked:y.indexOf(b)!==-1,pos:String(x?x.pos:""),dragOver:s===b&&M===0,dragOverGapTop:s===b&&M===-1,dragOverGapBottom:s===b&&M===1};return E}function f(b){var v=b.data,m=b.expanded,n=b.selected,d=b.checked,g=b.loaded,T=b.loading,y=b.halfChecked,s=b.dragOver,M=b.dragOverGapTop,A=b.dragOverGapBottom,x=b.pos,E=b.active,w=Object(u.a)(Object(u.a)({},v),{},{expanded:m,selected:n,checked:d,loaded:g,loading:T,halfChecked:y,dragOver:s,dragOverGapTop:M,dragOverGapBottom:A,pos:x,active:E});return"props"in w||Object.defineProperty(w,"props",{get:function(){return Object(h.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),b}}),w}},"8EBN":function(I,J,P){(function(L){L(P("VrN/"))})(function(L){"use strict";L.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 u=0;u-1&&R.substring(C+1,R.length);if(c)return L.findModeByExtension(c)},L.findModeByName=function(R){R=R.toLowerCase();for(var h=0;h=ne.length?me.slice(ne.length):me}).join(`
`)}var m=[],n=[""],d=new f.a.Renderer,g=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function T(){m.length=0,n=[""]}var y={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function s(se,V,X,ne){if(V>=se.length||se[V].level<=X)return V;var me=se[V];ne.push("- "+me.text+""),V++;var ie=[];return V=s(se,V,me.level,ie),ie.length>0&&(ne.push("
"),ie.forEach(function(ze){ne.push(ze)}),ne.push("
")),ne.push(" "),V=s(se,V,X,ne),V}function M(){return s(m,0,0,n),n.push("
"),n.join("")}var A={heading:function(V){var X=g.exec(V);if(X)return{type:"heading",raw:X[0],depth:X[1].length,text:X[2]}},fences:function(V){var X=this.rules.block.fences.exec(V);if(X){var ne=X[0],me=v(ne,X[3]||""),ie=X[2]?X[2].trim():X[2];if(["latex","katex","math"].indexOf(ie)>=0){var ze=w(),pt=me;me=ze,_[ze]={type:"block",expression:pt}}return{type:"code",raw:ne,lang:ie,text:me}}}},x=/(?:\${2})([^\n`]+?)(?:\${2})/gi,E=0,w=function(){return"__special_katext_id_".concat(E++,"__")},_={};function N(){return _}function j(){E=0,_={}}function k(se){return se=se.replace(x,function(V,X){var ne=w();return _[ne]={type:"inline",expression:X},ne}),se}var z=d.listitem;d.listitem=function(se){return z(k(se))};var H=d.paragraph;d.paragraph=function(se){return H(k(se))};var F=d.tablecell;d.tablecell=function(se,V){return F(k(se),V)},d.code=function(se,V,X){var ne=(V||"").match(/\S*/)[0];return ne?["latex","katex","math"].indexOf(ne)>=0?"".concat(se,"
"):'
').concat(X?se:Object(b.escape)(se,!0),`
`):''+(X?se:Object(b.escape)(se,!0))+"
"},d.heading=function(se,V,X){var ne=this.options.headerPrefix+X.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return m.push({anchor:ne,level:V,text:se}),"'+se+""},f.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),f.a.use({tokenizer:A,renderer:d});var G=f.a,B=P("SJMd"),W=P("ulZh"),K=P.n(W),q=P("m3rI"),re=P("Oy/b"),ee=P("p5ED"),Ce=P("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var xe=function(se,V){return(xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,ne){X.__proto__=ne}||function(X,ne){for(var me in ne)Object.prototype.hasOwnProperty.call(ne,me)&&(X[me]=ne[me])})(se,V)};function he(se,V){function X(){this.constructor=se}xe(se,V),se.prototype=V===null?Object.create(V):(X.prototype=V.prototype,new X)}function ke(se,V,X,ne){return new(X||(X=Promise))(function(me,ie){function ze(It){try{ot(ne.next(It))}catch(gt){ie(gt)}}function pt(It){try{ot(ne.throw(It))}catch(gt){ie(gt)}}function ot(It){var gt;It.done?me(It.value):(gt=It.value,gt instanceof X?gt:new X(function(Ht){Ht(gt)})).then(ze,pt)}ot((ne=ne.apply(se,V||[])).next())})}function _e(se,V){var X,ne,me,ie,ze={label:0,sent:function(){if(1&me[0])throw me[1];return me[1]},trys:[],ops:[]};return ie={next:pt(0),throw:pt(1),return:pt(2)},typeof Symbol=="function"&&(ie[Symbol.iterator]=function(){return this}),ie;function pt(ot){return function(It){return function(gt){if(X)throw new TypeError("Generator is already executing.");for(;ze;)try{if(X=1,ne&&(me=2>[0]?ne.return:gt[0]?ne.throw||((me=ne.return)&&me.call(ne),0):ne.next)&&!(me=me.call(ne,gt[1])).done)return me;switch(ne=0,me&&(gt=[2>[0],me.value]),gt[0]){case 0:case 1:me=gt;break;case 4:return ze.label++,{value:gt[1],done:!1};case 5:ze.label++,ne=gt[1],gt=[0];continue;case 7:gt=ze.ops.pop(),ze.trys.pop();continue;default:if(!(me=ze.trys,(me=me.length>0&&me[me.length-1])||gt[0]!==6&>[0]!==2)){ze=0;continue}if(gt[0]===3&&(!me||gt[1]>me[0]&>[1]',"select"),this.addActionButton(ne,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(ne,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(ne,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(ne,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(ne,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(ne,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(ne,'',"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(ie){var ze=document.createElement("div");ze.className=""+X.toolbarButtonStyleClass.name,ze.setAttribute("data-type-name",ie.typeName),ze.innerHTML=ie.icon,ze.addEventListener("click",function(){X.markerToolbarButtonClicked(ze,ie)}),X.buttons.push(ze),X.markerButtons.push(ze)}),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 me=document.createElement("div");me.className=this.toolbarBlockStyleClass.name,me.style.whiteSpace="nowrap",me.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(me),this.addActionButton(me,'',"render"),this.addActionButton(me,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},se.prototype.addButtonClickListener=function(V){this.buttonClickListeners.push(V)},se.prototype.removeButtonClickListener=function(V){this.buttonClickListeners.indexOf(V)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(V),1)},se.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},se.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var V=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var X=0;X0&&this.buttonClickListeners.forEach(function(ne){return ne("marker",X)}),this.markerButtonOverflowBlock.style.display="none"},se.prototype.actionToolbarButtonClicked=function(V,X){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ne){return ne("action",X)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},se.prototype.setActiveButton=function(V){this.resetButtonStyles(),V.className=V.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),V.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},se.prototype.setActiveMarkerButton=function(V){var X=this.markerButtons.find(function(ne){return ne.getAttribute("data-type-name")===V});X&&this.setActiveButton(X)},se.prototype.setCurrentMarker=function(V){var X=this;this.currentMarker=V,this.buttons.filter(function(ne){return/delete|notes/.test(ne.getAttribute("data-action"))}).forEach(function(ne){X.currentMarker===void 0?(ne.style.fillOpacity="0.4",ne.style.pointerEvents="none"):(ne.style.fillOpacity="1",ne.style.pointerEvents="all")})},se}(),Y=function(){function se(V,X,ne,me){this.panels=[],this.panelButtons=[],this.markerjsContainer=V,this.displayMode=X,this.uiStyleSettings=ne,this.styles=me,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return se.prototype.addStyles=function(){var V;this.toolboxStyleClass=this.styles.addClass(new le("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 le("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var X=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new le("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new le("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new le("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 le("toolbox-panel-row_colors",`
background-color: `+((V=this.uiStyleSettings.toolboxBackgroundColor)!==null&&V!==void 0?V:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new le("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*X)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*X)+`px;
padding: `+X+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new le("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new le("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Oe("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Oe("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},se.prototype.show=function(V){var X;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=V,this.uiContainer.className=this.toolboxStyleClass.name+" "+((X=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&X!==void 0?X:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},se.prototype.setPanelButtons=function(V){var X,ne,me=this;this.panels=V,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((X=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&X!==void 0?X:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((ne=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&ne!==void 0?ne:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(ie){var ze;ie.uiStyleSettings=me.uiStyleSettings;var pt=document.createElement("div");pt.className=me.toolboxButtonStyleClass.name+" "+((ze=me.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ze!==void 0?ze:me.toolboxButtonStyleColorsClass.name),pt.innerHTML=ie.icon,pt.title=ie.title,pt.addEventListener("click",function(){me.panelButtonClick(ie)}),me.panelButtons.push(pt),me.buttonRow.appendChild(pt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},se.prototype.panelButtonClick=function(V){var X=this,ne=-1;if(V!==this.activePanel){ne=this.panels.indexOf(V),this.panelRow.innerHTML="";var me=V.getUi();me.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(me),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=V}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){X.displayMode==="inline"?X.panelRow.style.display="none":X.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(ie,ze){var pt,ot;ie.className=X.toolboxButtonStyleClass.name+" "+(ze===ne?""+((pt=X.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&pt!==void 0?pt:X.toolboxActiveButtonStyleColorsClass.name):""+((ot=X.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ot!==void 0?ot:X.toolboxButtonStyleColorsClass.name))})},se}(),Z=function(se,V){this.title=se,this.icon=V},be=function(se){function V(X,ne,me,ie){var ze=se.call(this,X,ie||'')||this;return ze.colors=[],ze.addTransparent=!1,ze.colorBoxes=[],ze.colors=ne,ze.currentColor=me,ze.setCurrentColor=ze.setCurrentColor.bind(ze),ze.getColorBox=ze.getColorBox.bind(ze),ze}return he(V,se),V.prototype.getUi=function(){var X=this,ne=document.createElement("div");return ne.style.overflow="hidden",ne.style.whiteSpace="nowrap",this.colors.forEach(function(me){var ie=X.getColorBox(me);ne.appendChild(ie),X.colorBoxes.push(ie)}),ne},V.prototype.getColorBox=function(X){var ne=this,me=this.uiStyleSettings.toolbarHeight/4,ie=this.uiStyleSettings.toolbarHeight-me,ze=document.createElement("div");ze.style.display="inline-block",ze.style.boxSizing="content-box",ze.style.width=ie-2+"px",ze.style.height=ie-2+"px",ze.style.padding="1px",ze.style.marginRight="2px",ze.style.marginBottom="2px",ze.style.borderWidth="2px",ze.style.borderStyle="solid",ze.style.borderRadius=(ie+2)/2+"px",ze.style.borderColor=X===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ze.addEventListener("click",function(){ne.setCurrentColor(X,ze)});var pt=document.createElement("div");return pt.style.display="inline-block",pt.style.width=ie-2+"px",pt.style.height=ie-2+"px",pt.style.backgroundColor=X,pt.style.borderRadius=ie/2+"px",X==="transparent"&&(pt.style.fill=this.uiStyleSettings.toolboxAccentColor,pt.innerHTML=``),ze.appendChild(pt),ze},V.prototype.setCurrentColor=function(X,ne){var me=this;this.currentColor=X,this.colorBoxes.forEach(function(ie){ie.style.borderColor=ie===ne?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(X)},V}(Z),ge=function(){function se(V,X,ne){this._state="new",this._isSelected=!1,this._container=V,this._overlayContainer=X,this.globalSettings=ne,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(se.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),se.prototype.ownsTarget=function(V){return!1},Object.defineProperty(se.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),se.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},se.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},se.prototype.pointerDown=function(V,X){},se.prototype.dblClick=function(V,X){},se.prototype.manipulate=function(V){},se.prototype.pointerUp=function(V){this.stateChanged()},se.prototype.dispose=function(){},se.prototype.addMarkerVisualToContainer=function(V){this.container.childNodes.length>0?this.container.insertBefore(V,this.container.childNodes[0]):this.container.appendChild(V)},se.prototype.getState=function(){return{typeName:se.typeName,state:this.state,notes:this.notes}},se.prototype.restoreState=function(V){this._state=V.state,this.notes=V.notes},se.prototype.scale=function(V,X){},se.prototype.colorChanged=function(V){this.onColorChanged&&this.onColorChanged(V),this.stateChanged()},se.prototype.fillColorChanged=function(V){this.onFillColorChanged&&this.onFillColorChanged(V),this.stateChanged()},se.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var V=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),V.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(V)&&this.onStateChanged(this)}},se.typeName="MarkerBase",se}(),De=function(){function se(){this.findGripByVisual=this.findGripByVisual.bind(this)}return se.prototype.findGripByVisual=function(V){return this.topLeft.ownsTarget(V)?this.topLeft:this.topCenter.ownsTarget(V)?this.topCenter:this.topRight.ownsTarget(V)?this.topRight:this.centerLeft.ownsTarget(V)?this.centerLeft:this.centerRight.ownsTarget(V)?this.centerRight:this.bottomLeft.ownsTarget(V)?this.bottomLeft:this.bottomCenter.ownsTarget(V)?this.bottomCenter:this.bottomRight.ownsTarget(V)?this.bottomRight:void 0},se}(),Qe=function(){function se(){this.GRIP_SIZE=10,this.visual=ce.createGroup(),this.visual.appendChild(ce.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ce.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return se.prototype.ownsTarget=function(V){return V===this.visual||V===this.visual.childNodes[0]||V===this.visual.childNodes[1]},se}(),Ze=function(){function se(){}return se.toITransformMatrix=function(V){return{a:V.a,b:V.b,c:V.c,d:V.d,e:V.e,f:V.f}},se.toSVGMatrix=function(V,X){return V.a=X.a,V.b=X.b,V.c=X.c,V.d=X.d,V.e=X.e,V.f=X.f,V},se}(),nt=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.left=0,ie.top=0,ie.width=0,ie.height=0,ie.defaultSize={x:50,y:20},ie.offsetX=0,ie.offsetY=0,ie.rotationAngle=0,ie.CB_DISTANCE=10,ie._suppressMarkerCreateEvent=!1,ie.container.transform.baseVal.appendItem(ce.createTransform()),ie.setupControlBox(),ie}return he(V,se),Object.defineProperty(V.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"visual",{get:function(){return this._visual},set:function(X){this._visual=X;var ne=ce.createTransform();this._visual.transform.baseVal.appendItem(ne)},enumerable:!1,configurable:!0}),V.prototype.ownsTarget=function(X){return!!se.prototype.ownsTarget.call(this,X)||!!(this.controlGrips.findGripByVisual(X)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(X))},V.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.state==="new"&&(this.left=X.x,this.top=X.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var me=this.unrotatePoint(X);if(this.manipulationStartX=me.x,this.manipulationStartY=me.y,this.offsetX=me.x-this.left,this.offsetY=me.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(ne),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(ne)){this.activeGrip=this.rotatorGrip;var ie=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=ie.x-this.width/2,this.top=ie.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ze=this.container.transform.baseVal.getItem(0);ze.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ze,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},V.prototype.pointerUp=function(X){var ne=this.state;se.prototype.pointerUp.call(this,X),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(X),this._state="select",ne==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},V.prototype.moveVisual=function(X){this.visual.style.transform="translate("+X.x+"px, "+X.y+"px)"},V.prototype.manipulate=function(X){var ne=this.unrotatePoint(X);this.state==="creating"?this.resize(X):this.state==="move"?(this.left=this.manipulationStartLeft+(ne.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(ne.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(ne):this.state==="rotate"&&this.rotate(X)},V.prototype.resize=function(X){var ne=this.manipulationStartLeft,me=this.manipulationStartWidth,ie=this.manipulationStartTop,ze=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:ne=this.manipulationStartLeft+X.x-this.manipulationStartX,me=this.manipulationStartWidth+this.manipulationStartLeft-ne;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:me=this.manipulationStartWidth+X.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:ie=this.manipulationStartTop+X.y-this.manipulationStartY,ze=this.manipulationStartHeight+this.manipulationStartTop-ie;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ze=this.manipulationStartHeight+X.y-this.manipulationStartY}me>=0?(this.left=ne,this.width=me):(this.left=ne+me,this.width=-me),ze>=0?(this.top=ie,this.height=ze):(this.top=ie+ze,this.height=-ze),this.setSize()},V.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},V.prototype.rotate=function(X){if(Math.abs(X.x-this.centerX)>.1){var ne=Math.sign(X.x-this.centerX);this.rotationAngle=180*Math.atan((X.y-this.centerY)/(X.x-this.centerX))/Math.PI+90*ne,this.applyRotation()}},V.prototype.applyRotation=function(){var X=this.container.transform.baseVal.getItem(0);X.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(X,0)},V.prototype.rotatePoint=function(X){if(this.rotationAngle===0)return X;var ne=this.container.getCTM(),me=ce.createPoint(X.x,X.y);return{x:(me=me.matrixTransform(ne)).x,y:me.y}},V.prototype.unrotatePoint=function(X){if(this.rotationAngle===0)return X;var ne=this.container.getCTM();ne=ne.inverse();var me=ce.createPoint(X.x,X.y);return{x:(me=me.matrixTransform(ne)).x,y:me.y}},V.prototype.select=function(){se.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},V.prototype.deselect=function(){se.prototype.deselect.call(this),this.controlBox.style.display="none"},V.prototype.setupControlBox=function(){this.controlBox=ce.createGroup();var X=ce.createTransform();X.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(X),this.container.appendChild(this.controlBox),this.controlRect=ce.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=ce.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 De,this.addControlGrips(),this.controlBox.style.display="none"},V.prototype.adjustControlBox=function(){var X=this.controlBox.transform.baseVal.getItem(0);X.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(X,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()},V.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()},V.prototype.createGrip=function(){var X=new Qe;return X.visual.transform.baseVal.appendItem(ce.createTransform()),this.controlBox.appendChild(X.visual),X},V.prototype.positionGrips=function(){var X=this.controlGrips.topLeft.GRIP_SIZE,ne=-X/2,me=ne,ie=(this.width+this.CB_DISTANCE)/2-X/2,ze=(this.height+this.CB_DISTANCE)/2-X/2,pt=this.height+this.CB_DISTANCE-X/2,ot=this.width+this.CB_DISTANCE-X/2;this.positionGrip(this.controlGrips.topLeft.visual,ne,me),this.positionGrip(this.controlGrips.topCenter.visual,ie,me),this.positionGrip(this.controlGrips.topRight.visual,ot,me),this.positionGrip(this.controlGrips.centerLeft.visual,ne,ze),this.positionGrip(this.controlGrips.centerRight.visual,ot,ze),this.positionGrip(this.controlGrips.bottomLeft.visual,ne,pt),this.positionGrip(this.controlGrips.bottomCenter.visual,ie,pt),this.positionGrip(this.controlGrips.bottomRight.visual,ot,pt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,ie,me-3*this.CB_DISTANCE)},V.prototype.positionGrip=function(X,ne,me){var ie=X.transform.baseVal.getItem(0);ie.setTranslate(ne,me),X.transform.baseVal.replaceItem(ie,0)},V.prototype.hideControlBox=function(){this.controlBox.style.display="none"},V.prototype.showControlBox=function(){this.controlBox.style.display=""},V.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Ze.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Ze.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},se.prototype.getState.call(this))},V.prototype.restoreState=function(X){se.prototype.restoreState.call(this,X);var ne=X;this.left=ne.left,this.top=ne.top,this.width=ne.width,this.height=ne.height,this.rotationAngle=ne.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Ze.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,ne.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Ze.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,ne.containerTransformMatrix))},V.prototype.scale=function(X,ne){se.prototype.scale.call(this,X,ne);var me=this.rotatePoint({x:this.left,y:this.top}),ie=this.unrotatePoint({x:me.x*X,y:me.y*ne});this.left=ie.x,this.top=ie.y,this.width=this.width*X,this.height=this.height*ne,this.adjustControlBox()},V}(ge),tt=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.fillColor="transparent",ie.strokeColor="transparent",ie.strokeWidth=0,ie.strokeDasharray="",ie.opacity=1,ie.setStrokeColor=ie.setStrokeColor.bind(ie),ie.setFillColor=ie.setFillColor.bind(ie),ie.setStrokeWidth=ie.setStrokeWidth.bind(ie),ie.setStrokeDasharray=ie.setStrokeDasharray.bind(ie),ie.createVisual=ie.createVisual.bind(ie),ie}return he(V,se),V.prototype.ownsTarget=function(X){return!(!se.prototype.ownsTarget.call(this,X)&&X!==this.visual)},V.prototype.createVisual=function(){this.visual=ce.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)},V.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.state==="new"&&(this.createVisual(),this.moveVisual(X),this._state="creating")},V.prototype.manipulate=function(X){se.prototype.manipulate.call(this,X)},V.prototype.resize=function(X){se.prototype.resize.call(this,X),this.setSize()},V.prototype.setSize=function(){se.prototype.setSize.call(this),ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},V.prototype.pointerUp=function(X){se.prototype.pointerUp.call(this,X),this.setSize()},V.prototype.setStrokeColor=function(X){this.strokeColor=X,this.visual&&ce.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(X),this.stateChanged()},V.prototype.setFillColor=function(X){this.fillColor=X,this.visual&&ce.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},V.prototype.setStrokeWidth=function(X){this.strokeWidth=X,this.visual&&ce.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},V.prototype.setStrokeDasharray=function(X){this.strokeDasharray=X,this.visual&&ce.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},V.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},se.prototype.getState.call(this))},V.prototype.restoreState=function(X){var ne=X;this.fillColor=ne.fillColor,this.strokeColor=ne.strokeColor,this.strokeWidth=ne.strokeWidth,this.strokeDasharray=ne.strokeDasharray,this.opacity=ne.opacity,this.createVisual(),se.prototype.restoreState.call(this,X),this.setSize()},V.prototype.scale=function(X,ne){se.prototype.scale.call(this,X,ne),this.setSize()},V.title="Rectangle marker",V}(nt),lt=function(se){function V(X,ne,me,ie){var ze=se.call(this,X,ie||'')||this;return ze.widths=[],ze.widthBoxes=[],ze.widths=ne,ze.currentWidth=me,ze.setCurrentWidth=ze.setCurrentWidth.bind(ze),ze}return he(V,se),V.prototype.getUi=function(){var X=this,ne=document.createElement("div");return ne.style.display="flex",ne.style.overflow="hidden",ne.style.flexGrow="2",this.widths.forEach(function(me){var ie=document.createElement("div");ie.style.display="flex",ie.style.flexGrow="2",ie.style.alignItems="center",ie.style.justifyContent="space-between",ie.style.padding="5px",ie.style.borderWidth="2px",ie.style.borderStyle="solid",ie.style.borderColor=me===X.currentWidth?X.uiStyleSettings.toolboxAccentColor:"transparent",ie.addEventListener("click",function(){X.setCurrentWidth(me,ie)}),ne.appendChild(ie);var ze=document.createElement("div");ze.innerText=me.toString(),ze.style.marginRight="5px",ie.appendChild(ze);var pt=document.createElement("div");pt.style.minHeight="20px",pt.style.flexGrow="2",pt.style.display="flex",pt.style.alignItems="center";var ot=document.createElement("hr");ot.style.minWidth="20px",ot.style.border="0px",ot.style.borderTop=me+"px solid "+X.uiStyleSettings.toolboxColor,ot.style.flexGrow="2",pt.appendChild(ot),ie.appendChild(pt),X.widthBoxes.push(ie)}),ne},V.prototype.setCurrentWidth=function(X,ne){var me=this;this.currentWidth=X,this.widthBoxes.forEach(function(ie){ie.style.borderColor=ie===ne?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},V}(Z),st=function(se){function V(X,ne,me,ie){var ze=se.call(this,X,ie||'')||this;return ze.styles=[],ze.styleBoxes=[],ze.styles=ne,ze.currentStyle=me,ze.setCurrentStyle=ze.setCurrentStyle.bind(ze),ze}return he(V,se),V.prototype.getUi=function(){var X=this,ne=document.createElement("div");return ne.style.display="flex",ne.style.overflow="hidden",ne.style.flexGrow="2",this.styles.forEach(function(me){var ie=document.createElement("div");ie.style.display="flex",ie.style.alignItems="center",ie.style.justifyContent="space-between",ie.style.padding="5px",ie.style.borderWidth="2px",ie.style.borderStyle="solid",ie.style.overflow="hidden",ie.style.maxWidth=100/X.styles.length-5+"%",ie.style.borderColor=me===X.currentStyle?X.uiStyleSettings.toolboxAccentColor:"transparent",ie.addEventListener("click",function(){X.setCurrentStyle(me,ie)}),ne.appendChild(ie);var ze=document.createElement("div");ze.style.minHeight="20px",ze.style.flexGrow="2",ze.style.overflow="hidden";var pt=``;ze.innerHTML=pt,ie.appendChild(ze),X.styleBoxes.push(ie)}),ne},V.prototype.setCurrentStyle=function(X,ne){var me=this;this.currentStyle=X,this.styleBoxes.forEach(function(ie){ie.style.borderColor=ie===ne?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},V}(Z),je=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.strokeColor=me.defaultColor,ie.strokeWidth=me.defaultStrokeWidth,ie.strokeDasharray=me.defaultStrokeDasharray,ie.strokePanel=new be("Line color",me.defaultColorSet,me.defaultColor),ie.strokePanel.onColorChanged=ie.setStrokeColor,ie.strokeWidthPanel=new lt("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),ie.strokeWidthPanel.onWidthChanged=ie.setStrokeWidth,ie.strokeStylePanel=new st("Line style",me.defaultStrokeDasharrays,me.defaultStrokeDasharray),ie.strokeStylePanel.onStyleChanged=ie.setStrokeDasharray,ie}return he(V,se),Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),V.prototype.getState=function(){var X=se.prototype.getState.call(this);return X.typeName=V.typeName,X},V.typeName="FrameMarker",V.title="Frame marker",V.icon='',V}(tt),Re=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},et=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.x1=0,ie.y1=0,ie.x2=0,ie.y2=0,ie.defaultLength=50,ie.manipulationStartX=0,ie.manipulationStartY=0,ie.manipulationStartX1=0,ie.manipulationStartY1=0,ie.manipulationStartX2=0,ie.manipulationStartY2=0,ie.setupControlBox(),ie}return he(V,se),V.prototype.ownsTarget=function(X){return!!se.prototype.ownsTarget.call(this,X)||!(!this.grip1.ownsTarget(X)&&!this.grip2.ownsTarget(X))},V.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.manipulationStartX=X.x,this.manipulationStartY=X.y,this.state==="new"&&(this.x1=X.x,this.y1=X.y,this.x2=X.x,this.y2=X.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(ne)?this.activeGrip=this.grip1:this.grip2.ownsTarget(ne)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},V.prototype.pointerUp=function(X){var ne=this.state;se.prototype.pointerUp.call(this,X),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(X),this._state="select",ne==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},V.prototype.adjustVisual=function(){},V.prototype.manipulate=function(X){this.state==="creating"?this.resize(X):this.state==="move"?(this.x1=this.manipulationStartX1+X.x-this.manipulationStartX,this.y1=this.manipulationStartY1+X.y-this.manipulationStartY,this.x2=this.manipulationStartX2+X.x-this.manipulationStartX,this.y2=this.manipulationStartY2+X.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(X)},V.prototype.resize=function(X){switch(this.activeGrip){case this.grip1:this.x1=X.x,this.y1=X.y;break;case this.grip2:case void 0:this.x2=X.x,this.y2=X.y}this.adjustVisual(),this.adjustControlBox()},V.prototype.select=function(){se.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},V.prototype.deselect=function(){se.prototype.deselect.call(this),this.controlBox.style.display="none"},V.prototype.setupControlBox=function(){this.controlBox=ce.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},V.prototype.adjustControlBox=function(){this.positionGrips()},V.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},V.prototype.createGrip=function(){var X=new Qe;return X.visual.transform.baseVal.appendItem(ce.createTransform()),this.controlBox.appendChild(X.visual),X},V.prototype.positionGrips=function(){var X=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-X/2,this.y1-X/2),this.positionGrip(this.grip2.visual,this.x2-X/2,this.y2-X/2)},V.prototype.positionGrip=function(X,ne,me){var ie=X.transform.baseVal.getItem(0);ie.setTranslate(ne,me),X.transform.baseVal.replaceItem(ie,0)},V.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},se.prototype.getState.call(this))},V.prototype.restoreState=function(X){se.prototype.restoreState.call(this,X);var ne=X;this.x1=ne.x1,this.y1=ne.y1,this.x2=ne.x2,this.y2=ne.y2},V.prototype.scale=function(X,ne){se.prototype.scale.call(this,X,ne),this.x1=this.x1*X,this.y1=this.y1*ne,this.x2=this.x2*X,this.y2=this.y2*ne,this.adjustVisual(),this.adjustControlBox()},V}(ge),ct=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.strokeColor="transparent",ie.strokeWidth=0,ie.strokeDasharray="",ie.setStrokeColor=ie.setStrokeColor.bind(ie),ie.setStrokeWidth=ie.setStrokeWidth.bind(ie),ie.setStrokeDasharray=ie.setStrokeDasharray.bind(ie),ie.strokeColor=me.defaultColor,ie.strokeWidth=me.defaultStrokeWidth,ie.strokeDasharray=me.defaultStrokeDasharray,ie.strokePanel=new be("Line color",me.defaultColorSet,me.defaultColor),ie.strokePanel.onColorChanged=ie.setStrokeColor,ie.strokeWidthPanel=new lt("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),ie.strokeWidthPanel.onWidthChanged=ie.setStrokeWidth,ie.strokeStylePanel=new st("Line style",me.defaultStrokeDasharrays,me.defaultStrokeDasharray),ie.strokeStylePanel.onStyleChanged=ie.setStrokeDasharray,ie}return he(V,se),V.prototype.ownsTarget=function(X){return!(!se.prototype.ownsTarget.call(this,X)&&X!==this.visual&&X!==this.selectorLine&&X!==this.visibleLine)},V.prototype.createVisual=function(){this.visual=ce.createGroup(),this.selectorLine=ce.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ce.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)},V.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},V.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()),ce.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ce.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},V.prototype.setStrokeColor=function(X){this.strokeColor=X,this.adjustVisual(),this.colorChanged(X)},V.prototype.setStrokeWidth=function(X){this.strokeWidth=X,this.adjustVisual()},V.prototype.setStrokeDasharray=function(X){this.strokeDasharray=X,this.adjustVisual(),this.stateChanged()},Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),V.prototype.getState=function(){var X=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},se.prototype.getState.call(this));return X.typeName=V.typeName,X},V.prototype.restoreState=function(X){se.prototype.restoreState.call(this,X);var ne=X;this.strokeColor=ne.strokeColor,this.strokeWidth=ne.strokeWidth,this.strokeDasharray=ne.strokeDasharray,this.createVisual(),this.adjustVisual()},V.typeName="LineMarker",V.title="Line marker",V.icon='',V}(et),$e=function(se){function V(X,ne,me,ie){var ze=se.call(this,X,ie||'')||this;return ze.fonts=[],ze.fontBoxes=[],ze.fonts=ne,ze.currentFont=me,ze.setCurrentFont=ze.setCurrentFont.bind(ze),ze}return he(V,se),V.prototype.getUi=function(){var X=this,ne=document.createElement("div");return ne.style.overflow="hidden",ne.style.flexGrow="2",this.fonts.forEach(function(me){var ie=document.createElement("div");ie.style.display="inline-block",ie.style.alignItems="center",ie.style.justifyContent="space-between",ie.style.padding="5px",ie.style.borderWidth="2px",ie.style.borderStyle="solid",ie.style.overflow="hidden",ie.style.maxWidth=100/X.fonts.length-5+"%",ie.style.borderColor=me===X.currentFont?X.uiStyleSettings.toolboxAccentColor:"transparent",ie.addEventListener("click",function(){X.setCurrentFont(me,ie)}),ne.appendChild(ie);var ze=document.createElement("div");ze.style.display="flex",ze.style.minHeight="20px",ze.style.flexGrow="2",ze.style.fontFamily=me,ze.style.overflow="hidden";var pt=document.createElement("div");pt.style.whiteSpace="nowrap",pt.style.overflow="hidden",pt.style.textOverflow="ellipsis",pt.innerHTML="The quick brown fox jumps over the lazy dog",ze.appendChild(pt),ie.appendChild(ze),X.fontBoxes.push(ie)}),ne},V.prototype.setCurrentFont=function(X,ne){var me=this;this.currentFont=X,this.fontBoxes.forEach(function(ie){ie.style.borderColor=ie===ne?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},V}(Z),qe=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.color="transparent",ie.padding=5,ie.DEFAULT_TEXT="your text here",ie.text=ie.DEFAULT_TEXT,ie.isMoved=!1,ie.color=me.defaultColor,ie.fontFamily=me.defaultFontFamily,ie.defaultSize={x:100,y:30},ie.setColor=ie.setColor.bind(ie),ie.setFont=ie.setFont.bind(ie),ie.renderText=ie.renderText.bind(ie),ie.sizeText=ie.sizeText.bind(ie),ie.textEditDivClicked=ie.textEditDivClicked.bind(ie),ie.showTextEditor=ie.showTextEditor.bind(ie),ie.setSize=ie.setSize.bind(ie),ie.positionTextEditor=ie.positionTextEditor.bind(ie),ie.colorPanel=new be("Color",me.defaultColorSet,me.defaultColor),ie.colorPanel.onColorChanged=ie.setColor,ie.fontFamilyPanel=new $e("Font",me.defaultFontFamilies,me.defaultFontFamily),ie.fontFamilyPanel.onFontChanged=ie.setFont,ie}return he(V,se),V.prototype.ownsTarget=function(X){if(se.prototype.ownsTarget.call(this,X)||X===this.visual||X===this.textElement||X===this.bgRectangle)return!0;var ne=!1;return this.textElement.childNodes.forEach(function(me){me===X&&(ne=!0)}),ne},V.prototype.createVisual=function(){this.visual=ce.createGroup(),this.bgRectangle=ce.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ce.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ce.createTransform()),this.textElement.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},V.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.isMoved=!1,this.pointerDownPoint=X,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(X),this._state="creating")},V.prototype.renderText=function(){var X=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(ne){X.textElement.appendChild(ce.createTSpan(ne.trim()===""?" ":ne.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},V.prototype.getTextScale=function(){var X=this.textElement.getBBox(),ne=1;if(X.width>0&&X.height>0){var me=(1*this.width-this.width*this.padding*2/100)/X.width,ie=(1*this.height-this.height*this.padding*2/100)/X.height;ne=Math.min(me,ie)}return ne},V.prototype.getTextPosition=function(X){var ne=this.textElement.getBBox(),me=0,ie=0;return ne.width>0&&ne.height>0&&(me=(this.width-ne.width*X)/2,ie=this.height/2-ne.height*X/2),{x:me,y:ie}},V.prototype.sizeText=function(){var X=this.textElement.getBBox(),ne=this.getTextScale(),me=this.getTextPosition(ne);me.y-=X.y*ne,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+me.x+"px, "+me.y+"px) scale("+ne+", "+ne+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(me.x,me.y),this.textElement.transform.baseVal.getItem(1).setScale(ne,ne))},V.prototype.manipulate=function(X){se.prototype.manipulate.call(this,X),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(X.x-this.pointerDownPoint.x)>5||Math.abs(X.y-this.pointerDownPoint.y)>5)},V.prototype.resize=function(X){se.prototype.resize.call(this,X),this.isMoved=!0,this.setSize(),this.sizeText()},V.prototype.setSize=function(){se.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},V.prototype.pointerUp=function(X){var ne=this.state;ne==="creating"&&(this._suppressMarkerCreateEvent=!0),se.prototype.pointerUp.call(this,X),this.setSize(),(ne==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},V.prototype.showTextEditor=function(){var X=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(ne){ne.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var ne=Number.parseFloat(X.textEditor.style.fontSize);X.textEditor.clientWidth>=Number.parseInt(X.textEditor.style.maxWidth)&&ne>.9;)ne-=.1,X.textEditor.style.fontSize=Math.max(ne,.9)+"em"}),this.textEditor.addEventListener("keyup",function(ne){ne.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(ne){if(ne.clipboardData){var me=ne.clipboardData.getData("text"),ie=window.getSelection();if(!ie.rangeCount)return!1;ie.deleteFromDocument(),ie.getRangeAt(0).insertNode(document.createTextNode(me)),ne.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){X.textEditDivClicked(X.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},V.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var X=this.getTextScale(),ne=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),me=this.textElement.getBBox(),ie={x:me.width*X,y:me.height*X};ne.x-=ie.x/2,ne.y-=ie.y/2,this.textEditor.style.top=ne.y+"px",this.textEditor.style.left=ne.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-ne.x+"px",this.textEditor.style.fontSize=Math.max(16*X,12)+"px",this.textElement.style.display="none"}},V.prototype.textEditDivClicked=function(X){this.text=X.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},V.prototype.select=function(){se.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},V.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),se.prototype.deselect.call(this)},V.prototype.dblClick=function(X,ne){se.prototype.dblClick.call(this,X,ne),this.showTextEditor()},V.prototype.setColor=function(X){this.textElement&&ce.setAttributes(this.textElement,[["fill",X]]),this.color=X,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(X)},V.prototype.setFont=function(X){this.textElement&&ce.setAttributes(this.textElement,[["font-family",X]]),this.fontFamily=X,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},V.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},V.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),V.prototype.getState=function(){var X=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},se.prototype.getState.call(this));return X.typeName=V.typeName,X},V.prototype.restoreState=function(X){var ne=X;this.color=ne.color,this.fontFamily=ne.fontFamily,this.padding=ne.padding,this.text=ne.text,this.createVisual(),se.prototype.restoreState.call(this,X),this.setSize()},V.prototype.scale=function(X,ne){se.prototype.scale.call(this,X,ne),this.setSize(),this.sizeText(),this.positionTextEditor()},V.typeName="TextMarker",V.title="Text marker",V.icon='',V}(nt),Ue=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.color="transparent",ie.lineWidth=3,ie.drawing=!1,ie.pixelRatio=1,ie.color=me.defaultColor,ie.lineWidth=me.defaultStrokeWidth,ie.pixelRatio=me.freehandPixelRatio,ie.setColor=ie.setColor.bind(ie),ie.addCanvas=ie.addCanvas.bind(ie),ie.finishCreation=ie.finishCreation.bind(ie),ie.setLineWidth=ie.setLineWidth.bind(ie),ie.colorPanel=new be("Color",me.defaultColorSet,me.defaultColor),ie.colorPanel.onColorChanged=ie.setColor,ie.lineWidthPanel=new lt("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),ie.lineWidthPanel.onWidthChanged=ie.setLineWidth,ie}return he(V,se),V.prototype.ownsTarget=function(X){return!(!se.prototype.ownsTarget.call(this,X)&&X!==this.visual&&X!==this.drawingImage)},V.prototype.createVisual=function(){this.visual=ce.createGroup(),this.drawingImage=ce.createImage(),this.visual.appendChild(this.drawingImage);var X=ce.createTransform();this.visual.transform.baseVal.appendItem(X),this.addMarkerVisualToContainer(this.visual)},V.prototype.pointerDown=function(X,ne){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(X.x,X.y),this.drawing=!0):se.prototype.pointerDown.call(this,X,ne)},V.prototype.manipulate=function(X){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(X.x,X.y),this.canvasContext.stroke()):se.prototype.manipulate.call(this,X)},V.prototype.resize=function(X){se.prototype.resize.call(this,X),ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},V.prototype.pointerUp=function(X){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):se.prototype.pointerUp.call(this,X)},V.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)},V.prototype.select=function(){this.state==="creating"&&this.finishCreation(),se.prototype.select.call(this)},V.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),se.prototype.deselect.call(this)},V.prototype.finishCreation=function(){for(var X=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),ne=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],me=ne[0],ie=ne[1],ze=ne[2],pt=ne[3],ot=!1,It=0;It0&&(ot=!0,Itpt&&(pt=It),gt>ze&&(ze=gt));if(ot){this.left=me/this.pixelRatio,this.top=ie/this.pixelRatio,this.width=(ze-me)/this.pixelRatio,this.height=(pt-ie)/this.pixelRatio;var Ht=document.createElement("canvas");Ht.width=ze-me,Ht.height=pt-ie,Ht.getContext("2d").putImageData(this.canvasContext.getImageData(me,ie,ze-me,pt-ie),0,0),this.drawingImgUrl=Ht.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},V.prototype.setDrawingImage=function(){ce.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},V.prototype.setColor=function(X){this.color=X,this.colorChanged(X)},V.prototype.setLineWidth=function(X){this.lineWidth=X},Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),V.prototype.getState=function(){var X=Object.assign({drawingImgUrl:this.drawingImgUrl},se.prototype.getState.call(this));return X.typeName=V.typeName,X},V.prototype.restoreState=function(X){this.createVisual(),se.prototype.restoreState.call(this,X),this.drawingImgUrl=X.drawingImgUrl,this.setDrawingImage()},V.prototype.scale=function(X,ne){se.prototype.scale.call(this,X,ne),this.setDrawingImage()},V.typeName="FreehandMarker",V.title="Freehand marker",V.icon='',V}(nt),Me=function(se){function V(X,ne,me){var ie=se.call(this,X,me||'')||this;return ie.typeBoxes=[],ie.currentType=ne,ie.setCurrentType=ie.setCurrentType.bind(ie),ie}return he(V,se),V.prototype.getUi=function(){var X=this,ne=document.createElement("div");ne.style.display="flex",ne.style.overflow="hidden",ne.style.flexGrow="2";for(var me=function(pt){var ot="both";switch(pt){case 0:ot="both";break;case 1:ot="start";break;case 2:ot="end";break;case 3:ot="none"}var It=document.createElement("div");if(It.style.display="flex",It.style.flexGrow="2",It.style.alignItems="center",It.style.justifyContent="space-between",It.style.padding="5px",It.style.borderWidth="2px",It.style.borderStyle="solid",It.style.borderColor=ot===ie.currentType?ie.uiStyleSettings.toolboxAccentColor:"transparent",It.addEventListener("click",function(){X.setCurrentType(ot,It)}),ne.appendChild(It),ot==="both"||ot==="start"){var gt=document.createElement("div");gt.style.display="flex",gt.style.alignItems="center",gt.style.minHeight="20px",gt.innerHTML=``,gt.style.marginLeft="5px",It.appendChild(gt)}var Ht=document.createElement("div");Ht.style.display="flex",Ht.style.alignItems="center",Ht.style.minHeight="20px",Ht.style.flexGrow="2";var Xt=document.createElement("hr");if(Xt.style.minWidth="20px",Xt.style.border="0px",Xt.style.borderTop="3px solid "+(ie.uiStyleSettings!==void 0?ie.uiStyleSettings.toolboxColor:"#eeeeee"),Xt.style.flexGrow="2",Ht.appendChild(Xt),It.appendChild(Ht),ot==="both"||ot==="end"){var Sr=document.createElement("div");Sr.style.display="flex",Sr.style.alignItems="center",Sr.style.minHeight="20px",Sr.innerHTML=``,Sr.style.marginRight="5px",It.appendChild(Sr)}ie.typeBoxes.push(It)},ie=this,ze=0;ze<4;ze++)me(ze);return ne},V.prototype.setCurrentType=function(X,ne){var me=this;this.currentType=X,this.typeBoxes.forEach(function(ie){ie.style.borderColor=ie===ne?me.uiStyleSettings!==void 0?me.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},V}(Z),Ie=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.arrowType="end",ie.arrowBaseHeight=10,ie.arrowBaseWidth=10,ie.getArrowPoints=ie.getArrowPoints.bind(ie),ie.setArrowType=ie.setArrowType.bind(ie),ie.arrowTypePanel=new Me("Arrow type","end"),ie.arrowTypePanel.onArrowTypeChanged=ie.setArrowType,ie}return he(V,se),V.prototype.ownsTarget=function(X){return!(!se.prototype.ownsTarget.call(this,X)&&X!==this.arrow1&&X!==this.arrow2)},V.prototype.getArrowPoints=function(X,ne){var me=this.arrowBaseWidth+2*this.strokeWidth,ie=this.arrowBaseHeight+2*this.strokeWidth;return X-me/2+","+(ne+ie/2)+" "+X+","+(ne-ie/2)+" "+(X+me/2)+","+(ne+ie/2)},V.prototype.createTips=function(){this.arrow1=ce.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ce.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.arrow2)},V.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.state==="creating"&&this.createTips()},V.prototype.adjustVisual=function(){if(se.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",ce.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ce.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var X=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ne=this.arrow1.transform.baseVal.getItem(0);ne.setRotate(X,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(ne,0);var me=this.arrow2.transform.baseVal.getItem(0);me.setRotate(X+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(me,0)}},V.prototype.setArrowType=function(X){this.arrowType=X,this.adjustVisual(),this.stateChanged()},Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),V.prototype.getState=function(){var X=Object.assign({arrowType:this.arrowType},se.prototype.getState.call(this));return X.typeName=V.typeName,X},V.prototype.restoreState=function(X){se.prototype.restoreState.call(this,X);var ne=X;this.arrowType=ne.arrowType,this.createTips(),this.adjustVisual()},V.typeName="ArrowMarker",V.title="Arrow marker",V.icon='',V}(ct),ye=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.fillColor=me.defaultFillColor,ie.strokeWidth=0,ie.fillPanel=new be("Color",me.defaultColorSet,me.defaultFillColor),ie.fillPanel.onColorChanged=ie.setFillColor,ie}return he(V,se),Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),V.prototype.getState=function(){var X=se.prototype.getState.call(this);return X.typeName=V.typeName,X},V.typeName="CoverMarker",V.title="Cover marker",V.icon='',V}(tt),Te=function(se){function V(X,ne,me,ie){var ze=se.call(this,X,ie||'')||this;return ze.opacities=[],ze.opacityBoxes=[],ze.opacities=ne,ze.currentOpacity=me,ze.setCurrentOpacity=ze.setCurrentOpacity.bind(ze),ze}return he(V,se),V.prototype.getUi=function(){var X=this,ne=document.createElement("div");return ne.style.display="flex",ne.style.overflow="hidden",ne.style.flexGrow="2",ne.style.justifyContent="space-between",this.opacities.forEach(function(me){var ie=document.createElement("div");ie.style.display="flex",ie.style.alignItems="center",ie.style.justifyContent="center",ie.style.padding="5px",ie.style.borderWidth="2px",ie.style.borderStyle="solid",ie.style.borderColor=me===X.currentOpacity?X.uiStyleSettings.toolboxAccentColor:"transparent",ie.addEventListener("click",function(){X.setCurrentOpacity(me,ie)}),ne.appendChild(ie);var ze=document.createElement("div");ze.innerText=100*me+"%",ie.appendChild(ze),X.opacityBoxes.push(ie)}),ne},V.prototype.setCurrentOpacity=function(X,ne){var me=this;this.currentOpacity=X,this.opacityBoxes.forEach(function(ie){ie.style.borderColor=ie===ne?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},V}(Z),Ae=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.setOpacity=ie.setOpacity.bind(ie),ie.fillColor=me.defaultHighlightColor,ie.strokeWidth=0,ie.opacity=me.defaultHighlightOpacity,ie.fillPanel=new be("Color",me.defaultColorSet,ie.fillColor),ie.fillPanel.onColorChanged=ie.setFillColor,ie.opacityPanel=new Te("Opacity",me.defaultOpacitySteps,ie.opacity),ie.opacityPanel.onOpacityChanged=ie.setOpacity,ie}return he(V,se),V.prototype.setOpacity=function(X){this.opacity=X,this.visual&&ce.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),V.prototype.getState=function(){var X=se.prototype.getState.call(this);return X.typeName=V.typeName,X},V.typeName="HighlightMarker",V.title="Highlight marker",V.icon='',V}(ye),Pe='',Xe=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.bgColor="transparent",ie.tipPosition={x:0,y:0},ie.tipBase1Position={x:0,y:0},ie.tipBase2Position={x:0,y:0},ie.tipMoving=!1,ie.color=me.defaultStrokeColor,ie.bgColor=me.defaultFillColor,ie.fontFamily=me.defaultFontFamily,ie.defaultSize={x:100,y:30},ie.setBgColor=ie.setBgColor.bind(ie),ie.getTipPoints=ie.getTipPoints.bind(ie),ie.positionTip=ie.positionTip.bind(ie),ie.setTipPoints=ie.setTipPoints.bind(ie),ie.colorPanel=new be("Text color",me.defaultColorSet,ie.color,''),ie.colorPanel.onColorChanged=ie.setColor,ie.bgColorPanel=new be("Fill color",me.defaultColorSet,ie.bgColor,Pe),ie.bgColorPanel.onColorChanged=ie.setBgColor,ie.fontFamilyPanel=new $e("Font",me.defaultFontFamilies,me.defaultFontFamily),ie.fontFamilyPanel.onFontChanged=ie.setFont,ie.tipGrip=new Qe,ie.tipGrip.visual.transform.baseVal.appendItem(ce.createTransform()),ie.controlBox.appendChild(ie.tipGrip.visual),ie}return he(V,se),V.prototype.ownsTarget=function(X){return se.prototype.ownsTarget.call(this,X)||this.tipGrip.ownsTarget(X)||this.tip===X},V.prototype.createTip=function(){ce.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ce.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},V.prototype.pointerDown=function(X,ne){this.state==="new"&&se.prototype.pointerDown.call(this,X,ne),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(ne)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):se.prototype.pointerDown.call(this,X,ne)},V.prototype.pointerUp=function(X){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,se.prototype.pointerUp.call(this,X);else{var ne=this.state==="creating";se.prototype.pointerUp.call(this,X),this.setTipPoints(ne),this.positionTip()}},V.prototype.manipulate=function(X){if(this.tipMoving){var ne=this.unrotatePoint(X);this.tipPosition={x:ne.x-this.manipulationStartLeft,y:ne.y-this.manipulationStartTop},this.positionTip()}else se.prototype.manipulate.call(this,X)},V.prototype.setBgColor=function(X){this.bgRectangle&&this.tip&&(ce.setAttributes(this.bgRectangle,[["fill",X]]),ce.setAttributes(this.tip,[["fill",X]])),this.bgColor=X,this.fillColorChanged(X)},V.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},V.prototype.setTipPoints=function(X){X===void 0&&(X=!1);var ne=Math.min(this.height/2,15),me=this.height/5;X&&(this.tipPosition={x:ne+me/2,y:this.height+20});var ie=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?ie',V}(qe),rt=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.fillColor="transparent",ie.strokeColor="transparent",ie.strokeWidth=0,ie.strokeDasharray="",ie.opacity=1,ie.strokeColor=me.defaultColor,ie.strokeWidth=me.defaultStrokeWidth,ie.strokeDasharray=me.defaultStrokeDasharray,ie.fillColor=me.defaultFillColor,ie.setStrokeColor=ie.setStrokeColor.bind(ie),ie.setFillColor=ie.setFillColor.bind(ie),ie.setStrokeWidth=ie.setStrokeWidth.bind(ie),ie.setStrokeDasharray=ie.setStrokeDasharray.bind(ie),ie.setOpacity=ie.setOpacity.bind(ie),ie.createVisual=ie.createVisual.bind(ie),ie.strokePanel=new be("Line color",de(me.defaultColorSet,["transparent"]),me.defaultColor),ie.strokePanel.onColorChanged=ie.setStrokeColor,ie.fillPanel=new be("Fill color",de(me.defaultColorSet,["transparent"]),ie.fillColor,Pe),ie.fillPanel.onColorChanged=ie.setFillColor,ie.strokeWidthPanel=new lt("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),ie.strokeWidthPanel.onWidthChanged=ie.setStrokeWidth,ie.strokeStylePanel=new st("Line style",me.defaultStrokeDasharrays,me.defaultStrokeDasharray),ie.strokeStylePanel.onStyleChanged=ie.setStrokeDasharray,ie.opacityPanel=new Te("Opacity",me.defaultOpacitySteps,ie.opacity),ie.opacityPanel.onOpacityChanged=ie.setOpacity,ie}return he(V,se),V.prototype.ownsTarget=function(X){return!(!se.prototype.ownsTarget.call(this,X)&&X!==this.visual)},V.prototype.createVisual=function(){this.visual=ce.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)},V.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.state==="new"&&(this.createVisual(),this.moveVisual(X),this._state="creating")},V.prototype.manipulate=function(X){se.prototype.manipulate.call(this,X)},V.prototype.resize=function(X){se.prototype.resize.call(this,X),this.setSize()},V.prototype.setSize=function(){se.prototype.setSize.call(this),ce.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},V.prototype.pointerUp=function(X){se.prototype.pointerUp.call(this,X),this.setSize()},V.prototype.setStrokeColor=function(X){this.strokeColor=X,this.visual&&ce.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(X),this.stateChanged()},V.prototype.setFillColor=function(X){this.fillColor=X,this.visual&&ce.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(X),this.stateChanged()},V.prototype.setStrokeWidth=function(X){this.strokeWidth=X,this.visual&&ce.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},V.prototype.setStrokeDasharray=function(X){this.strokeDasharray=X,this.visual&&ce.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},V.prototype.setOpacity=function(X){this.opacity=X,this.visual&&ce.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),V.prototype.getState=function(){var X=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},se.prototype.getState.call(this));return X.typeName=V.typeName,X},V.prototype.restoreState=function(X){var ne=X;this.fillColor=ne.fillColor,this.strokeColor=ne.strokeColor,this.strokeWidth=ne.strokeWidth,this.strokeDasharray=ne.strokeDasharray,this.opacity=ne.opacity,this.createVisual(),se.prototype.restoreState.call(this,X),this.setSize()},V.prototype.scale=function(X,ne){se.prototype.scale.call(this,X,ne),this.setSize()},V.typeName="EllipseMarker",V.title="Ellipse marker",V.icon='',V}(nt),ft=function(se){function V(X,ne,me){return se.call(this,X,ne,me)||this}return he(V,se),Object.defineProperty(V.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),V.prototype.ownsTarget=function(X){return!(!se.prototype.ownsTarget.call(this,X)&&X!==this.tip1&&X!==this.tip2)},V.prototype.createTips=function(){this.tip1=ce.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(ce.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ce.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(ce.createTransform()),this.visual.appendChild(this.tip2)},V.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.state==="creating"&&this.createTips()},V.prototype.adjustVisual=function(){if(se.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ce.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()]]),ce.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 X=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ne=this.tip1.transform.baseVal.getItem(0);ne.setRotate(X,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(ne,0);var me=this.tip2.transform.baseVal.getItem(0);me.setRotate(X+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(me,0)}},Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),V.prototype.getState=function(){var X=se.prototype.getState.call(this);return X.typeName=V.typeName,X},V.prototype.restoreState=function(X){se.prototype.restoreState.call(this,X),this.createTips(),this.adjustVisual()},V.typeName="MeasurementMarker",V.title="Measurement marker",V.icon='',V}(ct),St=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.strokePanel.colors=me.defaultColorSet,ie.fillColor="transparent",ie}return he(V,se),Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),V.prototype.getState=function(){var X=se.prototype.getState.call(this);return X.typeName=V.typeName,X},V.typeName="EllipseFrameMarker",V.title="Ellipse frame marker",V.icon='',V}(rt),Pt=function(){function se(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(se.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),se.prototype.addUndoStep=function(V){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(V)||(this.undoStack.push(V),JSON.stringify(this.lastRedoStep)!==JSON.stringify(V)&&this.redoStack.splice(0,this.redoStack.length))},se.prototype.replaceLastUndoStep=function(V){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=V)},se.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},se.prototype.undo=function(){if(this.undoStack.length>1){var V=this.undoStack.pop();return V!==void 0&&this.redoStack.push(V),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},se.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},se}(),dt=function(se){function V(X,ne,me){var ie=se.call(this,X,ne,me)||this;return ie.strokeColor="transparent",ie.strokeWidth=0,ie.strokeDasharray="",ie.curveX=0,ie.curveY=0,ie.manipulationStartCurveX=0,ie.manipulationStartCurveY=0,ie.setStrokeColor=ie.setStrokeColor.bind(ie),ie.setStrokeWidth=ie.setStrokeWidth.bind(ie),ie.setStrokeDasharray=ie.setStrokeDasharray.bind(ie),ie.positionGrips=ie.positionGrips.bind(ie),ie.addControlGrips=ie.addControlGrips.bind(ie),ie.adjustVisual=ie.adjustVisual.bind(ie),ie.setupControlBox=ie.setupControlBox.bind(ie),ie.resize=ie.resize.bind(ie),ie.strokeColor=me.defaultColor,ie.strokeWidth=me.defaultStrokeWidth,ie.strokeDasharray=me.defaultStrokeDasharray,ie.strokePanel=new be("Line color",me.defaultColorSet,me.defaultColor),ie.strokePanel.onColorChanged=ie.setStrokeColor,ie.strokeWidthPanel=new lt("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),ie.strokeWidthPanel.onWidthChanged=ie.setStrokeWidth,ie.strokeStylePanel=new st("Line style",me.defaultStrokeDasharrays,me.defaultStrokeDasharray),ie.strokeStylePanel.onStyleChanged=ie.setStrokeDasharray,ie}return he(V,se),V.prototype.ownsTarget=function(X){return!(!se.prototype.ownsTarget.call(this,X)&&X!==this.visual&&X!==this.selectorCurve&&X!==this.visibleCurve&&!this.curveGrip.ownsTarget(X))},V.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},V.prototype.createVisual=function(){this.visual=ce.createGroup(),this.selectorCurve=ce.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ce.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)},V.prototype.pointerDown=function(X,ne){se.prototype.pointerDown.call(this,X,ne),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=X.x,this.curveY=X.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(ne)&&(this.activeGrip=this.curveGrip,this._state="resize")},V.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ce.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ce.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},V.prototype.setupControlBox=function(){se.prototype.setupControlBox.call(this),this.curveControlLine1=ce.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ce.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)},V.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,se.prototype.addControlGrips.call(this)},V.prototype.positionGrips=function(){se.prototype.positionGrips.call(this);var X=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-X/2,this.curveY-X/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()))},V.prototype.manipulate=function(X){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+X.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+X.y-this.manipulationStartY),se.prototype.manipulate.call(this,X)},V.prototype.resize=function(X){this.activeGrip===this.curveGrip&&(this.curveX=X.x,this.curveY=X.y),se.prototype.resize.call(this,X),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},V.prototype.setStrokeColor=function(X){this.strokeColor=X,this.adjustVisual(),this.colorChanged(X)},V.prototype.setStrokeWidth=function(X){this.strokeWidth=X,this.adjustVisual()},V.prototype.setStrokeDasharray=function(X){this.strokeDasharray=X,this.adjustVisual()},V.prototype.scale=function(X,ne){this.curveX=this.curveX*X,this.curveY=this.curveY*ne,se.prototype.scale.call(this,X,ne)},Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),V.prototype.getState=function(){var X=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},se.prototype.getState.call(this));return X.typeName=V.typeName,X},V.prototype.restoreState=function(X){se.prototype.restoreState.call(this,X);var ne=X;this.strokeColor=ne.strokeColor,this.strokeWidth=ne.strokeWidth,this.strokeDasharray=ne.strokeDasharray,this.curveX=ne.curveX,this.curveY=ne.curveY,this.createVisual(),this.adjustVisual()},V.typeName="CurveMarker",V.title="Curve marker",V.icon='',V}(et),At=function(){function se(V,X){X===void 0&&(X=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=V,this.cancelable=X}return Object.defineProperty(se.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),se.prototype.preventDefault=function(){this._defaultPrevented=!0},se}(),Ot=function(se){function V(X,ne,me){var ie=se.call(this,X,!1)||this;return ie.dataUrl=ne,ie.state=me,ie}return he(V,se),V}(At),bt=function(se){function V(X,ne,me){me===void 0&&(me=!1);var ie=se.call(this,X,me)||this;return ie.marker=ne,ie}return he(V,se),V}(At),Vt=function(){function se(){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 se.prototype.addEventListener=function(V,X){this[V].push(X)},se.prototype.removeEventListener=function(V,X){var ne=this[V].indexOf(X);ne>-1&&this[V].splice(ne,1)},se}(),ir=function(){function se(V){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Re,this._isOpen=!1,this.undoRedoManager=new Pt,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 Vt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=se.instanceCounter++,this.styles=new ue(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=V,this.targetRoot=document.body,this.width=V.clientWidth,this.height=V.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(se.prototype,"ALL_MARKER_TYPES",{get:function(){return[je,Ue,Ie,qe,St,rt,Ae,Xe,ft,ye,ct,dt]},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[je,Ue,Ie,qe,rt,Ae,Xe]},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"BASIC_MARKER_TYPES",{get:function(){return[je,Ue,Ie,qe,Ae]},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(V){var X=this;this._availableMarkerTypes.splice(0),V.forEach(function(ne){if(typeof ne=="string"){var me=X.ALL_MARKER_TYPES.find(function(ie){return ie.typeName===ne});me!==void 0&&X._availableMarkerTypes.push(me)}else X._availableMarkerTypes.push(ne)})},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(V){this._zoomLevel=V,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(se.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),se.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ae.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},se.prototype.show=function(){var V=this;this.styles.styleSheetRoot===void 0&&te.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=te.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(X){return X(new At(V))})},se.prototype.render=function(){return ke(this,void 0,void 0,function(){var V;return _e(this,function(X){switch(X.label){case 0:return this.setCurrentMarker(),(V=new Se).naturalSize=this.renderAtNaturalSize,V.imageType=this.renderImageType,V.imageQuality=this.renderImageQuality,V.markersOnly=this.renderMarkersOnly,V.width=this.renderWidth,V.height=this.renderHeight,[4,V.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return X.sent(),[4,V.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,X.sent()]}})})},se.prototype.close=function(V){var X=this;if(V===void 0&&(V=!1),this.isOpen){var ne=!1;V||this.eventListeners.beforeclose.forEach(function(me){var ie=new At(X,!0);me(ie),ie.defaultPrevented&&(ne=!0)}),ne||(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(me){return me(new At(X))}),this.detachEvents(),this._isOpen=!1)}},se.prototype.addMarkersToToolbar=function(){for(var V,X=[],ne=0;nethis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*V:this.editorCanvas.clientWidth,ne=X',V.title="Powered by marker.js",V.style.display="grid",V.style.alignItems="center",V.style.justifyItems="center",V.style.padding="3px",V.style.width="20px",V.style.height="20px",this.logoUI.appendChild(V),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},se.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")},se.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"},se.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},se.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 V=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=V+"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 Q(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(V),1),V.dispose()},se.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())},se.prototype.toolbarButtonClicked=function(V,X){if(V==="marker"&&X!==void 0)this.createNewMarker(X);else if(V==="action")switch(X){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()}},se.prototype.deleteSelectedMarker=function(){var V=this;if(this._currentMarker!==void 0){var X=!1;if(this.eventListeners.markerbeforedelete.forEach(function(me){var ie=new bt(V,V._currentMarker,!0);me(ie),ie.defaultPrevented&&(X=!0)}),!X){var ne=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(me){return me(new bt(V,ne))})}}},se.prototype.clear=function(){var V=this,X=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ze){var pt=new bt(V,void 0,!0);ze(pt),pt.defaultPrevented&&(X=!0)}),!X)){this.setCurrentMarker();for(var ne=function(ze){var pt=me.markers[ze];me.setCurrentMarker(me.markers[ze]),me._currentMarker.dispose(),me.markerImage.removeChild(me._currentMarker.container),me.markers.splice(me.markers.indexOf(me._currentMarker),1),me.eventListeners.markerdelete.forEach(function(ot){return ot(new bt(V,pt))})},me=this,ie=this.markers.length-1;ie>=0;ie--)ne(ie);this.addUndoStep()}},Object.defineProperty(se.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),se.prototype.showNotesEditor=function(){var V;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=(V=this._currentMarker.notes)!==null&&V!==void 0?V:"",this.overlayContainer.appendChild(this.notesArea))},se.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)},se.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},se.prototype.addUndoStep=function(){var V=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var X=this.getState(),ne=this.undoRedoManager.getLastUndoStep();if(!ne||ne.width===X.width&&ne.height===X.height){var me=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(X),me1&&this.panTo({x:V.clientX,y:V.clientY}))},se.prototype.onPointerUp=function(V){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(V.clientX,V.clientY)),this.isDragging=!1,this.addUndoStep()},se.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},se.prototype.onKeyUp=function(V){this._currentMarker===void 0||this.notesArea!==void 0||V.key!=="Delete"&&V.key!=="Backspace"||this.deleteSelectedMarker()},se.prototype.clientToLocalCoordinates=function(V,X){var ne=this.markerImage.getBoundingClientRect();return{x:(V-ne.left)/this.zoomLevel,y:(X-ne.top)/this.zoomLevel}},se.prototype.onWindowResize=function(){this.positionUI()},se.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var V=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=V+"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()},se.prototype.addLicenseKey=function(V){ae.addKey(V)},se.prototype.addEventListener=function(V,X){this.eventListeners.addEventListener(V,X)},se.prototype.removeEventListener=function(V,X){this.eventListeners.removeEventListener(V,X)},se.prototype.renderState=function(V){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(V),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(se.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),se.prototype.focus=function(){var V=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(X){return X(new At(V))}))},se.prototype.blur=function(){var V=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(X){return X(new At(V))}))},se.instanceCounter=0,se}();/* **********************************
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 Qt=function(se,V){return(Qt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,ne){X.__proto__=ne}||function(X,ne){for(var me in ne)Object.prototype.hasOwnProperty.call(ne,me)&&(X[me]=ne[me])})(se,V)};function dr(se,V){if(typeof V!="function"&&V!==null)throw new TypeError("Class extends value "+String(V)+" is not a constructor or null");function X(){this.constructor=se}Qt(se,V),se.prototype=V===null?Object.create(V):(X.prototype=V.prototype,new X)}function Nt(se,V,X,ne){return new(X||(X=Promise))(function(me,ie){function ze(It){try{ot(ne.next(It))}catch(gt){ie(gt)}}function pt(It){try{ot(ne.throw(It))}catch(gt){ie(gt)}}function ot(It){var gt;It.done?me(It.value):(gt=It.value,gt instanceof X?gt:new X(function(Ht){Ht(gt)})).then(ze,pt)}ot((ne=ne.apply(se,V||[])).next())})}function br(se,V){var X,ne,me,ie,ze={label:0,sent:function(){if(1&me[0])throw me[1];return me[1]},trys:[],ops:[]};return ie={next:pt(0),throw:pt(1),return:pt(2)},typeof Symbol=="function"&&(ie[Symbol.iterator]=function(){return this}),ie;function pt(ot){return function(It){return function(gt){if(X)throw new TypeError("Generator is already executing.");for(;ze;)try{if(X=1,ne&&(me=2>[0]?ne.return:gt[0]?ne.throw||((me=ne.return)&&me.call(ne),0):ne.next)&&!(me=me.call(ne,gt[1])).done)return me;switch(ne=0,me&&(gt=[2>[0],me.value]),gt[0]){case 0:case 1:me=gt;break;case 4:return ze.label++,{value:gt[1],done:!1};case 5:ze.label++,ne=gt[1],gt=[0];continue;case 7:gt=ze.ops.pop(),ze.trys.pop();continue;default:if(!(me=ze.trys,(me=me.length>0&&me[me.length-1])||gt[0]!==6&>[0]!==2)){ze=0;continue}if(gt[0]===3&&(!me||gt[1]>me[0]&>[1]0&&X>0){var ne=new Rr(V,X),me=ne.ratio>=1?20:ne.getHorizontalLength(20),ie=ne.ratio<1?20:ne.getVerticalLength(20),ze=document.createElementNS("http://www.w3.org/2000/svg","svg");ze.setAttribute("xmlns","http://www.w3.org/2000/svg"),ze.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ze);var pt=wt.createDefs();ze.appendChild(pt);var ot=wt.createElement("clipPath",[["id","text-bg-clip"]]);pt.appendChild(ot);var It=wt.createPath(wt.getHollowRectanglePath((24-me)/2,(24-ie)/2,me,ie,(24-me)/2+2,(24-ie)/2+2,me-4,ie-4));ze.appendChild(It);var gt=wt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);gt.appendChild(wt.createTSpan(V+":"+X)),ze.appendChild(gt);var Ht=gt.getBBox();wt.setAttributes(gt,[["x",((24-Ht.width)/2).toString()],["y",((24-Ht.height)/2-Ht.y).toString()]]);var Xt=wt.createPath(wt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ht.width))/2,(24-Math.ceil(Ht.height))/2,Math.ceil(Ht.width),Math.ceil(Ht.height)));return ot.appendChild(Xt),wt.setAttributes(It,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ze),ze.outerHTML}return''},se}(),$t=function(se){function V(X,ne,me){var ie=se.call(this,X,ne)||this;return ie.isDropdownOpen=!1,ie.onClick=ie.dropdownButtonClicked,ie.dropdownButtons=me,ie}return dr(V,se),V.prototype.setupDropdown=function(){var X=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ne){ne.className=X.className,ne.colorsClassName=X.colorsClassName,X.dropdownBlock.appendChild(ne.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},V.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},V.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},V.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},V.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},V.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},V}(Dt),jt=function(){function se(V,X){this.GRIP_SIZE=10,this.color=V,this.fillColor=X,this.visual=wt.createGroup(),this.visual.appendChild(wt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(wt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return se.prototype.ownsTarget=function(V){return V===this.visual||V===this.visual.childNodes[0]||V===this.visual.childNodes[1]},se.prototype.setCenter=function(V,X){this.visual.childNodes.forEach(function(ne){return wt.setAttributes(ne,[["cx",V.toString()],["cy",X.toString()]])})},se}(),Ur=function(){function se(V,X,ne,me){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=V,this.canvasHeight=X,this.margin=ne,this.container=me,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(se.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(V){this._aspectRatio=V,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(V){this._isGridVisible=V,this.gridContainer&&wt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(V){this._zoomFactor=V,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),se.prototype.open=function(){var V=this;this.cropShadeElement=wt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=wt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var X=0;Xthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-X.height/2),wt.setAttributes(this.cropRectElement,[["x",X.x.toString()],["y",X.y.toString()],["width",X.width.toString()],["height",X.height.toString()]]);var ne=X.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(ie,ze){var pt=X.y+ne*(ze+1);wt.setAttributes(ie,[["x1",""+X.x],["y1",""+pt],["x2",""+(X.x+X.width)],["y2",""+pt]])});var me=X.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(ie,ze){var pt=X.x+me*(ze+1);wt.setAttributes(ie,[["x1",""+pt],["y1",""+X.y],["x2",""+pt],["y2",""+(X.y+X.height)]])}),wt.setAttributes(this.cropShadeElement,[["d",wt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,X.x,X.y,X.width,X.height)]]),this.topLeftGrip.setCenter(X.x,X.y),this.topRightGrip.setCenter(X.x+X.width,X.y),this.bottomLeftGrip.setCenter(X.x,X.y+X.height),this.bottomRightGrip.setCenter(X.x+X.width,X.y+X.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},se.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)},se.prototype.clientToLocalCoordinates=function(V,X){var ne=this.container.getBoundingClientRect();return{x:V-ne.left+this.margin,y:X-ne.top+this.margin}},se.prototype.onPointerDown=function(V){this.container.setPointerCapture(V.pointerId),this.previousPoint=this.clientToLocalCoordinates(V.clientX,V.clientY),this.cropRectElement===V.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(V.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(V.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(V.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(V.target)&&(this.activeGrip=this.bottomRightGrip)},se.prototype.onPointerMove=function(V){if(this.isMoving)this.move(this.clientToLocalCoordinates(V.clientX,V.clientY));else if(this.activeGrip){var X=this.clientToLocalCoordinates(V.clientX,V.clientY);this.resize(X)}V.preventDefault()},se.prototype.onPointerUp=function(V){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(V.pointerId)},se.prototype.move=function(V){var X=V.x-this.previousPoint.x,ne=V.y-this.previousPoint.y;this.zoomFactor!==1&&(X=-X/this.zoomFactor,ne=-ne/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+X),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ne),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=V},se.prototype.resize=function(V){var X=Object.assign({},this.cropRect),ne=V.x-this.previousPoint.x,me=V.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:X.x+nethis.canvasWidth*this.zoomFactor&&(ne=this.canvasWidth*this.zoomFactor-X.width),X.width+=ne}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(X.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ne),X.height=this.aspectRatio.getVerticalLength(X.width)):(X.y+=me,X.height=this.cropRect.y+this.cropRect.height-X.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?X.height=this.aspectRatio.getVerticalLength(X.width):X.height+=me}X.width<10&&(X.x=this.cropRect.x,X.width=10),X.height<10&&(X.y=this.cropRect.y,X.height=10),this.previousPoint=V,X.x>=this.margin&&X.y>=this.margin&&X.x-this.margin+X.width<=this.canvasWidth&&X.y-this.margin+X.height<=this.canvasHeight&&(this.cropRect=X,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},se.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var V=this.cropRect.x+this.cropRect.width/2,X=this.cropRect.y+this.cropRect.height/2,ne=this.aspectRatio.getHorizontalLength(this.cropRect.height),me=this.aspectRatio.getVerticalLength(this.cropRect.width);ne/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=V-this.cropRect.width/2,this.cropRect.y=X-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)}},se.prototype.getRescaledRect=function(V,X,ne,me,ie,ze){var pt=ne/V,ot=me/X;return{x:(ie.x-ze)*pt+ze,y:(ie.y-ze)*ot+ze,width:ie.width*pt,height:ie.height*ot}},se.prototype.scaleCanvas=function(V,X){var ne=this.getRescaledRect(this.canvasWidth,this.canvasHeight,V,X,this.cropRect,this.margin);this.canvasWidth=V,this.canvasHeight=X,this.onCropChange&&this.onCropChange(ne),this.setCropRectangle(ne)},se}(),_n=function(){function se(V){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=V,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(se.prototype,"angle",{get:function(){return this._angle},set:function(V){this._angle=V,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),se.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},se.prototype.onPointerDown=function(V){this.controlContainer.setPointerCapture(V.pointerId),this.isDragging=!0,this.previousPoint={x:V.clientX,y:V.clientY}},se.prototype.onPointerMove=function(V){this.isDragging&&(this.onAngleChange&&this.onAngleChange((V.clientX-this.previousPoint.x)/5),this.previousPoint.x=V.clientX)},se.prototype.onPointerUp=function(V){this.isDragging&&this.onAngleChange&&this.onAngleChange((V.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(V.pointerId)},se.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var V=this.angleLabelText.getBBox();wt.setAttributes(this.angleLabelElement,[["x",((this.width-V.width)/2).toString()],["y",(this.height/2).toString()]])}},se.prototype.positionScaleShape=function(){if(this.scaleShape){var V=this.scaleShape.transform.baseVal.getItem(0);V.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(V,0)}},se.prototype.getVisual=function(){var V=document.createElementNS("http://www.w3.org/2000/svg","svg");V.setAttribute("xmlns","http://www.w3.org/2000/svg"),V.setAttribute("width",this.width+"px"),V.setAttribute("height",this.height+"px"),V.setAttribute("viewBox","0 0 "+this.width+" "+this.height),V.style.flexShrink="0",document.body.appendChild(V);for(var X="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ne=1;ne<=this.width/5+10;ne++){var me=ne%5==0?this.height/3:this.height/6;X+="h4v"+-me+"h1v"+me}X+="v1H0Z",this.scaleShape=wt.createPath(X);var ie=wt.createTransform();this.scaleShape.transform.baseVal.appendItem(ie),V.appendChild(this.scaleShape),this.angleLabelElement=wt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=wt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ze=wt.createTSpan("");return ze.innerHTML="°",this.angleLabelElement.appendChild(ze),V.appendChild(this.angleLabelElement),document.body.removeChild(V),V},se}(),Vr=function(){function se(){this.naturalSize=!1,this.imageType="image/png"}return se.prototype.rasterize=function(V,X,ne,me,ie,ze,pt){var ot=this;return new Promise(function(It){var gt=document.createElement("canvas");gt.width=V.width.baseVal.value-2*me,gt.height=V.height.baseVal.value-2*me;var Ht=1,Xt=1;ot.naturalSize===!0?(Ht=X.naturalWidth/(V.width.baseVal.value-2*me)/ze,Xt=X.naturalHeight/(V.height.baseVal.value-2*me)/pt,gt.width=X.naturalWidth/ze,gt.height=X.naturalHeight/pt):ot.width!==void 0&&ot.height!==void 0&&(Ht=ot.width/ne.width,Xt=ot.height/ne.height,gt.width*=Ht,gt.height*=Xt);var Sr=gt.getContext("2d");Sr.translate(gt.width/2,gt.height/2),Sr.rotate(ie*Math.PI/180),Sr.scale(ze,pt),Sr.translate(-gt.width/2,-gt.height/2),Sr.drawImage(X,0,0,gt.width,gt.height);var an=document.createElement("canvas");an.width=ne.width*Ht,an.height=ne.height*Xt,an.getContext("2d").putImageData(Sr.getImageData((ne.x-me)*Ht,(ne.y-me)*Xt,ne.width*Ht,ne.height*Xt),0,0),It(an.toDataURL(ot.imageType,ot.imageQuality))})},se}(),vt=function(){function se(V){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=se.instanceCounter++,this.styles=new hr(this.instanceNo),this.target=V,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(se.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(V){this._zoomToCropEnabled=V,V?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(V){this._isGridVisible=V,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"gridLines",{get:function(){return this._gridLines},set:function(V){this._gridLines=V,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(V){this._rotationAngle=V,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"aspectRatio",{get:function(){var V;return(V=this._aspectRatio)!==null&&V!==void 0?V:this.aspectRatios[0]},set:function(V){this._aspectRatio=V},enumerable:!1,configurable:!0}),se.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},se.prototype.show=function(){this.showUI(),this.open()},se.prototype.close=function(V){V===void 0&&(V=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),V||this.closeEventListeners.forEach(function(X){return X()}),this._isOpen=!1)},se.prototype.addRenderEventListener=function(V){this.renderEventListeners.push(V)},se.prototype.removeRenderEventListener=function(V){this.renderEventListeners.indexOf(V)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(V),1)},se.prototype.addCloseEventListener=function(V){this.closeEventListeners.push(V)},se.prototype.removeCloseEventListener=function(V){this.closeEventListeners.indexOf(V)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(V),1)},se.prototype.setupResizeObserver=function(){var V=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){V.resize(V.target.clientWidth,V.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))},se.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var V=1*this.target.clientWidth/this.target.clientHeight,X=this.contentDiv.clientWidth/V>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*V:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ne=X+2*this.CANVAS_MARGINV+this.CANVAS_MARGIN?this.target.offsetTop-(V+this.CANVAS_MARGIN):0;this.coverDiv.style.top=X+"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},se.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},se.prototype.addTopToolbar=function(){var V=this;this.topToolbar=new Lr,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 X=new Tt;X.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(X);var ne=[];this.aspectRatios.forEach(function(Xt){var Sr=new Dt(jr.getIcon(Xt.horizontal,Xt.vertical),Xt.horizontal===0&&Xt.vertical===0?"FREE":Xt.horizontal+":"+Xt.vertical);Sr.onClick=function(){return V.ratioButtonClicked(Xt)},ne.push(Sr)}),this.aspectRatioButton=new $t(jr.getIcon(0,0),"Aspect ratio",ne),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,X.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var me=new Dt('',"Toggle grid");me.isActive=this.isGridVisible,me.onClick=function(){V.isGridVisible=!V.isGridVisible,me.isActive=V.isGridVisible},X.addButton(me);var ie=new Dt('',"Zoom to selection");if(ie.isActive=this.zoomToCropEnabled,ie.onClick=function(){V.zoomToCropEnabled=!V.zoomToCropEnabled,ie.isActive=V.zoomToCropEnabled},X.addButton(ie),!ur.isLicensed){var ze=new Ct;this.topToolbar.addElementBlock(ze);var pt=document.createElement("div");pt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var ot=document.createElement("a");ot.style.color="currentColor",ot.href="https://markerjs.com/products/cropro",ot.target="_blank",ot.innerHTML='',pt.appendChild(ot),ze.addElement(pt)}var It=new Tt;It.minWidth=3*this.toolbarHeight+"px",It.contentAlign="end",this.topToolbar.addButtonBlock(It);var gt=new Dt('',"OK");gt.onClick=this.startRenderAndClose,It.addButton(gt),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(gt.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ht=new Dt('',"Close");Ht.onClick=this.close,It.addButton(Ht),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ht.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},se.prototype.addBottomToolbar=function(){var V=this;this.bottomToolbar=new Lr,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 X=new Tt;X.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(X);var ne=new Dt('',"Rotate left");ne.onClick=this.rotateLeftButtonClicked,X.addButton(ne);var me=new Dt('',"Rotate right");me.onClick=this.rotateRightButtonClicked,X.addButton(me);var ie=new Ct;ie.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(ie),this.straightener=new _n("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(It){V.rotateBy(It),V.straightener.angle=V.rotationAngle},ie.addElement(this.straightener.getUI());var ze=new Tt;ze.minWidth=2*this.toolbarHeight+"px",ze.contentAlign="end",this.bottomToolbar.addButtonBlock(ze);var pt=new Dt('',"Flip horizontal");pt.onClick=this.flipHorizontallyButtonClicked,ze.addButton(pt);var ot=new Dt('',"Flip vertical");ot.onClick=this.flipVerticallyButtonClicked,ze.addButton(ot)},se.prototype.ratioButtonClicked=function(V){this.aspectRatio=V,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},se.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=jr.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},se.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Rr(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},se.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},se.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},se.prototype.restoreState=function(V){if(V){var X=this.cropLayer.getRescaledRect(V.width,V.height,this.imageWidth,this.imageHeight,V.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(X),this.cropRectChanged(X),this.flippedHorizontally=V.flippedHorizontally,this.flippedVertically=V.flippedVertically,this.applyFlip(),this.rotationAngle=V.rotationAngle,this.applyRotation()}},se.prototype.clientToLocalCoordinates=function(V,X){var ne=this.cropImage.getBoundingClientRect();return{x:V-ne.left,y:X-ne.top}},se.prototype.onWindowResize=function(){this.positionUI()},se.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var V=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=V+"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()},se.prototype.rotateLeftButtonClicked=function(){var V=this.rotationAngle-90;this.rotationAngle%90!=0&&(V+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(V)},se.prototype.rotateRightButtonClicked=function(){var V=this.rotationAngle+90;this.rotationAngle%90!=0&&(V-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(V)},se.prototype.rotateTo=function(V){V=(V=V>180?V-360:V)<=-180?V+360:V,this.rotationAngle=V,this.applyRotation()},se.prototype.rotateBy=function(V){this.rotateTo((this.rotationAngle+V)%360)},se.prototype.applyRotation=function(){var V=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var X=this.editingTargetRotationContainer.transform.baseVal.getItem(0);X.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(X,0);var ne=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ne.width,this.imageHeight/ne.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=V},se.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},se.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},se.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},se.prototype.startRenderAndClose=function(){return Nt(this,void 0,void 0,function(){var V,X;return br(this,function(ne){switch(ne.label){case 0:return[4,this.render()];case 1:return V=ne.sent(),X=this.getState(),this.renderEventListeners.forEach(function(me){return me(V,X)}),this.close(!0),[2]}})})},se.prototype.render=function(){return Nt(this,void 0,void 0,function(){var V;return br(this,function(X){switch(X.label){case 0:return(V=new Vr).naturalSize=this.renderAtNaturalSize,V.imageType=this.renderImageType,V.imageQuality=this.renderImageQuality,V.width=this.renderWidth,V.height=this.renderHeight,this.unzoomFromCrop(),wt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,V.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 X.sent(),[4,V.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,X.sent()]}})})},se.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Gr("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 Gr("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Gr("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var V=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Gr("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*V)+`px;
height: `+(this.toolbarHeight-2*V)+`px;
padding: `+V+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Gr("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Gr("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new Qr("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new Qr("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Gr("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 Gr("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Gr("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 Gr("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*V)+`px;
padding: `+V+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Gr("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},se.instanceCounter=0,se}(),Ft=P("8hTe"),rn=P.n(Ft),hn=/]*>/g;function An(se){var V=document.createElement("div");return V.innerHTML=se,V.childNodes.length===0?"":V.childNodes[0].nodeValue}var Rn=J.a=function(se){var V=se.value,X=V===void 0?"":V,ne=se.edit,me=ne===void 0?!1:ne,ie=se.className,ze=se.showTextOnly,pt=se.showLines,ot=se.replaces,It=se.zoomImg,gt=se.hasMask,Ht=se.style,Xt=Ht===void 0?{}:Ht,Sr=se.stylesPrev,an=Sr===void 0?{}:Sr,Zr=String(X),Zt=Object(i.useRef)(),Hr=Object(i.useRef)(),fr=Object(i.useState)(""),Jt=Object(C.a)(fr,2),tr=Jt[0],vr=Jt[1],Xr=Object(i.useState)("office"),ln=Object(C.a)(Xr,2),mn=ln[0],li=ln[1],Ki=function(){var cr=new vt(Hr.current);cr.displayMode="popup",cr.addRenderEventListener(function(){var en=Object(o.a)(a.a.mark(function Mr(En){var Fr;return a.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:return Zt.current.style.display="none",gn.next=3,Object(Ce.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:En}});case 3:Fr=gn.sent,Fr!=null&&Fr.id&&ot(Hr.current.getAttribute("src").replace(q.a.API_SERVER,""),"/api/attachments/".concat(Fr==null?void 0:Fr.id,"?type=").concat(Fr.content_type));case 5:case"end":return gn.stop()}},Mr)}));return function(Mr){return en.apply(this,arguments)}}()),cr.show()},Ui=function(){var cr=new ir(Hr.current);cr.settings.displayMode="popup",cr.addEventListener("render",function(){var en=Object(o.a)(a.a.mark(function Mr(En){var Fr;return a.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:if(Zt.current.style.display="none",!Hr.current){gn.next=6;break}return gn.next=4,Object(Ce.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:En.dataUrl}});case 4:Fr=gn.sent,Fr!=null&&Fr.id&&ot(Hr.current.getAttribute("src").replace(q.a.API_SERVER,""),"/api/attachments/".concat(Fr==null?void 0:Fr.id,"?type=").concat(Fr.content_type));case 6:case"end":return gn.stop()}},Mr)}));return function(Mr){return en.apply(this,arguments)}}()),cr.show(),window.markerArea=cr},Fn=Object(i.useMemo)(function(){try{var Yr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,cr=/\"\/api\/attachments\/|\"\/attachments\/download\//g,en=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Zr=Zr.replace(Yr,"("+q.a.API_SERVER+"/api/attachments/").replace(cr,'"'+q.a.API_SERVER+"/api/attachments/").replace(en,'"'+q.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`),Zr=Zr.replace(new RegExp("(?[TOC]
",M()),T()),Mr=Mr.replace(/(__special_katext_id_\d+__)/g,function(xi,gn){var On=En[gn],ui=On.type,ci=On.expression;return Object(re.renderToString)(An(ci)||"",{displayMode:ui==="block",throwOnError:!1,output:"html"})}),Mr=Mr.replace(/▁/g,"\u2581\u2581\u2581"),j(),ze){var Fr=document.createElement("div");return Fr.innerHTML=Mr,Fr.innerText}return setTimeout(function(){return on()},500),Mr},[Zr]),qr=Object(i.useRef)();y.WebkitLineClamp=pt,pt&&(Xt=Object(h.a)(Object(h.a)({},Xt),y));function Oi(Yr){var cr=Yr.target;if(cr.tagName.toUpperCase()==="IMG"){if(It){var en=cr.getAttribute("src");vr(en),li("image")}}else if(cr.tagName.toUpperCase()==="A"){var Mr=cr.getAttribute("href");if(Mr.indexOf("office")>-1)Yr.preventDefault(),vr(Mr),li("office");else if(Mr.indexOf("application/pdf")>-1)Yr.preventDefault(),vr(Mr),li("pdf");else if(Mr.indexOf("type=text")>-1)Yr.preventDefault(),vr(Mr),li("html");else if(Mr.startsWith("#")){Yr.preventDefault();var En=document.getElementById(Mr.replace("#",""));En&&En.scrollIntoView(!0)}}}var on=function(){var cr,en=(cr=qr.current)===null||cr===void 0?void 0:cr.querySelectorAll("video");en==null||en.forEach(function(Mr){if(Mr.oncontextmenu=function(){return!1},Mr.src.indexOf(".m3u8")>-1&&!Mr.canPlayType("application/vnd.apple.mpegurl")){if(K.a.isSupported()){var En=new K.a;En.loadSource(Mr.src),En.attachMedia(Mr)}}})};Object(i.useEffect)(function(){if(qr.current&&Fn&&(Fn.match(hn)&&window.PR.prettyPrint()),qr.current)return qr.current.addEventListener("click",Oi),function(){qr.current.removeEventListener("click",Oi),j(),T()}},[Fn,qr.current,Oi]);var Zn=function(cr){if(!me)return;cr.target.nodeName==="IMG"?(Zt.current.style.display="flex",Zt.current.style.width=cr.target.clientWidth+"px",Zt.current.style.height=cr.target.clientHeight+"px",Zt.current.style.top=cr.target.offsetTop+"px",Zt.current.style.left=cr.target.offsetLeft+"px",Hr.current.src=cr.target.getAttribute("src")):Zt.current.style.display="none"};return r.a.createElement("div",{style:{position:"relative"}},r.a.createElement("div",{ref:qr,style:Object(h.a)({},Xt),className:"".concat(ie||""," markdown-body ").concat(rn.a.mdBody),onMouseOver:Zn,dangerouslySetInnerHTML:{__html:Fn}}),r.a.createElement("div",{ref:Zt,className:rn.a.button},r.a.createElement(u.a,null,r.a.createElement(R.a,{onClick:function(){return Ki()}},"\u88C1\u526A"),r.a.createElement(R.a,{onClick:function(){return Ui()}},"\u7F16\u8F91"))),r.a.createElement("img",{ref:Hr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),r.a.createElement(ee.a,{close:!0,data:tr,hasMask:gt,type:tr!=null&&tr.length?mn:"",style:Object(h.a)({},an),onClose:function(){return vr("")}}))}},"9OqN":function(I,J,P){(function(L,u,S){I.exports=J=u(P("Ib8C"),P("OLod"))})(this,function(L){return L.mode.CTR=function(){var u=L.lib.BlockCipherMode.extend(),S=u.Encryptor=u.extend({processBlock:function(R,h){var o=this._cipher,C=o.blockSize,c=this._iv,a=this._counter;c&&(a=this._counter=c.slice(0),this._iv=void 0);var i=a.slice(0);o.encryptBlock(i,0),a[C-1]=a[C-1]+1|0;for(var r=0;r-1?"."+tt.split(".").pop():"");K===null&&(je="testsets/".concat(st).concat(tt.indexOf(".")>-1?"."+tt.split(".").pop():"")),nt.multipartUpload(je,new Blob([Ze.file],{type:Ze.file.type}),{timeout:3600*1e3,partSize:1002400,callback:{customValue:{id:tt+""},url:ke==null?void 0:ke.callback_url,host:ke==null?void 0:ke.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object(x.e)(lt)}}).then(function(Re){if(Re.data.status===0){ue.current=ue.current+1;var et=te.current.map(function($e){var qe,Ue;if($e.name===((qe=Re.data)===null||qe===void 0||((Ue=qe.data)===null||Ue===void 0)?void 0:Ue.file_name)){var Me,Ie,ye,Te=Object(C.a)({},$e);if((Me=Re.data)!==null&&Me!==void 0&&(Ie=Me.data)!==null&&Ie!==void 0&&(ye=Ie.file_name)!==null&&ye!==void 0&&ye.includes(".in")){var Ae,Pe,Xe,rt,ft,St;Te.in_object_key=(Ae=Re.data)===null||Ae===void 0||((Pe=Ae.data)===null||Pe===void 0)?void 0:Pe.object,Te.in_object_size=(Xe=Re.data)===null||Xe===void 0||((rt=Xe.data)===null||rt===void 0)?void 0:rt.size,Te.input=(ft=Re.data)===null||ft===void 0||((St=ft.data)===null||St===void 0)?void 0:St.file_name,Te.in_file=Ze}else{var Pt,dt,At,Ot,bt,Vt;Te.out_object_key=(Pt=Re.data)===null||Pt===void 0||((dt=Pt.data)===null||dt===void 0)?void 0:dt.object,Te.out_object_size=(At=Re.data)===null||At===void 0||((Ot=At.data)===null||Ot===void 0)?void 0:Ot.size,Te.output=(bt=Re.data)===null||bt===void 0||((Vt=bt.data)===null||Vt===void 0)?void 0:Vt.file_name,Te.out_file=Ze}return Te}return $e});if(te.current=Object(l.a)(et),Ce(Object(l.a)(et)),ue.current>0&&ue.current===ee.length){Se(!1);var ct=N(et);ct=ct.filter(function($e){var qe,Ue;return!!((qe=$e[0])!==null&&qe!==void 0&&qe.name&&(Ue=$e[1])!==null&&Ue!==void 0&&Ue.name)}),ct=ct.map(function($e){return Object(C.a)(Object(C.a)(Object(C.a)({},$e[0]),$e[1]),{},{is_file:!0})}),G(ct),F()}}})},be=function(){if(ee.length===0){a.b.warn("\u8BF7\u9009\u62E9\u4E0A\u4F20\u6587\u4EF6");return}Se(!0);var Ze=N(ee);if(Ze.some(function(nt){var tt,lt;return!((tt=nt[0])!==null&&tt!==void 0&&tt.name&&(lt=nt[1])!==null&<!==void 0&<.name)})){o.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u4E0A\u4F20\u7684\u6D4B\u8BD5\u7528\u4F8B\u4E2D\u5B58\u5728\u672A\u914D\u5BF9\u7684\u6587\u4EF6\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u4EC5\u4FDD\u5B58\u5DF2\u914D\u5BF9\u7684\u6D4B\u8BD5\u7528\u4F8B\uFF1F",onOk:function(){var nt=Object(i.a)(v.a.mark(function lt(){return v.a.wrap(function(je){for(;;)switch(je.prev=je.next){case 0:ee.map(function(){var Re=Object(i.a)(v.a.mark(function et(ct){return v.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:Z(ct);case 1:case"end":return qe.stop()}},et)}));return function(et){return Re.apply(this,arguments)}}());case 1:case"end":return je.stop()}},lt)}));function tt(){return nt.apply(this,arguments)}return tt}(),onCancel:function(){Se(!1)}});return}ee.map(function(){var nt=Object(i.a)(v.a.mark(function tt(lt){return v.a.wrap(function(je){for(;;)switch(je.prev=je.next){case 0:Z(lt);case 1:case"end":return je.stop()}},tt)}));return function(tt){return nt.apply(this,arguments)}}())},ge={name:"file",fileList:ee,multiple:!0,accept:".in, .out",showUploadList:!1,beforeUpload:function(Ze){if(ee!=null&&ee.some(function(tt){return tt.name===Ze.name}))return a.b.info("".concat(Ze.name,"\u6587\u4EF6\u5DF2\u5B58\u5728")),!1;if(Ze.size/1024/1024>100)return a.b.info("\u6587\u4EF6\u8D85\u8FC7100M\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42"),!1;if(!/\.(in|out|IN|OUT)$/.test(Ze.name))return a.b.warn("\u8F93\u5165\u6587\u4EF6\u53EA\u80FD\u4E0A\u4F20.in\u548C.out\u7C7B\u578B\u7684\u6587\u672C\u6587\u4EF6"),!1;var nt={name:Ze.name,uid:Ze.uid,file:Ze,percent:0};return ee.push(nt),te.current=Object(l.a)(ee),Ce(Object(l.a)(ee)),!1}},De=N(ee);return console.log(ee,De,"fileList"),n.a.createElement(o.a,{visible:B,wrapClassName:W,onOk:be,centered:!0,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",okButtonProps:{loading:ae},onCancel:Oe,width:"1000px",title:"\u6279\u91CF\u4E0A\u4F20\u6D4B\u8BD5\u7528\u4F8B"},n.a.createElement("div",{className:g.a.wrap},ee.length?n.a.createElement("div",null,n.a.createElement(f.a,ge,n.a.createElement(R.a,{className:g.a.btnS},"\u4E0A\u4F20\u6587\u4EF6")),n.a.createElement(k,{data:De,onRemove:Y})):n.a.createElement("div",{className:g.a.noData},n.a.createElement("img",{src:y.a,alt:""}),n.a.createElement(f.a,ge,n.a.createElement(R.a,{className:g.a.btn},"\u4E0A\u4F20\u6587\u4EF6"))),n.a.createElement("div",{className:g.a.text},"\u4E0A\u4F20\u9650\u5236\uFF1A",n.a.createElement("br",null),"1\u3001\u6587\u4EF6\u5FC5\u987B\u4E0A\u4F20.in\u548C.out\u7C7B\u578B\u7684\u6587\u672C\u6587\u4EF6\u3002",n.a.createElement("br",null),"2\u3001\u8F93\u5165\u8F93\u51FA\u6587\u4EF6\u9700\u6587\u4EF6\u540D\u79F0\u4E00\u4E00\u5BF9\u5E94\uFF0C\u672A\u5BF9\u5E94\u65F6\uFF0C\u5C06\u65E0\u6CD5\u4E0A\u4F20\u3002",n.a.createElement("br",null),"3\u3001\u5355\u4E2A\u4E0A\u4F20\u6587\u4EF6\u4E0D\u80FD\u8D85\u8FC7100MB\uFF0C\u8D85\u8FC7\u65F6\u53EF\u4EE5\u5206\u6279\u6B21\u4E0A\u4F20\u3002")))},k=function(H){var F=H.data,G=F===void 0?[]:F,B=H.onRemove,W=H.width,K=W===void 0?"auto":W,q=H.showScore,re=q===void 0?!1:q,ee=H.disabled,Ce=ee===void 0?!1:ee,xe=H.inputChange,he=function(ce){var ae=document.createElement("a");document.body.appendChild(ae);var Se=URL.createObjectURL(ce.file);ae.href=Se,ae.download=ce.name,ae.click(),URL.revokeObjectURL(Se),document.body.removeChild(ae)},ke=function(ce,ae){Object(w.w)(ce,ae)},_e=function(ce,ae){o.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:n.a.createElement("div",{className:"tc font16"},"\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664\u8BE5\u6D4B\u8BD5\u7528\u4F8B?"),onOk:function(){B(ce,ae)},onCancel:function(){}})};return G.length?n.a.createElement("div",{style:{width:K}},n.a.createElement("div",{className:g.a.head},n.a.createElement("div",{style:{width:"20%"}},"\u7528\u4F8B"),n.a.createElement("div",{style:{width:re?"25%":"35%"}},"\u8F93\u5165"),n.a.createElement("div",{style:{width:re?"25%":"35%"}},"\u8F93\u51FA"),re&&n.a.createElement("div",{style:{width:"20%"}},"\u5F97\u5206\u6BD4\u4F8B"),n.a.createElement("div",{style:{width:"10%"}},"\u64CD\u4F5C")),G.map(function(de,ce){var ae,Se,te,ue;return n.a.createElement("div",{key:ce,className:g.a.list},n.a.createElement("div",{style:{width:"20%"}},"\u6D4B\u8BD5\u7528\u4F8B",ce+1),n.a.createElement("div",{className:g.a.info,style:{width:re?"25%":"35%"}},n.a.createElement("span",{title:de.input||((ae=de[0])===null||ae===void 0?void 0:ae.name),onClick:function(){de.input?de.input_file_url?ke(de.input_file_url,de.input):he(de.in_file):he(de[0])}},de.input||((Se=de[0])===null||Se===void 0?void 0:Se.name))),n.a.createElement("div",{className:g.a.info,style:{width:re?"25%":"35%"}},n.a.createElement("span",{title:de.output||((te=de[1])===null||te===void 0?void 0:te.name),onClick:function(){de.input?de.output_file_url?ke(de.output_file_url,de.output):he(de.out_file):he(de[1])}},de.output||((ue=de[1])===null||ue===void 0?void 0:ue.name))),re&&n.a.createElement("div",{style:{width:"20%"}},n.a.createElement(u.a,{disabled:Ce,style:{width:"70%"},onChange:function(le){return xe(le,ce)},value:de.score}),n.a.createElement("span",null,"\xA0%")),n.a.createElement("div",{onClick:function(){return _e(de,ce)},style:{width:"10%"}},n.a.createElement("span",{className:g.a.del},"\u5220\u9664")))})):n.a.createElement(n.a.Fragment,null)};J.b=j},BU3w:function(I,J,P){"use strict";P.d(J,"a",function(){return o});var L=P("MNnm"),u="rc-util-key";function S(C){if(C.attachTo)return C.attachTo;var c=document.querySelector("head");return c||document.body}function R(C){var c,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(L.a)())return null;var i=document.createElement("style");if((c=a.csp)===null||c===void 0?void 0:c.nonce){var r;i.nonce=(r=a.csp)===null||r===void 0?void 0:r.nonce}i.innerHTML=C;var l=S(a),p=l.firstChild;return a.prepend&&l.prepend?l.prepend(i):a.prepend&&p?l.insertBefore(i,p):l.appendChild(i),i}var h=new Map;function o(C,c){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=S(a);if(!h.has(i)){var r=R("",a),l=r.parentNode;h.set(i,l),l.removeChild(r)}var p=Array.from(h.get(i).children).find(function(n){return n.tagName==="STYLE"&&n[u]===c});if(p){var f,b;if(((f=a.csp)===null||f===void 0?void 0:f.nonce)&&p.nonce!==((b=a.csp)===null||b===void 0?void 0:b.nonce)){var v;p.nonce=(v=a.csp)===null||v===void 0?void 0:v.nonce}return p.innerHTML!==C&&(p.innerHTML=C),p}var m=R(C,a);return m[u]=c,m}},Bd2K:function(I,J,P){(function(L){L(P("VrN/"),P("osHv"))})(function(L){L.defineOption("autoCloseTags",!1,function(a,i,r){if(r!=L.Init&&r&&a.removeKeyMap("autoCloseTags"),!i)return;var l={name:"autoCloseTags"};(typeof i!="object"||i.whenClosing!==!1)&&(l["'/'"]=function(p){return o(p)}),(typeof i!="object"||i.whenOpening!==!1)&&(l["'>'"]=function(p){return R(p)}),a.addKeyMap(l)});var u=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],S=["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 R(a){if(a.getOption("disableInput"))return L.Pass;for(var i=a.listSelections(),r=[],l=a.getOption("autoCloseTags"),p=0;pf.ch&&(d=d.slice(0,d.length-b.end+f.ch));var s=d.toLowerCase();if(!d||b.type=="string"&&(b.end!=f.ch||!/[\"\']/.test(b.string.charAt(b.string.length-1))||b.string.length==1)||b.type=="tag"&&n.close||b.string.indexOf("/")==f.ch-b.start-1||T&&C(T,s)>-1||c(a,v.mode.xmlCurrentContext&&v.mode.xmlCurrentContext(m)||[],d,f,!0))return L.Pass;var M=typeof l=="object"&&l.emptyTags;if(M&&C(M,d)>-1){r[p]={text:"/>",newPos:L.Pos(f.line,f.ch+2)};continue}var A=y&&C(y,s)>-1;r[p]={indent:A,text:">"+(A?`
`:"")+""+d+">",newPos:A?L.Pos(f.line+1,0):L.Pos(f.line,f.ch+1)}}for(var x=typeof l=="object"&&l.dontIndentOnAutoClose,p=i.length-1;p>=0;p--){var E=r[p];a.replaceRange(E.text,i[p].head,i[p].anchor,"+insert");var w=a.listSelections().slice(0);w[p]={head:E.newPos,anchor:E.newPos},a.setSelections(w),!x&&E.indent&&(a.indentLine(E.newPos.line,null,!0),a.indentLine(E.newPos.line+1,null,!0))}}function h(a,i){for(var r=a.listSelections(),l=[],p=i?"/":"",f=a.getOption("autoCloseTags"),b=typeof f=="object"&&f.dontIndentOnSlash,v=0;v"&&(T+=">"),l[v]=T}if(a.replaceSelections(l),r=a.listSelections(),!b)for(var v=0;v=0&&i[m]==r;m--)++v;l=b.to;for(var m=1;m0){for(var i=0;i1&&arguments[1]!==void 0?arguments[1]:"",i=[],r=0;r=0;i--){var r=S().key(i);a(R(r),r)}}function C(a){return S().removeItem(a)}function c(){return S().clear()}},D1Df:function(I,J,P){"use strict";function L(k){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?L=function(H){return typeof H}:L=function(H){return H&&typeof Symbol=="function"&&H.constructor===Symbol&&H!==Symbol.prototype?"symbol":typeof H},L(k)}function u(){return u=Object.assign||function(k){for(var z=1;z=0)continue;if(!Object.prototype.propertyIsEnumerable.call(k,F))continue;H[F]=k[F]}}return H}function o(k,z){if(k==null)return{};var H={},F=Object.keys(k),G,B;for(B=0;B=0)continue;H[G]=k[G]}return H}function C(k,z){if(!(k instanceof z))throw new TypeError("Cannot call a class as a function")}function c(k,z){for(var H=0;H>6),z+=String.fromCharCode(128|F&63)):F<55296||F>=57344?(z+=String.fromCharCode(224|F>>12),z+=String.fromCharCode(128|F>>6&63),z+=String.fromCharCode(128|F&63)):(H++,F=65536+((F&1023)<<10|k.charCodeAt(H)&1023),z+=String.fromCharCode(240|F>>18),z+=String.fromCharCode(128|F>>12&63),z+=String.fromCharCode(128|F>>6&63),z+=String.fromCharCode(128|F&63))}return z}var T={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},y={},s=4,M=.1;function A(k){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,H=[];return k.forEach(function(F,G){var B=null;F.forEach(function(W,K){if(!W&&B!==null){H.push("M".concat(B+z," ").concat(G+z,"h").concat(K-B,"v1H").concat(B+z,"z")),B=null;return}if(K===F.length-1){if(!W)return;B===null?H.push("M".concat(K+z,",").concat(G+z," h1v1H").concat(K+z,"z")):H.push("M".concat(B+z,",").concat(G+z," h").concat(K+1-B,"v1H").concat(B+z,"z"));return}W&&B===null&&(B=K)})}),H.join("")}function x(k,z){return k.slice().map(function(H,F){return F=z.y+z.h?H:H.map(function(G,B){return B=z.x+z.w?G:!1})})}function E(k,z){var H=k.imageSettings,F=k.size,G=k.includeMargin;if(H==null)return null;var B=G?s:0,W=z.length+B*2,K=Math.floor(F*M),q=W/F,re=(H.width||K)*q,ee=(H.height||K)*q,Ce=H.x==null?z.length/2-re/2:H.x*q,xe=H.y==null?z.length/2-ee/2:H.y*q,he=null;if(H.excavate){var ke=Math.floor(Ce),_e=Math.floor(xe),de=Math.ceil(re+Ce-ke),ce=Math.ceil(ee+xe-_e);he={x:ke,y:_e,w:de,h:ce}}return{x:Ce,y:xe,h:ee,w:re,excavation:he}}var w=function(){try{new Path2D().addPath(new Path2D)}catch(k){return!1}return!0}(),_=function(k){p(z,k);function z(){var H,F;C(this,z);for(var G=arguments.length,B=new Array(G),W=0;WUe.length)&&(Me=Ue.length);for(var Ie=0,ye=new Array(Me);Ie=Ue.length?{done:!0}:{done:!1,value:Ue[ye++]}}}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 Ie=Ue[Symbol.iterator](),Ie.next.bind(Ie)}function o(Ue,Me){return Me={exports:{}},Ue(Me,Me.exports),Me.exports}var C=o(function(Ue){function Me(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function Ie(ye){Ue.exports.defaults=ye}Ue.exports={defaults:Me(),getDefaults:Me,changeDefaults:Ie}}),c=C.defaults,a=C.getDefaults,i=C.changeDefaults,r=/[&<>"']/,l=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,f=/[<>"']|&(?!#?\w+;)/g,b={"&":"&","<":"<",">":">",'"':""","'":"'"},v=function(Me){return b[Me]};function m(Ue,Me){if(Me){if(r.test(Ue))return Ue.replace(l,v)}else if(p.test(Ue))return Ue.replace(f,v);return Ue}var n=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function d(Ue){return Ue.replace(n,function(Me,Ie){return Ie=Ie.toLowerCase(),Ie==="colon"?":":Ie.charAt(0)==="#"?Ie.charAt(1)==="x"?String.fromCharCode(parseInt(Ie.substring(2),16)):String.fromCharCode(+Ie.substring(1)):""})}var g=/(^|[^\[])\^/g;function T(Ue,Me){Ue=Ue.source||Ue,Me=Me||"";var Ie={replace:function(Te,Ae){return Ae=Ae.source||Ae,Ae=Ae.replace(g,"$1"),Ue=Ue.replace(Te,Ae),Ie},getRegex:function(){return new RegExp(Ue,Me)}};return Ie}var y=/[^\w:]/g,s=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function M(Ue,Me,Ie){if(Ue){var ye;try{ye=decodeURIComponent(d(Ie)).replace(y,"").toLowerCase()}catch(Te){return null}if(ye.indexOf("javascript:")===0||ye.indexOf("vbscript:")===0||ye.indexOf("data:")===0)return null}Me&&!s.test(Ie)&&(Ie=_(Me,Ie));try{Ie=encodeURI(Ie).replace(/%25/g,"%")}catch(Te){return null}return Ie}var A={},x=/^[^:]+:\/*[^/]*$/,E=/^([^:]+:)[\s\S]*$/,w=/^([^:]+:\/*[^/]*)[\s\S]*$/;function _(Ue,Me){A[" "+Ue]||(x.test(Ue)?A[" "+Ue]=Ue+"/":A[" "+Ue]=z(Ue,"/",!0)),Ue=A[" "+Ue];var Ie=Ue.indexOf(":")===-1;return Me.substring(0,2)==="//"?Ie?Me:Ue.replace(E,"$1")+Me:Me.charAt(0)==="/"?Ie?Me:Ue.replace(w,"$1")+Me:Ue+Me}var N={exec:function(){}};function j(Ue){for(var Me=1,Ie,ye;Me=0&&Xe[ft]==="\\";)rt=!rt;return rt?"|":" |"}),ye=Ie.split(/ \|/),Te=0;if(ye.length>Me)ye.splice(Me);else for(;ye.length=ye.length?Te.slice(ye.length):Te}).join(`
`)}var xe=function(){function Ue(Ie){this.options=Ie||B}var Me=Ue.prototype;return Me.space=function(ye){var Te=this.rules.block.newline.exec(ye);if(Te)return Te[0].length>1?{type:"space",raw:Te[0]}:{raw:`
`}},Me.code=function(ye,Te){var Ae=this.rules.block.code.exec(ye);if(Ae){var Pe=Te[Te.length-1];if(Pe&&Pe.type==="paragraph")return{raw:Ae[0],text:Ae[0].trimRight()};var Xe=Ae[0].replace(/^ {4}/gm,"");return{type:"code",raw:Ae[0],codeBlockStyle:"indented",text:this.options.pedantic?Xe:W(Xe,`
`)}}},Me.fences=function(ye){var Te=this.rules.block.fences.exec(ye);if(Te){var Ae=Te[0],Pe=Ce(Ae,Te[3]||"");return{type:"code",raw:Ae,lang:Te[2]?Te[2].trim():Te[2],text:Pe}}},Me.heading=function(ye){var Te=this.rules.block.heading.exec(ye);if(Te)return{type:"heading",raw:Te[0],depth:Te[1].length,text:Te[2]}},Me.nptable=function(ye){var Te=this.rules.block.nptable.exec(ye);if(Te){var Ae={type:"table",header:K(Te[1].replace(/^ *| *\| *$/g,"")),align:Te[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Te[3]?Te[3].replace(/\n$/,"").split(`
`):[],raw:Te[0]};if(Ae.header.length===Ae.align.length){var Pe=Ae.align.length,Xe;for(Xe=0;Xe ?/gm,"");return{type:"blockquote",raw:Te[0],text:Ae}}},Me.list=function(ye){var Te=this.rules.block.list.exec(ye);if(Te){for(var Ae=Te[0],Pe=Te[2],Xe=Pe.length>1,rt=Pe[Pe.length-1]===")",ft={type:"list",raw:Ae,ordered:Xe,start:Xe?+Pe.slice(0,-1):"",loose:!1,items:[]},St=Te[0].match(this.rules.block.item),Pt=!1,dt,At,Ot,bt,Vt,ir,Qt,dr=St.length,Nt=0;Nt1||this.options.smartLists&&Ot!==Pe)&&(bt=St.slice(Nt+1).join(`
`),ft.raw=ft.raw.substring(0,ft.raw.length-bt.length),Nt=dr-1)),Vt=Pt||/\n\n(?!\s*$)/.test(dt),Nt!==dr-1&&(Pt=dt.charAt(dt.length-1)===`
`,Vt||(Vt=Pt)),Vt&&(ft.loose=!0),ir=/^\[[ xX]\] /.test(dt),Qt=void 0,ir&&(Qt=dt[1]!==" ",dt=dt.replace(/^\[[ xX]\] +/,"")),ft.items.push({type:"list_item",raw:Ae,task:ir,checked:Qt,loose:Vt,text:dt});return ft}},Me.html=function(ye){var Te=this.rules.block.html.exec(ye);if(Te)return{type:this.options.sanitize?"paragraph":"html",raw:Te[0],pre:!this.options.sanitizer&&(Te[1]==="pre"||Te[1]==="script"||Te[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Te[0]):q(Te[0]):Te[0]}},Me.def=function(ye){var Te=this.rules.block.def.exec(ye);if(Te){Te[3]&&(Te[3]=Te[3].substring(1,Te[3].length-1));var Ae=Te[1].toLowerCase().replace(/\s+/g," ");return{tag:Ae,raw:Te[0],href:Te[2],title:Te[3]}}},Me.table=function(ye){var Te=this.rules.block.table.exec(ye);if(Te){var Ae={type:"table",header:K(Te[1].replace(/^ *| *\| *$/g,"")),align:Te[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Te[3]?Te[3].replace(/\n$/,"").split(`
`):[]};if(Ae.header.length===Ae.align.length){Ae.raw=Te[0];var Pe=Ae.align.length,Xe;for(Xe=0;Xe/i.test(Pe[0])&&(Te=!1),!Ae&&/^<(pre|code|kbd|script)(\s|>)/i.test(Pe[0])?Ae=!0:Ae&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Pe[0])&&(Ae=!1),{type:this.options.sanitize?"text":"html",raw:Pe[0],inLink:Te,inRawBlock:Ae,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Pe[0]):q(Pe[0]):Pe[0]}},Me.link=function(ye){var Te=this.rules.inline.link.exec(ye);if(Te){var Ae=re(Te[2],"()");if(Ae>-1){var Pe=Te[0].indexOf("!")===0?5:4,Xe=Pe+Te[1].length+Ae;Te[2]=Te[2].substring(0,Ae),Te[0]=Te[0].substring(0,Xe).trim(),Te[3]=""}var rt=Te[2],ft="";if(this.options.pedantic){var St=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(rt);St?(rt=St[1],ft=St[3]):ft=""}else ft=Te[3]?Te[3].slice(1,-1):"";rt=rt.trim().replace(/^<([\s\S]*)>$/,"$1");var Pt=ee(Te,{href:rt&&rt.replace(this.rules.inline._escapes,"$1"),title:ft&&ft.replace(this.rules.inline._escapes,"$1")},Te[0]);return Pt}},Me.reflink=function(ye,Te){var Ae;if((Ae=this.rules.inline.reflink.exec(ye))||(Ae=this.rules.inline.nolink.exec(ye))){var Pe=(Ae[2]||Ae[1]).replace(/\s+/g," ");if(Pe=Te[Pe.toLowerCase()],!Pe||!Pe.href){var Xe=Ae[0].charAt(0);return{type:"text",raw:Xe,text:Xe}}var rt=ee(Ae,Pe,Ae[0]);return rt}},Me.strong=function(ye,Te,Ae){Ae===void 0&&(Ae="");var Pe=this.rules.inline.strong.start.exec(ye);if(Pe&&(!Pe[1]||Pe[1]&&(Ae===""||this.rules.inline.punctuation.exec(Ae)))){Te=Te.slice(-1*ye.length);var Xe=Pe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Xe.lastIndex=0;for(var rt;(Pe=Xe.exec(Te))!=null;)if(rt=this.rules.inline.strong.middle.exec(Te.slice(0,Pe.index+3)),rt)return{type:"strong",raw:ye.slice(0,rt[0].length),text:ye.slice(2,rt[0].length-2)}}},Me.em=function(ye,Te,Ae){Ae===void 0&&(Ae="");var Pe=this.rules.inline.em.start.exec(ye);if(Pe&&(!Pe[1]||Pe[1]&&(Ae===""||this.rules.inline.punctuation.exec(Ae)))){Te=Te.slice(-1*ye.length);var Xe=Pe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Xe.lastIndex=0;for(var rt;(Pe=Xe.exec(Te))!=null;)if(rt=this.rules.inline.em.middle.exec(Te.slice(0,Pe.index+2)),rt)return{type:"em",raw:ye.slice(0,rt[0].length),text:ye.slice(1,rt[0].length-1)}}},Me.codespan=function(ye){var Te=this.rules.inline.code.exec(ye);if(Te){var Ae=Te[2].replace(/\n/g," "),Pe=/[^ ]/.test(Ae),Xe=Ae.startsWith(" ")&&Ae.endsWith(" ");return Pe&&Xe&&(Ae=Ae.substring(1,Ae.length-1)),Ae=q(Ae,!0),{type:"codespan",raw:Te[0],text:Ae}}},Me.br=function(ye){var Te=this.rules.inline.br.exec(ye);if(Te)return{type:"br",raw:Te[0]}},Me.del=function(ye){var Te=this.rules.inline.del.exec(ye);if(Te)return{type:"del",raw:Te[0],text:Te[1]}},Me.autolink=function(ye,Te){var Ae=this.rules.inline.autolink.exec(ye);if(Ae){var Pe,Xe;return Ae[2]==="@"?(Pe=q(this.options.mangle?Te(Ae[1]):Ae[1]),Xe="mailto:"+Pe):(Pe=q(Ae[1]),Xe=Pe),{type:"link",raw:Ae[0],text:Pe,href:Xe,tokens:[{type:"text",raw:Pe,text:Pe}]}}},Me.url=function(ye,Te){var Ae;if(Ae=this.rules.inline.url.exec(ye)){var Pe,Xe;if(Ae[2]==="@")Pe=q(this.options.mangle?Te(Ae[0]):Ae[0]),Xe="mailto:"+Pe;else{var rt;do rt=Ae[0],Ae[0]=this.rules.inline._backpedal.exec(Ae[0])[0];while(rt!==Ae[0]);Pe=q(Ae[0]),Ae[1]==="www."?Xe="http://"+Pe:Xe=Pe}return{type:"link",raw:Ae[0],text:Pe,href:Xe,tokens:[{type:"text",raw:Pe,text:Pe}]}}},Me.inlineText=function(ye,Te,Ae){var Pe=this.rules.inline.text.exec(ye);if(Pe){var Xe;return Te?Xe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Pe[0]):q(Pe[0]):Pe[0]:Xe=q(this.options.smartypants?Ae(Pe[0]):Pe[0]),{type:"text",raw:Pe[0],text:Xe}}},Ue}(),he=G.noopTest,ke=G.edit,_e=G.merge,de={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:he,table:he,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};de._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,de._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,de.def=ke(de.def).replace("label",de._label).replace("title",de._title).getRegex(),de.bullet=/(?:[*+-]|\d{1,9}[.)])/,de.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,de.item=ke(de.item,"gm").replace(/bull/g,de.bullet).getRegex(),de.list=ke(de.list).replace(/bull/g,de.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+de.def.source+")").getRegex(),de._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",de._comment=//,de.html=ke(de.html,"i").replace("comment",de._comment).replace("tag",de._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),de.paragraph=ke(de._paragraph).replace("hr",de.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",de._tag).getRegex(),de.blockquote=ke(de.blockquote).replace("paragraph",de.paragraph).getRegex(),de.normal=_e({},de),de.gfm=_e({},de.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*|$)"}),de.gfm.nptable=ke(de.gfm.nptable).replace("hr",de.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",de._tag).getRegex(),de.gfm.table=ke(de.gfm.table).replace("hr",de.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",de._tag).getRegex(),de.pedantic=_e({},de.normal,{html:ke(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",de._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:he,paragraph:ke(de.normal._paragraph).replace("hr",de.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",de.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ce={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:he,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:he,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",ce.punctuation=ke(ce.punctuation).replace(/punctuation/g,ce._punctuation).getRegex(),ce._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ce._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ce.em.start=ke(ce.em.start).replace(/punctuation/g,ce._punctuation).getRegex(),ce.em.middle=ke(ce.em.middle).replace(/punctuation/g,ce._punctuation).replace(/overlapSkip/g,ce._overlapSkip).getRegex(),ce.em.endAst=ke(ce.em.endAst,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.em.endUnd=ke(ce.em.endUnd,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.start=ke(ce.strong.start).replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.middle=ke(ce.strong.middle).replace(/punctuation/g,ce._punctuation).replace(/blockSkip/g,ce._blockSkip).getRegex(),ce.strong.endAst=ke(ce.strong.endAst,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.endUnd=ke(ce.strong.endUnd,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.blockSkip=ke(ce._blockSkip,"g").getRegex(),ce.overlapSkip=ke(ce._overlapSkip,"g").getRegex(),ce._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ce._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ce._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])?)+(?![-_])/,ce.autolink=ke(ce.autolink).replace("scheme",ce._scheme).replace("email",ce._email).getRegex(),ce._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ce.tag=ke(ce.tag).replace("comment",de._comment).replace("attribute",ce._attribute).getRegex(),ce._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ce._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ce._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ce.link=ke(ce.link).replace("label",ce._label).replace("href",ce._href).replace("title",ce._title).getRegex(),ce.reflink=ke(ce.reflink).replace("label",ce._label).getRegex(),ce.reflinkSearch=ke(ce.reflinkSearch,"g").replace("reflink",ce.reflink).replace("nolink",ce.nolink).getRegex(),ce.normal=_e({},ce),ce.pedantic=_e({},ce.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:ke(/^!?\[(label)\]\((.*?)\)/).replace("label",ce._label).getRegex(),reflink:ke(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ce._label).getRegex()}),ce.gfm=_e({},ce.normal,{escape:ke(ce.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&&(ye="x"+ye.toString(16)),Me+=""+ye+";";return Me}var Q=function(){function Ue(Ie){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ie||Se,this.options.tokenizer=this.options.tokenizer||new xe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ye={block:te.normal,inline:ue.normal};this.options.pedantic?(ye.block=te.pedantic,ye.inline=ue.pedantic):this.options.gfm&&(ye.block=te.gfm,this.options.breaks?ye.inline=ue.breaks:ye.inline=ue.gfm),this.tokenizer.rules=ye}Ue.lex=function(ye,Te){var Ae=new Ue(Te);return Ae.lex(ye)};var Me=Ue.prototype;return Me.lex=function(ye){return ye=ye.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ye,this.tokens,!0),this.inline(this.tokens),this.tokens},Me.blockTokens=function(ye,Te,Ae){Te===void 0&&(Te=[]),Ae===void 0&&(Ae=!0),ye=ye.replace(/^ +$/gm,"");for(var Pe,Xe,rt,ft;ye;){if(Pe=this.tokenizer.space(ye)){ye=ye.substring(Pe.raw.length),Pe.type&&Te.push(Pe);continue}if(Pe=this.tokenizer.code(ye,Te)){ye=ye.substring(Pe.raw.length),Pe.type?Te.push(Pe):(ft=Te[Te.length-1],ft.raw+=`
`+Pe.raw,ft.text+=`
`+Pe.text);continue}if(Pe=this.tokenizer.fences(ye)){ye=ye.substring(Pe.raw.length),Te.push(Pe);continue}if(Pe=this.tokenizer.heading(ye)){ye=ye.substring(Pe.raw.length),Te.push(Pe);continue}if(Pe=this.tokenizer.nptable(ye)){ye=ye.substring(Pe.raw.length),Te.push(Pe);continue}if(Pe=this.tokenizer.hr(ye)){ye=ye.substring(Pe.raw.length),Te.push(Pe);continue}if(Pe=this.tokenizer.blockquote(ye)){ye=ye.substring(Pe.raw.length),Pe.tokens=this.blockTokens(Pe.text,[],Ae),Te.push(Pe);continue}if(Pe=this.tokenizer.list(ye)){for(ye=ye.substring(Pe.raw.length),rt=Pe.items.length,Xe=0;Xe