(window.webpackJsonp=window.webpackJsonp||[]).push([[164,5,6,7],{"+NIl":function(rt,_e,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";ie.defineMode("stex",function(J,P){"use strict";function X(h,l){h.cmdState.push(l)}function j(h){return h.cmdState.length>0?h.cmdState[h.cmdState.length-1]:null}function U(h){var l=h.cmdState.pop();l&&l.closeBracket()}function K(h){for(var l=h.cmdState,f=l.length-1;f>=0;f--){var o=l[f];if(o.name=="DEFAULT")continue;return o}return{styleIdentifier:function(){return null}}}function G(h,l,f){return function(){this.name=h,this.bracketNo=0,this.style=l,this.styles=f,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var r={};r.importmodule=G("importmodule","tag",["string","builtin"]),r.documentclass=G("documentclass","tag",["","atom"]),r.usepackage=G("usepackage","tag",["atom"]),r.begin=G("begin","tag",["atom"]),r.end=G("end","tag",["atom"]),r.label=G("label","tag",["atom"]),r.ref=G("ref","tag",["atom"]),r.eqref=G("eqref","tag",["atom"]),r.cite=G("cite","tag",["atom"]),r.bibitem=G("bibitem","tag",["atom"]),r.Bibitem=G("Bibitem","tag",["atom"]),r.RBibitem=G("RBibitem","tag",["atom"]),r.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function R(h,l){h.f=l}function v(h,l){var f;if(h.match(/^\\[a-zA-Z@]+/)){var o=h.current().slice(1);return f=r.hasOwnProperty(o)?r[o]:r.DEFAULT,f=new f,X(l,f),R(l,p),f.style}if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/\\]/))return"tag";if(h.match("\\["))return R(l,function(s,a){return m(s,a,"\\]")}),"keyword";if(h.match("\\("))return R(l,function(s,a){return m(s,a,"\\)")}),"keyword";if(h.match("$$"))return R(l,function(s,a){return m(s,a,"$$")}),"keyword";if(h.match("$"))return R(l,function(s,a){return m(s,a,"$")}),"keyword";var u=h.next();if(u=="%")return h.skipToEnd(),"comment";if(u=="}"||u=="]"){if(f=j(l),f)f.closeBracket(u),R(l,p);else return"error";return"bracket"}else return u=="{"||u=="["?(f=r.DEFAULT,f=new f,X(l,f),"bracket"):/\d/.test(u)?(h.eatWhile(/[\w.%]/),"atom"):(h.eatWhile(/[\w\-_]/),f=K(l),f.name=="begin"&&(f.argument=h.current()),f.styleIdentifier())}function m(h,l,f){if(h.eatSpace())return null;if(f&&h.match(f))return R(l,v),"keyword";if(h.match(/^\\[a-zA-Z@]+/))return"tag";if(h.match(/^[a-zA-Z]+/))return"variable-2";if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/]/))return"tag";if(h.match(/^[\^_&]/))return"tag";if(h.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(h.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var o=h.next();return o=="{"||o=="}"||o=="["||o=="]"||o=="("||o==")"?"bracket":o=="%"?(h.skipToEnd(),"comment"):"error"}function p(h,l){var f=h.peek(),o;return f=="{"||f=="["?(o=j(l),o.openBracket(f),h.eat(f),R(l,v),"bracket"):/[ \t\r]/.test(f)?(h.eat(f),null):(R(l,v),U(l),v(h,l))}return{startState:function(){var h=P.inMathMode?function(l,f){return m(l,f)}:v;return{cmdState:[],f:h}},copyState:function(h){return{cmdState:h.cmdState.slice(),f:h.f}},token:function(h,l){return l.f(h,l)},blankLine:function(h){h.f=v,h.cmdState.length=0},lineComment:"%"}}),ie.defineMIME("text/x-stex","stex"),ie.defineMIME("text/x-latex","stex")})},"+ua5":function(rt,_e,Z){},"/cxE":function(rt,_e,Z){"use strict";Z.d(_e,"f",function(){return P}),Z.d(_e,"g",function(){return X}),Z.d(_e,"h",function(){return j}),Z.d(_e,"e",function(){return K}),Z.d(_e,"b",function(){return G}),Z.d(_e,"c",function(){return r}),Z.d(_e,"d",function(){return R}),Z.d(_e,"a",function(){return v});class ie{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(m){setTimeout(()=>{throw m.stack?new Error(m.message+`
`+m.stack):m},0)}}emit(m){this.listeners.forEach(p=>{p(m)})}onUnexpectedError(m){this.unexpectedErrorHandler(m),this.emit(m)}onUnexpectedExternalError(m){this.unexpectedErrorHandler(m)}}const J=new ie;function P(m){K(m)||J.onUnexpectedError(m);return}function X(m){K(m)||J.onUnexpectedExternalError(m);return}function j(m){if(m instanceof Error){let{name:p,message:h}=m;const l=m.stacktrace||m.stack;return{$isError:!0,name:p,message:h,stack:l}}return m}const U="Canceled";function K(m){return m instanceof Error&&m.name===U&&m.message===U}function G(){const m=new Error(U);return m.name=m.message,m}function r(m){return m?new Error(`Illegal argument: ${m}`):new Error("Illegal argument")}function R(m){return m?new Error(`Illegal state: ${m}`):new Error("Illegal state")}class v extends Error{constructor(m){super("NotSupported");m&&(this.message=m)}}},"19Vz":function(rt,_e,Z){(function(ie){ie(Z("VrN/"))})(function(ie){ie.defineOption("placeholder","",function(G,r,R){var v=R&&R!=ie.Init;if(r&&!v)G.on("blur",j),G.on("change",U),G.on("swapDoc",U),ie.on(G.getInputField(),"compositionupdate",G.state.placeholderCompose=function(){X(G)}),U(G);else if(!r&&v){G.off("blur",j),G.off("change",U),G.off("swapDoc",U),ie.off(G.getInputField(),"compositionupdate",G.state.placeholderCompose),J(G);var m=G.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}r&&!G.hasFocus()&&j(G)});function J(G){G.state.placeholder&&(G.state.placeholder.parentNode.removeChild(G.state.placeholder),G.state.placeholder=null)}function P(G){J(G);var r=G.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=G.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var R=G.getOption("placeholder");typeof R=="string"&&(R=document.createTextNode(R)),r.appendChild(R),G.display.lineSpace.insertBefore(r,G.display.lineSpace.firstChild)}function X(G){setTimeout(function(){var r=!1,R=G.getInputField();R.nodeName=="TEXTAREA"?r=!R.value:G.lineCount()==1&&(r=!/[^\u200b]/.test(R.querySelector(".CodeMirror-line").textContent)),r?P(G):J(G)},20)}function j(G){K(G)&&P(G)}function U(G){var r=G.getWrapperElement(),R=K(G);r.className=r.className.replace(" CodeMirror-empty","")+(R?" CodeMirror-empty":""),R?P(G):J(G)}function K(G){return G.lineCount()===1&&G.getLine(0)===""}})},"1eCo":function(rt,_e,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";var J={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},P={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ie.defineMode("xml",function(X,j){var U=X.indentUnit,K={},G=j.htmlMode?J:P;for(var r in G)K[r]=G[r];for(var r in j)K[r]=j[r];var R,v;function m(c,S){function y(F){return S.tokenize=F,F(c,S)}var b=c.next();if(b=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?y(l("atom","]]>")):null:c.match("--")?y(l("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),y(f(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),S.tokenize=l("meta","?>"),"meta"):(R=c.eat("/")?"closeTag":"openTag",S.tokenize=p,"tag bracket");if(b=="&"){var B;return c.eat("#")?c.eat("x")?B=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):B=c.eatWhile(/[\d]/)&&c.eat(";"):B=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),B?"atom":"error"}else return c.eatWhile(/[^&<]/),null}m.isInText=!0;function p(c,S){var y=c.next();if(y==">"||y=="/"&&c.eat(">"))return S.tokenize=m,R=y==">"?"endTag":"selfcloseTag","tag bracket";if(y=="=")return R="equals",null;if(y=="<"){S.tokenize=m,S.state=a,S.tagName=S.tagStart=null;var b=S.tokenize(c,S);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(y)?(S.tokenize=h(y),S.stringStartCol=c.column(),S.tokenize(c,S)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(c){var S=function(y,b){for(;!y.eol();)if(y.next()==c){b.tokenize=p;break}return"string"};return S.isInAttribute=!0,S}function l(c,S){return function(y,b){for(;!y.eol();){if(y.match(S)){b.tokenize=m;break}y.next()}return c}}function f(c){return function(S,y){for(var b;(b=S.next())!=null;){if(b=="<")return y.tokenize=f(c+1),y.tokenize(S,y);if(b==">")if(c==1){y.tokenize=m;break}else return y.tokenize=f(c-1),y.tokenize(S,y)}return"meta"}}function o(c,S,y){this.prev=c.context,this.tagName=S,this.indent=c.indented,this.startOfLine=y,(K.doNotIndent.hasOwnProperty(S)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function u(c){c.context&&(c.context=c.context.prev)}function s(c,S){for(var y;;){if(!c.context)return;if(y=c.context.tagName,!K.contextGrabbers.hasOwnProperty(y)||!K.contextGrabbers[y].hasOwnProperty(S))return;u(c)}}function a(c,S,y){return c=="openTag"?(y.tagStart=S.column(),O):c=="closeTag"?E:a}function O(c,S,y){return c=="word"?(y.tagName=S.current(),v="tag",L):K.allowMissingTagName&&c=="endTag"?(v="tag bracket",L(c,S,y)):(v="error",O)}function E(c,S,y){if(c=="word"){var b=S.current();return y.context&&y.context.tagName!=b&&K.implicitlyClosed.hasOwnProperty(y.context.tagName)&&u(y),y.context&&y.context.tagName==b||K.matchClosing===!1?(v="tag",w):(v="tag error",D)}else return K.allowMissingTagName&&c=="endTag"?(v="tag bracket",w(c,S,y)):(v="error",D)}function w(c,S,y){return c!="endTag"?(v="error",w):(u(y),a)}function D(c,S,y){return v="error",w(c,S,y)}function L(c,S,y){if(c=="word")return v="attribute",A;if(c=="endTag"||c=="selfcloseTag"){var b=y.tagName,B=y.tagStart;return y.tagName=y.tagStart=null,c=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(b)?s(y,b):(s(y,b),y.context=new o(y,b,B==y.indented)),a}return v="error",L}function A(c,S,y){return c=="equals"?C:(K.allowMissing||(v="error"),L(c,S,y))}function C(c,S,y){return c=="string"?x:c=="word"&&K.allowUnquoted?(v="string",L):(v="error",L(c,S,y))}function x(c,S,y){return c=="string"?x:L(c,S,y)}return{startState:function(c){var S={tokenize:m,state:a,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(S.baseIndent=c),S},token:function(c,S){if(!S.tagName&&c.sol()&&(S.indented=c.indentation()),c.eatSpace())return null;R=null;var y=S.tokenize(c,S);return(y||R)&&y!="comment"&&(v=null,S.state=S.state(R||y,c,S),v&&(y=v=="error"?y+" error":v)),y},indent:function(c,S,y){var b=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+U;if(b&&b.noIndent)return ie.Pass;if(c.tokenize!=p&&c.tokenize!=m)return y?y.match(/^(\s*)/)[0].length:0;if(c.tagName)return K.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+U*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/$/,blockCommentStart:"",configuration:K.htmlMode?"html":"xml",helperType:K.htmlMode?"html":"xml",skipAttribute:function(c){c.state==C&&(c.state=L)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var S=[],y=c.context;y;y=y.prev)y.tagName&&S.push(y.tagName);return S.reverse()}}}),ie.defineMIME("text/xml","xml"),ie.defineMIME("application/xml","xml"),ie.mimeModes.hasOwnProperty("text/html")||ie.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return J});class ie{constructor(P){this.element=P,this.next=ie.Undefined,this.prev=ie.Undefined}}ie.Undefined=new ie(void 0);class J{constructor(){this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ie.Undefined}clear(){let P=this._first;for(;P!==ie.Undefined;){const X=P.next;P.prev=ie.Undefined,P.next=ie.Undefined,P=X}this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}unshift(P){return this._insert(P,!1)}push(P){return this._insert(P,!0)}_insert(P,X){const j=new ie(P);if(this._first===ie.Undefined)this._first=j,this._last=j;else if(X){const K=this._last;this._last=j,j.prev=K,K.next=j}else{const K=this._first;this._first=j,j.next=K,K.prev=j}this._size+=1;let U=!1;return()=>{U||(U=!0,this._remove(j))}}shift(){if(this._first===ie.Undefined)return;{const P=this._first.element;return this._remove(this._first),P}}pop(){if(this._last===ie.Undefined)return;{const P=this._last.element;return this._remove(this._last),P}}_remove(P){if(P.prev!==ie.Undefined&&P.next!==ie.Undefined){const X=P.prev;X.next=P.next,P.next.prev=X}else P.prev===ie.Undefined&&P.next===ie.Undefined?(this._first=ie.Undefined,this._last=ie.Undefined):P.next===ie.Undefined?(this._last=this._last.prev,this._last.next=ie.Undefined):P.prev===ie.Undefined&&(this._first=this._first.next,this._first.prev=ie.Undefined);this._size-=1}*[Symbol.iterator](){let P=this._first;for(;P!==ie.Undefined;)yield P.element,P=P.next}}},"3/fG":function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return J});function ie(P,X){let j;return X.length===0?j=P:j=P.replace(/\{(\d+)\}/g,function(U,K){const G=K[0];return typeof X[G]!="undefined"?X[G]:U}),j}function J(P,X,...j){return ie(X,j)}},"500L":function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return E});var ie=Z("+L6B"),J=Z("2/Rp"),P=Z("2qtc"),X=Z("kLXV"),j=Z("9og8"),U=Z("k1fw"),K=Z("miYZ"),G=Z("tsqr"),r=Z("oBTY"),R=Z("tJVT"),v=Z("DZo9"),m=Z("8z0m"),p=Z("WmNS"),h=Z.n(p),l=Z("q1tI"),f=Z.n(l),o=Z("m3rI"),u=Z("wzkS"),s=Z("y5JW"),a=Z("LtfV"),O=m.a.Dragger;function E(w){var D=[];return w&&w.length>0&&(D=w.map(function(L){return{uid:L.id,id:L.id,name:L.title+s.c+L.filesize,url:L.url,filesize:L.filesize,status:"done",response:{id:L.id}}})),D}_e.b=function(w){var D=w.value,L=w.onChange,A=w.action,C=w.className,x=w.maxSize,c=x===void 0?150:x,S=w.title,y=S===void 0?"\u4E0A\u4F20\u9644\u4EF6":S,b=w.showRemoveModal,B=b===void 0?!1:b,F=w.accept,_=F===void 0?"":F,M=w.additionalText,I=w.isDragger,g=w.number,H=g===void 0?1e3:g,$=w.aloneClear,ne=$===void 0?!1:$,oe=Object(l.useState)(!1),Oe=Object(R.a)(oe,2),ye=Oe[0],Te=Oe[1],Re=Object(l.useState)(D||[]),Le=Object(R.a)(Re,2),de=Le[0],he=Le[1];Object(l.useEffect)(function(){D&&(he(Object(r.a)(D)),H===(D==null?void 0:D.length)&&Te(!0))},[D]);var re=function(){setTimeout(function(){de.pop(),he(Object(r.a)(de))},500)},fe={multiple:!0,disabled:ye,accept:_,withCredentials:!0,fileList:de,beforeUpload:function(Ne,Se){var Pe=Ne.size/1024/1024;return de.concat(Se).length>H?(de.pop(),he(Object(r.a)(de)),G.b.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(H,"\u4E2A\u6587\u4EF6")),ne?Promise.reject():(re(),!1)):!0},action:A||"".concat(o.a.API_SERVER,"/api/attachments.json"),onChange:function(Ne){var Se,Pe,je=Object(r.a)(Ne.fileList);if(Ne.file.status==="done"&&((Se=Ne.file)===null||Se===void 0||((Pe=Se.response)===null||Pe===void 0)?void 0:Pe.status)===-1){var le,ve;G.b.error((le=Ne.file)===null||le===void 0||((ve=le.response)===null||ve===void 0)?void 0:ve.message);return}je.length>=H?Te(!0):Te(!1),he(Object(r.a)(je)),je=je.map(function(we){var Ie;if(we!=null&&(Ie=we.response)!==null&&Ie!==void 0&&Ie.id){var We;we.url="/api/attachments/".concat(we==null||((We=we.response)===null||We===void 0)?void 0:We.id)}return we.name.indexOf(s.c)===-1&&(we.name="".concat(we.name).concat(s.c).concat(Object(s.a)(we.size))),Object(U.a)({},we)}),console.log("info:",Ne),L(je)},onRemove:function(){var De=Object(j.a)(h.a.mark(function Se(Pe){var je;return h.a.wrap(function(ve){for(;;)switch(ve.prev=ve.next){case 0:if(je=function(){var we=Object(j.a)(h.a.mark(function Ie(){var We,Ve;return h.a.wrap(function($e){for(;;)switch($e.prev=$e.next){case 0:if(We=Pe.response?Pe.response.id:Pe.id,!We){$e.next=8;break}return $e.next=4,Object(u.d)(Pe.response?Pe.response.id:Pe.uid);case 4:return Ve=$e.sent,$e.abrupt("return",Ve);case 8:return $e.abrupt("return",!0);case 9:case"end":return $e.stop()}},Ie)}));return function(){return we.apply(this,arguments)}}(),!B){ve.next=5;break}return ve.abrupt("return",new Promise(function(we,Ie){X.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:f.a.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:function(){var We=Object(j.a)(h.a.mark(function Ze(){var $e;return h.a.wrap(function(Qe){for(;;)switch(Qe.prev=Qe.next){case 0:return Qe.next=2,je();case 2:$e=Qe.sent,G.b.success("\u5220\u9664\u6210\u529F"),we(!0);case 5:case"end":return Qe.stop()}},Ze)}));function Ve(){return We.apply(this,arguments)}return Ve}(),onCancel:function(){return we(!1)}})}));case 5:return ve.next=7,je();case 7:return ve.abrupt("return",ve.sent);case 8:case"end":return ve.stop()}},Se)}));function Ne(Se){return De.apply(this,arguments)}return Ne}()};function se(De){De.preventDefault(),De.stopPropagation()}return f.a.createElement("div",{className:"multi-upload ".concat(C||"")},I&&f.a.createElement(O,fe,f.a.createElement("p",{className:"ant-upload-drag-icon"},f.a.createElement(a.a,null)),f.a.createElement("p",{className:"ant-upload-text"},"\u70B9\u51FB\u4E0A\u4F20\u56FE\u6807\uFF0C\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64",f.a.createElement("br",null),"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A",c,"MB)"," "),M),!I&&f.a.createElement(m.a,fe,f.a.createElement(J.a,{style:{width:"108px",height:"32px",background:"#F6F7F9 linear-gradient(180deg, #FFFFFF 0%, #F6F7F9 100%)",boxShadow:"0px 2px 4px 0px #E0DFE1, inset 0px 1px 3px 0px rgba(255,255,255,0.5)",borderRadius:"2px",border:"1px solid #BACFFE",color:"#3061D0"},icon:f.a.createElement("i",{className:"iconfont icon-shangchuan3",style:{marginRight:"6px"}}),disabled:ye},y),f.a.createElement("span",{onClick:se,style:{marginLeft:10,color:"#FA6400"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",c,"MB)"," ")))}},"55Ip":function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return s});var ie=Z("Ty5D"),J=Z("dI71"),P=Z("q1tI"),X=Z.n(P),j=Z("YS25"),U=Z("17x9"),K=Z.n(U),G=Z("wx14"),r=Z("zLVn"),R=Z("9R94"),v=function(C){Object(J.a)(x,C);function x(){for(var S,y=arguments.length,b=new Array(y),B=0;B$&&($=g.line_indent_level));var ne={mode:H,parent:g,last_token:g?g.last_token:new p(s.START_BLOCK,""),last_word:g?g.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:$,alignment:0,line_indent_level:g?g.line_indent_level:$,start_line_index:this._output.get_line_number(),ternary_depth:0};return ne},M.prototype._reset=function(g){var H=g.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,H),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(c.BlockStatement);var $=new f(g,this._options);return this._tokens=$.tokenize(),g},M.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var g,H=this._reset(this._source_text),$=this._options.eol;this._options.eol==="auto"&&($=`
`,H&&h.lineBreak.test(H||"")&&($=H.match(h.lineBreak)[0]));for(var ne=this._tokens.next();ne;)this.handle_token(ne),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ne,ne=this._tokens.next();return g=this._output.get_code($),g},M.prototype.handle_token=function(g,H){g.type===s.START_EXPR?this.handle_start_expr(g):g.type===s.END_EXPR?this.handle_end_expr(g):g.type===s.START_BLOCK?this.handle_start_block(g):g.type===s.END_BLOCK?this.handle_end_block(g):g.type===s.WORD?this.handle_word(g):g.type===s.RESERVED?this.handle_word(g):g.type===s.SEMICOLON?this.handle_semicolon(g):g.type===s.STRING?this.handle_string(g):g.type===s.EQUALS?this.handle_equals(g):g.type===s.OPERATOR?this.handle_operator(g):g.type===s.COMMA?this.handle_comma(g):g.type===s.BLOCK_COMMENT?this.handle_block_comment(g,H):g.type===s.COMMENT?this.handle_comment(g,H):g.type===s.DOT?this.handle_dot(g):g.type===s.EOF?this.handle_eof(g):g.type===s.UNKNOWN?this.handle_unknown(g,H):this.handle_unknown(g,H)},M.prototype.handle_whitespace_and_comments=function(g,H){var $=g.newlines,ne=this._options.keep_array_indentation&&b(this._flags.mode);if(g.comments_before)for(var oe=g.comments_before.next();oe;)this.handle_whitespace_and_comments(oe,H),this.handle_token(oe,H),oe=g.comments_before.next();if(ne)for(var Oe=0;Oe<$;Oe+=1)this.print_newline(Oe>0,H);else if(this._options.max_preserve_newlines&&$>this._options.max_preserve_newlines&&($=this._options.max_preserve_newlines),this._options.preserve_newlines&&$>1){this.print_newline(!1,H);for(var ye=1;ye<$;ye+=1)this.print_newline(!0,H)}};var I=["async","break","continue","return","throw","yield"];M.prototype.allow_wrap_or_preserved_newline=function(g,H){if(H=H===void 0?!1:H,this._output.just_added_newline())return;var $=this._options.preserve_newlines&&g.newlines||H,ne=a(this._flags.last_token.text,u)||a(g.text,u);if(ne){var oe=a(this._flags.last_token.text,u)&&a(this._options.operator_position,x)||a(g.text,u);$=$&&oe}if($)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(D(this._flags.last_token,I))return;this._output.set_wrap_point()}},M.prototype.print_newline=function(g,H){if(!H&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var $=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&w($,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(g)&&(this._flags.multiline_frame=!0)},M.prototype.print_token_line_indentation=function(g){this._output.just_added_newline()&&(this._options.keep_array_indentation&&g.newlines&&(g.text==="["||b(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(g.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},M.prototype.print_token=function(g){if(this._output.raw){this._output.add_raw_token(g);return}if(this._options.comma_first&&g.previous&&g.previous.type===s.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var H=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(H),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(g),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(g),this._output.non_breaking_space=!0,this._output.add_token(g.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},M.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},M.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},M.prototype.set_mode=function(g){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,g),this._flags=this.create_flags(this._previous_flags,g),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},M.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===c.Statement&&S(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},M.prototype.start_of_object_property=function(){return this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"]))},M.prototype.start_of_statement=function(g){var H=!1;return H=H||D(this._flags.last_token,["var","let","const"])&&g.type===s.WORD,H=H||w(this._flags.last_token,"do"),H=H||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&D(this._flags.last_token,I)&&!g.newlines,H=H||w(this._flags.last_token,"else")&&!(w(g,"if")&&!g.comments_before),H=H||this._flags.last_token.type===s.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),H=H||this._flags.last_token.type===s.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(g.text==="--"||g.text==="++")&&this._last_last_text!=="function"&&g.type!==s.WORD&&g.type!==s.RESERVED,H=H||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"])),H?(this.set_mode(c.Statement),this.indent(),this.handle_whitespace_and_comments(g,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g,D(g,["do","for","if","while"])),!0):!1},M.prototype.handle_start_expr=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g);var H=c.Expression;if(g.text==="["){if(this._flags.last_token.type===s.WORD||this._flags.last_token.text===")"){D(this._flags.last_token,o)&&(this._output.space_before_token=!0),this.print_token(g),this.set_mode(H),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}H=c.ArrayLiteral,b(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),a(this._flags.last_token.type,[s.START_EXPR,s.END_EXPR,s.WORD,s.OPERATOR,s.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===s.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,H=c.ForInitializer):a(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,H=c.Conditional):a(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&g.whitespace_before===""?this._output.space_before_token=!1:(a(this._flags.last_token.text,o)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g);else if(this._flags.last_token.type===s.WORD){this._output.space_before_token=!1;var $=this._tokens.peek(-3);if(this._options.space_after_named_function&&$){var ne=this._tokens.peek(-4);D($,["async","function"])||$.text==="*"&&D(ne,["async","function"])?this._output.space_before_token=!0:this._flags.mode===c.ObjectLiteral?($.text==="{"||$.text===","||$.text==="*"&&(ne.text==="{"||ne.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(g);(this._flags.last_token.type===s.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(a(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&a(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===s.START_BLOCK?this.print_newline():(this._flags.last_token.type===s.END_EXPR||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===s.COMMA)&&this.allow_wrap_or_preserved_newline(g,g.newlines),this.print_token(g),this.set_mode(H),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},M.prototype.handle_end_expr=function(g){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(g,g.text==="]"&&b(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===s.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(g),this.restore_mode(),S(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===c.Conditional&&(this._previous_flags.mode=c.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},M.prototype.handle_start_block=function(g){this.handle_whitespace_and_comments(g);var H=this._tokens.peek(),$=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===s.END_EXPR?(this.set_mode(c.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(c.BlockStatement):$&&(a($.text,[":",","])&&a(H.type,[s.STRING,s.WORD,s.RESERVED])||a(H.text,["get","set","..."])&&a($.type,[s.WORD,s.RESERVED]))?a(this._last_last_text,["class","interface"])&&!a($.text,[":",","])?this.set_mode(c.BlockStatement):this.set_mode(c.ObjectLiteral):this._flags.last_token.type===s.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(c.BlockStatement):a(this._flags.last_token.type,[s.EQUALS,s.START_EXPR,s.COMMA,s.OPERATOR])||D(this._flags.last_token,["return","throw","import","default"])?this.set_mode(c.ObjectLiteral):this.set_mode(c.BlockStatement),this._flags.last_token&&(D(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ne=!H.comments_before&&H.text==="}",oe=ne&&this._flags.last_word==="function"&&this._flags.last_token.type===s.END_EXPR;if(this._options.brace_preserve_inline){var Oe=0,ye=null;this._flags.inline_frame=!0;do if(Oe+=1,ye=this._tokens.peek(Oe-1),ye.newlines){this._flags.inline_frame=!1;break}while(ye.type!==s.EOF&&!(ye.type===s.END_BLOCK&&ye.opened===g))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==s.OPERATOR&&(oe||this._flags.last_token.type===s.EQUALS||D(this._flags.last_token,L)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(b(this._previous_flags.mode)&&(this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.COMMA)&&((this._flags.last_token.type===s.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(g),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==s.OPERATOR&&this._flags.last_token.type!==s.START_EXPR&&(this._flags.last_token.type===s.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(g),this.indent(),!ne&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},M.prototype.handle_end_block=function(g){for(this.handle_whitespace_and_comments(g);this._flags.mode===c.Statement;)this.restore_mode();var H=this._flags.last_token.type===s.START_BLOCK;this._flags.inline_frame&&!H?this._output.space_before_token=!0:this._options.brace_style==="expand"?H||this.print_newline():H||(b(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(g)},M.prototype.handle_word=function(g){if(g.type===s.RESERVED){if(a(g.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)g.type=s.WORD;else if(g.text==="import"&&a(this._tokens.peek().text,["(","."]))g.type=s.WORD;else if(a(g.text,["as","from"])&&!this._flags.import_block)g.type=s.WORD;else if(this._flags.mode===c.ObjectLiteral){var H=this._tokens.peek();H.text===":"&&(g.type=s.WORD)}}if(this.start_of_statement(g)?D(this._flags.last_token,["var","let","const"])&&g.type===s.WORD&&(this._flags.declaration_statement=!0):g.newlines&&!B(this._flags.mode)&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==s.EQUALS&&(this._options.preserve_newlines||!D(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(g),this.print_newline()):this.handle_whitespace_and_comments(g),this._flags.do_block&&!this._flags.do_while)if(w(g,"while")){this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&w(g,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===c.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&D(g,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(g),this._flags.in_case=!0;return}if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g)),w(g,"function")){(a(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(a(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===s.OPERATOR))&&(!this._output.just_added_blankline()&&!g.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD?D(this._flags.last_token,["get","set","new","export"])||D(this._flags.last_token,I)?this._output.space_before_token=!0:w(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===s.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(B(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(g),this._flags.last_word=g.text;return}var $="NONE";if(this._flags.last_token.type===s.END_BLOCK?this._previous_flags.inline_frame?$="SPACE":D(g,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines?$="NEWLINE":($="SPACE",this._output.space_before_token=!0):$="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&this._flags.mode===c.BlockStatement?$="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&B(this._flags.mode)?$="SPACE":this._flags.last_token.type===s.STRING?$="NEWLINE":this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.last_token.text==="*"&&(a(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&a(this._last_last_text,["{",","]))?$="SPACE":this._flags.last_token.type===s.START_BLOCK?this._flags.inline_frame?$="SPACE":$="NEWLINE":this._flags.last_token.type===s.END_EXPR&&(this._output.space_before_token=!0,$="NEWLINE"),D(g,o)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?$="SPACE":$="NEWLINE"),D(g,["else","catch","finally"]))if((!(this._flags.last_token.type===s.END_BLOCK&&this._previous_flags.mode===c.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ne=this._output.current_line;ne.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else $==="NEWLINE"?D(this._flags.last_token,L)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&D(g,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==s.END_EXPR?(this._flags.last_token.type!==s.START_EXPR||!D(g,["var","let","const"]))&&this._flags.last_token.text!==":"&&(w(g,"if")&&w(g.previous,"else")?this._output.space_before_token=!0:this.print_newline()):D(g,o)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&b(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():$==="SPACE"&&(this._output.space_before_token=!0);g.previous&&(g.previous.type===s.WORD||g.previous.type===s.RESERVED)&&(this._output.space_before_token=!0),this.print_token(g),this._flags.last_word=g.text,g.type===s.RESERVED&&(g.text==="do"?this._flags.do_block=!0:g.text==="if"?this._flags.if_block=!0:g.text==="import"?this._flags.import_block=!0:this._flags.import_block&&w(g,"from")&&(this._flags.import_block=!1))},M.prototype.handle_semicolon=function(g){this.start_of_statement(g)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(g);for(var H=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&w(H,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(g)},M.prototype.handle_string=function(g){g.text.startsWith("`")&&g.newlines===0&&g.whitespace_before===""&&(g.previous.text===")"||this._flags.last_token.type===s.WORD)||(this.start_of_statement(g)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(g),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g):g.text.startsWith("`")&&this._flags.last_token.type===s.END_EXPR&&(g.previous.text==="]"||g.previous.text===")")&&g.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(g)},M.prototype.handle_equals=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0},M.prototype.handle_comma=function(g){this.handle_whitespace_and_comments(g,!0),this.print_token(g),this._output.space_before_token=!0,this._flags.declaration_statement?(B(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(g)):this._flags.mode===c.ObjectLiteral||this._flags.mode===c.Statement&&this._flags.parent.mode===c.ObjectLiteral?(this._flags.mode===c.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(g)},M.prototype.handle_operator=function(g){var H=g.text==="*"&&(D(this._flags.last_token,["function","yield"])||a(this._flags.last_token.type,[s.START_BLOCK,s.COMMA,s.END_BLOCK,s.SEMICOLON])),$=a(g.text,["-","+"])&&(a(this._flags.last_token.type,[s.START_BLOCK,s.START_EXPR,s.EQUALS,s.OPERATOR])||a(this._flags.last_token.text,o)||this._flags.last_token.text===",");if(!this.start_of_statement(g)){var ne=!H;this.handle_whitespace_and_comments(g,ne)}if(g.text==="*"&&this._flags.last_token.type===s.DOT){this.print_token(g);return}if(g.text==="::"){this.print_token(g);return}if(this._flags.last_token.type===s.OPERATOR&&a(this._options.operator_position,x)&&this.allow_wrap_or_preserved_newline(g),g.text===":"&&this._flags.in_case){this.print_token(g),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==s.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var oe=!0,Oe=!0,ye=!1;if(g.text===":"?this._flags.ternary_depth===0?oe=!1:(this._flags.ternary_depth-=1,ye=!0):g.text==="?"&&(this._flags.ternary_depth+=1),!$&&!H&&this._options.preserve_newlines&&a(g.text,u)){var Te=g.text===":",Re=Te&&ye,Le=Te&&!ye;switch(this._options.operator_position){case C.before_newline:this._output.space_before_token=!Le,this.print_token(g),(!Te||Re)&&this.allow_wrap_or_preserved_newline(g),this._output.space_before_token=!0;return;case C.after_newline:this._output.space_before_token=!0,!Te||Re?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(g):this._output.space_before_token=!1,this.print_token(g),this._output.space_before_token=!0;return;case C.preserve_newline:Le||this.allow_wrap_or_preserved_newline(g),oe=!(this._output.just_added_newline()||Le),this._output.space_before_token=oe,this.print_token(g),this._output.space_before_token=!0;return}}if(H){this.allow_wrap_or_preserved_newline(g),oe=!1;var de=this._tokens.peek();Oe=de&&a(de.type,[s.WORD,s.RESERVED])}else if(g.text==="...")this.allow_wrap_or_preserved_newline(g),oe=this._flags.last_token.type===s.START_BLOCK,Oe=!1;else if(a(g.text,["--","++","!","~"])||$){if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR)&&this.allow_wrap_or_preserved_newline(g),oe=!1,Oe=!1,g.newlines&&(g.text==="--"||g.text==="++"||g.text==="~")){var he=D(this._flags.last_token,L)&&g.newlines;he&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(he,!0)}this._flags.last_token.text===";"&&B(this._flags.mode)&&(oe=!0),this._flags.last_token.type===s.RESERVED?oe=!0:this._flags.last_token.type===s.END_EXPR?oe=!(this._flags.last_token.text==="]"&&(g.text==="--"||g.text==="++")):this._flags.last_token.type===s.OPERATOR&&(oe=a(g.text,["--","-","++","+"])&&a(this._flags.last_token.text,["--","-","++","+"]),a(g.text,["+","-"])&&a(this._flags.last_token.text,["--","++"])&&(Oe=!0)),(this._flags.mode===c.BlockStatement&&!this._flags.inline_frame||this._flags.mode===c.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||oe,this.print_token(g),this._output.space_before_token=Oe},M.prototype.handle_block_comment=function(g,H){if(this._output.raw){this._output.add_raw_token(g),g.directives&&g.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(g.directives){this.print_newline(!1,H),this.print_token(g),g.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!h.newline.test(g.text)&&!g.newlines){this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0;return}else this.print_block_commment(g,H)},M.prototype.print_block_commment=function(g,H){var $=y(g.text),ne,oe=!1,Oe=!1,ye=g.whitespace_before,Te=ye.length;if(this.print_newline(!1,H),this.print_token_line_indentation(g),this._output.add_token($[0]),this.print_newline(!1,H),$.length>1){for($=$.slice(1),oe=F($,"*"),Oe=_($,ye),oe&&(this._flags.alignment=1),ne=0;ne<$.length;ne++)oe?(this.print_token_line_indentation(g),this._output.add_token(O($[ne]))):Oe&&$[ne]?(this.print_token_line_indentation(g),this._output.add_token($[ne].substring(Te))):(this._output.current_line.set_indent(-1),this._output.add_token($[ne])),this.print_newline(!1,H);this._flags.alignment=0}},M.prototype.handle_comment=function(g,H){g.newlines?this.print_newline(!1,H):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(g),this.print_newline(!1,H)},M.prototype.handle_dot=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),D(this._flags.last_token,L)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(g,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(g)},M.prototype.handle_unknown=function(g,H){this.print_token(g),g.text[g.text.length-1]===`
`&&this.print_newline(!1,H)},M.prototype.handle_eof=function(g){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g)},r.exports.Beautifier=M},function(r){function R(p){this.__parent=p,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}R.prototype.clone_empty=function(){var p=new R(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},R.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},R.prototype.has_match=function(p){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(p))return!0;return!1},R.prototype.set_indent=function(p,h){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},R.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},R.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},R.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},R.prototype.is_empty=function(){return this.__items.length===0},R.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},R.prototype.push=function(p){this.__items.push(p);var h=p.lastIndexOf(`
`);h!==-1?this.__character_count=p.length-h:this.__character_count+=p.length},R.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},R.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},R.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},R.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},R.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function v(p,h){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),h=h||"",p.indent_level>0&&(h=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}v.prototype.get_indent_size=function(p,h){var l=this.__base_string_length;return h=h||0,p<0&&(l=0),l+=p*this.__indent_size,l+=h,l},v.prototype.get_indent_string=function(p,h){var l=this.__base_string;return h=h||0,p<0&&(p=0,l=""),h+=p*this.__indent_size,this.__ensure_cache(h),l+=this.__cache[h],l},v.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var p=this.__cache.length,h=0,l="";this.__indent_size&&p>=this.__indent_size&&(h=Math.floor(p/this.__indent_size),p-=h*this.__indent_size,l=new Array(h+1).join(this.__indent_string)),p&&(l+=new Array(p+1).join(" ")),this.__cache.push(l)};function m(p,h){this.__indent_cache=new v(p,h),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new R(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(p,h){return this.__indent_cache.get_indent_string(p,h)},m.prototype.get_indent_size=function(p,h){return this.__indent_cache.get_indent_size(p,h)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(p){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===`
`&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(`
`);return p!==`
`&&(l=l.replace(/[\n]/g,p)),l},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,h){return p=p||0,h=h||0,this.next_line.set_indent(p,h),this.__lines.length>1?(this.current_line.set_indent(p,h),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var h=0;h1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(p,h){for(var l=this.__lines.length-2;l>=0;){var f=this.__lines[l];if(f.is_empty())break;if(f.item(0).indexOf(p)!==0&&f.item(-1)!==h){this.__lines.splice(l+1,0,new R(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},r.exports.Output=m},function(r){function R(v,m,p,h){this.type=v,this.text=m,this.comments_before=null,this.newlines=p||0,this.whitespace_before=h||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}r.exports.Token=R},function(r,R){var v="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",h="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",l="(?:\\\\u[0-9a-fA-F]{4}|["+v+p+"])",f="(?:\\\\u[0-9a-fA-F]{4}|["+m+p+h+"])*";R.identifier=new RegExp(l+f,"g"),R.identifierStart=new RegExp(l),R.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+p+h+"])+");var o=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;R.newline=/[\n\r\u2028\u2029]/,R.lineBreak=new RegExp(`\r
|`+R.newline.source),R.allLineBreaks=new RegExp(R.lineBreak.source,"g")},function(r,R,v){var m=v(6).Options,p=["before-newline","after-newline","preserve-newline"];function h(l){m.call(this,l,"js");var f=this.raw_options.brace_style||null;f==="expand-strict"?this.raw_options.brace_style="expand":f==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var o=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var u=0;u>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),A=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";A=A.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),A="\\?\\.(?!\\d) "+A,A=A.replace(/ /g,"|");var C=new RegExp(A),x="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),c=x.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),S=new RegExp("^(?:"+c.join("|")+")$"),y,b=function(F,_){p.call(this,F,_),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var M=new o(this._input),I=new u(this._input).read_options(this._options);this.__patterns={template:I,identifier:I.starting_with(f.identifier).matching(f.identifierMatch),number:M.matching(E),punct:M.matching(C),comment:M.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:M.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:M.matching(//),include:M.starting_with(/#include/).until_after(f.lineBreak),shebang:M.starting_with(/#!/).until_after(f.lineBreak),xml:M.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:I.until(/['\\\n\r\u2028\u2029]/),double_quote:I.until(/["\\\n\r\u2028\u2029]/),template_text:I.until(/[`\\$]/),template_expression:I.until(/[`}\\]/)}};b.prototype=new p,b.prototype._is_comment=function(F){return F.type===a.COMMENT||F.type===a.BLOCK_COMMENT||F.type===a.UNKNOWN},b.prototype._is_opening=function(F){return F.type===a.START_BLOCK||F.type===a.START_EXPR},b.prototype._is_closing=function(F,_){return(F.type===a.END_BLOCK||F.type===a.END_EXPR)&&_&&(F.text==="]"&&_.text==="["||F.text===")"&&_.text==="("||F.text==="}"&&_.text==="{")},b.prototype._reset=function(){y=!1},b.prototype._get_next_token=function(F,_){var M=null;this._readWhitespace();var I=this._input.peek();return I===null?this._create_token(a.EOF,""):(M=M||this._read_non_javascript(I),M=M||this._read_string(I),M=M||this._read_word(F),M=M||this._read_singles(I),M=M||this._read_comment(I),M=M||this._read_regexp(I,F),M=M||this._read_xml(I,F),M=M||this._read_punctuation(),M=M||this._create_token(a.UNKNOWN,this._input.next()),M)},b.prototype._read_word=function(F){var _;if(_=this.__patterns.identifier.read(),_!=="")return _=_.replace(f.allLineBreaks,`
`),!(F.type===a.DOT||F.type===a.RESERVED&&(F.text==="set"||F.text==="get"))&&S.test(_)?(_==="in"||_==="of")&&(F.type===a.WORD||F.type===a.STRING)?this._create_token(a.OPERATOR,_):this._create_token(a.RESERVED,_):this._create_token(a.WORD,_);if(_=this.__patterns.number.read(),_!=="")return this._create_token(a.WORD,_)},b.prototype._read_singles=function(F){var _=null;return F==="("||F==="["?_=this._create_token(a.START_EXPR,F):F===")"||F==="]"?_=this._create_token(a.END_EXPR,F):F==="{"?_=this._create_token(a.START_BLOCK,F):F==="}"?_=this._create_token(a.END_BLOCK,F):F===";"?_=this._create_token(a.SEMICOLON,F):F==="."&&D.test(this._input.peek(1))?_=this._create_token(a.DOT,F):F===","&&(_=this._create_token(a.COMMA,F)),_&&this._input.next(),_},b.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(a.EQUALS,F):F==="?."?this._create_token(a.DOT,F):this._create_token(a.OPERATOR,F)},b.prototype._read_non_javascript=function(F){var _="";if(F==="#"){if(this._is_first_token()&&(_=this.__patterns.shebang.read(),_))return this._create_token(a.UNKNOWN,_.trim()+`
`);if(_=this.__patterns.include.read(),_)return this._create_token(a.UNKNOWN,_.trim()+`
`);F=this._input.next();var M="#";if(this._input.hasNext()&&this._input.testChar(w)){do F=this._input.next(),M+=F;while(this._input.hasNext()&&F!=="#"&&F!=="=");return F==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(M+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(M+="{}",this._input.next(),this._input.next())),this._create_token(a.WORD,M)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(_=this.__patterns.html_comment_start.read(),_){for(;this._input.hasNext()&&!this._input.testChar(f.newline);)_+=this._input.next();return y=!0,this._create_token(a.COMMENT,_)}}else if(y&&F==="-"&&(_=this.__patterns.html_comment_end.read(),_))return y=!1,this._create_token(a.COMMENT,_);return null},b.prototype._read_comment=function(F){var _=null;if(F==="/"){var M="";if(this._input.peek(1)==="*"){M=this.__patterns.block_comment.read();var I=O.get_directives(M);I&&I.ignore==="start"&&(M+=O.readIgnored(this._input)),M=M.replace(f.allLineBreaks,`
`),_=this._create_token(a.BLOCK_COMMENT,M),_.directives=I}else this._input.peek(1)==="/"&&(M=this.__patterns.comment.read(),_=this._create_token(a.COMMENT,M))}return _},b.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var _=this._input.next();return this.has_char_escapes=!1,F==="`"?_+=this._read_string_recursive("`",!0,"${"):_+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(_=B(_)),this._input.peek()===F&&(_+=this._input.next()),_=_.replace(f.allLineBreaks,`
`),this._create_token(a.STRING,_)}return null},b.prototype._allow_regexp_or_xml=function(F){return F.type===a.RESERVED&&s(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===a.END_EXPR&&F.text===")"&&F.opened.previous.type===a.RESERVED&&s(F.opened.previous.text,["if","while","for"])||s(F.type,[a.COMMENT,a.START_EXPR,a.START_BLOCK,a.START,a.END_BLOCK,a.OPERATOR,a.EQUALS,a.EOF,a.SEMICOLON,a.COMMA])},b.prototype._read_regexp=function(F,_){if(F==="/"&&this._allow_regexp_or_xml(_)){for(var M=this._input.next(),I=!1,g=!1;this._input.hasNext()&&(I||g||this._input.peek()!==F)&&!this._input.testChar(f.newline);)M+=this._input.peek(),I?I=!1:(I=this._input.peek()==="\\",this._input.peek()==="["?g=!0:this._input.peek()==="]"&&(g=!1)),this._input.next();return this._input.peek()===F&&(M+=this._input.next(),M+=this._input.read(f.identifier)),this._create_token(a.STRING,M)}return null},b.prototype._read_xml=function(F,_){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(_)){var M="",I=this.__patterns.xml.read_match();if(I){for(var g=I[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),H=g.indexOf("{")===0,$=0;I;){var ne=!!I[1],oe=I[2],Oe=!!I[I.length-1]||oe.slice(0,8)==="![CDATA[";if(!Oe&&(oe===g||H&&oe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ne?--$:++$),M+=I[0],$<=0)break;I=this.__patterns.xml.read_match()}return I||(M+=this._input.match(/[\s\S]*/g)[0]),M=M.replace(f.allLineBreaks,`
`),this._create_token(a.STRING,M)}}return null};function B(F){for(var _="",M=0,I=new m(F),g=null;I.hasNext();)if(g=I.match(/([\s]|[^\\]|\\\\)+/g),g&&(_+=g[0]),I.peek()==="\\"){if(I.next(),I.peek()==="x")g=I.match(/x([0-9A-Fa-f]{2})/g);else if(I.peek()==="u")g=I.match(/u([0-9A-Fa-f]{4})/g);else{_+="\\",I.hasNext()&&(_+=I.next());continue}if(!g)return F;if(M=parseInt(g[1],16),M>126&&M<=255&&g[0].indexOf("x")===0)return F;if(M>=0&&M<32){_+="\\"+g[0];continue}else M===34||M===39||M===92?_+="\\"+String.fromCharCode(M):_+=String.fromCharCode(M)}return _}b.prototype._read_string_recursive=function(F,_,M){var I,g;F==="'"?g=this.__patterns.single_quote:F==='"'?g=this.__patterns.double_quote:F==="`"?g=this.__patterns.template_text:F==="}"&&(g=this.__patterns.template_expression);for(var H=g.read(),$="";this._input.hasNext();){if($=this._input.next(),$===F||!_&&f.newline.test($)){this._input.back();break}else $==="\\"&&this._input.hasNext()?(I=this._input.peek(),I==="x"||I==="u"?this.has_char_escapes=!0:I==="\r"&&this._input.peek(1)===`
`&&this._input.next(),$+=this._input.next()):M&&(M==="${"&&$==="$"&&this._input.peek()==="{"&&($+=this._input.next()),M===$&&(F==="`"?$+=this._read_string_recursive("}",_,"`"):$+=this._read_string_recursive("`",_,"${"),this._input.hasNext()&&($+=this._input.next())));$+=g.read(),H+=$}return H},r.exports.Tokenizer=b,r.exports.TOKEN=a,r.exports.positionable_operators=L.slice(),r.exports.line_starters=x.slice()},function(r){var R=RegExp.prototype.hasOwnProperty("sticky");function v(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position=0&&m=0&&p=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},r.exports.InputScanner=v},function(r,R,v){var m=v(8).InputScanner,p=v(3).Token,h=v(10).TokenStream,l=v(11).WhitespacePattern,f={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(u,s){this._input=new m(u),this._options=s||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new h,this._reset();for(var u,s=new p(f.START,""),a=null,O=[],E=new h;s.type!==f.EOF;){for(u=this._get_next_token(s,a);this._is_comment(u);)E.add(u),u=this._get_next_token(s,a);E.isEmpty()||(u.comments_before=E,E=new h),u.parent=a,this._is_opening(u)?(O.push(a),a=u):a&&this._is_closing(u,a)&&(u.opened=a,a.closed=u,a=O.pop(),u.parent=a),u.previous=s,s.next=u,this.__tokens.add(u),s=u}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(u,s){this._readWhitespace();var a=this._input.read(/.+/g);return a?this._create_token(f.RAW,a):this._create_token(f.EOF,"")},o.prototype._is_comment=function(u){return!1},o.prototype._is_opening=function(u){return!1},o.prototype._is_closing=function(u,s){return!1},o.prototype._create_token=function(u,s){var a=new p(u,s,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return a},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},r.exports.Tokenizer=o,r.exports.TOKEN=f},function(r){function R(v){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=v}R.prototype.restart=function(){this.__position=0},R.prototype.isEmpty=function(){return this.__tokens_length===0},R.prototype.hasNext=function(){return this.__position=0&&v/),erb:o.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:o.starting_with(/{%/).until_after(/%}/),django_value:o.starting_with(/{{/).until_after(/}}/),django_comment:o.starting_with(/{#/).until_after(/#}/),smarty:o.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:o.starting_with(/{\*/).until_after(/\*}/),smarty_literal:o.starting_with(/{literal}/).until_after(/{\/literal}/)}}h.prototype=new m,h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){this.__set_templated_pattern()},h.prototype.disable=function(l){var f=this._create();return f._disabled[l]=!0,f._update(),f},h.prototype.read_options=function(l){var f=this._create();for(var o in p)f._disabled[o]=l.templating.indexOf(o)===-1;return f._update(),f},h.prototype.exclude=function(l){var f=this._create();return f._excluded[l]=!0,f._update(),f},h.prototype.read=function(){var l="";this._match_pattern?l=this._input.read(this._starting_pattern):l=this._input.read(this._starting_pattern,this.__template_pattern);for(var f=this._read_template();f;)this._match_pattern?f+=this._input.read(this._match_pattern):f+=this._input.readUntil(this.__template_pattern),l+=f,f=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},h.prototype.__set_templated_pattern=function(){var l=[];this._disabled.php||l.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||l.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||l.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(l.push(this.__patterns.django._starting_pattern.source),l.push(this.__patterns.django_value._starting_pattern.source),l.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||l.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&l.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+l.join("|")+")")},h.prototype._read_template=function(){var l="",f=this._input.peek();if(f==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(l=l||this.__patterns.erb.read())}else f==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(l=l||this.__patterns.handlebars_comment.read(),l=l||this.__patterns.handlebars_unescaped.read(),l=l||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(l=l||this.__patterns.django_value.read()),this._excluded.django||(l=l||this.__patterns.django_comment.read(),l=l||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(l=l||this.__patterns.smarty_comment.read(),l=l||this.__patterns.smarty_literal.read(),l=l||this.__patterns.smarty.read()));return l},r.exports.TemplatablePattern=h}],U={};function K(r){var R=U[r];if(R!==void 0)return R.exports;var v=U[r]={exports:{}};return j[r](v,v.exports,K),v.exports}var G=K(0);P=G})();var X=P;!(ie=[],J=function(){return{js_beautify:X}}.apply(_e,ie),J!==void 0&&(rt.exports=J))})()},"7/Dv":function(rt,_e,Z){rt.exports={bg:"bg___2rJyo",flexRow:"flexRow___2xuIa",flexJustifyCenter:"flexJustifyCenter___Z3bJt",flexAlignEnd:"flexAlignEnd___v7Ww-",flexAlignCenter:"flexAlignCenter___223DA",flexColumn:"flexColumn___3CNqR",formWrap:"formWrap___2b6uL",titleWrap:"titleWrap___1CMQA",fieldWrap:"fieldWrap___2BRrD",mdWrap:"mdWrap___3UYzt",backgroundFa:"backgroundFa___32wpj",button:"button___MHDAn"}},"746U":function(rt,_e,Z){"use strict";Z.d(_e,"f",function(){return ie}),Z.d(_e,"l",function(){return J}),Z.d(_e,"k",function(){return P}),Z.d(_e,"j",function(){return X}),Z.d(_e,"g",function(){return j}),Z.d(_e,"m",function(){return U}),Z.d(_e,"h",function(){return K}),Z.d(_e,"n",function(){return G}),Z.d(_e,"c",function(){return r}),Z.d(_e,"a",function(){return R}),Z.d(_e,"i",function(){return v}),Z.d(_e,"o",function(){return m}),Z.d(_e,"e",function(){return l}),Z.d(_e,"d",function(){return f}),Z.d(_e,"p",function(){return o}),Z.d(_e,"b",function(){return u});function ie(s){return Array.isArray(s)}function J(s){return typeof s=="string"}function P(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&!(s instanceof RegExp)&&!(s instanceof Date)}function X(s){return typeof s=="number"&&!isNaN(s)}function j(s){return s===!0||s===!1}function U(s){return typeof s=="undefined"}function K(s){return!G(s)}function G(s){return U(s)||s===null}function r(s,a){if(!s)throw new Error(a?`Unexpected type, expected '${a}'`:"Unexpected type")}function R(s){if(G(s))throw new Error("Assertion Failed: argument is undefined or null");return s}function v(s){return typeof s=="function"}function m(s,a){const O=Math.min(s.length,a.length);for(let E=0;Efunction(){const D=Array.prototype.slice.call(arguments,0);return a(w,D)};let E={};for(const w of s)E[w]=O(w);return E}function o(s){return s===null?void 0:s}function u(s,a="Unreachable"){throw new Error(a)}},"7Cbv":function(rt,_e,Z){"use strict";var ie=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),J=new Uint8Array(16);function P(){if(!ie)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ie(J)}var X=/^(?:[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 j(p){return typeof p=="string"&&X.test(p)}for(var U=j,K=[],G=0;G<256;++G)K.push((G+256).toString(16).substr(1));function r(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,l=(K[p[h+0]]+K[p[h+1]]+K[p[h+2]]+K[p[h+3]]+"-"+K[p[h+4]]+K[p[h+5]]+"-"+K[p[h+6]]+K[p[h+7]]+"-"+K[p[h+8]]+K[p[h+9]]+"-"+K[p[h+10]]+K[p[h+11]]+K[p[h+12]]+K[p[h+13]]+K[p[h+14]]+K[p[h+15]]).toLowerCase();if(!U(l))throw TypeError("Stringified UUID is invalid");return l}var R=r;function v(p,h,l){p=p||{};var f=p.random||(p.rng||P)();if(f[6]=f[6]&15|64,f[8]=f[8]&63|128,h){l=l||0;for(var o=0;o<16;++o)h[l+o]=f[o];return h}return R(f)}var m=_e.a=v},"7ahc":function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return O});var ie=Z("k1fw"),J=Z("0Owb"),P=Z("+L6B"),X=Z("2/Rp"),j=Z("y8nQ"),U=Z("Vl3Y"),K=Z("tJVT"),G=Z("OaEy"),r=Z("2fM7"),R=Z("q1tI"),v=Z.n(R),m=Z("VrN/"),p=Z.n(m),h=Z("p77/"),l=Z.n(h),f=Z("c5Ni"),o=Z.n(f),u=r.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},a={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"]};_e.b=function(E){var w=E.callback,D=E.onCancel,L=Object(R.useState)("python"),A=Object(K.a)(L,2),C=A[0],x=A[1];function c(y){x(a[y][1])}function S(y){w(y)}return v.a.createElement(U.a,Object(J.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:S}),v.a.createElement(U.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},v.a.createElement(r.a,{onChange:c},Object.keys(a).map(function(y){return v.a.createElement(u,{key:y,value:y},a[y][0])}))),v.a.createElement(U.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},v.a.createElement(O,{mode:C})),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(X.a,{type:"ghost",onClick:D},"\u53D6\u6D88")))};function O(E){var w=E.value,D=E.onChange,L=E.mode,A=E.options,C=A===void 0?{}:A,x=Object(R.useRef)(),c=Object(R.useState)(),S=Object(K.a)(c,2),y=S[0],b=S[1];return Object(R.useEffect)(function(){if(y){function B(F){var _=F.getValue();D&&D(_)}return y.on("change",B),function(){y.off("change",B)}}},[y,D]),Object(R.useEffect)(function(){y&&y.setOption("mode",L)},[y,L]),Object(R.useEffect)(function(){y&&((w!==y.getValue()||w==="")&&setTimeout(function(){y.setValue(w||" ")},300))},[y,w]),Object(R.useEffect)(function(){if(x.current&&!y){var B=p.a.fromTextArea(x.current,Object(ie.a)({mode:L,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},C));b(B)}},[x.current,y]),v.a.createElement("div",{className:"my-codemirror-container"},v.a.createElement("textarea",{ref:x}))}},"8EBN":function(rt,_e,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";ie.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var J=0;J-1&&X.substring(K+1,X.length);if(G)return ie.findModeByExtension(G)},ie.findModeByName=function(X){X=X.toLowerCase();for(var j=0;j=W.length?ee.slice(W.length):ee}).join(`
`)}var o=[],u=[""],s=new h.a.Renderer,a=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function O(){o.length=0,u=[""]}var E={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function w(Y,T,k,W){if(T>=Y.length||Y[T].level<=k)return T;var ee=Y[T];W.push("- "+ee.text+""),T++;var V=[];return T=w(Y,T,ee.level,V),V.length>0&&(W.push("
"),V.forEach(function(Ee){W.push(Ee)}),W.push("
")),W.push(" "),T=w(Y,T,k,W),T}function D(){return w(o,0,0,u),u.push("
"),u.join("")}var L={heading:function(T){var k=a.exec(T);if(k)return{type:"heading",raw:k[0],depth:k[1].length,text:k[2]}},fences:function(T){var k=this.rules.block.fences.exec(T);if(k){var W=k[0],ee=f(W,k[3]||""),V=k[2]?k[2].trim():k[2];if(["latex","katex","math"].indexOf(V)>=0){var Ee=x(),Ke=ee;ee=Ee,c[Ee]={type:"block",expression:Ke}}return{type:"code",raw:W,lang:V,text:ee}}}},A=/(?:\${2})([^\n`]+?)(?:\${2})/gi,C=0,x=function(){return"__special_katext_id_".concat(C++,"__")},c={};function S(){return c}function y(){C=0,c={}}function b(Y){return Y=Y.replace(A,function(T,k){var W=x();return c[W]={type:"inline",expression:k},W}),Y}var B=s.listitem;s.listitem=function(Y){return B(b(Y))};var F=s.paragraph;s.paragraph=function(Y){return F(b(Y))};var _=s.tablecell;s.tablecell=function(Y,T){return _(b(Y),T)},s.code=function(Y,T,k){var W=(T||"").match(/\S*/)[0];return W?["latex","katex","math"].indexOf(W)>=0?"".concat(Y,"
"):'
').concat(k?Y:Object(l.escape)(Y,!0),`
`):''+(k?Y:Object(l.escape)(Y,!0))+"
"},s.heading=function(Y,T,k){var W=this.options.headerPrefix+k.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return o.push({anchor:W,level:T,text:Y}),"'+Y+""},h.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),h.a.use({tokenizer:L,renderer:s});var M=h.a,I=Z("SJMd"),g=Z("ulZh"),H=Z.n(g),$=Z("m3rI"),ne=Z("Oy/b"),oe=Z("p5ED"),Oe=Z("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 ye=function(Y,T){return(ye=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,W){k.__proto__=W}||function(k,W){for(var ee in W)Object.prototype.hasOwnProperty.call(W,ee)&&(k[ee]=W[ee])})(Y,T)};function Te(Y,T){function k(){this.constructor=Y}ye(Y,T),Y.prototype=T===null?Object.create(T):(k.prototype=T.prototype,new k)}function Re(Y,T,k,W){return new(k||(k=Promise))(function(ee,V){function Ee(pt){try{et(W.next(pt))}catch(Ye){V(Ye)}}function Ke(pt){try{et(W.throw(pt))}catch(Ye){V(Ye)}}function et(pt){var Ye;pt.done?ee(pt.value):(Ye=pt.value,Ye instanceof k?Ye:new k(function(_t){_t(Ye)})).then(Ee,Ke)}et((W=W.apply(Y,T||[])).next())})}function Le(Y,T){var k,W,ee,V,Ee={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return V={next:Ke(0),throw:Ke(1),return:Ke(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function Ke(et){return function(pt){return function(Ye){if(k)throw new TypeError("Generator is already executing.");for(;Ee;)try{if(k=1,W&&(ee=2&Ye[0]?W.return:Ye[0]?W.throw||((ee=W.return)&&ee.call(W),0):W.next)&&!(ee=ee.call(W,Ye[1])).done)return ee;switch(W=0,ee&&(Ye=[2&Ye[0],ee.value]),Ye[0]){case 0:case 1:ee=Ye;break;case 4:return Ee.label++,{value:Ye[1],done:!1};case 5:Ee.label++,W=Ye[1],Ye=[0];continue;case 7:Ye=Ee.ops.pop(),Ee.trys.pop();continue;default:if(!(ee=Ee.trys,(ee=ee.length>0&&ee[ee.length-1])||Ye[0]!==6&&Ye[0]!==2)){Ee=0;continue}if(Ye[0]===3&&(!ee||Ye[1]>ee[0]&&Ye[1]',"select"),this.addActionButton(W,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(W,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(W,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(W,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(W,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(W,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(W,'',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(V){var Ee=document.createElement("div");Ee.className=""+k.toolbarButtonStyleClass.name,Ee.setAttribute("data-type-name",V.typeName),Ee.innerHTML=V.icon,Ee.addEventListener("click",function(){k.markerToolbarButtonClicked(Ee,V)}),k.buttons.push(Ee),k.markerButtons.push(Ee)}),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 ee=document.createElement("div");ee.className=this.toolbarBlockStyleClass.name,ee.style.whiteSpace="nowrap",ee.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ee),this.addActionButton(ee,'',"render"),this.addActionButton(ee,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},Y.prototype.addButtonClickListener=function(T){this.buttonClickListeners.push(T)},Y.prototype.removeButtonClickListener=function(T){this.buttonClickListeners.indexOf(T)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(T),1)},Y.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Y.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var T=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var k=0;k0&&this.buttonClickListeners.forEach(function(W){return W("marker",k)}),this.markerButtonOverflowBlock.style.display="none"},Y.prototype.actionToolbarButtonClicked=function(T,k){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(W){return W("action",k)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Y.prototype.setActiveButton=function(T){this.resetButtonStyles(),T.className=T.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),T.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Y.prototype.setActiveMarkerButton=function(T){var k=this.markerButtons.find(function(W){return W.getAttribute("data-type-name")===T});k&&this.setActiveButton(k)},Y.prototype.setCurrentMarker=function(T){var k=this;this.currentMarker=T,this.buttons.filter(function(W){return/delete|notes/.test(W.getAttribute("data-action"))}).forEach(function(W){k.currentMarker===void 0?(W.style.fillOpacity="0.4",W.style.pointerEvents="none"):(W.style.fillOpacity="1",W.style.pointerEvents="all")})},Y}(),je=function(){function Y(T,k,W,ee){this.panels=[],this.panelButtons=[],this.markerjsContainer=T,this.displayMode=k,this.uiStyleSettings=W,this.styles=ee,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Y.prototype.addStyles=function(){var T;this.toolboxStyleClass=this.styles.addClass(new Se("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 Se("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var k=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Se("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Se("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Se("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 Se("toolbox-panel-row_colors",`
background-color: `+((T=this.uiStyleSettings.toolboxBackgroundColor)!==null&&T!==void 0?T:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Se("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
padding: `+k+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Se("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Se("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ne("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ne("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},Y.prototype.show=function(T){var k;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=T,this.uiContainer.className=this.toolboxStyleClass.name+" "+((k=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Y.prototype.setPanelButtons=function(T){var k,W,ee=this;this.panels=T,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((k=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((W=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&W!==void 0?W:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(V){var Ee;V.uiStyleSettings=ee.uiStyleSettings;var Ke=document.createElement("div");Ke.className=ee.toolboxButtonStyleClass.name+" "+((Ee=ee.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ee!==void 0?Ee:ee.toolboxButtonStyleColorsClass.name),Ke.innerHTML=V.icon,Ke.title=V.title,Ke.addEventListener("click",function(){ee.panelButtonClick(V)}),ee.panelButtons.push(Ke),ee.buttonRow.appendChild(Ke)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Y.prototype.panelButtonClick=function(T){var k=this,W=-1;if(T!==this.activePanel){W=this.panels.indexOf(T),this.panelRow.innerHTML="";var ee=T.getUi();ee.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ee),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=T}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){k.displayMode==="inline"?k.panelRow.style.display="none":k.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(V,Ee){var Ke,et;V.className=k.toolboxButtonStyleClass.name+" "+(Ee===W?""+((Ke=k.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ke!==void 0?Ke:k.toolboxActiveButtonStyleColorsClass.name):""+((et=k.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&et!==void 0?et:k.toolboxButtonStyleColorsClass.name))})},Y}(),le=function(Y,T){this.title=Y,this.icon=T},ve=function(Y){function T(k,W,ee,V){var Ee=Y.call(this,k,V||'')||this;return Ee.colors=[],Ee.addTransparent=!1,Ee.colorBoxes=[],Ee.colors=W,Ee.currentColor=ee,Ee.setCurrentColor=Ee.setCurrentColor.bind(Ee),Ee.getColorBox=Ee.getColorBox.bind(Ee),Ee}return Te(T,Y),T.prototype.getUi=function(){var k=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.whiteSpace="nowrap",this.colors.forEach(function(ee){var V=k.getColorBox(ee);W.appendChild(V),k.colorBoxes.push(V)}),W},T.prototype.getColorBox=function(k){var W=this,ee=this.uiStyleSettings.toolbarHeight/4,V=this.uiStyleSettings.toolbarHeight-ee,Ee=document.createElement("div");Ee.style.display="inline-block",Ee.style.boxSizing="content-box",Ee.style.width=V-2+"px",Ee.style.height=V-2+"px",Ee.style.padding="1px",Ee.style.marginRight="2px",Ee.style.marginBottom="2px",Ee.style.borderWidth="2px",Ee.style.borderStyle="solid",Ee.style.borderRadius=(V+2)/2+"px",Ee.style.borderColor=k===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ee.addEventListener("click",function(){W.setCurrentColor(k,Ee)});var Ke=document.createElement("div");return Ke.style.display="inline-block",Ke.style.width=V-2+"px",Ke.style.height=V-2+"px",Ke.style.backgroundColor=k,Ke.style.borderRadius=V/2+"px",k==="transparent"&&(Ke.style.fill=this.uiStyleSettings.toolboxAccentColor,Ke.innerHTML=``),Ee.appendChild(Ke),Ee},T.prototype.setCurrentColor=function(k,W){var ee=this;this.currentColor=k,this.colorBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(k)},T}(le),we=function(){function Y(T,k,W){this._state="new",this._isSelected=!1,this._container=T,this._overlayContainer=k,this.globalSettings=W,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Y.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Y.prototype.ownsTarget=function(T){return!1},Object.defineProperty(Y.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Y.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Y.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Y.prototype.pointerDown=function(T,k){},Y.prototype.dblClick=function(T,k){},Y.prototype.manipulate=function(T){},Y.prototype.pointerUp=function(T){this.stateChanged()},Y.prototype.dispose=function(){},Y.prototype.addMarkerVisualToContainer=function(T){this.container.childNodes.length>0?this.container.insertBefore(T,this.container.childNodes[0]):this.container.appendChild(T)},Y.prototype.getState=function(){return{typeName:Y.typeName,state:this.state,notes:this.notes}},Y.prototype.restoreState=function(T){this._state=T.state,this.notes=T.notes},Y.prototype.scale=function(T,k){},Y.prototype.colorChanged=function(T){this.onColorChanged&&this.onColorChanged(T),this.stateChanged()},Y.prototype.fillColorChanged=function(T){this.onFillColorChanged&&this.onFillColorChanged(T),this.stateChanged()},Y.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var T=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),T.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(T)&&this.onStateChanged(this)}},Y.typeName="MarkerBase",Y}(),Ie=function(){function Y(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Y.prototype.findGripByVisual=function(T){return this.topLeft.ownsTarget(T)?this.topLeft:this.topCenter.ownsTarget(T)?this.topCenter:this.topRight.ownsTarget(T)?this.topRight:this.centerLeft.ownsTarget(T)?this.centerLeft:this.centerRight.ownsTarget(T)?this.centerRight:this.bottomLeft.ownsTarget(T)?this.bottomLeft:this.bottomCenter.ownsTarget(T)?this.bottomCenter:this.bottomRight.ownsTarget(T)?this.bottomRight:void 0},Y}(),We=function(){function Y(){this.GRIP_SIZE=10,this.visual=he.createGroup(),this.visual.appendChild(he.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(he.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Y.prototype.ownsTarget=function(T){return T===this.visual||T===this.visual.childNodes[0]||T===this.visual.childNodes[1]},Y}(),Ve=function(){function Y(){}return Y.toITransformMatrix=function(T){return{a:T.a,b:T.b,c:T.c,d:T.d,e:T.e,f:T.f}},Y.toSVGMatrix=function(T,k){return T.a=k.a,T.b=k.b,T.c=k.c,T.d=k.d,T.e=k.e,T.f=k.f,T},Y}(),Ze=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.left=0,V.top=0,V.width=0,V.height=0,V.defaultSize={x:50,y:20},V.offsetX=0,V.offsetY=0,V.rotationAngle=0,V.CB_DISTANCE=10,V._suppressMarkerCreateEvent=!1,V.container.transform.baseVal.appendItem(he.createTransform()),V.setupControlBox(),V}return Te(T,Y),Object.defineProperty(T.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"visual",{get:function(){return this._visual},set:function(k){this._visual=k;var W=he.createTransform();this._visual.transform.baseVal.appendItem(W)},enumerable:!1,configurable:!0}),T.prototype.ownsTarget=function(k){return!!Y.prototype.ownsTarget.call(this,k)||!!(this.controlGrips.findGripByVisual(k)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(k))},T.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.state==="new"&&(this.left=k.x,this.top=k.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ee=this.unrotatePoint(k);if(this.manipulationStartX=ee.x,this.manipulationStartY=ee.y,this.offsetX=ee.x-this.left,this.offsetY=ee.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(W),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(W)){this.activeGrip=this.rotatorGrip;var V=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=V.x-this.width/2,this.top=V.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ee=this.container.transform.baseVal.getItem(0);Ee.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ee,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},T.prototype.pointerUp=function(k){var W=this.state;Y.prototype.pointerUp.call(this,k),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(k),this._state="select",W==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},T.prototype.moveVisual=function(k){this.visual.style.transform="translate("+k.x+"px, "+k.y+"px)"},T.prototype.manipulate=function(k){var W=this.unrotatePoint(k);this.state==="creating"?this.resize(k):this.state==="move"?(this.left=this.manipulationStartLeft+(W.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(W.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(W):this.state==="rotate"&&this.rotate(k)},T.prototype.resize=function(k){var W=this.manipulationStartLeft,ee=this.manipulationStartWidth,V=this.manipulationStartTop,Ee=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:W=this.manipulationStartLeft+k.x-this.manipulationStartX,ee=this.manipulationStartWidth+this.manipulationStartLeft-W;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ee=this.manipulationStartWidth+k.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:V=this.manipulationStartTop+k.y-this.manipulationStartY,Ee=this.manipulationStartHeight+this.manipulationStartTop-V;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ee=this.manipulationStartHeight+k.y-this.manipulationStartY}ee>=0?(this.left=W,this.width=ee):(this.left=W+ee,this.width=-ee),Ee>=0?(this.top=V,this.height=Ee):(this.top=V+Ee,this.height=-Ee),this.setSize()},T.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},T.prototype.rotate=function(k){if(Math.abs(k.x-this.centerX)>.1){var W=Math.sign(k.x-this.centerX);this.rotationAngle=180*Math.atan((k.y-this.centerY)/(k.x-this.centerX))/Math.PI+90*W,this.applyRotation()}},T.prototype.applyRotation=function(){var k=this.container.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(k,0)},T.prototype.rotatePoint=function(k){if(this.rotationAngle===0)return k;var W=this.container.getCTM(),ee=he.createPoint(k.x,k.y);return{x:(ee=ee.matrixTransform(W)).x,y:ee.y}},T.prototype.unrotatePoint=function(k){if(this.rotationAngle===0)return k;var W=this.container.getCTM();W=W.inverse();var ee=he.createPoint(k.x,k.y);return{x:(ee=ee.matrixTransform(W)).x,y:ee.y}},T.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},T.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},T.prototype.setupControlBox=function(){this.controlBox=he.createGroup();var k=he.createTransform();k.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(k),this.container.appendChild(this.controlBox),this.controlRect=he.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=he.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Ie,this.addControlGrips(),this.controlBox.style.display="none"},T.prototype.adjustControlBox=function(){var k=this.controlBox.transform.baseVal.getItem(0);k.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(k,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()},T.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()},T.prototype.createGrip=function(){var k=new We;return k.visual.transform.baseVal.appendItem(he.createTransform()),this.controlBox.appendChild(k.visual),k},T.prototype.positionGrips=function(){var k=this.controlGrips.topLeft.GRIP_SIZE,W=-k/2,ee=W,V=(this.width+this.CB_DISTANCE)/2-k/2,Ee=(this.height+this.CB_DISTANCE)/2-k/2,Ke=this.height+this.CB_DISTANCE-k/2,et=this.width+this.CB_DISTANCE-k/2;this.positionGrip(this.controlGrips.topLeft.visual,W,ee),this.positionGrip(this.controlGrips.topCenter.visual,V,ee),this.positionGrip(this.controlGrips.topRight.visual,et,ee),this.positionGrip(this.controlGrips.centerLeft.visual,W,Ee),this.positionGrip(this.controlGrips.centerRight.visual,et,Ee),this.positionGrip(this.controlGrips.bottomLeft.visual,W,Ke),this.positionGrip(this.controlGrips.bottomCenter.visual,V,Ke),this.positionGrip(this.controlGrips.bottomRight.visual,et,Ke),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,V,ee-3*this.CB_DISTANCE)},T.prototype.positionGrip=function(k,W,ee){var V=k.transform.baseVal.getItem(0);V.setTranslate(W,ee),k.transform.baseVal.replaceItem(V,0)},T.prototype.hideControlBox=function(){this.controlBox.style.display="none"},T.prototype.showControlBox=function(){this.controlBox.style.display=""},T.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Ve.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Ve.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Y.prototype.getState.call(this))},T.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var W=k;this.left=W.left,this.top=W.top,this.width=W.width,this.height=W.height,this.rotationAngle=W.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Ve.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,W.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Ve.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,W.containerTransformMatrix))},T.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W);var ee=this.rotatePoint({x:this.left,y:this.top}),V=this.unrotatePoint({x:ee.x*k,y:ee.y*W});this.left=V.x,this.top=V.y,this.width=this.width*k,this.height=this.height*W,this.adjustControlBox()},T}(we),$e=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.createVisual=V.createVisual.bind(V),V}return Te(T,Y),T.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual)},T.prototype.createVisual=function(){this.visual=he.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},T.prototype.manipulate=function(k){Y.prototype.manipulate.call(this,k)},T.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.setSize()},T.prototype.setSize=function(){Y.prototype.setSize.call(this),he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},T.prototype.pointerUp=function(k){Y.prototype.pointerUp.call(this,k),this.setSize()},T.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&he.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},T.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&he.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},T.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&he.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},T.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&he.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},T.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Y.prototype.getState.call(this))},T.prototype.restoreState=function(k){var W=k;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),Y.prototype.restoreState.call(this,k),this.setSize()},T.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W),this.setSize()},T.title="Rectangle marker",T}(Ze),st=function(Y){function T(k,W,ee,V){var Ee=Y.call(this,k,V||'')||this;return Ee.widths=[],Ee.widthBoxes=[],Ee.widths=W,Ee.currentWidth=ee,Ee.setCurrentWidth=Ee.setCurrentWidth.bind(Ee),Ee}return Te(T,Y),T.prototype.getUi=function(){var k=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.widths.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.flexGrow="2",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=ee===k.currentWidth?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentWidth(ee,V)}),W.appendChild(V);var Ee=document.createElement("div");Ee.innerText=ee.toString(),Ee.style.marginRight="5px",V.appendChild(Ee);var Ke=document.createElement("div");Ke.style.minHeight="20px",Ke.style.flexGrow="2",Ke.style.display="flex",Ke.style.alignItems="center";var et=document.createElement("hr");et.style.minWidth="20px",et.style.border="0px",et.style.borderTop=ee+"px solid "+k.uiStyleSettings.toolboxColor,et.style.flexGrow="2",Ke.appendChild(et),V.appendChild(Ke),k.widthBoxes.push(V)}),W},T.prototype.setCurrentWidth=function(k,W){var ee=this;this.currentWidth=k,this.widthBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},T}(le),Qe=function(Y){function T(k,W,ee,V){var Ee=Y.call(this,k,V||'')||this;return Ee.styles=[],Ee.styleBoxes=[],Ee.styles=W,Ee.currentStyle=ee,Ee.setCurrentStyle=Ee.setCurrentStyle.bind(Ee),Ee}return Te(T,Y),T.prototype.getUi=function(){var k=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.styles.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/k.styles.length-5+"%",V.style.borderColor=ee===k.currentStyle?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentStyle(ee,V)}),W.appendChild(V);var Ee=document.createElement("div");Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.overflow="hidden";var Ke=``;Ee.innerHTML=Ke,V.appendChild(Ee),k.styleBoxes.push(V)}),W},T.prototype.setCurrentStyle=function(k,W){var ee=this;this.currentStyle=k,this.styleBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},T}(le),nt=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new ve("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new st("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Qe("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Te(T,Y),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=T.typeName,k},T.typeName="FrameMarker",T.title="Frame marker",T.icon='',T}($e),Fe=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},ot=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.x1=0,V.y1=0,V.x2=0,V.y2=0,V.defaultLength=50,V.manipulationStartX=0,V.manipulationStartY=0,V.manipulationStartX1=0,V.manipulationStartY1=0,V.manipulationStartX2=0,V.manipulationStartY2=0,V.setupControlBox(),V}return Te(T,Y),T.prototype.ownsTarget=function(k){return!!Y.prototype.ownsTarget.call(this,k)||!(!this.grip1.ownsTarget(k)&&!this.grip2.ownsTarget(k))},T.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.manipulationStartX=k.x,this.manipulationStartY=k.y,this.state==="new"&&(this.x1=k.x,this.y1=k.y,this.x2=k.x,this.y2=k.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(W)?this.activeGrip=this.grip1:this.grip2.ownsTarget(W)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},T.prototype.pointerUp=function(k){var W=this.state;Y.prototype.pointerUp.call(this,k),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(k),this._state="select",W==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},T.prototype.adjustVisual=function(){},T.prototype.manipulate=function(k){this.state==="creating"?this.resize(k):this.state==="move"?(this.x1=this.manipulationStartX1+k.x-this.manipulationStartX,this.y1=this.manipulationStartY1+k.y-this.manipulationStartY,this.x2=this.manipulationStartX2+k.x-this.manipulationStartX,this.y2=this.manipulationStartY2+k.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(k)},T.prototype.resize=function(k){switch(this.activeGrip){case this.grip1:this.x1=k.x,this.y1=k.y;break;case this.grip2:case void 0:this.x2=k.x,this.y2=k.y}this.adjustVisual(),this.adjustControlBox()},T.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},T.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},T.prototype.setupControlBox=function(){this.controlBox=he.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},T.prototype.adjustControlBox=function(){this.positionGrips()},T.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},T.prototype.createGrip=function(){var k=new We;return k.visual.transform.baseVal.appendItem(he.createTransform()),this.controlBox.appendChild(k.visual),k},T.prototype.positionGrips=function(){var k=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-k/2,this.y1-k/2),this.positionGrip(this.grip2.visual,this.x2-k/2,this.y2-k/2)},T.prototype.positionGrip=function(k,W,ee){var V=k.transform.baseVal.getItem(0);V.setTranslate(W,ee),k.transform.baseVal.replaceItem(V,0)},T.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Y.prototype.getState.call(this))},T.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var W=k;this.x1=W.x1,this.y1=W.y1,this.x2=W.x2,this.y2=W.y2},T.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W),this.x1=this.x1*k,this.y1=this.y1*W,this.x2=this.x2*k,this.y2=this.y2*W,this.adjustVisual(),this.adjustControlBox()},T}(we),tt=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new ve("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new st("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Qe("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Te(T,Y),T.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorLine&&k!==this.visibleLine)},T.prototype.createVisual=function(){this.visual=he.createGroup(),this.selectorLine=he.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=he.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},T.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),he.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),he.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),he.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},T.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},T.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},T.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Y.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var W=k;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.createVisual(),this.adjustVisual()},T.typeName="LineMarker",T.title="Line marker",T.icon='',T}(ot),Be=function(Y){function T(k,W,ee,V){var Ee=Y.call(this,k,V||'')||this;return Ee.fonts=[],Ee.fontBoxes=[],Ee.fonts=W,Ee.currentFont=ee,Ee.setCurrentFont=Ee.setCurrentFont.bind(Ee),Ee}return Te(T,Y),T.prototype.getUi=function(){var k=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.flexGrow="2",this.fonts.forEach(function(ee){var V=document.createElement("div");V.style.display="inline-block",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/k.fonts.length-5+"%",V.style.borderColor=ee===k.currentFont?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentFont(ee,V)}),W.appendChild(V);var Ee=document.createElement("div");Ee.style.display="flex",Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.fontFamily=ee,Ee.style.overflow="hidden";var Ke=document.createElement("div");Ke.style.whiteSpace="nowrap",Ke.style.overflow="hidden",Ke.style.textOverflow="ellipsis",Ke.innerHTML="The quick brown fox jumps over the lazy dog",Ee.appendChild(Ke),V.appendChild(Ee),k.fontBoxes.push(V)}),W},T.prototype.setCurrentFont=function(k,W){var ee=this;this.currentFont=k,this.fontBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},T}(le),He=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.color="transparent",V.padding=5,V.DEFAULT_TEXT="your text here",V.text=V.DEFAULT_TEXT,V.isMoved=!1,V.color=ee.defaultColor,V.fontFamily=ee.defaultFontFamily,V.defaultSize={x:100,y:30},V.setColor=V.setColor.bind(V),V.setFont=V.setFont.bind(V),V.renderText=V.renderText.bind(V),V.sizeText=V.sizeText.bind(V),V.textEditDivClicked=V.textEditDivClicked.bind(V),V.showTextEditor=V.showTextEditor.bind(V),V.setSize=V.setSize.bind(V),V.positionTextEditor=V.positionTextEditor.bind(V),V.colorPanel=new ve("Color",ee.defaultColorSet,ee.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.fontFamilyPanel=new Be("Font",ee.defaultFontFamilies,ee.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V}return Te(T,Y),T.prototype.ownsTarget=function(k){if(Y.prototype.ownsTarget.call(this,k)||k===this.visual||k===this.textElement||k===this.bgRectangle)return!0;var W=!1;return this.textElement.childNodes.forEach(function(ee){ee===k&&(W=!0)}),W},T.prototype.createVisual=function(){this.visual=he.createGroup(),this.bgRectangle=he.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=he.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(he.createTransform()),this.textElement.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},T.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.isMoved=!1,this.pointerDownPoint=k,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},T.prototype.renderText=function(){var k=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(W){k.textElement.appendChild(he.createTSpan(W.trim()===""?" ":W.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},T.prototype.getTextScale=function(){var k=this.textElement.getBBox(),W=1;if(k.width>0&&k.height>0){var ee=(1*this.width-this.width*this.padding*2/100)/k.width,V=(1*this.height-this.height*this.padding*2/100)/k.height;W=Math.min(ee,V)}return W},T.prototype.getTextPosition=function(k){var W=this.textElement.getBBox(),ee=0,V=0;return W.width>0&&W.height>0&&(ee=(this.width-W.width*k)/2,V=this.height/2-W.height*k/2),{x:ee,y:V}},T.prototype.sizeText=function(){var k=this.textElement.getBBox(),W=this.getTextScale(),ee=this.getTextPosition(W);ee.y-=k.y*W,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ee.x+"px, "+ee.y+"px) scale("+W+", "+W+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ee.x,ee.y),this.textElement.transform.baseVal.getItem(1).setScale(W,W))},T.prototype.manipulate=function(k){Y.prototype.manipulate.call(this,k),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(k.x-this.pointerDownPoint.x)>5||Math.abs(k.y-this.pointerDownPoint.y)>5)},T.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.isMoved=!0,this.setSize(),this.sizeText()},T.prototype.setSize=function(){Y.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},T.prototype.pointerUp=function(k){var W=this.state;W==="creating"&&(this._suppressMarkerCreateEvent=!0),Y.prototype.pointerUp.call(this,k),this.setSize(),(W==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},T.prototype.showTextEditor=function(){var k=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(W){W.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var W=Number.parseFloat(k.textEditor.style.fontSize);k.textEditor.clientWidth>=Number.parseInt(k.textEditor.style.maxWidth)&&W>.9;)W-=.1,k.textEditor.style.fontSize=Math.max(W,.9)+"em"}),this.textEditor.addEventListener("keyup",function(W){W.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(W){if(W.clipboardData){var ee=W.clipboardData.getData("text"),V=window.getSelection();if(!V.rangeCount)return!1;V.deleteFromDocument(),V.getRangeAt(0).insertNode(document.createTextNode(ee)),W.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){k.textEditDivClicked(k.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},T.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var k=this.getTextScale(),W=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ee=this.textElement.getBBox(),V={x:ee.width*k,y:ee.height*k};W.x-=V.x/2,W.y-=V.y/2,this.textEditor.style.top=W.y+"px",this.textEditor.style.left=W.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-W.x+"px",this.textEditor.style.fontSize=Math.max(16*k,12)+"px",this.textElement.style.display="none"}},T.prototype.textEditDivClicked=function(k){this.text=k.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},T.prototype.select=function(){Y.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},T.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Y.prototype.deselect.call(this)},T.prototype.dblClick=function(k,W){Y.prototype.dblClick.call(this,k,W),this.showTextEditor()},T.prototype.setColor=function(k){this.textElement&&he.setAttributes(this.textElement,[["fill",k]]),this.color=k,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(k)},T.prototype.setFont=function(k){this.textElement&&he.setAttributes(this.textElement,[["font-family",k]]),this.fontFamily=k,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},T.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},T.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Y.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){var W=k;this.color=W.color,this.fontFamily=W.fontFamily,this.padding=W.padding,this.text=W.text,this.createVisual(),Y.prototype.restoreState.call(this,k),this.setSize()},T.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W),this.setSize(),this.sizeText(),this.positionTextEditor()},T.typeName="TextMarker",T.title="Text marker",T.icon='',T}(Ze),Ae=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.color="transparent",V.lineWidth=3,V.drawing=!1,V.pixelRatio=1,V.color=ee.defaultColor,V.lineWidth=ee.defaultStrokeWidth,V.pixelRatio=ee.freehandPixelRatio,V.setColor=V.setColor.bind(V),V.addCanvas=V.addCanvas.bind(V),V.finishCreation=V.finishCreation.bind(V),V.setLineWidth=V.setLineWidth.bind(V),V.colorPanel=new ve("Color",ee.defaultColorSet,ee.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.lineWidthPanel=new st("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.lineWidthPanel.onWidthChanged=V.setLineWidth,V}return Te(T,Y),T.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.drawingImage)},T.prototype.createVisual=function(){this.visual=he.createGroup(),this.drawingImage=he.createImage(),this.visual.appendChild(this.drawingImage);var k=he.createTransform();this.visual.transform.baseVal.appendItem(k),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(k,W){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(k.x,k.y),this.drawing=!0):Y.prototype.pointerDown.call(this,k,W)},T.prototype.manipulate=function(k){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(k.x,k.y),this.canvasContext.stroke()):Y.prototype.manipulate.call(this,k)},T.prototype.resize=function(k){Y.prototype.resize.call(this,k),he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},T.prototype.pointerUp=function(k){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Y.prototype.pointerUp.call(this,k)},T.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)},T.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.select.call(this)},T.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.deselect.call(this)},T.prototype.finishCreation=function(){for(var k=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),W=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ee=W[0],V=W[1],Ee=W[2],Ke=W[3],et=!1,pt=0;pt0&&(et=!0,ptKe&&(Ke=pt),Ye>Ee&&(Ee=Ye));if(et){this.left=ee/this.pixelRatio,this.top=V/this.pixelRatio,this.width=(Ee-ee)/this.pixelRatio,this.height=(Ke-V)/this.pixelRatio;var _t=document.createElement("canvas");_t.width=Ee-ee,_t.height=Ke-V,_t.getContext("2d").putImageData(this.canvasContext.getImageData(ee,V,Ee-ee,Ke-V),0,0),this.drawingImgUrl=_t.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},T.prototype.setDrawingImage=function(){he.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},T.prototype.setColor=function(k){this.color=k,this.colorChanged(k)},T.prototype.setLineWidth=function(k){this.lineWidth=k},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Object.assign({drawingImgUrl:this.drawingImgUrl},Y.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){this.createVisual(),Y.prototype.restoreState.call(this,k),this.drawingImgUrl=k.drawingImgUrl,this.setDrawingImage()},T.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W),this.setDrawingImage()},T.typeName="FreehandMarker",T.title="Freehand marker",T.icon='',T}(Ze),me=function(Y){function T(k,W,ee){var V=Y.call(this,k,ee||'')||this;return V.typeBoxes=[],V.currentType=W,V.setCurrentType=V.setCurrentType.bind(V),V}return Te(T,Y),T.prototype.getUi=function(){var k=this,W=document.createElement("div");W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2";for(var ee=function(Ke){var et="both";switch(Ke){case 0:et="both";break;case 1:et="start";break;case 2:et="end";break;case 3:et="none"}var pt=document.createElement("div");if(pt.style.display="flex",pt.style.flexGrow="2",pt.style.alignItems="center",pt.style.justifyContent="space-between",pt.style.padding="5px",pt.style.borderWidth="2px",pt.style.borderStyle="solid",pt.style.borderColor=et===V.currentType?V.uiStyleSettings.toolboxAccentColor:"transparent",pt.addEventListener("click",function(){k.setCurrentType(et,pt)}),W.appendChild(pt),et==="both"||et==="start"){var Ye=document.createElement("div");Ye.style.display="flex",Ye.style.alignItems="center",Ye.style.minHeight="20px",Ye.innerHTML=``,Ye.style.marginLeft="5px",pt.appendChild(Ye)}var _t=document.createElement("div");_t.style.display="flex",_t.style.alignItems="center",_t.style.minHeight="20px",_t.style.flexGrow="2";var jt=document.createElement("hr");if(jt.style.minWidth="20px",jt.style.border="0px",jt.style.borderTop="3px solid "+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee"),jt.style.flexGrow="2",_t.appendChild(jt),pt.appendChild(_t),et==="both"||et==="end"){var $t=document.createElement("div");$t.style.display="flex",$t.style.alignItems="center",$t.style.minHeight="20px",$t.innerHTML=``,$t.style.marginRight="5px",pt.appendChild($t)}V.typeBoxes.push(pt)},V=this,Ee=0;Ee<4;Ee++)ee(Ee);return W},T.prototype.setCurrentType=function(k,W){var ee=this;this.currentType=k,this.typeBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings!==void 0?ee.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},T}(le),xe=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.arrowType="end",V.arrowBaseHeight=10,V.arrowBaseWidth=10,V.getArrowPoints=V.getArrowPoints.bind(V),V.setArrowType=V.setArrowType.bind(V),V.arrowTypePanel=new me("Arrow type","end"),V.arrowTypePanel.onArrowTypeChanged=V.setArrowType,V}return Te(T,Y),T.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.arrow1&&k!==this.arrow2)},T.prototype.getArrowPoints=function(k,W){var ee=this.arrowBaseWidth+2*this.strokeWidth,V=this.arrowBaseHeight+2*this.strokeWidth;return k-ee/2+","+(W+V/2)+" "+k+","+(W-V/2)+" "+(k+ee/2)+","+(W+V/2)},T.prototype.createTips=function(){this.arrow1=he.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=he.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.arrow2)},T.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.state==="creating"&&this.createTips()},T.prototype.adjustVisual=function(){if(Y.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",he.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),he.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.arrow1.transform.baseVal.getItem(0);W.setRotate(k,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(W,0);var ee=this.arrow2.transform.baseVal.getItem(0);ee.setRotate(k+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ee,0)}},T.prototype.setArrowType=function(k){this.arrowType=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Object.assign({arrowType:this.arrowType},Y.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var W=k;this.arrowType=W.arrowType,this.createTips(),this.adjustVisual()},T.typeName="ArrowMarker",T.title="Arrow marker",T.icon='',T}(tt),ae=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.fillColor=ee.defaultFillColor,V.strokeWidth=0,V.fillPanel=new ve("Color",ee.defaultColorSet,ee.defaultFillColor),V.fillPanel.onColorChanged=V.setFillColor,V}return Te(T,Y),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=T.typeName,k},T.typeName="CoverMarker",T.title="Cover marker",T.icon='',T}($e),ue=function(Y){function T(k,W,ee,V){var Ee=Y.call(this,k,V||'')||this;return Ee.opacities=[],Ee.opacityBoxes=[],Ee.opacities=W,Ee.currentOpacity=ee,Ee.setCurrentOpacity=Ee.setCurrentOpacity.bind(Ee),Ee}return Te(T,Y),T.prototype.getUi=function(){var k=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",W.style.justifyContent="space-between",this.opacities.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="center",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=ee===k.currentOpacity?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentOpacity(ee,V)}),W.appendChild(V);var Ee=document.createElement("div");Ee.innerText=100*ee+"%",V.appendChild(Ee),k.opacityBoxes.push(V)}),W},T.prototype.setCurrentOpacity=function(k,W){var ee=this;this.currentOpacity=k,this.opacityBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},T}(le),ce=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.setOpacity=V.setOpacity.bind(V),V.fillColor=ee.defaultHighlightColor,V.strokeWidth=0,V.opacity=ee.defaultHighlightOpacity,V.fillPanel=new ve("Color",ee.defaultColorSet,V.fillColor),V.fillPanel.onColorChanged=V.setFillColor,V.opacityPanel=new ue("Opacity",ee.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return Te(T,Y),T.prototype.setOpacity=function(k){this.opacity=k,this.visual&&he.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=T.typeName,k},T.typeName="HighlightMarker",T.title="Highlight marker",T.icon='',T}(ae),ge='',Ce=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.bgColor="transparent",V.tipPosition={x:0,y:0},V.tipBase1Position={x:0,y:0},V.tipBase2Position={x:0,y:0},V.tipMoving=!1,V.color=ee.defaultStrokeColor,V.bgColor=ee.defaultFillColor,V.fontFamily=ee.defaultFontFamily,V.defaultSize={x:100,y:30},V.setBgColor=V.setBgColor.bind(V),V.getTipPoints=V.getTipPoints.bind(V),V.positionTip=V.positionTip.bind(V),V.setTipPoints=V.setTipPoints.bind(V),V.colorPanel=new ve("Text color",ee.defaultColorSet,V.color,''),V.colorPanel.onColorChanged=V.setColor,V.bgColorPanel=new ve("Fill color",ee.defaultColorSet,V.bgColor,ge),V.bgColorPanel.onColorChanged=V.setBgColor,V.fontFamilyPanel=new Be("Font",ee.defaultFontFamilies,ee.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V.tipGrip=new We,V.tipGrip.visual.transform.baseVal.appendItem(he.createTransform()),V.controlBox.appendChild(V.tipGrip.visual),V}return Te(T,Y),T.prototype.ownsTarget=function(k){return Y.prototype.ownsTarget.call(this,k)||this.tipGrip.ownsTarget(k)||this.tip===k},T.prototype.createTip=function(){he.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=he.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},T.prototype.pointerDown=function(k,W){this.state==="new"&&Y.prototype.pointerDown.call(this,k,W),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(W)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Y.prototype.pointerDown.call(this,k,W)},T.prototype.pointerUp=function(k){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Y.prototype.pointerUp.call(this,k);else{var W=this.state==="creating";Y.prototype.pointerUp.call(this,k),this.setTipPoints(W),this.positionTip()}},T.prototype.manipulate=function(k){if(this.tipMoving){var W=this.unrotatePoint(k);this.tipPosition={x:W.x-this.manipulationStartLeft,y:W.y-this.manipulationStartTop},this.positionTip()}else Y.prototype.manipulate.call(this,k)},T.prototype.setBgColor=function(k){this.bgRectangle&&this.tip&&(he.setAttributes(this.bgRectangle,[["fill",k]]),he.setAttributes(this.tip,[["fill",k]])),this.bgColor=k,this.fillColorChanged(k)},T.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},T.prototype.setTipPoints=function(k){k===void 0&&(k=!1);var W=Math.min(this.height/2,15),ee=this.height/5;k&&(this.tipPosition={x:W+ee/2,y:this.height+20});var V=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?V',T}(He),Ue=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.fillColor=ee.defaultFillColor,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.setOpacity=V.setOpacity.bind(V),V.createVisual=V.createVisual.bind(V),V.strokePanel=new ve("Line color",de(ee.defaultColorSet,["transparent"]),ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.fillPanel=new ve("Fill color",de(ee.defaultColorSet,["transparent"]),V.fillColor,ge),V.fillPanel.onColorChanged=V.setFillColor,V.strokeWidthPanel=new st("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Qe("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V.opacityPanel=new ue("Opacity",ee.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return Te(T,Y),T.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual)},T.prototype.createVisual=function(){this.visual=he.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},T.prototype.manipulate=function(k){Y.prototype.manipulate.call(this,k)},T.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.setSize()},T.prototype.setSize=function(){Y.prototype.setSize.call(this),he.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},T.prototype.pointerUp=function(k){Y.prototype.pointerUp.call(this,k),this.setSize()},T.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&he.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},T.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&he.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(k),this.stateChanged()},T.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&he.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},T.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&he.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},T.prototype.setOpacity=function(k){this.opacity=k,this.visual&&he.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Y.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){var W=k;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),Y.prototype.restoreState.call(this,k),this.setSize()},T.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W),this.setSize()},T.typeName="EllipseMarker",T.title="Ellipse marker",T.icon='',T}(Ze),ze=function(Y){function T(k,W,ee){return Y.call(this,k,W,ee)||this}return Te(T,Y),Object.defineProperty(T.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),T.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.tip1&&k!==this.tip2)},T.prototype.createTips=function(){this.tip1=he.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.tip1),this.tip2=he.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.tip2)},T.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.state==="creating"&&this.createTips()},T.prototype.adjustVisual=function(){if(Y.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(he.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),he.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.tip1.transform.baseVal.getItem(0);W.setRotate(k,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(W,0);var ee=this.tip2.transform.baseVal.getItem(0);ee.setRotate(k+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ee,0)}},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k),this.createTips(),this.adjustVisual()},T.typeName="MeasurementMarker",T.title="Measurement marker",T.icon='',T}(tt),lt=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.strokePanel.colors=ee.defaultColorSet,V.fillColor="transparent",V}return Te(T,Y),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=T.typeName,k},T.typeName="EllipseFrameMarker",T.title="Ellipse frame marker",T.icon='',T}(Ue),mt=function(){function Y(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Y.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Y.prototype.addUndoStep=function(T){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(T)||(this.undoStack.push(T),JSON.stringify(this.lastRedoStep)!==JSON.stringify(T)&&this.redoStack.splice(0,this.redoStack.length))},Y.prototype.replaceLastUndoStep=function(T){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=T)},Y.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Y.prototype.undo=function(){if(this.undoStack.length>1){var T=this.undoStack.pop();return T!==void 0&&this.redoStack.push(T),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Y.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Y}(),ft=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.curveX=0,V.curveY=0,V.manipulationStartCurveX=0,V.manipulationStartCurveY=0,V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.positionGrips=V.positionGrips.bind(V),V.addControlGrips=V.addControlGrips.bind(V),V.adjustVisual=V.adjustVisual.bind(V),V.setupControlBox=V.setupControlBox.bind(V),V.resize=V.resize.bind(V),V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new ve("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new st("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Qe("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Te(T,Y),T.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorCurve&&k!==this.visibleCurve&&!this.curveGrip.ownsTarget(k))},T.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},T.prototype.createVisual=function(){this.visual=he.createGroup(),this.selectorCurve=he.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=he.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=k.x,this.curveY=k.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(W)&&(this.activeGrip=this.curveGrip,this._state="resize")},T.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),he.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),he.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),he.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},T.prototype.setupControlBox=function(){Y.prototype.setupControlBox.call(this),this.curveControlLine1=he.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=he.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},T.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Y.prototype.addControlGrips.call(this)},T.prototype.positionGrips=function(){Y.prototype.positionGrips.call(this);var k=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-k/2,this.curveY-k/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()))},T.prototype.manipulate=function(k){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+k.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+k.y-this.manipulationStartY),Y.prototype.manipulate.call(this,k)},T.prototype.resize=function(k){this.activeGrip===this.curveGrip&&(this.curveX=k.x,this.curveY=k.y),Y.prototype.resize.call(this,k),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},T.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},T.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},T.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual()},T.prototype.scale=function(k,W){this.curveX=this.curveX*k,this.curveY=this.curveY*W,Y.prototype.scale.call(this,k,W)},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Y.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var W=k;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.curveX=W.curveX,this.curveY=W.curveY,this.createVisual(),this.adjustVisual()},T.typeName="CurveMarker",T.title="Curve marker",T.icon='',T}(ot),wt=function(){function Y(T,k){k===void 0&&(k=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=T,this.cancelable=k}return Object.defineProperty(Y.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Y.prototype.preventDefault=function(){this._defaultPrevented=!0},Y}(),St=function(Y){function T(k,W,ee){var V=Y.call(this,k,!1)||this;return V.dataUrl=W,V.state=ee,V}return Te(T,Y),T}(wt),dt=function(Y){function T(k,W,ee){ee===void 0&&(ee=!1);var V=Y.call(this,k,ee)||this;return V.marker=W,V}return Te(T,Y),T}(wt),Bt=function(){function Y(){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 Y.prototype.addEventListener=function(T,k){this[T].push(k)},Y.prototype.removeEventListener=function(T,k){var W=this[T].indexOf(k);W>-1&&this[T].splice(W,1)},Y}(),Lt=function(){function Y(T){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Fe,this._isOpen=!1,this.undoRedoManager=new mt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Bt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Y.instanceCounter++,this.styles=new De(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=T,this.targetRoot=document.body,this.width=T.clientWidth,this.height=T.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(Y.prototype,"ALL_MARKER_TYPES",{get:function(){return[nt,Ae,xe,He,lt,Ue,ce,Ce,ze,ae,tt,ft]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[nt,Ae,xe,He,Ue,ce,Ce]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"BASIC_MARKER_TYPES",{get:function(){return[nt,Ae,xe,He,ce]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(T){var k=this;this._availableMarkerTypes.splice(0),T.forEach(function(W){if(typeof W=="string"){var ee=k.ALL_MARKER_TYPES.find(function(V){return V.typeName===W});ee!==void 0&&k._availableMarkerTypes.push(ee)}else k._availableMarkerTypes.push(W)})},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(T){this._zoomLevel=T,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(Y.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Y.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),re.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Y.prototype.show=function(){var T=this;this.styles.styleSheetRoot===void 0&&se.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=se.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(k){return k(new wt(T))})},Y.prototype.render=function(){return Re(this,void 0,void 0,function(){var T;return Le(this,function(k){switch(k.label){case 0:return this.setCurrentMarker(),(T=new fe).naturalSize=this.renderAtNaturalSize,T.imageType=this.renderImageType,T.imageQuality=this.renderImageQuality,T.markersOnly=this.renderMarkersOnly,T.width=this.renderWidth,T.height=this.renderHeight,[4,T.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return k.sent(),[4,T.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,k.sent()]}})})},Y.prototype.close=function(T){var k=this;if(T===void 0&&(T=!1),this.isOpen){var W=!1;T||this.eventListeners.beforeclose.forEach(function(ee){var V=new wt(k,!0);ee(V),V.defaultPrevented&&(W=!0)}),W||(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(ee){return ee(new wt(k))}),this.detachEvents(),this._isOpen=!1)}},Y.prototype.addMarkersToToolbar=function(){for(var T,k=[],W=0;Wthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*T:this.editorCanvas.clientWidth,W=k',T.title="Powered by marker.js",T.style.display="grid",T.style.alignItems="center",T.style.justifyItems="center",T.style.padding="3px",T.style.width="20px",T.style.height="20px",this.logoUI.appendChild(T),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Y.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")},Y.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"},Y.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Y.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 T=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=T+"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 Pe(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(T),1),T.dispose()},Y.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())},Y.prototype.toolbarButtonClicked=function(T,k){if(T==="marker"&&k!==void 0)this.createNewMarker(k);else if(T==="action")switch(k){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()}},Y.prototype.deleteSelectedMarker=function(){var T=this;if(this._currentMarker!==void 0){var k=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ee){var V=new dt(T,T._currentMarker,!0);ee(V),V.defaultPrevented&&(k=!0)}),!k){var W=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(ee){return ee(new dt(T,W))})}}},Y.prototype.clear=function(){var T=this,k=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ee){var Ke=new dt(T,void 0,!0);Ee(Ke),Ke.defaultPrevented&&(k=!0)}),!k)){this.setCurrentMarker();for(var W=function(Ee){var Ke=ee.markers[Ee];ee.setCurrentMarker(ee.markers[Ee]),ee._currentMarker.dispose(),ee.markerImage.removeChild(ee._currentMarker.container),ee.markers.splice(ee.markers.indexOf(ee._currentMarker),1),ee.eventListeners.markerdelete.forEach(function(et){return et(new dt(T,Ke))})},ee=this,V=this.markers.length-1;V>=0;V--)W(V);this.addUndoStep()}},Object.defineProperty(Y.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Y.prototype.showNotesEditor=function(){var T;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=(T=this._currentMarker.notes)!==null&&T!==void 0?T:"",this.overlayContainer.appendChild(this.notesArea))},Y.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)},Y.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Y.prototype.addUndoStep=function(){var T=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var k=this.getState(),W=this.undoRedoManager.getLastUndoStep();if(!W||W.width===k.width&&W.height===k.height){var ee=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(k),ee1&&this.panTo({x:T.clientX,y:T.clientY}))},Y.prototype.onPointerUp=function(T){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(T.clientX,T.clientY)),this.isDragging=!1,this.addUndoStep()},Y.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Y.prototype.onKeyUp=function(T){this._currentMarker===void 0||this.notesArea!==void 0||T.key!=="Delete"&&T.key!=="Backspace"||this.deleteSelectedMarker()},Y.prototype.clientToLocalCoordinates=function(T,k){var W=this.markerImage.getBoundingClientRect();return{x:(T-W.left)/this.zoomLevel,y:(k-W.top)/this.zoomLevel}},Y.prototype.onWindowResize=function(){this.positionUI()},Y.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var T=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=T+"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()},Y.prototype.addLicenseKey=function(T){re.addKey(T)},Y.prototype.addEventListener=function(T,k){this.eventListeners.addEventListener(T,k)},Y.prototype.removeEventListener=function(T,k){this.eventListeners.removeEventListener(T,k)},Y.prototype.renderState=function(T){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(T),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Y.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Y.prototype.focus=function(){var T=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(k){return k(new wt(T))}))},Y.prototype.blur=function(){var T=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(k){return k(new wt(T))}))},Y.instanceCounter=0,Y}();/* **********************************
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(Y,T){return(qt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,W){k.__proto__=W}||function(k,W){for(var ee in W)Object.prototype.hasOwnProperty.call(W,ee)&&(k[ee]=W[ee])})(Y,T)};function Zt(Y,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");function k(){this.constructor=Y}qt(Y,T),Y.prototype=T===null?Object.create(T):(k.prototype=T.prototype,new k)}function It(Y,T,k,W){return new(k||(k=Promise))(function(ee,V){function Ee(pt){try{et(W.next(pt))}catch(Ye){V(Ye)}}function Ke(pt){try{et(W.throw(pt))}catch(Ye){V(Ye)}}function et(pt){var Ye;pt.done?ee(pt.value):(Ye=pt.value,Ye instanceof k?Ye:new k(function(_t){_t(Ye)})).then(Ee,Ke)}et((W=W.apply(Y,T||[])).next())})}function Cr(Y,T){var k,W,ee,V,Ee={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return V={next:Ke(0),throw:Ke(1),return:Ke(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function Ke(et){return function(pt){return function(Ye){if(k)throw new TypeError("Generator is already executing.");for(;Ee;)try{if(k=1,W&&(ee=2&Ye[0]?W.return:Ye[0]?W.throw||((ee=W.return)&&ee.call(W),0):W.next)&&!(ee=ee.call(W,Ye[1])).done)return ee;switch(W=0,ee&&(Ye=[2&Ye[0],ee.value]),Ye[0]){case 0:case 1:ee=Ye;break;case 4:return Ee.label++,{value:Ye[1],done:!1};case 5:Ee.label++,W=Ye[1],Ye=[0];continue;case 7:Ye=Ee.ops.pop(),Ee.trys.pop();continue;default:if(!(ee=Ee.trys,(ee=ee.length>0&&ee[ee.length-1])||Ye[0]!==6&&Ye[0]!==2)){Ee=0;continue}if(Ye[0]===3&&(!ee||Ye[1]>ee[0]&&Ye[1]0&&k>0){var W=new Br(T,k),ee=W.ratio>=1?20:W.getHorizontalLength(20),V=W.ratio<1?20:W.getVerticalLength(20),Ee=document.createElementNS("http://www.w3.org/2000/svg","svg");Ee.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ee.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Ee);var Ke=yt.createDefs();Ee.appendChild(Ke);var et=yt.createElement("clipPath",[["id","text-bg-clip"]]);Ke.appendChild(et);var pt=yt.createPath(yt.getHollowRectanglePath((24-ee)/2,(24-V)/2,ee,V,(24-ee)/2+2,(24-V)/2+2,ee-4,V-4));Ee.appendChild(pt);var Ye=yt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ye.appendChild(yt.createTSpan(T+":"+k)),Ee.appendChild(Ye);var _t=Ye.getBBox();yt.setAttributes(Ye,[["x",((24-_t.width)/2).toString()],["y",((24-_t.height)/2-_t.y).toString()]]);var jt=yt.createPath(yt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(_t.width))/2,(24-Math.ceil(_t.height))/2,Math.ceil(_t.width),Math.ceil(_t.height)));return et.appendChild(jt),yt.setAttributes(pt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Ee),Ee.outerHTML}return''},Y}(),Jt=function(Y){function T(k,W,ee){var V=Y.call(this,k,W)||this;return V.isDropdownOpen=!1,V.onClick=V.dropdownButtonClicked,V.dropdownButtons=ee,V}return Zt(T,Y),T.prototype.setupDropdown=function(){var k=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(W){W.className=k.className,W.colorsClassName=k.colorsClassName,k.dropdownBlock.appendChild(W.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},T.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},T.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},T.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},T.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},T.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},T}(Pt),Ot=function(){function Y(T,k){this.GRIP_SIZE=10,this.color=T,this.fillColor=k,this.visual=yt.createGroup(),this.visual.appendChild(yt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(yt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Y.prototype.ownsTarget=function(T){return T===this.visual||T===this.visual.childNodes[0]||T===this.visual.childNodes[1]},Y.prototype.setCenter=function(T,k){this.visual.childNodes.forEach(function(W){return yt.setAttributes(W,[["cx",T.toString()],["cy",k.toString()]])})},Y}(),lr=function(){function Y(T,k,W,ee){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=T,this.canvasHeight=k,this.margin=W,this.container=ee,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(Y.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(T){this._aspectRatio=T,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(T){this._isGridVisible=T,this.gridContainer&&yt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(T){this._zoomFactor=T,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Y.prototype.open=function(){var T=this;this.cropShadeElement=yt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=yt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var k=0;kthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-k.height/2),yt.setAttributes(this.cropRectElement,[["x",k.x.toString()],["y",k.y.toString()],["width",k.width.toString()],["height",k.height.toString()]]);var W=k.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(V,Ee){var Ke=k.y+W*(Ee+1);yt.setAttributes(V,[["x1",""+k.x],["y1",""+Ke],["x2",""+(k.x+k.width)],["y2",""+Ke]])});var ee=k.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(V,Ee){var Ke=k.x+ee*(Ee+1);yt.setAttributes(V,[["x1",""+Ke],["y1",""+k.y],["x2",""+Ke],["y2",""+(k.y+k.height)]])}),yt.setAttributes(this.cropShadeElement,[["d",yt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,k.x,k.y,k.width,k.height)]]),this.topLeftGrip.setCenter(k.x,k.y),this.topRightGrip.setCenter(k.x+k.width,k.y),this.bottomLeftGrip.setCenter(k.x,k.y+k.height),this.bottomRightGrip.setCenter(k.x+k.width,k.y+k.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},Y.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)},Y.prototype.clientToLocalCoordinates=function(T,k){var W=this.container.getBoundingClientRect();return{x:T-W.left+this.margin,y:k-W.top+this.margin}},Y.prototype.onPointerDown=function(T){this.container.setPointerCapture(T.pointerId),this.previousPoint=this.clientToLocalCoordinates(T.clientX,T.clientY),this.cropRectElement===T.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(T.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(T.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(T.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(T.target)&&(this.activeGrip=this.bottomRightGrip)},Y.prototype.onPointerMove=function(T){if(this.isMoving)this.move(this.clientToLocalCoordinates(T.clientX,T.clientY));else if(this.activeGrip){var k=this.clientToLocalCoordinates(T.clientX,T.clientY);this.resize(k)}T.preventDefault()},Y.prototype.onPointerUp=function(T){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(T.pointerId)},Y.prototype.move=function(T){var k=T.x-this.previousPoint.x,W=T.y-this.previousPoint.y;this.zoomFactor!==1&&(k=-k/this.zoomFactor,W=-W/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+k),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+W),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=T},Y.prototype.resize=function(T){var k=Object.assign({},this.cropRect),W=T.x-this.previousPoint.x,ee=T.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:k.x+Wthis.canvasWidth*this.zoomFactor&&(W=this.canvasWidth*this.zoomFactor-k.width),k.width+=W}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(k.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(W),k.height=this.aspectRatio.getVerticalLength(k.width)):(k.y+=ee,k.height=this.cropRect.y+this.cropRect.height-k.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?k.height=this.aspectRatio.getVerticalLength(k.width):k.height+=ee}k.width<10&&(k.x=this.cropRect.x,k.width=10),k.height<10&&(k.y=this.cropRect.y,k.height=10),this.previousPoint=T,k.x>=this.margin&&k.y>=this.margin&&k.x-this.margin+k.width<=this.canvasWidth&&k.y-this.margin+k.height<=this.canvasHeight&&(this.cropRect=k,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},Y.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var T=this.cropRect.x+this.cropRect.width/2,k=this.cropRect.y+this.cropRect.height/2,W=this.aspectRatio.getHorizontalLength(this.cropRect.height),ee=this.aspectRatio.getVerticalLength(this.cropRect.width);W/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=T-this.cropRect.width/2,this.cropRect.y=k-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)}},Y.prototype.getRescaledRect=function(T,k,W,ee,V,Ee){var Ke=W/T,et=ee/k;return{x:(V.x-Ee)*Ke+Ee,y:(V.y-Ee)*et+Ee,width:V.width*Ke,height:V.height*et}},Y.prototype.scaleCanvas=function(T,k){var W=this.getRescaledRect(this.canvasWidth,this.canvasHeight,T,k,this.cropRect,this.margin);this.canvasWidth=T,this.canvasHeight=k,this.onCropChange&&this.onCropChange(W),this.setCropRectangle(W)},Y}(),Ir=function(){function Y(T){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=T,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(Y.prototype,"angle",{get:function(){return this._angle},set:function(T){this._angle=T,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),Y.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},Y.prototype.onPointerDown=function(T){this.controlContainer.setPointerCapture(T.pointerId),this.isDragging=!0,this.previousPoint={x:T.clientX,y:T.clientY}},Y.prototype.onPointerMove=function(T){this.isDragging&&(this.onAngleChange&&this.onAngleChange((T.clientX-this.previousPoint.x)/5),this.previousPoint.x=T.clientX)},Y.prototype.onPointerUp=function(T){this.isDragging&&this.onAngleChange&&this.onAngleChange((T.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(T.pointerId)},Y.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var T=this.angleLabelText.getBBox();yt.setAttributes(this.angleLabelElement,[["x",((this.width-T.width)/2).toString()],["y",(this.height/2).toString()]])}},Y.prototype.positionScaleShape=function(){if(this.scaleShape){var T=this.scaleShape.transform.baseVal.getItem(0);T.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(T,0)}},Y.prototype.getVisual=function(){var T=document.createElementNS("http://www.w3.org/2000/svg","svg");T.setAttribute("xmlns","http://www.w3.org/2000/svg"),T.setAttribute("width",this.width+"px"),T.setAttribute("height",this.height+"px"),T.setAttribute("viewBox","0 0 "+this.width+" "+this.height),T.style.flexShrink="0",document.body.appendChild(T);for(var k="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,W=1;W<=this.width/5+10;W++){var ee=W%5==0?this.height/3:this.height/6;k+="h4v"+-ee+"h1v"+ee}k+="v1H0Z",this.scaleShape=yt.createPath(k);var V=yt.createTransform();this.scaleShape.transform.baseVal.appendItem(V),T.appendChild(this.scaleShape),this.angleLabelElement=yt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=yt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Ee=yt.createTSpan("");return Ee.innerHTML="°",this.angleLabelElement.appendChild(Ee),T.appendChild(this.angleLabelElement),document.body.removeChild(T),T},Y}(),Xr=function(){function Y(){this.naturalSize=!1,this.imageType="image/png"}return Y.prototype.rasterize=function(T,k,W,ee,V,Ee,Ke){var et=this;return new Promise(function(pt){var Ye=document.createElement("canvas");Ye.width=T.width.baseVal.value-2*ee,Ye.height=T.height.baseVal.value-2*ee;var _t=1,jt=1;et.naturalSize===!0?(_t=k.naturalWidth/(T.width.baseVal.value-2*ee)/Ee,jt=k.naturalHeight/(T.height.baseVal.value-2*ee)/Ke,Ye.width=k.naturalWidth/Ee,Ye.height=k.naturalHeight/Ke):et.width!==void 0&&et.height!==void 0&&(_t=et.width/W.width,jt=et.height/W.height,Ye.width*=_t,Ye.height*=jt);var $t=Ye.getContext("2d");$t.translate(Ye.width/2,Ye.height/2),$t.rotate(V*Math.PI/180),$t.scale(Ee,Ke),$t.translate(-Ye.width/2,-Ye.height/2),$t.drawImage(k,0,0,Ye.width,Ye.height);var jr=document.createElement("canvas");jr.width=W.width*_t,jr.height=W.height*jt,jr.getContext("2d").putImageData($t.getImageData((W.x-ee)*_t,(W.y-ee)*jt,W.width*_t,W.height*jt),0,0),pt(jr.toDataURL(et.imageType,et.imageQuality))})},Y}(),Je=function(){function Y(T){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=Y.instanceCounter++,this.styles=new Lr(this.instanceNo),this.target=T,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(Y.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(T){this._zoomToCropEnabled=T,T?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(T){this._isGridVisible=T,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"gridLines",{get:function(){return this._gridLines},set:function(T){this._gridLines=T,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(T){this._rotationAngle=T,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"aspectRatio",{get:function(){var T;return(T=this._aspectRatio)!==null&&T!==void 0?T:this.aspectRatios[0]},set:function(T){this._aspectRatio=T},enumerable:!1,configurable:!0}),Y.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},Y.prototype.show=function(){this.showUI(),this.open()},Y.prototype.close=function(T){T===void 0&&(T=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),T||this.closeEventListeners.forEach(function(k){return k()}),this._isOpen=!1)},Y.prototype.addRenderEventListener=function(T){this.renderEventListeners.push(T)},Y.prototype.removeRenderEventListener=function(T){this.renderEventListeners.indexOf(T)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(T),1)},Y.prototype.addCloseEventListener=function(T){this.closeEventListeners.push(T)},Y.prototype.removeCloseEventListener=function(T){this.closeEventListeners.indexOf(T)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(T),1)},Y.prototype.setupResizeObserver=function(){var T=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){T.resize(T.target.clientWidth,T.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))},Y.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var T=1*this.target.clientWidth/this.target.clientHeight,k=this.contentDiv.clientWidth/T>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*T:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,W=k+2*this.CANVAS_MARGINT+this.CANVAS_MARGIN?this.target.offsetTop-(T+this.CANVAS_MARGIN):0;this.coverDiv.style.top=k+"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},Y.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},Y.prototype.addTopToolbar=function(){var T=this;this.topToolbar=new Ft,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 k=new dr;k.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(k);var W=[];this.aspectRatios.forEach(function(jt){var $t=new Pt(Vt.getIcon(jt.horizontal,jt.vertical),jt.horizontal===0&&jt.vertical===0?"FREE":jt.horizontal+":"+jt.vertical);$t.onClick=function(){return T.ratioButtonClicked(jt)},W.push($t)}),this.aspectRatioButton=new Jt(Vt.getIcon(0,0),"Aspect ratio",W),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,k.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ee=new Pt('',"Toggle grid");ee.isActive=this.isGridVisible,ee.onClick=function(){T.isGridVisible=!T.isGridVisible,ee.isActive=T.isGridVisible},k.addButton(ee);var V=new Pt('',"Zoom to selection");if(V.isActive=this.zoomToCropEnabled,V.onClick=function(){T.zoomToCropEnabled=!T.zoomToCropEnabled,V.isActive=T.zoomToCropEnabled},k.addButton(V),!Kr.isLicensed){var Ee=new ct;this.topToolbar.addElementBlock(Ee);var Ke=document.createElement("div");Ke.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var et=document.createElement("a");et.style.color="currentColor",et.href="https://markerjs.com/products/cropro",et.target="_blank",et.innerHTML='',Ke.appendChild(et),Ee.addElement(Ke)}var pt=new dr;pt.minWidth=3*this.toolbarHeight+"px",pt.contentAlign="end",this.topToolbar.addButtonBlock(pt);var Ye=new Pt('',"OK");Ye.onClick=this.startRenderAndClose,pt.addButton(Ye),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ye.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var _t=new Pt('',"Close");_t.onClick=this.close,pt.addButton(_t),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(_t.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},Y.prototype.addBottomToolbar=function(){var T=this;this.bottomToolbar=new Ft,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 k=new dr;k.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(k);var W=new Pt('',"Rotate left");W.onClick=this.rotateLeftButtonClicked,k.addButton(W);var ee=new Pt('',"Rotate right");ee.onClick=this.rotateRightButtonClicked,k.addButton(ee);var V=new ct;V.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(V),this.straightener=new Ir("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(pt){T.rotateBy(pt),T.straightener.angle=T.rotationAngle},V.addElement(this.straightener.getUI());var Ee=new dr;Ee.minWidth=2*this.toolbarHeight+"px",Ee.contentAlign="end",this.bottomToolbar.addButtonBlock(Ee);var Ke=new Pt('',"Flip horizontal");Ke.onClick=this.flipHorizontallyButtonClicked,Ee.addButton(Ke);var et=new Pt('',"Flip vertical");et.onClick=this.flipVerticallyButtonClicked,Ee.addButton(et)},Y.prototype.ratioButtonClicked=function(T){this.aspectRatio=T,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},Y.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Vt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},Y.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Br(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},Y.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Y.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},Y.prototype.restoreState=function(T){if(T){var k=this.cropLayer.getRescaledRect(T.width,T.height,this.imageWidth,this.imageHeight,T.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(k),this.cropRectChanged(k),this.flippedHorizontally=T.flippedHorizontally,this.flippedVertically=T.flippedVertically,this.applyFlip(),this.rotationAngle=T.rotationAngle,this.applyRotation()}},Y.prototype.clientToLocalCoordinates=function(T,k){var W=this.cropImage.getBoundingClientRect();return{x:T-W.left,y:k-W.top}},Y.prototype.onWindowResize=function(){this.positionUI()},Y.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var T=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=T+"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()},Y.prototype.rotateLeftButtonClicked=function(){var T=this.rotationAngle-90;this.rotationAngle%90!=0&&(T+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(T)},Y.prototype.rotateRightButtonClicked=function(){var T=this.rotationAngle+90;this.rotationAngle%90!=0&&(T-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(T)},Y.prototype.rotateTo=function(T){T=(T=T>180?T-360:T)<=-180?T+360:T,this.rotationAngle=T,this.applyRotation()},Y.prototype.rotateBy=function(T){this.rotateTo((this.rotationAngle+T)%360)},Y.prototype.applyRotation=function(){var T=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var k=this.editingTargetRotationContainer.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(k,0);var W=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/W.width,this.imageHeight/W.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=T},Y.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},Y.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},Y.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},Y.prototype.startRenderAndClose=function(){return It(this,void 0,void 0,function(){var T,k;return Cr(this,function(W){switch(W.label){case 0:return[4,this.render()];case 1:return T=W.sent(),k=this.getState(),this.renderEventListeners.forEach(function(ee){return ee(T,k)}),this.close(!0),[2]}})})},Y.prototype.render=function(){return It(this,void 0,void 0,function(){var T;return Cr(this,function(k){switch(k.label){case 0:return(T=new Xr).naturalSize=this.renderAtNaturalSize,T.imageType=this.renderImageType,T.imageQuality=this.renderImageQuality,T.width=this.renderWidth,T.height=this.renderHeight,this.unzoomFromCrop(),yt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,T.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 k.sent(),[4,T.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,k.sent()]}})})},Y.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new xt("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new xt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new xt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var T=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new xt("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*T)+`px;
height: `+(this.toolbarHeight-2*T)+`px;
padding: `+T+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new xt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new xt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new bt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new bt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new xt("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new xt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new xt("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new xt("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*T)+`px;
padding: `+T+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new xt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},Y.instanceCounter=0,Y}(),Ct=Z("8hTe"),mn=Z.n(Ct),gn=/]*>/g;function vn(Y){var T=document.createElement("div");return T.innerHTML=Y,T.childNodes.length===0?"":T.childNodes[0].nodeValue}var yn=_e.a=function(Y){var T=Y.value,k=T===void 0?"":T,W=Y.edit,ee=W===void 0?!1:W,V=Y.className,Ee=Y.showTextOnly,Ke=Y.showLines,et=Y.replaces,pt=Y.zoomImg,Ye=Y.hasMask,_t=Y.style,jt=_t===void 0?{}:_t,$t=Y.stylesPrev,jr=$t===void 0?{}:$t,Er=String(k),xr=Object(R.useRef)(),Zr=Object(R.useRef)(),Dn=Object(R.useState)(""),cr=Object(K.a)(Dn,2),zr=cr[0],un=cr[1],hn=Object(R.useState)("office"),Hr=Object(K.a)(hn,2),kn=Hr[0],bn=Hr[1],zn=function(){var Ht=new Je(Zr.current);Ht.displayMode="popup",Ht.addRenderEventListener(function(){var yr=Object(U.a)(r.a.mark(function kt(ar){var Kt;return r.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:return xr.current.style.display="none",fr.next=3,Object(Oe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ar}});case 3:Kt=fr.sent,Kt!=null&&Kt.id&&et(Zr.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 5:case"end":return fr.stop()}},kt)}));return function(kt){return yr.apply(this,arguments)}}()),Ht.show()},Vn=function(){var Ht=new Lt(Zr.current);Ht.settings.displayMode="popup",Ht.addEventListener("render",function(){var yr=Object(U.a)(r.a.mark(function kt(ar){var Kt;return r.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:if(xr.current.style.display="none",!Zr.current){fr.next=6;break}return fr.next=4,Object(Oe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ar.dataUrl}});case 4:Kt=fr.sent,Kt!=null&&Kt.id&&et(Zr.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 6:case"end":return fr.stop()}},kt)}));return function(kt){return yr.apply(this,arguments)}}()),Ht.show(),window.markerArea=Ht},Qr=Object(R.useMemo)(function(){xr.current&&(xr.current.style.zIndex=-1);try{var nr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ht=/\"\/api\/attachments\/|\"\/attachments\/download\//g,yr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Er=Er.replace(nr,"("+$.a.API_SERVER+"/api/attachments/").replace(Ht,'"'+$.a.API_SERVER+"/api/attachments/").replace(yr,'"'+$.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(nn){}var kt=M(Er),ar=S();if(Er.match(/\[TOC\]/)&&(kt=kt.replace("[TOC]
",D()),O()),kt=kt.replace(/(__special_katext_id_\d+__)/g,function(nn,fr){var Ar=ar[fr],Yn=Ar.type,xn=Ar.expression;return Object(ne.renderToString)(vn(xn)||"",{displayMode:Yn==="block",throwOnError:!1,output:"html"})}),kt=kt.replace(/▁/g,"\u2581\u2581\u2581"),y(),Ee){var Kt=document.createElement("div");return Kt.innerHTML=kt,Kt.innerText}return setTimeout(function(){return di()},500),kt},[Er]),$r=Object(R.useRef)();E.WebkitLineClamp=Ke,Ke&&(jt=Object(j.a)(Object(j.a)({},jt),E));function _n(nr){var Ht=nr.target;if(Ht.tagName.toUpperCase()==="IMG"){if(pt){var yr=Ht.getAttribute("src");un(yr),bn("image")}}else if(Ht.tagName.toUpperCase()==="A"){var kt=Ht.getAttribute("href");if(kt.indexOf("office")>-1)nr.preventDefault(),un(kt),bn("office");else if(kt.indexOf("application/pdf")>-1)nr.preventDefault(),un(kt),bn("pdf");else if(kt.indexOf("text/html")>-1)nr.preventDefault(),un(kt),bn("html");else if(kt.startsWith("#")){nr.preventDefault();var ar=document.getElementById(kt.replace("#",""));ar&&ar.scrollIntoView(!0)}}}var di=function(){var Ht,yr=(Ht=$r.current)===null||Ht===void 0?void 0:Ht.querySelectorAll("video");yr==null||yr.forEach(function(kt){if(kt.oncontextmenu=function(){return!1},kt.src.indexOf(".m3u8")>-1&&!kt.canPlayType("application/vnd.apple.mpegurl")){if(H.a.isSupported()){var ar=new H.a;ar.loadSource(kt.src),ar.attachMedia(kt)}}})};Object(R.useEffect)(function(){if($r.current&&Qr&&(Qr.match(gn)&&window.PR.prettyPrint()),$r.current)return $r.current.addEventListener("click",_n),function(){$r.current.removeEventListener("click",_n),y(),O()}},[Qr,$r.current,_n]);var En=function(Ht){if(!ee)return;Ht.target.nodeName==="IMG"?(xr.current.style.zIndex=1,xr.current.style.display="flex",xr.current.style.width=Ht.target.clientWidth+"px",xr.current.style.height=Ht.target.clientHeight+"px",xr.current.style.top=Ht.target.offsetTop+"px",xr.current.style.left=Ht.target.offsetLeft+"px",Zr.current.src=Ht.target.getAttribute("src")):xr.current.style.display="none"};return v.a.createElement("div",{style:{position:"relative"}},v.a.createElement("div",{ref:$r,style:Object(j.a)({},jt),className:"".concat(V||""," markdown-body ").concat(mn.a.mdBody),onMouseOver:En,dangerouslySetInnerHTML:{__html:Qr}}),v.a.createElement("div",{ref:xr,className:mn.a.button},v.a.createElement(J.a,null,v.a.createElement(X.a,{onClick:function(){return zn()}},"\u88C1\u526A"),v.a.createElement(X.a,{onClick:function(){return Vn()}},"\u7F16\u8F91"))),v.a.createElement("img",{ref:Zr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),v.a.createElement(oe.a,{close:!0,data:zr,type:zr!=null&&zr.length?kn:"",style:Object(j.a)({},jr),onClose:function(){return un("")}}))}},"9VGf":function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return P});var ie=Z("q1tI"),J=Z.n(ie);function P(X,j){var U=Object(ie.useRef)();Object(ie.useEffect)(function(){U.current=X}),Object(ie.useEffect)(function(){function K(){U.current()}if(j!==null){var G=setInterval(K,j);return function(){return clearInterval(G)}}},[j])}},BU3w:function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return U});var ie=Z("MNnm"),J="rc-util-key";function P(K){if(K.attachTo)return K.attachTo;var G=document.querySelector("head");return G||document.body}function X(K){var G,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ie.a)())return null;var R=document.createElement("style");if((G=r.csp)===null||G===void 0?void 0:G.nonce){var v;R.nonce=(v=r.csp)===null||v===void 0?void 0:v.nonce}R.innerHTML=K;var m=P(r),p=m.firstChild;return r.prepend&&m.prepend?m.prepend(R):r.prepend&&p?m.insertBefore(R,p):m.appendChild(R),R}var j=new Map;function U(K,G){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},R=P(r);if(!j.has(R)){var v=X("",r),m=v.parentNode;j.set(R,m),m.removeChild(v)}var p=Array.from(j.get(R).children).find(function(u){return u.tagName==="STYLE"&&u[J]===G});if(p){var h,l;if(((h=r.csp)===null||h===void 0?void 0:h.nonce)&&p.nonce!==((l=r.csp)===null||l===void 0?void 0:l.nonce)){var f;p.nonce=(f=r.csp)===null||f===void 0?void 0:f.nonce}return p.innerHTML!==K&&(p.innerHTML=K),p}var o=X(K,r);return o[J]=G,o}},Bd2K:function(rt,_e,Z){(function(ie){ie(Z("VrN/"),Z("osHv"))})(function(ie){ie.defineOption("autoCloseTags",!1,function(r,R,v){if(v!=ie.Init&&v&&r.removeKeyMap("autoCloseTags"),!R)return;var m={name:"autoCloseTags"};(typeof R!="object"||R.whenClosing!==!1)&&(m["'/'"]=function(p){return U(p)}),(typeof R!="object"||R.whenOpening!==!1)&&(m["'>'"]=function(p){return X(p)}),r.addKeyMap(m)});var J=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function X(r){if(r.getOption("disableInput"))return ie.Pass;for(var R=r.listSelections(),v=[],m=r.getOption("autoCloseTags"),p=0;ph.ch&&(s=s.slice(0,s.length-l.end+h.ch));var w=s.toLowerCase();if(!s||l.type=="string"&&(l.end!=h.ch||!/[\"\']/.test(l.string.charAt(l.string.length-1))||l.string.length==1)||l.type=="tag"&&u.close||l.string.indexOf("/")==h.ch-l.start-1||O&&K(O,w)>-1||G(r,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(o)||[],s,h,!0))return ie.Pass;var D=typeof m=="object"&&m.emptyTags;if(D&&K(D,s)>-1){v[p]={text:"/>",newPos:ie.Pos(h.line,h.ch+2)};continue}var L=E&&K(E,w)>-1;v[p]={indent:L,text:">"+(L?`
`:"")+""+s+">",newPos:L?ie.Pos(h.line+1,0):ie.Pos(h.line,h.ch+1)}}for(var A=typeof m=="object"&&m.dontIndentOnAutoClose,p=R.length-1;p>=0;p--){var C=v[p];r.replaceRange(C.text,R[p].head,R[p].anchor,"+insert");var x=r.listSelections().slice(0);x[p]={head:C.newPos,anchor:C.newPos},r.setSelections(x),!A&&C.indent&&(r.indentLine(C.newPos.line,null,!0),r.indentLine(C.newPos.line+1,null,!0))}}function j(r,R){for(var v=r.listSelections(),m=[],p=R?"/":"",h=r.getOption("autoCloseTags"),l=typeof h=="object"&&h.dontIndentOnSlash,f=0;f"&&(O+=">"),m[f]=O}if(r.replaceSelections(m),v=r.listSelections(),!l)for(var f=0;f=0&&R[o]==v;o--)++f;m=l.to;for(var o=1;o0){for(var R=0;R1&&arguments[1]!==void 0?arguments[1]:"",R=[],v=0;vU,ie.serviceIds.set(U,K),K}function j(U){return function(K,G,r){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");P(U,K,r,!0)}}},DlQD:function(rt,_e,Z){(function(ie,J){rt.exports=J()})(this,function(){"use strict";function ie(Ae,me){for(var xe=0;xeAe.length)&&(me=Ae.length);for(var xe=0,ae=new Array(me);xe=Ae.length?{done:!0}:{done:!1,value:Ae[ae++]}}}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 xe=Ae[Symbol.iterator](),xe.next.bind(xe)}function U(Ae,me){return me={exports:{}},Ae(me,me.exports),me.exports}var K=U(function(Ae){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 xe(ae){Ae.exports.defaults=ae}Ae.exports={defaults:me(),getDefaults:me,changeDefaults:xe}}),G=K.defaults,r=K.getDefaults,R=K.changeDefaults,v=/[&<>"']/,m=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"},f=function(me){return l[me]};function o(Ae,me){if(me){if(v.test(Ae))return Ae.replace(m,f)}else if(p.test(Ae))return Ae.replace(h,f);return Ae}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(Ae){return Ae.replace(u,function(me,xe){return xe=xe.toLowerCase(),xe==="colon"?":":xe.charAt(0)==="#"?xe.charAt(1)==="x"?String.fromCharCode(parseInt(xe.substring(2),16)):String.fromCharCode(+xe.substring(1)):""})}var a=/(^|[^\[])\^/g;function O(Ae,me){Ae=Ae.source||Ae,me=me||"";var xe={replace:function(ue,ce){return ce=ce.source||ce,ce=ce.replace(a,"$1"),Ae=Ae.replace(ue,ce),xe},getRegex:function(){return new RegExp(Ae,me)}};return xe}var E=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(Ae,me,xe){if(Ae){var ae;try{ae=decodeURIComponent(s(xe)).replace(E,"").toLowerCase()}catch(ue){return null}if(ae.indexOf("javascript:")===0||ae.indexOf("vbscript:")===0||ae.indexOf("data:")===0)return null}me&&!w.test(xe)&&(xe=c(me,xe));try{xe=encodeURI(xe).replace(/%25/g,"%")}catch(ue){return null}return xe}var L={},A=/^[^:]+:\/*[^/]*$/,C=/^([^:]+:)[\s\S]*$/,x=/^([^:]+:\/*[^/]*)[\s\S]*$/;function c(Ae,me){L[" "+Ae]||(A.test(Ae)?L[" "+Ae]=Ae+"/":L[" "+Ae]=B(Ae,"/",!0)),Ae=L[" "+Ae];var xe=Ae.indexOf(":")===-1;return me.substring(0,2)==="//"?xe?me:Ae.replace(C,"$1")+me:me.charAt(0)==="/"?xe?me:Ae.replace(x,"$1")+me:Ae+me}var S={exec:function(){}};function y(Ae){for(var me=1,xe,ae;me=0&&Ce[ze]==="\\";)Ue=!Ue;return Ue?"|":" |"}),ae=xe.split(/ \|/),ue=0;if(ae.length>me)ae.splice(me);else for(;ae.length=ae.length?ue.slice(ae.length):ue}).join(`
`)}var ye=function(){function Ae(xe){this.options=xe||I}var me=Ae.prototype;return me.space=function(ae){var ue=this.rules.block.newline.exec(ae);if(ue)return ue[0].length>1?{type:"space",raw:ue[0]}:{raw:`
`}},me.code=function(ae,ue){var ce=this.rules.block.code.exec(ae);if(ce){var ge=ue[ue.length-1];if(ge&&ge.type==="paragraph")return{raw:ce[0],text:ce[0].trimRight()};var Ce=ce[0].replace(/^ {4}/gm,"");return{type:"code",raw:ce[0],codeBlockStyle:"indented",text:this.options.pedantic?Ce:g(Ce,`
`)}}},me.fences=function(ae){var ue=this.rules.block.fences.exec(ae);if(ue){var ce=ue[0],ge=Oe(ce,ue[3]||"");return{type:"code",raw:ce,lang:ue[2]?ue[2].trim():ue[2],text:ge}}},me.heading=function(ae){var ue=this.rules.block.heading.exec(ae);if(ue)return{type:"heading",raw:ue[0],depth:ue[1].length,text:ue[2]}},me.nptable=function(ae){var ue=this.rules.block.nptable.exec(ae);if(ue){var ce={type:"table",header:H(ue[1].replace(/^ *| *\| *$/g,"")),align:ue[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ue[3]?ue[3].replace(/\n$/,"").split(`
`):[],raw:ue[0]};if(ce.header.length===ce.align.length){var ge=ce.align.length,Ce;for(Ce=0;Ce ?/gm,"");return{type:"blockquote",raw:ue[0],text:ce}}},me.list=function(ae){var ue=this.rules.block.list.exec(ae);if(ue){for(var ce=ue[0],ge=ue[2],Ce=ge.length>1,Ue=ge[ge.length-1]===")",ze={type:"list",raw:ce,ordered:Ce,start:Ce?+ge.slice(0,-1):"",loose:!1,items:[]},lt=ue[0].match(this.rules.block.item),mt=!1,ft,wt,St,dt,Bt,Lt,qt,Zt=lt.length,It=0;It1||this.options.smartLists&&St!==ge)&&(dt=lt.slice(It+1).join(`
`),ze.raw=ze.raw.substring(0,ze.raw.length-dt.length),It=Zt-1)),Bt=mt||/\n\n(?!\s*$)/.test(ft),It!==Zt-1&&(mt=ft.charAt(ft.length-1)===`
`,Bt||(Bt=mt)),Bt&&(ze.loose=!0),Lt=/^\[[ xX]\] /.test(ft),qt=void 0,Lt&&(qt=ft[1]!==" ",ft=ft.replace(/^\[[ xX]\] +/,"")),ze.items.push({type:"list_item",raw:ce,task:Lt,checked:qt,loose:Bt,text:ft});return ze}},me.html=function(ae){var ue=this.rules.block.html.exec(ae);if(ue)return{type:this.options.sanitize?"paragraph":"html",raw:ue[0],pre:!this.options.sanitizer&&(ue[1]==="pre"||ue[1]==="script"||ue[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):$(ue[0]):ue[0]}},me.def=function(ae){var ue=this.rules.block.def.exec(ae);if(ue){ue[3]&&(ue[3]=ue[3].substring(1,ue[3].length-1));var ce=ue[1].toLowerCase().replace(/\s+/g," ");return{tag:ce,raw:ue[0],href:ue[2],title:ue[3]}}},me.table=function(ae){var ue=this.rules.block.table.exec(ae);if(ue){var ce={type:"table",header:H(ue[1].replace(/^ *| *\| *$/g,"")),align:ue[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ue[3]?ue[3].replace(/\n$/,"").split(`
`):[]};if(ce.header.length===ce.align.length){ce.raw=ue[0];var ge=ce.align.length,Ce;for(Ce=0;Ce/i.test(ge[0])&&(ue=!1),!ce&&/^<(pre|code|kbd|script)(\s|>)/i.test(ge[0])?ce=!0:ce&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ge[0])&&(ce=!1),{type:this.options.sanitize?"text":"html",raw:ge[0],inLink:ue,inRawBlock:ce,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):$(ge[0]):ge[0]}},me.link=function(ae){var ue=this.rules.inline.link.exec(ae);if(ue){var ce=ne(ue[2],"()");if(ce>-1){var ge=ue[0].indexOf("!")===0?5:4,Ce=ge+ue[1].length+ce;ue[2]=ue[2].substring(0,ce),ue[0]=ue[0].substring(0,Ce).trim(),ue[3]=""}var Ue=ue[2],ze="";if(this.options.pedantic){var lt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ue);lt?(Ue=lt[1],ze=lt[3]):ze=""}else ze=ue[3]?ue[3].slice(1,-1):"";Ue=Ue.trim().replace(/^<([\s\S]*)>$/,"$1");var mt=oe(ue,{href:Ue&&Ue.replace(this.rules.inline._escapes,"$1"),title:ze&&ze.replace(this.rules.inline._escapes,"$1")},ue[0]);return mt}},me.reflink=function(ae,ue){var ce;if((ce=this.rules.inline.reflink.exec(ae))||(ce=this.rules.inline.nolink.exec(ae))){var ge=(ce[2]||ce[1]).replace(/\s+/g," ");if(ge=ue[ge.toLowerCase()],!ge||!ge.href){var Ce=ce[0].charAt(0);return{type:"text",raw:Ce,text:Ce}}var Ue=oe(ce,ge,ce[0]);return Ue}},me.strong=function(ae,ue,ce){ce===void 0&&(ce="");var ge=this.rules.inline.strong.start.exec(ae);if(ge&&(!ge[1]||ge[1]&&(ce===""||this.rules.inline.punctuation.exec(ce)))){ue=ue.slice(-1*ae.length);var Ce=ge[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ce.lastIndex=0;for(var Ue;(ge=Ce.exec(ue))!=null;)if(Ue=this.rules.inline.strong.middle.exec(ue.slice(0,ge.index+3)),Ue)return{type:"strong",raw:ae.slice(0,Ue[0].length),text:ae.slice(2,Ue[0].length-2)}}},me.em=function(ae,ue,ce){ce===void 0&&(ce="");var ge=this.rules.inline.em.start.exec(ae);if(ge&&(!ge[1]||ge[1]&&(ce===""||this.rules.inline.punctuation.exec(ce)))){ue=ue.slice(-1*ae.length);var Ce=ge[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ce.lastIndex=0;for(var Ue;(ge=Ce.exec(ue))!=null;)if(Ue=this.rules.inline.em.middle.exec(ue.slice(0,ge.index+2)),Ue)return{type:"em",raw:ae.slice(0,Ue[0].length),text:ae.slice(1,Ue[0].length-1)}}},me.codespan=function(ae){var ue=this.rules.inline.code.exec(ae);if(ue){var ce=ue[2].replace(/\n/g," "),ge=/[^ ]/.test(ce),Ce=ce.startsWith(" ")&&ce.endsWith(" ");return ge&&Ce&&(ce=ce.substring(1,ce.length-1)),ce=$(ce,!0),{type:"codespan",raw:ue[0],text:ce}}},me.br=function(ae){var ue=this.rules.inline.br.exec(ae);if(ue)return{type:"br",raw:ue[0]}},me.del=function(ae){var ue=this.rules.inline.del.exec(ae);if(ue)return{type:"del",raw:ue[0],text:ue[1]}},me.autolink=function(ae,ue){var ce=this.rules.inline.autolink.exec(ae);if(ce){var ge,Ce;return ce[2]==="@"?(ge=$(this.options.mangle?ue(ce[1]):ce[1]),Ce="mailto:"+ge):(ge=$(ce[1]),Ce=ge),{type:"link",raw:ce[0],text:ge,href:Ce,tokens:[{type:"text",raw:ge,text:ge}]}}},me.url=function(ae,ue){var ce;if(ce=this.rules.inline.url.exec(ae)){var ge,Ce;if(ce[2]==="@")ge=$(this.options.mangle?ue(ce[0]):ce[0]),Ce="mailto:"+ge;else{var Ue;do Ue=ce[0],ce[0]=this.rules.inline._backpedal.exec(ce[0])[0];while(Ue!==ce[0]);ge=$(ce[0]),ce[1]==="www."?Ce="http://"+ge:Ce=ge}return{type:"link",raw:ce[0],text:ge,href:Ce,tokens:[{type:"text",raw:ge,text:ge}]}}},me.inlineText=function(ae,ue,ce){var ge=this.rules.inline.text.exec(ae);if(ge){var Ce;return ue?Ce=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):$(ge[0]):ge[0]:Ce=$(this.options.smartypants?ce(ge[0]):ge[0]),{type:"text",raw:ge[0],text:Ce}}},Ae}(),Te=M.noopTest,Re=M.edit,Le=M.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:Te,table:Te,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=Re(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=Re(de.item,"gm").replace(/bull/g,de.bullet).getRegex(),de.list=Re(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=Re(de.html,"i").replace("comment",de._comment).replace("tag",de._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),de.paragraph=Re(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=Re(de.blockquote).replace("paragraph",de.paragraph).getRegex(),de.normal=Le({},de),de.gfm=Le({},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=Re(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=Re(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=Le({},de.normal,{html:Re(`^ *(?: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:Te,paragraph:Re(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 he={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Te,tag:"^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Te,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",he.punctuation=Re(he.punctuation).replace(/punctuation/g,he._punctuation).getRegex(),he._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",he._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",he.em.start=Re(he.em.start).replace(/punctuation/g,he._punctuation).getRegex(),he.em.middle=Re(he.em.middle).replace(/punctuation/g,he._punctuation).replace(/overlapSkip/g,he._overlapSkip).getRegex(),he.em.endAst=Re(he.em.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.em.endUnd=Re(he.em.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.start=Re(he.strong.start).replace(/punctuation/g,he._punctuation).getRegex(),he.strong.middle=Re(he.strong.middle).replace(/punctuation/g,he._punctuation).replace(/blockSkip/g,he._blockSkip).getRegex(),he.strong.endAst=Re(he.strong.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.endUnd=Re(he.strong.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.blockSkip=Re(he._blockSkip,"g").getRegex(),he.overlapSkip=Re(he._overlapSkip,"g").getRegex(),he._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,he._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,he._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,he.autolink=Re(he.autolink).replace("scheme",he._scheme).replace("email",he._email).getRegex(),he._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,he.tag=Re(he.tag).replace("comment",de._comment).replace("attribute",he._attribute).getRegex(),he._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,he._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,he._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,he.link=Re(he.link).replace("label",he._label).replace("href",he._href).replace("title",he._title).getRegex(),he.reflink=Re(he.reflink).replace("label",he._label).getRegex(),he.reflinkSearch=Re(he.reflinkSearch,"g").replace("reflink",he.reflink).replace("nolink",he.nolink).getRegex(),he.normal=Le({},he),he.pedantic=Le({},he.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Re(/^!?\[(label)\]\((.*?)\)/).replace("label",he._label).getRegex(),reflink:Re(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",he._label).getRegex()}),he.gfm=Le({},he.normal,{escape:Re(he.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(ae="x"+ae.toString(16)),me+=""+ae+";";return me}var Pe=function(){function Ae(xe){this.tokens=[],this.tokens.links=Object.create(null),this.options=xe||fe,this.options.tokenizer=this.options.tokenizer||new ye,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ae={block:se.normal,inline:De.normal};this.options.pedantic?(ae.block=se.pedantic,ae.inline=De.pedantic):this.options.gfm&&(ae.block=se.gfm,this.options.breaks?ae.inline=De.breaks:ae.inline=De.gfm),this.tokenizer.rules=ae}Ae.lex=function(ae,ue){var ce=new Ae(ue);return ce.lex(ae)};var me=Ae.prototype;return me.lex=function(ae){return ae=ae.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ae,this.tokens,!0),this.inline(this.tokens),this.tokens},me.blockTokens=function(ae,ue,ce){ue===void 0&&(ue=[]),ce===void 0&&(ce=!0),ae=ae.replace(/^ +$/gm,"");for(var ge,Ce,Ue,ze;ae;){if(ge=this.tokenizer.space(ae)){ae=ae.substring(ge.raw.length),ge.type&&ue.push(ge);continue}if(ge=this.tokenizer.code(ae,ue)){ae=ae.substring(ge.raw.length),ge.type?ue.push(ge):(ze=ue[ue.length-1],ze.raw+=`
`+ge.raw,ze.text+=`
`+ge.text);continue}if(ge=this.tokenizer.fences(ae)){ae=ae.substring(ge.raw.length),ue.push(ge);continue}if(ge=this.tokenizer.heading(ae)){ae=ae.substring(ge.raw.length),ue.push(ge);continue}if(ge=this.tokenizer.nptable(ae)){ae=ae.substring(ge.raw.length),ue.push(ge);continue}if(ge=this.tokenizer.hr(ae)){ae=ae.substring(ge.raw.length),ue.push(ge);continue}if(ge=this.tokenizer.blockquote(ae)){ae=ae.substring(ge.raw.length),ge.tokens=this.blockTokens(ge.text,[],ce),ue.push(ge);continue}if(ge=this.tokenizer.list(ae)){for(ae=ae.substring(ge.raw.length),Ue=ge.items.length,Ce=0;Ce0)for(;(lt=this.tokenizer.rules.inline.reflinkSearch.exec(ze))!=null;)mt.includes(lt[0].slice(lt[0].lastIndexOf("[")+1,-1))&&(ze=ze.slice(0,lt.index)+"["+"a".repeat(lt[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(lt=this.tokenizer.rules.inline.blockSkip.exec(ze))!=null;)ze=ze.slice(0,lt.index)+"["+"a".repeat(lt[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ae;){if(Ue=this.tokenizer.escape(ae)){ae=ae.substring(Ue.raw.length),ue.push(Ue);continue}if(Ue=this.tokenizer.tag(ae,ce,ge)){ae=ae.substring(Ue.raw.length),ce=Ue.inLink,ge=Ue.inRawBlock,ue.push(Ue);continue}if(Ue=this.tokenizer.link(ae)){ae=ae.substring(Ue.raw.length),Ue.type==="link"&&(Ue.tokens=this.inlineTokens(Ue.text,[],!0,ge)),ue.push(Ue);continue}if(Ue=this.tokenizer.reflink(ae,this.tokens.links)){ae=ae.substring(Ue.raw.length),Ue.type==="link"&&(Ue.tokens=this.inlineTokens(Ue.text,[],!0,ge)),ue.push(Ue);continue}if(Ue=this.tokenizer.strong(ae,ze,Ce)){ae=ae.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],ce,ge),ue.push(Ue);continue}if(Ue=this.tokenizer.em(ae,ze,Ce)){ae=ae.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],ce,ge),ue.push(Ue);continue}if(Ue=this.tokenizer.codespan(ae)){ae=ae.substring(Ue.raw.length),ue.push(Ue);continue}if(Ue=this.tokenizer.br(ae)){ae=ae.substring(Ue.raw.length),ue.push(Ue);continue}if(Ue=this.tokenizer.del(ae)){ae=ae.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],ce,ge),ue.push(Ue);continue}if(Ue=this.tokenizer.autolink(ae,Se)){ae=ae.substring(Ue.raw.length),ue.push(Ue);continue}if(!ce&&(Ue=this.tokenizer.url(ae,Se))){ae=ae.substring(Ue.raw.length),ue.push(Ue);continue}if(Ue=this.tokenizer.inlineText(ae,ge,Ne)){ae=ae.substring(Ue.raw.length),Ce=Ue.raw.slice(-1),ue.push(Ue);continue}if(ae){var ft="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(ft);break}else throw new Error(ft)}}return ue},J(Ae,null,[{key:"rules",get:function(){return{block:se,inline:De}}}]),Ae}(),je=K.defaults,le=M.cleanUrl,ve=M.escape,we=function(){function Ae(xe){this.options=xe||je}var me=Ae.prototype;return me.code=function(ae,ue,ce){var ge=(ue||"").match(/\S*/)[0];if(this.options.highlight){var Ce=this.options.highlight(ae,ge);Ce!=null&&Ce!==ae&&(ce=!0,ae=Ce)}return ge?''+(ce?ae:ve(ae,!0))+`
`:""+(ce?ae:ve(ae,!0))+`
`},me.blockquote=function(ae){return`
`+ae+`
`},me.html=function(ae){return ae},me.heading=function(ae,ue,ce,ge){return this.options.headerIds?"
`:""+ae+"
`},me.hr=function(){return this.options.xhtml?`
`:`
`},me.list=function(ae,ue,ce){var ge=ue?"ol":"ul",Ce=ue&&ce!==1?' start="'+ce+'"':"";return"<"+ge+Ce+`>
`+ae+""+ge+`>
`},me.listitem=function(ae){return""+ae+`
`},me.checkbox=function(ae){return" "},me.paragraph=function(ae){return""+ae+`
`},me.table=function(ae,ue){return ue&&(ue=""+ue+""),`
`},me.tablerow=function(ae){return`
`+ae+`
`},me.tablecell=function(ae,ue){var ce=ue.header?"th":"td",ge=ue.align?"<"+ce+' align="'+ue.align+'">':"<"+ce+">";return ge+ae+""+ce+`>
`},me.strong=function(ae){return""+ae+""},me.em=function(ae){return""+ae+""},me.codespan=function(ae){return""+ae+""},me.br=function(){return this.options.xhtml?"
":"
"},me.del=function(ae){return""+ae+""},me.link=function(ae,ue,ce){if(ae=le(this.options.sanitize,this.options.baseUrl,ae),ae===null)return ce;var ge='"+ce+"",ge},me.image=function(ae,ue,ce){if(ae=le(this.options.sanitize,this.options.baseUrl,ae),ae===null)return ce;var ge='
":">",ge},me.text=function(ae){return ae},Ae}(),Ie=function(){function Ae(){}var me=Ae.prototype;return me.strong=function(ae){return ae},me.em=function(ae){return ae},me.codespan=function(ae){return ae},me.del=function(ae){return ae},me.html=function(ae){return ae},me.text=function(ae){return ae},me.link=function(ae,ue,ce){return""+ce},me.image=function(ae,ue,ce){return""+ce},me.br=function(){return""},Ae}(),We=function(){function Ae(){this.seen={}}var me=Ae.prototype;return me.slug=function(ae){var ue=ae.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ue)){var ce=ue;do this.seen[ce]++,ue=ce+"-"+this.seen[ce];while(this.seen.hasOwnProperty(ue))}return this.seen[ue]=0,ue},Ae}(),Ve=K.defaults,Ze=M.unescape,$e=function(){function Ae(xe){this.options=xe||Ve,this.options.renderer=this.options.renderer||new we,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ie,this.slugger=new We}Ae.parse=function(ae,ue){var ce=new Ae(ue);return ce.parse(ae)};var me=Ae.prototype;return me.parse=function(ae,ue){ue===void 0&&(ue=!0);var ce="",ge,Ce,Ue,ze,lt,mt,ft,wt,St,dt,Bt,Lt,qt,Zt,It,Cr,Kr,yt,Lr=ae.length;for(ge=0;ge0&&It.tokens[0].type==="text"?(It.tokens[0].text=yt+" "+It.tokens[0].text,It.tokens[0].tokens&&It.tokens[0].tokens.length>0&&It.tokens[0].tokens[0].type==="text"&&(It.tokens[0].tokens[0].text=yt+" "+It.tokens[0].tokens[0].text)):It.tokens.unshift({type:"text",text:yt}):Zt+=yt),Zt+=this.parse(It.tokens,qt),St+=this.renderer.listitem(Zt,Kr,Cr);ce+=this.renderer.list(St,Bt,Lt);continue}case"html":{ce+=this.renderer.html(dt.text);continue}case"paragraph":{ce+=this.renderer.paragraph(this.parseInline(dt.tokens));continue}case"text":{for(St=dt.tokens?this.parseInline(dt.tokens):dt.text;ge+1An error occurred:
"+nt(Ue.message+"",!0)+"
";throw Ue}}Be.options=Be.setOptions=function(Ae){return st(Be.defaults,Ae),ot(Be.defaults),Be},Be.getDefaults=Fe,Be.defaults=tt,Be.use=function(Ae){var me=st({},Ae);if(Ae.renderer&&function(){var ae=Be.defaults.renderer||new we,ue=function(Ce){var Ue=ae[Ce];ae[Ce]=function(){for(var ze=arguments.length,lt=new Array(ze),mt=0;mt`,triples:"",explode:"[]{}"},P=ie.Pos;ie.defineOption("autoCloseBrackets",!1,function(l,f,o){o&&o!=ie.Init&&(l.removeKeyMap(j),l.state.closeBrackets=null),f&&(U(X(f,"pairs")),l.state.closeBrackets=f,l.addKeyMap(j))});function X(l,f){return f=="pairs"&&typeof l=="string"?l:typeof l=="object"&&l[f]!=null?l[f]:J[f]}var j={Backspace:r,Enter:R};function U(l){for(var f=0;f=0;s--){var O=u[s].head;l.replaceRange("",P(O.line,O.ch-1),P(O.line,O.ch+1),"+delete")}}function R(l){var f=G(l),o=f&&X(f,"explode");if(!o||l.getOption("disableInput"))return ie.Pass;for(var u=l.listSelections(),s=0;s0;return{anchor:new P(l.anchor.line,l.anchor.ch+(f?-1:1)),head:new P(l.head.line,l.head.ch+(f?1:-1))}}function m(l,f){var o=G(l);if(!o||l.getOption("disableInput"))return ie.Pass;var u=X(o,"pairs"),s=u.indexOf(f);if(s==-1)return ie.Pass;for(var a=X(o,"closeBefore"),O=X(o,"triples"),E=u.charAt(s+1)==f,w=l.listSelections(),D=s%2==0,L,A=0;A=0&&l.getRange(x,P(x.line,x.ch+3))==f+f+f?c="skipThree":c="skip";else if(E&&x.ch>1&&O.indexOf(f)>=0&&l.getRange(P(x.line,x.ch-2),x)==f+f){if(x.ch>2&&/\bstring/.test(l.getTokenTypeAt(P(x.line,x.ch-2))))return ie.Pass;c="addFour"}else if(E){var y=x.ch==0?" ":l.getRange(P(x.line,x.ch-1),x);if(!ie.isWordChar(S)&&y!=f&&!ie.isWordChar(y))c="both";else return ie.Pass}else if(D&&(S.length===0||/\s/.test(S)||a.indexOf(S)>-1))c="both";else return ie.Pass;if(!L)L=c;else if(L!=c)return ie.Pass}var b=s%2?u.charAt(s-1):f,B=s%2?f:u.charAt(s+1);l.operation(function(){if(L=="skip")l.execCommand("goCharRight");else if(L=="skipThree")for(var F=0;F<3;F++)l.execCommand("goCharRight");else if(L=="surround"){for(var _=l.getSelections(),F=0;F<_.length;F++)_[F]=b+_[F]+B;l.replaceSelections(_,"around"),_=l.listSelections().slice();for(var F=0;F<_.length;F++)_[F]=v(_[F]);l.setSelections(_)}else L=="both"?(l.replaceSelection(b+B,null),l.triggerElectric(b+B),l.execCommand("goCharLeft")):L=="addFour"&&(l.replaceSelection(b+b+b+b,"before"),l.execCommand("goCharRight"))})}function p(l,f){var o=l.getRange(P(f.line,f.ch-1),P(f.line,f.ch+1));return o.length==2?o:null}function h(l,f){var o=l.getTokenAt(P(f.line,f.ch+1));return/\bstring/.test(o.type)&&o.start==f.ch&&(f.ch==0||!/\bstring/.test(l.getTokenTypeAt(f)))}})},FWmy:function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return ie});function ie(J,P){if(!J)throw new Error(P?`Assertion failed (${P})`:"Assertion Failed")}},GfqC:function(rt,_e,Z){"use strict";var ie=Z("q1tI"),J=Z.n(ie),P=Z("TSYQ"),X=Z.n(P);function j(M,I){var g="cannot "+M.method+" "+M.action+" "+I.status+"'",H=new Error(g);return H.status=I.status,H.method=M.method,H.url=M.action,H}function U(M){var I=M.responseText||M.response;if(!I)return I;try{return JSON.parse(I)}catch(g){return I}}function K(M){var I=new XMLHttpRequest;M.onProgress&&I.upload&&(I.upload.onprogress=function(ne){ne.total>0&&(ne.percent=ne.loaded/ne.total*100),M.onProgress(ne)});var g=new FormData;M.data&&Object.keys(M.data).forEach(function($){var ne=M.data[$];if(Array.isArray(ne)){ne.forEach(function(oe){g.append($+"[]",oe)});return}g.append($,M.data[$])}),M.file instanceof Blob?g.append(M.filename,M.file,M.file.name):g.append(M.filename,M.file),I.onerror=function(ne){M.onError(ne)},I.onload=function(){return I.status<200||I.status>=300?M.onError(j(M,I),U(I)):M.onSuccess(U(I),I)},I.open(M.method,M.action,!0),M.withCredentials&&"withCredentials"in I&&(I.withCredentials=!0);var H=M.headers||{};return H["X-Requested-With"]!==null&&I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(H).forEach(function($){H[$]!==null&&I.setRequestHeader($,H[$])}),I.send(g),{abort:function(){I.abort()}}}var G=+new Date,r=0;function R(){return"rc-upload-"+G+"-"+ ++r}function v(M,I){return M.indexOf(I,M.length-I.length)!==-1}var m=function(M,I){if(M&&I){var g=Array.isArray(I)?I:I.split(","),H=M.name||"",$=M.type||"",ne=$.replace(/\/.*$/,"");return g.some(function(oe){var Oe=oe.trim();return Oe.charAt(0)==="."?v(H.toLowerCase(),Oe.toLowerCase()):/\/\*$/.test(Oe)?ne===Oe.replace(/\/.*$/,""):$===Oe})}return!0};function p(M,I){var g=M.createReader(),H=[];function $(){g.readEntries(function(ne){var oe=Array.prototype.slice.apply(ne);H=H.concat(oe);var Oe=!oe.length;Oe?I(H):$()})}$()}var h=function(I,g,H){var $=function ne(oe,Oe){Oe=Oe||"",oe.isFile?oe.file(function(ye){H(ye)&&(oe.fullPath&&!ye.webkitRelativePath&&(Object.defineProperties(ye,{webkitRelativePath:{writable:!0}}),ye.webkitRelativePath=oe.fullPath.replace(/^\//,""),Object.defineProperties(ye,{webkitRelativePath:{writable:!1}})),g([ye]))}):oe.isDirectory&&p(oe,function(ye){ye.forEach(function(Te){ne(Te,""+Oe+oe.name+"/")})})};I.forEach(function(ne){$(ne.webkitGetAsEntry())})},l=h,f=Object.assign||function(M){for(var I=1;I=0)continue;if(!Object.prototype.hasOwnProperty.call(M,H))continue;g[H]=M[H]}return g}function O(M,I){if(!(M instanceof I))throw new TypeError("Cannot call a class as a function")}function E(M,I){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:M}function w(M,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);M.prototype=Object.create(I&&I.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(M,I):M.__proto__=I)}var D=function(I){return Object.keys(I).reduce(function(g,H){return(H.substr(0,5)==="data-"||H.substr(0,5)==="aria-"||H==="role")&&(g[H]=I[H]),g},{})},L=function(M){w(I,M);function I(){var g,H,$,ne;O(this,I);for(var oe=arguments.length,Oe=Array(oe),ye=0;yea.length&&(E=a.length);Ow===D){const w=a[Symbol.iterator](),D=O[Symbol.iterator]();for(;;){const L=w.next(),A=D.next();if(L.done!==A.done)return!1;if(L.done)return!0;if(!E(L.value,A.value))return!1}}J.equals=s})(ie||(ie={}))},LdHM:function(rt,_e,Z){"use strict";Z.d(_e,"b",function(){return a}),Z.d(_e,"a",function(){return E});var ie=Z("1OyB"),J=Z("vuIU"),P=Z("Ji7U"),X=Z("LK+K"),j=Z("q1tI"),U=Z("rePB"),K=Z("Ff2n"),G=Z("ODXe"),r=Z("4IlW"),R=Z("bX4T"),v=Z("YrtM"),m=Z("TSYQ"),p=Z.n(m),h=Z("+nKL"),l=Z("8OUc"),f=function(H,$){var ne=H.prefixCls,oe=H.id,Oe=H.flattenOptions,ye=H.childrenAsData,Te=H.values,Re=H.searchValue,Le=H.multiple,de=H.defaultActiveFirstOption,he=H.height,re=H.itemHeight,fe=H.notFoundContent,se=H.open,De=H.menuItemSelectedIcon,Ne=H.virtual,Se=H.onSelect,Pe=H.onToggleOpen,je=H.onActiveValue,le=H.onScroll,ve=H.onMouseEnter,we="".concat(ne,"-item"),Ie=Object(v.a)(function(){return Oe},[se,Oe],function(He,Ae){return Ae[0]&&He[1]!==Ae[1]}),We=j.useRef(null),Ve=function(Ae){Ae.preventDefault()},Ze=function(Ae){We.current&&We.current.scrollTo({index:Ae})},$e=function(Ae){for(var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,xe=Ie.length,ae=0;ae1&&arguments[1]!==void 0?arguments[1]:!1;return Object(D.a)(g).map(function($,ne){if(!j.isValidElement($)||!$.type)return null;var oe=$.type.isSelectOptGroup,Oe=$.key,ye=$.props,Te=ye.children,Re=Object(K.a)(ye,["children"]);return H||!oe?L($):Object(w.a)(Object(w.a)({key:"__RC_SELECT_GRP__".concat(Oe===null?ne:Oe,"__"),label:Oe},Re),{},{options:A(Te)})}).filter(function($){return $})}var C=Z("2Qr1"),x=Z("qNPg"),c=Z("U8pU"),S=Z("Kwbf"),y=Z("WKfj");function b(g){var H=g.mode,$=g.options,ne=g.children,oe=g.backfill,Oe=g.allowClear,ye=g.placeholder,Te=g.getInputElement,Re=g.showSearch,Le=g.onSearch,de=g.defaultOpen,he=g.autoFocus,re=g.labelInValue,fe=g.value,se=g.inputValue,De=g.optionLabelProp,Ne=H==="multiple"||H==="tags",Se=Re!==void 0?Re:Ne||H==="combobox",Pe=$||A(ne);if(Object(S.a)(H!=="tags"||Pe.every(function(we){return!we.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),H==="tags"||H==="combobox"){var je=Pe.some(function(we){return we.options?we.options.some(function(Ie){return typeof("value"in Ie?Ie.value:Ie.key)=="number"}):typeof("value"in we?we.value:we.key)=="number"});Object(S.a)(!je,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(S.a)(H!=="combobox"||!De,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(S.a)(H==="combobox"||!oe,"`backfill` only works with `combobox` mode."),Object(S.a)(H==="combobox"||!Te,"`getInputElement` only work with `combobox` mode."),Object(S.b)(H!=="combobox"||!Te||!Oe||!ye,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Le&&!Se&&H!=="combobox"&&H!=="tags"&&Object(S.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(S.b)(!de||he,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),fe!=null){var le=Object(y.d)(fe);Object(S.a)(!re||le.every(function(we){return Object(c.a)(we)==="object"&&("key"in we||"value"in we)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(S.a)(!Ne||Array.isArray(fe),"`value` should be array when `mode` is `multiple` or `tags`")}if(ne){var ve=null;Object(D.a)(ne).some(function(we){if(!j.isValidElement(we)||!we.type)return!1;var Ie=we.type;if(Ie.isSelectOption)return!1;if(Ie.isSelectOptGroup){var We=Object(D.a)(we.props.children).every(function(Ve){return!j.isValidElement(Ve)||!we.type||Ve.type.isSelectOption?!0:(ve=Ve.type,!1)});return!We}return ve=Ie,!0}),ve&&Object(S.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ve.displayName||ve.name||ve,"`.")),Object(S.a)(se===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var B=b,F=Object(x.a)({prefixCls:"rc-select",components:{optionList:u},convertChildrenToData:A,flattenOptions:C.d,getLabeledValue:C.e,filterOptions:C.b,isValueDisabled:C.g,findValueOption:C.c,warningProps:B,fillOptionsWithMissingValue:C.a}),_=function(g){Object(P.a)($,g);var H=Object(X.a)($);function $(){var ne;return Object(ie.a)(this,$),ne=H.apply(this,arguments),ne.selectRef=j.createRef(),ne.focus=function(){ne.selectRef.current.focus()},ne.blur=function(){ne.selectRef.current.blur()},ne}return Object(J.a)($,[{key:"render",value:function(){return j.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),$}(j.Component);_.Option=a,_.OptGroup=E;var M=_,I=_e.c=M},M8RZ:function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return r});var ie=Z("fWQN"),J=Z("mtLc"),P=Z("yKVA"),X=Z("879j"),j=Z("q1tI"),U=Z.n(j),K=Z("i8i4"),G=Z.n(K),r=function(R){Object(P.a)(m,R);var v=Object(X.a)(m);function m(p){var h;Object(ie.a)(this,m),h=v.call(this,p);var l=window.document;return h.node=l.createElement("div"),l.body.appendChild(h.node),h}return Object(J.a)(m,[{key:"render",value:function(){var h=this.props.children;return Object(K.createPortal)(h,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(U.a.Component)},MI8n:function(rt,_e,Z){"use strict";Z.d(_e,"c",function(){return j}),Z.d(_e,"b",function(){return r}),Z.d(_e,"e",function(){return R}),Z.d(_e,"a",function(){return v}),Z.d(_e,"d",function(){return m}),Z.d(_e,"f",function(){return p});var ie=Z("/cxE"),J=Z("pmY6"),P=Z("24hK"),X=Z("5Y4S"),j;(function(h){h.None=()=>J.a.None;function l(b){return(B,F=null,_)=>{let M=!1,I;return I=b(g=>M?void 0:(I?I.dispose():M=!0,B.call(F,g)),null,_),M&&I.dispose(),I}}h.once=l;function f(b,B){return E((F,_=null,M)=>b(I=>F.call(_,B(I)),null,M))}h.map=f;function o(b,B){return E((F,_=null,M)=>b(I=>{B(I),F.call(_,I)},null,M))}h.forEach=o;function u(b,B){return E((F,_=null,M)=>b(I=>B(I)&&F.call(_,I),null,M))}h.filter=u;function s(b){return b}h.signal=s;function a(...b){return(B,F=null,_)=>Object(J.e)(...b.map(M=>M(I=>B.call(F,I),null,_)))}h.any=a;function O(b,B,F){let _=F;return f(b,M=>(_=B(_,M),_))}h.reduce=O;function E(b){let B;const F=new r({onFirstListenerAdd(){B=b(F.fire,F)},onLastListenerRemove(){B.dispose()}});return F.event}function w(b,B,F=100,_=!1,M){let I,g,H,$=0;const ne=new r({leakWarningThreshold:M,onFirstListenerAdd(){I=b(oe=>{$++,g=B(g,oe),_&&!H&&(ne.fire(g),g=void 0),clearTimeout(H),H=setTimeout(()=>{const Oe=g;g=void 0,H=void 0,(!_||$>1)&&ne.fire(Oe),$=0},F)})},onLastListenerRemove(){I.dispose()}});return ne.event}h.debounce=w;function D(b,B=(F,_)=>F===_){let F=!0,_;return u(b,M=>{const I=F||!B(M,_);return F=!1,_=M,I})}h.latch=D;function L(b,B){return[h.filter(b,B),h.filter(b,F=>!B(F))]}h.split=L;function A(b,B=!1,F=[]){let _=F.slice(),M=b(H=>{_?_.push(H):g.fire(H)});const I=()=>{_&&_.forEach(H=>g.fire(H)),_=null},g=new r({onFirstListenerAdd(){M||(M=b(H=>g.fire(H)))},onFirstListenerDidAdd(){_&&(B?setTimeout(I):I())},onLastListenerRemove(){M&&M.dispose(),M=null}});return g.event}h.buffer=A;class C{constructor(b){this.event=b}map(b){return new C(f(this.event,b))}forEach(b){return new C(o(this.event,b))}filter(b){return new C(u(this.event,b))}reduce(b,B){return new C(O(this.event,b,B))}latch(){return new C(D(this.event))}debounce(b,B=100,F=!1,_){return new C(w(this.event,b,B,F,_))}on(b,B,F){return this.event(b,B,F)}once(b,B,F){return l(this.event)(b,B,F)}}function x(b){return new C(b)}h.chain=x;function c(b,B,F=_=>_){const _=(...H)=>g.fire(F(...H)),M=()=>b.on(B,_),I=()=>b.removeListener(B,_),g=new r({onFirstListenerAdd:M,onLastListenerRemove:I});return g.event}h.fromNodeEventEmitter=c;function S(b,B,F=_=>_){const _=(...H)=>g.fire(F(...H)),M=()=>b.addEventListener(B,_),I=()=>b.removeEventListener(B,_),g=new r({onFirstListenerAdd:M,onLastListenerRemove:I});return g.event}h.fromDOMEventEmitter=S;function y(b){return new Promise(B=>l(b)(B))}h.toPromise=y})(j||(j={}));class U{constructor(h){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${h}_${U._idPool++}`}start(h){this._stopWatch=new X.a(!0),this._listenerCount=h}stop(){if(this._stopWatch){const h=this._stopWatch.elapsed();this._elapsedOverall+=h,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${h.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}U._idPool=0;let K=-1;class G{constructor(h,l=Math.random().toString(18).slice(2,5)){this.customThreshold=h,this.name=l,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(h){let l=K;if(typeof this.customThreshold=="number"&&(l=this.customThreshold),l<=0||h{const u=this._stacks.get(f)||0;this._stacks.set(f,u-1)}}}class r{constructor(h){var l;this._disposed=!1,this._options=h,this._leakageMon=K>0?new G(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((l=this._options)===null||l===void 0?void 0:l._profName)?new U(this._options._profName):void 0}get event(){return this._event||(this._event=(h,l,f)=>{var o;this._listeners||(this._listeners=new P.a);const u=this._listeners.isEmpty();u&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const s=this._listeners.push(l?[h,l]:h);u&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,h,l);const a=(o=this._leakageMon)===null||o===void 0?void 0:o.check(this._listeners.size),O=Object(J.i)(()=>{if(a&&a(),!this._disposed&&(s(),this._options&&this._options.onLastListenerRemove)){const E=this._listeners&&!this._listeners.isEmpty();E||this._options.onLastListenerRemove(this)}});return f instanceof J.b?f.add(O):Array.isArray(f)&&f.push(O),O}),this._event}fire(h){var l,f;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new P.a);for(let o of this._listeners)this._deliveryQueue.push([o,h]);for((l=this._perfMon)===null||l===void 0||l.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[o,u]=this._deliveryQueue.shift();try{typeof o=="function"?o.call(void 0,u):o[0].call(o[1],u)}catch(s){Object(ie.f)(s)}}(f=this._perfMon)===null||f===void 0||f.stop()}}dispose(){var h,l,f,o,u;this._disposed||(this._disposed=!0,(h=this._listeners)===null||h===void 0||h.clear(),(l=this._deliveryQueue)===null||l===void 0||l.clear(),(o=(f=this._options)===null||f===void 0?void 0:f.onLastListenerRemove)===null||o===void 0||o.call(f),(u=this._leakageMon)===null||u===void 0||u.dispose())}}class R extends r{constructor(h){super(h);this._isPaused=0,this._eventQueue=new P.a,this._mergeFn=h==null?void 0:h.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const h=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(h))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(h){this._listeners&&(this._isPaused!==0?this._eventQueue.push(h):super.fire(h))}}class v extends R{constructor(h){var l;super(h);this._delay=(l=h.delay)!==null&&l!==void 0?l:100}fire(h){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(h)}}class m{constructor(){this.buffers=[]}wrapEvent(h){return(l,f,o)=>h(u=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>l.call(f,u)):l.call(f,u)},void 0,o)}bufferEvents(h){const l=[];this.buffers.push(l);const f=h();return this.buffers.pop(),l.forEach(o=>o()),f}}class p{constructor(){this.listening=!1,this.inputEvent=j.None,this.inputEventListener=J.a.None,this.emitter=new r({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(h){this.inputEvent=h,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=h(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(rt,_e,Z){"use strict";(function(ie,J){Z.d(_e,"b",function(){return f}),Z.d(_e,"i",function(){return a}),Z.d(_e,"f",function(){return O}),Z.d(_e,"d",function(){return E}),Z.d(_e,"g",function(){return w}),Z.d(_e,"h",function(){return D}),Z.d(_e,"c",function(){return L}),Z.d(_e,"k",function(){return A}),Z.d(_e,"j",function(){return C}),Z.d(_e,"a",function(){return x}),Z.d(_e,"e",function(){return y});var P;const X="en";let j=!1,U=!1,K=!1,G=!1,r=!1,R=!1,v=!1,m,p=X,h,l;const f=typeof self=="object"?self:typeof ie=="object"?ie:{};let o;typeof f.vscode!="undefined"&&typeof f.vscode.process!="undefined"?o=f.vscode.process:typeof J!="undefined"&&(o=J);const u=typeof((P=o==null?void 0:o.versions)===null||P===void 0?void 0:P.electron)=="string"&&o.type==="renderer";if(typeof navigator=="object"&&!u)l=navigator.userAgent,j=l.indexOf("Windows")>=0,U=l.indexOf("Macintosh")>=0,v=(l.indexOf("Macintosh")>=0||l.indexOf("iPad")>=0||l.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,K=l.indexOf("Linux")>=0,R=!0,m=navigator.language,p=m;else if(typeof o=="object"){j=o.platform==="win32",U=o.platform==="darwin",K=o.platform==="linux",G=K&&!!o.env.SNAP&&!!o.env.SNAP_REVISION,m=X,p=X;const b=o.env.VSCODE_NLS_CONFIG;if(b)try{const B=JSON.parse(b),F=B.availableLanguages["*"];m=B.locale,p=F||X,h=B._translationsConfigFile}catch(B){}r=!0}else console.error("Unable to resolve platform.");let s=0;U?s=1:j?s=3:K&&(s=2);const a=j,O=U,E=K,w=r,D=R,L=v,A=l,C=function(){if(f.setImmediate)return f.setImmediate.bind(f);if(typeof f.postMessage=="function"&&!f.importScripts){let F=[];f.addEventListener("message",M=>{if(M.data&&M.data.vscodeSetImmediateId)for(let I=0,g=F.length;I{const I=++_;F.push({id:I,callback:M}),f.postMessage({vscodeSetImmediateId:I},"*")}}if(typeof(o==null?void 0:o.nextTick)=="function")return o.nextTick.bind(o);const B=Promise.resolve();return F=>B.then(F)}(),x=U||v?2:j?1:3;let c=!0,S=!1;function y(){if(!S){S=!0;const b=new Uint8Array(2);b[0]=1,b[1]=2;const B=new Uint16Array(b.buffer);c=B[0]===(2<<8)+1}return c}}).call(this,Z("IyRk"),Z("Q2Ig"))},N0LK:function(rt,_e,Z){"use strict";Z.d(_e,"C",function(){return ie}),Z.d(_e,"v",function(){return P}),Z.d(_e,"s",function(){return X}),Z.d(_e,"t",function(){return j}),Z.d(_e,"U",function(){return U}),Z.d(_e,"J",function(){return K}),Z.d(_e,"O",function(){return G}),Z.d(_e,"p",function(){return r}),Z.d(_e,"T",function(){return R}),Z.d(_e,"q",function(){return v}),Z.d(_e,"N",function(){return m}),Z.d(_e,"M",function(){return p}),Z.d(_e,"Q",function(){return h}),Z.d(_e,"u",function(){return l}),Z.d(_e,"x",function(){return f}),Z.d(_e,"I",function(){return o}),Z.d(_e,"f",function(){return u}),Z.d(_e,"h",function(){return s}),Z.d(_e,"g",function(){return a}),Z.d(_e,"i",function(){return O}),Z.d(_e,"G",function(){return E}),Z.d(_e,"H",function(){return w}),Z.d(_e,"r",function(){return D}),Z.d(_e,"R",function(){return L}),Z.d(_e,"d",function(){return A}),Z.d(_e,"e",function(){return C}),Z.d(_e,"E",function(){return x}),Z.d(_e,"F",function(){return c}),Z.d(_e,"j",function(){return S}),Z.d(_e,"z",function(){return y}),Z.d(_e,"K",function(){return B}),Z.d(_e,"L",function(){return F}),Z.d(_e,"m",function(){return M}),Z.d(_e,"k",function(){return g}),Z.d(_e,"A",function(){return $}),Z.d(_e,"a",function(){return ne}),Z.d(_e,"n",function(){return oe}),Z.d(_e,"l",function(){return Oe}),Z.d(_e,"D",function(){return ye}),Z.d(_e,"B",function(){return Te}),Z.d(_e,"b",function(){return Re}),Z.d(_e,"S",function(){return Le}),Z.d(_e,"o",function(){return de}),Z.d(_e,"P",function(){return he}),Z.d(_e,"w",function(){return re}),Z.d(_e,"c",function(){return fe}),Z.d(_e,"y",function(){return Ne});function ie(le){return!le||typeof le!="string"?!0:le.trim().length===0}const J=/{(\d+)}/g;function P(le,...ve){return ve.length===0?le:le.replace(J,function(we,Ie){const We=parseInt(Ie,10);return isNaN(We)||We<0||We>=ve.length?we:ve[We]})}function X(le){return le.replace(/[<>&]/g,function(ve){switch(ve){case"<":return"<";case">":return">";case"&":return"&";default:return ve}})}function j(le){return le.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function U(le,ve=" "){const we=K(le,ve);return G(we,ve)}function K(le,ve){if(!le||!ve)return le;const we=ve.length;if(we===0||le.length===0)return le;let Ie=0;for(;le.indexOf(ve,Ie)===Ie;)Ie=Ie+we;return le.substring(Ie)}function G(le,ve){if(!le||!ve)return le;const we=ve.length,Ie=le.length;if(we===0||Ie===0)return le;let We=Ie,Ve=-1;for(;!(Ve=le.lastIndexOf(ve,We-1),Ve===-1||Ve+we!==We);){if(Ve===0)return"";We=Ve}return le.substring(0,We)}function r(le){return le.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function R(le){return le.replace(/\*/g,"")}function v(le,ve,we={}){if(!le)throw new Error("Cannot create regex from empty string");ve||(le=j(le)),we.wholeWord&&(/\B/.test(le.charAt(0))||(le="\\b"+le),/\B/.test(le.charAt(le.length-1))||(le=le+"\\b"));let Ie="";return we.global&&(Ie+="g"),we.matchCase||(Ie+="i"),we.multiline&&(Ie+="m"),we.unicode&&(Ie+="u"),new RegExp(le,Ie)}function m(le){if(le.source==="^"||le.source==="^$"||le.source==="$"||le.source==="^\\s*$")return!1;const ve=le.exec("");return!!(ve&&le.lastIndex===0)}function p(le){return(le.global?"g":"")+(le.ignoreCase?"i":"")+(le.multiline?"m":"")+(le.unicode?"u":"")}function h(le){return le.split(/\r\n|\r|\n/)}function l(le){for(let ve=0,we=le.length;ve=0;we--){const Ie=le.charCodeAt(we);if(Ie!==32&&Ie!==9)return we}return-1}function u(le,ve){return leve?1:0}function s(le,ve,we=0,Ie=le.length,We=0,Ve=ve.length){for(;weQe)return 1}const Ze=Ie-we,$e=Ve-We;return Ze<$e?-1:Ze>$e?1:0}function a(le,ve){return O(le,ve,0,le.length,0,ve.length)}function O(le,ve,we=0,Ie=le.length,We=0,Ve=ve.length){for(;we=128||Qe>=128)return s(le.toLowerCase(),ve.toLowerCase(),we,Ie,We,Ve);E(st)&&(st-=32),E(Qe)&&(Qe-=32);const nt=st-Qe;if(nt===0)continue;return nt}const Ze=Ie-we,$e=Ve-We;return Ze<$e?-1:Ze>$e?1:0}function E(le){return le>=97&&le<=122}function w(le){return le>=65&&le<=90}function D(le,ve){return le.length===ve.length&&O(le,ve)===0}function L(le,ve){const we=ve.length;return ve.length>le.length?!1:O(le,ve,0,we)===0}function A(le,ve){let we,Ie=Math.min(le.length,ve.length);for(we=0;we1){const Ie=le.charCodeAt(ve-2);if(x(Ie))return S(Ie,we)}return we}function B(le,ve){const we=se.getInstance(),Ie=ve,We=le.length,Ve=y(le,We,ve);ve+=Ve>=65536?2:1;let Ze=we.getGraphemeBreakType(Ve);for(;ve=65536?2:1,Ze=st}return ve-Ie}function F(le,ve){const we=se.getInstance(),Ie=ve,We=b(le,ve);ve-=We>=65536?2:1;let Ve=we.getGraphemeBreakType(We);for(;ve>0;){const Ze=b(le,ve),$e=we.getGraphemeBreakType(Ze);if(fe($e,Ve))break;ve-=Ze>=65536?2:1,Ve=$e}return Ie-ve}const _=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function M(le){return _.test(le)}const I=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function g(le){return I.test(le)}const H=/^[\t\n\r\x20-\x7E]*$/;function $(le){return H.test(le)}const ne=/[\u2028\u2029]/;function oe(le){return ne.test(le)}function Oe(le){for(let ve=0,we=le.length;ve=11904&&le<=55215||le>=63744&&le<=64255||le>=65281&&le<=65374}function Te(le){return le>=127462&&le<=127487||le===8986||le===8987||le===9200||le===9203||le>=9728&&le<=10175||le===11088||le===11093||le>=127744&&le<=128591||le>=128640&&le<=128764||le>=128992&&le<=129003||le>=129280&&le<=129535||le>=129648&&le<=129750}const Re=String.fromCharCode(65279);function Le(le){return!!(le&&le.length>0&&le.charCodeAt(0)===65279)}function de(le,ve=!1){return le?(ve&&(le=le.replace(/\\./g,"")),le.toLowerCase()!==le):!1}function he(le){const ve=90-65+1;return le=le%(2*ve),leve[3*Ie+1])Ie=2*Ie+1;else return ve[3*Ie+2];return 0}}se._INSTANCE=null;function De(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function Ne(le,ve){if(le===0)return 0;const we=Se(le,ve);if(we!==void 0)return we;const Ie=b(ve,le);return le-=Pe(Ie),le}function Se(le,ve){let we=b(ve,le);for(le-=Pe(we);je(we)||we===65039||we===8419;){if(le===0)return;we=b(ve,le),le-=Pe(we)}if(!Te(we))return;if(le>=0){const Ie=b(ve,le);Ie===8205&&(le-=Pe(Ie))}return le}function Pe(le){return le>=65536?2:1}function je(le){return 127995<=le&&le<=127999}},Ot1p:function(rt,_e,Z){"use strict";var ie=Z("2qtc"),J=Z("kLXV"),P=Z("rAM+"),X=Z("miYZ"),j=Z("tsqr"),U=Z("9og8"),K=Z("tJVT"),G=Z("jrin"),r=Z("WmNS"),R=Z.n(r),v=Z("q1tI"),m=Z.n(v),p=Z("VrN/"),h=Z.n(p),l=Z("bdgK"),f=Z("p77/"),o=Z("Bd2K"),u=Z("ELLl"),s=Z("19Vz"),a=Z("lZu9"),O=Z("+NIl"),E=Z("kSUc"),w=Z("9Bee"),D=function(Ce){var Ue=Ce.value,ze=Ue===void 0?"":Ue,lt=Ce.className,mt=Ce.showTextOnly,ft=Ce.showLines,wt=Ce.style,St=wt===void 0?{}:wt,dt=Object(v.useMemo)(function(){return""},[ze]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:dt}}))},L=Z("0Owb"),A=Z("dejd"),C=Z("C+DQ"),x=Z("1vsH"),c=Z("m3rI"),S=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function y(Ce){var Ue=Ce.onActionCallback,ze=Ce.title,lt=Ce.icon,mt=Ce.actionName,ft=Ce.className,wt=ft===void 0?"":ft,St=Ce.children;function dt(){Ue(mt)}return m.a.createElement("a",{title:ze,className:wt,onClick:dt},m.a.createElement("i",{className:"md-iconfont ".concat(lt)}),St)}var b=function(Ce){var Ue=Ce.watch,ze=Ce.showNullButton,lt=Ce.onActionCallback,mt=Ce.fullScreen,ft=Ce.insertTemp,wt=Ce.hidetoolBar,St=Ce.uuid,dt=Ce.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(x.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(x.F)("_educoder_session"),"&key=").concat(St,"&api=").concat(encodeURIComponent(c.a.PROXY_SERVER)));var Bt=[].concat(S,[{title:"".concat(Ue?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ue?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!wt&&Bt.map(function(Lt,qt){return m.a.createElement("li",{key:qt},Lt.actionName?m.a.createElement(y,Object(L.a)({},Lt,{onActionCallback:lt})):m.a.createElement("span",{className:"v-line"}))}),ze?m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:lt},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ft&&m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ft),onActionCallback:lt},m.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),m.a.createElement("li",{className:"btn-full-screen"},m.a.createElement(y,{icon:"".concat(mt?"icon-shrink":"icon-enlarge"),title:mt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:lt})))},B=Z("M8RZ"),F=Z("+L6B"),_=Z("2/Rp"),M=Z("y8nQ"),I=Z("Vl3Y"),g=Z("5NDa"),H=Z("5rEg"),$={labelCol:{span:4},wrapperCol:{span:20}},ne=function(Ce){var Ue=Ce.callback,ze=Ce.onCancel;function lt(mt){Ue(mt)}return m.a.createElement(I.a,Object(L.a)({},$,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:lt}),m.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(H.a,null)),m.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(H.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(_.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(_.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))},oe=Z("7ahc"),Oe=Z("HmJG"),ye=Z("BjJ7"),Te=I.a.useForm,Re={width:280,marginRight:10},Le={labelCol:{span:5},wrapperCol:{span:19}},de=function(Ce){var Ue=Ce.callback,ze=Ce.onCancel,lt=Te(),mt=Object(K.a)(lt,1),ft=mt[0];function wt(Bt){Ue(Bt)}function St(Bt,Lt){if(Bt.status===-1){j.b.error(Bt.message);return}ft.setFieldsValue({src:"/api/attachments/".concat(Bt.id),type:Lt.type})}function dt(Bt){var Lt=Bt.target.files[0];re(Lt,St)}return m.a.createElement(I.a,Object(L.a)({form:ft},Le,{className:"upload-image-panel",onFinish:wt}),m.a.createElement(I.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(I.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(H.a,{style:Re})),m.a.createElement(he,{onFileChange:dt}))),m.a.createElement(I.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(H.a,{style:{width:264}})),m.a.createElement(I.a.Item,{style:{textAlign:"right"}},m.a.createElement(_.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(_.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))};function he(Ce){var Ue=Ce.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:Ue}))}function re(Ce,Ue){if(!Ce)throw new String("\u6CA1\u6709\u6587\u4EF6");var ze=new FormData;ze.append("editormd-image-file",Ce),ze.append("file_param_name","editormd-image-file"),ze.append("byxhr","true");var lt=new window.XMLHttpRequest;lt.withCredentials=!0,lt.addEventListener("load",function(mt){Ue(JSON.parse(mt.target.responseText),Ce)},!1),lt.addEventListener("error",function(mt){console.error(mt)},!1),lt.open("POST","".concat(ye.a,"/api/attachments.json")),lt.send(ze)}var fe=Z("giR+"),se=Z("fyUT"),De=Z("7Kak"),Ne=Z("9yH6"),Se=Ne.a.Group,Pe={margin:"0 8px"},je=function(Ce){var Ue=Ce.callback,ze=Ce.onCancel;function lt(mt){Ue(mt)}return m.a.createElement(I.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:lt},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:Pe},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:Pe},"\u884C\u6570"),m.a.createElement(I.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(se.a,null)),m.a.createElement("span",{style:Pe},"\u5217\u6570"),m.a.createElement(I.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(se.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:Pe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(I.a.Item,{name:"align"},m.a.createElement(Se,null,m.a.createElement(Ne.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(Ne.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(Ne.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(Ne.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(_.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(_.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))},le=Z("ErOA"),ve=Z("7Cbv"),we="link",Ie="upload-image",We="code-block",Ve="add-table",Ze="------------",$e={default:Ze,left:":".concat(Ze),center:":".concat(Ze,":"),right:"".concat(Ze,":")},st=Z("9VGf"),Qe,nt;function Fe(){}var ot=0,tt=1e4,Be="\u2581",He=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Ae(Ce){return/^\d+$/.test(Ce)?"".concat(Ce,"px"):Ce}var me=navigator.platform.toUpperCase().indexOf("MAC")>=0,xe=me?"Cmd":"Ctrl",ae=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],ue=(Qe={},Object(G.a)(Qe,xe+"-B","bold"),Object(G.a)(Qe,xe+"-I","italic"),Qe),ce=(nt={},Object(G.a)(nt,we,"\u6DFB\u52A0\u94FE\u63A5"),Object(G.a)(nt,We,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(G.a)(nt,Ie,"\u6DFB\u52A0\u6587\u4EF6"),Object(G.a)(nt,Ve,"\u6DFB\u52A0\u8868\u683C"),nt),ge=_e.a=function(Ce){var Ue=Ce.defaultValue,ze=Ue===void 0?"":Ue,lt=Ce.onChange,mt=Ce.width,ft=mt===void 0?"100%":mt,wt=Ce.height,St=wt===void 0?400:wt,dt=Ce.miniToolbar,Bt=dt===void 0?!1:dt,Lt=Ce.isFocus,qt=Lt===void 0?!1:Lt,Zt=Ce.watch,It=Ce.insertTemp,Cr=Ce.mode,Kr=Cr===void 0?"markdown":Cr,yt=Ce.id,Lr=yt===void 0?"markdown-editor-id":yt,bt=Ce.showResizeBar,xt=bt===void 0?!1:bt,Ft=Ce.noStorage,tr=Ft===void 0?!1:Ft,dr=Ce.showNullButton,Pt=dr===void 0?!1:dr,ct=Ce.hidetoolBar,Br=ct===void 0?!1:ct,Vt=Ce.fullScreen,Jt=Vt===void 0?!1:Vt,Ot=Ce.onBlur,lr=Ce.onCMBeforeChange,Ir=Ce.onFullScreen,Xr=Ce.className,Je=Xr===void 0?"":Xr,Ct=Ce.disablePaste,mn=Ct===void 0?!1:Ct,gn=Ce.placeholder,vn=gn===void 0?"":gn,yn=Ce.values,Y=yn===void 0?"":yn,T=Object(v.useState)(null),k=Object(K.a)(T,2),W=k[0],ee=k[1],V=Object(v.useState)(ze),Ee=Object(K.a)(V,2),Ke=Ee[0],et=Ee[1],pt=Object(v.useState)(Zt),Ye=Object(K.a)(pt,2),_t=Ye[0],jt=Ye[1],$t=Object(v.useState)(Jt),jr=Object(K.a)($t,2),Er=jr[0],xr=jr[1],Zr=Object(v.useState)(""),Dn=Object(K.a)(Zr,2),cr=Dn[0],zr=Dn[1],un=Object(v.useState)(0),hn=Object(K.a)(un,2),Hr=hn[0],kn=hn[1],bn=Object(v.useState)(St),zn=Object(K.a)(bn,2),Vn=zn[0],Qr=zn[1],$r=Object(v.useState)(!1),_n=Object(K.a)($r,2),di=_n[0],En=_n[1],nr=Object(v.useRef)(Object(ve.a)()),Ht=Object(v.useRef)(!1),yr=Object(v.useRef)(),kt=Object(v.useRef)(),ar=Object(v.useRef)(),Kt=Object(v.useRef)(),nn=Object(v.useRef)(),fr=function(){var gt=Object(U.a)(R.a.mark(function At(){var Et,Dt;return R.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return Yt.next=2,Object(le.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:nr.current}});case 2:Dt=Yt.sent,Dt!=null&&(Et=Dt.attachments)!==null&&Et!==void 0&&Et.length&&(console.log("cm:",W,kt),Dt.attachments.map(function(Nt){Nt.content_type.indexOf("image")>-1?W.replaceSelection(".concat(Nt.content_type,")")):Nt.content_type.indexOf("video")>-1?W.replaceSelection('')):Nt.content_type.indexOf("pdf")>-1?W.replaceSelection('').concat(Nt.name,"")):W.replaceSelection("[".concat(Nt.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Nt.id,"?type=").concat(Nt.content_type,")"))}));case 4:case"end":return Yt.stop()}},At)}));return function(){return gt.apply(this,arguments)}}();Object(v.useEffect)(function(){et(Y),W==null||W.setValue(Y)},[Y]),Object(v.useEffect)(function(){Ir==null||Ir(Er)},[Er]),Object(v.useEffect)(function(){if(kt.current){var gt=h.a.fromTextArea(kt.current,{mode:Kr,lineNumbers:!Bt,lineWrapping:!0,value:ze,autoCloseTags:!0,autoCloseBrackets:!0});qt&>.focus();function At(Et,Dt){if(mn){Dt.preventDefault();return}var Ut=Dt.clipboardData;if(Ut){var Yt=Ut.types.toString(),Nt=Ut.items;if(Yt==="Files"||Ut.types.indexOf("Files")>-1){if(Dt.preventDefault(),Kr=="stex")return;try{var ur,Dr=Nt[1];((ur=Nt[0])===null||ur===void 0?void 0:ur.kind)==="file"&&(Dr=Nt[0]);var Mt=Dr.getAsFile(),dn=Mt.name.split(".").pop();re(Mt,function(Wt){if(Wt.id){var kr,Tr,Jr;(Mt==null||((kr=Mt.type)===null||kr===void 0)?void 0:kr.indexOf("image"))>-1?gt.replaceSelection(".concat(Wt.content_type,")")):(Mt==null||((Tr=Mt.type)===null||Tr===void 0)?void 0:Tr.indexOf("video"))>-1?gt.replaceSelection('')):(Mt==null||((Jr=Mt.type)===null||Jr===void 0)?void 0:Jr.indexOf("pdf"))>-1?gt.replaceSelection('').concat(Mt.name,"")):ae.includes(dn)?gt.replaceSelection('').concat(Mt.name,"")):gt.replaceSelection("[".concat(Mt.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})}catch(Wt){j.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return gt.on("paste",At),gt.on("dragleave",function(Et,Dt){ar.current.classList.remove("mouse-hover-md")}),gt.on("dragover",function(Et,Dt){ar.current.classList.add("mouse-hover-md")}),gt.on("drop",function(Et,Dt){ar.current.classList.add("mouse-hover-md");var Ut;if(Ut=Dt.dataTransfer.files,Ut.length>0){Dt.preventDefault(),Dt.stopPropagation();for(var Yt=function(Dr){var Mt=Ut[Dr],dn=Mt.name.split(".").pop();re(Mt,function(Wt){if(Wt.id){var kr,Tr,Jr;(Mt==null||((kr=Mt.type)===null||kr===void 0)?void 0:kr.indexOf("image"))>-1?gt.replaceSelection(".concat(Wt.content_type,")")):(Mt==null||((Tr=Mt.type)===null||Tr===void 0)?void 0:Tr.indexOf("video"))>-1?gt.replaceSelection('')):(Mt==null||((Jr=Mt.type)===null||Jr===void 0)?void 0:Jr.indexOf("pdf"))>-1?gt.replaceSelection('').concat(Mt.name,"")):ae.includes(dn)?gt.replaceSelection('').concat(Mt.name,"")):gt.replaceSelection("[".concat(Mt.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})},Nt=0;Nt0||Nt.target.offsetWidth>0)&&(Ar(),W.setSize("100%","100%"),W.refresh())}}catch(ur){Ut.e(ur)}finally{Ut.f()}});return Et.observe(kt.current.parentElement),Et}if(W){var At=gt();return function(){At.unobserve(kt.current.parentElement)}}},[W,Ar]),Object(v.useEffect)(function(){if(W){for(var gt=[],At=function(){var Nt=Dt[Et];Ut=Object(K.a)(Nt,2);var ur=Ut[0],Dr=Ut[1],Mt=Object(G.a)({},ur,function(){Yn(Dr)});gt.push(Mt),W.addKeyMap(Mt)},Et=0,Dt=Object.entries(ue);Et0){var gt=new Date().getTime(),At=window.sessionStorage.getItem(Lr);gt>=Hr+tt&&(!At||At!==Ke)&&(window.sessionStorage.setItem(Lr,Ke),En(!0))}},tt),Object(v.useEffect)(function(){jt(Zt)},[W,Zt]),Object(v.useEffect)(function(){W&&(qt&&W.focus())},[W,qt]),Object(v.useEffect)(function(){if(_t&&W){var gt=W.getScrollerElement();function At(Et){var Dt=Et.target;if(nn.current){var Ut=Dt.scrollTop/Dt.scrollHeight;nn.current.scrollTop=nn.current.scrollHeight*Ut}}return gt.addEventListener("scroll",At),function(){gt.removeEventListener("scroll",At)}}},[W,_t]),Object(v.useEffect)(function(){if(W&&lr){function gt(At,Et){lr(At,Et)}return W.on("beforeChange",gt),function(){W.off("beforeChange",gt)}}},[W,lr]),Object(v.useEffect)(function(){if(W&&Ot){function gt(){Ot(W.getValue())}return W.on("blur",gt),function(){W.off("blur",gt)}}},[W,Ot]),Object(v.useEffect)(function(){if(W){function gt(At){var Et=At.getValue();et(Et),kn(new Date().getTime()),At.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),lt&<(Et)}return W.on("change",gt),function(){W.off("change",gt)}}},[W,lt]),Object(v.useEffect)(function(){W&&(ze==null?(W.setValue(""),et("")):ze!==W.getValue()&&(W.setValue(ze),et(ze),W.setCursor(W.lineCount(),0)))},[W,ze]);var Yn=Object(v.useCallback)(function(gt){var At=W.getCursor(),Et=W.getSelection(),Dt=Et.split(`
`);switch(gt){case"bold":return W.replaceSelection("**"+Et+"**"),Et===""&&W.setCursor(At.line,At.ch+2),W.focus();case"italic":return W.replaceSelection("*"+Et+"*"),Et===""&&W.setCursor(At.line,At.ch+1),W.focus();case"code":return W.replaceSelection("`"+Et+"`"),Et===""&&W.setCursor(At.line,At.ch+1),W.focus();case"inline-latex":return W.replaceSelection("`$$"+Et+"$$`"),Et===""&&W.setCursor(At.line,At.ch+3),W.focus();case"latex":return W.replaceSelection("```latex\n"+Et+"\n```"),W.setCursor(At.line+1,Et.length+1),W.focus();case"line-break":return W.replaceSelection(`
`),W.focus();case"list-ul":return Et===""?W.replaceSelection("- "+Et):W.replaceSelection(Dt.map(function(Ut){return Ut===""?"":"- ".concat(Ut)}).join(`
`)),W.focus();case"list-ol":return Et===""?W.replaceSelection("1. "+Et):W.replaceSelection(Dt.map(function(Ut,Yt){return Ut===""?"":"".concat(Yt+1,". ").concat(Ut)}).join(`
`)),W.focus();case"add-null-ch":return Et===""&&W.setCursor(At.line,At.ch+1),W.replaceSelection(Be),W.focus();case"inster-template-1":return Et===""&&W.setCursor(At.line,At.ch),W.replaceSelection(He),W.focus();case"eraser":return W.setValue(""),W.focus();case"trigger-watch":return jt(!_t),W.focus();case"trigger-full-screen":return xr(!Er),W.focus();case we:zr(we);return;case We:zr(We);return;case Ie:zr(Ie);return;case Ve:zr(Ve);return;default:throw new Error}},[W,_t,Er]),xn=Object(v.useCallback)(function(gt){zr("");switch(cr){case we:var At=gt.title,Et=gt.link;return W.replaceSelection("[".concat(At,"](").concat(Et,")")),W.focus();case We:var Dt=gt.language,Ut=gt.content;return W.replaceSelection(["```"+Dt,Ut,"```"].join(`
`)),W.focus();case Ie:var Yt=gt.src,Nt=gt.alt;return Nt?W.replaceSelection(".concat(Yt,' "').concat(Nt,'" )')):W.replaceSelection("")),W.focus();case Ve:for(var ur=gt.row,Dr=gt.col,Mt=gt.align,dn=`
`,Wt=0;Wt300&&(ur=300);var Dr=St+ur+"px";Qr(Dr)}}return gt.addEventListener("mousedown",Dt),document.addEventListener("mousemove",Yt),document.addEventListener("mouseup",Ut),function(){gt.removeEventListener("mousedown",Dt),document.removeEventListener("mousemove",Yt),document.removeEventListener("mouseup",Ut)}}},[W,Kt]),Object(v.useEffect)(function(){Qr(St)},[St]);var an=Ae(ft),fi=Ae(Vn),qr={width:an,height:fi},pi=Object(v.useMemo)(function(){if(Hr){var gt=new Date(Hr),At=gt.getHours(),Et=gt.getMinutes(),Dt=gt.getSeconds();return At=At<10?"0"+At:At,Et=Et<10?"0"+Et:Et,Dt=Dt<10?"0"+Dt:Dt,"".concat(At,":").concat(Et,":").concat(Dt)}return 0},[Hr]);function ji(){window.sessionStorage.removeItem(Lr),En(!1),kn(0)}function Mn(){En(!1),kn(0),W.setValue(window.sessionStorage.getItem(Lr))}function ua(gt,At){var Et=W.getValue();Et=Et.replace(gt,At),et(Et),W==null||W.setValue(Et)}return m.a.createElement(v.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:ar},m.a.createElement("div",{className:"markdown-editor-container ".concat(Je," ").concat(_t?"on-preview":""," ").concat(Bt?"mini":""," ").concat(Er?"full-screen":""),style:qr},m.a.createElement(b,{insertTemp:It,watch:_t,fullScreen:Er,showNullButton:Pt,onActionCallback:Yn,hidetoolBar:Br,uuid:nr.current,setOpenPhones:function(){Ht.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:kt,placeholder:vn})),_t?m.a.createElement("div",{ref:nn,className:"preview-container"},Kr==="stex"&&m.a.createElement(D,{value:Ke}),Kr!=="stex"&&m.a.createElement(w.a,{edit:!0,value:Ke,replaces:ua})):null))),xt?m.a.createElement("a",{ref:Kt,className:"editor-resize"}):null,m.a.createElement(B.a,null,ce[cr]?m.a.createElement(J.a,{centered:!0,title:ce[cr],visible:!0,onCancel:Tn,footer:null,className:"markdown-popup-form"},ci):null))}},SJMd:function(rt,_e){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var Z,ie,J,P=!1,X,j;window.PR_SHOULD_USE_CONTINUATION=!0;var U,K;(function(){var G=window,r=["break,continue,do,else,for,if,return,while"],R=[r,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],v=[R,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[v,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],p=[v,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],h=[v,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],l="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",f=[v,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],o="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",u=[r,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],s=[r,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],a=[r,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],O=[m,h,p,f,o,u,s,a],E=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,w="str",D="kwd",L="com",A="typ",C="lit",x="pun",c="pln",S="tag",y="dec",b="src",B="atn",F="atv",_="nocode",M="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function I(Se){for(var Pe=0,je=!1,le=!1,ve=0,we=Se.length;ve122||(ae<65||xe>90||ot.push([Math.max(65,xe)|32,Math.min(ae,90)|32]),ae<97||xe>122||ot.push([Math.max(97,xe)&~32,Math.min(ae,122)&~32]))}}ot.sort(function(Ce,Ue){return Ce[0]-Ue[0]||Ue[1]-Ce[1]});for(var ue=[],ce=[],He=0;Hege[0]&&(ge[1]+1>ge[0]&&Be.push("-"),Be.push(Ze(ge[1])))}return Be.push("]"),Be.join("")}function st(nt){for(var Fe=nt.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),ot=Fe.length,tt=[],Be=0,He=0;Be=2&&xe==="["?Fe[Be]=$e(Ae):xe!=="\\"&&(Fe[Be]=Ae.replace(/[a-zA-Z]/g,function(ce){var ge=ce.charCodeAt(0);return"["+String.fromCharCode(ge&~32,ge|32)+"]"}))}return Fe.join("")}for(var Qe=[],ve=0,we=Se.length;ve=0;)je[Qe.charAt(nt)]=st;var Fe=st[1],ot=""+Fe;Ve.hasOwnProperty(ot)||(We.push(Fe),Ve[ot]=null)}We.push(/[\0-\uffff]/),le=I(We)})();var ve=Pe.length,we=function(Ie){for(var We=Ie.sourceCode,Ve=Ie.basePos,Ze=Ie.sourceNode,$e=[Ve,c],st=0,Qe=We.match(le)||[],nt={},Fe=0,ot=Qe.length;Fe=5&&Be.substring(0,5)==="lang-",Ae&&!(He&&typeof He[1]=="string")&&(Ae=!1,Be=b),Ae||(nt[tt]=Be)}var ae=st;if(st+=tt.length,!Ae)$e.push(Ve+ae,Be);else{var ue=He[1],ce=tt.indexOf(ue),ge=ce+ue.length;He[2]&&(ge=tt.length-He[2].length,ce=ge-ue.length);var Ce=Be.substring(5);H(Ze,Ve+ae,tt.substring(0,ce),we,$e),H(Ze,Ve+ae+ce,ue,he(Ce,ue),$e),H(Ze,Ve+ae+ge,tt.substring(ge),we,$e)}}Ie.decorations=$e};return we}function Oe(Se){var Pe=[],je=[];Se.tripleQuotedStrings?Pe.push([w,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Se.multiLineStrings?Pe.push([w,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Pe.push([w,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Se.verbatimStrings&&je.push([w,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var le=Se.hashComments;le&&(Se.cStyleComments?(le>1?Pe.push([L,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Pe.push([L,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),je.push([w,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Pe.push([L,/^#[^\r\n]*/,null,"#"])),Se.cStyleComments&&(je.push([L,/^\/\/[^\r\n]*/,null]),je.push([L,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ve=Se.regexLiterals;if(ve){var we=ve>1?"":`
\r`,Ie=we?".":"[\\S\\s]",We="/(?=[^/*"+we+"])(?:[^/\\x5B\\x5C"+we+"]|\\x5C"+Ie+"|\\x5B(?:[^\\x5C\\x5D"+we+"]|\\x5C"+Ie+")*(?:\\x5D|$))+/";je.push(["lang-regex",RegExp("^"+M+"("+We+")")])}var Ve=Se.types;Ve&&je.push([A,Ve]);var Ze=(""+Se.keywords).replace(/^ | $/g,"");Ze.length&&je.push([D,new RegExp("^(?:"+Ze.replace(/[\s,]+/g,"|")+")\\b"),null]),Pe.push([c,/^\s+/,null,` \r
\xA0`]);var $e="^.[^\\s\\w.$@'\"`/\\\\]*";return Se.regexLiterals&&($e+="(?!s*/)"),je.push([C,/^@[a-z_$][a-z_$@0-9]*/i,null],[A,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[a-z_$][a-z_$@0-9]*/i,null],[C,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[c,/^\\[\s\S]?/,null],[x,new RegExp($e),null]),oe(Pe,je)}var ye=Oe({keywords:O,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Te(Se,Pe,je){for(var le=/(?:^|\s)nocode(?:\s|$)/,ve=/\r\n?|\n/,we=Se.ownerDocument,Ie=we.createElement("li");Se.firstChild;)Ie.appendChild(Se.firstChild);var We=[Ie];function Ve(Fe){var ot=Fe.nodeType;if(ot==1&&!le.test(Fe.className))if(Fe.nodeName==="br")Ze(Fe),Fe.parentNode&&Fe.parentNode.removeChild(Fe);else for(var tt=Fe.firstChild;tt;tt=tt.nextSibling)Ve(tt);else if((ot==3||ot==4)&&je){var Be=Fe.nodeValue,He=Be.match(ve);if(He){var Ae=Be.substring(0,He.index);Fe.nodeValue=Ae;var me=Be.substring(He.index+He[0].length);if(me){var xe=Fe.parentNode;xe.insertBefore(we.createTextNode(me),Fe.nextSibling)}Ze(Fe),Ae||Fe.parentNode.removeChild(Fe)}}}function Ze(Fe){for(;!Fe.nextSibling;)if(Fe=Fe.parentNode,!Fe)return;function ot(He,Ae){var me=Ae?He.cloneNode(!1):He,xe=He.parentNode;if(xe){var ae=ot(xe,1),ue=He.nextSibling;ae.appendChild(me);for(var ce=ue;ce;ce=ue)ue=ce.nextSibling,ae.appendChild(ce)}return me}for(var tt=ot(Fe.nextSibling,0),Be;(Be=tt.parentNode)&&Be.nodeType===1;)tt=Be;We.push(tt)}for(var $e=0;$e=xe&&(Ve+=2),we>=ae&&(st+=2)}}finally{Be&&(Be.style.display=He)}}var Le={};function de(Se,Pe){for(var je=Pe.length;--je>=0;){var le=Pe[je];Le.hasOwnProperty(le)?G.console&&console.warn("cannot override language handler %s",le):Le[le]=Se}}function he(Se,Pe){return Se&&Le.hasOwnProperty(Se)||(Se=/^\s*]*(?:>|$)/],[L,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[x,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^