(window.webpackJsonp=window.webpackJsonp||[]).push([[165,5,7],{"+NIl":function(mt,Ee,Q){(function(ne){ne(Q("VrN/"))})(function(ne){"use strict";ne.defineMode("stex",function($,O){"use strict";function V(m,p){m.cmdState.push(p)}function _(m){return m.cmdState.length>0?m.cmdState[m.cmdState.length-1]:null}function P(m){var p=m.cmdState.pop();p&&p.closeBracket()}function F(m){for(var p=m.cmdState,v=p.length-1;v>=0;v--){var a=p[v];if(a.name=="DEFAULT")continue;return a}return{styleIdentifier:function(){return null}}}function N(m,p,v){return function(){this.name=m,this.bracketNo=0,this.style=p,this.styles=v,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var M={};M.importmodule=N("importmodule","tag",["string","builtin"]),M.documentclass=N("documentclass","tag",["","atom"]),M.usepackage=N("usepackage","tag",["atom"]),M.begin=N("begin","tag",["atom"]),M.end=N("end","tag",["atom"]),M.label=N("label","tag",["atom"]),M.ref=N("ref","tag",["atom"]),M.eqref=N("eqref","tag",["atom"]),M.cite=N("cite","tag",["atom"]),M.bibitem=N("bibitem","tag",["atom"]),M.Bibitem=N("Bibitem","tag",["atom"]),M.RBibitem=N("RBibitem","tag",["atom"]),M.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function k(m,p){m.f=p}function d(m,p){var v;if(m.match(/^\\[a-zA-Z@]+/)){var a=m.current().slice(1);return v=M.hasOwnProperty(a)?M[a]:M.DEFAULT,v=new v,V(p,v),k(p,S),v.style}if(m.match(/^\\[$&%#{}_]/))return"tag";if(m.match(/^\\[,;!\/\\]/))return"tag";if(m.match("\\["))return k(p,function(s,l){return h(s,l,"\\]")}),"keyword";if(m.match("\\("))return k(p,function(s,l){return h(s,l,"\\)")}),"keyword";if(m.match("$$"))return k(p,function(s,l){return h(s,l,"$$")}),"keyword";if(m.match("$"))return k(p,function(s,l){return h(s,l,"$")}),"keyword";var i=m.next();if(i=="%")return m.skipToEnd(),"comment";if(i=="}"||i=="]"){if(v=_(p),v)v.closeBracket(i),k(p,S);else return"error";return"bracket"}else return i=="{"||i=="["?(v=M.DEFAULT,v=new v,V(p,v),"bracket"):/\d/.test(i)?(m.eatWhile(/[\w.%]/),"atom"):(m.eatWhile(/[\w\-_]/),v=F(p),v.name=="begin"&&(v.argument=m.current()),v.styleIdentifier())}function h(m,p,v){if(m.eatSpace())return null;if(v&&m.match(v))return k(p,d),"keyword";if(m.match(/^\\[a-zA-Z@]+/))return"tag";if(m.match(/^[a-zA-Z]+/))return"variable-2";if(m.match(/^\\[$&%#{}_]/))return"tag";if(m.match(/^\\[,;!\/]/))return"tag";if(m.match(/^[\^_&]/))return"tag";if(m.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(m.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var a=m.next();return a=="{"||a=="}"||a=="["||a=="]"||a=="("||a==")"?"bracket":a=="%"?(m.skipToEnd(),"comment"):"error"}function S(m,p){var v=m.peek(),a;return v=="{"||v=="["?(a=_(p),a.openBracket(v),m.eat(v),k(p,d),"bracket"):/[ \t\r]/.test(v)?(m.eat(v),null):(k(p,d),P(p),d(m,p))}return{startState:function(){var m=O.inMathMode?function(p,v){return h(p,v)}:d;return{cmdState:[],f:m}},copyState:function(m){return{cmdState:m.cmdState.slice(),f:m.f}},token:function(m,p){return p.f(m,p)},blankLine:function(m){m.f=d,m.cmdState.length=0},lineComment:"%"}}),ne.defineMIME("text/x-stex","stex"),ne.defineMIME("text/x-latex","stex")})},"+ua5":function(mt,Ee,Q){},"/cxE":function(mt,Ee,Q){"use strict";Q.d(Ee,"e",function(){return O}),Q.d(Ee,"f",function(){return V}),Q.d(Ee,"g",function(){return _}),Q.d(Ee,"d",function(){return F}),Q.d(Ee,"a",function(){return N}),Q.d(Ee,"b",function(){return M}),Q.d(Ee,"c",function(){return k});var ne=function(){function d(){this.listeners=[],this.unexpectedErrorHandler=function(h){setTimeout(function(){throw h.stack?new Error(h.message+`
`+h.stack):h},0)}}return d.prototype.emit=function(h){this.listeners.forEach(function(S){S(h)})},d.prototype.onUnexpectedError=function(h){this.unexpectedErrorHandler(h),this.emit(h)},d.prototype.onUnexpectedExternalError=function(h){this.unexpectedErrorHandler(h)},d}(),$=new ne;function O(d){F(d)||$.onUnexpectedError(d);return}function V(d){F(d)||$.onUnexpectedExternalError(d);return}function _(d){if(d instanceof Error){var h=d.name,S=d.message,m=d.stacktrace||d.stack;return{$isError:!0,name:h,message:S,stack:m}}return d}var P="Canceled";function F(d){return d instanceof Error&&d.name===P&&d.message===P}function N(){var d=new Error(P);return d.name=d.message,d}function M(d){return d?new Error("Illegal argument: "+d):new Error("Illegal argument")}function k(d){return d?new Error("Illegal state: "+d):new Error("Illegal state")}},"19Vz":function(mt,Ee,Q){(function(ne){ne(Q("VrN/"))})(function(ne){ne.defineOption("placeholder","",function(N,M,k){var d=k&&k!=ne.Init;if(M&&!d)N.on("blur",_),N.on("change",P),N.on("swapDoc",P),ne.on(N.getInputField(),"compositionupdate",N.state.placeholderCompose=function(){V(N)}),P(N);else if(!M&&d){N.off("blur",_),N.off("change",P),N.off("swapDoc",P),ne.off(N.getInputField(),"compositionupdate",N.state.placeholderCompose),$(N);var h=N.getWrapperElement();h.className=h.className.replace(" CodeMirror-empty","")}M&&!N.hasFocus()&&_(N)});function $(N){N.state.placeholder&&(N.state.placeholder.parentNode.removeChild(N.state.placeholder),N.state.placeholder=null)}function O(N){$(N);var M=N.state.placeholder=document.createElement("pre");M.style.cssText="height: 0; overflow: visible",M.style.direction=N.getOption("direction"),M.className="CodeMirror-placeholder CodeMirror-line-like";var k=N.getOption("placeholder");typeof k=="string"&&(k=document.createTextNode(k)),M.appendChild(k),N.display.lineSpace.insertBefore(M,N.display.lineSpace.firstChild)}function V(N){setTimeout(function(){var M=!1,k=N.getInputField();k.nodeName=="TEXTAREA"?M=!k.value:N.lineCount()==1&&(M=!/[^\u200b]/.test(k.querySelector(".CodeMirror-line").textContent)),M?O(N):$(N)},20)}function _(N){F(N)&&O(N)}function P(N){var M=N.getWrapperElement(),k=F(N);M.className=M.className.replace(" CodeMirror-empty","")+(k?" CodeMirror-empty":""),k?O(N):$(N)}function F(N){return N.lineCount()===1&&N.getLine(0)===""}})},"1eCo":function(mt,Ee,Q){(function(ne){ne(Q("VrN/"))})(function(ne){"use strict";var $={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},O={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ne.defineMode("xml",function(V,_){var P=V.indentUnit,F={},N=_.htmlMode?$:O;for(var M in N)F[M]=N[M];for(var M in _)F[M]=_[M];var k,d;function h(u,L){function x(W){return L.tokenize=W,W(u,L)}var A=u.next();if(A=="<")return u.eat("!")?u.eat("[")?u.match("CDATA[")?x(p("atom","]]>")):null:u.match("--")?x(p("comment","-->")):u.match("DOCTYPE",!0,!0)?(u.eatWhile(/[\w\._\-]/),x(v(1))):null:u.eat("?")?(u.eatWhile(/[\w\._\-]/),L.tokenize=p("meta","?>"),"meta"):(k=u.eat("/")?"closeTag":"openTag",L.tokenize=S,"tag bracket");if(A=="&"){var I;return u.eat("#")?u.eat("x")?I=u.eatWhile(/[a-fA-F\d]/)&&u.eat(";"):I=u.eatWhile(/[\d]/)&&u.eat(";"):I=u.eatWhile(/[\w\.\-:]/)&&u.eat(";"),I?"atom":"error"}else return u.eatWhile(/[^&<]/),null}h.isInText=!0;function S(u,L){var x=u.next();if(x==">"||x=="/"&&u.eat(">"))return L.tokenize=h,k=x==">"?"endTag":"selfcloseTag","tag bracket";if(x=="=")return k="equals",null;if(x=="<"){L.tokenize=h,L.state=l,L.tagName=L.tagStart=null;var A=L.tokenize(u,L);return A?A+" tag error":"tag error"}else return/[\'\"]/.test(x)?(L.tokenize=m(x),L.stringStartCol=u.column(),L.tokenize(u,L)):(u.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function m(u){var L=function(x,A){for(;!x.eol();)if(x.next()==u){A.tokenize=S;break}return"string"};return L.isInAttribute=!0,L}function p(u,L){return function(x,A){for(;!x.eol();){if(x.match(L)){A.tokenize=h;break}x.next()}return u}}function v(u){return function(L,x){for(var A;(A=L.next())!=null;){if(A=="<")return x.tokenize=v(u+1),x.tokenize(L,x);if(A==">")if(u==1){x.tokenize=h;break}else return x.tokenize=v(u-1),x.tokenize(L,x)}return"meta"}}function a(u,L,x){this.prev=u.context,this.tagName=L,this.indent=u.indented,this.startOfLine=x,(F.doNotIndent.hasOwnProperty(L)||u.context&&u.context.noIndent)&&(this.noIndent=!0)}function i(u){u.context&&(u.context=u.context.prev)}function s(u,L){for(var x;;){if(!u.context)return;if(x=u.context.tagName,!F.contextGrabbers.hasOwnProperty(x)||!F.contextGrabbers[x].hasOwnProperty(L))return;i(u)}}function l(u,L,x){return u=="openTag"?(x.tagStart=L.column(),C):u=="closeTag"?g:l}function C(u,L,x){return u=="word"?(x.tagName=L.current(),d="tag",w):F.allowMissingTagName&&u=="endTag"?(d="tag bracket",w(u,L,x)):(d="error",C)}function g(u,L,x){if(u=="word"){var A=L.current();return x.context&&x.context.tagName!=A&&F.implicitlyClosed.hasOwnProperty(x.context.tagName)&&i(x),x.context&&x.context.tagName==A||F.matchClosing===!1?(d="tag",y):(d="tag error",R)}else return F.allowMissingTagName&&u=="endTag"?(d="tag bracket",y(u,L,x)):(d="error",R)}function y(u,L,x){return u!="endTag"?(d="error",y):(i(x),l)}function R(u,L,x){return d="error",y(u,L,x)}function w(u,L,x){if(u=="word")return d="attribute",T;if(u=="endTag"||u=="selfcloseTag"){var A=x.tagName,I=x.tagStart;return x.tagName=x.tagStart=null,u=="selfcloseTag"||F.autoSelfClosers.hasOwnProperty(A)?s(x,A):(s(x,A),x.context=new a(x,A,I==x.indented)),l}return d="error",w}function T(u,L,x){return u=="equals"?b:(F.allowMissing||(d="error"),w(u,L,x))}function b(u,L,x){return u=="string"?f:u=="word"&&F.allowUnquoted?(d="string",w):(d="error",w(u,L,x))}function f(u,L,x){return u=="string"?f:w(u,L,x)}return{startState:function(u){var L={tokenize:h,state:l,indented:u||0,tagName:null,tagStart:null,context:null};return u!=null&&(L.baseIndent=u),L},token:function(u,L){if(!L.tagName&&u.sol()&&(L.indented=u.indentation()),u.eatSpace())return null;k=null;var x=L.tokenize(u,L);return(x||k)&&x!="comment"&&(d=null,L.state=L.state(k||x,u,L),d&&(x=d=="error"?x+" error":d)),x},indent:function(u,L,x){var A=u.context;if(u.tokenize.isInAttribute)return u.tagStart==u.indented?u.stringStartCol+1:u.indented+P;if(A&&A.noIndent)return ne.Pass;if(u.tokenize!=S&&u.tokenize!=h)return x?x.match(/^(\s*)/)[0].length:0;if(u.tagName)return F.multilineTagIndentPastTag!==!1?u.tagStart+u.tagName.length+2:u.tagStart+P*(F.multilineTagIndentFactor||1);if(F.alignCDATA&&/$/,blockCommentStart:"",configuration:F.htmlMode?"html":"xml",helperType:F.htmlMode?"html":"xml",skipAttribute:function(u){u.state==b&&(u.state=w)},xmlCurrentTag:function(u){return u.tagName?{name:u.tagName,close:u.type=="closeTag"}:null},xmlCurrentContext:function(u){for(var L=[],x=u.context;x;x=x.prev)x.tagName&&L.push(x.tagName);return L.reverse()}}}),ne.defineMIME("text/xml","xml"),ne.defineMIME("application/xml","xml"),ne.mimeModes.hasOwnProperty("text/html")||ne.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(mt,Ee,Q){"use strict";Q.d(Ee,"a",function(){return O});var ne=Q("JYp7"),$=function(){function V(_){this.element=_,this.next=V.Undefined,this.prev=V.Undefined}return V.Undefined=new V(void 0),V}(),O=function(){function V(){this._first=$.Undefined,this._last=$.Undefined,this._size=0}return Object.defineProperty(V.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),V.prototype.isEmpty=function(){return this._first===$.Undefined},V.prototype.clear=function(){this._first=$.Undefined,this._last=$.Undefined,this._size=0},V.prototype.unshift=function(_){return this._insert(_,!1)},V.prototype.push=function(_){return this._insert(_,!0)},V.prototype._insert=function(_,P){var F=this,N=new $(_);if(this._first===$.Undefined)this._first=N,this._last=N;else if(P){var M=this._last;this._last=N,N.prev=M,M.next=N}else{var k=this._first;this._first=N,N.next=k,k.prev=N}this._size+=1;var d=!1;return function(){d||(d=!0,F._remove(N))}},V.prototype.shift=function(){if(this._first===$.Undefined)return;var _=this._first.element;return this._remove(this._first),_},V.prototype.pop=function(){if(this._last===$.Undefined)return;var _=this._last.element;return this._remove(this._last),_},V.prototype._remove=function(_){if(_.prev!==$.Undefined&&_.next!==$.Undefined){var P=_.prev;P.next=_.next,_.next.prev=P}else _.prev===$.Undefined&&_.next===$.Undefined?(this._first=$.Undefined,this._last=$.Undefined):_.next===$.Undefined?(this._last=this._last.prev,this._last.next=$.Undefined):_.prev===$.Undefined&&(this._first=this._first.next,this._first.prev=$.Undefined);this._size-=1},V.prototype.iterator=function(){var _,P=this._first;return{next:function(){return P===$.Undefined?ne.c:(_?_.value=P.element:_={done:!1,value:P.element},P=P.next,_)}}},V.prototype.toArray=function(){for(var _=[],P=this._first;P!==$.Undefined;P=P.next)_.push(P.element);return _},V}()},"30zm":function(mt,Ee,Q){"use strict";var ne=Q("jCWc"),$=Q("kPKH"),O=Q("k1fw"),V=Q("tJVT"),_=Q("PpiC"),P=Q("B9cy"),F=Q("Ol7k"),N=Q("lUTK"),M=Q("BvKs"),k=Q("q1tI"),d=Q.n(k),h=Q("Ty5D"),S=Q("55Ip"),m=Q("9kvl"),p=Q("m3rI"),v=Q("kzJb"),a=Q.n(v),i=M.a.SubMenu,s=F.a.Sider,l=F.a.Content,C=function(y){var R=y.messages,w=y.globalSetting,T=y.loading,b=y.user,f=y.dispatch,u=Object(_.a)(y,["messages","globalSetting","loading","user","dispatch"]),L=Object(h.i)(),x=b.userInfo,A=Object(h.h)(),I=R.tidingsList,W=R.privateMessage,K=R.unreadInfo,Z=Object(k.useState)({per_page:10,page:1}),z=Object(V.a)(Z,2),B=z[0],ee=z[1];Object(k.useEffect)(function(){ie()},[L.userId]);var ie=function(){f({type:"messages/unreadMessageInfo",payload:Object(O.a)(Object(O.a)({},B),L)})};return d.a.createElement($.a,{flex:"264px"},d.a.createElement("aside",{className:a.a.userInfo},d.a.createElement("img",{className:"mt40",src:p.a.IMG_SERVER+"/images/"+(x==null?void 0:x.image_url)}),d.a.createElement("p",{className:"font24 mt10"},x==null?void 0:x.username),d.a.createElement("p",{className:"mt20"},x==null?void 0:x.user_identity)),d.a.createElement("ul",{className:a.a.navInfo},d.a.createElement(S.a,{to:"/messages/".concat(x==null?void 0:x.login,"/user_tidings")},d.a.createElement("li",{className:A.pathname.indexOf("user_tidings")>-1&&a.a.actived},"\u6D88\u606F",!!(K!=null&&K.unread_tiding_count)&&d.a.createElement("span",{className:a.a.newTip},K==null?void 0:K.unread_tiding_count))),d.a.createElement(S.a,{to:"/messages/".concat(x==null?void 0:x.login,"/private_messages")},d.a.createElement("li",{className:(A.pathname.indexOf("private_messages")>-1||A.pathname.indexOf("message_detail")>-1)&&a.a.actived},"\u79C1\u4FE1",!!(K!=null&&K.unread_message_count)&&d.a.createElement("span",{className:a.a.newTip},K==null?void 0:K.unread_message_count)))))};Ee.a=Object(m.a)(function(g){var y=g.messages,R=g.loading,w=g.user,T=g.globalSetting;return{messages:y,globalSetting:T,user:w,loading:R.effects}})(C)},"55Ip":function(mt,Ee,Q){"use strict";Q.d(Ee,"a",function(){return s}),Q.d(Ee,"b",function(){return w});var ne=Q("Ty5D"),$=Q("dI71"),O=Q("q1tI"),V=Q.n(O),_=Q("YS25"),P=Q("17x9"),F=Q.n(P),N=Q("wx14"),M=Q("zLVn"),k=Q("9R94"),d=function(b){Object($.a)(f,b);function f(){for(var L,x=arguments.length,A=new Array(x),I=0;I1&&arguments[1]!==void 0?arguments[1]:0,p=(F[S[m+0]]+F[S[m+1]]+F[S[m+2]]+F[S[m+3]]+"-"+F[S[m+4]]+F[S[m+5]]+"-"+F[S[m+6]]+F[S[m+7]]+"-"+F[S[m+8]]+F[S[m+9]]+"-"+F[S[m+10]]+F[S[m+11]]+F[S[m+12]]+F[S[m+13]]+F[S[m+14]]+F[S[m+15]]).toLowerCase();if(!P(p))throw TypeError("Stringified UUID is invalid");return p}var k=M;function d(S,m,p){S=S||{};var v=S.random||(S.rng||O)();if(v[6]=v[6]&15|64,v[8]=v[8]&63|128,m){p=p||0;for(var a=0;a<16;++a)m[p+a]=v[a];return m}return k(v)}var h=Ee.a=d},"7ahc":function(mt,Ee,Q){"use strict";Q.d(Ee,"a",function(){return C});var ne=Q("k1fw"),$=Q("0Owb"),O=Q("+L6B"),V=Q("2/Rp"),_=Q("y8nQ"),P=Q("Vl3Y"),F=Q("tJVT"),N=Q("OaEy"),M=Q("2fM7"),k=Q("q1tI"),d=Q.n(k),h=Q("VrN/"),S=Q.n(h),m=Q("p77/"),p=Q.n(m),v=Q("c5Ni"),a=Q.n(v),i=M.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},l={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Ee.b=function(g){var y=g.callback,R=g.onCancel,w=Object(k.useState)("python"),T=Object(F.a)(w,2),b=T[0],f=T[1];function u(x){f(l[x][1])}function L(x){y(x)}return d.a.createElement(P.a,Object($.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:L}),d.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},d.a.createElement(M.a,{onChange:u},Object.keys(l).map(function(x){return d.a.createElement(i,{key:x,value:x},l[x][0])}))),d.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},d.a.createElement(C,{mode:b})),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(V.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function C(g){var y=g.value,R=g.onChange,w=g.mode,T=g.options,b=T===void 0?{}:T,f=Object(k.useRef)(),u=Object(k.useState)(),L=Object(F.a)(u,2),x=L[0],A=L[1];return Object(k.useEffect)(function(){if(x){function I(W){var K=W.getValue();R&&R(K)}return x.on("change",I),function(){x.off("change",I)}}},[x,R]),Object(k.useEffect)(function(){x&&x.setOption("mode",w)},[x,w]),Object(k.useEffect)(function(){x&&((y!==x.getValue()||y==="")&&setTimeout(function(){x.setValue(y||" ")},300))},[x,y]),Object(k.useEffect)(function(){if(f.current&&!x){var I=S.a.fromTextArea(f.current,Object(ne.a)({mode:w,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},b));A(I)}},[f.current,x]),d.a.createElement("div",{className:"my-codemirror-container"},d.a.createElement("textarea",{ref:f}))}},"8EBN":function(mt,Ee,Q){(function(ne){ne(Q("VrN/"))})(function(ne){"use strict";ne.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var $=0;$-1&&V.substring(F+1,V.length);if(N)return ne.findModeByExtension(N)},ne.findModeByName=function(V){V=V.toLowerCase();for(var _=0;_0&&S[S.length-1])&&(a[0]===6||a[0]===2)){k=0;continue}if(a[0]===3&&(!S||a[1]>S[0]&&a[1]=j.length?X.slice(j.length):X}).join(`
`)}var a=[],i=[""],s=new m.a.Renderer,l=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function C(){a.length=0,i=[""]}var g={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function y(H,c,E,j){if(c>=H.length||H[c].level<=E)return c;var X=H[c];j.push("- "+X.text+""),c++;var G=[];return c=y(H,c,X.level,G),G.length>0&&(j.push("
"),G.forEach(function(pe){j.push(pe)}),j.push("
")),j.push(" "),c=y(H,c,E,j),c}function R(){return y(a,0,0,i),i.push("
"),i.join("")}var w={heading:function(c){var E=l.exec(c);if(E)return{type:"heading",raw:E[0],depth:E[1].length,text:E[2]}},fences:function(c){var E=this.rules.block.fences.exec(c);if(E){var j=E[0],X=v(j,E[3]||""),G=E[2]?E[2].trim():E[2];if(["latex","katex","math"].indexOf(G)>=0){var pe=f(),We=X;X=pe,u[pe]={type:"block",expression:We}}return{type:"code",raw:j,lang:G,text:X}}}},T=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,f=function(){return"__special_katext_id_".concat(b++,"__")},u={};function L(){return u}function x(){b=0,u={}}function A(H){return H=H.replace(T,function(c,E){var j=f();return u[j]={type:"inline",expression:E},j}),H}var I=s.listitem;s.listitem=function(H){return I(A(H))};var W=s.paragraph;s.paragraph=function(H){return W(A(H))};var K=s.tablecell;s.tablecell=function(H,c){return K(A(H),c)},s.code=function(H,c,E){var j=(c||"").match(/\S*/)[0];return j?["latex","katex","math"].indexOf(j)>=0?"".concat(H,"
"):'
').concat(E?H:Object(p.escape)(H,!0),`
`):''+(E?H:Object(p.escape)(H,!0))+"
"},s.heading=function(H,c,E){var j=this.options.headerPrefix+E.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return a.push({anchor:j,level:c,text:H}),"'+H+""},m.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),m.a.use({tokenizer:w,renderer:s});var Z=m.a,z=Q("SJMd"),B=Q("ulZh"),ee=Q.n(B),ie=Q("m3rI"),de=Q("Oy/b"),be=Q("p5ED"),Ie=Q("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Ae=function(H,c){return(Ae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,j){E.__proto__=j}||function(E,j){for(var X in j)Object.prototype.hasOwnProperty.call(j,X)&&(E[X]=j[X])})(H,c)};function Re(H,c){function E(){this.constructor=H}Ae(H,c),H.prototype=c===null?Object.create(c):(E.prototype=c.prototype,new E)}function ke(H,c,E,j){return new(E||(E=Promise))(function(X,G){function pe(gt){try{nt(j.next(gt))}catch(Ge){G(Ge)}}function We(gt){try{nt(j.throw(gt))}catch(Ge){G(Ge)}}function nt(gt){var Ge;gt.done?X(gt.value):(Ge=gt.value,Ge instanceof E?Ge:new E(function(Dt){Dt(Ge)})).then(pe,We)}nt((j=j.apply(H,c||[])).next())})}function De(H,c){var E,j,X,G,pe={label:0,sent:function(){if(1&X[0])throw X[1];return X[1]},trys:[],ops:[]};return G={next:We(0),throw:We(1),return:We(2)},typeof Symbol=="function"&&(G[Symbol.iterator]=function(){return this}),G;function We(nt){return function(gt){return function(Ge){if(E)throw new TypeError("Generator is already executing.");for(;pe;)try{if(E=1,j&&(X=2&Ge[0]?j.return:Ge[0]?j.throw||((X=j.return)&&X.call(j),0):j.next)&&!(X=X.call(j,Ge[1])).done)return X;switch(j=0,X&&(Ge=[2&Ge[0],X.value]),Ge[0]){case 0:case 1:X=Ge;break;case 4:return pe.label++,{value:Ge[1],done:!1};case 5:pe.label++,j=Ge[1],Ge=[0];continue;case 7:Ge=pe.ops.pop(),pe.trys.pop();continue;default:if(!(X=pe.trys,(X=X.length>0&&X[X.length-1])||Ge[0]!==6&&Ge[0]!==2)){pe=0;continue}if(Ge[0]===3&&(!X||Ge[1]>X[0]&&Ge[1]',"select"),this.addActionButton(j,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(j,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(j,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(j,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(j,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(j,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(j,'',"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(G){var pe=document.createElement("div");pe.className=""+E.toolbarButtonStyleClass.name,pe.setAttribute("data-type-name",G.typeName),pe.innerHTML=G.icon,pe.addEventListener("click",function(){E.markerToolbarButtonClicked(pe,G)}),E.buttons.push(pe),E.markerButtons.push(pe)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var X=document.createElement("div");X.className=this.toolbarBlockStyleClass.name,X.style.whiteSpace="nowrap",X.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(X),this.addActionButton(X,'',"render"),this.addActionButton(X,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},H.prototype.addButtonClickListener=function(c){this.buttonClickListeners.push(c)},H.prototype.removeButtonClickListener=function(c){this.buttonClickListeners.indexOf(c)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(c),1)},H.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},H.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var c=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var E=0;E0&&this.buttonClickListeners.forEach(function(j){return j("marker",E)}),this.markerButtonOverflowBlock.style.display="none"},H.prototype.actionToolbarButtonClicked=function(c,E){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(j){return j("action",E)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},H.prototype.setActiveButton=function(c){this.resetButtonStyles(),c.className=c.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),c.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},H.prototype.setActiveMarkerButton=function(c){var E=this.markerButtons.find(function(j){return j.getAttribute("data-type-name")===c});E&&this.setActiveButton(E)},H.prototype.setCurrentMarker=function(c){var E=this;this.currentMarker=c,this.buttons.filter(function(j){return/delete|notes/.test(j.getAttribute("data-action"))}).forEach(function(j){E.currentMarker===void 0?(j.style.fillOpacity="0.4",j.style.pointerEvents="none"):(j.style.fillOpacity="1",j.style.pointerEvents="all")})},H}(),we=function(){function H(c,E,j,X){this.panels=[],this.panelButtons=[],this.markerjsContainer=c,this.displayMode=E,this.uiStyleSettings=j,this.styles=X,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return H.prototype.addStyles=function(){var c;this.toolboxStyleClass=this.styles.addClass(new ae("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new ae("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var E=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ae("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ae("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ae("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new ae("toolbox-panel-row_colors",`
background-color: `+((c=this.uiStyleSettings.toolboxBackgroundColor)!==null&&c!==void 0?c:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ae("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*E)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*E)+`px;
padding: `+E+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ae("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ae("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new se("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new se("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},H.prototype.show=function(c){var E;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=c,this.uiContainer.className=this.toolboxStyleClass.name+" "+((E=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&E!==void 0?E:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},H.prototype.setPanelButtons=function(c){var E,j,X=this;this.panels=c,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((E=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&E!==void 0?E:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((j=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&j!==void 0?j:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(G){var pe;G.uiStyleSettings=X.uiStyleSettings;var We=document.createElement("div");We.className=X.toolboxButtonStyleClass.name+" "+((pe=X.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&pe!==void 0?pe:X.toolboxButtonStyleColorsClass.name),We.innerHTML=G.icon,We.title=G.title,We.addEventListener("click",function(){X.panelButtonClick(G)}),X.panelButtons.push(We),X.buttonRow.appendChild(We)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},H.prototype.panelButtonClick=function(c){var E=this,j=-1;if(c!==this.activePanel){j=this.panels.indexOf(c),this.panelRow.innerHTML="";var X=c.getUi();X.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(X),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=c}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){E.displayMode==="inline"?E.panelRow.style.display="none":E.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(G,pe){var We,nt;G.className=E.toolboxButtonStyleClass.name+" "+(pe===j?""+((We=E.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&We!==void 0?We:E.toolboxActiveButtonStyleColorsClass.name):""+((nt=E.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&nt!==void 0?nt:E.toolboxButtonStyleColorsClass.name))})},H}(),Pe=function(H,c){this.title=H,this.icon=c},_e=function(H){function c(E,j,X,G){var pe=H.call(this,E,G||'')||this;return pe.colors=[],pe.addTransparent=!1,pe.colorBoxes=[],pe.colors=j,pe.currentColor=X,pe.setCurrentColor=pe.setCurrentColor.bind(pe),pe.getColorBox=pe.getColorBox.bind(pe),pe}return Re(c,H),c.prototype.getUi=function(){var E=this,j=document.createElement("div");return j.style.overflow="hidden",j.style.whiteSpace="nowrap",this.colors.forEach(function(X){var G=E.getColorBox(X);j.appendChild(G),E.colorBoxes.push(G)}),j},c.prototype.getColorBox=function(E){var j=this,X=this.uiStyleSettings.toolbarHeight/4,G=this.uiStyleSettings.toolbarHeight-X,pe=document.createElement("div");pe.style.display="inline-block",pe.style.boxSizing="content-box",pe.style.width=G-2+"px",pe.style.height=G-2+"px",pe.style.padding="1px",pe.style.marginRight="2px",pe.style.marginBottom="2px",pe.style.borderWidth="2px",pe.style.borderStyle="solid",pe.style.borderRadius=(G+2)/2+"px",pe.style.borderColor=E===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",pe.addEventListener("click",function(){j.setCurrentColor(E,pe)});var We=document.createElement("div");return We.style.display="inline-block",We.style.width=G-2+"px",We.style.height=G-2+"px",We.style.backgroundColor=E,We.style.borderRadius=G/2+"px",E==="transparent"&&(We.style.fill=this.uiStyleSettings.toolboxAccentColor,We.innerHTML=``),pe.appendChild(We),pe},c.prototype.setCurrentColor=function(E,j){var X=this;this.currentColor=E,this.colorBoxes.forEach(function(G){G.style.borderColor=G===j?X.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(E)},c}(Pe),Ue=function(){function H(c,E,j){this._state="new",this._isSelected=!1,this._container=c,this._overlayContainer=E,this.globalSettings=j,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(H.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),H.prototype.ownsTarget=function(c){return!1},Object.defineProperty(H.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),H.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},H.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},H.prototype.pointerDown=function(c,E){},H.prototype.dblClick=function(c,E){},H.prototype.manipulate=function(c){},H.prototype.pointerUp=function(c){this.stateChanged()},H.prototype.dispose=function(){},H.prototype.addMarkerVisualToContainer=function(c){this.container.childNodes.length>0?this.container.insertBefore(c,this.container.childNodes[0]):this.container.appendChild(c)},H.prototype.getState=function(){return{typeName:H.typeName,state:this.state,notes:this.notes}},H.prototype.restoreState=function(c){this._state=c.state,this.notes=c.notes},H.prototype.scale=function(c,E){},H.prototype.colorChanged=function(c){this.onColorChanged&&this.onColorChanged(c),this.stateChanged()},H.prototype.fillColorChanged=function(c){this.onFillColorChanged&&this.onFillColorChanged(c),this.stateChanged()},H.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var c=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),c.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(c)&&this.onStateChanged(this)}},H.typeName="MarkerBase",H}(),je=function(){function H(){this.findGripByVisual=this.findGripByVisual.bind(this)}return H.prototype.findGripByVisual=function(c){return this.topLeft.ownsTarget(c)?this.topLeft:this.topCenter.ownsTarget(c)?this.topCenter:this.topRight.ownsTarget(c)?this.topRight:this.centerLeft.ownsTarget(c)?this.centerLeft:this.centerRight.ownsTarget(c)?this.centerRight:this.bottomLeft.ownsTarget(c)?this.bottomLeft:this.bottomCenter.ownsTarget(c)?this.bottomCenter:this.bottomRight.ownsTarget(c)?this.bottomRight:void 0},H}(),at=function(){function H(){this.GRIP_SIZE=10,this.visual=ue.createGroup(),this.visual.appendChild(ue.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ue.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return H.prototype.ownsTarget=function(c){return c===this.visual||c===this.visual.childNodes[0]||c===this.visual.childNodes[1]},H}(),Je=function(){function H(){}return H.toITransformMatrix=function(c){return{a:c.a,b:c.b,c:c.c,d:c.d,e:c.e,f:c.f}},H.toSVGMatrix=function(c,E){return c.a=E.a,c.b=E.b,c.c=E.c,c.d=E.d,c.e=E.e,c.f=E.f,c},H}(),Qe=function(H){function c(E,j,X){var G=H.call(this,E,j,X)||this;return G.left=0,G.top=0,G.width=0,G.height=0,G.defaultSize={x:50,y:20},G.offsetX=0,G.offsetY=0,G.rotationAngle=0,G.CB_DISTANCE=10,G._suppressMarkerCreateEvent=!1,G.container.transform.baseVal.appendItem(ue.createTransform()),G.setupControlBox(),G}return Re(c,H),Object.defineProperty(c.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"visual",{get:function(){return this._visual},set:function(E){this._visual=E;var j=ue.createTransform();this._visual.transform.baseVal.appendItem(j)},enumerable:!1,configurable:!0}),c.prototype.ownsTarget=function(E){return!!H.prototype.ownsTarget.call(this,E)||!!(this.controlGrips.findGripByVisual(E)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(E))},c.prototype.pointerDown=function(E,j){H.prototype.pointerDown.call(this,E,j),this.state==="new"&&(this.left=E.x,this.top=E.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var X=this.unrotatePoint(E);if(this.manipulationStartX=X.x,this.manipulationStartY=X.y,this.offsetX=X.x-this.left,this.offsetY=X.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(j),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(j)){this.activeGrip=this.rotatorGrip;var G=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=G.x-this.width/2,this.top=G.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var pe=this.container.transform.baseVal.getItem(0);pe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(pe,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},c.prototype.pointerUp=function(E){var j=this.state;H.prototype.pointerUp.call(this,E),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(E),this._state="select",j==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},c.prototype.moveVisual=function(E){this.visual.style.transform="translate("+E.x+"px, "+E.y+"px)"},c.prototype.manipulate=function(E){var j=this.unrotatePoint(E);this.state==="creating"?this.resize(E):this.state==="move"?(this.left=this.manipulationStartLeft+(j.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(j.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(j):this.state==="rotate"&&this.rotate(E)},c.prototype.resize=function(E){var j=this.manipulationStartLeft,X=this.manipulationStartWidth,G=this.manipulationStartTop,pe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:j=this.manipulationStartLeft+E.x-this.manipulationStartX,X=this.manipulationStartWidth+this.manipulationStartLeft-j;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:X=this.manipulationStartWidth+E.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:G=this.manipulationStartTop+E.y-this.manipulationStartY,pe=this.manipulationStartHeight+this.manipulationStartTop-G;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:pe=this.manipulationStartHeight+E.y-this.manipulationStartY}X>=0?(this.left=j,this.width=X):(this.left=j+X,this.width=-X),pe>=0?(this.top=G,this.height=pe):(this.top=G+pe,this.height=-pe),this.setSize()},c.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},c.prototype.rotate=function(E){if(Math.abs(E.x-this.centerX)>.1){var j=Math.sign(E.x-this.centerX);this.rotationAngle=180*Math.atan((E.y-this.centerY)/(E.x-this.centerX))/Math.PI+90*j,this.applyRotation()}},c.prototype.applyRotation=function(){var E=this.container.transform.baseVal.getItem(0);E.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(E,0)},c.prototype.rotatePoint=function(E){if(this.rotationAngle===0)return E;var j=this.container.getCTM(),X=ue.createPoint(E.x,E.y);return{x:(X=X.matrixTransform(j)).x,y:X.y}},c.prototype.unrotatePoint=function(E){if(this.rotationAngle===0)return E;var j=this.container.getCTM();j=j.inverse();var X=ue.createPoint(E.x,E.y);return{x:(X=X.matrixTransform(j)).x,y:X.y}},c.prototype.select=function(){H.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},c.prototype.deselect=function(){H.prototype.deselect.call(this),this.controlBox.style.display="none"},c.prototype.setupControlBox=function(){this.controlBox=ue.createGroup();var E=ue.createTransform();E.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(E),this.container.appendChild(this.controlBox),this.controlRect=ue.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=ue.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new je,this.addControlGrips(),this.controlBox.style.display="none"},c.prototype.adjustControlBox=function(){var E=this.controlBox.transform.baseVal.getItem(0);E.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(E,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},c.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},c.prototype.createGrip=function(){var E=new at;return E.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(E.visual),E},c.prototype.positionGrips=function(){var E=this.controlGrips.topLeft.GRIP_SIZE,j=-E/2,X=j,G=(this.width+this.CB_DISTANCE)/2-E/2,pe=(this.height+this.CB_DISTANCE)/2-E/2,We=this.height+this.CB_DISTANCE-E/2,nt=this.width+this.CB_DISTANCE-E/2;this.positionGrip(this.controlGrips.topLeft.visual,j,X),this.positionGrip(this.controlGrips.topCenter.visual,G,X),this.positionGrip(this.controlGrips.topRight.visual,nt,X),this.positionGrip(this.controlGrips.centerLeft.visual,j,pe),this.positionGrip(this.controlGrips.centerRight.visual,nt,pe),this.positionGrip(this.controlGrips.bottomLeft.visual,j,We),this.positionGrip(this.controlGrips.bottomCenter.visual,G,We),this.positionGrip(this.controlGrips.bottomRight.visual,nt,We),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,G,X-3*this.CB_DISTANCE)},c.prototype.positionGrip=function(E,j,X){var G=E.transform.baseVal.getItem(0);G.setTranslate(j,X),E.transform.baseVal.replaceItem(G,0)},c.prototype.hideControlBox=function(){this.controlBox.style.display="none"},c.prototype.showControlBox=function(){this.controlBox.style.display=""},c.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Je.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Je.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},H.prototype.getState.call(this))},c.prototype.restoreState=function(E){H.prototype.restoreState.call(this,E);var j=E;this.left=j.left,this.top=j.top,this.width=j.width,this.height=j.height,this.rotationAngle=j.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Je.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,j.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Je.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,j.containerTransformMatrix))},c.prototype.scale=function(E,j){H.prototype.scale.call(this,E,j);var X=this.rotatePoint({x:this.left,y:this.top}),G=this.unrotatePoint({x:X.x*E,y:X.y*j});this.left=G.x,this.top=G.y,this.width=this.width*E,this.height=this.height*j,this.adjustControlBox()},c}(Ue),Ve=function(H){function c(E,j,X){var G=H.call(this,E,j,X)||this;return G.fillColor="transparent",G.strokeColor="transparent",G.strokeWidth=0,G.strokeDasharray="",G.opacity=1,G.setStrokeColor=G.setStrokeColor.bind(G),G.setFillColor=G.setFillColor.bind(G),G.setStrokeWidth=G.setStrokeWidth.bind(G),G.setStrokeDasharray=G.setStrokeDasharray.bind(G),G.createVisual=G.createVisual.bind(G),G}return Re(c,H),c.prototype.ownsTarget=function(E){return!(!H.prototype.ownsTarget.call(this,E)&&E!==this.visual)},c.prototype.createVisual=function(){this.visual=ue.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},c.prototype.pointerDown=function(E,j){H.prototype.pointerDown.call(this,E,j),this.state==="new"&&(this.createVisual(),this.moveVisual(E),this._state="creating")},c.prototype.manipulate=function(E){H.prototype.manipulate.call(this,E)},c.prototype.resize=function(E){H.prototype.resize.call(this,E),this.setSize()},c.prototype.setSize=function(){H.prototype.setSize.call(this),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},c.prototype.pointerUp=function(E){H.prototype.pointerUp.call(this,E),this.setSize()},c.prototype.setStrokeColor=function(E){this.strokeColor=E,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(E),this.stateChanged()},c.prototype.setFillColor=function(E){this.fillColor=E,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},c.prototype.setStrokeWidth=function(E){this.strokeWidth=E,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},c.prototype.setStrokeDasharray=function(E){this.strokeDasharray=E,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},c.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},H.prototype.getState.call(this))},c.prototype.restoreState=function(E){var j=E;this.fillColor=j.fillColor,this.strokeColor=j.strokeColor,this.strokeWidth=j.strokeWidth,this.strokeDasharray=j.strokeDasharray,this.opacity=j.opacity,this.createVisual(),H.prototype.restoreState.call(this,E),this.setSize()},c.prototype.scale=function(E,j){H.prototype.scale.call(this,E,j),this.setSize()},c.title="Rectangle marker",c}(Qe),ht=function(H){function c(E,j,X,G){var pe=H.call(this,E,G||'')||this;return pe.widths=[],pe.widthBoxes=[],pe.widths=j,pe.currentWidth=X,pe.setCurrentWidth=pe.setCurrentWidth.bind(pe),pe}return Re(c,H),c.prototype.getUi=function(){var E=this,j=document.createElement("div");return j.style.display="flex",j.style.overflow="hidden",j.style.flexGrow="2",this.widths.forEach(function(X){var G=document.createElement("div");G.style.display="flex",G.style.flexGrow="2",G.style.alignItems="center",G.style.justifyContent="space-between",G.style.padding="5px",G.style.borderWidth="2px",G.style.borderStyle="solid",G.style.borderColor=X===E.currentWidth?E.uiStyleSettings.toolboxAccentColor:"transparent",G.addEventListener("click",function(){E.setCurrentWidth(X,G)}),j.appendChild(G);var pe=document.createElement("div");pe.innerText=X.toString(),pe.style.marginRight="5px",G.appendChild(pe);var We=document.createElement("div");We.style.minHeight="20px",We.style.flexGrow="2",We.style.display="flex",We.style.alignItems="center";var nt=document.createElement("hr");nt.style.minWidth="20px",nt.style.border="0px",nt.style.borderTop=X+"px solid "+E.uiStyleSettings.toolboxColor,nt.style.flexGrow="2",We.appendChild(nt),G.appendChild(We),E.widthBoxes.push(G)}),j},c.prototype.setCurrentWidth=function(E,j){var X=this;this.currentWidth=E,this.widthBoxes.forEach(function(G){G.style.borderColor=G===j?X.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},c}(Pe),it=function(H){function c(E,j,X,G){var pe=H.call(this,E,G||'')||this;return pe.styles=[],pe.styleBoxes=[],pe.styles=j,pe.currentStyle=X,pe.setCurrentStyle=pe.setCurrentStyle.bind(pe),pe}return Re(c,H),c.prototype.getUi=function(){var E=this,j=document.createElement("div");return j.style.display="flex",j.style.overflow="hidden",j.style.flexGrow="2",this.styles.forEach(function(X){var G=document.createElement("div");G.style.display="flex",G.style.alignItems="center",G.style.justifyContent="space-between",G.style.padding="5px",G.style.borderWidth="2px",G.style.borderStyle="solid",G.style.overflow="hidden",G.style.maxWidth=100/E.styles.length-5+"%",G.style.borderColor=X===E.currentStyle?E.uiStyleSettings.toolboxAccentColor:"transparent",G.addEventListener("click",function(){E.setCurrentStyle(X,G)}),j.appendChild(G);var pe=document.createElement("div");pe.style.minHeight="20px",pe.style.flexGrow="2",pe.style.overflow="hidden";var We=``;pe.innerHTML=We,G.appendChild(pe),E.styleBoxes.push(G)}),j},c.prototype.setCurrentStyle=function(E,j){var X=this;this.currentStyle=E,this.styleBoxes.forEach(function(G){G.style.borderColor=G===j?X.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},c}(Pe),rt=function(H){function c(E,j,X){var G=H.call(this,E,j,X)||this;return G.strokeColor=X.defaultColor,G.strokeWidth=X.defaultStrokeWidth,G.strokeDasharray=X.defaultStrokeDasharray,G.strokePanel=new _e("Line color",X.defaultColorSet,X.defaultColor),G.strokePanel.onColorChanged=G.setStrokeColor,G.strokeWidthPanel=new ht("Line width",X.defaultStrokeWidths,X.defaultStrokeWidth),G.strokeWidthPanel.onWidthChanged=G.setStrokeWidth,G.strokeStylePanel=new it("Line style",X.defaultStrokeDasharrays,X.defaultStrokeDasharray),G.strokeStylePanel.onStyleChanged=G.setStrokeDasharray,G}return Re(c,H),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=H.prototype.getState.call(this);return E.typeName=c.typeName,E},c.typeName="FrameMarker",c.title="Frame marker",c.icon='',c}(Ve),Le=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},Xe=function(H){function c(E,j,X){var G=H.call(this,E,j,X)||this;return G.x1=0,G.y1=0,G.x2=0,G.y2=0,G.defaultLength=50,G.manipulationStartX=0,G.manipulationStartY=0,G.manipulationStartX1=0,G.manipulationStartY1=0,G.manipulationStartX2=0,G.manipulationStartY2=0,G.setupControlBox(),G}return Re(c,H),c.prototype.ownsTarget=function(E){return!!H.prototype.ownsTarget.call(this,E)||!(!this.grip1.ownsTarget(E)&&!this.grip2.ownsTarget(E))},c.prototype.pointerDown=function(E,j){H.prototype.pointerDown.call(this,E,j),this.manipulationStartX=E.x,this.manipulationStartY=E.y,this.state==="new"&&(this.x1=E.x,this.y1=E.y,this.x2=E.x,this.y2=E.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(j)?this.activeGrip=this.grip1:this.grip2.ownsTarget(j)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},c.prototype.pointerUp=function(E){var j=this.state;H.prototype.pointerUp.call(this,E),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(E),this._state="select",j==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},c.prototype.adjustVisual=function(){},c.prototype.manipulate=function(E){this.state==="creating"?this.resize(E):this.state==="move"?(this.x1=this.manipulationStartX1+E.x-this.manipulationStartX,this.y1=this.manipulationStartY1+E.y-this.manipulationStartY,this.x2=this.manipulationStartX2+E.x-this.manipulationStartX,this.y2=this.manipulationStartY2+E.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(E)},c.prototype.resize=function(E){switch(this.activeGrip){case this.grip1:this.x1=E.x,this.y1=E.y;break;case this.grip2:case void 0:this.x2=E.x,this.y2=E.y}this.adjustVisual(),this.adjustControlBox()},c.prototype.select=function(){H.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},c.prototype.deselect=function(){H.prototype.deselect.call(this),this.controlBox.style.display="none"},c.prototype.setupControlBox=function(){this.controlBox=ue.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},c.prototype.adjustControlBox=function(){this.positionGrips()},c.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},c.prototype.createGrip=function(){var E=new at;return E.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(E.visual),E},c.prototype.positionGrips=function(){var E=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-E/2,this.y1-E/2),this.positionGrip(this.grip2.visual,this.x2-E/2,this.y2-E/2)},c.prototype.positionGrip=function(E,j,X){var G=E.transform.baseVal.getItem(0);G.setTranslate(j,X),E.transform.baseVal.replaceItem(G,0)},c.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},H.prototype.getState.call(this))},c.prototype.restoreState=function(E){H.prototype.restoreState.call(this,E);var j=E;this.x1=j.x1,this.y1=j.y1,this.x2=j.x2,this.y2=j.y2},c.prototype.scale=function(E,j){H.prototype.scale.call(this,E,j),this.x1=this.x1*E,this.y1=this.y1*j,this.x2=this.x2*E,this.y2=this.y2*j,this.adjustVisual(),this.adjustControlBox()},c}(Ue),lt=function(H){function c(E,j,X){var G=H.call(this,E,j,X)||this;return G.strokeColor="transparent",G.strokeWidth=0,G.strokeDasharray="",G.setStrokeColor=G.setStrokeColor.bind(G),G.setStrokeWidth=G.setStrokeWidth.bind(G),G.setStrokeDasharray=G.setStrokeDasharray.bind(G),G.strokeColor=X.defaultColor,G.strokeWidth=X.defaultStrokeWidth,G.strokeDasharray=X.defaultStrokeDasharray,G.strokePanel=new _e("Line color",X.defaultColorSet,X.defaultColor),G.strokePanel.onColorChanged=G.setStrokeColor,G.strokeWidthPanel=new ht("Line width",X.defaultStrokeWidths,X.defaultStrokeWidth),G.strokeWidthPanel.onWidthChanged=G.setStrokeWidth,G.strokeStylePanel=new it("Line style",X.defaultStrokeDasharrays,X.defaultStrokeDasharray),G.strokeStylePanel.onStyleChanged=G.setStrokeDasharray,G}return Re(c,H),c.prototype.ownsTarget=function(E){return!(!H.prototype.ownsTarget.call(this,E)&&E!==this.visual&&E!==this.selectorLine&&E!==this.visibleLine)},c.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorLine=ue.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ue.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},c.prototype.pointerDown=function(E,j){H.prototype.pointerDown.call(this,E,j),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},c.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),ue.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},c.prototype.setStrokeColor=function(E){this.strokeColor=E,this.adjustVisual(),this.colorChanged(E)},c.prototype.setStrokeWidth=function(E){this.strokeWidth=E,this.adjustVisual()},c.prototype.setStrokeDasharray=function(E){this.strokeDasharray=E,this.adjustVisual(),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},H.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){H.prototype.restoreState.call(this,E);var j=E;this.strokeColor=j.strokeColor,this.strokeWidth=j.strokeWidth,this.strokeDasharray=j.strokeDasharray,this.createVisual(),this.adjustVisual()},c.typeName="LineMarker",c.title="Line marker",c.icon='',c}(Xe),Oe=function(H){function c(E,j,X,G){var pe=H.call(this,E,G||'')||this;return pe.fonts=[],pe.fontBoxes=[],pe.fonts=j,pe.currentFont=X,pe.setCurrentFont=pe.setCurrentFont.bind(pe),pe}return Re(c,H),c.prototype.getUi=function(){var E=this,j=document.createElement("div");return j.style.overflow="hidden",j.style.flexGrow="2",this.fonts.forEach(function(X){var G=document.createElement("div");G.style.display="inline-block",G.style.alignItems="center",G.style.justifyContent="space-between",G.style.padding="5px",G.style.borderWidth="2px",G.style.borderStyle="solid",G.style.overflow="hidden",G.style.maxWidth=100/E.fonts.length-5+"%",G.style.borderColor=X===E.currentFont?E.uiStyleSettings.toolboxAccentColor:"transparent",G.addEventListener("click",function(){E.setCurrentFont(X,G)}),j.appendChild(G);var pe=document.createElement("div");pe.style.display="flex",pe.style.minHeight="20px",pe.style.flexGrow="2",pe.style.fontFamily=X,pe.style.overflow="hidden";var We=document.createElement("div");We.style.whiteSpace="nowrap",We.style.overflow="hidden",We.style.textOverflow="ellipsis",We.innerHTML="The quick brown fox jumps over the lazy dog",pe.appendChild(We),G.appendChild(pe),E.fontBoxes.push(G)}),j},c.prototype.setCurrentFont=function(E,j){var X=this;this.currentFont=E,this.fontBoxes.forEach(function(G){G.style.borderColor=G===j?X.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},c}(Pe),He=function(H){function c(E,j,X){var G=H.call(this,E,j,X)||this;return G.color="transparent",G.padding=5,G.DEFAULT_TEXT="your text here",G.text=G.DEFAULT_TEXT,G.isMoved=!1,G.color=X.defaultColor,G.fontFamily=X.defaultFontFamily,G.defaultSize={x:100,y:30},G.setColor=G.setColor.bind(G),G.setFont=G.setFont.bind(G),G.renderText=G.renderText.bind(G),G.sizeText=G.sizeText.bind(G),G.textEditDivClicked=G.textEditDivClicked.bind(G),G.showTextEditor=G.showTextEditor.bind(G),G.setSize=G.setSize.bind(G),G.positionTextEditor=G.positionTextEditor.bind(G),G.colorPanel=new _e("Color",X.defaultColorSet,X.defaultColor),G.colorPanel.onColorChanged=G.setColor,G.fontFamilyPanel=new Oe("Font",X.defaultFontFamilies,X.defaultFontFamily),G.fontFamilyPanel.onFontChanged=G.setFont,G}return Re(c,H),c.prototype.ownsTarget=function(E){if(H.prototype.ownsTarget.call(this,E)||E===this.visual||E===this.textElement||E===this.bgRectangle)return!0;var j=!1;return this.textElement.childNodes.forEach(function(X){X===E&&(j=!0)}),j},c.prototype.createVisual=function(){this.visual=ue.createGroup(),this.bgRectangle=ue.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ue.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},c.prototype.pointerDown=function(E,j){H.prototype.pointerDown.call(this,E,j),this.isMoved=!1,this.pointerDownPoint=E,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(E),this._state="creating")},c.prototype.renderText=function(){var E=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(j){E.textElement.appendChild(ue.createTSpan(j.trim()===""?" ":j.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},c.prototype.getTextScale=function(){var E=this.textElement.getBBox(),j=1;if(E.width>0&&E.height>0){var X=(1*this.width-this.width*this.padding*2/100)/E.width,G=(1*this.height-this.height*this.padding*2/100)/E.height;j=Math.min(X,G)}return j},c.prototype.getTextPosition=function(E){var j=this.textElement.getBBox(),X=0,G=0;return j.width>0&&j.height>0&&(X=(this.width-j.width*E)/2,G=this.height/2-j.height*E/2),{x:X,y:G}},c.prototype.sizeText=function(){var E=this.textElement.getBBox(),j=this.getTextScale(),X=this.getTextPosition(j);X.y-=E.y*j,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+X.x+"px, "+X.y+"px) scale("+j+", "+j+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(X.x,X.y),this.textElement.transform.baseVal.getItem(1).setScale(j,j))},c.prototype.manipulate=function(E){H.prototype.manipulate.call(this,E),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(E.x-this.pointerDownPoint.x)>5||Math.abs(E.y-this.pointerDownPoint.y)>5)},c.prototype.resize=function(E){H.prototype.resize.call(this,E),this.isMoved=!0,this.setSize(),this.sizeText()},c.prototype.setSize=function(){H.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},c.prototype.pointerUp=function(E){var j=this.state;j==="creating"&&(this._suppressMarkerCreateEvent=!0),H.prototype.pointerUp.call(this,E),this.setSize(),(j==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},c.prototype.showTextEditor=function(){var E=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(j){j.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var j=Number.parseFloat(E.textEditor.style.fontSize);E.textEditor.clientWidth>=Number.parseInt(E.textEditor.style.maxWidth)&&j>.9;)j-=.1,E.textEditor.style.fontSize=Math.max(j,.9)+"em"}),this.textEditor.addEventListener("keyup",function(j){j.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(j){if(j.clipboardData){var X=j.clipboardData.getData("text"),G=window.getSelection();if(!G.rangeCount)return!1;G.deleteFromDocument(),G.getRangeAt(0).insertNode(document.createTextNode(X)),j.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){E.textEditDivClicked(E.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},c.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var E=this.getTextScale(),j=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),X=this.textElement.getBBox(),G={x:X.width*E,y:X.height*E};j.x-=G.x/2,j.y-=G.y/2,this.textEditor.style.top=j.y+"px",this.textEditor.style.left=j.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-j.x+"px",this.textEditor.style.fontSize=Math.max(16*E,12)+"px",this.textElement.style.display="none"}},c.prototype.textEditDivClicked=function(E){this.text=E.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},c.prototype.select=function(){H.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},c.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),H.prototype.deselect.call(this)},c.prototype.dblClick=function(E,j){H.prototype.dblClick.call(this,E,j),this.showTextEditor()},c.prototype.setColor=function(E){this.textElement&&ue.setAttributes(this.textElement,[["fill",E]]),this.color=E,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(E)},c.prototype.setFont=function(E){this.textElement&&ue.setAttributes(this.textElement,[["font-family",E]]),this.fontFamily=E,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},c.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},c.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},H.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){var j=E;this.color=j.color,this.fontFamily=j.fontFamily,this.padding=j.padding,this.text=j.text,this.createVisual(),H.prototype.restoreState.call(this,E),this.setSize()},c.prototype.scale=function(E,j){H.prototype.scale.call(this,E,j),this.setSize(),this.sizeText(),this.positionTextEditor()},c.typeName="TextMarker",c.title="Text marker",c.icon='',c}(Qe),ye=function(H){function c(E,j,X){var G=H.call(this,E,j,X)||this;return G.color="transparent",G.lineWidth=3,G.drawing=!1,G.pixelRatio=1,G.color=X.defaultColor,G.lineWidth=X.defaultStrokeWidth,G.pixelRatio=X.freehandPixelRatio,G.setColor=G.setColor.bind(G),G.addCanvas=G.addCanvas.bind(G),G.finishCreation=G.finishCreation.bind(G),G.setLineWidth=G.setLineWidth.bind(G),G.colorPanel=new _e("Color",X.defaultColorSet,X.defaultColor),G.colorPanel.onColorChanged=G.setColor,G.lineWidthPanel=new ht("Line width",X.defaultStrokeWidths,X.defaultStrokeWidth),G.lineWidthPanel.onWidthChanged=G.setLineWidth,G}return Re(c,H),c.prototype.ownsTarget=function(E){return!(!H.prototype.ownsTarget.call(this,E)&&E!==this.visual&&E!==this.drawingImage)},c.prototype.createVisual=function(){this.visual=ue.createGroup(),this.drawingImage=ue.createImage(),this.visual.appendChild(this.drawingImage);var E=ue.createTransform();this.visual.transform.baseVal.appendItem(E),this.addMarkerVisualToContainer(this.visual)},c.prototype.pointerDown=function(E,j){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(E.x,E.y),this.drawing=!0):H.prototype.pointerDown.call(this,E,j)},c.prototype.manipulate=function(E){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(E.x,E.y),this.canvasContext.stroke()):H.prototype.manipulate.call(this,E)},c.prototype.resize=function(E){H.prototype.resize.call(this,E),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},c.prototype.pointerUp=function(E){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):H.prototype.pointerUp.call(this,E)},c.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},c.prototype.select=function(){this.state==="creating"&&this.finishCreation(),H.prototype.select.call(this)},c.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),H.prototype.deselect.call(this)},c.prototype.finishCreation=function(){for(var E=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),j=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],X=j[0],G=j[1],pe=j[2],We=j[3],nt=!1,gt=0;gt0&&(nt=!0,gtWe&&(We=gt),Ge>pe&&(pe=Ge));if(nt){this.left=X/this.pixelRatio,this.top=G/this.pixelRatio,this.width=(pe-X)/this.pixelRatio,this.height=(We-G)/this.pixelRatio;var Dt=document.createElement("canvas");Dt.width=pe-X,Dt.height=We-G,Dt.getContext("2d").putImageData(this.canvasContext.getImageData(X,G,pe-X,We-G),0,0),this.drawingImgUrl=Dt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},c.prototype.setDrawingImage=function(){ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},c.prototype.setColor=function(E){this.color=E,this.colorChanged(E)},c.prototype.setLineWidth=function(E){this.lineWidth=E},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({drawingImgUrl:this.drawingImgUrl},H.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){this.createVisual(),H.prototype.restoreState.call(this,E),this.drawingImgUrl=E.drawingImgUrl,this.setDrawingImage()},c.prototype.scale=function(E,j){H.prototype.scale.call(this,E,j),this.setDrawingImage()},c.typeName="FreehandMarker",c.title="Freehand marker",c.icon='',c}(Qe),ce=function(H){function c(E,j,X){var G=H.call(this,E,X||'')||this;return G.typeBoxes=[],G.currentType=j,G.setCurrentType=G.setCurrentType.bind(G),G}return Re(c,H),c.prototype.getUi=function(){var E=this,j=document.createElement("div");j.style.display="flex",j.style.overflow="hidden",j.style.flexGrow="2";for(var X=function(We){var nt="both";switch(We){case 0:nt="both";break;case 1:nt="start";break;case 2:nt="end";break;case 3:nt="none"}var gt=document.createElement("div");if(gt.style.display="flex",gt.style.flexGrow="2",gt.style.alignItems="center",gt.style.justifyContent="space-between",gt.style.padding="5px",gt.style.borderWidth="2px",gt.style.borderStyle="solid",gt.style.borderColor=nt===G.currentType?G.uiStyleSettings.toolboxAccentColor:"transparent",gt.addEventListener("click",function(){E.setCurrentType(nt,gt)}),j.appendChild(gt),nt==="both"||nt==="start"){var Ge=document.createElement("div");Ge.style.display="flex",Ge.style.alignItems="center",Ge.style.minHeight="20px",Ge.innerHTML=``,Ge.style.marginLeft="5px",gt.appendChild(Ge)}var Dt=document.createElement("div");Dt.style.display="flex",Dt.style.alignItems="center",Dt.style.minHeight="20px",Dt.style.flexGrow="2";var Ut=document.createElement("hr");if(Ut.style.minWidth="20px",Ut.style.border="0px",Ut.style.borderTop="3px solid "+(G.uiStyleSettings!==void 0?G.uiStyleSettings.toolboxColor:"#eeeeee"),Ut.style.flexGrow="2",Dt.appendChild(Ut),gt.appendChild(Dt),nt==="both"||nt==="end"){var rr=document.createElement("div");rr.style.display="flex",rr.style.alignItems="center",rr.style.minHeight="20px",rr.innerHTML=``,rr.style.marginRight="5px",gt.appendChild(rr)}G.typeBoxes.push(gt)},G=this,pe=0;pe<4;pe++)X(pe);return j},c.prototype.setCurrentType=function(E,j){var X=this;this.currentType=E,this.typeBoxes.forEach(function(G){G.style.borderColor=G===j?X.uiStyleSettings!==void 0?X.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},c}(Pe),me=function(H){function c(E,j,X){var G=H.call(this,E,j,X)||this;return G.arrowType="end",G.arrowBaseHeight=10,G.arrowBaseWidth=10,G.getArrowPoints=G.getArrowPoints.bind(G),G.setArrowType=G.setArrowType.bind(G),G.arrowTypePanel=new ce("Arrow type","end"),G.arrowTypePanel.onArrowTypeChanged=G.setArrowType,G}return Re(c,H),c.prototype.ownsTarget=function(E){return!(!H.prototype.ownsTarget.call(this,E)&&E!==this.arrow1&&E!==this.arrow2)},c.prototype.getArrowPoints=function(E,j){var X=this.arrowBaseWidth+2*this.strokeWidth,G=this.arrowBaseHeight+2*this.strokeWidth;return E-X/2+","+(j+G/2)+" "+E+","+(j-G/2)+" "+(E+X/2)+","+(j+G/2)},c.prototype.createTips=function(){this.arrow1=ue.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ue.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow2)},c.prototype.pointerDown=function(E,j){H.prototype.pointerDown.call(this,E,j),this.state==="creating"&&this.createTips()},c.prototype.adjustVisual=function(){if(H.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",ue.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ue.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var E=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),j=this.arrow1.transform.baseVal.getItem(0);j.setRotate(E,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(j,0);var X=this.arrow2.transform.baseVal.getItem(0);X.setRotate(E+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(X,0)}},c.prototype.setArrowType=function(E){this.arrowType=E,this.adjustVisual(),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({arrowType:this.arrowType},H.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){H.prototype.restoreState.call(this,E);var j=E;this.arrowType=j.arrowType,this.createTips(),this.adjustVisual()},c.typeName="ArrowMarker",c.title="Arrow marker",c.icon='',c}(lt),te=function(H){function c(E,j,X){var G=H.call(this,E,j,X)||this;return G.fillColor=X.defaultFillColor,G.strokeWidth=0,G.fillPanel=new _e("Color",X.defaultColorSet,X.defaultFillColor),G.fillPanel.onColorChanged=G.setFillColor,G}return Re(c,H),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=H.prototype.getState.call(this);return E.typeName=c.typeName,E},c.typeName="CoverMarker",c.title="Cover marker",c.icon='',c}(Ve),re=function(H){function c(E,j,X,G){var pe=H.call(this,E,G||'')||this;return pe.opacities=[],pe.opacityBoxes=[],pe.opacities=j,pe.currentOpacity=X,pe.setCurrentOpacity=pe.setCurrentOpacity.bind(pe),pe}return Re(c,H),c.prototype.getUi=function(){var E=this,j=document.createElement("div");return j.style.display="flex",j.style.overflow="hidden",j.style.flexGrow="2",j.style.justifyContent="space-between",this.opacities.forEach(function(X){var G=document.createElement("div");G.style.display="flex",G.style.alignItems="center",G.style.justifyContent="center",G.style.padding="5px",G.style.borderWidth="2px",G.style.borderStyle="solid",G.style.borderColor=X===E.currentOpacity?E.uiStyleSettings.toolboxAccentColor:"transparent",G.addEventListener("click",function(){E.setCurrentOpacity(X,G)}),j.appendChild(G);var pe=document.createElement("div");pe.innerText=100*X+"%",G.appendChild(pe),E.opacityBoxes.push(G)}),j},c.prototype.setCurrentOpacity=function(E,j){var X=this;this.currentOpacity=E,this.opacityBoxes.forEach(function(G){G.style.borderColor=G===j?X.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},c}(Pe),oe=function(H){function c(E,j,X){var G=H.call(this,E,j,X)||this;return G.setOpacity=G.setOpacity.bind(G),G.fillColor=X.defaultHighlightColor,G.strokeWidth=0,G.opacity=X.defaultHighlightOpacity,G.fillPanel=new _e("Color",X.defaultColorSet,G.fillColor),G.fillPanel.onColorChanged=G.setFillColor,G.opacityPanel=new re("Opacity",X.defaultOpacitySteps,G.opacity),G.opacityPanel.onOpacityChanged=G.setOpacity,G}return Re(c,H),c.prototype.setOpacity=function(E){this.opacity=E,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=H.prototype.getState.call(this);return E.typeName=c.typeName,E},c.typeName="HighlightMarker",c.title="Highlight marker",c.icon='',c}(te),he='',Te=function(H){function c(E,j,X){var G=H.call(this,E,j,X)||this;return G.bgColor="transparent",G.tipPosition={x:0,y:0},G.tipBase1Position={x:0,y:0},G.tipBase2Position={x:0,y:0},G.tipMoving=!1,G.color=X.defaultStrokeColor,G.bgColor=X.defaultFillColor,G.fontFamily=X.defaultFontFamily,G.defaultSize={x:100,y:30},G.setBgColor=G.setBgColor.bind(G),G.getTipPoints=G.getTipPoints.bind(G),G.positionTip=G.positionTip.bind(G),G.setTipPoints=G.setTipPoints.bind(G),G.colorPanel=new _e("Text color",X.defaultColorSet,G.color,''),G.colorPanel.onColorChanged=G.setColor,G.bgColorPanel=new _e("Fill color",X.defaultColorSet,G.bgColor,he),G.bgColorPanel.onColorChanged=G.setBgColor,G.fontFamilyPanel=new Oe("Font",X.defaultFontFamilies,X.defaultFontFamily),G.fontFamilyPanel.onFontChanged=G.setFont,G.tipGrip=new at,G.tipGrip.visual.transform.baseVal.appendItem(ue.createTransform()),G.controlBox.appendChild(G.tipGrip.visual),G}return Re(c,H),c.prototype.ownsTarget=function(E){return H.prototype.ownsTarget.call(this,E)||this.tipGrip.ownsTarget(E)||this.tip===E},c.prototype.createTip=function(){ue.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ue.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},c.prototype.pointerDown=function(E,j){this.state==="new"&&H.prototype.pointerDown.call(this,E,j),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(j)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):H.prototype.pointerDown.call(this,E,j)},c.prototype.pointerUp=function(E){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,H.prototype.pointerUp.call(this,E);else{var j=this.state==="creating";H.prototype.pointerUp.call(this,E),this.setTipPoints(j),this.positionTip()}},c.prototype.manipulate=function(E){if(this.tipMoving){var j=this.unrotatePoint(E);this.tipPosition={x:j.x-this.manipulationStartLeft,y:j.y-this.manipulationStartTop},this.positionTip()}else H.prototype.manipulate.call(this,E)},c.prototype.setBgColor=function(E){this.bgRectangle&&this.tip&&(ue.setAttributes(this.bgRectangle,[["fill",E]]),ue.setAttributes(this.tip,[["fill",E]])),this.bgColor=E,this.fillColorChanged(E)},c.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},c.prototype.setTipPoints=function(E){E===void 0&&(E=!1);var j=Math.min(this.height/2,15),X=this.height/5;E&&(this.tipPosition={x:j+X/2,y:this.height+20});var G=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?G',c}(He),xe=function(H){function c(E,j,X){var G=H.call(this,E,j,X)||this;return G.fillColor="transparent",G.strokeColor="transparent",G.strokeWidth=0,G.strokeDasharray="",G.opacity=1,G.strokeColor=X.defaultColor,G.strokeWidth=X.defaultStrokeWidth,G.strokeDasharray=X.defaultStrokeDasharray,G.fillColor=X.defaultFillColor,G.setStrokeColor=G.setStrokeColor.bind(G),G.setFillColor=G.setFillColor.bind(G),G.setStrokeWidth=G.setStrokeWidth.bind(G),G.setStrokeDasharray=G.setStrokeDasharray.bind(G),G.setOpacity=G.setOpacity.bind(G),G.createVisual=G.createVisual.bind(G),G.strokePanel=new _e("Line color",ge(X.defaultColorSet,["transparent"]),X.defaultColor),G.strokePanel.onColorChanged=G.setStrokeColor,G.fillPanel=new _e("Fill color",ge(X.defaultColorSet,["transparent"]),G.fillColor,he),G.fillPanel.onColorChanged=G.setFillColor,G.strokeWidthPanel=new ht("Line width",X.defaultStrokeWidths,X.defaultStrokeWidth),G.strokeWidthPanel.onWidthChanged=G.setStrokeWidth,G.strokeStylePanel=new it("Line style",X.defaultStrokeDasharrays,X.defaultStrokeDasharray),G.strokeStylePanel.onStyleChanged=G.setStrokeDasharray,G.opacityPanel=new re("Opacity",X.defaultOpacitySteps,G.opacity),G.opacityPanel.onOpacityChanged=G.setOpacity,G}return Re(c,H),c.prototype.ownsTarget=function(E){return!(!H.prototype.ownsTarget.call(this,E)&&E!==this.visual)},c.prototype.createVisual=function(){this.visual=ue.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},c.prototype.pointerDown=function(E,j){H.prototype.pointerDown.call(this,E,j),this.state==="new"&&(this.createVisual(),this.moveVisual(E),this._state="creating")},c.prototype.manipulate=function(E){H.prototype.manipulate.call(this,E)},c.prototype.resize=function(E){H.prototype.resize.call(this,E),this.setSize()},c.prototype.setSize=function(){H.prototype.setSize.call(this),ue.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},c.prototype.pointerUp=function(E){H.prototype.pointerUp.call(this,E),this.setSize()},c.prototype.setStrokeColor=function(E){this.strokeColor=E,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(E),this.stateChanged()},c.prototype.setFillColor=function(E){this.fillColor=E,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(E),this.stateChanged()},c.prototype.setStrokeWidth=function(E){this.strokeWidth=E,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},c.prototype.setStrokeDasharray=function(E){this.strokeDasharray=E,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},c.prototype.setOpacity=function(E){this.opacity=E,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},H.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){var j=E;this.fillColor=j.fillColor,this.strokeColor=j.strokeColor,this.strokeWidth=j.strokeWidth,this.strokeDasharray=j.strokeDasharray,this.opacity=j.opacity,this.createVisual(),H.prototype.restoreState.call(this,E),this.setSize()},c.prototype.scale=function(E,j){H.prototype.scale.call(this,E,j),this.setSize()},c.typeName="EllipseMarker",c.title="Ellipse marker",c.icon='',c}(Qe),Be=function(H){function c(E,j,X){return H.call(this,E,j,X)||this}return Re(c,H),Object.defineProperty(c.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),c.prototype.ownsTarget=function(E){return!(!H.prototype.ownsTarget.call(this,E)&&E!==this.tip1&&E!==this.tip2)},c.prototype.createTips=function(){this.tip1=ue.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ue.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.tip2)},c.prototype.pointerDown=function(E,j){H.prototype.pointerDown.call(this,E,j),this.state==="creating"&&this.createTips()},c.prototype.adjustVisual=function(){if(H.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ue.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var E=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),j=this.tip1.transform.baseVal.getItem(0);j.setRotate(E,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(j,0);var X=this.tip2.transform.baseVal.getItem(0);X.setRotate(E+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(X,0)}},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=H.prototype.getState.call(this);return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){H.prototype.restoreState.call(this,E),this.createTips(),this.adjustVisual()},c.typeName="MeasurementMarker",c.title="Measurement marker",c.icon='',c}(lt),Ye=function(H){function c(E,j,X){var G=H.call(this,E,j,X)||this;return G.strokePanel.colors=X.defaultColorSet,G.fillColor="transparent",G}return Re(c,H),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=H.prototype.getState.call(this);return E.typeName=c.typeName,E},c.typeName="EllipseFrameMarker",c.title="Ellipse frame marker",c.icon='',c}(xe),ut=function(){function H(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(H.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),H.prototype.addUndoStep=function(c){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(c)||(this.undoStack.push(c),JSON.stringify(this.lastRedoStep)!==JSON.stringify(c)&&this.redoStack.splice(0,this.redoStack.length))},H.prototype.replaceLastUndoStep=function(c){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=c)},H.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},H.prototype.undo=function(){if(this.undoStack.length>1){var c=this.undoStack.pop();return c!==void 0&&this.redoStack.push(c),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},H.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},H}(),qe=function(H){function c(E,j,X){var G=H.call(this,E,j,X)||this;return G.strokeColor="transparent",G.strokeWidth=0,G.strokeDasharray="",G.curveX=0,G.curveY=0,G.manipulationStartCurveX=0,G.manipulationStartCurveY=0,G.setStrokeColor=G.setStrokeColor.bind(G),G.setStrokeWidth=G.setStrokeWidth.bind(G),G.setStrokeDasharray=G.setStrokeDasharray.bind(G),G.positionGrips=G.positionGrips.bind(G),G.addControlGrips=G.addControlGrips.bind(G),G.adjustVisual=G.adjustVisual.bind(G),G.setupControlBox=G.setupControlBox.bind(G),G.resize=G.resize.bind(G),G.strokeColor=X.defaultColor,G.strokeWidth=X.defaultStrokeWidth,G.strokeDasharray=X.defaultStrokeDasharray,G.strokePanel=new _e("Line color",X.defaultColorSet,X.defaultColor),G.strokePanel.onColorChanged=G.setStrokeColor,G.strokeWidthPanel=new ht("Line width",X.defaultStrokeWidths,X.defaultStrokeWidth),G.strokeWidthPanel.onWidthChanged=G.setStrokeWidth,G.strokeStylePanel=new it("Line style",X.defaultStrokeDasharrays,X.defaultStrokeDasharray),G.strokeStylePanel.onStyleChanged=G.setStrokeDasharray,G}return Re(c,H),c.prototype.ownsTarget=function(E){return!(!H.prototype.ownsTarget.call(this,E)&&E!==this.visual&&E!==this.selectorCurve&&E!==this.visibleCurve&&!this.curveGrip.ownsTarget(E))},c.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},c.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorCurve=ue.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ue.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},c.prototype.pointerDown=function(E,j){H.prototype.pointerDown.call(this,E,j),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=E.x,this.curveY=E.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(j)&&(this.activeGrip=this.curveGrip,this._state="resize")},c.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ue.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},c.prototype.setupControlBox=function(){H.prototype.setupControlBox.call(this),this.curveControlLine1=ue.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ue.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},c.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,H.prototype.addControlGrips.call(this)},c.prototype.positionGrips=function(){H.prototype.positionGrips.call(this);var E=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-E/2,this.curveY-E/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},c.prototype.manipulate=function(E){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+E.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+E.y-this.manipulationStartY),H.prototype.manipulate.call(this,E)},c.prototype.resize=function(E){this.activeGrip===this.curveGrip&&(this.curveX=E.x,this.curveY=E.y),H.prototype.resize.call(this,E),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},c.prototype.setStrokeColor=function(E){this.strokeColor=E,this.adjustVisual(),this.colorChanged(E)},c.prototype.setStrokeWidth=function(E){this.strokeWidth=E,this.adjustVisual()},c.prototype.setStrokeDasharray=function(E){this.strokeDasharray=E,this.adjustVisual()},c.prototype.scale=function(E,j){this.curveX=this.curveX*E,this.curveY=this.curveY*j,H.prototype.scale.call(this,E,j)},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},H.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){H.prototype.restoreState.call(this,E);var j=E;this.strokeColor=j.strokeColor,this.strokeWidth=j.strokeWidth,this.strokeDasharray=j.strokeDasharray,this.curveX=j.curveX,this.curveY=j.curveY,this.createVisual(),this.adjustVisual()},c.typeName="CurveMarker",c.title="Curve marker",c.icon='',c}(Xe),yt=function(){function H(c,E){E===void 0&&(E=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=c,this.cancelable=E}return Object.defineProperty(H.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),H.prototype.preventDefault=function(){this._defaultPrevented=!0},H}(),xt=function(H){function c(E,j,X){var G=H.call(this,E,!1)||this;return G.dataUrl=j,G.state=X,G}return Re(c,H),c}(yt),et=function(H){function c(E,j,X){X===void 0&&(X=!1);var G=H.call(this,E,X)||this;return G.marker=j,G}return Re(c,H),c}(yt),Wt=function(){function H(){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 H.prototype.addEventListener=function(c,E){this[c].push(E)},H.prototype.removeEventListener=function(c,E){var j=this[c].indexOf(E);j>-1&&this[c].splice(j,1)},H}(),kt=function(){function H(c){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Le,this._isOpen=!1,this.undoRedoManager=new ut,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 Wt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=H.instanceCounter++,this.styles=new tt(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=c,this.targetRoot=document.body,this.width=c.clientWidth,this.height=c.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(H.prototype,"ALL_MARKER_TYPES",{get:function(){return[rt,ye,me,He,Ye,xe,oe,Te,Be,te,lt,qe]},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[rt,ye,me,He,xe,oe,Te]},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"BASIC_MARKER_TYPES",{get:function(){return[rt,ye,me,He,oe]},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(c){var E=this;this._availableMarkerTypes.splice(0),c.forEach(function(j){if(typeof j=="string"){var X=E.ALL_MARKER_TYPES.find(function(G){return G.typeName===j});X!==void 0&&E._availableMarkerTypes.push(X)}else E._availableMarkerTypes.push(j)})},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(c){this._zoomLevel=c,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),H.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Me.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},H.prototype.show=function(){var c=this;this.styles.styleSheetRoot===void 0&&Ke.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Ke.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(E){return E(new yt(c))})},H.prototype.render=function(){return ke(this,void 0,void 0,function(){var c;return De(this,function(E){switch(E.label){case 0:return this.setCurrentMarker(),(c=new $e).naturalSize=this.renderAtNaturalSize,c.imageType=this.renderImageType,c.imageQuality=this.renderImageQuality,c.markersOnly=this.renderMarkersOnly,c.width=this.renderWidth,c.height=this.renderHeight,[4,c.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return E.sent(),[4,c.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,E.sent()]}})})},H.prototype.close=function(c){var E=this;if(c===void 0&&(c=!1),this.isOpen){var j=!1;c||this.eventListeners.beforeclose.forEach(function(X){var G=new yt(E,!0);X(G),G.defaultPrevented&&(j=!0)}),j||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(X){return X(new yt(E))}),this.detachEvents(),this._isOpen=!1)}},H.prototype.addMarkersToToolbar=function(){for(var c,E=[],j=0;jthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*c:this.editorCanvas.clientWidth,j=E',c.title="Powered by marker.js",c.style.display="grid",c.style.alignItems="center",c.style.justifyItems="center",c.style.padding="3px",c.style.width="20px",c.style.height="20px",this.logoUI.appendChild(c),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},H.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")},H.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"},H.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},H.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var c=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=c+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new ve(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(c),1),c.dispose()},H.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())},H.prototype.toolbarButtonClicked=function(c,E){if(c==="marker"&&E!==void 0)this.createNewMarker(E);else if(c==="action")switch(E){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},H.prototype.deleteSelectedMarker=function(){var c=this;if(this._currentMarker!==void 0){var E=!1;if(this.eventListeners.markerbeforedelete.forEach(function(X){var G=new et(c,c._currentMarker,!0);X(G),G.defaultPrevented&&(E=!0)}),!E){var j=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(X){return X(new et(c,j))})}}},H.prototype.clear=function(){var c=this,E=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(pe){var We=new et(c,void 0,!0);pe(We),We.defaultPrevented&&(E=!0)}),!E)){this.setCurrentMarker();for(var j=function(pe){var We=X.markers[pe];X.setCurrentMarker(X.markers[pe]),X._currentMarker.dispose(),X.markerImage.removeChild(X._currentMarker.container),X.markers.splice(X.markers.indexOf(X._currentMarker),1),X.eventListeners.markerdelete.forEach(function(nt){return nt(new et(c,We))})},X=this,G=this.markers.length-1;G>=0;G--)j(G);this.addUndoStep()}},Object.defineProperty(H.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),H.prototype.showNotesEditor=function(){var c;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(c=this._currentMarker.notes)!==null&&c!==void 0?c:"",this.overlayContainer.appendChild(this.notesArea))},H.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)},H.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},H.prototype.addUndoStep=function(){var c=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var E=this.getState(),j=this.undoRedoManager.getLastUndoStep();if(!j||j.width===E.width&&j.height===E.height){var X=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(E),X1&&this.panTo({x:c.clientX,y:c.clientY}))},H.prototype.onPointerUp=function(c){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(c.clientX,c.clientY)),this.isDragging=!1,this.addUndoStep()},H.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},H.prototype.onKeyUp=function(c){this._currentMarker===void 0||this.notesArea!==void 0||c.key!=="Delete"&&c.key!=="Backspace"||this.deleteSelectedMarker()},H.prototype.clientToLocalCoordinates=function(c,E){var j=this.markerImage.getBoundingClientRect();return{x:(c-j.left)/this.zoomLevel,y:(E-j.top)/this.zoomLevel}},H.prototype.onWindowResize=function(){this.positionUI()},H.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var c=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=c+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},H.prototype.addLicenseKey=function(c){Me.addKey(c)},H.prototype.addEventListener=function(c,E){this.eventListeners.addEventListener(c,E)},H.prototype.removeEventListener=function(c,E){this.eventListeners.removeEventListener(c,E)},H.prototype.renderState=function(c){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(c),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(H.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),H.prototype.focus=function(){var c=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(E){return E(new yt(c))}))},H.prototype.blur=function(){var c=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(E){return E(new yt(c))}))},H.instanceCounter=0,H}();/* **********************************
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 Gt=function(H,c){return(Gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,j){E.__proto__=j}||function(E,j){for(var X in j)Object.prototype.hasOwnProperty.call(j,X)&&(E[X]=j[X])})(H,c)};function Kt(H,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");function E(){this.constructor=H}Gt(H,c),H.prototype=c===null?Object.create(c):(E.prototype=c.prototype,new E)}function Pt(H,c,E,j){return new(E||(E=Promise))(function(X,G){function pe(gt){try{nt(j.next(gt))}catch(Ge){G(Ge)}}function We(gt){try{nt(j.throw(gt))}catch(Ge){G(Ge)}}function nt(gt){var Ge;gt.done?X(gt.value):(Ge=gt.value,Ge instanceof E?Ge:new E(function(Dt){Dt(Ge)})).then(pe,We)}nt((j=j.apply(H,c||[])).next())})}function wr(H,c){var E,j,X,G,pe={label:0,sent:function(){if(1&X[0])throw X[1];return X[1]},trys:[],ops:[]};return G={next:We(0),throw:We(1),return:We(2)},typeof Symbol=="function"&&(G[Symbol.iterator]=function(){return this}),G;function We(nt){return function(gt){return function(Ge){if(E)throw new TypeError("Generator is already executing.");for(;pe;)try{if(E=1,j&&(X=2&Ge[0]?j.return:Ge[0]?j.throw||((X=j.return)&&X.call(j),0):j.next)&&!(X=X.call(j,Ge[1])).done)return X;switch(j=0,X&&(Ge=[2&Ge[0],X.value]),Ge[0]){case 0:case 1:X=Ge;break;case 4:return pe.label++,{value:Ge[1],done:!1};case 5:pe.label++,j=Ge[1],Ge=[0];continue;case 7:Ge=pe.ops.pop(),pe.trys.pop();continue;default:if(!(X=pe.trys,(X=X.length>0&&X[X.length-1])||Ge[0]!==6&&Ge[0]!==2)){pe=0;continue}if(Ge[0]===3&&(!X||Ge[1]>X[0]&&Ge[1]0&&E>0){var j=new lr(c,E),X=j.ratio>=1?20:j.getHorizontalLength(20),G=j.ratio<1?20:j.getVerticalLength(20),pe=document.createElementNS("http://www.w3.org/2000/svg","svg");pe.setAttribute("xmlns","http://www.w3.org/2000/svg"),pe.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(pe);var We=St.createDefs();pe.appendChild(We);var nt=St.createElement("clipPath",[["id","text-bg-clip"]]);We.appendChild(nt);var gt=St.createPath(St.getHollowRectanglePath((24-X)/2,(24-G)/2,X,G,(24-X)/2+2,(24-G)/2+2,X-4,G-4));pe.appendChild(gt);var Ge=St.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ge.appendChild(St.createTSpan(c+":"+E)),pe.appendChild(Ge);var Dt=Ge.getBBox();St.setAttributes(Ge,[["x",((24-Dt.width)/2).toString()],["y",((24-Dt.height)/2-Dt.y).toString()]]);var Ut=St.createPath(St.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Dt.width))/2,(24-Math.ceil(Dt.height))/2,Math.ceil(Dt.width),Math.ceil(Dt.height)));return nt.appendChild(Ut),St.setAttributes(gt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(pe),pe.outerHTML}return''},H}(),Ar=function(H){function c(E,j,X){var G=H.call(this,E,j)||this;return G.isDropdownOpen=!1,G.onClick=G.dropdownButtonClicked,G.dropdownButtons=X,G}return Kt(c,H),c.prototype.setupDropdown=function(){var E=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(j){j.className=E.className,j.colorsClassName=E.colorsClassName,E.dropdownBlock.appendChild(j.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},c.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},c.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},c.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},c.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},c.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},c}(Tt),_t=function(){function H(c,E){this.GRIP_SIZE=10,this.color=c,this.fillColor=E,this.visual=St.createGroup(),this.visual.appendChild(St.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(St.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return H.prototype.ownsTarget=function(c){return c===this.visual||c===this.visual.childNodes[0]||c===this.visual.childNodes[1]},H.prototype.setCenter=function(c,E){this.visual.childNodes.forEach(function(j){return St.setAttributes(j,[["cx",c.toString()],["cy",E.toString()]])})},H}(),kr=function(){function H(c,E,j,X){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=c,this.canvasHeight=E,this.margin=j,this.container=X,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(H.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(c){this._aspectRatio=c,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(c){this._isGridVisible=c,this.gridContainer&&St.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(c){this._zoomFactor=c,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),H.prototype.open=function(){var c=this;this.cropShadeElement=St.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=St.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var E=0;Ethis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-E.height/2),St.setAttributes(this.cropRectElement,[["x",E.x.toString()],["y",E.y.toString()],["width",E.width.toString()],["height",E.height.toString()]]);var j=E.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(G,pe){var We=E.y+j*(pe+1);St.setAttributes(G,[["x1",""+E.x],["y1",""+We],["x2",""+(E.x+E.width)],["y2",""+We]])});var X=E.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(G,pe){var We=E.x+X*(pe+1);St.setAttributes(G,[["x1",""+We],["y1",""+E.y],["x2",""+We],["y2",""+(E.y+E.height)]])}),St.setAttributes(this.cropShadeElement,[["d",St.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,E.x,E.y,E.width,E.height)]]),this.topLeftGrip.setCenter(E.x,E.y),this.topRightGrip.setCenter(E.x+E.width,E.y),this.bottomLeftGrip.setCenter(E.x,E.y+E.height),this.bottomRightGrip.setCenter(E.x+E.width,E.y+E.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},H.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)},H.prototype.clientToLocalCoordinates=function(c,E){var j=this.container.getBoundingClientRect();return{x:c-j.left+this.margin,y:E-j.top+this.margin}},H.prototype.onPointerDown=function(c){this.container.setPointerCapture(c.pointerId),this.previousPoint=this.clientToLocalCoordinates(c.clientX,c.clientY),this.cropRectElement===c.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(c.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(c.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(c.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(c.target)&&(this.activeGrip=this.bottomRightGrip)},H.prototype.onPointerMove=function(c){if(this.isMoving)this.move(this.clientToLocalCoordinates(c.clientX,c.clientY));else if(this.activeGrip){var E=this.clientToLocalCoordinates(c.clientX,c.clientY);this.resize(E)}c.preventDefault()},H.prototype.onPointerUp=function(c){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(c.pointerId)},H.prototype.move=function(c){var E=c.x-this.previousPoint.x,j=c.y-this.previousPoint.y;this.zoomFactor!==1&&(E=-E/this.zoomFactor,j=-j/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+E),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+j),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=c},H.prototype.resize=function(c){var E=Object.assign({},this.cropRect),j=c.x-this.previousPoint.x,X=c.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:E.x+jthis.canvasWidth*this.zoomFactor&&(j=this.canvasWidth*this.zoomFactor-E.width),E.width+=j}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(E.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(j),E.height=this.aspectRatio.getVerticalLength(E.width)):(E.y+=X,E.height=this.cropRect.y+this.cropRect.height-E.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?E.height=this.aspectRatio.getVerticalLength(E.width):E.height+=X}E.width<10&&(E.x=this.cropRect.x,E.width=10),E.height<10&&(E.y=this.cropRect.y,E.height=10),this.previousPoint=c,E.x>=this.margin&&E.y>=this.margin&&E.x-this.margin+E.width<=this.canvasWidth&&E.y-this.margin+E.height<=this.canvasHeight&&(this.cropRect=E,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},H.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var c=this.cropRect.x+this.cropRect.width/2,E=this.cropRect.y+this.cropRect.height/2,j=this.aspectRatio.getHorizontalLength(this.cropRect.height),X=this.aspectRatio.getVerticalLength(this.cropRect.width);j/this.canvasWidththis.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=c-this.cropRect.width/2,this.cropRect.y=E-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},H.prototype.getRescaledRect=function(c,E,j,X,G,pe){var We=j/c,nt=X/E;return{x:(G.x-pe)*We+pe,y:(G.y-pe)*nt+pe,width:G.width*We,height:G.height*nt}},H.prototype.scaleCanvas=function(c,E){var j=this.getRescaledRect(this.canvasWidth,this.canvasHeight,c,E,this.cropRect,this.margin);this.canvasWidth=c,this.canvasHeight=E,this.onCropChange&&this.onCropChange(j),this.setCropRectangle(j)},H}(),Vr=function(){function H(c){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=c,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(H.prototype,"angle",{get:function(){return this._angle},set:function(c){this._angle=c,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),H.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},H.prototype.onPointerDown=function(c){this.controlContainer.setPointerCapture(c.pointerId),this.isDragging=!0,this.previousPoint={x:c.clientX,y:c.clientY}},H.prototype.onPointerMove=function(c){this.isDragging&&(this.onAngleChange&&this.onAngleChange((c.clientX-this.previousPoint.x)/5),this.previousPoint.x=c.clientX)},H.prototype.onPointerUp=function(c){this.isDragging&&this.onAngleChange&&this.onAngleChange((c.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(c.pointerId)},H.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var c=this.angleLabelText.getBBox();St.setAttributes(this.angleLabelElement,[["x",((this.width-c.width)/2).toString()],["y",(this.height/2).toString()]])}},H.prototype.positionScaleShape=function(){if(this.scaleShape){var c=this.scaleShape.transform.baseVal.getItem(0);c.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(c,0)}},H.prototype.getVisual=function(){var c=document.createElementNS("http://www.w3.org/2000/svg","svg");c.setAttribute("xmlns","http://www.w3.org/2000/svg"),c.setAttribute("width",this.width+"px"),c.setAttribute("height",this.height+"px"),c.setAttribute("viewBox","0 0 "+this.width+" "+this.height),c.style.flexShrink="0",document.body.appendChild(c);for(var E="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,j=1;j<=this.width/5+10;j++){var X=j%5==0?this.height/3:this.height/6;E+="h4v"+-X+"h1v"+X}E+="v1H0Z",this.scaleShape=St.createPath(E);var G=St.createTransform();this.scaleShape.transform.baseVal.appendItem(G),c.appendChild(this.scaleShape),this.angleLabelElement=St.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=St.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var pe=St.createTSpan("");return pe.innerHTML="°",this.angleLabelElement.appendChild(pe),c.appendChild(this.angleLabelElement),document.body.removeChild(c),c},H}(),rn=function(){function H(){this.naturalSize=!1,this.imageType="image/png"}return H.prototype.rasterize=function(c,E,j,X,G,pe,We){var nt=this;return new Promise(function(gt){var Ge=document.createElement("canvas");Ge.width=c.width.baseVal.value-2*X,Ge.height=c.height.baseVal.value-2*X;var Dt=1,Ut=1;nt.naturalSize===!0?(Dt=E.naturalWidth/(c.width.baseVal.value-2*X)/pe,Ut=E.naturalHeight/(c.height.baseVal.value-2*X)/We,Ge.width=E.naturalWidth/pe,Ge.height=E.naturalHeight/We):nt.width!==void 0&&nt.height!==void 0&&(Dt=nt.width/j.width,Ut=nt.height/j.height,Ge.width*=Dt,Ge.height*=Ut);var rr=Ge.getContext("2d");rr.translate(Ge.width/2,Ge.height/2),rr.rotate(G*Math.PI/180),rr.scale(pe,We),rr.translate(-Ge.width/2,-Ge.height/2),rr.drawImage(E,0,0,Ge.width,Ge.height);var Xr=document.createElement("canvas");Xr.width=j.width*Dt,Xr.height=j.height*Ut,Xr.getContext("2d").putImageData(rr.getImageData((j.x-X)*Dt,(j.y-X)*Ut,j.width*Dt,j.height*Ut),0,0),gt(Xr.toDataURL(nt.imageType,nt.imageQuality))})},H}(),Fe=function(){function H(c){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=H.instanceCounter++,this.styles=new Et(this.instanceNo),this.target=c,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(H.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(c){this._zoomToCropEnabled=c,c?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(c){this._isGridVisible=c,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"gridLines",{get:function(){return this._gridLines},set:function(c){this._gridLines=c,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(c){this._rotationAngle=c,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"aspectRatio",{get:function(){var c;return(c=this._aspectRatio)!==null&&c!==void 0?c:this.aspectRatios[0]},set:function(c){this._aspectRatio=c},enumerable:!1,configurable:!0}),H.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},H.prototype.show=function(){this.showUI(),this.open()},H.prototype.close=function(c){c===void 0&&(c=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),c||this.closeEventListeners.forEach(function(E){return E()}),this._isOpen=!1)},H.prototype.addRenderEventListener=function(c){this.renderEventListeners.push(c)},H.prototype.removeRenderEventListener=function(c){this.renderEventListeners.indexOf(c)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(c),1)},H.prototype.addCloseEventListener=function(c){this.closeEventListeners.push(c)},H.prototype.removeCloseEventListener=function(c){this.closeEventListeners.indexOf(c)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(c),1)},H.prototype.setupResizeObserver=function(){var c=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){c.resize(c.target.clientWidth,c.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},H.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var c=1*this.target.clientWidth/this.target.clientHeight,E=this.contentDiv.clientWidth/c>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*c:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,j=E+2*this.CANVAS_MARGINc+this.CANVAS_MARGIN?this.target.offsetTop-(c+this.CANVAS_MARGIN):0;this.coverDiv.style.top=E+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},H.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},H.prototype.addTopToolbar=function(){var c=this;this.topToolbar=new Rt,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var E=new Mt;E.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(E);var j=[];this.aspectRatios.forEach(function(Ut){var rr=new Tt(Lr.getIcon(Ut.horizontal,Ut.vertical),Ut.horizontal===0&&Ut.vertical===0?"FREE":Ut.horizontal+":"+Ut.vertical);rr.onClick=function(){return c.ratioButtonClicked(Ut)},j.push(rr)}),this.aspectRatioButton=new Ar(Lr.getIcon(0,0),"Aspect ratio",j),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,E.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var X=new Tt('',"Toggle grid");X.isActive=this.isGridVisible,X.onClick=function(){c.isGridVisible=!c.isGridVisible,X.isActive=c.isGridVisible},E.addButton(X);var G=new Tt('',"Zoom to selection");if(G.isActive=this.zoomToCropEnabled,G.onClick=function(){c.zoomToCropEnabled=!c.zoomToCropEnabled,G.isActive=c.zoomToCropEnabled},E.addButton(G),!Wr.isLicensed){var pe=new pt;this.topToolbar.addElementBlock(pe);var We=document.createElement("div");We.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var nt=document.createElement("a");nt.style.color="currentColor",nt.href="https://markerjs.com/products/cropro",nt.target="_blank",nt.innerHTML='',We.appendChild(nt),pe.addElement(We)}var gt=new Mt;gt.minWidth=3*this.toolbarHeight+"px",gt.contentAlign="end",this.topToolbar.addButtonBlock(gt);var Ge=new Tt('',"OK");Ge.onClick=this.startRenderAndClose,gt.addButton(Ge),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ge.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Dt=new Tt('',"Close");Dt.onClick=this.close,gt.addButton(Dt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Dt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},H.prototype.addBottomToolbar=function(){var c=this;this.bottomToolbar=new Rt,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var E=new Mt;E.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(E);var j=new Tt('',"Rotate left");j.onClick=this.rotateLeftButtonClicked,E.addButton(j);var X=new Tt('',"Rotate right");X.onClick=this.rotateRightButtonClicked,E.addButton(X);var G=new pt;G.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(G),this.straightener=new Vr("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(gt){c.rotateBy(gt),c.straightener.angle=c.rotationAngle},G.addElement(this.straightener.getUI());var pe=new Mt;pe.minWidth=2*this.toolbarHeight+"px",pe.contentAlign="end",this.bottomToolbar.addButtonBlock(pe);var We=new Tt('',"Flip horizontal");We.onClick=this.flipHorizontallyButtonClicked,pe.addButton(We);var nt=new Tt('',"Flip vertical");nt.onClick=this.flipVerticallyButtonClicked,pe.addButton(nt)},H.prototype.ratioButtonClicked=function(c){this.aspectRatio=c,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},H.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Lr.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},H.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new lr(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},H.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},H.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},H.prototype.restoreState=function(c){if(c){var E=this.cropLayer.getRescaledRect(c.width,c.height,this.imageWidth,this.imageHeight,c.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(E),this.cropRectChanged(E),this.flippedHorizontally=c.flippedHorizontally,this.flippedVertically=c.flippedVertically,this.applyFlip(),this.rotationAngle=c.rotationAngle,this.applyRotation()}},H.prototype.clientToLocalCoordinates=function(c,E){var j=this.cropImage.getBoundingClientRect();return{x:c-j.left,y:E-j.top}},H.prototype.onWindowResize=function(){this.positionUI()},H.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var c=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=c+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},H.prototype.rotateLeftButtonClicked=function(){var c=this.rotationAngle-90;this.rotationAngle%90!=0&&(c+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(c)},H.prototype.rotateRightButtonClicked=function(){var c=this.rotationAngle+90;this.rotationAngle%90!=0&&(c-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(c)},H.prototype.rotateTo=function(c){c=(c=c>180?c-360:c)<=-180?c+360:c,this.rotationAngle=c,this.applyRotation()},H.prototype.rotateBy=function(c){this.rotateTo((this.rotationAngle+c)%360)},H.prototype.applyRotation=function(){var c=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var E=this.editingTargetRotationContainer.transform.baseVal.getItem(0);E.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(E,0);var j=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/j.width,this.imageHeight/j.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=c},H.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},H.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},H.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},H.prototype.startRenderAndClose=function(){return Pt(this,void 0,void 0,function(){var c,E;return wr(this,function(j){switch(j.label){case 0:return[4,this.render()];case 1:return c=j.sent(),E=this.getState(),this.renderEventListeners.forEach(function(X){return X(c,E)}),this.close(!0),[2]}})})},H.prototype.render=function(){return Pt(this,void 0,void 0,function(){var c;return wr(this,function(E){switch(E.label){case 0:return(c=new rn).naturalSize=this.renderAtNaturalSize,c.imageType=this.renderImageType,c.imageQuality=this.renderImageQuality,c.width=this.renderWidth,c.height=this.renderHeight,this.unzoomFromCrop(),St.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,c.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return E.sent(),[4,c.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,E.sent()]}})})},H.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ct("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Ct("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ct("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var c=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ct("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*c)+`px;
height: `+(this.toolbarHeight-2*c)+`px;
padding: `+c+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ct("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ct("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new dt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new dt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Ct("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new Ct("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Ct("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new Ct("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*c)+`px;
padding: `+c+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Ct("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},H.instanceCounter=0,H}(),ct=Q("8hTe"),Nt=Q.n(ct),$t=/]*>/g;function Qt(H){var c=document.createElement("div");return c.innerHTML=H,c.childNodes.length===0?"":c.childNodes[0].nodeValue}var tr=Ee.a=function(H){var c=H.value,E=c===void 0?"":c,j=H.edit,X=j===void 0?!1:j,G=H.className,pe=H.showTextOnly,We=H.showLines,nt=H.replaces,gt=H.zoomImg,Ge=H.hasMask,Dt=H.style,Ut=Dt===void 0?{}:Dt,rr=H.stylesPrev,Xr=rr===void 0?{}:rr,Yr=String(E),mr=Object(k.useRef)(),qr=Object(k.useRef)(),Gn=Object(k.useState)(""),Pr=Object(F.a)(Gn,2),$r=Pr[0],Hr=Pr[1],bn=Object(k.useState)("office"),nn=Object(F.a)(bn,2),mn=nn[0],dn=nn[1],hi=function(){var Vt=new Fe(qr.current);Vt.displayMode="popup",Vt.addRenderEventListener(function(){var Sr=Object(P.a)(M.a.mark(function zt(hr){var Jt;return M.a.wrap(function(ur){for(;;)switch(ur.prev=ur.next){case 0:return mr.current.style.display="none",ur.next=3,Object(Ie.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:hr}});case 3:Jt=ur.sent,Jt!=null&&Jt.id&&nt(qr.current.getAttribute("src").replace(ie.a.API_SERVER,""),"/api/attachments/".concat(Jt==null?void 0:Jt.id,"?type=").concat(Jt.content_type));case 5:case"end":return ur.stop()}},zt)}));return function(zt){return Sr.apply(this,arguments)}}()),Vt.show()},zn=function(){var Vt=new kt(qr.current);Vt.settings.displayMode="popup",Vt.addEventListener("render",function(){var Sr=Object(P.a)(M.a.mark(function zt(hr){var Jt;return M.a.wrap(function(ur){for(;;)switch(ur.prev=ur.next){case 0:if(mr.current.style.display="none",!qr.current){ur.next=6;break}return ur.next=4,Object(Ie.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:hr.dataUrl}});case 4:Jt=ur.sent,Jt!=null&&Jt.id&&nt(qr.current.getAttribute("src").replace(ie.a.API_SERVER,""),"/api/attachments/".concat(Jt==null?void 0:Jt.id,"?type=").concat(Jt.content_type));case 6:case"end":return ur.stop()}},zt)}));return function(zt){return Sr.apply(this,arguments)}}()),Vt.show(),window.markerArea=Vt},an=Object(k.useMemo)(function(){try{var or=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Vt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Sr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Yr=Yr.replace(or,"("+ie.a.API_SERVER+"/api/attachments/").replace(Vt,'"'+ie.a.API_SERVER+"/api/attachments/").replace(Sr,'"'+ie.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,`
`),Yr=Yr.replace(new RegExp("(?[TOC]
",R()),C()),zt=zt.replace(/(__special_katext_id_\d+__)/g,function(hn,ur){var _r=hr[ur],Kn=_r.type,Vn=_r.expression;return Object(de.renderToString)(Qt(Vn)||"",{displayMode:Kn==="block",throwOnError:!1,output:"html"})}),zt=zt.replace(/▁/g,"\u2581\u2581\u2581"),x(),pe){var Jt=document.createElement("div");return Jt.innerHTML=zt,Jt.innerText}return setTimeout(function(){return On()},500),zt},[Yr]),Jr=Object(k.useRef)();g.WebkitLineClamp=We,We&&(Ut=Object(_.a)(Object(_.a)({},Ut),g));function kn(or){var Vt=or.target;if(Vt.tagName.toUpperCase()==="IMG"){if(gt){var Sr=Vt.getAttribute("src");Hr(Sr),dn("image")}}else if(Vt.tagName.toUpperCase()==="A"){var zt=Vt.getAttribute("href");if(zt.indexOf("office")>-1)or.preventDefault(),Hr(zt),dn("office");else if(zt.indexOf("application/pdf")>-1)or.preventDefault(),Hr(zt),dn("pdf");else if(zt.indexOf("type=text")>-1)or.preventDefault(),Hr(zt),dn("html");else if(zt.startsWith("#")){or.preventDefault();var hr=document.getElementById(zt.replace("#",""));hr&&hr.scrollIntoView(!0)}}}var On=function(){var Vt,Sr=(Vt=Jr.current)===null||Vt===void 0?void 0:Vt.querySelectorAll("video");Sr==null||Sr.forEach(function(zt){if(zt.oncontextmenu=function(){return!1},zt.src.indexOf(".m3u8")>-1&&!zt.canPlayType("application/vnd.apple.mpegurl")){if(ee.a.isSupported()){var hr=new ee.a;hr.loadSource(zt.src),hr.attachMedia(zt)}}})};Object(k.useEffect)(function(){if(Jr.current&&an&&(an.match($t)&&window.PR.prettyPrint()),Jr.current)return Jr.current.addEventListener("click",kn),function(){Jr.current.removeEventListener("click",kn),x(),C()}},[an,Jr.current,kn]);var ci=function(Vt){if(!X)return;Vt.target.nodeName==="IMG"?(mr.current.style.display="flex",mr.current.style.width=Vt.target.clientWidth+"px",mr.current.style.height=Vt.target.clientHeight+"px",mr.current.style.top=Vt.target.offsetTop+"px",mr.current.style.left=Vt.target.offsetLeft+"px",qr.current.src=Vt.target.getAttribute("src")):mr.current.style.display="none"};return d.a.createElement("div",{style:{position:"relative"}},d.a.createElement("div",{ref:Jr,style:Object(_.a)({},Ut),className:"".concat(G||""," markdown-body ").concat(Nt.a.mdBody),onMouseOver:ci,dangerouslySetInnerHTML:{__html:an}}),d.a.createElement("div",{ref:mr,className:Nt.a.button},d.a.createElement($.a,null,d.a.createElement(V.a,{onClick:function(){return hi()}},"\u88C1\u526A"),d.a.createElement(V.a,{onClick:function(){return zn()}},"\u7F16\u8F91"))),d.a.createElement("img",{ref:qr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),d.a.createElement(be.a,{close:!0,data:$r,hasMask:Ge,type:$r!=null&&$r.length?mn:"",style:Object(_.a)({},Xr),onClose:function(){return Hr("")}}))}},"9VGf":function(mt,Ee,Q){"use strict";Q.d(Ee,"a",function(){return O});var ne=Q("q1tI"),$=Q.n(ne);function O(V,_){var P=Object(ne.useRef)();Object(ne.useEffect)(function(){P.current=V}),Object(ne.useEffect)(function(){function F(){P.current()}if(_!==null){var N=setInterval(F,_);return function(){return clearInterval(N)}}},[_])}},BU3w:function(mt,Ee,Q){"use strict";Q.d(Ee,"a",function(){return P});var ne=Q("MNnm"),$="rc-util-key";function O(F){if(F.attachTo)return F.attachTo;var N=document.querySelector("head");return N||document.body}function V(F){var N,M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ne.a)())return null;var k=document.createElement("style");if((N=M.csp)===null||N===void 0?void 0:N.nonce){var d;k.nonce=(d=M.csp)===null||d===void 0?void 0:d.nonce}k.innerHTML=F;var h=O(M),S=h.firstChild;return M.prepend&&h.prepend?h.prepend(k):M.prepend&&S?h.insertBefore(k,S):h.appendChild(k),k}var _=new Map;function P(F,N){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},k=O(M);if(!_.has(k)){var d=V("",M),h=d.parentNode;_.set(k,h),h.removeChild(d)}var S=Array.from(_.get(k).children).find(function(i){return i.tagName==="STYLE"&&i[$]===N});if(S){var m,p;if(((m=M.csp)===null||m===void 0?void 0:m.nonce)&&S.nonce!==((p=M.csp)===null||p===void 0?void 0:p.nonce)){var v;S.nonce=(v=M.csp)===null||v===void 0?void 0:v.nonce}return S.innerHTML!==F&&(S.innerHTML=F),S}var a=V(F,M);return a[$]=N,a}},Bd2K:function(mt,Ee,Q){(function(ne){ne(Q("VrN/"),Q("osHv"))})(function(ne){ne.defineOption("autoCloseTags",!1,function(M,k,d){if(d!=ne.Init&&d&&M.removeKeyMap("autoCloseTags"),!k)return;var h={name:"autoCloseTags"};(typeof k!="object"||k.whenClosing!==!1)&&(h["'/'"]=function(S){return P(S)}),(typeof k!="object"||k.whenOpening!==!1)&&(h["'>'"]=function(S){return V(S)}),M.addKeyMap(h)});var $=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],O=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function V(M){if(M.getOption("disableInput"))return ne.Pass;for(var k=M.listSelections(),d=[],h=M.getOption("autoCloseTags"),S=0;Sm.ch&&(s=s.slice(0,s.length-p.end+m.ch));var y=s.toLowerCase();if(!s||p.type=="string"&&(p.end!=m.ch||!/[\"\']/.test(p.string.charAt(p.string.length-1))||p.string.length==1)||p.type=="tag"&&i.close||p.string.indexOf("/")==m.ch-p.start-1||C&&F(C,y)>-1||N(M,v.mode.xmlCurrentContext&&v.mode.xmlCurrentContext(a)||[],s,m,!0))return ne.Pass;var R=typeof h=="object"&&h.emptyTags;if(R&&F(R,s)>-1){d[S]={text:"/>",newPos:ne.Pos(m.line,m.ch+2)};continue}var w=g&&F(g,y)>-1;d[S]={indent:w,text:">"+(w?`
`:"")+""+s+">",newPos:w?ne.Pos(m.line+1,0):ne.Pos(m.line,m.ch+1)}}for(var T=typeof h=="object"&&h.dontIndentOnAutoClose,S=k.length-1;S>=0;S--){var b=d[S];M.replaceRange(b.text,k[S].head,k[S].anchor,"+insert");var f=M.listSelections().slice(0);f[S]={head:b.newPos,anchor:b.newPos},M.setSelections(f),!T&&b.indent&&(M.indentLine(b.newPos.line,null,!0),M.indentLine(b.newPos.line+1,null,!0))}}function _(M,k){for(var d=M.listSelections(),h=[],S=k?"/":"",m=M.getOption("autoCloseTags"),p=typeof m=="object"&&m.dontIndentOnSlash,v=0;v"&&(C+=">"),h[v]=C}if(M.replaceSelections(h),d=M.listSelections(),!p)for(var v=0;v=0&&k[a]==d;a--)++v;h=p.to;for(var a=1;a0){for(var k=0;k1&&arguments[1]!==void 0?arguments[1]:"",k=[],d=0;dye.length)&&(ce=ye.length);for(var me=0,te=new Array(ce);me=ye.length?{done:!0}:{done:!1,value:ye[te++]}}}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 me=ye[Symbol.iterator](),me.next.bind(me)}function P(ye,ce){return ce={exports:{}},ye(ce,ce.exports),ce.exports}var F=P(function(ye){function ce(){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 me(te){ye.exports.defaults=te}ye.exports={defaults:ce(),getDefaults:ce,changeDefaults:me}}),N=F.defaults,M=F.getDefaults,k=F.changeDefaults,d=/[&<>"']/,h=/[&<>"']/g,S=/[<>"']|&(?!#?\w+;)/,m=/[<>"']|&(?!#?\w+;)/g,p={"&":"&","<":"<",">":">",'"':""","'":"'"},v=function(ce){return p[ce]};function a(ye,ce){if(ce){if(d.test(ye))return ye.replace(h,v)}else if(S.test(ye))return ye.replace(m,v);return ye}var i=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(ye){return ye.replace(i,function(ce,me){return me=me.toLowerCase(),me==="colon"?":":me.charAt(0)==="#"?me.charAt(1)==="x"?String.fromCharCode(parseInt(me.substring(2),16)):String.fromCharCode(+me.substring(1)):""})}var l=/(^|[^\[])\^/g;function C(ye,ce){ye=ye.source||ye,ce=ce||"";var me={replace:function(re,oe){return oe=oe.source||oe,oe=oe.replace(l,"$1"),ye=ye.replace(re,oe),me},getRegex:function(){return new RegExp(ye,ce)}};return me}var g=/[^\w:]/g,y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(ye,ce,me){if(ye){var te;try{te=decodeURIComponent(s(me)).replace(g,"").toLowerCase()}catch(re){return null}if(te.indexOf("javascript:")===0||te.indexOf("vbscript:")===0||te.indexOf("data:")===0)return null}ce&&!y.test(me)&&(me=u(ce,me));try{me=encodeURI(me).replace(/%25/g,"%")}catch(re){return null}return me}var w={},T=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,f=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(ye,ce){w[" "+ye]||(T.test(ye)?w[" "+ye]=ye+"/":w[" "+ye]=I(ye,"/",!0)),ye=w[" "+ye];var me=ye.indexOf(":")===-1;return ce.substring(0,2)==="//"?me?ce:ye.replace(b,"$1")+ce:ce.charAt(0)==="/"?me?ce:ye.replace(f,"$1")+ce:ye+ce}var L={exec:function(){}};function x(ye){for(var ce=1,me,te;ce=0&&Te[Be]==="\\";)xe=!xe;return xe?"|":" |"}),te=me.split(/ \|/),re=0;if(te.length>ce)te.splice(ce);else for(;te.length=te.length?re.slice(te.length):re}).join(`
`)}var Ae=function(){function ye(me){this.options=me||z}var ce=ye.prototype;return ce.space=function(te){var re=this.rules.block.newline.exec(te);if(re)return re[0].length>1?{type:"space",raw:re[0]}:{raw:`
`}},ce.code=function(te,re){var oe=this.rules.block.code.exec(te);if(oe){var he=re[re.length-1];if(he&&he.type==="paragraph")return{raw:oe[0],text:oe[0].trimRight()};var Te=oe[0].replace(/^ {4}/gm,"");return{type:"code",raw:oe[0],codeBlockStyle:"indented",text:this.options.pedantic?Te:B(Te,`
`)}}},ce.fences=function(te){var re=this.rules.block.fences.exec(te);if(re){var oe=re[0],he=Ie(oe,re[3]||"");return{type:"code",raw:oe,lang:re[2]?re[2].trim():re[2],text:he}}},ce.heading=function(te){var re=this.rules.block.heading.exec(te);if(re)return{type:"heading",raw:re[0],depth:re[1].length,text:re[2]}},ce.nptable=function(te){var re=this.rules.block.nptable.exec(te);if(re){var oe={type:"table",header:ee(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(`
`):[],raw:re[0]};if(oe.header.length===oe.align.length){var he=oe.align.length,Te;for(Te=0;Te ?/gm,"");return{type:"blockquote",raw:re[0],text:oe}}},ce.list=function(te){var re=this.rules.block.list.exec(te);if(re){for(var oe=re[0],he=re[2],Te=he.length>1,xe=he[he.length-1]===")",Be={type:"list",raw:oe,ordered:Te,start:Te?+he.slice(0,-1):"",loose:!1,items:[]},Ye=re[0].match(this.rules.block.item),ut=!1,qe,yt,xt,et,Wt,kt,Gt,Kt=Ye.length,Pt=0;Pt1||this.options.smartLists&&xt!==he)&&(et=Ye.slice(Pt+1).join(`
`),Be.raw=Be.raw.substring(0,Be.raw.length-et.length),Pt=Kt-1)),Wt=ut||/\n\n(?!\s*$)/.test(qe),Pt!==Kt-1&&(ut=qe.charAt(qe.length-1)===`
`,Wt||(Wt=ut)),Wt&&(Be.loose=!0),kt=/^\[[ xX]\] /.test(qe),Gt=void 0,kt&&(Gt=qe[1]!==" ",qe=qe.replace(/^\[[ xX]\] +/,"")),Be.items.push({type:"list_item",raw:oe,task:kt,checked:Gt,loose:Wt,text:qe});return Be}},ce.html=function(te){var re=this.rules.block.html.exec(te);if(re)return{type:this.options.sanitize?"paragraph":"html",raw:re[0],pre:!this.options.sanitizer&&(re[1]==="pre"||re[1]==="script"||re[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(re[0]):ie(re[0]):re[0]}},ce.def=function(te){var re=this.rules.block.def.exec(te);if(re){re[3]&&(re[3]=re[3].substring(1,re[3].length-1));var oe=re[1].toLowerCase().replace(/\s+/g," ");return{tag:oe,raw:re[0],href:re[2],title:re[3]}}},ce.table=function(te){var re=this.rules.block.table.exec(te);if(re){var oe={type:"table",header:ee(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(`
`):[]};if(oe.header.length===oe.align.length){oe.raw=re[0];var he=oe.align.length,Te;for(Te=0;Te/i.test(he[0])&&(re=!1),!oe&&/^<(pre|code|kbd|script)(\s|>)/i.test(he[0])?oe=!0:oe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(he[0])&&(oe=!1),{type:this.options.sanitize?"text":"html",raw:he[0],inLink:re,inRawBlock:oe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(he[0]):ie(he[0]):he[0]}},ce.link=function(te){var re=this.rules.inline.link.exec(te);if(re){var oe=de(re[2],"()");if(oe>-1){var he=re[0].indexOf("!")===0?5:4,Te=he+re[1].length+oe;re[2]=re[2].substring(0,oe),re[0]=re[0].substring(0,Te).trim(),re[3]=""}var xe=re[2],Be="";if(this.options.pedantic){var Ye=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(xe);Ye?(xe=Ye[1],Be=Ye[3]):Be=""}else Be=re[3]?re[3].slice(1,-1):"";xe=xe.trim().replace(/^<([\s\S]*)>$/,"$1");var ut=be(re,{href:xe&&xe.replace(this.rules.inline._escapes,"$1"),title:Be&&Be.replace(this.rules.inline._escapes,"$1")},re[0]);return ut}},ce.reflink=function(te,re){var oe;if((oe=this.rules.inline.reflink.exec(te))||(oe=this.rules.inline.nolink.exec(te))){var he=(oe[2]||oe[1]).replace(/\s+/g," ");if(he=re[he.toLowerCase()],!he||!he.href){var Te=oe[0].charAt(0);return{type:"text",raw:Te,text:Te}}var xe=be(oe,he,oe[0]);return xe}},ce.strong=function(te,re,oe){oe===void 0&&(oe="");var he=this.rules.inline.strong.start.exec(te);if(he&&(!he[1]||he[1]&&(oe===""||this.rules.inline.punctuation.exec(oe)))){re=re.slice(-1*te.length);var Te=he[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Te.lastIndex=0;for(var xe;(he=Te.exec(re))!=null;)if(xe=this.rules.inline.strong.middle.exec(re.slice(0,he.index+3)),xe)return{type:"strong",raw:te.slice(0,xe[0].length),text:te.slice(2,xe[0].length-2)}}},ce.em=function(te,re,oe){oe===void 0&&(oe="");var he=this.rules.inline.em.start.exec(te);if(he&&(!he[1]||he[1]&&(oe===""||this.rules.inline.punctuation.exec(oe)))){re=re.slice(-1*te.length);var Te=he[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Te.lastIndex=0;for(var xe;(he=Te.exec(re))!=null;)if(xe=this.rules.inline.em.middle.exec(re.slice(0,he.index+2)),xe)return{type:"em",raw:te.slice(0,xe[0].length),text:te.slice(1,xe[0].length-1)}}},ce.codespan=function(te){var re=this.rules.inline.code.exec(te);if(re){var oe=re[2].replace(/\n/g," "),he=/[^ ]/.test(oe),Te=oe.startsWith(" ")&&oe.endsWith(" ");return he&&Te&&(oe=oe.substring(1,oe.length-1)),oe=ie(oe,!0),{type:"codespan",raw:re[0],text:oe}}},ce.br=function(te){var re=this.rules.inline.br.exec(te);if(re)return{type:"br",raw:re[0]}},ce.del=function(te){var re=this.rules.inline.del.exec(te);if(re)return{type:"del",raw:re[0],text:re[1]}},ce.autolink=function(te,re){var oe=this.rules.inline.autolink.exec(te);if(oe){var he,Te;return oe[2]==="@"?(he=ie(this.options.mangle?re(oe[1]):oe[1]),Te="mailto:"+he):(he=ie(oe[1]),Te=he),{type:"link",raw:oe[0],text:he,href:Te,tokens:[{type:"text",raw:he,text:he}]}}},ce.url=function(te,re){var oe;if(oe=this.rules.inline.url.exec(te)){var he,Te;if(oe[2]==="@")he=ie(this.options.mangle?re(oe[0]):oe[0]),Te="mailto:"+he;else{var xe;do xe=oe[0],oe[0]=this.rules.inline._backpedal.exec(oe[0])[0];while(xe!==oe[0]);he=ie(oe[0]),oe[1]==="www."?Te="http://"+he:Te=he}return{type:"link",raw:oe[0],text:he,href:Te,tokens:[{type:"text",raw:he,text:he}]}}},ce.inlineText=function(te,re,oe){var he=this.rules.inline.text.exec(te);if(he){var Te;return re?Te=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(he[0]):ie(he[0]):he[0]:Te=ie(this.options.smartypants?oe(he[0]):he[0]),{type:"text",raw:he[0],text:Te}}},ye}(),Re=Z.noopTest,ke=Z.edit,De=Z.merge,ge={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Re,table:Re,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ge._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ge._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ge.def=ke(ge.def).replace("label",ge._label).replace("title",ge._title).getRegex(),ge.bullet=/(?:[*+-]|\d{1,9}[.)])/,ge.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ge.item=ke(ge.item,"gm").replace(/bull/g,ge.bullet).getRegex(),ge.list=ke(ge.list).replace(/bull/g,ge.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ge.def.source+")").getRegex(),ge._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ge._comment=//,ge.html=ke(ge.html,"i").replace("comment",ge._comment).replace("tag",ge._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ge.paragraph=ke(ge._paragraph).replace("hr",ge.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ge._tag).getRegex(),ge.blockquote=ke(ge.blockquote).replace("paragraph",ge.paragraph).getRegex(),ge.normal=De({},ge),ge.gfm=De({},ge.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ge.gfm.nptable=ke(ge.gfm.nptable).replace("hr",ge.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ge._tag).getRegex(),ge.gfm.table=ke(ge.gfm.table).replace("hr",ge.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ge._tag).getRegex(),ge.pedantic=De({},ge.normal,{html:ke(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ge._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Re,paragraph:ke(ge.normal._paragraph).replace("hr",ge.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ge.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ue={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Re,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:Re,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",ue.punctuation=ke(ue.punctuation).replace(/punctuation/g,ue._punctuation).getRegex(),ue._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ue._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ue.em.start=ke(ue.em.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.middle=ke(ue.em.middle).replace(/punctuation/g,ue._punctuation).replace(/overlapSkip/g,ue._overlapSkip).getRegex(),ue.em.endAst=ke(ue.em.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.endUnd=ke(ue.em.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.start=ke(ue.strong.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.middle=ke(ue.strong.middle).replace(/punctuation/g,ue._punctuation).replace(/blockSkip/g,ue._blockSkip).getRegex(),ue.strong.endAst=ke(ue.strong.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.endUnd=ke(ue.strong.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.blockSkip=ke(ue._blockSkip,"g").getRegex(),ue.overlapSkip=ke(ue._overlapSkip,"g").getRegex(),ue._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ue._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ue._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,ue.autolink=ke(ue.autolink).replace("scheme",ue._scheme).replace("email",ue._email).getRegex(),ue._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ue.tag=ke(ue.tag).replace("comment",ge._comment).replace("attribute",ue._attribute).getRegex(),ue._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ue._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ue._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ue.link=ke(ue.link).replace("label",ue._label).replace("href",ue._href).replace("title",ue._title).getRegex(),ue.reflink=ke(ue.reflink).replace("label",ue._label).getRegex(),ue.reflinkSearch=ke(ue.reflinkSearch,"g").replace("reflink",ue.reflink).replace("nolink",ue.nolink).getRegex(),ue.normal=De({},ue),ue.pedantic=De({},ue.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:ke(/^!?\[(label)\]\((.*?)\)/).replace("label",ue._label).getRegex(),reflink:ke(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ue._label).getRegex()}),ue.gfm=De({},ue.normal,{escape:ke(ue.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(te="x"+te.toString(16)),ce+=""+te+";";return ce}var ve=function(){function ye(me){this.tokens=[],this.tokens.links=Object.create(null),this.options=me||$e,this.options.tokenizer=this.options.tokenizer||new Ae,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var te={block:Ke.normal,inline:tt.normal};this.options.pedantic?(te.block=Ke.pedantic,te.inline=tt.pedantic):this.options.gfm&&(te.block=Ke.gfm,this.options.breaks?te.inline=tt.breaks:te.inline=tt.gfm),this.tokenizer.rules=te}ye.lex=function(te,re){var oe=new ye(re);return oe.lex(te)};var ce=ye.prototype;return ce.lex=function(te){return te=te.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(te,this.tokens,!0),this.inline(this.tokens),this.tokens},ce.blockTokens=function(te,re,oe){re===void 0&&(re=[]),oe===void 0&&(oe=!0),te=te.replace(/^ +$/gm,"");for(var he,Te,xe,Be;te;){if(he=this.tokenizer.space(te)){te=te.substring(he.raw.length),he.type&&re.push(he);continue}if(he=this.tokenizer.code(te,re)){te=te.substring(he.raw.length),he.type?re.push(he):(Be=re[re.length-1],Be.raw+=`
`+he.raw,Be.text+=`
`+he.text);continue}if(he=this.tokenizer.fences(te)){te=te.substring(he.raw.length),re.push(he);continue}if(he=this.tokenizer.heading(te)){te=te.substring(he.raw.length),re.push(he);continue}if(he=this.tokenizer.nptable(te)){te=te.substring(he.raw.length),re.push(he);continue}if(he=this.tokenizer.hr(te)){te=te.substring(he.raw.length),re.push(he);continue}if(he=this.tokenizer.blockquote(te)){te=te.substring(he.raw.length),he.tokens=this.blockTokens(he.text,[],oe),re.push(he);continue}if(he=this.tokenizer.list(te)){for(te=te.substring(he.raw.length),xe=he.items.length,Te=0;Te0)for(;(Ye=this.tokenizer.rules.inline.reflinkSearch.exec(Be))!=null;)ut.includes(Ye[0].slice(Ye[0].lastIndexOf("[")+1,-1))&&(Be=Be.slice(0,Ye.index)+"["+"a".repeat(Ye[0].length-2)+"]"+Be.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ye=this.tokenizer.rules.inline.blockSkip.exec(Be))!=null;)Be=Be.slice(0,Ye.index)+"["+"a".repeat(Ye[0].length-2)+"]"+Be.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;te;){if(xe=this.tokenizer.escape(te)){te=te.substring(xe.raw.length),re.push(xe);continue}if(xe=this.tokenizer.tag(te,oe,he)){te=te.substring(xe.raw.length),oe=xe.inLink,he=xe.inRawBlock,re.push(xe);continue}if(xe=this.tokenizer.link(te)){te=te.substring(xe.raw.length),xe.type==="link"&&(xe.tokens=this.inlineTokens(xe.text,[],!0,he)),re.push(xe);continue}if(xe=this.tokenizer.reflink(te,this.tokens.links)){te=te.substring(xe.raw.length),xe.type==="link"&&(xe.tokens=this.inlineTokens(xe.text,[],!0,he)),re.push(xe);continue}if(xe=this.tokenizer.strong(te,Be,Te)){te=te.substring(xe.raw.length),xe.tokens=this.inlineTokens(xe.text,[],oe,he),re.push(xe);continue}if(xe=this.tokenizer.em(te,Be,Te)){te=te.substring(xe.raw.length),xe.tokens=this.inlineTokens(xe.text,[],oe,he),re.push(xe);continue}if(xe=this.tokenizer.codespan(te)){te=te.substring(xe.raw.length),re.push(xe);continue}if(xe=this.tokenizer.br(te)){te=te.substring(xe.raw.length),re.push(xe);continue}if(xe=this.tokenizer.del(te)){te=te.substring(xe.raw.length),xe.tokens=this.inlineTokens(xe.text,[],oe,he),re.push(xe);continue}if(xe=this.tokenizer.autolink(te,ae)){te=te.substring(xe.raw.length),re.push(xe);continue}if(!oe&&(xe=this.tokenizer.url(te,ae))){te=te.substring(xe.raw.length),re.push(xe);continue}if(xe=this.tokenizer.inlineText(te,he,se)){te=te.substring(xe.raw.length),Te=xe.raw.slice(-1),re.push(xe);continue}if(te){var qe="Infinite loop on byte: "+te.charCodeAt(0);if(this.options.silent){console.error(qe);break}else throw new Error(qe)}}return re},$(ye,null,[{key:"rules",get:function(){return{block:Ke,inline:tt}}}]),ye}(),we=F.defaults,Pe=Z.cleanUrl,_e=Z.escape,Ue=function(){function ye(me){this.options=me||we}var ce=ye.prototype;return ce.code=function(te,re,oe){var he=(re||"").match(/\S*/)[0];if(this.options.highlight){var Te=this.options.highlight(te,he);Te!=null&&Te!==te&&(oe=!0,te=Te)}return he?''+(oe?te:_e(te,!0))+`
`:""+(oe?te:_e(te,!0))+`
`},ce.blockquote=function(te){return`
`+te+`
`},ce.html=function(te){return te},ce.heading=function(te,re,oe,he){return this.options.headerIds?"
`:""+te+"
`},ce.hr=function(){return this.options.xhtml?`
`:`
`},ce.list=function(te,re,oe){var he=re?"ol":"ul",Te=re&&oe!==1?' start="'+oe+'"':"";return"<"+he+Te+`>
`+te+""+he+`>
`},ce.listitem=function(te){return""+te+`
`},ce.checkbox=function(te){return" "},ce.paragraph=function(te){return""+te+`
`},ce.table=function(te,re){return re&&(re=""+re+""),`
`},ce.tablerow=function(te){return`
`+te+`
`},ce.tablecell=function(te,re){var oe=re.header?"th":"td",he=re.align?"<"+oe+' align="'+re.align+'">':"<"+oe+">";return he+te+""+oe+`>
`},ce.strong=function(te){return""+te+""},ce.em=function(te){return""+te+""},ce.codespan=function(te){return""+te+""},ce.br=function(){return this.options.xhtml?"
":"
"},ce.del=function(te){return""+te+""},ce.link=function(te,re,oe){if(te=Pe(this.options.sanitize,this.options.baseUrl,te),te===null)return oe;var he='"+oe+"",he},ce.image=function(te,re,oe){if(te=Pe(this.options.sanitize,this.options.baseUrl,te),te===null)return oe;var he='
":">",he},ce.text=function(te){return te},ye}(),je=function(){function ye(){}var ce=ye.prototype;return ce.strong=function(te){return te},ce.em=function(te){return te},ce.codespan=function(te){return te},ce.del=function(te){return te},ce.html=function(te){return te},ce.text=function(te){return te},ce.link=function(te,re,oe){return""+oe},ce.image=function(te,re,oe){return""+oe},ce.br=function(){return""},ye}(),at=function(){function ye(){this.seen={}}var ce=ye.prototype;return ce.slug=function(te){var re=te.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(re)){var oe=re;do this.seen[oe]++,re=oe+"-"+this.seen[oe];while(this.seen.hasOwnProperty(re))}return this.seen[re]=0,re},ye}(),Je=F.defaults,Qe=Z.unescape,Ve=function(){function ye(me){this.options=me||Je,this.options.renderer=this.options.renderer||new Ue,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new je,this.slugger=new at}ye.parse=function(te,re){var oe=new ye(re);return oe.parse(te)};var ce=ye.prototype;return ce.parse=function(te,re){re===void 0&&(re=!0);var oe="",he,Te,xe,Be,Ye,ut,qe,yt,xt,et,Wt,kt,Gt,Kt,Pt,wr,Wr,St,Et=te.length;for(he=0;he0&&Pt.tokens[0].type==="text"?(Pt.tokens[0].text=St+" "+Pt.tokens[0].text,Pt.tokens[0].tokens&&Pt.tokens[0].tokens.length>0&&Pt.tokens[0].tokens[0].type==="text"&&(Pt.tokens[0].tokens[0].text=St+" "+Pt.tokens[0].tokens[0].text)):Pt.tokens.unshift({type:"text",text:St}):Kt+=St),Kt+=this.parse(Pt.tokens,Gt),xt+=this.renderer.listitem(Kt,Wr,wr);oe+=this.renderer.list(xt,Wt,kt);continue}case"html":{oe+=this.renderer.html(et.text);continue}case"paragraph":{oe+=this.renderer.paragraph(this.parseInline(et.tokens));continue}case"text":{for(xt=et.tokens?this.parseInline(et.tokens):et.text;he+1An error occurred:"+rt(xe.message+"",!0)+"
";throw xe}}Oe.options=Oe.setOptions=function(ye){return ht(Oe.defaults,ye),Xe(Oe.defaults),Oe},Oe.getDefaults=Le,Oe.defaults=lt,Oe.use=function(ye){var ce=ht({},ye);if(ye.renderer&&function(){var te=Oe.defaults.renderer||new Ue,re=function(Te){var xe=te[Te];te[Te]=function(){for(var Be=arguments.length,Ye=new Array(Be),ut=0;ut`,triples:"",explode:"[]{}"},O=ne.Pos;ne.defineOption("autoCloseBrackets",!1,function(p,v,a){a&&a!=ne.Init&&(p.removeKeyMap(_),p.state.closeBrackets=null),v&&(P(V(v,"pairs")),p.state.closeBrackets=v,p.addKeyMap(_))});function V(p,v){return v=="pairs"&&typeof p=="string"?p:typeof p=="object"&&p[v]!=null?p[v]:$[v]}var _={Backspace:M,Enter:k};function P(p){for(var v=0;v=0;s--){var C=i[s].head;p.replaceRange("",O(C.line,C.ch-1),O(C.line,C.ch+1),"+delete")}}function k(p){var v=N(p),a=v&&V(v,"explode");if(!a||p.getOption("disableInput"))return ne.Pass;for(var i=p.listSelections(),s=0;s0;return{anchor:new O(p.anchor.line,p.anchor.ch+(v?-1:1)),head:new O(p.head.line,p.head.ch+(v?1:-1))}}function h(p,v){var a=N(p);if(!a||p.getOption("disableInput"))return ne.Pass;var i=V(a,"pairs"),s=i.indexOf(v);if(s==-1)return ne.Pass;for(var l=V(a,"closeBefore"),C=V(a,"triples"),g=i.charAt(s+1)==v,y=p.listSelections(),R=s%2==0,w,T=0;T=0&&p.getRange(f,O(f.line,f.ch+3))==v+v+v?u="skipThree":u="skip";else if(g&&f.ch>1&&C.indexOf(v)>=0&&p.getRange(O(f.line,f.ch-2),f)==v+v){if(f.ch>2&&/\bstring/.test(p.getTokenTypeAt(O(f.line,f.ch-2))))return ne.Pass;u="addFour"}else if(g){var x=f.ch==0?" ":p.getRange(O(f.line,f.ch-1),f);if(!ne.isWordChar(L)&&x!=v&&!ne.isWordChar(x))u="both";else return ne.Pass}else if(R&&(L.length===0||/\s/.test(L)||l.indexOf(L)>-1))u="both";else return ne.Pass;if(!w)w=u;else if(w!=u)return ne.Pass}var A=s%2?i.charAt(s-1):v,I=s%2?v:i.charAt(s+1);p.operation(function(){if(w=="skip")p.execCommand("goCharRight");else if(w=="skipThree")for(var W=0;W<3;W++)p.execCommand("goCharRight");else if(w=="surround"){for(var K=p.getSelections(),W=0;W=R?$:{done:!1,value:g[y++]}}}}M.fromArray=S;function m(g){return{next:function(){var y=g.next();return y.done?$:{done:!1,value:y.value}}}}M.fromNativeIterator=m;function p(g){return g?Array.isArray(g)?M.fromArray(g):g:M.empty()}M.from=p;function v(g,y){return{next:function(){var R=g.next();return R.done?$:{done:!1,value:y(R.value)}}}}M.map=v;function a(g,y){return{next:function(){for(;;){var R=g.next();if(R.done)return $;if(y(R.value))return{done:!1,value:R.value}}}}}M.filter=a;function i(g,y){for(var R=g.next();!R.done;R=g.next())y(R.value)}M.forEach=i;function s(g,y){y===void 0&&(y=Number.POSITIVE_INFINITY);var R=[];if(y===0)return R;for(var w=0,T=g.next();!T.done&&!(R.push(T.value),++w>=y);T=g.next());return R}M.collect=s;function l(){for(var g=[],y=0;y=g.length)return $;var w=g[R],T=w.next();return T.done?(R++,this.next()):T}}}M.concat=l;function C(g){return new V(g)}M.chain=C})(O||(O={}));var V=function(){function M(k){this.it=k}return M.prototype.next=function(){return this.it.next()},M}();function _(M){return Array.isArray(M)?O.fromArray(M):M||O.empty()}var P=function(){function M(k,d,h,S){d===void 0&&(d=0),h===void 0&&(h=k.length),S===void 0&&(S=d-1),this.items=k,this.start=d,this.end=h,this.index=S}return M.prototype.first=function(){return this.index=this.start,this.current()},M.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},M.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},M}(),F=function(M){ne(k,M);function k(d,h,S,m){return h===void 0&&(h=0),S===void 0&&(S=d.length),m===void 0&&(m=h-1),M.call(this,d,h,S,m)||this}return k.prototype.current=function(){return M.prototype.current.call(this)},k.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},k.prototype.first=function(){return this.index=this.start,this.current()},k.prototype.last=function(){return this.index=this.end-1,this.current()},k.prototype.parent=function(){return null},k}(P),N=function(){function M(k,d){this.iterator=k,this.fn=d}return M.prototype.next=function(){return this.fn(this.iterator.next())},M}()},LSTS:function(mt,Ee,Q){"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});var ne=function(){function h(S,m){for(var p=0;p=0)continue;if(!Object.prototype.hasOwnProperty.call(h,p))continue;m[p]=h[p]}return m}function N(h,S){if(!(h instanceof S))throw new TypeError("Cannot call a class as a function")}function M(h,S){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:h}function k(h,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);h.prototype=Object.create(S&&S.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(h,S):h.__proto__=S)}var d=function(h){k(S,h);function S(m){N(this,S);var p=M(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,m));return p.scrollListener=p.scrollListener.bind(p),p.eventListenerOptions=p.eventListenerOptions.bind(p),p.mousewheelListener=p.mousewheelListener.bind(p),p}return ne(S,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var p=this.getParentElement(this.scrollComponent);p.scrollTop=p.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var p=!1,v={get passive(){p=!0}};try{document.addEventListener("test",null,v),document.removeEventListener("test",null,v)}catch(a){}return p}},{key:"eventListenerOptions",value:function(){var p=this.props.useCapture;return this.isPassiveSupported()&&(p={useCapture:this.props.useCapture,passive:!0}),p}},{key:"setDefaultLoader",value:function(p){this.defaultLoader=p}},{key:"detachMousewheelListener",value:function(){var p=window;this.props.useWindow===!1&&(p=this.scrollComponent.parentNode),p.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var p=window;this.props.useWindow===!1&&(p=this.getParentElement(this.scrollComponent)),p.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),p.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(p){var v=this.props.getScrollParent&&this.props.getScrollParent();return v!=null?v:p&&p.parentNode}},{key:"filterProps",value:function(p){return p}},{key:"attachScrollListener",value:function(){var p=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!p)return;var v=window;this.props.useWindow===!1&&(v=p),v.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),v.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),v.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}},{key:"mousewheelListener",value:function(p){p.deltaY===1&&!this.isPassiveSupported()&&p.preventDefault()}},{key:"scrollListener",value:function(){var p=this.scrollComponent,v=window,a=this.getParentElement(p),i=void 0;if(this.props.useWindow){var s=document.documentElement||document.body.parentNode||document.body,l=v.pageYOffset!==void 0?v.pageYOffset:s.scrollTop;this.props.isReverse?i=l:i=this.calculateOffset(p,l)}else this.props.isReverse?i=a.scrollTop:i=p.scrollHeight-a.scrollTop-a.clientHeight;i1&&arguments[1]!==void 0?arguments[1]:1,me=je.length,te=0;te1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(B).map(function(ie,de){if(!_.isValidElement(ie)||!ie.type)return null;var be=ie.type.isSelectOptGroup,Ie=ie.key,Ae=ie.props,Re=Ae.children,ke=Object(F.a)(Ae,["children"]);return ee||!be?w(ie):Object(y.a)(Object(y.a)({key:"__RC_SELECT_GRP__".concat(Ie===null?de:Ie,"__"),label:Ie},ke),{},{options:T(Re)})}).filter(function(ie){return ie})}var b=Q("2Qr1"),f=Q("qNPg"),u=Q("U8pU"),L=Q("Kwbf"),x=Q("WKfj");function A(B){var ee=B.mode,ie=B.options,de=B.children,be=B.backfill,Ie=B.allowClear,Ae=B.placeholder,Re=B.getInputElement,ke=B.showSearch,De=B.onSearch,ge=B.defaultOpen,ue=B.autoFocus,Me=B.labelInValue,$e=B.value,Ke=B.inputValue,tt=B.optionLabelProp,se=ee==="multiple"||ee==="tags",ae=ke!==void 0?ke:se||ee==="combobox",ve=ie||T(de);if(Object(L.a)(ee!=="tags"||ve.every(function(Ue){return!Ue.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),ee==="tags"||ee==="combobox"){var we=ve.some(function(Ue){return Ue.options?Ue.options.some(function(je){return typeof("value"in je?je.value:je.key)=="number"}):typeof("value"in Ue?Ue.value:Ue.key)=="number"});Object(L.a)(!we,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(L.a)(ee!=="combobox"||!tt,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(L.a)(ee==="combobox"||!be,"`backfill` only works with `combobox` mode."),Object(L.a)(ee==="combobox"||!Re,"`getInputElement` only work with `combobox` mode."),Object(L.b)(ee!=="combobox"||!Re||!Ie||!Ae,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),De&&!ae&&ee!=="combobox"&&ee!=="tags"&&Object(L.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(L.b)(!ge||ue,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),$e!=null){var Pe=Object(x.d)($e);Object(L.a)(!Me||Pe.every(function(Ue){return Object(u.a)(Ue)==="object"&&("key"in Ue||"value"in Ue)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(L.a)(!se||Array.isArray($e),"`value` should be array when `mode` is `multiple` or `tags`")}if(de){var _e=null;Object(R.a)(de).some(function(Ue){if(!_.isValidElement(Ue)||!Ue.type)return!1;var je=Ue.type;if(je.isSelectOption)return!1;if(je.isSelectOptGroup){var at=Object(R.a)(Ue.props.children).every(function(Je){return!_.isValidElement(Je)||!Ue.type||Je.type.isSelectOption?!0:(_e=Je.type,!1)});return!at}return _e=je,!0}),_e&&Object(L.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(_e.displayName||_e.name||_e,"`.")),Object(L.a)(Ke===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var I=A,W=Object(f.a)({prefixCls:"rc-select",components:{optionList:i},convertChildrenToData:T,flattenOptions:b.d,getLabeledValue:b.e,filterOptions:b.b,isValueDisabled:b.g,findValueOption:b.c,warningProps:I,fillOptionsWithMissingValue:b.a}),K=function(B){Object(O.a)(ie,B);var ee=Object(V.a)(ie);function ie(){var de;return Object(ne.a)(this,ie),de=ee.apply(this,arguments),de.selectRef=_.createRef(),de.focus=function(){de.selectRef.current.focus()},de.blur=function(){de.selectRef.current.blur()},de}return Object($.a)(ie,[{key:"render",value:function(){return _.createElement(W,Object.assign({ref:this.selectRef},this.props))}}]),ie}(_.Component);K.Option=l,K.OptGroup=g;var Z=K,z=Ee.c=Z},M8RZ:function(mt,Ee,Q){"use strict";Q.d(Ee,"a",function(){return M});var ne=Q("fWQN"),$=Q("mtLc"),O=Q("yKVA"),V=Q("879j"),_=Q("q1tI"),P=Q.n(_),F=Q("i8i4"),N=Q.n(F),M=function(k){Object(O.a)(h,k);var d=Object(V.a)(h);function h(S){var m;Object(ne.a)(this,h),m=d.call(this,S);var p=window.document;return m.node=p.createElement("div"),p.body.appendChild(m.node),m}return Object($.a)(h,[{key:"render",value:function(){var m=this.props.children;return Object(F.createPortal)(m,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),h}(P.a.Component)},MI8n:function(mt,Ee,Q){"use strict";Q.d(Ee,"b",function(){return P}),Q.d(Ee,"a",function(){return M}),Q.d(Ee,"e",function(){return k}),Q.d(Ee,"d",function(){return d}),Q.d(Ee,"c",function(){return h}),Q.d(Ee,"f",function(){return S});var ne=Q("/cxE"),$=Q("C/vA"),O=Q("pmY6"),V=Q("24hK"),_=function(){var m=function(p,v){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,i){a.__proto__=i}||function(a,i){for(var s in i)i.hasOwnProperty(s)&&(a[s]=i[s])},m(p,v)};return function(p,v){m(p,v);function a(){this.constructor=p}p.prototype=v===null?Object.create(v):(a.prototype=v.prototype,new a)}}(),P;(function(m){m.None=function(){return O.a.None};function p(I){return function(W,K,Z){K===void 0&&(K=null);var z=!1,B;return B=I(function(ee){return z?void 0:(B?B.dispose():z=!0,W.call(K,ee))},null,Z),z&&B.dispose(),B}}m.once=p;function v(I,W){return g(function(K,Z,z){return Z===void 0&&(Z=null),I(function(B){return K.call(Z,W(B))},null,z)})}m.map=v;function a(I,W){return g(function(K,Z,z){return Z===void 0&&(Z=null),I(function(B){W(B),K.call(Z,B)},null,z)})}m.forEach=a;function i(I,W){return g(function(K,Z,z){return Z===void 0&&(Z=null),I(function(B){return W(B)&&K.call(Z,B)},null,z)})}m.filter=i;function s(I){return I}m.signal=s;function l(){for(var I=[],W=0;W1)&&be.fire(Ae),de=0},K)})},onLastListenerRemove:function(){B.dispose()}});return be.event}m.debounce=y;function R(I){var W=new Date().getTime();return v(p(I),function(K){return new Date().getTime()-W})}m.stopwatch=R;function w(I){var W=!0,K;return i(I,function(Z){var z=W||Z!==K;return W=!1,K=Z,z})}m.latch=w;function T(I,W,K){W===void 0&&(W=!1),K===void 0&&(K=[]);var Z=K.slice(),z=I(function(ie){Z?Z.push(ie):ee.fire(ie)}),B=function(){Z&&Z.forEach(function(ie){return ee.fire(ie)}),Z=null},ee=new M({onFirstListenerAdd:function(){z||(z=I(function(ie){return ee.fire(ie)}))},onFirstListenerDidAdd:function(){Z&&(W?setTimeout(B):B())},onLastListenerRemove:function(){z&&z.dispose(),z=null}});return ee.event}m.buffer=T;var b=function(){function I(W){this.event=W}return I.prototype.map=function(W){return new I(v(this.event,W))},I.prototype.forEach=function(W){return new I(a(this.event,W))},I.prototype.filter=function(W){return new I(i(this.event,W))},I.prototype.reduce=function(W,K){return new I(C(this.event,W,K))},I.prototype.latch=function(){return new I(w(this.event))},I.prototype.debounce=function(W,K,Z,z){return K===void 0&&(K=100),Z===void 0&&(Z=!1),new I(y(this.event,W,K,Z,z))},I.prototype.on=function(W,K,Z){return this.event(W,K,Z)},I.prototype.once=function(W,K,Z){return p(this.event)(W,K,Z)},I}();function f(I){return new b(I)}m.chain=f;function u(I,W,K){K===void 0&&(K=function(ie){return ie});var Z=function(){for(var ie=[],de=0;de0?new N(this._options&&this._options.leakWarningThreshold):void 0}return Object.defineProperty(m.prototype,"event",{get:function(){var p=this;return this._event||(this._event=function(v,a,i){p._listeners||(p._listeners=new V.a);var s=p._listeners.isEmpty();s&&p._options&&p._options.onFirstListenerAdd&&p._options.onFirstListenerAdd(p);var l=p._listeners.push(a?[v,a]:v);s&&p._options&&p._options.onFirstListenerDidAdd&&p._options.onFirstListenerDidAdd(p),p._options&&p._options.onListenerDidAdd&&p._options.onListenerDidAdd(p,v,a);var C;p._leakageMon&&(C=p._leakageMon.check(p._listeners.size));var g;return g={dispose:function(){if(C&&C(),g.dispose=m._noop,!p._disposed&&(l(),p._options&&p._options.onLastListenerRemove)){var y=p._listeners&&!p._listeners.isEmpty();y||p._options.onLastListenerRemove(p)}}},i instanceof O.b?i.add(g):Array.isArray(i)&&i.push(g),g}),this._event},enumerable:!0,configurable:!0}),m.prototype.fire=function(p){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new V.a);for(var v=this._listeners.iterator(),a=v.next();!a.done;a=v.next())this._deliveryQueue.push([a.value,p]);for(;this._deliveryQueue.size>0;){var i=this._deliveryQueue.shift(),s=i[0],l=i[1];try{typeof s=="function"?s.call(void 0,l):s[0].call(s[1],l)}catch(C){Object(ne.e)(C)}}}},m.prototype.dispose=function(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0},m._noop=function(){},m}(),k=function(m){_(p,m);function p(v){var a=m.call(this,v)||this;return a._isPaused=0,a._eventQueue=new V.a,a._mergeFn=v&&v.merge,a}return p.prototype.pause=function(){this._isPaused++},p.prototype.resume=function(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){var v=this._eventQueue.toArray();this._eventQueue.clear(),m.prototype.fire.call(this,this._mergeFn(v))}else for(;!this._isPaused&&this._eventQueue.size!==0;)m.prototype.fire.call(this,this._eventQueue.shift())},p.prototype.fire=function(v){this._listeners&&(this._isPaused!==0?this._eventQueue.push(v):m.prototype.fire.call(this,v))},p}(M),d=function(){function m(){var p=this;this.hasListeners=!1,this.events=[],this.emitter=new M({onFirstListenerAdd:function(){return p.onFirstListenerAdd()},onLastListenerRemove:function(){return p.onLastListenerRemove()}})}return Object.defineProperty(m.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),m.prototype.add=function(p){var v=this,a={event:p,listener:null};this.events.push(a),this.hasListeners&&this.hook(a);var i=function(){v.hasListeners&&v.unhook(a);var s=v.events.indexOf(a);v.events.splice(s,1)};return Object(O.h)(Object($.a)(i))},m.prototype.onFirstListenerAdd=function(){var p=this;this.hasListeners=!0,this.events.forEach(function(v){return p.hook(v)})},m.prototype.onLastListenerRemove=function(){var p=this;this.hasListeners=!1,this.events.forEach(function(v){return p.unhook(v)})},m.prototype.hook=function(p){var v=this;p.listener=p.event(function(a){return v.emitter.fire(a)})},m.prototype.unhook=function(p){p.listener&&p.listener.dispose(),p.listener=null},m.prototype.dispose=function(){this.emitter.dispose()},m}(),h=function(){function m(){this.buffers=[]}return m.prototype.wrapEvent=function(p){var v=this;return function(a,i,s){return p(function(l){var C=v.buffers[v.buffers.length-1];C?C.push(function(){return a.call(i,l)}):a.call(i,l)},void 0,s)}},m.prototype.bufferEvents=function(p){var v=[];this.buffers.push(v);var a=p();return this.buffers.pop(),v.forEach(function(i){return i()}),a},m}(),S=function(){function m(){var p=this;this.listening=!1,this.inputEvent=P.None,this.inputEventListener=O.a.None,this.emitter=new M({onFirstListenerDidAdd:function(){p.listening=!0,p.inputEventListener=p.inputEvent(p.emitter.fire,p.emitter)},onLastListenerRemove:function(){p.listening=!1,p.inputEventListener.dispose()}}),this.event=this.emitter.event}return Object.defineProperty(m.prototype,"input",{set:function(p){this.inputEvent=p,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=p(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),m.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()},m}()},N0LK:function(mt,Ee,Q){"use strict";Q.d(Ee,"x",function(){return ne}),Q.d(Ee,"F",function(){return $}),Q.d(Ee,"r",function(){return V}),Q.d(Ee,"o",function(){return _}),Q.d(Ee,"p",function(){return P}),Q.d(Ee,"Q",function(){return F}),Q.d(Ee,"K",function(){return M}),Q.d(Ee,"k",function(){return k}),Q.d(Ee,"N",function(){return d}),Q.d(Ee,"m",function(){return h}),Q.d(Ee,"l",function(){return S}),Q.d(Ee,"I",function(){return m}),Q.d(Ee,"H",function(){return p}),Q.d(Ee,"q",function(){return v}),Q.d(Ee,"t",function(){return a}),Q.d(Ee,"D",function(){return i}),Q.d(Ee,"e",function(){return s}),Q.d(Ee,"f",function(){return l}),Q.d(Ee,"B",function(){return C}),Q.d(Ee,"C",function(){return g}),Q.d(Ee,"n",function(){return R}),Q.d(Ee,"O",function(){return T}),Q.d(Ee,"c",function(){return b}),Q.d(Ee,"d",function(){return f}),Q.d(Ee,"z",function(){return u}),Q.d(Ee,"A",function(){return L}),Q.d(Ee,"u",function(){return x}),Q.d(Ee,"E",function(){return I}),Q.d(Ee,"G",function(){return W}),Q.d(Ee,"i",function(){return Z}),Q.d(Ee,"g",function(){return B}),Q.d(Ee,"v",function(){return ie}),Q.d(Ee,"h",function(){return de}),Q.d(Ee,"y",function(){return be}),Q.d(Ee,"w",function(){return Ie}),Q.d(Ee,"a",function(){return Ae}),Q.d(Ee,"P",function(){return Re}),Q.d(Ee,"L",function(){return ke}),Q.d(Ee,"J",function(){return De}),Q.d(Ee,"j",function(){return ge}),Q.d(Ee,"M",function(){return ue}),Q.d(Ee,"s",function(){return Me}),Q.d(Ee,"b",function(){return $e});function ne(se){return!se||typeof se!="string"?!0:se.trim().length===0}function $(se,ae,ve){ve===void 0&&(ve="0");for(var we=""+se,Pe=[we],_e=we.length;_e=ae.length?we:ae[_e]})}function _(se){return se.replace(/[<>&]/g,function(ae){switch(ae){case"<":return"<";case">":return">";case"&":return"&";default:return ae}})}function P(se){return se.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function F(se,ae){ae===void 0&&(ae=" ");var ve=N(se,ae);return M(ve,ae)}function N(se,ae){if(!se||!ae)return se;var ve=ae.length;if(ve===0||se.length===0)return se;for(var we=0;se.indexOf(ae,we)===we;)we=we+ve;return se.substring(we)}function M(se,ae){if(!se||!ae)return se;var ve=ae.length,we=se.length;if(ve===0||we===0)return se;for(var Pe=we,_e=-1;!(_e=se.lastIndexOf(ae,Pe-1),_e===-1||_e+ve!==Pe);){if(_e===0)return"";Pe=_e}return se.substring(0,Pe)}function k(se){return se.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function d(se,ae){if(se.length0?se.indexOf(ae,ve)===ve:ve===0?se===ae:!1}function S(se,ae,ve){if(ve===void 0&&(ve={}),!se)throw new Error("Cannot create regex from empty string");ae||(se=P(se)),ve.wholeWord&&(/\B/.test(se.charAt(0))||(se="\\b"+se),/\B/.test(se.charAt(se.length-1))||(se=se+"\\b"));var we="";return ve.global&&(we+="g"),ve.matchCase||(we+="i"),ve.multiline&&(we+="m"),ve.unicode&&(we+="u"),new RegExp(se,we)}function m(se){if(se.source==="^"||se.source==="^$"||se.source==="$"||se.source==="^\\s*$")return!1;var ae=se.exec("");return!!(ae&&se.lastIndex===0)}function p(se){return(se.global?"g":"")+(se.ignoreCase?"i":"")+(se.multiline?"m":"")+(se.unicode?"u":"")}function v(se){for(var ae=0,ve=se.length;ae=0;ve--){var we=se.charCodeAt(ve);if(we!==32&&we!==9)return ve}return-1}function s(se,ae){return seae?1:0}function l(se,ae){for(var ve=Math.min(se.length,ae.length),we=0;weae.length?1:0}function C(se){return se>=97&&se<=122}function g(se){return se>=65&&se<=90}function y(se){return C(se)||g(se)}function R(se,ae){return se.length===ae.length&&w(se,ae)}function w(se,ae,ve){ve===void 0&&(ve=se.length);for(var we=0;wese.length?!1:w(se,ae,ve)}function b(se,ae){var ve,we=Math.min(se.length,ae.length);for(ve=0;ve1){var we=se.charCodeAt(ae-2);if(u(we))return(we-55296<<10)+(ve-56320)+65536}return ve}function I(se,ae){var ve=Ke.getInstance(),we=ae,Pe=se.length,_e=x(se,Pe,ae);ae+=_e>=65536?2:1;for(var Ue=ve.getGraphemeBreakType(_e);ae=65536?2:1,Ue=at}return ae-we}function W(se,ae){var ve=Ke.getInstance(),we=ae,Pe=A(se,ae);ae-=Pe>=65536?2:1;for(var _e=ve.getGraphemeBreakType(Pe);ae>0;){var Ue=A(se,ae),je=ve.getGraphemeBreakType(Ue);if($e(je,_e))break;ae-=Ue>=65536?2:1,_e=je}return we-ae}var K=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function Z(se){return K.test(se)}var z=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDE73\uDE78-\uDE82\uDE90-\uDE95])/;function B(se){return z.test(se)}var ee=/^[\t\n\r\x20-\x7E]*$/;function ie(se){return ee.test(se)}function de(se){for(var ae=0,ve=se.length;ae=11904&&se<=55215||se>=63744&&se<=64255||se>=65281&&se<=65374}function Ie(se){return se>=127462&&se<=127487||se>=9728&&se<=10175||se>=127744&&se<=128591||se>=128640&&se<=128764||se>=128992&&se<=129003||se>=129280&&se<=129535||se>=129648&&se<=129651||se>=129656&&se<=129666||se>=129680&&se<=129685}var Ae=String.fromCharCode(65279);function Re(se){return!!(se&&se.length>0&&se.charCodeAt(0)===65279)}function ke(se){return btoa(encodeURIComponent(se))}function De(se,ae){for(var ve="",we=0;weve[3*Pe+1])Pe=2*Pe+1;else return ve[3*Pe+2];return 0},se._INSTANCE=null,se}();function tt(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}},Ot1p:function(mt,Ee,Q){"use strict";var ne=Q("2qtc"),$=Q("kLXV"),O=Q("rAM+"),V=Q("miYZ"),_=Q("tsqr"),P=Q("9og8"),F=Q("tJVT"),N=Q("jrin"),M=Q("WmNS"),k=Q.n(M),d=Q("q1tI"),h=Q.n(d),S=Q("VrN/"),m=Q.n(S),p=Q("bdgK"),v=Q("p77/"),a=Q("Bd2K"),i=Q("ELLl"),s=Q("19Vz"),l=Q("lZu9"),C=Q("+NIl"),g=Q("kSUc"),y=Q("9Bee"),R=function(xe){var Be=xe.value,Ye=Be===void 0?"":Be,ut=xe.className,qe=xe.showTextOnly,yt=xe.showLines,xt=xe.style,et=xt===void 0?{}:xt,Wt=Object(d.useMemo)(function(){return""},[Ye]);return h.a.createElement(h.a.Fragment,null,h.a.createElement("div",{dangerouslySetInnerHTML:{__html:Wt}}))},w=Q("0Owb"),T=Q("dejd"),b=Q("C+DQ"),f=Q("1vsH"),u=Q("m3rI"),L=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function x(xe){var Be=xe.onActionCallback,Ye=xe.title,ut=xe.icon,qe=xe.actionName,yt=xe.className,xt=yt===void 0?"":yt,et=xe.children;function Wt(){Be(qe)}return h.a.createElement("a",{title:Ye,className:xt,onClick:Wt},h.a.createElement("i",{className:"md-iconfont ".concat(ut)}),et)}var A=function(xe){var Be=xe.watch,Ye=xe.showNullButton,ut=xe.onActionCallback,qe=xe.fullScreen,yt=xe.insertTemp,xt=xe.hidetoolBar,et=xe.uuid,Wt=xe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(f.D)("_educoder_session_login"),"&_educoder_session=").concat(Object(f.D)("_educoder_session"),"&key=").concat(et,"&api=").concat(encodeURIComponent(u.a.PROXY_SERVER)));var kt=[].concat(L,[{title:"".concat(Be?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Be?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return h.a.createElement("ul",{className:"markdown-toolbar-container"},!xt&&kt.map(function(Gt,Kt){return h.a.createElement("li",{key:Kt},Gt.actionName?h.a.createElement(x,Object(w.a)({},Gt,{onActionCallback:ut})):h.a.createElement("span",{className:"v-line"}))}),Ye?h.a.createElement("li",null,h.a.createElement(x,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ut},h.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,yt&&h.a.createElement("li",null,h.a.createElement(x,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(yt),onActionCallback:ut},h.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),h.a.createElement("li",{className:"btn-full-screen"},h.a.createElement(x,{icon:"".concat(qe?"icon-shrink":"icon-enlarge"),title:qe?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ut})))},I=Q("M8RZ"),W=Q("+L6B"),K=Q("2/Rp"),Z=Q("y8nQ"),z=Q("Vl3Y"),B=Q("5NDa"),ee=Q("5rEg"),ie={labelCol:{span:4},wrapperCol:{span:20}},de=function(xe){var Be=xe.callback,Ye=xe.onCancel;function ut(qe){Be(qe)}return h.a.createElement(z.a,Object(w.a)({},ie,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ut}),h.a.createElement(z.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},h.a.createElement(ee.a,null)),h.a.createElement(z.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},h.a.createElement(ee.a,null)),h.a.createElement("div",{className:"flex-container flex-end"},h.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(K.a,{type:"ghost",onClick:Ye},"\u53D6\u6D88")))},be=Q("7ahc"),Ie=Q("k1fw"),Ae=Q("HmJG"),Re=Q("BjJ7"),ke=z.a.useForm,De={width:280,marginRight:10},ge={labelCol:{span:5},wrapperCol:{span:19}},ue=function(xe){var Be=xe.callback,Ye=xe.onCancel,ut=ke(),qe=Object(F.a)(ut,1),yt=qe[0],xt=Object(d.useRef)();function et(Gt){Be(Object(Ie.a)(Object(Ie.a)({},Gt),{},{name:xt.current}))}function Wt(Gt,Kt){yt.setFieldsValue({src:"/api/attachments/".concat(Gt.id,"?type=").concat(Gt.content_type),type:Kt.type})}function kt(Gt){var Kt=Gt.target.files[0];xt.current=Kt.name,$e(Kt,Wt)}return h.a.createElement(z.a,Object(w.a)({form:yt},ge,{className:"upload-image-panel",onFinish:et}),h.a.createElement(z.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},h.a.createElement("div",{className:"flex-container"},h.a.createElement(z.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},h.a.createElement(ee.a,{style:De})),h.a.createElement(Me,{onFileChange:kt}))),h.a.createElement(z.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},h.a.createElement(ee.a,{style:{width:264}})),h.a.createElement(z.a.Item,{style:{textAlign:"right"}},h.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(K.a,{type:"ghost",onClick:Ye},"\u53D6\u6D88")))};function Me(xe){var Be=xe.onFileChange;return h.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",h.a.createElement("input",{type:"file",onChange:Be}))}function $e(xe,Be){if(!xe)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ye=new FormData;Ye.append("editormd-image-file",xe),Ye.append("file_param_name","editormd-image-file"),Ye.append("byxhr","true");var ut=new window.XMLHttpRequest;ut.withCredentials=!0,ut.addEventListener("load",function(qe){Be(JSON.parse(qe.target.responseText),xe)},!1),ut.addEventListener("error",function(qe){console.error(qe)},!1),ut.open("POST","".concat(Re.a,"/api/attachments.json")),ut.send(Ye)}var Ke=Q("giR+"),tt=Q("fyUT"),se=Q("7Kak"),ae=Q("9yH6"),ve=ae.a.Group,we={margin:"0 8px"},Pe=function(xe){var Be=xe.callback,Ye=xe.onCancel;function ut(qe){Be(qe)}return h.a.createElement(z.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ut},h.a.createElement("div",{className:"flex-container"},h.a.createElement("span",{style:we},"\u5355\u5143\u683C\u6570\uFF1A"),h.a.createElement("span",{style:we},"\u884C\u6570"),h.a.createElement(z.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},h.a.createElement(tt.a,null)),h.a.createElement("span",{style:we},"\u5217\u6570"),h.a.createElement(z.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},h.a.createElement(tt.a,null))),h.a.createElement("div",{className:"flex-container",style:{marginTop:12}},h.a.createElement("span",{style:we},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),h.a.createElement(z.a.Item,{name:"align"},h.a.createElement(ve,null,h.a.createElement(ae.a,{value:"default"},h.a.createElement("i",{className:"fa fa-align-justify"})),h.a.createElement(ae.a,{value:"left"},h.a.createElement("i",{className:"fa fa-align-left"})),h.a.createElement(ae.a,{value:"center"},h.a.createElement("i",{className:"fa fa-align-center"})),h.a.createElement(ae.a,{value:"right"},h.a.createElement("i",{className:"fa fa-align-right"}))))),h.a.createElement("div",{className:"flex-container flex-end"},h.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(K.a,{type:"ghost",onClick:Ye},"\u53D6\u6D88")))},_e=Q("ErOA"),Ue=Q("7Cbv"),je="link",at="upload-image",Je="code-block",Qe="add-table",Ve="------------",ht={default:Ve,left:":".concat(Ve),center:":".concat(Ve,":"),right:"".concat(Ve,":")},it=Q("9VGf"),rt,Le;function Xe(){}var lt=0,Oe=1e4,He="\u2581",ye=`
**\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 ce(xe){return/^\d+$/.test(xe)?"".concat(xe,"px"):xe}var me=navigator.platform.toUpperCase().indexOf("MAC")>=0,te=me?"Cmd":"Ctrl",re=["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"],oe=(rt={},Object(N.a)(rt,te+"-B","bold"),Object(N.a)(rt,te+"-I","italic"),rt),he=(Le={},Object(N.a)(Le,je,"\u6DFB\u52A0\u94FE\u63A5"),Object(N.a)(Le,Je,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(N.a)(Le,at,"\u6DFB\u52A0\u6587\u4EF6"),Object(N.a)(Le,Qe,"\u6DFB\u52A0\u8868\u683C"),Le),Te=Ee.a=function(xe){var Be=xe.defaultValue,Ye=Be===void 0?"":Be,ut=xe.onChange,qe=xe.width,yt=qe===void 0?"100%":qe,xt=xe.height,et=xt===void 0?400:xt,Wt=xe.miniToolbar,kt=Wt===void 0?!1:Wt,Gt=xe.isFocus,Kt=Gt===void 0?!1:Gt,Pt=xe.watch,wr=xe.insertTemp,Wr=xe.mode,St=Wr===void 0?"markdown":Wr,Et=xe.id,dt=Et===void 0?"markdown-editor-id":Et,Ct=xe.showResizeBar,Rt=Ct===void 0?!1:Ct,Bt=xe.noStorage,Mt=Bt===void 0?!1:Bt,Tt=xe.showNullButton,pt=Tt===void 0?!1:Tt,lr=xe.hidetoolBar,Lr=lr===void 0?!1:lr,Ar=xe.fullScreen,_t=Ar===void 0?!1:Ar,kr=xe.onBlur,Vr=xe.onCMBeforeChange,rn=xe.onFullScreen,Fe=xe.className,ct=Fe===void 0?"":Fe,Nt=xe.disablePaste,$t=Nt===void 0?!1:Nt,Qt=xe.placeholder,tr=Qt===void 0?"":Qt,H=xe.values,c=H===void 0?"":H,E=Object(d.useState)(null),j=Object(F.a)(E,2),X=j[0],G=j[1],pe=Object(d.useState)(Ye),We=Object(F.a)(pe,2),nt=We[0],gt=We[1],Ge=Object(d.useState)(Pt),Dt=Object(F.a)(Ge,2),Ut=Dt[0],rr=Dt[1],Xr=Object(d.useState)(_t),Yr=Object(F.a)(Xr,2),mr=Yr[0],qr=Yr[1],Gn=Object(d.useState)(""),Pr=Object(F.a)(Gn,2),$r=Pr[0],Hr=Pr[1],bn=Object(d.useState)(0),nn=Object(F.a)(bn,2),mn=nn[0],dn=nn[1],hi=Object(d.useState)(et),zn=Object(F.a)(hi,2),an=zn[0],Jr=zn[1],kn=Object(d.useState)(!1),On=Object(F.a)(kn,2),ci=On[0],or=On[1],Vt=Object(d.useRef)(Object(Ue.a)()),Sr=Object(d.useRef)(!1),zt=Object(d.useRef)(),hr=Object(d.useRef)(),Jt=Object(d.useRef)(),hn=Object(d.useRef)(),ur=Object(d.useRef)(),_r=function(){var bt=Object(P.a)(k.a.mark(function Ot(){var Lt,Ft;return k.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return qt.next=2,Object(_e.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Vt.current}});case 2:Ft=qt.sent,Ft!=null&&(Lt=Ft.attachments)!==null&&Lt!==void 0&&Lt.length&&(console.log("cm:",X,hr),Ft.attachments.map(function(Ht){Ht.content_type.indexOf("image")>-1?X.replaceSelection(".concat(Ht.content_type,")")):Ht.content_type.indexOf("video")>-1?X.replaceSelection('')):Ht.content_type.indexOf("pdf")>-1?X.replaceSelection('').concat(Ht.name,"")):X.replaceSelection("[".concat(Ht.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(Ht.id,"?type=").concat(Ht.content_type,")"))}));case 4:case"end":return qt.stop()}},Ot)}));return function(){return bt.apply(this,arguments)}}();Object(d.useEffect)(function(){gt(c),X==null||X.setValue(c)},[c]),Object(d.useEffect)(function(){rn==null||rn(mr)},[mr]),Object(d.useEffect)(function(){if(hr.current){var bt=m.a.fromTextArea(hr.current,{mode:St,lineNumbers:!kt,lineWrapping:!0,value:Ye,autoCloseTags:!0,autoCloseBrackets:!0});Kt&&bt.focus();function Ot(Lt,Ft){if($t){Ft.preventDefault();return}var Xt=Ft.clipboardData;if(Xt){var qt=Xt.types.toString(),Ht=Xt.items;if(qt==="Files"||Xt.types.indexOf("Files")>-1){if(Ft.preventDefault(),St=="stex")return;try{var cr,Ir=Ht[1];((cr=Ht[0])===null||cr===void 0?void 0:cr.kind)==="file"&&(Ir=Ht[0]);var jt=Ir.getAsFile(),En=jt.name.split(".").pop();$e(jt,function(Yt){if(Yt.id){var vr,en,tn;(jt==null||((vr=jt.type)===null||vr===void 0)?void 0:vr.indexOf("image"))>-1?bt.replaceSelection(".concat(Yt.content_type,")")):(jt==null||((en=jt.type)===null||en===void 0)?void 0:en.indexOf("video"))>-1?bt.replaceSelection('')):(jt==null||((tn=jt.type)===null||tn===void 0)?void 0:tn.indexOf("pdf"))>-1?bt.replaceSelection('').concat(jt.name,"")):re.includes(En)?bt.replaceSelection('').concat(jt.name,"")):bt.replaceSelection("[".concat(jt.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(Yt.id,"?type=").concat(Yt.content_type,")"))}else(Yt==null?void 0:Yt.status)===401&&(document.location.href="/user/login")})}catch(Yt){_.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return bt.on("paste",Ot),bt.on("dragleave",function(Lt,Ft){Jt.current.classList.remove("mouse-hover-md")}),bt.on("dragover",function(Lt,Ft){Jt.current.classList.add("mouse-hover-md")}),bt.on("drop",function(Lt,Ft){Jt.current.classList.add("mouse-hover-md");var Xt;if(Xt=Ft.dataTransfer.files,Xt.length>0){Ft.preventDefault(),Ft.stopPropagation();for(var qt=function(Ir){var jt=Xt[Ir],En=jt.name.split(".").pop();$e(jt,function(Yt){if(Yt.id){var vr,en,tn;(jt==null||((vr=jt.type)===null||vr===void 0)?void 0:vr.indexOf("image"))>-1?bt.replaceSelection(".concat(Yt.content_type,")")):(jt==null||((en=jt.type)===null||en===void 0)?void 0:en.indexOf("video"))>-1?bt.replaceSelection('')):(jt==null||((tn=jt.type)===null||tn===void 0)?void 0:tn.indexOf("pdf"))>-1?bt.replaceSelection('').concat(jt.name,"")):re.includes(En)?bt.replaceSelection('').concat(jt.name,"")):bt.replaceSelection("[".concat(jt.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(Yt.id,"?type=").concat(Yt.content_type,")"))}else(Yt==null?void 0:Yt.status)===401&&(document.location.href="/user/login")})},Ht=0;Ht0||Ht.target.offsetWidth>0)&&(Kn(),X.setSize("100%","100%"),X.refresh())}}catch(cr){Xt.e(cr)}finally{Xt.f()}});return Lt.observe(hr.current.parentElement),Lt}if(X){var Ot=bt();return function(){Ot.unobserve(hr.current.parentElement)}}},[X,Kn]),Object(d.useEffect)(function(){if(X){for(var bt=[],Ot=function(){var Ht=Ft[Lt];Xt=Object(F.a)(Ht,2);var cr=Xt[0],Ir=Xt[1],jt=Object(N.a)({},cr,function(){Vn(Ir)});bt.push(jt),X.addKeyMap(jt)},Lt=0,Ft=Object.entries(oe);Lt0){var bt=new Date().getTime(),Ot=window.sessionStorage.getItem(dt);bt>=mn+Oe&&(!Ot||Ot!==nt)&&(window.sessionStorage.setItem(dt,nt),or(!0))}},Oe),Object(d.useEffect)(function(){rr(Pt)},[X,Pt]),Object(d.useEffect)(function(){X&&(Kt&&X.focus())},[X,Kt]),Object(d.useEffect)(function(){if(Ut&&X){var bt=X.getScrollerElement();function Ot(Lt){var Ft=Lt.target;if(ur.current){var Xt=Ft.scrollTop/Ft.scrollHeight;ur.current.scrollTop=ur.current.scrollHeight*Xt}}return bt.addEventListener("scroll",Ot),function(){bt.removeEventListener("scroll",Ot)}}},[X,Ut]),Object(d.useEffect)(function(){if(X&&Vr){function bt(Ot,Lt){Vr(Ot,Lt)}return X.on("beforeChange",bt),function(){X.off("beforeChange",bt)}}},[X,Vr]),Object(d.useEffect)(function(){if(X&&kr){function bt(){kr(X.getValue())}return X.on("blur",bt),function(){X.off("blur",bt)}}},[X,kr]),Object(d.useEffect)(function(){if(X){function bt(Ot){var Lt=Ot.getValue();gt(Lt),dn(new Date().getTime()),Ot.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ut&&ut(Lt)}return X.on("change",bt),function(){X.off("change",bt)}}},[X,ut]),Object(d.useEffect)(function(){X&&(Ye==null?(X.setValue(""),gt("")):Ye!==X.getValue()&&(X.setValue(Ye),gt(Ye),X.setCursor(X.lineCount(),0)))},[X,Ye]);var Vn=Object(d.useCallback)(function(bt){var Ot=X.getCursor(),Lt=X.getSelection(),Ft=Lt.split(`
`);switch(bt){case"bold":return X.replaceSelection("**"+Lt+"**"),Lt===""&&X.setCursor(Ot.line,Ot.ch+2),X.focus();case"italic":return X.replaceSelection("*"+Lt+"*"),Lt===""&&X.setCursor(Ot.line,Ot.ch+1),X.focus();case"code":return X.replaceSelection("`"+Lt+"`"),Lt===""&&X.setCursor(Ot.line,Ot.ch+1),X.focus();case"inline-latex":return X.replaceSelection("`$$"+Lt+"$$`"),Lt===""&&X.setCursor(Ot.line,Ot.ch+3),X.focus();case"latex":return X.replaceSelection("```latex\n"+Lt+"\n```"),X.setCursor(Ot.line+1,Lt.length+1),X.focus();case"line-break":return X.replaceSelection(`
`),X.focus();case"list-ul":return Lt===""?X.replaceSelection("- "+Lt):X.replaceSelection(Ft.map(function(Xt){return Xt===""?"":"- ".concat(Xt)}).join(`
`)),X.focus();case"list-ol":return Lt===""?X.replaceSelection("1. "+Lt):X.replaceSelection(Ft.map(function(Xt,qt){return Xt===""?"":"".concat(qt+1,". ").concat(Xt)}).join(`
`)),X.focus();case"add-null-ch":return Lt===""&&X.setCursor(Ot.line,Ot.ch+1),X.replaceSelection(He),X.focus();case"inster-template-1":return Lt===""&&X.setCursor(Ot.line,Ot.ch),X.replaceSelection(ye),X.focus();case"eraser":return X.setValue(""),X.focus();case"trigger-watch":return rr(!Ut),X.focus();case"trigger-full-screen":return qr(!mr),X.focus();case je:Hr(je);return;case Je:Hr(Je);return;case at:Hr(at);return;case Qe:Hr(Qe);return;default:throw new Error}},[X,Ut,mr]),xn=Object(d.useCallback)(function(bt){Hr("");switch($r){case je:var Ot=bt.title,Lt=bt.link;return X.replaceSelection("[".concat(Ot,"](").concat(Lt,")")),X.focus();case Je:var Ft=bt.language,Xt=bt.content;return X.replaceSelection(["```"+Ft,Xt,"```"].join(`
`)),X.focus();case at:var qt=bt.src,Ht=bt.alt,cr=bt.name;return qt.indexOf("type=image")>-1?X.replaceSelection(".concat(qt,' "').concat(Ht||"",'" )')):qt.indexOf("type=application/pdf")>-1?X.replaceSelection('').concat(cr,"")):X.replaceSelection('').concat(cr,"")),X.focus();case Qe:for(var Ir=bt.row,jt=bt.col,En=bt.align,Yt=`
`,vr=0;vr300&&(cr=300);var Ir=et+cr+"px";Jr(Ir)}}return bt.addEventListener("mousedown",Ft),document.addEventListener("mousemove",qt),document.addEventListener("mouseup",Xt),function(){bt.removeEventListener("mousedown",Ft),document.removeEventListener("mousemove",qt),document.removeEventListener("mouseup",Xt)}}},[X,hn]),Object(d.useEffect)(function(){Jr(et)},[et]);var fi=ce(yt),on=ce(an),Xn={width:fi,height:on},ji=Object(d.useMemo)(function(){if(mn){var bt=new Date(mn),Ot=bt.getHours(),Lt=bt.getMinutes(),Ft=bt.getSeconds();return Ot=Ot<10?"0"+Ot:Ot,Lt=Lt<10?"0"+Lt:Lt,Ft=Ft<10?"0"+Ft:Ft,"".concat(Ot,":").concat(Lt,":").concat(Ft)}return 0},[mn]);function Mn(){window.sessionStorage.removeItem(dt),or(!1),dn(0)}function $a(){or(!1),dn(0),X.setValue(window.sessionStorage.getItem(dt))}function da(bt,Ot){var Lt=X.getValue();Lt=Lt.replace(bt,Ot),gt(Lt),X==null||X.setValue(Lt)}return h.a.createElement(d.Fragment,null,h.a.createElement("div",{className:"markdown-editor-wrapper",ref:Jt},h.a.createElement("div",{className:"markdown-editor-container ".concat(ct," ").concat(Ut?"on-preview":""," ").concat(kt?"mini":""," ").concat(mr?"full-screen":""),style:Xn},h.a.createElement(A,{insertTemp:wr,watch:Ut,fullScreen:mr,showNullButton:pt,onActionCallback:Vn,hidetoolBar:Lr,uuid:Vt.current,setOpenPhones:function(){Sr.current=!0}}),h.a.createElement("div",{className:"markdown-editor-body"},h.a.createElement("div",{className:"codemirror-container"},h.a.createElement("textarea",{ref:hr,placeholder:tr})),Ut?h.a.createElement("div",{ref:ur,className:"preview-container"},St==="stex"&&h.a.createElement(R,{value:nt}),St!=="stex"&&h.a.createElement(y.a,{edit:!0,value:nt,replaces:da})):null))),Rt?h.a.createElement("a",{ref:hn,className:"editor-resize"}):null,h.a.createElement(I.a,null,he[$r]?h.a.createElement($.a,{centered:!0,title:he[$r],visible:!0,onCancel:Gr,footer:null},Ui):null))}},QDVR:function(mt,Ee,Q){"use strict";Q.d(Ee,"e",function(){return $}),Q.d(Ee,"d",function(){return O}),Q.d(Ee,"c",function(){return F}),Q.d(Ee,"b",function(){return N}),Q.d(Ee,"a",function(){return k});var ne=function(){var d=function(h,S){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,p){m.__proto__=p}||function(m,p){for(var v in p)p.hasOwnProperty(v)&&(m[v]=p[v])},d(h,S)};return function(h,S){d(h,S);function m(){this.constructor=h}h.prototype=S===null?Object.create(S):(m.prototype=S.prototype,new m)}}();function $(d){var h=[];return d.forEach(function(S){return h.push(S)}),h}function O(d){var h=[];return d.forEach(function(S,m){return h.push(m)}),h}var V=function(){function d(){this._value="",this._pos=0}return d.prototype.reset=function(h){return this._value=h,this._pos=0,this},d.prototype.next=function(){return this._pos+=1,this},d.prototype.hasNext=function(){return this._pos0)p.left||(p.left=new P,p.left.segment=m.value()),p=p.left;else if(v<0)p.right||(p.right=new P,p.right.segment=m.value()),p=p.right;else if(m.hasNext())m.next(),p.mid||(p.mid=new P,p.mid.segment=m.value()),p=p.mid;else break}var a=p.value;return p.value=S,p.key=h,a},d.prototype.get=function(h){for(var S=this._iter.reset(h),m=this._root;m;){var p=S.cmp(m.segment);if(p>0)m=m.left;else if(p<0)m=m.right;else if(S.hasNext())S.next(),m=m.mid;else break}return m?m.value:void 0},d.prototype.findSubstr=function(h){for(var S=this._iter.reset(h),m=this._root,p=void 0;m;){var v=S.cmp(m.segment);if(v>0)m=m.left;else if(v<0)m=m.right;else if(S.hasNext())S.next(),p=m.value||p,m=m.mid;else break}return m&&m.value||p},d.prototype.forEach=function(h){this._forEach(this._root,h)},d.prototype._forEach=function(h,S){h&&(this._forEach(h.left,S),h.value&&S(h.value,h.key),this._forEach(h.mid,S),this._forEach(h.right,S))},d}(),N=function(){function d(){this.map=new Map,this.ignoreCase=!1}return d.prototype.set=function(h,S){this.map.set(this.toKey(h),S)},d.prototype.get=function(h){return this.map.get(this.toKey(h))},d.prototype.toKey=function(h){var S=h.toString();return this.ignoreCase&&(S=S.toLowerCase()),S},d}(),M=function(){function d(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}return d.prototype.clear=function(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0},Object.defineProperty(d.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),d.prototype.get=function(h,S){S===void 0&&(S=0);var m=this._map.get(h);return m?(S!==0&&this.touch(m,S),m.value):void 0},d.prototype.set=function(h,S,m){m===void 0&&(m=0);var p=this._map.get(h);if(p)p.value=S,m!==0&&this.touch(p,m);else{p={key:h,value:S,next:void 0,previous:void 0};switch(m){case 0:this.addItemLast(p);break;case 1:this.addItemFirst(p);break;case 2:this.addItemLast(p);break;default:this.addItemLast(p);break}this._map.set(h,p),this._size++}},d.prototype.delete=function(h){return!!this.remove(h)},d.prototype.remove=function(h){var S=this._map.get(h);return S?(this._map.delete(h),this.removeItem(S),this._size--,S.value):void 0},d.prototype.forEach=function(h,S){for(var m=this._head;m;)S?h.bind(S)(m.value,m.key,this):h(m.value,m.key,this),m=m.next},d.prototype.trimOld=function(h){if(h>=this.size)return;if(h===0){this.clear();return}for(var S=this._head,m=this.size;S&&m>h;)this._map.delete(S.key),S=S.next,m--;this._head=S,this._size=m,S&&(S.previous=void 0)},d.prototype.addItemFirst=function(h){if(!this._head&&!this._tail)this._tail=h;else if(this._head)h.next=this._head,this._head.previous=h;else throw new Error("Invalid list");this._head=h},d.prototype.addItemLast=function(h){if(!this._head&&!this._tail)this._head=h;else if(this._tail)h.previous=this._tail,this._tail.next=h;else throw new Error("Invalid list");this._tail=h},d.prototype.removeItem=function(h){if(h===this._head&&h===this._tail)this._head=void 0,this._tail=void 0;else if(h===this._head){if(!h.next)throw new Error("Invalid list");h.next.previous=void 0,this._head=h.next}else if(h===this._tail){if(!h.previous)throw new Error("Invalid list");h.previous.next=void 0,this._tail=h.previous}else{var S=h.next,m=h.previous;if(!S||!m)throw new Error("Invalid list");S.previous=m,m.next=S}h.next=void 0,h.previous=void 0},d.prototype.touch=function(h,S){if(!this._head||!this._tail)throw new Error("Invalid list");if(S!==1&&S!==2)return;if(S===1){if(h===this._head)return;var m=h.next,p=h.previous;h===this._tail?(p.next=void 0,this._tail=p):(m.previous=p,p.next=m),h.previous=void 0,h.next=this._head,this._head.previous=h,this._head=h}else if(S===2){if(h===this._tail)return;var m=h.next,p=h.previous;h===this._head?(m.previous=void 0,this._head=m):(m.previous=p,p.next=m),h.next=void 0,h.previous=this._tail,this._tail.next=h,this._tail=h}},d.prototype.toJSON=function(){var h=[];return this.forEach(function(S,m){h.push([m,S])}),h},d}(),k=function(d){ne(h,d);function h(S,m){m===void 0&&(m=1);var p=d.call(this)||this;return p._limit=S,p._ratio=Math.min(Math.max(0,m),1),p}return h.prototype.get=function(S){return d.prototype.get.call(this,S,2)},h.prototype.peek=function(S){return d.prototype.get.call(this,S,0)},h.prototype.set=function(S,m){d.prototype.set.call(this,S,m,2),this.checkTrim()},h.prototype.checkTrim=function(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))},h}(M)},RotF:function(mt,Ee,Q){mt.exports=Q("LSTS")},SJMd:function(mt,Ee){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var Q,ne,$,O=!1,V,_;window.PR_SHOULD_USE_CONTINUATION=!0;var P,F;(function(){var N=window,M=["break,continue,do,else,for,if,return,while"],k=[M,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],d=[k,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],h=[d,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],S=[d,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],m=[d,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],p="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",v=[d,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],a="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",i=[M,"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=[M,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],l=[M,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],C=[h,m,S,v,a,i,s,l],g=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,y="str",R="kwd",w="com",T="typ",b="lit",f="pun",u="pln",L="tag",x="dec",A="src",I="atn",W="atv",K="nocode",Z="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function z(ae){for(var ve=0,we=!1,Pe=!1,_e=0,Ue=ae.length;_e122||(te<65||me>90||Xe.push([Math.max(65,me)|32,Math.min(te,90)|32]),te<97||me>122||Xe.push([Math.max(97,me)&~32,Math.min(te,122)&~32]))}}Xe.sort(function(Te,xe){return Te[0]-xe[0]||xe[1]-Te[1]});for(var re=[],oe=[],He=0;Hehe[0]&&(he[1]+1>he[0]&&Oe.push("-"),Oe.push(Qe(he[1])))}return Oe.push("]"),Oe.join("")}function ht(rt){for(var Le=rt.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")),Xe=Le.length,lt=[],Oe=0,He=0;Oe=2&&me==="["?Le[Oe]=Ve(ye):me!=="\\"&&(Le[Oe]=ye.replace(/[a-zA-Z]/g,function(oe){var he=oe.charCodeAt(0);return"["+String.fromCharCode(he&~32,he|32)+"]"}))}return Le.join("")}for(var it=[],_e=0,Ue=ae.length;_e=0;)we[it.charAt(rt)]=ht;var Le=ht[1],Xe=""+Le;Je.hasOwnProperty(Xe)||(at.push(Le),Je[Xe]=null)}at.push(/[\0-\uffff]/),Pe=z(at)})();var _e=ve.length,Ue=function(je){for(var at=je.sourceCode,Je=je.basePos,Qe=je.sourceNode,Ve=[Je,u],ht=0,it=at.match(Pe)||[],rt={},Le=0,Xe=it.length;Le=5&&Oe.substring(0,5)==="lang-",ye&&!(He&&typeof He[1]=="string")&&(ye=!1,Oe=A),ye||(rt[lt]=Oe)}var te=ht;if(ht+=lt.length,!ye)Ve.push(Je+te,Oe);else{var re=He[1],oe=lt.indexOf(re),he=oe+re.length;He[2]&&(he=lt.length-He[2].length,oe=he-re.length);var Te=Oe.substring(5);ee(Qe,Je+te,lt.substring(0,oe),Ue,Ve),ee(Qe,Je+te+oe,re,ue(Te,re),Ve),ee(Qe,Je+te+he,lt.substring(he),Ue,Ve)}}je.decorations=Ve};return Ue}function Ie(ae){var ve=[],we=[];ae.tripleQuotedStrings?ve.push([y,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ae.multiLineStrings?ve.push([y,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):ve.push([y,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ae.verbatimStrings&&we.push([y,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Pe=ae.hashComments;Pe&&(ae.cStyleComments?(Pe>1?ve.push([w,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):ve.push([w,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),we.push([y,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):ve.push([w,/^#[^\r\n]*/,null,"#"])),ae.cStyleComments&&(we.push([w,/^\/\/[^\r\n]*/,null]),we.push([w,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var _e=ae.regexLiterals;if(_e){var Ue=_e>1?"":`
\r`,je=Ue?".":"[\\S\\s]",at="/(?=[^/*"+Ue+"])(?:[^/\\x5B\\x5C"+Ue+"]|\\x5C"+je+"|\\x5B(?:[^\\x5C\\x5D"+Ue+"]|\\x5C"+je+")*(?:\\x5D|$))+/";we.push(["lang-regex",RegExp("^"+Z+"("+at+")")])}var Je=ae.types;Je&&we.push([T,Je]);var Qe=(""+ae.keywords).replace(/^ | $/g,"");Qe.length&&we.push([R,new RegExp("^(?:"+Qe.replace(/[\s,]+/g,"|")+")\\b"),null]),ve.push([u,/^\s+/,null,` \r
\xA0`]);var Ve="^.[^\\s\\w.$@'\"`/\\\\]*";return ae.regexLiterals&&(Ve+="(?!s*/)"),we.push([b,/^@[a-z_$][a-z_$@0-9]*/i,null],[T,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[u,/^[a-z_$][a-z_$@0-9]*/i,null],[b,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[u,/^\\[\s\S]?/,null],[f,new RegExp(Ve),null]),be(ve,we)}var Ae=Ie({keywords:C,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Re(ae,ve,we){for(var Pe=/(?:^|\s)nocode(?:\s|$)/,_e=/\r\n?|\n/,Ue=ae.ownerDocument,je=Ue.createElement("li");ae.firstChild;)je.appendChild(ae.firstChild);var at=[je];function Je(Le){var Xe=Le.nodeType;if(Xe==1&&!Pe.test(Le.className))if(Le.nodeName==="br")Qe(Le),Le.parentNode&&Le.parentNode.removeChild(Le);else for(var lt=Le.firstChild;lt;lt=lt.nextSibling)Je(lt);else if((Xe==3||Xe==4)&&we){var Oe=Le.nodeValue,He=Oe.match(_e);if(He){var ye=Oe.substring(0,He.index);Le.nodeValue=ye;var ce=Oe.substring(He.index+He[0].length);if(ce){var me=Le.parentNode;me.insertBefore(Ue.createTextNode(ce),Le.nextSibling)}Qe(Le),ye||Le.parentNode.removeChild(Le)}}}function Qe(Le){for(;!Le.nextSibling;)if(Le=Le.parentNode,!Le)return;function Xe(He,ye){var ce=ye?He.cloneNode(!1):He,me=He.parentNode;if(me){var te=Xe(me,1),re=He.nextSibling;te.appendChild(ce);for(var oe=re;oe;oe=re)re=oe.nextSibling,te.appendChild(oe)}return ce}for(var lt=Xe(Le.nextSibling,0),Oe;(Oe=lt.parentNode)&&Oe.nodeType===1;)lt=Oe;at.push(lt)}for(var Ve=0;Ve=me&&(Je+=2),Ue>=te&&(ht+=2)}}finally{Oe&&(Oe.style.display=He)}}var De={};function ge(ae,ve){for(var we=ve.length;--we>=0;){var Pe=ve[we];De.hasOwnProperty(Pe)?N.console&&console.warn("cannot override language handler %s",Pe):De[Pe]=ae}}function ue(ae,ve){return ae&&De.hasOwnProperty(ae)||(ae=/^\s*]*(?:>|$)/],[w,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[f,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^