(window.webpackJsonp=window.webpackJsonp||[]).push([[161,5,7],{"+NIl":function(ht,be,Z){(function(re){re(Z("VrN/"))})(function(re){"use strict";re.defineMode("stex",function($,P){"use strict";function X(u,o){u.cmdState.push(o)}function U(u){return u.cmdState.length>0?u.cmdState[u.cmdState.length-1]:null}function k(u){var o=u.cmdState.pop();o&&o.closeBracket()}function G(u){for(var o=u.cmdState,f=o.length-1;f>=0;f--){var l=o[f];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function W(u,o,f){return function(){this.name=u,this.bracketNo=0,this.style=o,this.styles=f,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var i={};i.importmodule=W("importmodule","tag",["string","builtin"]),i.documentclass=W("documentclass","tag",["","atom"]),i.usepackage=W("usepackage","tag",["atom"]),i.begin=W("begin","tag",["atom"]),i.end=W("end","tag",["atom"]),i.label=W("label","tag",["atom"]),i.ref=W("ref","tag",["atom"]),i.eqref=W("eqref","tag",["atom"]),i.cite=W("cite","tag",["atom"]),i.bibitem=W("bibitem","tag",["atom"]),i.Bibitem=W("Bibitem","tag",["atom"]),i.RBibitem=W("RBibitem","tag",["atom"]),i.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(u,o){u.f=o}function g(u,o){var f;if(u.match(/^\\[a-zA-Z@]+/)){var l=u.current().slice(1);return f=i.hasOwnProperty(l)?i[l]:i.DEFAULT,f=new f,X(o,f),D(o,m),f.style}if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/\\]/))return"tag";if(u.match("\\["))return D(o,function(a,s){return p(a,s,"\\]")}),"keyword";if(u.match("\\("))return D(o,function(a,s){return p(a,s,"\\)")}),"keyword";if(u.match("$$"))return D(o,function(a,s){return p(a,s,"$$")}),"keyword";if(u.match("$"))return D(o,function(a,s){return p(a,s,"$")}),"keyword";var h=u.next();if(h=="%")return u.skipToEnd(),"comment";if(h=="}"||h=="]"){if(f=U(o),f)f.closeBracket(h),D(o,m);else return"error";return"bracket"}else return h=="{"||h=="["?(f=i.DEFAULT,f=new f,X(o,f),"bracket"):/\d/.test(h)?(u.eatWhile(/[\w.%]/),"atom"):(u.eatWhile(/[\w\-_]/),f=G(o),f.name=="begin"&&(f.argument=u.current()),f.styleIdentifier())}function p(u,o,f){if(u.eatSpace())return null;if(f&&u.match(f))return D(o,g),"keyword";if(u.match(/^\\[a-zA-Z@]+/))return"tag";if(u.match(/^[a-zA-Z]+/))return"variable-2";if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/]/))return"tag";if(u.match(/^[\^_&]/))return"tag";if(u.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(u.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var l=u.next();return l=="{"||l=="}"||l=="["||l=="]"||l=="("||l==")"?"bracket":l=="%"?(u.skipToEnd(),"comment"):"error"}function m(u,o){var f=u.peek(),l;return f=="{"||f=="["?(l=U(o),l.openBracket(f),u.eat(f),D(o,g),"bracket"):/[ \t\r]/.test(f)?(u.eat(f),null):(D(o,g),k(o),g(u,o))}return{startState:function(){var u=P.inMathMode?function(o,f){return p(o,f)}:g;return{cmdState:[],f:u}},copyState:function(u){return{cmdState:u.cmdState.slice(),f:u.f}},token:function(u,o){return o.f(u,o)},blankLine:function(u){u.f=g,u.cmdState.length=0},lineComment:"%"}}),re.defineMIME("text/x-stex","stex"),re.defineMIME("text/x-latex","stex")})},"+ua5":function(ht,be,Z){},"/cxE":function(ht,be,Z){"use strict";Z.d(be,"f",function(){return P}),Z.d(be,"g",function(){return X}),Z.d(be,"h",function(){return U}),Z.d(be,"e",function(){return G}),Z.d(be,"b",function(){return W}),Z.d(be,"c",function(){return i}),Z.d(be,"d",function(){return D}),Z.d(be,"a",function(){return g});class re{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(p){setTimeout(()=>{throw p.stack?new Error(p.message+`
`+p.stack):p},0)}}emit(p){this.listeners.forEach(m=>{m(p)})}onUnexpectedError(p){this.unexpectedErrorHandler(p),this.emit(p)}onUnexpectedExternalError(p){this.unexpectedErrorHandler(p)}}const $=new re;function P(p){G(p)||$.onUnexpectedError(p);return}function X(p){G(p)||$.onUnexpectedExternalError(p);return}function U(p){if(p instanceof Error){let{name:m,message:u}=p;const o=p.stacktrace||p.stack;return{$isError:!0,name:m,message:u,stack:o}}return p}const k="Canceled";function G(p){return p instanceof Error&&p.name===k&&p.message===k}function W(){const p=new Error(k);return p.name=p.message,p}function i(p){return p?new Error(`Illegal argument: ${p}`):new Error("Illegal argument")}function D(p){return p?new Error(`Illegal state: ${p}`):new Error("Illegal state")}class g extends Error{constructor(p){super("NotSupported");p&&(this.message=p)}}},"19Vz":function(ht,be,Z){(function(re){re(Z("VrN/"))})(function(re){re.defineOption("placeholder","",function(W,i,D){var g=D&&D!=re.Init;if(i&&!g)W.on("blur",U),W.on("change",k),W.on("swapDoc",k),re.on(W.getInputField(),"compositionupdate",W.state.placeholderCompose=function(){X(W)}),k(W);else if(!i&&g){W.off("blur",U),W.off("change",k),W.off("swapDoc",k),re.off(W.getInputField(),"compositionupdate",W.state.placeholderCompose),$(W);var p=W.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}i&&!W.hasFocus()&&U(W)});function $(W){W.state.placeholder&&(W.state.placeholder.parentNode.removeChild(W.state.placeholder),W.state.placeholder=null)}function P(W){$(W);var i=W.state.placeholder=document.createElement("pre");i.style.cssText="height: 0; overflow: visible",i.style.direction=W.getOption("direction"),i.className="CodeMirror-placeholder CodeMirror-line-like";var D=W.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),i.appendChild(D),W.display.lineSpace.insertBefore(i,W.display.lineSpace.firstChild)}function X(W){setTimeout(function(){var i=!1,D=W.getInputField();D.nodeName=="TEXTAREA"?i=!D.value:W.lineCount()==1&&(i=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),i?P(W):$(W)},20)}function U(W){G(W)&&P(W)}function k(W){var i=W.getWrapperElement(),D=G(W);i.className=i.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?P(W):$(W)}function G(W){return W.lineCount()===1&&W.getLine(0)===""}})},"1eCo":function(ht,be,Z){(function(re){re(Z("VrN/"))})(function(re){"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},P={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};re.defineMode("xml",function(X,U){var k=X.indentUnit,G={},W=U.htmlMode?$:P;for(var i in W)G[i]=W[i];for(var i in U)G[i]=U[i];var D,g;function p(c,w){function v(B){return w.tokenize=B,B(c,w)}var y=c.next();if(y=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?v(o("atom","]]>")):null:c.match("--")?v(o("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),v(f(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),w.tokenize=o("meta","?>"),"meta"):(D=c.eat("/")?"closeTag":"openTag",w.tokenize=m,"tag bracket");if(y=="&"){var F;return c.eat("#")?c.eat("x")?F=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):F=c.eatWhile(/[\d]/)&&c.eat(";"):F=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),F?"atom":"error"}else return c.eatWhile(/[^&<]/),null}p.isInText=!0;function m(c,w){var v=c.next();if(v==">"||v=="/"&&c.eat(">"))return w.tokenize=p,D=v==">"?"endTag":"selfcloseTag","tag bracket";if(v=="=")return D="equals",null;if(v=="<"){w.tokenize=p,w.state=s,w.tagName=w.tagStart=null;var y=w.tokenize(c,w);return y?y+" tag error":"tag error"}else return/[\'\"]/.test(v)?(w.tokenize=u(v),w.stringStartCol=c.column(),w.tokenize(c,w)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function u(c){var w=function(v,y){for(;!v.eol();)if(v.next()==c){y.tokenize=m;break}return"string"};return w.isInAttribute=!0,w}function o(c,w){return function(v,y){for(;!v.eol();){if(v.match(w)){y.tokenize=p;break}v.next()}return c}}function f(c){return function(w,v){for(var y;(y=w.next())!=null;){if(y=="<")return v.tokenize=f(c+1),v.tokenize(w,v);if(y==">")if(c==1){v.tokenize=p;break}else return v.tokenize=f(c-1),v.tokenize(w,v)}return"meta"}}function l(c,w,v){this.prev=c.context,this.tagName=w,this.indent=c.indented,this.startOfLine=v,(G.doNotIndent.hasOwnProperty(w)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function h(c){c.context&&(c.context=c.context.prev)}function a(c,w){for(var v;;){if(!c.context)return;if(v=c.context.tagName,!G.contextGrabbers.hasOwnProperty(v)||!G.contextGrabbers[v].hasOwnProperty(w))return;h(c)}}function s(c,w,v){return c=="openTag"?(v.tagStart=w.column(),A):c=="closeTag"?E:s}function A(c,w,v){return c=="word"?(v.tagName=w.current(),g="tag",O):G.allowMissingTagName&&c=="endTag"?(g="tag bracket",O(c,w,v)):(g="error",A)}function E(c,w,v){if(c=="word"){var y=w.current();return v.context&&v.context.tagName!=y&&G.implicitlyClosed.hasOwnProperty(v.context.tagName)&&h(v),v.context&&v.context.tagName==y||G.matchClosing===!1?(g="tag",S):(g="tag error",L)}else return G.allowMissingTagName&&c=="endTag"?(g="tag bracket",S(c,w,v)):(g="error",L)}function S(c,w,v){return c!="endTag"?(g="error",S):(h(v),s)}function L(c,w,v){return g="error",S(c,w,v)}function O(c,w,v){if(c=="word")return g="attribute",C;if(c=="endTag"||c=="selfcloseTag"){var y=v.tagName,F=v.tagStart;return v.tagName=v.tagStart=null,c=="selfcloseTag"||G.autoSelfClosers.hasOwnProperty(y)?a(v,y):(a(v,y),v.context=new l(v,y,F==v.indented)),s}return g="error",O}function C(c,w,v){return c=="equals"?T:(G.allowMissing||(g="error"),O(c,w,v))}function T(c,w,v){return c=="string"?x:c=="word"&&G.allowUnquoted?(g="string",O):(g="error",O(c,w,v))}function x(c,w,v){return c=="string"?x:O(c,w,v)}return{startState:function(c){var w={tokenize:p,state:s,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(w.baseIndent=c),w},token:function(c,w){if(!w.tagName&&c.sol()&&(w.indented=c.indentation()),c.eatSpace())return null;D=null;var v=w.tokenize(c,w);return(v||D)&&v!="comment"&&(g=null,w.state=w.state(D||v,c,w),g&&(v=g=="error"?v+" error":g)),v},indent:function(c,w,v){var y=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+k;if(y&&y.noIndent)return re.Pass;if(c.tokenize!=m&&c.tokenize!=p)return v?v.match(/^(\s*)/)[0].length:0;if(c.tagName)return G.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+k*(G.multilineTagIndentFactor||1);if(G.alignCDATA&&/$/,blockCommentStart:"",configuration:G.htmlMode?"html":"xml",helperType:G.htmlMode?"html":"xml",skipAttribute:function(c){c.state==T&&(c.state=O)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var w=[],v=c.context;v;v=v.prev)v.tagName&&w.push(v.tagName);return w.reverse()}}}),re.defineMIME("text/xml","xml"),re.defineMIME("application/xml","xml"),re.mimeModes.hasOwnProperty("text/html")||re.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(ht,be,Z){"use strict";Z.d(be,"a",function(){return $});class re{constructor(P){this.element=P,this.next=re.Undefined,this.prev=re.Undefined}}re.Undefined=new re(void 0);class ${constructor(){this._first=re.Undefined,this._last=re.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===re.Undefined}clear(){let P=this._first;for(;P!==re.Undefined;){const X=P.next;P.prev=re.Undefined,P.next=re.Undefined,P=X}this._first=re.Undefined,this._last=re.Undefined,this._size=0}unshift(P){return this._insert(P,!1)}push(P){return this._insert(P,!0)}_insert(P,X){const U=new re(P);if(this._first===re.Undefined)this._first=U,this._last=U;else if(X){const G=this._last;this._last=U,U.prev=G,G.next=U}else{const G=this._first;this._first=U,U.next=G,G.prev=U}this._size+=1;let k=!1;return()=>{k||(k=!0,this._remove(U))}}shift(){if(this._first===re.Undefined)return;{const P=this._first.element;return this._remove(this._first),P}}pop(){if(this._last===re.Undefined)return;{const P=this._last.element;return this._remove(this._last),P}}_remove(P){if(P.prev!==re.Undefined&&P.next!==re.Undefined){const X=P.prev;X.next=P.next,P.next.prev=X}else P.prev===re.Undefined&&P.next===re.Undefined?(this._first=re.Undefined,this._last=re.Undefined):P.next===re.Undefined?(this._last=this._last.prev,this._last.next=re.Undefined):P.prev===re.Undefined&&(this._first=this._first.next,this._first.prev=re.Undefined);this._size-=1}*[Symbol.iterator](){let P=this._first;for(;P!==re.Undefined;)yield P.element,P=P.next}}},"3/fG":function(ht,be,Z){"use strict";Z.d(be,"a",function(){return $});function re(P,X){let U;return X.length===0?U=P:U=P.replace(/\{(\d+)\}/g,function(k,G){const W=G[0];return typeof X[W]!="undefined"?X[W]:k}),U}function $(P,X,...U){return re(X,U)}},"55Ip":function(ht,be,Z){"use strict";Z.d(be,"a",function(){return a});var re=Z("Ty5D"),$=Z("dI71"),P=Z("q1tI"),X=Z.n(P),U=Z("YS25"),k=Z("17x9"),G=Z.n(k),W=Z("wx14"),i=Z("zLVn"),D=Z("9R94"),g=function(T){Object($.a)(x,T);function x(){for(var w,v=arguments.length,y=new Array(v),F=0;Fee&&(ee=b.line_indent_level));var ae={mode:Y,parent:b,last_token:b?b.last_token:new m(a.START_BLOCK,""),last_word:b?b.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:ee,alignment:0,line_indent_level:b?b.line_indent_level:ee,start_line_index:this._output.get_line_number(),ternary_depth:0};return ae},j.prototype._reset=function(b){var Y=b.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new p(this._options,Y),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(c.BlockStatement);var ee=new f(b,this._options);return this._tokens=ee.tokenize(),b},j.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var b,Y=this._reset(this._source_text),ee=this._options.eol;this._options.eol==="auto"&&(ee=`
`,Y&&u.lineBreak.test(Y||"")&&(ee=Y.match(u.lineBreak)[0]));for(var ae=this._tokens.next();ae;)this.handle_token(ae),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ae,ae=this._tokens.next();return b=this._output.get_code(ee),b},j.prototype.handle_token=function(b,Y){b.type===a.START_EXPR?this.handle_start_expr(b):b.type===a.END_EXPR?this.handle_end_expr(b):b.type===a.START_BLOCK?this.handle_start_block(b):b.type===a.END_BLOCK?this.handle_end_block(b):b.type===a.WORD?this.handle_word(b):b.type===a.RESERVED?this.handle_word(b):b.type===a.SEMICOLON?this.handle_semicolon(b):b.type===a.STRING?this.handle_string(b):b.type===a.EQUALS?this.handle_equals(b):b.type===a.OPERATOR?this.handle_operator(b):b.type===a.COMMA?this.handle_comma(b):b.type===a.BLOCK_COMMENT?this.handle_block_comment(b,Y):b.type===a.COMMENT?this.handle_comment(b,Y):b.type===a.DOT?this.handle_dot(b):b.type===a.EOF?this.handle_eof(b):b.type===a.UNKNOWN?this.handle_unknown(b,Y):this.handle_unknown(b,Y)},j.prototype.handle_whitespace_and_comments=function(b,Y){var ee=b.newlines,ae=this._options.keep_array_indentation&&y(this._flags.mode);if(b.comments_before)for(var ue=b.comments_before.next();ue;)this.handle_whitespace_and_comments(ue,Y),this.handle_token(ue,Y),ue=b.comments_before.next();if(ae)for(var Oe=0;Oe0,Y);else if(this._options.max_preserve_newlines&&ee>this._options.max_preserve_newlines&&(ee=this._options.max_preserve_newlines),this._options.preserve_newlines&&ee>1){this.print_newline(!1,Y);for(var Ee=1;Ee0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},j.prototype.set_mode=function(b){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,b),this._flags=this.create_flags(this._previous_flags,b),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},j.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===c.Statement&&w(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},j.prototype.start_of_object_property=function(){return this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"]))},j.prototype.start_of_statement=function(b){var Y=!1;return Y=Y||L(this._flags.last_token,["var","let","const"])&&b.type===a.WORD,Y=Y||S(this._flags.last_token,"do"),Y=Y||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&L(this._flags.last_token,N)&&!b.newlines,Y=Y||S(this._flags.last_token,"else")&&!(S(b,"if")&&!b.comments_before),Y=Y||this._flags.last_token.type===a.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),Y=Y||this._flags.last_token.type===a.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(b.text==="--"||b.text==="++")&&this._last_last_text!=="function"&&b.type!==a.WORD&&b.type!==a.RESERVED,Y=Y||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"])),Y?(this.set_mode(c.Statement),this.indent(),this.handle_whitespace_and_comments(b,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b,L(b,["do","for","if","while"])),!0):!1},j.prototype.handle_start_expr=function(b){this.start_of_statement(b)||this.handle_whitespace_and_comments(b);var Y=c.Expression;if(b.text==="["){if(this._flags.last_token.type===a.WORD||this._flags.last_token.text===")"){L(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(b),this.set_mode(Y),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}Y=c.ArrayLiteral,y(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),s(this._flags.last_token.type,[a.START_EXPR,a.END_EXPR,a.WORD,a.OPERATOR,a.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===a.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,Y=c.ForInitializer):s(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,Y=c.Conditional):s(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&b.whitespace_before===""?this._output.space_before_token=!1:(s(this._flags.last_token.text,l)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b);else if(this._flags.last_token.type===a.WORD){this._output.space_before_token=!1;var ee=this._tokens.peek(-3);if(this._options.space_after_named_function&&ee){var ae=this._tokens.peek(-4);L(ee,["async","function"])||ee.text==="*"&&L(ae,["async","function"])?this._output.space_before_token=!0:this._flags.mode===c.ObjectLiteral?(ee.text==="{"||ee.text===","||ee.text==="*"&&(ae.text==="{"||ae.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(b);(this._flags.last_token.type===a.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&s(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===a.START_BLOCK?this.print_newline():(this._flags.last_token.type===a.END_EXPR||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===a.COMMA)&&this.allow_wrap_or_preserved_newline(b,b.newlines),this.print_token(b),this.set_mode(Y),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},j.prototype.handle_end_expr=function(b){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(b),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(b,b.text==="]"&&y(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===a.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(b),this.restore_mode(),w(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===c.Conditional&&(this._previous_flags.mode=c.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},j.prototype.handle_start_block=function(b){this.handle_whitespace_and_comments(b);var Y=this._tokens.peek(),ee=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===a.END_EXPR?(this.set_mode(c.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(c.BlockStatement):ee&&(s(ee.text,[":",","])&&s(Y.type,[a.STRING,a.WORD,a.RESERVED])||s(Y.text,["get","set","..."])&&s(ee.type,[a.WORD,a.RESERVED]))?s(this._last_last_text,["class","interface"])&&!s(ee.text,[":",","])?this.set_mode(c.BlockStatement):this.set_mode(c.ObjectLiteral):this._flags.last_token.type===a.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(c.BlockStatement):s(this._flags.last_token.type,[a.EQUALS,a.START_EXPR,a.COMMA,a.OPERATOR])||L(this._flags.last_token,["return","throw","import","default"])?this.set_mode(c.ObjectLiteral):this.set_mode(c.BlockStatement),this._flags.last_token&&(L(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ae=!Y.comments_before&&Y.text==="}",ue=ae&&this._flags.last_word==="function"&&this._flags.last_token.type===a.END_EXPR;if(this._options.brace_preserve_inline){var Oe=0,Ee=null;this._flags.inline_frame=!0;do if(Oe+=1,Ee=this._tokens.peek(Oe-1),Ee.newlines){this._flags.inline_frame=!1;break}while(Ee.type!==a.EOF&&!(Ee.type===a.END_BLOCK&&Ee.opened===b))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&b.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==a.OPERATOR&&(ue||this._flags.last_token.type===a.EQUALS||L(this._flags.last_token,O)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(y(this._previous_flags.mode)&&(this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.COMMA)&&((this._flags.last_token.type===a.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(b),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==a.OPERATOR&&this._flags.last_token.type!==a.START_EXPR&&(this._flags.last_token.type===a.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(b),this.indent(),!ae&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},j.prototype.handle_end_block=function(b){for(this.handle_whitespace_and_comments(b);this._flags.mode===c.Statement;)this.restore_mode();var Y=this._flags.last_token.type===a.START_BLOCK;this._flags.inline_frame&&!Y?this._output.space_before_token=!0:this._options.brace_style==="expand"?Y||this.print_newline():Y||(y(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(b)},j.prototype.handle_word=function(b){if(b.type===a.RESERVED){if(s(b.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)b.type=a.WORD;else if(b.text==="import"&&s(this._tokens.peek().text,["(","."]))b.type=a.WORD;else if(s(b.text,["as","from"])&&!this._flags.import_block)b.type=a.WORD;else if(this._flags.mode===c.ObjectLiteral){var Y=this._tokens.peek();Y.text===":"&&(b.type=a.WORD)}}if(this.start_of_statement(b)?L(this._flags.last_token,["var","let","const"])&&b.type===a.WORD&&(this._flags.declaration_statement=!0):b.newlines&&!F(this._flags.mode)&&(this._flags.last_token.type!==a.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==a.EQUALS&&(this._options.preserve_newlines||!L(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(b),this.print_newline()):this.handle_whitespace_and_comments(b),this._flags.do_block&&!this._flags.do_while)if(S(b,"while")){this._output.space_before_token=!0,this.print_token(b),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&S(b,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===c.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&L(b,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(b),this._flags.in_case=!0;return}if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b)),S(b,"function")){(s(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(s(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===a.OPERATOR))&&(!this._output.just_added_blankline()&&!b.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD?L(this._flags.last_token,["get","set","new","export"])||L(this._flags.last_token,N)?this._output.space_before_token=!0:S(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===a.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(F(this._flags.mode)||y(this._flags.mode))||this.print_newline(),this.print_token(b),this._flags.last_word=b.text;return}var ee="NONE";if(this._flags.last_token.type===a.END_BLOCK?this._previous_flags.inline_frame?ee="SPACE":L(b,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&b.newlines?ee="NEWLINE":(ee="SPACE",this._output.space_before_token=!0):ee="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&this._flags.mode===c.BlockStatement?ee="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&F(this._flags.mode)?ee="SPACE":this._flags.last_token.type===a.STRING?ee="NEWLINE":this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD||this._flags.last_token.text==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&s(this._last_last_text,["{",","]))?ee="SPACE":this._flags.last_token.type===a.START_BLOCK?this._flags.inline_frame?ee="SPACE":ee="NEWLINE":this._flags.last_token.type===a.END_EXPR&&(this._output.space_before_token=!0,ee="NEWLINE"),L(b,l)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?ee="SPACE":ee="NEWLINE"),L(b,["else","catch","finally"]))if((!(this._flags.last_token.type===a.END_BLOCK&&this._previous_flags.mode===c.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&b.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ae=this._output.current_line;ae.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else ee==="NEWLINE"?L(this._flags.last_token,O)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&L(b,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==a.END_EXPR?(this._flags.last_token.type!==a.START_EXPR||!L(b,["var","let","const"]))&&this._flags.last_token.text!==":"&&(S(b,"if")&&S(b.previous,"else")?this._output.space_before_token=!0:this.print_newline()):L(b,l)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&y(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():ee==="SPACE"&&(this._output.space_before_token=!0);b.previous&&(b.previous.type===a.WORD||b.previous.type===a.RESERVED)&&(this._output.space_before_token=!0),this.print_token(b),this._flags.last_word=b.text,b.type===a.RESERVED&&(b.text==="do"?this._flags.do_block=!0:b.text==="if"?this._flags.if_block=!0:b.text==="import"?this._flags.import_block=!0:this._flags.import_block&&S(b,"from")&&(this._flags.import_block=!1))},j.prototype.handle_semicolon=function(b){this.start_of_statement(b)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(b);for(var Y=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&S(Y,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(b)},j.prototype.handle_string=function(b){b.text.startsWith("`")&&b.newlines===0&&b.whitespace_before===""&&(b.previous.text===")"||this._flags.last_token.type===a.WORD)||(this.start_of_statement(b)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(b),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(b):b.text.startsWith("`")&&this._flags.last_token.type===a.END_EXPR&&(b.previous.text==="]"||b.previous.text===")")&&b.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(b)},j.prototype.handle_equals=function(b){this.start_of_statement(b)||this.handle_whitespace_and_comments(b),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(b),this._output.space_before_token=!0},j.prototype.handle_comma=function(b){this.handle_whitespace_and_comments(b,!0),this.print_token(b),this._output.space_before_token=!0,this._flags.declaration_statement?(F(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(b)):this._flags.mode===c.ObjectLiteral||this._flags.mode===c.Statement&&this._flags.parent.mode===c.ObjectLiteral?(this._flags.mode===c.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(b)},j.prototype.handle_operator=function(b){var Y=b.text==="*"&&(L(this._flags.last_token,["function","yield"])||s(this._flags.last_token.type,[a.START_BLOCK,a.COMMA,a.END_BLOCK,a.SEMICOLON])),ee=s(b.text,["-","+"])&&(s(this._flags.last_token.type,[a.START_BLOCK,a.START_EXPR,a.EQUALS,a.OPERATOR])||s(this._flags.last_token.text,l)||this._flags.last_token.text===",");if(!this.start_of_statement(b)){var ae=!Y;this.handle_whitespace_and_comments(b,ae)}if(b.text==="*"&&this._flags.last_token.type===a.DOT){this.print_token(b);return}if(b.text==="::"){this.print_token(b);return}if(this._flags.last_token.type===a.OPERATOR&&s(this._options.operator_position,x)&&this.allow_wrap_or_preserved_newline(b),b.text===":"&&this._flags.in_case){this.print_token(b),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==a.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var ue=!0,Oe=!0,Ee=!1;if(b.text===":"?this._flags.ternary_depth===0?ue=!1:(this._flags.ternary_depth-=1,Ee=!0):b.text==="?"&&(this._flags.ternary_depth+=1),!ee&&!Y&&this._options.preserve_newlines&&s(b.text,h)){var xe=b.text===":",Ae=xe&&Ee,Re=xe&&!Ee;switch(this._options.operator_position){case T.before_newline:this._output.space_before_token=!Re,this.print_token(b),(!xe||Ae)&&this.allow_wrap_or_preserved_newline(b),this._output.space_before_token=!0;return;case T.after_newline:this._output.space_before_token=!0,!xe||Ae?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(b):this._output.space_before_token=!1,this.print_token(b),this._output.space_before_token=!0;return;case T.preserve_newline:Re||this.allow_wrap_or_preserved_newline(b),ue=!(this._output.just_added_newline()||Re),this._output.space_before_token=ue,this.print_token(b),this._output.space_before_token=!0;return}}if(Y){this.allow_wrap_or_preserved_newline(b),ue=!1;var pe=this._tokens.peek();Oe=pe&&s(pe.type,[a.WORD,a.RESERVED])}else if(b.text==="...")this.allow_wrap_or_preserved_newline(b),ue=this._flags.last_token.type===a.START_BLOCK,Oe=!1;else if(s(b.text,["--","++","!","~"])||ee){if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR)&&this.allow_wrap_or_preserved_newline(b),ue=!1,Oe=!1,b.newlines&&(b.text==="--"||b.text==="++"||b.text==="~")){var he=L(this._flags.last_token,O)&&b.newlines;he&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(he,!0)}this._flags.last_token.text===";"&&F(this._flags.mode)&&(ue=!0),this._flags.last_token.type===a.RESERVED?ue=!0:this._flags.last_token.type===a.END_EXPR?ue=!(this._flags.last_token.text==="]"&&(b.text==="--"||b.text==="++")):this._flags.last_token.type===a.OPERATOR&&(ue=s(b.text,["--","-","++","+"])&&s(this._flags.last_token.text,["--","-","++","+"]),s(b.text,["+","-"])&&s(this._flags.last_token.text,["--","++"])&&(Oe=!0)),(this._flags.mode===c.BlockStatement&&!this._flags.inline_frame||this._flags.mode===c.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ue,this.print_token(b),this._output.space_before_token=Oe},j.prototype.handle_block_comment=function(b,Y){if(this._output.raw){this._output.add_raw_token(b),b.directives&&b.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(b.directives){this.print_newline(!1,Y),this.print_token(b),b.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!u.newline.test(b.text)&&!b.newlines){this._output.space_before_token=!0,this.print_token(b),this._output.space_before_token=!0;return}else this.print_block_commment(b,Y)},j.prototype.print_block_commment=function(b,Y){var ee=v(b.text),ae,ue=!1,Oe=!1,Ee=b.whitespace_before,xe=Ee.length;if(this.print_newline(!1,Y),this.print_token_line_indentation(b),this._output.add_token(ee[0]),this.print_newline(!1,Y),ee.length>1){for(ee=ee.slice(1),ue=B(ee,"*"),Oe=R(ee,Ee),ue&&(this._flags.alignment=1),ae=0;ae=0;u--)if(this.__items[u].match(m))return!0;return!1},D.prototype.set_indent=function(m,u){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},D.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(m){this.__items.push(m);var u=m.lastIndexOf(`
`);u!==-1?this.__character_count=m.length-u:this.__character_count+=m.length},D.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function g(m,u){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),u=u||"",m.indent_level>0&&(u=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}g.prototype.get_indent_size=function(m,u){var o=this.__base_string_length;return u=u||0,m<0&&(o=0),o+=m*this.__indent_size,o+=u,o},g.prototype.get_indent_string=function(m,u){var o=this.__base_string;return u=u||0,m<0&&(m=0,o=""),u+=m*this.__indent_size,this.__ensure_cache(u),o+=this.__cache[u],o},g.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var m=this.__cache.length,u=0,o="";this.__indent_size&&m>=this.__indent_size&&(u=Math.floor(m/this.__indent_size),m-=u*this.__indent_size,o=new Array(u+1).join(this.__indent_string)),m&&(o+=new Array(m+1).join(" ")),this.__cache.push(o)};function p(m,u){this.__indent_cache=new g(m,u),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(m,u){return this.__indent_cache.get_indent_string(m,u)},p.prototype.get_indent_size=function(m,u){return this.__indent_cache.get_indent_size(m,u)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(m){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
`);return m!==`
`&&(o=o.replace(/[\n]/g,m)),o},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(m,u){return m=m||0,u=u||0,this.next_line.set_indent(m,u),this.__lines.length>1?(this.current_line.set_indent(m,u),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(m){for(var u=0;u1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(m,u){for(var o=this.__lines.length-2;o>=0;){var f=this.__lines[o];if(f.is_empty())break;if(f.item(0).indexOf(m)!==0&&f.item(-1)!==u){this.__lines.splice(o+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},i.exports.Output=p},function(i){function D(g,p,m,u){this.type=g,this.text=p,this.comments_before=null,this.newlines=m||0,this.whitespace_before=u||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}i.exports.Token=D},function(i,D){var g="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",u="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",o="(?:\\\\u[0-9a-fA-F]{4}|["+g+m+"])",f="(?:\\\\u[0-9a-fA-F]{4}|["+p+m+u+"])*";D.identifier=new RegExp(o+f,"g"),D.identifierStart=new RegExp(o),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+m+u+"])+");var l=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;D.newline=/[\n\r\u2028\u2029]/,D.lineBreak=new RegExp(`\r
|`+D.newline.source),D.allLineBreaks=new RegExp(D.lineBreak.source,"g")},function(i,D,g){var p=g(6).Options,m=["before-newline","after-newline","preserve-newline"];function u(o){p.call(this,o,"js");var f=this.raw_options.brace_style||null;f==="expand-strict"?this.raw_options.brace_style="expand":f==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var h=0;h>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),C=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";C=C.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),C="\\?\\.(?!\\d) "+C,C=C.replace(/ /g,"|");var T=new RegExp(C),x="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),c=x.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),w=new RegExp("^(?:"+c.join("|")+")$"),v,y=function(B,R){m.call(this,B,R),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var j=new l(this._input),N=new h(this._input).read_options(this._options);this.__patterns={template:N,identifier:N.starting_with(f.identifier).matching(f.identifierMatch),number:j.matching(E),punct:j.matching(T),comment:j.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:j.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:j.matching(//),include:j.starting_with(/#include/).until_after(f.lineBreak),shebang:j.starting_with(/#!/).until_after(f.lineBreak),xml:j.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:N.until(/['\\\n\r\u2028\u2029]/),double_quote:N.until(/["\\\n\r\u2028\u2029]/),template_text:N.until(/[`\\$]/),template_expression:N.until(/[`}\\]/)}};y.prototype=new m,y.prototype._is_comment=function(B){return B.type===s.COMMENT||B.type===s.BLOCK_COMMENT||B.type===s.UNKNOWN},y.prototype._is_opening=function(B){return B.type===s.START_BLOCK||B.type===s.START_EXPR},y.prototype._is_closing=function(B,R){return(B.type===s.END_BLOCK||B.type===s.END_EXPR)&&R&&(B.text==="]"&&R.text==="["||B.text===")"&&R.text==="("||B.text==="}"&&R.text==="{")},y.prototype._reset=function(){v=!1},y.prototype._get_next_token=function(B,R){var j=null;this._readWhitespace();var N=this._input.peek();return N===null?this._create_token(s.EOF,""):(j=j||this._read_non_javascript(N),j=j||this._read_string(N),j=j||this._read_word(B),j=j||this._read_singles(N),j=j||this._read_comment(N),j=j||this._read_regexp(N,B),j=j||this._read_xml(N,B),j=j||this._read_punctuation(),j=j||this._create_token(s.UNKNOWN,this._input.next()),j)},y.prototype._read_word=function(B){var R;if(R=this.__patterns.identifier.read(),R!=="")return R=R.replace(f.allLineBreaks,`
`),!(B.type===s.DOT||B.type===s.RESERVED&&(B.text==="set"||B.text==="get"))&&w.test(R)?(R==="in"||R==="of")&&(B.type===s.WORD||B.type===s.STRING)?this._create_token(s.OPERATOR,R):this._create_token(s.RESERVED,R):this._create_token(s.WORD,R);if(R=this.__patterns.number.read(),R!=="")return this._create_token(s.WORD,R)},y.prototype._read_singles=function(B){var R=null;return B==="("||B==="["?R=this._create_token(s.START_EXPR,B):B===")"||B==="]"?R=this._create_token(s.END_EXPR,B):B==="{"?R=this._create_token(s.START_BLOCK,B):B==="}"?R=this._create_token(s.END_BLOCK,B):B===";"?R=this._create_token(s.SEMICOLON,B):B==="."&&L.test(this._input.peek(1))?R=this._create_token(s.DOT,B):B===","&&(R=this._create_token(s.COMMA,B)),R&&this._input.next(),R},y.prototype._read_punctuation=function(){var B=this.__patterns.punct.read();if(B!=="")return B==="="?this._create_token(s.EQUALS,B):B==="?."?this._create_token(s.DOT,B):this._create_token(s.OPERATOR,B)},y.prototype._read_non_javascript=function(B){var R="";if(B==="#"){if(this._is_first_token()&&(R=this.__patterns.shebang.read(),R))return this._create_token(s.UNKNOWN,R.trim()+`
`);if(R=this.__patterns.include.read(),R)return this._create_token(s.UNKNOWN,R.trim()+`
`);B=this._input.next();var j="#";if(this._input.hasNext()&&this._input.testChar(S)){do B=this._input.next(),j+=B;while(this._input.hasNext()&&B!=="#"&&B!=="=");return B==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(j+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(j+="{}",this._input.next(),this._input.next())),this._create_token(s.WORD,j)}this._input.back()}else if(B==="<"&&this._is_first_token()){if(R=this.__patterns.html_comment_start.read(),R){for(;this._input.hasNext()&&!this._input.testChar(f.newline);)R+=this._input.next();return v=!0,this._create_token(s.COMMENT,R)}}else if(v&&B==="-"&&(R=this.__patterns.html_comment_end.read(),R))return v=!1,this._create_token(s.COMMENT,R);return null},y.prototype._read_comment=function(B){var R=null;if(B==="/"){var j="";if(this._input.peek(1)==="*"){j=this.__patterns.block_comment.read();var N=A.get_directives(j);N&&N.ignore==="start"&&(j+=A.readIgnored(this._input)),j=j.replace(f.allLineBreaks,`
`),R=this._create_token(s.BLOCK_COMMENT,j),R.directives=N}else this._input.peek(1)==="/"&&(j=this.__patterns.comment.read(),R=this._create_token(s.COMMENT,j))}return R},y.prototype._read_string=function(B){if(B==="`"||B==="'"||B==='"'){var R=this._input.next();return this.has_char_escapes=!1,B==="`"?R+=this._read_string_recursive("`",!0,"${"):R+=this._read_string_recursive(B),this.has_char_escapes&&this._options.unescape_strings&&(R=F(R)),this._input.peek()===B&&(R+=this._input.next()),R=R.replace(f.allLineBreaks,`
`),this._create_token(s.STRING,R)}return null},y.prototype._allow_regexp_or_xml=function(B){return B.type===s.RESERVED&&a(B.text,["return","case","throw","else","do","typeof","yield"])||B.type===s.END_EXPR&&B.text===")"&&B.opened.previous.type===s.RESERVED&&a(B.opened.previous.text,["if","while","for"])||a(B.type,[s.COMMENT,s.START_EXPR,s.START_BLOCK,s.START,s.END_BLOCK,s.OPERATOR,s.EQUALS,s.EOF,s.SEMICOLON,s.COMMA])},y.prototype._read_regexp=function(B,R){if(B==="/"&&this._allow_regexp_or_xml(R)){for(var j=this._input.next(),N=!1,b=!1;this._input.hasNext()&&(N||b||this._input.peek()!==B)&&!this._input.testChar(f.newline);)j+=this._input.peek(),N?N=!1:(N=this._input.peek()==="\\",this._input.peek()==="["?b=!0:this._input.peek()==="]"&&(b=!1)),this._input.next();return this._input.peek()===B&&(j+=this._input.next(),j+=this._input.read(f.identifier)),this._create_token(s.STRING,j)}return null},y.prototype._read_xml=function(B,R){if(this._options.e4x&&B==="<"&&this._allow_regexp_or_xml(R)){var j="",N=this.__patterns.xml.read_match();if(N){for(var b=N[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),Y=b.indexOf("{")===0,ee=0;N;){var ae=!!N[1],ue=N[2],Oe=!!N[N.length-1]||ue.slice(0,8)==="![CDATA[";if(!Oe&&(ue===b||Y&&ue.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ae?--ee:++ee),j+=N[0],ee<=0)break;N=this.__patterns.xml.read_match()}return N||(j+=this._input.match(/[\s\S]*/g)[0]),j=j.replace(f.allLineBreaks,`
`),this._create_token(s.STRING,j)}}return null};function F(B){for(var R="",j=0,N=new p(B),b=null;N.hasNext();)if(b=N.match(/([\s]|[^\\]|\\\\)+/g),b&&(R+=b[0]),N.peek()==="\\"){if(N.next(),N.peek()==="x")b=N.match(/x([0-9A-Fa-f]{2})/g);else if(N.peek()==="u")b=N.match(/u([0-9A-Fa-f]{4})/g);else{R+="\\",N.hasNext()&&(R+=N.next());continue}if(!b)return B;if(j=parseInt(b[1],16),j>126&&j<=255&&b[0].indexOf("x")===0)return B;if(j>=0&&j<32){R+="\\"+b[0];continue}else j===34||j===39||j===92?R+="\\"+String.fromCharCode(j):R+=String.fromCharCode(j)}return R}y.prototype._read_string_recursive=function(B,R,j){var N,b;B==="'"?b=this.__patterns.single_quote:B==='"'?b=this.__patterns.double_quote:B==="`"?b=this.__patterns.template_text:B==="}"&&(b=this.__patterns.template_expression);for(var Y=b.read(),ee="";this._input.hasNext();){if(ee=this._input.next(),ee===B||!R&&f.newline.test(ee)){this._input.back();break}else ee==="\\"&&this._input.hasNext()?(N=this._input.peek(),N==="x"||N==="u"?this.has_char_escapes=!0:N==="\r"&&this._input.peek(1)===`
`&&this._input.next(),ee+=this._input.next()):j&&(j==="${"&&ee==="$"&&this._input.peek()==="{"&&(ee+=this._input.next()),j===ee&&(B==="`"?ee+=this._read_string_recursive("}",R,"`"):ee+=this._read_string_recursive("`",R,"${"),this._input.hasNext()&&(ee+=this._input.next())));ee+=b.read(),Y+=ee}return Y},i.exports.Tokenizer=y,i.exports.TOKEN=s,i.exports.positionable_operators=O.slice(),i.exports.line_starters=x.slice()},function(i){var D=RegExp.prototype.hasOwnProperty("sticky");function g(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position=0&&p=0&&m=p.length&&this.__input.substring(m-p.length,m).toLowerCase()===p},i.exports.InputScanner=g},function(i,D,g){var p=g(8).InputScanner,m=g(3).Token,u=g(10).TokenStream,o=g(11).WhitespacePattern,f={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(h,a){this._input=new p(h),this._options=a||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var h,a=new m(f.START,""),s=null,A=[],E=new u;a.type!==f.EOF;){for(h=this._get_next_token(a,s);this._is_comment(h);)E.add(h),h=this._get_next_token(a,s);E.isEmpty()||(h.comments_before=E,E=new u),h.parent=s,this._is_opening(h)?(A.push(s),s=h):s&&this._is_closing(h,s)&&(h.opened=s,s.closed=h,s=A.pop(),h.parent=s),h.previous=a,a.next=h,this.__tokens.add(h),a=h}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(h,a){this._readWhitespace();var s=this._input.read(/.+/g);return s?this._create_token(f.RAW,s):this._create_token(f.EOF,"")},l.prototype._is_comment=function(h){return!1},l.prototype._is_opening=function(h){return!1},l.prototype._is_closing=function(h,a){return!1},l.prototype._create_token=function(h,a){var s=new m(h,a,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return s},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},i.exports.Tokenizer=l,i.exports.TOKEN=f},function(i){function D(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}D.prototype.restart=function(){this.__position=0},D.prototype.isEmpty=function(){return this.__tokens_length===0},D.prototype.hasNext=function(){return this.__position=0&&g/),erb:l.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:l.starting_with(/{%/).until_after(/%}/),django_value:l.starting_with(/{{/).until_after(/}}/),django_comment:l.starting_with(/{#/).until_after(/#}/),smarty:l.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:l.starting_with(/{\*/).until_after(/\*}/),smarty_literal:l.starting_with(/{literal}/).until_after(/{\/literal}/)}}u.prototype=new p,u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){this.__set_templated_pattern()},u.prototype.disable=function(o){var f=this._create();return f._disabled[o]=!0,f._update(),f},u.prototype.read_options=function(o){var f=this._create();for(var l in m)f._disabled[l]=o.templating.indexOf(l)===-1;return f._update(),f},u.prototype.exclude=function(o){var f=this._create();return f._excluded[o]=!0,f._update(),f},u.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=this._input.read(this._starting_pattern,this.__template_pattern);for(var f=this._read_template();f;)this._match_pattern?f+=this._input.read(this._match_pattern):f+=this._input.readUntil(this.__template_pattern),o+=f,f=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},u.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},u.prototype._read_template=function(){var o="",f=this._input.peek();if(f==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(o=o||this.__patterns.erb.read())}else f==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},i.exports.TemplatablePattern=u}],k={};function G(i){var D=k[i];if(D!==void 0)return D.exports;var g=k[i]={exports:{}};return U[i](g,g.exports,G),g.exports}var W=G(0);P=W})();var X=P;!(re=[],$=function(){return{js_beautify:X}}.apply(be,re),$!==void 0&&(ht.exports=$))})()},"746U":function(ht,be,Z){"use strict";Z.d(be,"f",function(){return re}),Z.d(be,"l",function(){return $}),Z.d(be,"k",function(){return P}),Z.d(be,"j",function(){return X}),Z.d(be,"g",function(){return U}),Z.d(be,"m",function(){return k}),Z.d(be,"h",function(){return G}),Z.d(be,"n",function(){return W}),Z.d(be,"c",function(){return i}),Z.d(be,"a",function(){return D}),Z.d(be,"i",function(){return g}),Z.d(be,"o",function(){return p}),Z.d(be,"e",function(){return o}),Z.d(be,"d",function(){return f}),Z.d(be,"p",function(){return l}),Z.d(be,"b",function(){return h});function re(a){return Array.isArray(a)}function $(a){return typeof a=="string"}function P(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)&&!(a instanceof RegExp)&&!(a instanceof Date)}function X(a){return typeof a=="number"&&!isNaN(a)}function U(a){return a===!0||a===!1}function k(a){return typeof a=="undefined"}function G(a){return!W(a)}function W(a){return k(a)||a===null}function i(a,s){if(!a)throw new Error(s?`Unexpected type, expected '${s}'`:"Unexpected type")}function D(a){if(W(a))throw new Error("Assertion Failed: argument is undefined or null");return a}function g(a){return typeof a=="function"}function p(a,s){const A=Math.min(a.length,s.length);for(let E=0;Efunction(){const L=Array.prototype.slice.call(arguments,0);return s(S,L)};let E={};for(const S of a)E[S]=A(S);return E}function l(a){return a===null?void 0:a}function h(a,s="Unreachable"){throw new Error(s)}},"7Cbv":function(ht,be,Z){"use strict";var re=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),$=new Uint8Array(16);function P(){if(!re)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return re($)}var X=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function U(m){return typeof m=="string"&&X.test(m)}for(var k=U,G=[],W=0;W<256;++W)G.push((W+256).toString(16).substr(1));function i(m){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=(G[m[u+0]]+G[m[u+1]]+G[m[u+2]]+G[m[u+3]]+"-"+G[m[u+4]]+G[m[u+5]]+"-"+G[m[u+6]]+G[m[u+7]]+"-"+G[m[u+8]]+G[m[u+9]]+"-"+G[m[u+10]]+G[m[u+11]]+G[m[u+12]]+G[m[u+13]]+G[m[u+14]]+G[m[u+15]]).toLowerCase();if(!k(o))throw TypeError("Stringified UUID is invalid");return o}var D=i;function g(m,u,o){m=m||{};var f=m.random||(m.rng||P)();if(f[6]=f[6]&15|64,f[8]=f[8]&63|128,u){o=o||0;for(var l=0;l<16;++l)u[o+l]=f[l];return u}return D(f)}var p=be.a=g},"7ahc":function(ht,be,Z){"use strict";Z.d(be,"a",function(){return A});var re=Z("k1fw"),$=Z("0Owb"),P=Z("+L6B"),X=Z("2/Rp"),U=Z("y8nQ"),k=Z("Vl3Y"),G=Z("tJVT"),W=Z("OaEy"),i=Z("2fM7"),D=Z("q1tI"),g=Z.n(D),p=Z("VrN/"),m=Z.n(p),u=Z("p77/"),o=Z.n(u),f=Z("c5Ni"),l=Z.n(f),h=i.a.Option,a={labelCol:{span:4},wrapperCol:{span:20}},s={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"]};be.b=function(E){var S=E.callback,L=E.onCancel,O=Object(D.useState)("python"),C=Object(G.a)(O,2),T=C[0],x=C[1];function c(v){x(s[v][1])}function w(v){S(v)}return g.a.createElement(k.a,Object($.a)({},a,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:w}),g.a.createElement(k.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},g.a.createElement(i.a,{onChange:c},Object.keys(s).map(function(v){return g.a.createElement(h,{key:v,value:v},s[v][0])}))),g.a.createElement(k.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},g.a.createElement(A,{mode:T})),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(X.a,{type:"ghost",onClick:L},"\u53D6\u6D88")))};function A(E){var S=E.value,L=E.onChange,O=E.mode,C=E.options,T=C===void 0?{}:C,x=Object(D.useRef)(),c=Object(D.useState)(),w=Object(G.a)(c,2),v=w[0],y=w[1];return Object(D.useEffect)(function(){if(v){function F(B){var R=B.getValue();L&&L(R)}return v.on("change",F),function(){v.off("change",F)}}},[v,L]),Object(D.useEffect)(function(){v&&v.setOption("mode",O)},[v,O]),Object(D.useEffect)(function(){v&&((S!==v.getValue()||S==="")&&setTimeout(function(){v.setValue(S||" ")},300))},[v,S]),Object(D.useEffect)(function(){if(x.current&&!v){var F=m.a.fromTextArea(x.current,Object(re.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},T));y(F)}},[x.current,v]),g.a.createElement("div",{className:"my-codemirror-container"},g.a.createElement("textarea",{ref:x}))}},"8EBN":function(ht,be,Z){(function(re){re(Z("VrN/"))})(function(re){"use strict";re.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&&X.substring(G+1,X.length);if(W)return re.findModeByExtension(W)},re.findModeByName=function(X){X=X.toLowerCase();for(var U=0;U=H.length?q.slice(H.length):q}).join(`
`)}var l=[],h=[""],a=new u.a.Renderer,s=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function A(){l.length=0,h=[""]}var E={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(V,_,I,H){if(_>=V.length||V[_].level<=I)return _;var q=V[_];H.push("- "+q.text+""),_++;var z=[];return _=S(V,_,q.level,z),z.length>0&&(H.push("
"),z.forEach(function(ge){H.push(ge)}),H.push("
")),H.push(" "),_=S(V,_,I,H),_}function L(){return S(l,0,0,h),h.push("
"),h.join("")}var O={heading:function(_){var I=s.exec(_);if(I)return{type:"heading",raw:I[0],depth:I[1].length,text:I[2]}},fences:function(_){var I=this.rules.block.fences.exec(_);if(I){var H=I[0],q=f(H,I[3]||""),z=I[2]?I[2].trim():I[2];if(["latex","katex","math"].indexOf(z)>=0){var ge=x(),He=q;q=ge,c[ge]={type:"block",expression:He}}return{type:"code",raw:H,lang:z,text:q}}}},C=/(?:\${2})([^\n`]+?)(?:\${2})/gi,T=0,x=function(){return"__special_katext_id_".concat(T++,"__")},c={};function w(){return c}function v(){T=0,c={}}function y(V){return V=V.replace(C,function(_,I){var H=x();return c[H]={type:"inline",expression:I},H}),V}var F=a.listitem;a.listitem=function(V){return F(y(V))};var B=a.paragraph;a.paragraph=function(V){return B(y(V))};var R=a.tablecell;a.tablecell=function(V,_){return R(y(V),_)},a.code=function(V,_,I){var H=(_||"").match(/\S*/)[0];return H?["latex","katex","math"].indexOf(H)>=0?"".concat(V,"
"):'
').concat(I?V:Object(o.escape)(V,!0),`
`):''+(I?V:Object(o.escape)(V,!0))+"
"},a.heading=function(V,_,I){var H=this.options.headerPrefix+I.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return l.push({anchor:H,level:_,text:V}),"'+V+""},u.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),u.a.use({tokenizer:O,renderer:a});var j=u.a,N=Z("SJMd"),b=Z("ulZh"),Y=Z.n(b),ee=Z("m3rI"),ae=Z("Oy/b"),ue=Z("p5ED"),Oe=Z("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Ee=function(V,_){return(Ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,H){I.__proto__=H}||function(I,H){for(var q in H)Object.prototype.hasOwnProperty.call(H,q)&&(I[q]=H[q])})(V,_)};function xe(V,_){function I(){this.constructor=V}Ee(V,_),V.prototype=_===null?Object.create(_):(I.prototype=_.prototype,new I)}function Ae(V,_,I,H){return new(I||(I=Promise))(function(q,z){function ge(gt){try{rt(H.next(gt))}catch(ze){z(ze)}}function He(gt){try{rt(H.throw(gt))}catch(ze){z(ze)}}function rt(gt){var ze;gt.done?q(gt.value):(ze=gt.value,ze instanceof I?ze:new I(function(wt){wt(ze)})).then(ge,He)}rt((H=H.apply(V,_||[])).next())})}function Re(V,_){var I,H,q,z,ge={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return z={next:He(0),throw:He(1),return:He(2)},typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function He(rt){return function(gt){return function(ze){if(I)throw new TypeError("Generator is already executing.");for(;ge;)try{if(I=1,H&&(q=2&ze[0]?H.return:ze[0]?H.throw||((q=H.return)&&q.call(H),0):H.next)&&!(q=q.call(H,ze[1])).done)return q;switch(H=0,q&&(ze=[2&ze[0],q.value]),ze[0]){case 0:case 1:q=ze;break;case 4:return ge.label++,{value:ze[1],done:!1};case 5:ge.label++,H=ze[1],ze=[0];continue;case 7:ze=ge.ops.pop(),ge.trys.pop();continue;default:if(!(q=ge.trys,(q=q.length>0&&q[q.length-1])||ze[0]!==6&&ze[0]!==2)){ge=0;continue}if(ze[0]===3&&(!q||ze[1]>q[0]&&ze[1]',"select"),this.addActionButton(H,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(H,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(H,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(H,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(H,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(H,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(H,'',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(z){var ge=document.createElement("div");ge.className=""+I.toolbarButtonStyleClass.name,ge.setAttribute("data-type-name",z.typeName),ge.innerHTML=z.icon,ge.addEventListener("click",function(){I.markerToolbarButtonClicked(ge,z)}),I.buttons.push(ge),I.markerButtons.push(ge)}),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 q=document.createElement("div");q.className=this.toolbarBlockStyleClass.name,q.style.whiteSpace="nowrap",q.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(q),this.addActionButton(q,'',"render"),this.addActionButton(q,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},V.prototype.addButtonClickListener=function(_){this.buttonClickListeners.push(_)},V.prototype.removeButtonClickListener=function(_){this.buttonClickListeners.indexOf(_)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(_),1)},V.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},V.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var _=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var I=0;I0&&this.buttonClickListeners.forEach(function(H){return H("marker",I)}),this.markerButtonOverflowBlock.style.display="none"},V.prototype.actionToolbarButtonClicked=function(_,I){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(H){return H("action",I)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},V.prototype.setActiveButton=function(_){this.resetButtonStyles(),_.className=_.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),_.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},V.prototype.setActiveMarkerButton=function(_){var I=this.markerButtons.find(function(H){return H.getAttribute("data-type-name")===_});I&&this.setActiveButton(I)},V.prototype.setCurrentMarker=function(_){var I=this;this.currentMarker=_,this.buttons.filter(function(H){return/delete|notes/.test(H.getAttribute("data-action"))}).forEach(function(H){I.currentMarker===void 0?(H.style.fillOpacity="0.4",H.style.pointerEvents="none"):(H.style.fillOpacity="1",H.style.pointerEvents="all")})},V}(),$e=function(){function V(_,I,H,q){this.panels=[],this.panelButtons=[],this.markerjsContainer=_,this.displayMode=I,this.uiStyleSettings=H,this.styles=q,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return V.prototype.addStyles=function(){var _;this.toolboxStyleClass=this.styles.addClass(new Pe("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 Pe("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var I=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Pe("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Pe("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Pe("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 Pe("toolbox-panel-row_colors",`
background-color: `+((_=this.uiStyleSettings.toolboxBackgroundColor)!==null&&_!==void 0?_:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Pe("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*I)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*I)+`px;
padding: `+I+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Pe("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Pe("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new at("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new at("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},V.prototype.show=function(_){var I;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=_,this.uiContainer.className=this.toolboxStyleClass.name+" "+((I=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&I!==void 0?I:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},V.prototype.setPanelButtons=function(_){var I,H,q=this;this.panels=_,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((I=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&I!==void 0?I:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((H=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&H!==void 0?H:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(z){var ge;z.uiStyleSettings=q.uiStyleSettings;var He=document.createElement("div");He.className=q.toolboxButtonStyleClass.name+" "+((ge=q.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ge!==void 0?ge:q.toolboxButtonStyleColorsClass.name),He.innerHTML=z.icon,He.title=z.title,He.addEventListener("click",function(){q.panelButtonClick(z)}),q.panelButtons.push(He),q.buttonRow.appendChild(He)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},V.prototype.panelButtonClick=function(_){var I=this,H=-1;if(_!==this.activePanel){H=this.panels.indexOf(_),this.panelRow.innerHTML="";var q=_.getUi();q.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(q),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=_}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){I.displayMode==="inline"?I.panelRow.style.display="none":I.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(z,ge){var He,rt;z.className=I.toolboxButtonStyleClass.name+" "+(ge===H?""+((He=I.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&He!==void 0?He:I.toolboxActiveButtonStyleColorsClass.name):""+((rt=I.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&rt!==void 0?rt:I.toolboxButtonStyleColorsClass.name))})},V}(),se=function(V,_){this.title=V,this.icon=_},_e=function(V){function _(I,H,q,z){var ge=V.call(this,I,z||'')||this;return ge.colors=[],ge.addTransparent=!1,ge.colorBoxes=[],ge.colors=H,ge.currentColor=q,ge.setCurrentColor=ge.setCurrentColor.bind(ge),ge.getColorBox=ge.getColorBox.bind(ge),ge}return xe(_,V),_.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.overflow="hidden",H.style.whiteSpace="nowrap",this.colors.forEach(function(q){var z=I.getColorBox(q);H.appendChild(z),I.colorBoxes.push(z)}),H},_.prototype.getColorBox=function(I){var H=this,q=this.uiStyleSettings.toolbarHeight/4,z=this.uiStyleSettings.toolbarHeight-q,ge=document.createElement("div");ge.style.display="inline-block",ge.style.boxSizing="content-box",ge.style.width=z-2+"px",ge.style.height=z-2+"px",ge.style.padding="1px",ge.style.marginRight="2px",ge.style.marginBottom="2px",ge.style.borderWidth="2px",ge.style.borderStyle="solid",ge.style.borderRadius=(z+2)/2+"px",ge.style.borderColor=I===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ge.addEventListener("click",function(){H.setCurrentColor(I,ge)});var He=document.createElement("div");return He.style.display="inline-block",He.style.width=z-2+"px",He.style.height=z-2+"px",He.style.backgroundColor=I,He.style.borderRadius=z/2+"px",I==="transparent"&&(He.style.fill=this.uiStyleSettings.toolboxAccentColor,He.innerHTML=``),ge.appendChild(He),ge},_.prototype.setCurrentColor=function(I,H){var q=this;this.currentColor=I,this.colorBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(I)},_}(se),Te=function(){function V(_,I,H){this._state="new",this._isSelected=!1,this._container=_,this._overlayContainer=I,this.globalSettings=H,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(V.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),V.prototype.ownsTarget=function(_){return!1},Object.defineProperty(V.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),V.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},V.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},V.prototype.pointerDown=function(_,I){},V.prototype.dblClick=function(_,I){},V.prototype.manipulate=function(_){},V.prototype.pointerUp=function(_){this.stateChanged()},V.prototype.dispose=function(){},V.prototype.addMarkerVisualToContainer=function(_){this.container.childNodes.length>0?this.container.insertBefore(_,this.container.childNodes[0]):this.container.appendChild(_)},V.prototype.getState=function(){return{typeName:V.typeName,state:this.state,notes:this.notes}},V.prototype.restoreState=function(_){this._state=_.state,this.notes=_.notes},V.prototype.scale=function(_,I){},V.prototype.colorChanged=function(_){this.onColorChanged&&this.onColorChanged(_),this.stateChanged()},V.prototype.fillColorChanged=function(_){this.onFillColorChanged&&this.onFillColorChanged(_),this.stateChanged()},V.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var _=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),_.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(_)&&this.onStateChanged(this)}},V.typeName="MarkerBase",V}(),Se=function(){function V(){this.findGripByVisual=this.findGripByVisual.bind(this)}return V.prototype.findGripByVisual=function(_){return this.topLeft.ownsTarget(_)?this.topLeft:this.topCenter.ownsTarget(_)?this.topCenter:this.topRight.ownsTarget(_)?this.topRight:this.centerLeft.ownsTarget(_)?this.centerLeft:this.centerRight.ownsTarget(_)?this.centerRight:this.bottomLeft.ownsTarget(_)?this.bottomLeft:this.bottomCenter.ownsTarget(_)?this.bottomCenter:this.bottomRight.ownsTarget(_)?this.bottomRight:void 0},V}(),Ge=function(){function V(){this.GRIP_SIZE=10,this.visual=he.createGroup(),this.visual.appendChild(he.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(he.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return V.prototype.ownsTarget=function(_){return _===this.visual||_===this.visual.childNodes[0]||_===this.visual.childNodes[1]},V}(),Ne=function(){function V(){}return V.toITransformMatrix=function(_){return{a:_.a,b:_.b,c:_.c,d:_.d,e:_.e,f:_.f}},V.toSVGMatrix=function(_,I){return _.a=I.a,_.b=I.b,_.c=I.c,_.d=I.d,_.e=I.e,_.f=I.f,_},V}(),Fe=function(V){function _(I,H,q){var z=V.call(this,I,H,q)||this;return z.left=0,z.top=0,z.width=0,z.height=0,z.defaultSize={x:50,y:20},z.offsetX=0,z.offsetY=0,z.rotationAngle=0,z.CB_DISTANCE=10,z._suppressMarkerCreateEvent=!1,z.container.transform.baseVal.appendItem(he.createTransform()),z.setupControlBox(),z}return xe(_,V),Object.defineProperty(_.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"visual",{get:function(){return this._visual},set:function(I){this._visual=I;var H=he.createTransform();this._visual.transform.baseVal.appendItem(H)},enumerable:!1,configurable:!0}),_.prototype.ownsTarget=function(I){return!!V.prototype.ownsTarget.call(this,I)||!!(this.controlGrips.findGripByVisual(I)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(I))},_.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.state==="new"&&(this.left=I.x,this.top=I.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var q=this.unrotatePoint(I);if(this.manipulationStartX=q.x,this.manipulationStartY=q.y,this.offsetX=q.x-this.left,this.offsetY=q.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(H),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(H)){this.activeGrip=this.rotatorGrip;var z=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=z.x-this.width/2,this.top=z.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ge=this.container.transform.baseVal.getItem(0);ge.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ge,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},_.prototype.pointerUp=function(I){var H=this.state;V.prototype.pointerUp.call(this,I),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(I),this._state="select",H==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},_.prototype.moveVisual=function(I){this.visual.style.transform="translate("+I.x+"px, "+I.y+"px)"},_.prototype.manipulate=function(I){var H=this.unrotatePoint(I);this.state==="creating"?this.resize(I):this.state==="move"?(this.left=this.manipulationStartLeft+(H.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(H.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(H):this.state==="rotate"&&this.rotate(I)},_.prototype.resize=function(I){var H=this.manipulationStartLeft,q=this.manipulationStartWidth,z=this.manipulationStartTop,ge=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:H=this.manipulationStartLeft+I.x-this.manipulationStartX,q=this.manipulationStartWidth+this.manipulationStartLeft-H;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:q=this.manipulationStartWidth+I.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:z=this.manipulationStartTop+I.y-this.manipulationStartY,ge=this.manipulationStartHeight+this.manipulationStartTop-z;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ge=this.manipulationStartHeight+I.y-this.manipulationStartY}q>=0?(this.left=H,this.width=q):(this.left=H+q,this.width=-q),ge>=0?(this.top=z,this.height=ge):(this.top=z+ge,this.height=-ge),this.setSize()},_.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},_.prototype.rotate=function(I){if(Math.abs(I.x-this.centerX)>.1){var H=Math.sign(I.x-this.centerX);this.rotationAngle=180*Math.atan((I.y-this.centerY)/(I.x-this.centerX))/Math.PI+90*H,this.applyRotation()}},_.prototype.applyRotation=function(){var I=this.container.transform.baseVal.getItem(0);I.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(I,0)},_.prototype.rotatePoint=function(I){if(this.rotationAngle===0)return I;var H=this.container.getCTM(),q=he.createPoint(I.x,I.y);return{x:(q=q.matrixTransform(H)).x,y:q.y}},_.prototype.unrotatePoint=function(I){if(this.rotationAngle===0)return I;var H=this.container.getCTM();H=H.inverse();var q=he.createPoint(I.x,I.y);return{x:(q=q.matrixTransform(H)).x,y:q.y}},_.prototype.select=function(){V.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},_.prototype.deselect=function(){V.prototype.deselect.call(this),this.controlBox.style.display="none"},_.prototype.setupControlBox=function(){this.controlBox=he.createGroup();var I=he.createTransform();I.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(I),this.container.appendChild(this.controlBox),this.controlRect=he.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=he.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Se,this.addControlGrips(),this.controlBox.style.display="none"},_.prototype.adjustControlBox=function(){var I=this.controlBox.transform.baseVal.getItem(0);I.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(I,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()},_.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()},_.prototype.createGrip=function(){var I=new Ge;return I.visual.transform.baseVal.appendItem(he.createTransform()),this.controlBox.appendChild(I.visual),I},_.prototype.positionGrips=function(){var I=this.controlGrips.topLeft.GRIP_SIZE,H=-I/2,q=H,z=(this.width+this.CB_DISTANCE)/2-I/2,ge=(this.height+this.CB_DISTANCE)/2-I/2,He=this.height+this.CB_DISTANCE-I/2,rt=this.width+this.CB_DISTANCE-I/2;this.positionGrip(this.controlGrips.topLeft.visual,H,q),this.positionGrip(this.controlGrips.topCenter.visual,z,q),this.positionGrip(this.controlGrips.topRight.visual,rt,q),this.positionGrip(this.controlGrips.centerLeft.visual,H,ge),this.positionGrip(this.controlGrips.centerRight.visual,rt,ge),this.positionGrip(this.controlGrips.bottomLeft.visual,H,He),this.positionGrip(this.controlGrips.bottomCenter.visual,z,He),this.positionGrip(this.controlGrips.bottomRight.visual,rt,He),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,z,q-3*this.CB_DISTANCE)},_.prototype.positionGrip=function(I,H,q){var z=I.transform.baseVal.getItem(0);z.setTranslate(H,q),I.transform.baseVal.replaceItem(z,0)},_.prototype.hideControlBox=function(){this.controlBox.style.display="none"},_.prototype.showControlBox=function(){this.controlBox.style.display=""},_.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Ne.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Ne.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},V.prototype.getState.call(this))},_.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I);var H=I;this.left=H.left,this.top=H.top,this.width=H.width,this.height=H.height,this.rotationAngle=H.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Ne.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,H.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Ne.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,H.containerTransformMatrix))},_.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H);var q=this.rotatePoint({x:this.left,y:this.top}),z=this.unrotatePoint({x:q.x*I,y:q.y*H});this.left=z.x,this.top=z.y,this.width=this.width*I,this.height=this.height*H,this.adjustControlBox()},_}(Te),Ke=function(V){function _(I,H,q){var z=V.call(this,I,H,q)||this;return z.fillColor="transparent",z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.opacity=1,z.setStrokeColor=z.setStrokeColor.bind(z),z.setFillColor=z.setFillColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.createVisual=z.createVisual.bind(z),z}return xe(_,V),_.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.visual)},_.prototype.createVisual=function(){this.visual=he.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},_.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},_.prototype.manipulate=function(I){V.prototype.manipulate.call(this,I)},_.prototype.resize=function(I){V.prototype.resize.call(this,I),this.setSize()},_.prototype.setSize=function(){V.prototype.setSize.call(this),he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},_.prototype.pointerUp=function(I){V.prototype.pointerUp.call(this,I),this.setSize()},_.prototype.setStrokeColor=function(I){this.strokeColor=I,this.visual&&he.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(I),this.stateChanged()},_.prototype.setFillColor=function(I){this.fillColor=I,this.visual&&he.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},_.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.visual&&he.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},_.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.visual&&he.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},_.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},V.prototype.getState.call(this))},_.prototype.restoreState=function(I){var H=I;this.fillColor=H.fillColor,this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.opacity=H.opacity,this.createVisual(),V.prototype.restoreState.call(this,I),this.setSize()},_.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H),this.setSize()},_.title="Rectangle marker",_}(Fe),Je=function(V){function _(I,H,q,z){var ge=V.call(this,I,z||'')||this;return ge.widths=[],ge.widthBoxes=[],ge.widths=H,ge.currentWidth=q,ge.setCurrentWidth=ge.setCurrentWidth.bind(ge),ge}return xe(_,V),_.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",this.widths.forEach(function(q){var z=document.createElement("div");z.style.display="flex",z.style.flexGrow="2",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.borderColor=q===I.currentWidth?I.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){I.setCurrentWidth(q,z)}),H.appendChild(z);var ge=document.createElement("div");ge.innerText=q.toString(),ge.style.marginRight="5px",z.appendChild(ge);var He=document.createElement("div");He.style.minHeight="20px",He.style.flexGrow="2",He.style.display="flex",He.style.alignItems="center";var rt=document.createElement("hr");rt.style.minWidth="20px",rt.style.border="0px",rt.style.borderTop=q+"px solid "+I.uiStyleSettings.toolboxColor,rt.style.flexGrow="2",He.appendChild(rt),z.appendChild(He),I.widthBoxes.push(z)}),H},_.prototype.setCurrentWidth=function(I,H){var q=this;this.currentWidth=I,this.widthBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},_}(se),Ve=function(V){function _(I,H,q,z){var ge=V.call(this,I,z||'')||this;return ge.styles=[],ge.styleBoxes=[],ge.styles=H,ge.currentStyle=q,ge.setCurrentStyle=ge.setCurrentStyle.bind(ge),ge}return xe(_,V),_.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",this.styles.forEach(function(q){var z=document.createElement("div");z.style.display="flex",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.overflow="hidden",z.style.maxWidth=100/I.styles.length-5+"%",z.style.borderColor=q===I.currentStyle?I.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){I.setCurrentStyle(q,z)}),H.appendChild(z);var ge=document.createElement("div");ge.style.minHeight="20px",ge.style.flexGrow="2",ge.style.overflow="hidden";var He=``;ge.innerHTML=He,z.appendChild(ge),I.styleBoxes.push(z)}),H},_.prototype.setCurrentStyle=function(I,H){var q=this;this.currentStyle=I,this.styleBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},_}(se),tt=function(V){function _(I,H,q){var z=V.call(this,I,H,q)||this;return z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.strokePanel=new _e("Line color",q.defaultColorSet,q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new Je("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new Ve("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return xe(_,V),Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var I=V.prototype.getState.call(this);return I.typeName=_.typeName,I},_.typeName="FrameMarker",_.title="Frame marker",_.icon='',_}(Ke),Ie=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},nt=function(V){function _(I,H,q){var z=V.call(this,I,H,q)||this;return z.x1=0,z.y1=0,z.x2=0,z.y2=0,z.defaultLength=50,z.manipulationStartX=0,z.manipulationStartY=0,z.manipulationStartX1=0,z.manipulationStartY1=0,z.manipulationStartX2=0,z.manipulationStartY2=0,z.setupControlBox(),z}return xe(_,V),_.prototype.ownsTarget=function(I){return!!V.prototype.ownsTarget.call(this,I)||!(!this.grip1.ownsTarget(I)&&!this.grip2.ownsTarget(I))},_.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.manipulationStartX=I.x,this.manipulationStartY=I.y,this.state==="new"&&(this.x1=I.x,this.y1=I.y,this.x2=I.x,this.y2=I.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(H)?this.activeGrip=this.grip1:this.grip2.ownsTarget(H)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},_.prototype.pointerUp=function(I){var H=this.state;V.prototype.pointerUp.call(this,I),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(I),this._state="select",H==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},_.prototype.adjustVisual=function(){},_.prototype.manipulate=function(I){this.state==="creating"?this.resize(I):this.state==="move"?(this.x1=this.manipulationStartX1+I.x-this.manipulationStartX,this.y1=this.manipulationStartY1+I.y-this.manipulationStartY,this.x2=this.manipulationStartX2+I.x-this.manipulationStartX,this.y2=this.manipulationStartY2+I.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(I)},_.prototype.resize=function(I){switch(this.activeGrip){case this.grip1:this.x1=I.x,this.y1=I.y;break;case this.grip2:case void 0:this.x2=I.x,this.y2=I.y}this.adjustVisual(),this.adjustControlBox()},_.prototype.select=function(){V.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},_.prototype.deselect=function(){V.prototype.deselect.call(this),this.controlBox.style.display="none"},_.prototype.setupControlBox=function(){this.controlBox=he.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},_.prototype.adjustControlBox=function(){this.positionGrips()},_.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},_.prototype.createGrip=function(){var I=new Ge;return I.visual.transform.baseVal.appendItem(he.createTransform()),this.controlBox.appendChild(I.visual),I},_.prototype.positionGrips=function(){var I=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-I/2,this.y1-I/2),this.positionGrip(this.grip2.visual,this.x2-I/2,this.y2-I/2)},_.prototype.positionGrip=function(I,H,q){var z=I.transform.baseVal.getItem(0);z.setTranslate(H,q),I.transform.baseVal.replaceItem(z,0)},_.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},V.prototype.getState.call(this))},_.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I);var H=I;this.x1=H.x1,this.y1=H.y1,this.x2=H.x2,this.y2=H.y2},_.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H),this.x1=this.x1*I,this.y1=this.y1*H,this.x2=this.x2*I,this.y2=this.y2*H,this.adjustVisual(),this.adjustControlBox()},_}(Te),st=function(V){function _(I,H,q){var z=V.call(this,I,H,q)||this;return z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.setStrokeColor=z.setStrokeColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.strokePanel=new _e("Line color",q.defaultColorSet,q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new Je("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new Ve("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return xe(_,V),_.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.selectorLine&&I!==this.visibleLine)},_.prototype.createVisual=function(){this.visual=he.createGroup(),this.selectorLine=he.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=he.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},_.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},_.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),he.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),he.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),he.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},_.prototype.setStrokeColor=function(I){this.strokeColor=I,this.adjustVisual(),this.colorChanged(I)},_.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.adjustVisual()},_.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.adjustVisual(),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var I=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},V.prototype.getState.call(this));return I.typeName=_.typeName,I},_.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I);var H=I;this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.createVisual(),this.adjustVisual()},_.typeName="LineMarker",_.title="Line marker",_.icon='',_}(nt),De=function(V){function _(I,H,q,z){var ge=V.call(this,I,z||'')||this;return ge.fonts=[],ge.fontBoxes=[],ge.fonts=H,ge.currentFont=q,ge.setCurrentFont=ge.setCurrentFont.bind(ge),ge}return xe(_,V),_.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.overflow="hidden",H.style.flexGrow="2",this.fonts.forEach(function(q){var z=document.createElement("div");z.style.display="inline-block",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.overflow="hidden",z.style.maxWidth=100/I.fonts.length-5+"%",z.style.borderColor=q===I.currentFont?I.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){I.setCurrentFont(q,z)}),H.appendChild(z);var ge=document.createElement("div");ge.style.display="flex",ge.style.minHeight="20px",ge.style.flexGrow="2",ge.style.fontFamily=q,ge.style.overflow="hidden";var He=document.createElement("div");He.style.whiteSpace="nowrap",He.style.overflow="hidden",He.style.textOverflow="ellipsis",He.innerHTML="The quick brown fox jumps over the lazy dog",ge.appendChild(He),z.appendChild(ge),I.fontBoxes.push(z)}),H},_.prototype.setCurrentFont=function(I,H){var q=this;this.currentFont=I,this.fontBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},_}(se),Me=function(V){function _(I,H,q){var z=V.call(this,I,H,q)||this;return z.color="transparent",z.padding=5,z.DEFAULT_TEXT="your text here",z.text=z.DEFAULT_TEXT,z.isMoved=!1,z.color=q.defaultColor,z.fontFamily=q.defaultFontFamily,z.defaultSize={x:100,y:30},z.setColor=z.setColor.bind(z),z.setFont=z.setFont.bind(z),z.renderText=z.renderText.bind(z),z.sizeText=z.sizeText.bind(z),z.textEditDivClicked=z.textEditDivClicked.bind(z),z.showTextEditor=z.showTextEditor.bind(z),z.setSize=z.setSize.bind(z),z.positionTextEditor=z.positionTextEditor.bind(z),z.colorPanel=new _e("Color",q.defaultColorSet,q.defaultColor),z.colorPanel.onColorChanged=z.setColor,z.fontFamilyPanel=new De("Font",q.defaultFontFamilies,q.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z}return xe(_,V),_.prototype.ownsTarget=function(I){if(V.prototype.ownsTarget.call(this,I)||I===this.visual||I===this.textElement||I===this.bgRectangle)return!0;var H=!1;return this.textElement.childNodes.forEach(function(q){q===I&&(H=!0)}),H},_.prototype.createVisual=function(){this.visual=he.createGroup(),this.bgRectangle=he.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=he.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(he.createTransform()),this.textElement.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},_.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.isMoved=!1,this.pointerDownPoint=I,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},_.prototype.renderText=function(){var I=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(H){I.textElement.appendChild(he.createTSpan(H.trim()===""?" ":H.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},_.prototype.getTextScale=function(){var I=this.textElement.getBBox(),H=1;if(I.width>0&&I.height>0){var q=(1*this.width-this.width*this.padding*2/100)/I.width,z=(1*this.height-this.height*this.padding*2/100)/I.height;H=Math.min(q,z)}return H},_.prototype.getTextPosition=function(I){var H=this.textElement.getBBox(),q=0,z=0;return H.width>0&&H.height>0&&(q=(this.width-H.width*I)/2,z=this.height/2-H.height*I/2),{x:q,y:z}},_.prototype.sizeText=function(){var I=this.textElement.getBBox(),H=this.getTextScale(),q=this.getTextPosition(H);q.y-=I.y*H,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+q.x+"px, "+q.y+"px) scale("+H+", "+H+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(q.x,q.y),this.textElement.transform.baseVal.getItem(1).setScale(H,H))},_.prototype.manipulate=function(I){V.prototype.manipulate.call(this,I),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(I.x-this.pointerDownPoint.x)>5||Math.abs(I.y-this.pointerDownPoint.y)>5)},_.prototype.resize=function(I){V.prototype.resize.call(this,I),this.isMoved=!0,this.setSize(),this.sizeText()},_.prototype.setSize=function(){V.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},_.prototype.pointerUp=function(I){var H=this.state;H==="creating"&&(this._suppressMarkerCreateEvent=!0),V.prototype.pointerUp.call(this,I),this.setSize(),(H==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},_.prototype.showTextEditor=function(){var I=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(H){H.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var H=Number.parseFloat(I.textEditor.style.fontSize);I.textEditor.clientWidth>=Number.parseInt(I.textEditor.style.maxWidth)&&H>.9;)H-=.1,I.textEditor.style.fontSize=Math.max(H,.9)+"em"}),this.textEditor.addEventListener("keyup",function(H){H.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(H){if(H.clipboardData){var q=H.clipboardData.getData("text"),z=window.getSelection();if(!z.rangeCount)return!1;z.deleteFromDocument(),z.getRangeAt(0).insertNode(document.createTextNode(q)),H.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){I.textEditDivClicked(I.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},_.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var I=this.getTextScale(),H=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),q=this.textElement.getBBox(),z={x:q.width*I,y:q.height*I};H.x-=z.x/2,H.y-=z.y/2,this.textEditor.style.top=H.y+"px",this.textEditor.style.left=H.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-H.x+"px",this.textEditor.style.fontSize=Math.max(16*I,12)+"px",this.textElement.style.display="none"}},_.prototype.textEditDivClicked=function(I){this.text=I.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},_.prototype.select=function(){V.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},_.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),V.prototype.deselect.call(this)},_.prototype.dblClick=function(I,H){V.prototype.dblClick.call(this,I,H),this.showTextEditor()},_.prototype.setColor=function(I){this.textElement&&he.setAttributes(this.textElement,[["fill",I]]),this.color=I,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(I)},_.prototype.setFont=function(I){this.textElement&&he.setAttributes(this.textElement,[["font-family",I]]),this.fontFamily=I,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},_.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},_.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var I=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},V.prototype.getState.call(this));return I.typeName=_.typeName,I},_.prototype.restoreState=function(I){var H=I;this.color=H.color,this.fontFamily=H.fontFamily,this.padding=H.padding,this.text=H.text,this.createVisual(),V.prototype.restoreState.call(this,I),this.setSize()},_.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H),this.setSize(),this.sizeText(),this.positionTextEditor()},_.typeName="TextMarker",_.title="Text marker",_.icon='',_}(Fe),ve=function(V){function _(I,H,q){var z=V.call(this,I,H,q)||this;return z.color="transparent",z.lineWidth=3,z.drawing=!1,z.pixelRatio=1,z.color=q.defaultColor,z.lineWidth=q.defaultStrokeWidth,z.pixelRatio=q.freehandPixelRatio,z.setColor=z.setColor.bind(z),z.addCanvas=z.addCanvas.bind(z),z.finishCreation=z.finishCreation.bind(z),z.setLineWidth=z.setLineWidth.bind(z),z.colorPanel=new _e("Color",q.defaultColorSet,q.defaultColor),z.colorPanel.onColorChanged=z.setColor,z.lineWidthPanel=new Je("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.lineWidthPanel.onWidthChanged=z.setLineWidth,z}return xe(_,V),_.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.drawingImage)},_.prototype.createVisual=function(){this.visual=he.createGroup(),this.drawingImage=he.createImage(),this.visual.appendChild(this.drawingImage);var I=he.createTransform();this.visual.transform.baseVal.appendItem(I),this.addMarkerVisualToContainer(this.visual)},_.prototype.pointerDown=function(I,H){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(I.x,I.y),this.drawing=!0):V.prototype.pointerDown.call(this,I,H)},_.prototype.manipulate=function(I){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(I.x,I.y),this.canvasContext.stroke()):V.prototype.manipulate.call(this,I)},_.prototype.resize=function(I){V.prototype.resize.call(this,I),he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},_.prototype.pointerUp=function(I){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):V.prototype.pointerUp.call(this,I)},_.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)},_.prototype.select=function(){this.state==="creating"&&this.finishCreation(),V.prototype.select.call(this)},_.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),V.prototype.deselect.call(this)},_.prototype.finishCreation=function(){for(var I=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),H=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],q=H[0],z=H[1],ge=H[2],He=H[3],rt=!1,gt=0;gt0&&(rt=!0,gtHe&&(He=gt),ze>ge&&(ge=ze));if(rt){this.left=q/this.pixelRatio,this.top=z/this.pixelRatio,this.width=(ge-q)/this.pixelRatio,this.height=(He-z)/this.pixelRatio;var wt=document.createElement("canvas");wt.width=ge-q,wt.height=He-z,wt.getContext("2d").putImageData(this.canvasContext.getImageData(q,z,ge-q,He-z),0,0),this.drawingImgUrl=wt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},_.prototype.setDrawingImage=function(){he.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},_.prototype.setColor=function(I){this.color=I,this.colorChanged(I)},_.prototype.setLineWidth=function(I){this.lineWidth=I},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var I=Object.assign({drawingImgUrl:this.drawingImgUrl},V.prototype.getState.call(this));return I.typeName=_.typeName,I},_.prototype.restoreState=function(I){this.createVisual(),V.prototype.restoreState.call(this,I),this.drawingImgUrl=I.drawingImgUrl,this.setDrawingImage()},_.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H),this.setDrawingImage()},_.typeName="FreehandMarker",_.title="Freehand marker",_.icon='',_}(Fe),ce=function(V){function _(I,H,q){var z=V.call(this,I,q||'')||this;return z.typeBoxes=[],z.currentType=H,z.setCurrentType=z.setCurrentType.bind(z),z}return xe(_,V),_.prototype.getUi=function(){var I=this,H=document.createElement("div");H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2";for(var q=function(He){var rt="both";switch(He){case 0:rt="both";break;case 1:rt="start";break;case 2:rt="end";break;case 3:rt="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=rt===z.currentType?z.uiStyleSettings.toolboxAccentColor:"transparent",gt.addEventListener("click",function(){I.setCurrentType(rt,gt)}),H.appendChild(gt),rt==="both"||rt==="start"){var ze=document.createElement("div");ze.style.display="flex",ze.style.alignItems="center",ze.style.minHeight="20px",ze.innerHTML=``,ze.style.marginLeft="5px",gt.appendChild(ze)}var wt=document.createElement("div");wt.style.display="flex",wt.style.alignItems="center",wt.style.minHeight="20px",wt.style.flexGrow="2";var zt=document.createElement("hr");if(zt.style.minWidth="20px",zt.style.border="0px",zt.style.borderTop="3px solid "+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee"),zt.style.flexGrow="2",wt.appendChild(zt),gt.appendChild(wt),rt==="both"||rt==="end"){var ei=document.createElement("div");ei.style.display="flex",ei.style.alignItems="center",ei.style.minHeight="20px",ei.innerHTML=``,ei.style.marginRight="5px",gt.appendChild(ei)}z.typeBoxes.push(gt)},z=this,ge=0;ge<4;ge++)q(ge);return H},_.prototype.setCurrentType=function(I,H){var q=this;this.currentType=I,this.typeBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings!==void 0?q.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},_}(se),fe=function(V){function _(I,H,q){var z=V.call(this,I,H,q)||this;return z.arrowType="end",z.arrowBaseHeight=10,z.arrowBaseWidth=10,z.getArrowPoints=z.getArrowPoints.bind(z),z.setArrowType=z.setArrowType.bind(z),z.arrowTypePanel=new ce("Arrow type","end"),z.arrowTypePanel.onArrowTypeChanged=z.setArrowType,z}return xe(_,V),_.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.arrow1&&I!==this.arrow2)},_.prototype.getArrowPoints=function(I,H){var q=this.arrowBaseWidth+2*this.strokeWidth,z=this.arrowBaseHeight+2*this.strokeWidth;return I-q/2+","+(H+z/2)+" "+I+","+(H-z/2)+" "+(I+q/2)+","+(H+z/2)},_.prototype.createTips=function(){this.arrow1=he.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=he.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.arrow2)},_.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.state==="creating"&&this.createTips()},_.prototype.adjustVisual=function(){if(V.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",he.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),he.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var I=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),H=this.arrow1.transform.baseVal.getItem(0);H.setRotate(I,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(H,0);var q=this.arrow2.transform.baseVal.getItem(0);q.setRotate(I+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(q,0)}},_.prototype.setArrowType=function(I){this.arrowType=I,this.adjustVisual(),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var I=Object.assign({arrowType:this.arrowType},V.prototype.getState.call(this));return I.typeName=_.typeName,I},_.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I);var H=I;this.arrowType=H.arrowType,this.createTips(),this.adjustVisual()},_.typeName="ArrowMarker",_.title="Arrow marker",_.icon='',_}(st),ne=function(V){function _(I,H,q){var z=V.call(this,I,H,q)||this;return z.fillColor=q.defaultFillColor,z.strokeWidth=0,z.fillPanel=new _e("Color",q.defaultColorSet,q.defaultFillColor),z.fillPanel.onColorChanged=z.setFillColor,z}return xe(_,V),Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var I=V.prototype.getState.call(this);return I.typeName=_.typeName,I},_.typeName="CoverMarker",_.title="Cover marker",_.icon='',_}(Ke),ie=function(V){function _(I,H,q,z){var ge=V.call(this,I,z||'')||this;return ge.opacities=[],ge.opacityBoxes=[],ge.opacities=H,ge.currentOpacity=q,ge.setCurrentOpacity=ge.setCurrentOpacity.bind(ge),ge}return xe(_,V),_.prototype.getUi=function(){var I=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",H.style.justifyContent="space-between",this.opacities.forEach(function(q){var z=document.createElement("div");z.style.display="flex",z.style.alignItems="center",z.style.justifyContent="center",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.borderColor=q===I.currentOpacity?I.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){I.setCurrentOpacity(q,z)}),H.appendChild(z);var ge=document.createElement("div");ge.innerText=100*q+"%",z.appendChild(ge),I.opacityBoxes.push(z)}),H},_.prototype.setCurrentOpacity=function(I,H){var q=this;this.currentOpacity=I,this.opacityBoxes.forEach(function(z){z.style.borderColor=z===H?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},_}(se),oe=function(V){function _(I,H,q){var z=V.call(this,I,H,q)||this;return z.setOpacity=z.setOpacity.bind(z),z.fillColor=q.defaultHighlightColor,z.strokeWidth=0,z.opacity=q.defaultHighlightOpacity,z.fillPanel=new _e("Color",q.defaultColorSet,z.fillColor),z.fillPanel.onColorChanged=z.setFillColor,z.opacityPanel=new ie("Opacity",q.defaultOpacitySteps,z.opacity),z.opacityPanel.onOpacityChanged=z.setOpacity,z}return xe(_,V),_.prototype.setOpacity=function(I){this.opacity=I,this.visual&&he.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var I=V.prototype.getState.call(this);return I.typeName=_.typeName,I},_.typeName="HighlightMarker",_.title="Highlight marker",_.icon='',_}(ne),le='',ye=function(V){function _(I,H,q){var z=V.call(this,I,H,q)||this;return z.bgColor="transparent",z.tipPosition={x:0,y:0},z.tipBase1Position={x:0,y:0},z.tipBase2Position={x:0,y:0},z.tipMoving=!1,z.color=q.defaultStrokeColor,z.bgColor=q.defaultFillColor,z.fontFamily=q.defaultFontFamily,z.defaultSize={x:100,y:30},z.setBgColor=z.setBgColor.bind(z),z.getTipPoints=z.getTipPoints.bind(z),z.positionTip=z.positionTip.bind(z),z.setTipPoints=z.setTipPoints.bind(z),z.colorPanel=new _e("Text color",q.defaultColorSet,z.color,''),z.colorPanel.onColorChanged=z.setColor,z.bgColorPanel=new _e("Fill color",q.defaultColorSet,z.bgColor,le),z.bgColorPanel.onColorChanged=z.setBgColor,z.fontFamilyPanel=new De("Font",q.defaultFontFamilies,q.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z.tipGrip=new Ge,z.tipGrip.visual.transform.baseVal.appendItem(he.createTransform()),z.controlBox.appendChild(z.tipGrip.visual),z}return xe(_,V),_.prototype.ownsTarget=function(I){return V.prototype.ownsTarget.call(this,I)||this.tipGrip.ownsTarget(I)||this.tip===I},_.prototype.createTip=function(){he.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=he.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},_.prototype.pointerDown=function(I,H){this.state==="new"&&V.prototype.pointerDown.call(this,I,H),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(H)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):V.prototype.pointerDown.call(this,I,H)},_.prototype.pointerUp=function(I){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,V.prototype.pointerUp.call(this,I);else{var H=this.state==="creating";V.prototype.pointerUp.call(this,I),this.setTipPoints(H),this.positionTip()}},_.prototype.manipulate=function(I){if(this.tipMoving){var H=this.unrotatePoint(I);this.tipPosition={x:H.x-this.manipulationStartLeft,y:H.y-this.manipulationStartTop},this.positionTip()}else V.prototype.manipulate.call(this,I)},_.prototype.setBgColor=function(I){this.bgRectangle&&this.tip&&(he.setAttributes(this.bgRectangle,[["fill",I]]),he.setAttributes(this.tip,[["fill",I]])),this.bgColor=I,this.fillColorChanged(I)},_.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},_.prototype.setTipPoints=function(I){I===void 0&&(I=!1);var H=Math.min(this.height/2,15),q=this.height/5;I&&(this.tipPosition={x:H+q/2,y:this.height+20});var z=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?z',_}(Me),Le=function(V){function _(I,H,q){var z=V.call(this,I,H,q)||this;return z.fillColor="transparent",z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.opacity=1,z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.fillColor=q.defaultFillColor,z.setStrokeColor=z.setStrokeColor.bind(z),z.setFillColor=z.setFillColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.setOpacity=z.setOpacity.bind(z),z.createVisual=z.createVisual.bind(z),z.strokePanel=new _e("Line color",pe(q.defaultColorSet,["transparent"]),q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.fillPanel=new _e("Fill color",pe(q.defaultColorSet,["transparent"]),z.fillColor,le),z.fillPanel.onColorChanged=z.setFillColor,z.strokeWidthPanel=new Je("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new Ve("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z.opacityPanel=new ie("Opacity",q.defaultOpacitySteps,z.opacity),z.opacityPanel.onOpacityChanged=z.setOpacity,z}return xe(_,V),_.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.visual)},_.prototype.createVisual=function(){this.visual=he.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},_.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.state==="new"&&(this.createVisual(),this.moveVisual(I),this._state="creating")},_.prototype.manipulate=function(I){V.prototype.manipulate.call(this,I)},_.prototype.resize=function(I){V.prototype.resize.call(this,I),this.setSize()},_.prototype.setSize=function(){V.prototype.setSize.call(this),he.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},_.prototype.pointerUp=function(I){V.prototype.pointerUp.call(this,I),this.setSize()},_.prototype.setStrokeColor=function(I){this.strokeColor=I,this.visual&&he.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(I),this.stateChanged()},_.prototype.setFillColor=function(I){this.fillColor=I,this.visual&&he.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(I),this.stateChanged()},_.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.visual&&he.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},_.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.visual&&he.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},_.prototype.setOpacity=function(I){this.opacity=I,this.visual&&he.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var I=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},V.prototype.getState.call(this));return I.typeName=_.typeName,I},_.prototype.restoreState=function(I){var H=I;this.fillColor=H.fillColor,this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.opacity=H.opacity,this.createVisual(),V.prototype.restoreState.call(this,I),this.setSize()},_.prototype.scale=function(I,H){V.prototype.scale.call(this,I,H),this.setSize()},_.typeName="EllipseMarker",_.title="Ellipse marker",_.icon='',_}(Fe),Ue=function(V){function _(I,H,q){return V.call(this,I,H,q)||this}return xe(_,V),Object.defineProperty(_.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),_.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.tip1&&I!==this.tip2)},_.prototype.createTips=function(){this.tip1=he.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.tip1),this.tip2=he.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.tip2)},_.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.state==="creating"&&this.createTips()},_.prototype.adjustVisual=function(){if(V.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(he.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),he.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var I=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),H=this.tip1.transform.baseVal.getItem(0);H.setRotate(I,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(H,0);var q=this.tip2.transform.baseVal.getItem(0);q.setRotate(I+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(q,0)}},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var I=V.prototype.getState.call(this);return I.typeName=_.typeName,I},_.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I),this.createTips(),this.adjustVisual()},_.typeName="MeasurementMarker",_.title="Measurement marker",_.icon='',_}(st),Ze=function(V){function _(I,H,q){var z=V.call(this,I,H,q)||this;return z.strokePanel.colors=q.defaultColorSet,z.fillColor="transparent",z}return xe(_,V),Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var I=V.prototype.getState.call(this);return I.typeName=_.typeName,I},_.typeName="EllipseFrameMarker",_.title="Ellipse frame marker",_.icon='',_}(Le),mt=function(){function V(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(V.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),V.prototype.addUndoStep=function(_){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(_)||(this.undoStack.push(_),JSON.stringify(this.lastRedoStep)!==JSON.stringify(_)&&this.redoStack.splice(0,this.redoStack.length))},V.prototype.replaceLastUndoStep=function(_){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=_)},V.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},V.prototype.undo=function(){if(this.undoStack.length>1){var _=this.undoStack.pop();return _!==void 0&&this.redoStack.push(_),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},V.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},V}(),ft=function(V){function _(I,H,q){var z=V.call(this,I,H,q)||this;return z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.curveX=0,z.curveY=0,z.manipulationStartCurveX=0,z.manipulationStartCurveY=0,z.setStrokeColor=z.setStrokeColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.positionGrips=z.positionGrips.bind(z),z.addControlGrips=z.addControlGrips.bind(z),z.adjustVisual=z.adjustVisual.bind(z),z.setupControlBox=z.setupControlBox.bind(z),z.resize=z.resize.bind(z),z.strokeColor=q.defaultColor,z.strokeWidth=q.defaultStrokeWidth,z.strokeDasharray=q.defaultStrokeDasharray,z.strokePanel=new _e("Line color",q.defaultColorSet,q.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new Je("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new Ve("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return xe(_,V),_.prototype.ownsTarget=function(I){return!(!V.prototype.ownsTarget.call(this,I)&&I!==this.visual&&I!==this.selectorCurve&&I!==this.visibleCurve&&!this.curveGrip.ownsTarget(I))},_.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},_.prototype.createVisual=function(){this.visual=he.createGroup(),this.selectorCurve=he.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=he.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},_.prototype.pointerDown=function(I,H){V.prototype.pointerDown.call(this,I,H),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=I.x,this.curveY=I.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(H)&&(this.activeGrip=this.curveGrip,this._state="resize")},_.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),he.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),he.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),he.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},_.prototype.setupControlBox=function(){V.prototype.setupControlBox.call(this),this.curveControlLine1=he.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=he.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},_.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,V.prototype.addControlGrips.call(this)},_.prototype.positionGrips=function(){V.prototype.positionGrips.call(this);var I=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-I/2,this.curveY-I/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()))},_.prototype.manipulate=function(I){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+I.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+I.y-this.manipulationStartY),V.prototype.manipulate.call(this,I)},_.prototype.resize=function(I){this.activeGrip===this.curveGrip&&(this.curveX=I.x,this.curveY=I.y),V.prototype.resize.call(this,I),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},_.prototype.setStrokeColor=function(I){this.strokeColor=I,this.adjustVisual(),this.colorChanged(I)},_.prototype.setStrokeWidth=function(I){this.strokeWidth=I,this.adjustVisual()},_.prototype.setStrokeDasharray=function(I){this.strokeDasharray=I,this.adjustVisual()},_.prototype.scale=function(I,H){this.curveX=this.curveX*I,this.curveY=this.curveY*H,V.prototype.scale.call(this,I,H)},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var I=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},V.prototype.getState.call(this));return I.typeName=_.typeName,I},_.prototype.restoreState=function(I){V.prototype.restoreState.call(this,I);var H=I;this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.curveX=H.curveX,this.curveY=H.curveY,this.createVisual(),this.adjustVisual()},_.typeName="CurveMarker",_.title="Curve marker",_.icon='',_}(nt),Ct=function(){function V(_,I){I===void 0&&(I=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=_,this.cancelable=I}return Object.defineProperty(V.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),V.prototype.preventDefault=function(){this._defaultPrevented=!0},V}(),xt=function(V){function _(I,H,q){var z=V.call(this,I,!1)||this;return z.dataUrl=H,z.state=q,z}return xe(_,V),_}(Ct),Qe=function(V){function _(I,H,q){q===void 0&&(q=!1);var z=V.call(this,I,q)||this;return z.marker=H,z}return xe(_,V),_}(Ct),Lt=function(){function V(){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 V.prototype.addEventListener=function(_,I){this[_].push(I)},V.prototype.removeEventListener=function(_,I){var H=this[_].indexOf(I);H>-1&&this[_].splice(H,1)},V}(),vt=function(){function V(_){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ie,this._isOpen=!1,this.undoRedoManager=new mt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Lt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=V.instanceCounter++,this.styles=new it(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=_,this.targetRoot=document.body,this.width=_.clientWidth,this.height=_.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(V.prototype,"ALL_MARKER_TYPES",{get:function(){return[tt,ve,fe,Me,Ze,Le,oe,ye,Ue,ne,st,ft]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[tt,ve,fe,Me,Le,oe,ye]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"BASIC_MARKER_TYPES",{get:function(){return[tt,ve,fe,Me,oe]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(_){var I=this;this._availableMarkerTypes.splice(0),_.forEach(function(H){if(typeof H=="string"){var q=I.ALL_MARKER_TYPES.find(function(z){return z.typeName===H});q!==void 0&&I._availableMarkerTypes.push(q)}else I._availableMarkerTypes.push(H)})},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(_){this._zoomLevel=_,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(V.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),V.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ke.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},V.prototype.show=function(){var _=this;this.styles.styleSheetRoot===void 0&&We.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=We.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(I){return I(new Ct(_))})},V.prototype.render=function(){return Ae(this,void 0,void 0,function(){var _;return Re(this,function(I){switch(I.label){case 0:return this.setCurrentMarker(),(_=new et).naturalSize=this.renderAtNaturalSize,_.imageType=this.renderImageType,_.imageQuality=this.renderImageQuality,_.markersOnly=this.renderMarkersOnly,_.width=this.renderWidth,_.height=this.renderHeight,[4,_.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return I.sent(),[4,_.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,I.sent()]}})})},V.prototype.close=function(_){var I=this;if(_===void 0&&(_=!1),this.isOpen){var H=!1;_||this.eventListeners.beforeclose.forEach(function(q){var z=new Ct(I,!0);q(z),z.defaultPrevented&&(H=!0)}),H||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(q){return q(new Ct(I))}),this.detachEvents(),this._isOpen=!1)}},V.prototype.addMarkersToToolbar=function(){for(var _,I=[],H=0;Hthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*_:this.editorCanvas.clientWidth,H=I',_.title="Powered by marker.js",_.style.display="grid",_.style.alignItems="center",_.style.justifyItems="center",_.style.padding="3px",_.style.width="20px",_.style.height="20px",this.logoUI.appendChild(_),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},V.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")},V.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"},V.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},V.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 _=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=_+"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 je(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(_),1),_.dispose()},V.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())},V.prototype.toolbarButtonClicked=function(_,I){if(_==="marker"&&I!==void 0)this.createNewMarker(I);else if(_==="action")switch(I){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()}},V.prototype.deleteSelectedMarker=function(){var _=this;if(this._currentMarker!==void 0){var I=!1;if(this.eventListeners.markerbeforedelete.forEach(function(q){var z=new Qe(_,_._currentMarker,!0);q(z),z.defaultPrevented&&(I=!0)}),!I){var H=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(q){return q(new Qe(_,H))})}}},V.prototype.clear=function(){var _=this,I=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ge){var He=new Qe(_,void 0,!0);ge(He),He.defaultPrevented&&(I=!0)}),!I)){this.setCurrentMarker();for(var H=function(ge){var He=q.markers[ge];q.setCurrentMarker(q.markers[ge]),q._currentMarker.dispose(),q.markerImage.removeChild(q._currentMarker.container),q.markers.splice(q.markers.indexOf(q._currentMarker),1),q.eventListeners.markerdelete.forEach(function(rt){return rt(new Qe(_,He))})},q=this,z=this.markers.length-1;z>=0;z--)H(z);this.addUndoStep()}},Object.defineProperty(V.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),V.prototype.showNotesEditor=function(){var _;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=(_=this._currentMarker.notes)!==null&&_!==void 0?_:"",this.overlayContainer.appendChild(this.notesArea))},V.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)},V.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},V.prototype.addUndoStep=function(){var _=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var I=this.getState(),H=this.undoRedoManager.getLastUndoStep();if(!H||H.width===I.width&&H.height===I.height){var q=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(I),q1&&this.panTo({x:_.clientX,y:_.clientY}))},V.prototype.onPointerUp=function(_){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(_.clientX,_.clientY)),this.isDragging=!1,this.addUndoStep()},V.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},V.prototype.onKeyUp=function(_){this._currentMarker===void 0||this.notesArea!==void 0||_.key!=="Delete"&&_.key!=="Backspace"||this.deleteSelectedMarker()},V.prototype.clientToLocalCoordinates=function(_,I){var H=this.markerImage.getBoundingClientRect();return{x:(_-H.left)/this.zoomLevel,y:(I-H.top)/this.zoomLevel}},V.prototype.onWindowResize=function(){this.positionUI()},V.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var _=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=_+"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()},V.prototype.addLicenseKey=function(_){ke.addKey(_)},V.prototype.addEventListener=function(_,I){this.eventListeners.addEventListener(_,I)},V.prototype.removeEventListener=function(_,I){this.eventListeners.removeEventListener(_,I)},V.prototype.renderState=function(_){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(_),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(V.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),V.prototype.focus=function(){var _=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(I){return I(new Ct(_))}))},V.prototype.blur=function(){var _=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(I){return I(new Ct(_))}))},V.instanceCounter=0,V}();/* **********************************
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 Ft=function(V,_){return(Ft=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,H){I.__proto__=H}||function(I,H){for(var q in H)Object.prototype.hasOwnProperty.call(H,q)&&(I[q]=H[q])})(V,_)};function Pt(V,_){if(typeof _!="function"&&_!==null)throw new TypeError("Class extends value "+String(_)+" is not a constructor or null");function I(){this.constructor=V}Ft(V,_),V.prototype=_===null?Object.create(_):(I.prototype=_.prototype,new I)}function Rt(V,_,I,H){return new(I||(I=Promise))(function(q,z){function ge(gt){try{rt(H.next(gt))}catch(ze){z(ze)}}function He(gt){try{rt(H.throw(gt))}catch(ze){z(ze)}}function rt(gt){var ze;gt.done?q(gt.value):(ze=gt.value,ze instanceof I?ze:new I(function(wt){wt(ze)})).then(ge,He)}rt((H=H.apply(V,_||[])).next())})}function pi(V,_){var I,H,q,z,ge={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return z={next:He(0),throw:He(1),return:He(2)},typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function He(rt){return function(gt){return function(ze){if(I)throw new TypeError("Generator is already executing.");for(;ge;)try{if(I=1,H&&(q=2&ze[0]?H.return:ze[0]?H.throw||((q=H.return)&&q.call(H),0):H.next)&&!(q=q.call(H,ze[1])).done)return q;switch(H=0,q&&(ze=[2&ze[0],q.value]),ze[0]){case 0:case 1:q=ze;break;case 4:return ge.label++,{value:ze[1],done:!1};case 5:ge.label++,H=ze[1],ze=[0];continue;case 7:ze=ge.ops.pop(),ge.trys.pop();continue;default:if(!(q=ge.trys,(q=q.length>0&&q[q.length-1])||ze[0]!==6&&ze[0]!==2)){ge=0;continue}if(ze[0]===3&&(!q||ze[1]>q[0]&&ze[1]0&&I>0){var H=new qt(_,I),q=H.ratio>=1?20:H.getHorizontalLength(20),z=H.ratio<1?20:H.getVerticalLength(20),ge=document.createElementNS("http://www.w3.org/2000/svg","svg");ge.setAttribute("xmlns","http://www.w3.org/2000/svg"),ge.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ge);var He=bt.createDefs();ge.appendChild(He);var rt=bt.createElement("clipPath",[["id","text-bg-clip"]]);He.appendChild(rt);var gt=bt.createPath(bt.getHollowRectanglePath((24-q)/2,(24-z)/2,q,z,(24-q)/2+2,(24-z)/2+2,q-4,z-4));ge.appendChild(gt);var ze=bt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ze.appendChild(bt.createTSpan(_+":"+I)),ge.appendChild(ze);var wt=ze.getBBox();bt.setAttributes(ze,[["x",((24-wt.width)/2).toString()],["y",((24-wt.height)/2-wt.y).toString()]]);var zt=bt.createPath(bt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(wt.width))/2,(24-Math.ceil(wt.height))/2,Math.ceil(wt.width),Math.ceil(wt.height)));return rt.appendChild(zt),bt.setAttributes(gt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ge),ge.outerHTML}return''},V}(),Mt=function(V){function _(I,H,q){var z=V.call(this,I,H)||this;return z.isDropdownOpen=!1,z.onClick=z.dropdownButtonClicked,z.dropdownButtons=q,z}return Pt(_,V),_.prototype.setupDropdown=function(){var I=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(H){H.className=I.className,H.colorsClassName=I.colorsClassName,I.dropdownBlock.appendChild(H.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},_.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},_.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},_.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},_.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},_.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},_}(dt),Dt=function(){function V(_,I){this.GRIP_SIZE=10,this.color=_,this.fillColor=I,this.visual=bt.createGroup(),this.visual.appendChild(bt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(bt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return V.prototype.ownsTarget=function(_){return _===this.visual||_===this.visual.childNodes[0]||_===this.visual.childNodes[1]},V.prototype.setCenter=function(_,I){this.visual.childNodes.forEach(function(H){return bt.setAttributes(H,[["cx",_.toString()],["cy",I.toString()]])})},V}(),Ut=function(){function V(_,I,H,q){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=_,this.canvasHeight=I,this.margin=H,this.container=q,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(V.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(_){this._aspectRatio=_,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(_){this._isGridVisible=_,this.gridContainer&&bt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(_){this._zoomFactor=_,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),V.prototype.open=function(){var _=this;this.cropShadeElement=bt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=bt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var I=0;Ithis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-I.height/2),bt.setAttributes(this.cropRectElement,[["x",I.x.toString()],["y",I.y.toString()],["width",I.width.toString()],["height",I.height.toString()]]);var H=I.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(z,ge){var He=I.y+H*(ge+1);bt.setAttributes(z,[["x1",""+I.x],["y1",""+He],["x2",""+(I.x+I.width)],["y2",""+He]])});var q=I.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(z,ge){var He=I.x+q*(ge+1);bt.setAttributes(z,[["x1",""+He],["y1",""+I.y],["x2",""+He],["y2",""+(I.y+I.height)]])}),bt.setAttributes(this.cropShadeElement,[["d",bt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,I.x,I.y,I.width,I.height)]]),this.topLeftGrip.setCenter(I.x,I.y),this.topRightGrip.setCenter(I.x+I.width,I.y),this.bottomLeftGrip.setCenter(I.x,I.y+I.height),this.bottomRightGrip.setCenter(I.x+I.width,I.y+I.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},V.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)},V.prototype.clientToLocalCoordinates=function(_,I){var H=this.container.getBoundingClientRect();return{x:_-H.left+this.margin,y:I-H.top+this.margin}},V.prototype.onPointerDown=function(_){this.container.setPointerCapture(_.pointerId),this.previousPoint=this.clientToLocalCoordinates(_.clientX,_.clientY),this.cropRectElement===_.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(_.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(_.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(_.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(_.target)&&(this.activeGrip=this.bottomRightGrip)},V.prototype.onPointerMove=function(_){if(this.isMoving)this.move(this.clientToLocalCoordinates(_.clientX,_.clientY));else if(this.activeGrip){var I=this.clientToLocalCoordinates(_.clientX,_.clientY);this.resize(I)}_.preventDefault()},V.prototype.onPointerUp=function(_){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(_.pointerId)},V.prototype.move=function(_){var I=_.x-this.previousPoint.x,H=_.y-this.previousPoint.y;this.zoomFactor!==1&&(I=-I/this.zoomFactor,H=-H/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+I),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+H),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=_},V.prototype.resize=function(_){var I=Object.assign({},this.cropRect),H=_.x-this.previousPoint.x,q=_.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:I.x+Hthis.canvasWidth*this.zoomFactor&&(H=this.canvasWidth*this.zoomFactor-I.width),I.width+=H}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(I.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(H),I.height=this.aspectRatio.getVerticalLength(I.width)):(I.y+=q,I.height=this.cropRect.y+this.cropRect.height-I.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?I.height=this.aspectRatio.getVerticalLength(I.width):I.height+=q}I.width<10&&(I.x=this.cropRect.x,I.width=10),I.height<10&&(I.y=this.cropRect.y,I.height=10),this.previousPoint=_,I.x>=this.margin&&I.y>=this.margin&&I.x-this.margin+I.width<=this.canvasWidth&&I.y-this.margin+I.height<=this.canvasHeight&&(this.cropRect=I,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},V.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var _=this.cropRect.x+this.cropRect.width/2,I=this.cropRect.y+this.cropRect.height/2,H=this.aspectRatio.getHorizontalLength(this.cropRect.height),q=this.aspectRatio.getVerticalLength(this.cropRect.width);H/this.canvasWidththis.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=_-this.cropRect.width/2,this.cropRect.y=I-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)}},V.prototype.getRescaledRect=function(_,I,H,q,z,ge){var He=H/_,rt=q/I;return{x:(z.x-ge)*He+ge,y:(z.y-ge)*rt+ge,width:z.width*He,height:z.height*rt}},V.prototype.scaleCanvas=function(_,I){var H=this.getRescaledRect(this.canvasWidth,this.canvasHeight,_,I,this.cropRect,this.margin);this.canvasWidth=_,this.canvasHeight=I,this.onCropChange&&this.onCropChange(H),this.setCropRectangle(H)},V}(),hi=function(){function V(_){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=_,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(V.prototype,"angle",{get:function(){return this._angle},set:function(_){this._angle=_,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),V.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},V.prototype.onPointerDown=function(_){this.controlContainer.setPointerCapture(_.pointerId),this.isDragging=!0,this.previousPoint={x:_.clientX,y:_.clientY}},V.prototype.onPointerMove=function(_){this.isDragging&&(this.onAngleChange&&this.onAngleChange((_.clientX-this.previousPoint.x)/5),this.previousPoint.x=_.clientX)},V.prototype.onPointerUp=function(_){this.isDragging&&this.onAngleChange&&this.onAngleChange((_.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(_.pointerId)},V.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var _=this.angleLabelText.getBBox();bt.setAttributes(this.angleLabelElement,[["x",((this.width-_.width)/2).toString()],["y",(this.height/2).toString()]])}},V.prototype.positionScaleShape=function(){if(this.scaleShape){var _=this.scaleShape.transform.baseVal.getItem(0);_.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(_,0)}},V.prototype.getVisual=function(){var _=document.createElementNS("http://www.w3.org/2000/svg","svg");_.setAttribute("xmlns","http://www.w3.org/2000/svg"),_.setAttribute("width",this.width+"px"),_.setAttribute("height",this.height+"px"),_.setAttribute("viewBox","0 0 "+this.width+" "+this.height),_.style.flexShrink="0",document.body.appendChild(_);for(var I="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,H=1;H<=this.width/5+10;H++){var q=H%5==0?this.height/3:this.height/6;I+="h4v"+-q+"h1v"+q}I+="v1H0Z",this.scaleShape=bt.createPath(I);var z=bt.createTransform();this.scaleShape.transform.baseVal.appendItem(z),_.appendChild(this.scaleShape),this.angleLabelElement=bt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=bt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ge=bt.createTSpan("");return ge.innerHTML="°",this.angleLabelElement.appendChild(ge),_.appendChild(this.angleLabelElement),document.body.removeChild(_),_},V}(),Yi=function(){function V(){this.naturalSize=!1,this.imageType="image/png"}return V.prototype.rasterize=function(_,I,H,q,z,ge,He){var rt=this;return new Promise(function(gt){var ze=document.createElement("canvas");ze.width=_.width.baseVal.value-2*q,ze.height=_.height.baseVal.value-2*q;var wt=1,zt=1;rt.naturalSize===!0?(wt=I.naturalWidth/(_.width.baseVal.value-2*q)/ge,zt=I.naturalHeight/(_.height.baseVal.value-2*q)/He,ze.width=I.naturalWidth/ge,ze.height=I.naturalHeight/He):rt.width!==void 0&&rt.height!==void 0&&(wt=rt.width/H.width,zt=rt.height/H.height,ze.width*=wt,ze.height*=zt);var ei=ze.getContext("2d");ei.translate(ze.width/2,ze.height/2),ei.rotate(z*Math.PI/180),ei.scale(ge,He),ei.translate(-ze.width/2,-ze.height/2),ei.drawImage(I,0,0,ze.width,ze.height);var Hi=document.createElement("canvas");Hi.width=H.width*wt,Hi.height=H.height*zt,Hi.getContext("2d").putImageData(ei.getImageData((H.x-q)*wt,(H.y-q)*zt,H.width*wt,H.height*zt),0,0),gt(Hi.toDataURL(rt.imageType,rt.imageQuality))})},V}(),Ye=function(){function V(_){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=V.instanceCounter++,this.styles=new ti(this.instanceNo),this.target=_,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(V.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(_){this._zoomToCropEnabled=_,_?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(_){this._isGridVisible=_,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"gridLines",{get:function(){return this._gridLines},set:function(_){this._gridLines=_,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(_){this._rotationAngle=_,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"aspectRatio",{get:function(){var _;return(_=this._aspectRatio)!==null&&_!==void 0?_:this.aspectRatios[0]},set:function(_){this._aspectRatio=_},enumerable:!1,configurable:!0}),V.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},V.prototype.show=function(){this.showUI(),this.open()},V.prototype.close=function(_){_===void 0&&(_=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),_||this.closeEventListeners.forEach(function(I){return I()}),this._isOpen=!1)},V.prototype.addRenderEventListener=function(_){this.renderEventListeners.push(_)},V.prototype.removeRenderEventListener=function(_){this.renderEventListeners.indexOf(_)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(_),1)},V.prototype.addCloseEventListener=function(_){this.closeEventListeners.push(_)},V.prototype.removeCloseEventListener=function(_){this.closeEventListeners.indexOf(_)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(_),1)},V.prototype.setupResizeObserver=function(){var _=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){_.resize(_.target.clientWidth,_.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))},V.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var _=1*this.target.clientWidth/this.target.clientHeight,I=this.contentDiv.clientWidth/_>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*_:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,H=I+2*this.CANVAS_MARGIN_+this.CANVAS_MARGIN?this.target.offsetTop-(_+this.CANVAS_MARGIN):0;this.coverDiv.style.top=I+"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},V.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},V.prototype.addTopToolbar=function(){var _=this;this.topToolbar=new Wt,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 I=new ui;I.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(I);var H=[];this.aspectRatios.forEach(function(zt){var ei=new dt(Ot.getIcon(zt.horizontal,zt.vertical),zt.horizontal===0&&zt.vertical===0?"FREE":zt.horizontal+":"+zt.vertical);ei.onClick=function(){return _.ratioButtonClicked(zt)},H.push(ei)}),this.aspectRatioButton=new Mt(Ot.getIcon(0,0),"Aspect ratio",H),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,I.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var q=new dt('',"Toggle grid");q.isActive=this.isGridVisible,q.onClick=function(){_.isGridVisible=!_.isGridVisible,q.isActive=_.isGridVisible},I.addButton(q);var z=new dt('',"Zoom to selection");if(z.isActive=this.zoomToCropEnabled,z.onClick=function(){_.zoomToCropEnabled=!_.zoomToCropEnabled,z.isActive=_.zoomToCropEnabled},I.addButton(z),!ai.isLicensed){var ge=new ut;this.topToolbar.addElementBlock(ge);var He=document.createElement("div");He.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var rt=document.createElement("a");rt.style.color="currentColor",rt.href="https://markerjs.com/products/cropro",rt.target="_blank",rt.innerHTML='',He.appendChild(rt),ge.addElement(He)}var gt=new ui;gt.minWidth=3*this.toolbarHeight+"px",gt.contentAlign="end",this.topToolbar.addButtonBlock(gt);var ze=new dt('',"OK");ze.onClick=this.startRenderAndClose,gt.addButton(ze),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ze.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var wt=new dt('',"Close");wt.onClick=this.close,gt.addButton(wt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(wt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},V.prototype.addBottomToolbar=function(){var _=this;this.bottomToolbar=new Wt,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 I=new ui;I.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(I);var H=new dt('',"Rotate left");H.onClick=this.rotateLeftButtonClicked,I.addButton(H);var q=new dt('',"Rotate right");q.onClick=this.rotateRightButtonClicked,I.addButton(q);var z=new ut;z.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(z),this.straightener=new hi("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){_.rotateBy(gt),_.straightener.angle=_.rotationAngle},z.addElement(this.straightener.getUI());var ge=new ui;ge.minWidth=2*this.toolbarHeight+"px",ge.contentAlign="end",this.bottomToolbar.addButtonBlock(ge);var He=new dt('',"Flip horizontal");He.onClick=this.flipHorizontallyButtonClicked,ge.addButton(He);var rt=new dt('',"Flip vertical");rt.onClick=this.flipVerticallyButtonClicked,ge.addButton(rt)},V.prototype.ratioButtonClicked=function(_){this.aspectRatio=_,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},V.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Ot.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},V.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new qt(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},V.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},V.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},V.prototype.restoreState=function(_){if(_){var I=this.cropLayer.getRescaledRect(_.width,_.height,this.imageWidth,this.imageHeight,_.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(I),this.cropRectChanged(I),this.flippedHorizontally=_.flippedHorizontally,this.flippedVertically=_.flippedVertically,this.applyFlip(),this.rotationAngle=_.rotationAngle,this.applyRotation()}},V.prototype.clientToLocalCoordinates=function(_,I){var H=this.cropImage.getBoundingClientRect();return{x:_-H.left,y:I-H.top}},V.prototype.onWindowResize=function(){this.positionUI()},V.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var _=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=_+"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()},V.prototype.rotateLeftButtonClicked=function(){var _=this.rotationAngle-90;this.rotationAngle%90!=0&&(_+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(_)},V.prototype.rotateRightButtonClicked=function(){var _=this.rotationAngle+90;this.rotationAngle%90!=0&&(_-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(_)},V.prototype.rotateTo=function(_){_=(_=_>180?_-360:_)<=-180?_+360:_,this.rotationAngle=_,this.applyRotation()},V.prototype.rotateBy=function(_){this.rotateTo((this.rotationAngle+_)%360)},V.prototype.applyRotation=function(){var _=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var I=this.editingTargetRotationContainer.transform.baseVal.getItem(0);I.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(I,0);var H=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/H.width,this.imageHeight/H.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=_},V.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},V.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},V.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},V.prototype.startRenderAndClose=function(){return Rt(this,void 0,void 0,function(){var _,I;return pi(this,function(H){switch(H.label){case 0:return[4,this.render()];case 1:return _=H.sent(),I=this.getState(),this.renderEventListeners.forEach(function(q){return q(_,I)}),this.close(!0),[2]}})})},V.prototype.render=function(){return Rt(this,void 0,void 0,function(){var _;return pi(this,function(I){switch(I.label){case 0:return(_=new Yi).naturalSize=this.renderAtNaturalSize,_.imageType=this.renderImageType,_.imageQuality=this.renderImageQuality,_.width=this.renderWidth,_.height=this.renderHeight,this.unzoomFromCrop(),bt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,_.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 I.sent(),[4,_.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,I.sent()]}})})},V.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Tt("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 Tt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Tt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var _=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Tt("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*_)+`px;
height: `+(this.toolbarHeight-2*_)+`px;
padding: `+_+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Tt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Tt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new _t("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new _t("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Tt("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 Tt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Tt("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 Tt("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*_)+`px;
padding: `+_+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Tt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},V.instanceCounter=0,V}(),It=Z("8hTe"),mn=Z.n(It),gn=/]*>/g;function vn(V){var _=document.createElement("div");return _.innerHTML=V,_.childNodes.length===0?"":_.childNodes[0].nodeValue}var yn=be.a=function(V){var _=V.value,I=_===void 0?"":_,H=V.edit,q=H===void 0?!1:H,z=V.className,ge=V.showTextOnly,He=V.showLines,rt=V.replaces,gt=V.zoomImg,ze=V.hasMask,wt=V.style,zt=wt===void 0?{}:wt,ei=V.stylesPrev,Hi=ei===void 0?{}:ei,Ci=String(I),Ai=Object(D.useRef)(),Zi=Object(D.useRef)(),Dn=Object(D.useState)(""),vi=Object(G.a)(Dn,2),zi=vi[0],un=vi[1],hn=Object(D.useState)("office"),Wi=Object(G.a)(hn,2),kn=Wi[0],bn=Wi[1],zn=function(){var Vt=new Ye(Zi.current);Vt.displayMode="popup",Vt.addRenderEventListener(function(){var Ti=Object(k.a)(i.a.mark(function jt(di){var $t;return i.a.wrap(function(yi){for(;;)switch(yi.prev=yi.next){case 0:return Ai.current.style.display="none",yi.next=3,Object(Oe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:di}});case 3:$t=yi.sent,$t!=null&&$t.id&&rt(Zi.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat($t==null?void 0:$t.id,"?type=").concat($t.content_type));case 5:case"end":return yi.stop()}},jt)}));return function(jt){return Ti.apply(this,arguments)}}()),Vt.show()},Vn=function(){var Vt=new vt(Zi.current);Vt.settings.displayMode="popup",Vt.addEventListener("render",function(){var Ti=Object(k.a)(i.a.mark(function jt(di){var $t;return i.a.wrap(function(yi){for(;;)switch(yi.prev=yi.next){case 0:if(Ai.current.style.display="none",!Zi.current){yi.next=6;break}return yi.next=4,Object(Oe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:di.dataUrl}});case 4:$t=yi.sent,$t!=null&&$t.id&&rt(Zi.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat($t==null?void 0:$t.id,"?type=").concat($t.content_type));case 6:case"end":return yi.stop()}},jt)}));return function(jt){return Ti.apply(this,arguments)}}()),Vt.show(),window.markerArea=Vt},Qi=Object(D.useMemo)(function(){Ai.current&&(Ai.current.style.zIndex=-1);try{var oi=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Vt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Ti=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ci=Ci.replace(oi,"("+ee.a.API_SERVER+"/api/attachments/").replace(Vt,'"'+ee.a.API_SERVER+"/api/attachments/").replace(Ti,'"'+ee.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(rn){}var jt=j(Ci),di=w();if(Ci.match(/\[TOC\]/)&&(jt=jt.replace("[TOC]
",L()),A()),jt=jt.replace(/(__special_katext_id_\d+__)/g,function(rn,yi){var Ii=di[yi],Xn=Ii.type,xn=Ii.expression;return Object(ae.renderToString)(vn(xn)||"",{displayMode:Xn==="block",throwOnError:!1,output:"html"})}),jt=jt.replace(/▁/g,"\u2581\u2581\u2581"),v(),ge){var $t=document.createElement("div");return $t.innerHTML=jt,$t.innerText}return setTimeout(function(){return dr()},500),jt},[Ci]),$i=Object(D.useRef)();E.WebkitLineClamp=He,He&&(zt=Object(U.a)(Object(U.a)({},zt),E));function _n(oi){var Vt=oi.target;if(Vt.tagName.toUpperCase()==="IMG"){if(gt){var Ti=Vt.getAttribute("src");un(Ti),bn("image")}}else if(Vt.tagName.toUpperCase()==="A"){var jt=Vt.getAttribute("href");if(jt.indexOf("office")>-1)oi.preventDefault(),un(jt),bn("office");else if(jt.indexOf("application/pdf")>-1)oi.preventDefault(),un(jt),bn("pdf");else if(jt.indexOf("text/html")>-1)oi.preventDefault(),un(jt),bn("html");else if(jt.startsWith("#")){oi.preventDefault();var di=document.getElementById(jt.replace("#",""));di&&di.scrollIntoView(!0)}}}var dr=function(){var Vt,Ti=(Vt=$i.current)===null||Vt===void 0?void 0:Vt.querySelectorAll("video");Ti==null||Ti.forEach(function(jt){if(jt.oncontextmenu=function(){return!1},jt.src.indexOf(".m3u8")>-1&&!jt.canPlayType("application/vnd.apple.mpegurl")){if(Y.a.isSupported()){var di=new Y.a;di.loadSource(jt.src),di.attachMedia(jt)}}})};Object(D.useEffect)(function(){if($i.current&&Qi&&(Qi.match(gn)&&window.PR.prettyPrint()),$i.current)return $i.current.addEventListener("click",_n),function(){$i.current.removeEventListener("click",_n),v(),A()}},[Qi,$i.current,_n]);var En=function(Vt){if(!q)return;Vt.target.nodeName==="IMG"?(Ai.current.style.zIndex=1,Ai.current.style.display="flex",Ai.current.style.width=Vt.target.clientWidth+"px",Ai.current.style.height=Vt.target.clientHeight+"px",Ai.current.style.top=Vt.target.offsetTop+"px",Ai.current.style.left=Vt.target.offsetLeft+"px",Zi.current.src=Vt.target.getAttribute("src")):Ai.current.style.display="none"};return g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:$i,style:Object(U.a)({},zt),className:"".concat(z||""," markdown-body ").concat(mn.a.mdBody),onMouseOver:En,dangerouslySetInnerHTML:{__html:Qi}}),g.a.createElement("div",{ref:Ai,className:mn.a.button},g.a.createElement($.a,null,g.a.createElement(X.a,{onClick:function(){return zn()}},"\u88C1\u526A"),g.a.createElement(X.a,{onClick:function(){return Vn()}},"\u7F16\u8F91"))),g.a.createElement("img",{ref:Zi,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),g.a.createElement(ue.a,{close:!0,data:zi,type:zi!=null&&zi.length?kn:"",style:Object(U.a)({},Hi),onClose:function(){return un("")}}))}},"9VGf":function(ht,be,Z){"use strict";Z.d(be,"a",function(){return P});var re=Z("q1tI"),$=Z.n(re);function P(X,U){var k=Object(re.useRef)();Object(re.useEffect)(function(){k.current=X}),Object(re.useEffect)(function(){function G(){k.current()}if(U!==null){var W=setInterval(G,U);return function(){return clearInterval(W)}}},[U])}},BU3w:function(ht,be,Z){"use strict";Z.d(be,"a",function(){return k});var re=Z("MNnm"),$="rc-util-key";function P(G){if(G.attachTo)return G.attachTo;var W=document.querySelector("head");return W||document.body}function X(G){var W,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(re.a)())return null;var D=document.createElement("style");if((W=i.csp)===null||W===void 0?void 0:W.nonce){var g;D.nonce=(g=i.csp)===null||g===void 0?void 0:g.nonce}D.innerHTML=G;var p=P(i),m=p.firstChild;return i.prepend&&p.prepend?p.prepend(D):i.prepend&&m?p.insertBefore(D,m):p.appendChild(D),D}var U=new Map;function k(G,W){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=P(i);if(!U.has(D)){var g=X("",i),p=g.parentNode;U.set(D,p),p.removeChild(g)}var m=Array.from(U.get(D).children).find(function(h){return h.tagName==="STYLE"&&h[$]===W});if(m){var u,o;if(((u=i.csp)===null||u===void 0?void 0:u.nonce)&&m.nonce!==((o=i.csp)===null||o===void 0?void 0:o.nonce)){var f;m.nonce=(f=i.csp)===null||f===void 0?void 0:f.nonce}return m.innerHTML!==G&&(m.innerHTML=G),m}var l=X(G,i);return l[$]=W,l}},Bd2K:function(ht,be,Z){(function(re){re(Z("VrN/"),Z("osHv"))})(function(re){re.defineOption("autoCloseTags",!1,function(i,D,g){if(g!=re.Init&&g&&i.removeKeyMap("autoCloseTags"),!D)return;var p={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(p["'/'"]=function(m){return k(m)}),(typeof D!="object"||D.whenOpening!==!1)&&(p["'>'"]=function(m){return X(m)}),i.addKeyMap(p)});var $=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function X(i){if(i.getOption("disableInput"))return re.Pass;for(var D=i.listSelections(),g=[],p=i.getOption("autoCloseTags"),m=0;mu.ch&&(a=a.slice(0,a.length-o.end+u.ch));var S=a.toLowerCase();if(!a||o.type=="string"&&(o.end!=u.ch||!/[\"\']/.test(o.string.charAt(o.string.length-1))||o.string.length==1)||o.type=="tag"&&h.close||o.string.indexOf("/")==u.ch-o.start-1||A&&G(A,S)>-1||W(i,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(l)||[],a,u,!0))return re.Pass;var L=typeof p=="object"&&p.emptyTags;if(L&&G(L,a)>-1){g[m]={text:"/>",newPos:re.Pos(u.line,u.ch+2)};continue}var O=E&&G(E,S)>-1;g[m]={indent:O,text:">"+(O?`
`:"")+""+a+">",newPos:O?re.Pos(u.line+1,0):re.Pos(u.line,u.ch+1)}}for(var C=typeof p=="object"&&p.dontIndentOnAutoClose,m=D.length-1;m>=0;m--){var T=g[m];i.replaceRange(T.text,D[m].head,D[m].anchor,"+insert");var x=i.listSelections().slice(0);x[m]={head:T.newPos,anchor:T.newPos},i.setSelections(x),!C&&T.indent&&(i.indentLine(T.newPos.line,null,!0),i.indentLine(T.newPos.line+1,null,!0))}}function U(i,D){for(var g=i.listSelections(),p=[],m=D?"/":"",u=i.getOption("autoCloseTags"),o=typeof u=="object"&&u.dontIndentOnSlash,f=0;f"&&(A+=">"),p[f]=A}if(i.replaceSelections(p),g=i.listSelections(),!o)for(var f=0;f=0&&D[l]==g;l--)++f;p=o.to;for(var l=1;l0){for(var D=0;D1&&arguments[1]!==void 0?arguments[1]:"",D=[],g=0;gk,re.serviceIds.set(k,G),G}function U(k){return function(G,W,i){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");P(k,G,i,!0)}}},DlQD:function(ht,be,Z){(function(re,$){ht.exports=$()})(this,function(){"use strict";function re(ve,ce){for(var fe=0;feve.length)&&(ce=ve.length);for(var fe=0,ne=new Array(ce);fe=ve.length?{done:!0}:{done:!1,value:ve[ne++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return fe=ve[Symbol.iterator](),fe.next.bind(fe)}function k(ve,ce){return ce={exports:{}},ve(ce,ce.exports),ce.exports}var G=k(function(ve){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 fe(ne){ve.exports.defaults=ne}ve.exports={defaults:ce(),getDefaults:ce,changeDefaults:fe}}),W=G.defaults,i=G.getDefaults,D=G.changeDefaults,g=/[&<>"']/,p=/[&<>"']/g,m=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,o={"&":"&","<":"<",">":">",'"':""","'":"'"},f=function(ce){return o[ce]};function l(ve,ce){if(ce){if(g.test(ve))return ve.replace(p,f)}else if(m.test(ve))return ve.replace(u,f);return ve}var h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function a(ve){return ve.replace(h,function(ce,fe){return fe=fe.toLowerCase(),fe==="colon"?":":fe.charAt(0)==="#"?fe.charAt(1)==="x"?String.fromCharCode(parseInt(fe.substring(2),16)):String.fromCharCode(+fe.substring(1)):""})}var s=/(^|[^\[])\^/g;function A(ve,ce){ve=ve.source||ve,ce=ce||"";var fe={replace:function(ie,oe){return oe=oe.source||oe,oe=oe.replace(s,"$1"),ve=ve.replace(ie,oe),fe},getRegex:function(){return new RegExp(ve,ce)}};return fe}var E=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(ve,ce,fe){if(ve){var ne;try{ne=decodeURIComponent(a(fe)).replace(E,"").toLowerCase()}catch(ie){return null}if(ne.indexOf("javascript:")===0||ne.indexOf("vbscript:")===0||ne.indexOf("data:")===0)return null}ce&&!S.test(fe)&&(fe=c(ce,fe));try{fe=encodeURI(fe).replace(/%25/g,"%")}catch(ie){return null}return fe}var O={},C=/^[^:]+:\/*[^/]*$/,T=/^([^:]+:)[\s\S]*$/,x=/^([^:]+:\/*[^/]*)[\s\S]*$/;function c(ve,ce){O[" "+ve]||(C.test(ve)?O[" "+ve]=ve+"/":O[" "+ve]=F(ve,"/",!0)),ve=O[" "+ve];var fe=ve.indexOf(":")===-1;return ce.substring(0,2)==="//"?fe?ce:ve.replace(T,"$1")+ce:ce.charAt(0)==="/"?fe?ce:ve.replace(x,"$1")+ce:ve+ce}var w={exec:function(){}};function v(ve){for(var ce=1,fe,ne;ce=0&&ye[Ue]==="\\";)Le=!Le;return Le?"|":" |"}),ne=fe.split(/ \|/),ie=0;if(ne.length>ce)ne.splice(ce);else for(;ne.length=ne.length?ie.slice(ne.length):ie}).join(`
`)}var Ee=function(){function ve(fe){this.options=fe||N}var ce=ve.prototype;return ce.space=function(ne){var ie=this.rules.block.newline.exec(ne);if(ie)return ie[0].length>1?{type:"space",raw:ie[0]}:{raw:`
`}},ce.code=function(ne,ie){var oe=this.rules.block.code.exec(ne);if(oe){var le=ie[ie.length-1];if(le&&le.type==="paragraph")return{raw:oe[0],text:oe[0].trimRight()};var ye=oe[0].replace(/^ {4}/gm,"");return{type:"code",raw:oe[0],codeBlockStyle:"indented",text:this.options.pedantic?ye:b(ye,`
`)}}},ce.fences=function(ne){var ie=this.rules.block.fences.exec(ne);if(ie){var oe=ie[0],le=Oe(oe,ie[3]||"");return{type:"code",raw:oe,lang:ie[2]?ie[2].trim():ie[2],text:le}}},ce.heading=function(ne){var ie=this.rules.block.heading.exec(ne);if(ie)return{type:"heading",raw:ie[0],depth:ie[1].length,text:ie[2]}},ce.nptable=function(ne){var ie=this.rules.block.nptable.exec(ne);if(ie){var oe={type:"table",header:Y(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
`):[],raw:ie[0]};if(oe.header.length===oe.align.length){var le=oe.align.length,ye;for(ye=0;ye ?/gm,"");return{type:"blockquote",raw:ie[0],text:oe}}},ce.list=function(ne){var ie=this.rules.block.list.exec(ne);if(ie){for(var oe=ie[0],le=ie[2],ye=le.length>1,Le=le[le.length-1]===")",Ue={type:"list",raw:oe,ordered:ye,start:ye?+le.slice(0,-1):"",loose:!1,items:[]},Ze=ie[0].match(this.rules.block.item),mt=!1,ft,Ct,xt,Qe,Lt,vt,Ft,Pt=Ze.length,Rt=0;Rt1||this.options.smartLists&&xt!==le)&&(Qe=Ze.slice(Rt+1).join(`
`),Ue.raw=Ue.raw.substring(0,Ue.raw.length-Qe.length),Rt=Pt-1)),Lt=mt||/\n\n(?!\s*$)/.test(ft),Rt!==Pt-1&&(mt=ft.charAt(ft.length-1)===`
`,Lt||(Lt=mt)),Lt&&(Ue.loose=!0),vt=/^\[[ xX]\] /.test(ft),Ft=void 0,vt&&(Ft=ft[1]!==" ",ft=ft.replace(/^\[[ xX]\] +/,"")),Ue.items.push({type:"list_item",raw:oe,task:vt,checked:Ft,loose:Lt,text:ft});return Ue}},ce.html=function(ne){var ie=this.rules.block.html.exec(ne);if(ie)return{type:this.options.sanitize?"paragraph":"html",raw:ie[0],pre:!this.options.sanitizer&&(ie[1]==="pre"||ie[1]==="script"||ie[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ie[0]):ee(ie[0]):ie[0]}},ce.def=function(ne){var ie=this.rules.block.def.exec(ne);if(ie){ie[3]&&(ie[3]=ie[3].substring(1,ie[3].length-1));var oe=ie[1].toLowerCase().replace(/\s+/g," ");return{tag:oe,raw:ie[0],href:ie[2],title:ie[3]}}},ce.table=function(ne){var ie=this.rules.block.table.exec(ne);if(ie){var oe={type:"table",header:Y(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
`):[]};if(oe.header.length===oe.align.length){oe.raw=ie[0];var le=oe.align.length,ye;for(ye=0;ye/i.test(le[0])&&(ie=!1),!oe&&/^<(pre|code|kbd|script)(\s|>)/i.test(le[0])?oe=!0:oe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(le[0])&&(oe=!1),{type:this.options.sanitize?"text":"html",raw:le[0],inLink:ie,inRawBlock:oe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):ee(le[0]):le[0]}},ce.link=function(ne){var ie=this.rules.inline.link.exec(ne);if(ie){var oe=ae(ie[2],"()");if(oe>-1){var le=ie[0].indexOf("!")===0?5:4,ye=le+ie[1].length+oe;ie[2]=ie[2].substring(0,oe),ie[0]=ie[0].substring(0,ye).trim(),ie[3]=""}var Le=ie[2],Ue="";if(this.options.pedantic){var Ze=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Le);Ze?(Le=Ze[1],Ue=Ze[3]):Ue=""}else Ue=ie[3]?ie[3].slice(1,-1):"";Le=Le.trim().replace(/^<([\s\S]*)>$/,"$1");var mt=ue(ie,{href:Le&&Le.replace(this.rules.inline._escapes,"$1"),title:Ue&&Ue.replace(this.rules.inline._escapes,"$1")},ie[0]);return mt}},ce.reflink=function(ne,ie){var oe;if((oe=this.rules.inline.reflink.exec(ne))||(oe=this.rules.inline.nolink.exec(ne))){var le=(oe[2]||oe[1]).replace(/\s+/g," ");if(le=ie[le.toLowerCase()],!le||!le.href){var ye=oe[0].charAt(0);return{type:"text",raw:ye,text:ye}}var Le=ue(oe,le,oe[0]);return Le}},ce.strong=function(ne,ie,oe){oe===void 0&&(oe="");var le=this.rules.inline.strong.start.exec(ne);if(le&&(!le[1]||le[1]&&(oe===""||this.rules.inline.punctuation.exec(oe)))){ie=ie.slice(-1*ne.length);var ye=le[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ye.lastIndex=0;for(var Le;(le=ye.exec(ie))!=null;)if(Le=this.rules.inline.strong.middle.exec(ie.slice(0,le.index+3)),Le)return{type:"strong",raw:ne.slice(0,Le[0].length),text:ne.slice(2,Le[0].length-2)}}},ce.em=function(ne,ie,oe){oe===void 0&&(oe="");var le=this.rules.inline.em.start.exec(ne);if(le&&(!le[1]||le[1]&&(oe===""||this.rules.inline.punctuation.exec(oe)))){ie=ie.slice(-1*ne.length);var ye=le[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ye.lastIndex=0;for(var Le;(le=ye.exec(ie))!=null;)if(Le=this.rules.inline.em.middle.exec(ie.slice(0,le.index+2)),Le)return{type:"em",raw:ne.slice(0,Le[0].length),text:ne.slice(1,Le[0].length-1)}}},ce.codespan=function(ne){var ie=this.rules.inline.code.exec(ne);if(ie){var oe=ie[2].replace(/\n/g," "),le=/[^ ]/.test(oe),ye=oe.startsWith(" ")&&oe.endsWith(" ");return le&&ye&&(oe=oe.substring(1,oe.length-1)),oe=ee(oe,!0),{type:"codespan",raw:ie[0],text:oe}}},ce.br=function(ne){var ie=this.rules.inline.br.exec(ne);if(ie)return{type:"br",raw:ie[0]}},ce.del=function(ne){var ie=this.rules.inline.del.exec(ne);if(ie)return{type:"del",raw:ie[0],text:ie[1]}},ce.autolink=function(ne,ie){var oe=this.rules.inline.autolink.exec(ne);if(oe){var le,ye;return oe[2]==="@"?(le=ee(this.options.mangle?ie(oe[1]):oe[1]),ye="mailto:"+le):(le=ee(oe[1]),ye=le),{type:"link",raw:oe[0],text:le,href:ye,tokens:[{type:"text",raw:le,text:le}]}}},ce.url=function(ne,ie){var oe;if(oe=this.rules.inline.url.exec(ne)){var le,ye;if(oe[2]==="@")le=ee(this.options.mangle?ie(oe[0]):oe[0]),ye="mailto:"+le;else{var Le;do Le=oe[0],oe[0]=this.rules.inline._backpedal.exec(oe[0])[0];while(Le!==oe[0]);le=ee(oe[0]),oe[1]==="www."?ye="http://"+le:ye=le}return{type:"link",raw:oe[0],text:le,href:ye,tokens:[{type:"text",raw:le,text:le}]}}},ce.inlineText=function(ne,ie,oe){var le=this.rules.inline.text.exec(ne);if(le){var ye;return ie?ye=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):ee(le[0]):le[0]:ye=ee(this.options.smartypants?oe(le[0]):le[0]),{type:"text",raw:le[0],text:ye}}},ve}(),xe=j.noopTest,Ae=j.edit,Re=j.merge,pe={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:xe,table:xe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};pe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,pe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,pe.def=Ae(pe.def).replace("label",pe._label).replace("title",pe._title).getRegex(),pe.bullet=/(?:[*+-]|\d{1,9}[.)])/,pe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,pe.item=Ae(pe.item,"gm").replace(/bull/g,pe.bullet).getRegex(),pe.list=Ae(pe.list).replace(/bull/g,pe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+pe.def.source+")").getRegex(),pe._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",pe._comment=//,pe.html=Ae(pe.html,"i").replace("comment",pe._comment).replace("tag",pe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pe.paragraph=Ae(pe._paragraph).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",pe._tag).getRegex(),pe.blockquote=Ae(pe.blockquote).replace("paragraph",pe.paragraph).getRegex(),pe.normal=Re({},pe),pe.gfm=Re({},pe.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),pe.gfm.nptable=Ae(pe.gfm.nptable).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",pe._tag).getRegex(),pe.gfm.table=Ae(pe.gfm.table).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",pe._tag).getRegex(),pe.pedantic=Re({},pe.normal,{html:Ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pe._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:xe,paragraph:Ae(pe.normal._paragraph).replace("hr",pe.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",pe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var he={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:xe,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:xe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",he.punctuation=Ae(he.punctuation).replace(/punctuation/g,he._punctuation).getRegex(),he._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",he._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",he.em.start=Ae(he.em.start).replace(/punctuation/g,he._punctuation).getRegex(),he.em.middle=Ae(he.em.middle).replace(/punctuation/g,he._punctuation).replace(/overlapSkip/g,he._overlapSkip).getRegex(),he.em.endAst=Ae(he.em.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.em.endUnd=Ae(he.em.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.start=Ae(he.strong.start).replace(/punctuation/g,he._punctuation).getRegex(),he.strong.middle=Ae(he.strong.middle).replace(/punctuation/g,he._punctuation).replace(/blockSkip/g,he._blockSkip).getRegex(),he.strong.endAst=Ae(he.strong.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.endUnd=Ae(he.strong.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.blockSkip=Ae(he._blockSkip,"g").getRegex(),he.overlapSkip=Ae(he._overlapSkip,"g").getRegex(),he._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,he._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,he._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,he.autolink=Ae(he.autolink).replace("scheme",he._scheme).replace("email",he._email).getRegex(),he._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,he.tag=Ae(he.tag).replace("comment",pe._comment).replace("attribute",he._attribute).getRegex(),he._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,he._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,he._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,he.link=Ae(he.link).replace("label",he._label).replace("href",he._href).replace("title",he._title).getRegex(),he.reflink=Ae(he.reflink).replace("label",he._label).getRegex(),he.reflinkSearch=Ae(he.reflinkSearch,"g").replace("reflink",he.reflink).replace("nolink",he.nolink).getRegex(),he.normal=Re({},he),he.pedantic=Re({},he.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ae(/^!?\[(label)\]\((.*?)\)/).replace("label",he._label).getRegex(),reflink:Ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",he._label).getRegex()}),he.gfm=Re({},he.normal,{escape:Ae(he.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(ne="x"+ne.toString(16)),ce+=""+ne+";";return ce}var je=function(){function ve(fe){this.tokens=[],this.tokens.links=Object.create(null),this.options=fe||et,this.options.tokenizer=this.options.tokenizer||new Ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ne={block:We.normal,inline:it.normal};this.options.pedantic?(ne.block=We.pedantic,ne.inline=it.pedantic):this.options.gfm&&(ne.block=We.gfm,this.options.breaks?ne.inline=it.breaks:ne.inline=it.gfm),this.tokenizer.rules=ne}ve.lex=function(ne,ie){var oe=new ve(ie);return oe.lex(ne)};var ce=ve.prototype;return ce.lex=function(ne){return ne=ne.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ne,this.tokens,!0),this.inline(this.tokens),this.tokens},ce.blockTokens=function(ne,ie,oe){ie===void 0&&(ie=[]),oe===void 0&&(oe=!0),ne=ne.replace(/^ +$/gm,"");for(var le,ye,Le,Ue;ne;){if(le=this.tokenizer.space(ne)){ne=ne.substring(le.raw.length),le.type&&ie.push(le);continue}if(le=this.tokenizer.code(ne,ie)){ne=ne.substring(le.raw.length),le.type?ie.push(le):(Ue=ie[ie.length-1],Ue.raw+=`
`+le.raw,Ue.text+=`
`+le.text);continue}if(le=this.tokenizer.fences(ne)){ne=ne.substring(le.raw.length),ie.push(le);continue}if(le=this.tokenizer.heading(ne)){ne=ne.substring(le.raw.length),ie.push(le);continue}if(le=this.tokenizer.nptable(ne)){ne=ne.substring(le.raw.length),ie.push(le);continue}if(le=this.tokenizer.hr(ne)){ne=ne.substring(le.raw.length),ie.push(le);continue}if(le=this.tokenizer.blockquote(ne)){ne=ne.substring(le.raw.length),le.tokens=this.blockTokens(le.text,[],oe),ie.push(le);continue}if(le=this.tokenizer.list(ne)){for(ne=ne.substring(le.raw.length),Le=le.items.length,ye=0;ye0)for(;(Ze=this.tokenizer.rules.inline.reflinkSearch.exec(Ue))!=null;)mt.includes(Ze[0].slice(Ze[0].lastIndexOf("[")+1,-1))&&(Ue=Ue.slice(0,Ze.index)+"["+"a".repeat(Ze[0].length-2)+"]"+Ue.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ze=this.tokenizer.rules.inline.blockSkip.exec(Ue))!=null;)Ue=Ue.slice(0,Ze.index)+"["+"a".repeat(Ze[0].length-2)+"]"+Ue.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ne;){if(Le=this.tokenizer.escape(ne)){ne=ne.substring(Le.raw.length),ie.push(Le);continue}if(Le=this.tokenizer.tag(ne,oe,le)){ne=ne.substring(Le.raw.length),oe=Le.inLink,le=Le.inRawBlock,ie.push(Le);continue}if(Le=this.tokenizer.link(ne)){ne=ne.substring(Le.raw.length),Le.type==="link"&&(Le.tokens=this.inlineTokens(Le.text,[],!0,le)),ie.push(Le);continue}if(Le=this.tokenizer.reflink(ne,this.tokens.links)){ne=ne.substring(Le.raw.length),Le.type==="link"&&(Le.tokens=this.inlineTokens(Le.text,[],!0,le)),ie.push(Le);continue}if(Le=this.tokenizer.strong(ne,Ue,ye)){ne=ne.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],oe,le),ie.push(Le);continue}if(Le=this.tokenizer.em(ne,Ue,ye)){ne=ne.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],oe,le),ie.push(Le);continue}if(Le=this.tokenizer.codespan(ne)){ne=ne.substring(Le.raw.length),ie.push(Le);continue}if(Le=this.tokenizer.br(ne)){ne=ne.substring(Le.raw.length),ie.push(Le);continue}if(Le=this.tokenizer.del(ne)){ne=ne.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],oe,le),ie.push(Le);continue}if(Le=this.tokenizer.autolink(ne,Pe)){ne=ne.substring(Le.raw.length),ie.push(Le);continue}if(!oe&&(Le=this.tokenizer.url(ne,Pe))){ne=ne.substring(Le.raw.length),ie.push(Le);continue}if(Le=this.tokenizer.inlineText(ne,le,at)){ne=ne.substring(Le.raw.length),ye=Le.raw.slice(-1),ie.push(Le);continue}if(ne){var ft="Infinite loop on byte: "+ne.charCodeAt(0);if(this.options.silent){console.error(ft);break}else throw new Error(ft)}}return ie},$(ve,null,[{key:"rules",get:function(){return{block:We,inline:it}}}]),ve}(),$e=G.defaults,se=j.cleanUrl,_e=j.escape,Te=function(){function ve(fe){this.options=fe||$e}var ce=ve.prototype;return ce.code=function(ne,ie,oe){var le=(ie||"").match(/\S*/)[0];if(this.options.highlight){var ye=this.options.highlight(ne,le);ye!=null&&ye!==ne&&(oe=!0,ne=ye)}return le?''+(oe?ne:_e(ne,!0))+`
`:""+(oe?ne:_e(ne,!0))+`
`},ce.blockquote=function(ne){return`
`+ne+`
`},ce.html=function(ne){return ne},ce.heading=function(ne,ie,oe,le){return this.options.headerIds?"
`:""+ne+"
`},ce.hr=function(){return this.options.xhtml?`
`:`
`},ce.list=function(ne,ie,oe){var le=ie?"ol":"ul",ye=ie&&oe!==1?' start="'+oe+'"':"";return"<"+le+ye+`>
`+ne+""+le+`>
`},ce.listitem=function(ne){return""+ne+`
`},ce.checkbox=function(ne){return" "},ce.paragraph=function(ne){return""+ne+`
`},ce.table=function(ne,ie){return ie&&(ie=""+ie+""),`
`},ce.tablerow=function(ne){return`
`+ne+`
`},ce.tablecell=function(ne,ie){var oe=ie.header?"th":"td",le=ie.align?"<"+oe+' align="'+ie.align+'">':"<"+oe+">";return le+ne+""+oe+`>
`},ce.strong=function(ne){return""+ne+""},ce.em=function(ne){return""+ne+""},ce.codespan=function(ne){return""+ne+""},ce.br=function(){return this.options.xhtml?"
":"
"},ce.del=function(ne){return""+ne+""},ce.link=function(ne,ie,oe){if(ne=se(this.options.sanitize,this.options.baseUrl,ne),ne===null)return oe;var le='"+oe+"",le},ce.image=function(ne,ie,oe){if(ne=se(this.options.sanitize,this.options.baseUrl,ne),ne===null)return oe;var le='
":">",le},ce.text=function(ne){return ne},ve}(),Se=function(){function ve(){}var ce=ve.prototype;return ce.strong=function(ne){return ne},ce.em=function(ne){return ne},ce.codespan=function(ne){return ne},ce.del=function(ne){return ne},ce.html=function(ne){return ne},ce.text=function(ne){return ne},ce.link=function(ne,ie,oe){return""+oe},ce.image=function(ne,ie,oe){return""+oe},ce.br=function(){return""},ve}(),Ge=function(){function ve(){this.seen={}}var ce=ve.prototype;return ce.slug=function(ne){var ie=ne.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ie)){var oe=ie;do this.seen[oe]++,ie=oe+"-"+this.seen[oe];while(this.seen.hasOwnProperty(ie))}return this.seen[ie]=0,ie},ve}(),Ne=G.defaults,Fe=j.unescape,Ke=function(){function ve(fe){this.options=fe||Ne,this.options.renderer=this.options.renderer||new Te,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Se,this.slugger=new Ge}ve.parse=function(ne,ie){var oe=new ve(ie);return oe.parse(ne)};var ce=ve.prototype;return ce.parse=function(ne,ie){ie===void 0&&(ie=!0);var oe="",le,ye,Le,Ue,Ze,mt,ft,Ct,xt,Qe,Lt,vt,Ft,Pt,Rt,pi,ai,bt,ti=ne.length;for(le=0;le0&&Rt.tokens[0].type==="text"?(Rt.tokens[0].text=bt+" "+Rt.tokens[0].text,Rt.tokens[0].tokens&&Rt.tokens[0].tokens.length>0&&Rt.tokens[0].tokens[0].type==="text"&&(Rt.tokens[0].tokens[0].text=bt+" "+Rt.tokens[0].tokens[0].text)):Rt.tokens.unshift({type:"text",text:bt}):Pt+=bt),Pt+=this.parse(Rt.tokens,Ft),xt+=this.renderer.listitem(Pt,ai,pi);oe+=this.renderer.list(xt,Lt,vt);continue}case"html":{oe+=this.renderer.html(Qe.text);continue}case"paragraph":{oe+=this.renderer.paragraph(this.parseInline(Qe.tokens));continue}case"text":{for(xt=Qe.tokens?this.parseInline(Qe.tokens):Qe.text;le+1An error occurred:
"+tt(Le.message+"",!0)+"
";throw Le}}De.options=De.setOptions=function(ve){return Je(De.defaults,ve),nt(De.defaults),De},De.getDefaults=Ie,De.defaults=st,De.use=function(ve){var ce=Je({},ve);if(ve.renderer&&function(){var ne=De.defaults.renderer||new Te,ie=function(ye){var Le=ne[ye];ne[ye]=function(){for(var Ue=arguments.length,Ze=new Array(Ue),mt=0;mt`,triples:"",explode:"[]{}"},P=re.Pos;re.defineOption("autoCloseBrackets",!1,function(o,f,l){l&&l!=re.Init&&(o.removeKeyMap(U),o.state.closeBrackets=null),f&&(k(X(f,"pairs")),o.state.closeBrackets=f,o.addKeyMap(U))});function X(o,f){return f=="pairs"&&typeof o=="string"?o:typeof o=="object"&&o[f]!=null?o[f]:$[f]}var U={Backspace:i,Enter:D};function k(o){for(var f=0;f=0;a--){var A=h[a].head;o.replaceRange("",P(A.line,A.ch-1),P(A.line,A.ch+1),"+delete")}}function D(o){var f=W(o),l=f&&X(f,"explode");if(!l||o.getOption("disableInput"))return re.Pass;for(var h=o.listSelections(),a=0;a0;return{anchor:new P(o.anchor.line,o.anchor.ch+(f?-1:1)),head:new P(o.head.line,o.head.ch+(f?1:-1))}}function p(o,f){var l=W(o);if(!l||o.getOption("disableInput"))return re.Pass;var h=X(l,"pairs"),a=h.indexOf(f);if(a==-1)return re.Pass;for(var s=X(l,"closeBefore"),A=X(l,"triples"),E=h.charAt(a+1)==f,S=o.listSelections(),L=a%2==0,O,C=0;C=0&&o.getRange(x,P(x.line,x.ch+3))==f+f+f?c="skipThree":c="skip";else if(E&&x.ch>1&&A.indexOf(f)>=0&&o.getRange(P(x.line,x.ch-2),x)==f+f){if(x.ch>2&&/\bstring/.test(o.getTokenTypeAt(P(x.line,x.ch-2))))return re.Pass;c="addFour"}else if(E){var v=x.ch==0?" ":o.getRange(P(x.line,x.ch-1),x);if(!re.isWordChar(w)&&v!=f&&!re.isWordChar(v))c="both";else return re.Pass}else if(L&&(w.length===0||/\s/.test(w)||s.indexOf(w)>-1))c="both";else return re.Pass;if(!O)O=c;else if(O!=c)return re.Pass}var y=a%2?h.charAt(a-1):f,F=a%2?f:h.charAt(a+1);o.operation(function(){if(O=="skip")o.execCommand("goCharRight");else if(O=="skipThree")for(var B=0;B<3;B++)o.execCommand("goCharRight");else if(O=="surround"){for(var R=o.getSelections(),B=0;Bs.length&&(E=s.length);AS===L){const S=s[Symbol.iterator](),L=A[Symbol.iterator]();for(;;){const O=S.next(),C=L.next();if(O.done!==C.done)return!1;if(O.done)return!0;if(!E(O.value,C.value))return!1}}$.equals=a})(re||(re={}))},JkjM:function(ht,be,Z){"use strict";Z.r(be);var re=Z("9og8"),$=Z("PpiC"),P=Z("WmNS"),X=Z.n(P),U=Z("q1tI"),k=Z.n(U),G=Z("Ty5D"),W=Z("9kvl"),i=Z("14J3"),D=Z("BMrR"),g=Z("jCWc"),p=Z("kPKH"),m=Z("+L6B"),u=Z("2/Rp"),o=Z("k1fw"),f=Z("m3rI"),l=Z("LO5M"),h=Z.n(l),a=Z("h+Ho"),s=function(Fe){var Ke,Je,Ve,tt,Ie=Fe.user,nt=Fe.forumsDetail,st=Fe.globalSetting,De=Fe.loading,Me=Fe.dispatch,ve=Object($.a)(Fe,["user","forumsDetail","globalSetting","loading","dispatch"]),ce=nt.forumsDetailData||{},fe=ce.author_info,ne=ce.memo,ie=ce.recommend_shixuns,oe=function(){var le=Object(re.a)(X.a.mark(function ye(){var Le;return X.a.wrap(function(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:if(!(fe!=null&&fe.watched)){Ze.next=6;break}return Ze.next=3,Object(a.a)({user_id:fe.user_id});case 3:Ze.t0=Ze.sent,Ze.next=9;break;case 6:return Ze.next=8,Object(a.o)({user_id:fe.user_id});case 8:Ze.t0=Ze.sent;case 9:Le=Ze.t0,Le&&Me({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},nt.forumsDetailData),{},{author_info:Object(o.a)(Object(o.a)({},fe),{},{watched:!(fe!=null&&fe.watched)})})});case 11:case"end":return Ze.stop()}},ye)}));return function(){return le.apply(this,arguments)}}();return k.a.createElement("section",{className:h.a.wrap},k.a.createElement("aside",{className:"ml20"},k.a.createElement("div",{className:"bg-white pt40 pb40 pl20 pr20 ".concat(h.a.head)},k.a.createElement("a",{href:"/users/".concat(fe==null?void 0:fe.login),target:"_blank"},(fe==null?void 0:fe.image_url)&&k.a.createElement("img",{src:"".concat(f.a.API_SERVER,"/images/").concat(fe==null?void 0:fe.image_url)})),k.a.createElement("div",{className:"tc font20"},fe==null?void 0:fe.username),k.a.createElement("div",{className:"tc c-grey-999"},fe==null?void 0:fe.identity),((Ke=Ie.userInfo)===null||Ke===void 0?void 0:Ke.user_id)!==(fe==null?void 0:fe.user_id)&&k.a.createElement(D.a,{justify:"center",className:"mt30 ".concat(h.a.buttonWrap)},k.a.createElement(p.a,null,k.a.createElement(u.a,{type:"primary",className:"mr10",onClick:oe},fe!=null&&fe.watched?"\u53D6\u6D88\u5173\u6CE8":"\u5173\u6CE8")),k.a.createElement(p.a,null,k.a.createElement(u.a,{ghost:!0,className:h.a.privateMessage,href:"/messages/".concat((Je=Ie.userInfo)===null||Je===void 0?void 0:Je.login,"/message_detail?target_ids=").concat(fe==null?void 0:fe.user_id),target:"_blank"},"\u79C1\u4FE1")))),!!(ne!=null&&(Ve=ne.tag)!==null&&Ve!==void 0&&Ve.length)&&k.a.createElement("div",{className:"bg-white mt10 pt40 pb40 pl20 pr20"},k.a.createElement("div",{className:"font16"},"\u8BDD\u9898\u6807\u7B7E"),k.a.createElement("div",{className:"mt30 ".concat(h.a.tag)},ne==null||((tt=ne.tag)===null||tt===void 0)?void 0:tt.map(function(le){return k.a.createElement("a",null,le==null?void 0:le.name)}))),k.a.createElement("div",{className:"pt10 pb10 pl10 pr10"},k.a.createElement("div",{className:"font16 mb20"},"\u63A8\u8350\u5B9E\u8BAD"),k.a.createElement("div",{className:h.a.recommend},ie==null?void 0:ie.map(function(le){return k.a.createElement("div",{className:h.a.recommendItem},k.a.createElement("a",{href:"/shixuns/".concat(le.identifier,"/challenges"),target:"_blank"},k.a.createElement("img",{alt:le.id,src:"".concat(f.a.API_SERVER,"/").concat(le.image_url)})),k.a.createElement("div",{className:"".concat(h.a.flex1," ml10")},k.a.createElement("a",{href:"/shixuns/".concat(le.identifier,"/challenges"),target:"_blank",title:le.name,className:"".concat(h.a.mWidth147," multi-llipsis1e c-grey-666 mb10")},le.name),k.a.createElement("div",{className:"c-grey-999"},le.myshixuns_count," \u4EBA\u5B66\u4E60")))})))))},A=Object(W.a)(function(Ne){var Fe=Ne.user,Ke=Ne.forumsDetail,Je=Ne.loading,Ve=Ne.globalSetting;return{user:Fe,forumsDetail:Ke,globalSetting:Ve,loading:Je.models.forumsDetail}})(s),E=Z("qVdP"),S=Z("jsC+"),L=Z("5Dmo"),O=Z("3S7+"),C=Z("sPJy"),T=Z("bE4q"),x=Z("lUTK"),c=Z("BvKs"),w=Z("5NDa"),v=Z("5rEg"),y=Z("2qtc"),F=Z("kLXV"),B=Z("miYZ"),R=Z("tsqr"),j=Z("55Ip"),N=Z("wd/R"),b=Z.n(N),Y=Z("9Bee"),ee=Z("oBTY"),ae=Z("tJVT"),ue=Z("Ot1p"),Oe=Z("/MfK"),Ee=Z("8JLL"),xe=Z.n(Ee);b.a.lang("ZH-cn");function Ae(Ne){var Fe=Ne.user,Ke=Ne.vlist,Je=Ke===void 0?[]:Ke,Ve=Ne.dispatch,tt=Ne.params,Ie=Ne.id,nt=Ne.memo_replies,st=Ne.forumsDetail;return k.a.createElement("aside",{className:xe.a.comment},Je.map(function(De,Me){var ve,ce;return k.a.createElement(D.a,{key:Me,className:xe.a.commentItem},k.a.createElement(p.a,{span:24},k.a.createElement(D.a,null,k.a.createElement(p.a,{flex:"1"},k.a.createElement("a",{href:"/users/".concat(De.user_login),target:"_blank",className:"c-light-black"},De==null?void 0:De.username),k.a.createElement("span",{className:"c-light-black ml10"},De.time)),(De.can_delete||De.user_id===((ve=Fe.userInfo)===null||ve===void 0?void 0:ve.user_id)||De.user_login===((ce=Fe.userInfo)===null||ce===void 0?void 0:ce.login))&&k.a.createElement(p.a,{className:"forums-comment-delete",style:{display:"none"}},k.a.createElement(O.a,{title:"\u5220\u9664"},k.a.createElement(Oe.a,{className:"current",onClick:function(){F.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:k.a.createElement("div",{className:"font16 tc"},"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"),onOk:function(){var ne=Object(re.a)(X.a.mark(function oe(){var le,ye;return X.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:return Ue.next=2,Object(a.b)({id:De.id});case 2:le=Ue.sent,ye=nt.find(function(Ze){return Ze.id===Ie}).children.filter(function(Ze){return Ze.id!==De.id}),nt.find(function(Ze){return Ze.id===Ie}).children=ye,Ve({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},st.forumsDetailData),{},{memo_replies:Object(ee.a)(nt)})});case 6:case"end":return Ue.stop()}},oe)}));function ie(){return ne.apply(this,arguments)}return ie}()})}}))))),k.a.createElement(p.a,null,k.a.createElement(Y.a,{value:De.content})))}))}var Re=Ae,pe=Z("1vsH");b.a.lang("ZH-cn");var he=function(Fe,Ke){var Je=Fe.user,Ve=Fe.forumsDetail,tt=Fe.globalSetting,Ie=Fe.loading,nt=Fe.dispatch,st=Fe.handleClick,De=Object($.a)(Fe,["user","forumsDetail","globalSetting","loading","dispatch","handleClick"]),Me=Ve.forumsDetailData||{},ve=Me.memo,ce=Me.memo_replies,fe=Object(G.i)(),ne=Object(U.useState)(""),ie=Object(ae.a)(ne,2),oe=ie[0],le=ie[1],ye=Object(U.useState)(""),Le=Object(ae.a)(ye,2),Ue=Le[0],Ze=Le[1],mt=Object(U.useState)(-1),ft=Object(ae.a)(mt,2),Ct=ft[0],xt=ft[1],Qe=Object(U.useState)(!1),Lt=Object(ae.a)(Qe,2),vt=Lt[0],Ft=Lt[1],Pt=Object(U.useState)(1),Rt=Object(ae.a)(Pt,2),pi=Rt[0],ai=Rt[1],bt=Object(U.useState)(!1),ti=Object(ae.a)(bt,2),_t=ti[0],Tt=ti[1];Object(U.useImperativeHandle)(Ke,function(){return{onMdFouch:ui}}),Object(U.useEffect)(function(){Ft((ve==null?void 0:ve.replies_count)>10)},[ve==null?void 0:ve.replies_count]);var Wt=function(){var dt=Object(re.a)(X.a.mark(function ut(){var qt,Ot,Mt;return X.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return qt=pi+1,ai(qt),Ut.next=4,Object(a.h)({id:fe.memoId,page:qt});case 4:Ot=Ut.sent,Ot!=null&&Ot.memo_replies&&(nt({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Ve.forumsDetailData),{},{memo_replies:[].concat(Object(ee.a)(ce),Object(ee.a)(Ot.memo_replies))})}),Ft(((Mt=Ot.memo_replies)===null||Mt===void 0?void 0:Mt.length)===10));case 6:case"end":return Ut.stop()}},ut)}));return function(){return dt.apply(this,arguments)}}(),ii=function(ut){var qt,Ot,Mt,Dt;return Object(o.a)(Object(o.a)({},ut),{},{image_url:(qt=Je.userInfo)===null||qt===void 0?void 0:qt.image_url,children:[],user_id:(Ot=Je.userInfo)===null||Ot===void 0?void 0:Ot.user_id,user_login:(Mt=Je.userInfo)===null||Mt===void 0?void 0:Mt.login,username:(Dt=Je.userInfo)===null||Dt===void 0?void 0:Dt.username,time:"".concat(Object(pe.bb)((new Date().getTime()-new Date(ut.created_at).getTime())/1e3),"\u524D")})},ui=function(){Tt(!0)};return k.a.createElement("section",{className:xe.a.wrap},!!(ce!=null&&ce.length)&&k.a.createElement("aside",{className:xe.a.content},k.a.createElement("div",{style:{padding:"10px 15px 5px 15px",justifyContent:"space-between",display:"flex"}},k.a.createElement("span",null,"\u5168\u90E8\u56DE\u590D\uFF08",ve.replies_count,"\uFF09")),k.a.createElement("aside",{className:xe.a.replyList},ce==null?void 0:ce.map(function(dt,ut){var qt;return k.a.createElement(D.a,{gutter:[12,12],key:ut},k.a.createElement(p.a,{flex:"40px"},k.a.createElement("a",{href:"/users/".concat(dt.user_login),target:"_blank"},k.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",width:"50",height:"50",src:"".concat(f.a.IMG_SERVER,"/images/").concat(dt==null?void 0:dt.image_url)}))),k.a.createElement(p.a,{flex:"1"},k.a.createElement(D.a,{align:"middle"},k.a.createElement(p.a,{span:24},k.a.createElement("a",{href:"/users/".concat(dt.user_login),target:"_blank"},k.a.createElement("span",{className:"c-light-black"},dt==null?void 0:dt.username)),k.a.createElement("span",{className:"c-light-black ml10"},dt.time)),k.a.createElement(p.a,{span:24},k.a.createElement("div",{onClick:st},k.a.createElement(Y.a,{value:dt.content}))),!!(dt!=null&&(qt=dt.children)!==null&&qt!==void 0&&qt.length)&&k.a.createElement(Re,{user:Je,id:dt==null?void 0:dt.id,vlist:dt==null?void 0:dt.children,dispatch:nt,params:fe,memo_replies:ce,forumsDetail:Ve}),k.a.createElement(p.a,{span:24,className:"mt5 c-light-black"},Ct===ut?k.a.createElement("aside",null,k.a.createElement(ue.a,{onChange:function(Mt){Ze(Mt)},height:150,isFocus:!0,placeholder:"\u6211\u8981\u56DE\u590D..."}),k.a.createElement(D.a,null,k.a.createElement(p.a,{span:24,className:"tr"},k.a.createElement(u.a,{type:"primary",size:"large",onClick:Object(re.a)(X.a.mark(function Ot(){var Mt;return X.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:if(!(Ue==="")){Ut.next=4;break}R.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Ut.next=9;break;case 4:return Ut.next=6,Object(a.k)({parent_id:dt.id,content:Ue});case 6:Mt=Ut.sent,Ze(null),Mt&&(xt(-1),ce.find(function(hi){return hi.id===Mt.parent_id}).children.push(ii(Mt)),nt({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Ve.forumsDetailData),{},{memo:Object(o.a)(Object(o.a)({},ve),{},{replies_count:ve.replies_count+1}),memo_replies:Object(ee.a)(ce)})}));case 9:case"end":return Ut.stop()}},Ot)}))},"\u53D1\u9001")))):k.a.createElement("div",{className:"tr"},k.a.createElement("span",{className:"iconfont icon-huifu1 mr15 ml30 current",onClick:function(){return xt(ut)}}),k.a.createElement(O.a,{title:dt.user_praise?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},k.a.createElement("span",{className:dt.user_praise?"c-orange":"c-gery-888"},k.a.createElement("i",{className:"iconfont icon-dianzan mr3 current",onClick:Object(re.a)(X.a.mark(function Ot(){var Mt;return X.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return Ut.next=2,Object(a.i)({id:dt.id,container_type:"Memo",type:dt.user_praise?0:1});case 2:Mt=Ut.sent,(Mt==null?void 0:Mt.praise_count)>=0&&(ce.find(function(hi){return hi.id===dt.id}).user_praise=!dt.user_praise,ce.find(function(hi){return hi.id===dt.id}).praise_count=Mt==null?void 0:Mt.praise_count,nt({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Ve.forumsDetailData),{},{memo_replies:Object(ee.a)(ce)})}));case 4:case"end":return Ut.stop()}},Ot)}))}),dt.praise_count>0?dt.praise_count:"")))))))}))),vt&&k.a.createElement("aside",{className:"bg-white pb20",style:{display:"flex",justifyContent:"center"}},k.a.createElement(D.a,{justify:"space-between"},k.a.createElement(p.a,null),k.a.createElement(p.a,null,vt&&k.a.createElement("a",{className:"c-black",onClick:Wt},"\u67E5\u770B\u66F4\u591A\u8BC4\u8BBA")))),k.a.createElement("aside",{className:xe.a.reply},k.a.createElement(ue.a,{onBlur:function(){return Tt(!1)},isFocus:_t,defaultValue:oe,id:"writeForumsReviewId",onChange:function(ut){le(ut)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),k.a.createElement(D.a,null,k.a.createElement(p.a,{flex:"1"}),k.a.createElement(p.a,null,k.a.createElement(u.a,{type:"primary",size:"large",onClick:Object(re.a)(X.a.mark(function dt(){var ut;return X.a.wrap(function(Ot){for(;;)switch(Ot.prev=Ot.next){case 0:if(!(oe==="")){Ot.next=4;break}R.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Ot.next=9;break;case 4:return Ot.next=6,Object(a.k)({parent_id:ve.id,content:oe});case 6:ut=Ot.sent,le(null),ut&&nt({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Ve.forumsDetailData),{},{memo:Object(o.a)(Object(o.a)({},ve),{},{replies_count:ve.replies_count+1}),memo_replies:[ii(ut)].concat(Object(ee.a)(ce))})});case 9:case"end":return Ot.stop()}},dt)}))},"\u53D1\u9001")))))},ke=Object(W.a)(function(Ne){var Fe=Ne.user,Ke=Ne.forumsDetail,Je=Ne.loading,Ve=Ne.globalSetting;return{user:Fe,forumsDetail:Ke,globalSetting:Ve,loading:Je.models.forumsDetail}},null,null,{forwardRef:!0})(Object(U.forwardRef)(he)),et=Z("smFo"),We=Z.n(et),it=Z("RCxd"),at=Z("kaH+"),Pe=Z("dhSg"),je={5:"\u6280\u672F\u5206\u4EAB",3:"\u64CD\u4F5C\u6307\u5357",16:"\u901A\u77E5\u516C\u544A"},$e=function(Fe){var Ke,Je,Ve,tt,Ie,nt=Fe.user,st=Fe.forumsDetail,De=Fe.globalSetting,Me=Fe.loading,ve=Fe.dispatch,ce=Object($.a)(Fe,["user","forumsDetail","globalSetting","loading","dispatch"]),fe=st.forumsDetailData||{},ne=fe.author_info,ie=fe.memo,oe=fe.attachments_list,le=Object(U.useRef)(),ye=Object(U.useRef)(),Le=function(){var Qe=Object(re.a)(X.a.mark(function Lt(){var vt,Ft;return X.a.wrap(function(Rt){for(;;)switch(Rt.prev=Rt.next){case 0:return vt={id:ie.id,sticky:ie.sticky?0:1},Rt.next=3,Object(a.m)(vt);case 3:Ft=Rt.sent,(Ft==null?void 0:Ft.status)===0&&ve({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},st.forumsDetailData),{},{memo:Object(o.a)(Object(o.a)({},ie),{},{sticky:!(ie!=null&&ie.sticky)})})});case 5:case"end":return Rt.stop()}},Lt)}));return function(){return Qe.apply(this,arguments)}}(),Ue=function(){var Qe=Object(re.a)(X.a.mark(function Lt(){var vt;return X.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(a.b)({id:ie==null?void 0:ie.id});case 2:vt=Pt.sent,(vt==null?void 0:vt.status)===0&&(R.b.success("\u5220\u9664\u6210\u529F"),W.d.push("/forums")),(vt==null?void 0:vt.status)===-1&&W.d.push("/forums");case 5:case"end":return Pt.stop()}},Lt)}));return function(){return Qe.apply(this,arguments)}}(),Ze=function(){var Qe=Object(re.a)(X.a.mark(function Lt(){return X.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:F.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u5956\u52B1\u8BBE\u7F6E",content:k.a.createElement("div",{className:"font14 tc"},k.a.createElement(v.a,{defaultValue:le.current,onChange:function(Rt){return le.current=Rt.target.value}})),onOk:function(){var Pt=Object(re.a)(X.a.mark(function pi(){var ai;return X.a.wrap(function(ti){for(;;)switch(ti.prev=ti.next){case 0:return ti.next=2,Object(a.l)({id:ie==null?void 0:ie.id,container_type:"Memo",score:le.current?Number(le.current):0,user_id:ne==null?void 0:ne.user_id});case 2:if(ai=ti.sent,le.current=null,!((ai==null?void 0:ai.code)>0)){ti.next=8;break}return ve({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},st.forumsDetailData),{},{memo:Object(o.a)(Object(o.a)({},ie),{},{reward:ai==null?void 0:ai.code})})}),R.b.success("\u5956\u52B1\u6210\u529F"),ti.abrupt("return");case 8:R.b.success("\u5956\u52B1\u5931\u8D25\uFF0C\u8BF7\u8054\u7CFB\u7CFB\u7EDF\u7BA1\u7406\u5458\uFF01");case 9:case"end":return ti.stop()}},pi)}));function Rt(){return Pt.apply(this,arguments)}return Rt}()});case 1:case"end":return Ft.stop()}},Lt)}));return function(){return Qe.apply(this,arguments)}}(),mt=function(){ye.current.onMdFouch&&ye.current.onMdFouch()},ft=function(){var Qe=Object(re.a)(X.a.mark(function Lt(){var vt;return X.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(a.i)({id:ie.id,container_type:"Memo",type:1});case 2:vt=Pt.sent,(vt==null?void 0:vt.praise_count)>=0&&ve({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},st.forumsDetailData),{},{memo:Object(o.a)(Object(o.a)({},ie),{},{user_praise:!(ie!=null&&ie.user_praise),memo_praise_count:vt==null?void 0:vt.praise_count})})});case 4:case"end":return Pt.stop()}},Lt)}));return function(){return Qe.apply(this,arguments)}}(),Ct=k.a.createElement(c.a,{className:We.a.menu},((Ke=nt.userInfo)===null||Ke===void 0?void 0:Ke.admin)&&(ie==null?void 0:ie.sticky)&&k.a.createElement(c.a.Item,null,k.a.createElement("a",{onClick:function(){return Le()}},"\u53D6\u6D88\u7F6E\u9876")),((Je=nt.userInfo)===null||Je===void 0?void 0:Je.admin)&&!(ie!=null&&ie.sticky)&&k.a.createElement(c.a.Item,null,k.a.createElement("a",{onClick:function(){return Le()}},"\u7F6E\xA0\xA0\u9876")),k.a.createElement(c.a.Item,null,k.a.createElement(j.a,{to:"/forums/".concat(ie==null?void 0:ie.id,"/edit")},"\u7F16\xA0\xA0\u8F91")),k.a.createElement(c.a.Item,null,k.a.createElement("a",{onClick:function(){F.a.confirm({title:"\u63D0\u793A",icon:k.a.createElement(it.a,null),content:"\u5E16\u5B50\u5C06\u88AB\u5220\u9664\uFF0C\u65E0\u6CD5\u6062\u590D\u3002\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F",okText:"\u786E\u8BA4",onOk:function(){Ue()},cancelText:"\u53D6\u6D88"})}},"\u5220\xA0\xA0\u9664"))),xt=function(Lt){var vt=Lt.target,Ft=vt.nodeName,Pt=vt.src;Ft==="IMG"&&(Pe.a.publish("preview-image",Pt),console.log("src:",Pt))};return Object(U.useEffect)(function(){},[]),k.a.createElement("section",{className:We.a.wrap},k.a.createElement(T.a,{separator:"/",className:"mb5"},k.a.createElement(T.a.Item,null,k.a.createElement(j.a,{to:"/forums/categories/".concat(ie==null?void 0:ie.forum_id)},je[ie==null?void 0:ie.forum_id])),k.a.createElement(T.a.Item,null,"\u8BE6\u60C5")),k.a.createElement("header",{className:"bg-white pt40 pb40 pl30 pr30 ".concat(We.a.header)},k.a.createElement(D.a,{align:"middle"},k.a.createElement(p.a,{flex:1,className:"font24 mb5"},k.a.createElement("span",{className:We.a.title},ie==null?void 0:ie.subject),(ie==null?void 0:ie.sticky)&&k.a.createElement("span",{className:We.a.top},"\u7F6E\u9876"),!!(ie!=null&&ie.reward)&&k.a.createElement(O.a,{placement:"bottom",title:"\u83B7\u5F97\u5E73\u53F0\u5956\u52B1\u91D1\u5E01\uFF1A".concat(ie==null?void 0:ie.reward)},k.a.createElement("span",{className:"ml10 c-orange-ff7"},k.a.createElement("i",{className:"iconfont icon-gift font16 mr5"}),k.a.createElement("span",{className:"font14"},ie==null?void 0:ie.reward)))),k.a.createElement(p.a,null,(((Ve=nt.userInfo)===null||Ve===void 0?void 0:Ve.admin)||((tt=nt.userInfo)===null||tt===void 0?void 0:tt.user_id)===(ne==null?void 0:ne.user_id))&&k.a.createElement(S.a,{overlay:Ct},k.a.createElement("i",{className:"fa fa-bars font-16 current c-grey-bcb"})))),k.a.createElement(D.a,{align:"middle",className:"font14"},k.a.createElement(p.a,{flex:1,className:"c-grey-999"},k.a.createElement("span",null,b()(ie==null?void 0:ie.time).fromNow()," \u53D1\u5E03")),k.a.createElement(p.a,{className:"c-grey-999"},((Ie=nt.userInfo)===null||Ie===void 0?void 0:Ie.admin)&&k.a.createElement(O.a,{placement:"bottom",title:"\u5E16\u5B50\u5956\u52B1"},k.a.createElement("span",{className:"current pr10 ".concat(We.a.line),onClick:Ze},k.a.createElement("i",{className:"iconfont icon-jiangli font18 mr5"}))),k.a.createElement("span",{className:"pr10 pl10 ".concat(ie!=null&&ie.replies_count?We.a.line:"")},k.a.createElement("i",{className:"iconfont icon-liulanyan font18 mr5"}),ie==null?void 0:ie.viewed_count),!!(ie!=null&&ie.replies_count)&&k.a.createElement(O.a,{placement:"bottom",title:"\u5199\u8BC4\u8BBA"},k.a.createElement("span",{className:"current pl10",onClick:mt},k.a.createElement("i",{className:"iconfont icon-huifu1 font18 mr5"}),ie==null?void 0:ie.replies_count))))),k.a.createElement("main",{className:"bg-white pt40 pb40 pl40 pr40"},k.a.createElement("div",{onClick:xt},k.a.createElement(Y.a,{value:ie==null?void 0:ie.content})),k.a.createElement("div",{className:"bg-white pl40 pr40 mt40"},k.a.createElement("div",{className:"mt10 mb20 ".concat(We.a.flexCenter)},k.a.createElement("div",{className:"".concat(We.a.like," ").concat(ie!=null&&ie.user_praise?"":We.a.canLike),onClick:ft},k.a.createElement("i",{className:"iconfont icon-dianzan font18"}),k.a.createElement("br",null),k.a.createElement("span",null,ie==null?void 0:ie.memo_praise_count)))),!!(oe!=null&&oe.length)&&k.a.createElement("div",{className:"mt40"},oe==null?void 0:oe.map(function(Qe){return k.a.createElement("div",{className:"c-grey-888 ".concat(We.a.flexCenter)},k.a.createElement("i",{className:"iconfont icon-fujian mr10 font14 c-green-29b"}),k.a.createElement("a",{href:Qe==null?void 0:Qe.url,title:Qe==null?void 0:Qe.title,className:"".concat(We.a.attachmentName," mr10")},Qe==null?void 0:Qe.title),k.a.createElement("span",{className:"font12 c-grey-666 mt3"},Qe==null?void 0:Qe.filesize))}))),k.a.createElement(ke,{ref:ye,handleClick:xt}),k.a.createElement(at.a,null))},se=Object(W.a)(function(Ne){var Fe=Ne.user,Ke=Ne.forumsDetail,Je=Ne.loading,Ve=Ne.globalSetting;return{user:Fe,forumsDetail:Ke,globalSetting:Ve,loading:Je.effects}})($e),_e=Z("G8my"),Te=Z.n(_e),Se=function(Fe){var Ke=Fe.forumsDetail,Je=Fe.globalSetting,Ve=Fe.loading,tt=Fe.dispatch,Ie=Object($.a)(Fe,["forumsDetail","globalSetting","loading","dispatch"]),nt=Object(G.i)();Object(U.useEffect)(function(){st()},[nt.memoId]);var st=function(){var De=Object(re.a)(X.a.mark(function Me(){return X.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:tt({type:"forumsDetail/getForumsDetailData",payload:{id:nt.memoId}});case 1:case"end":return ce.stop()}},Me)}));return function(){return De.apply(this,arguments)}}();return k.a.createElement("section",{className:"edu-container mb20 mt30 ".concat(Te.a.flex)},k.a.createElement(se,null),k.a.createElement(A,null))},Ge=be.default=Object(W.a)(function(Ne){var Fe=Ne.forumsDetail,Ke=Ne.loading,Je=Ne.globalSetting;return{forumsDetail:Fe,globalSetting:Je,loading:Ke.models.forumsDetail}})(Se)},LO5M:function(ht,be,Z){ht.exports={wrap:"wrap___1d4rP",head:"head___1_Uzf",recommendItem:"recommendItem___IStR9",buttonWrap:"buttonWrap___3dpFm",privateMessage:"privateMessage___24GfS",flex1:"flex1___3wIqQ",mWidth147:"mWidth147___3ODny"}},LdHM:function(ht,be,Z){"use strict";Z.d(be,"b",function(){return s}),Z.d(be,"a",function(){return E});var re=Z("1OyB"),$=Z("vuIU"),P=Z("Ji7U"),X=Z("LK+K"),U=Z("q1tI"),k=Z("rePB"),G=Z("Ff2n"),W=Z("ODXe"),i=Z("4IlW"),D=Z("bX4T"),g=Z("YrtM"),p=Z("TSYQ"),m=Z.n(p),u=Z("+nKL"),o=Z("8OUc"),f=function(Y,ee){var ae=Y.prefixCls,ue=Y.id,Oe=Y.flattenOptions,Ee=Y.childrenAsData,xe=Y.values,Ae=Y.searchValue,Re=Y.multiple,pe=Y.defaultActiveFirstOption,he=Y.height,ke=Y.itemHeight,et=Y.notFoundContent,We=Y.open,it=Y.menuItemSelectedIcon,at=Y.virtual,Pe=Y.onSelect,je=Y.onToggleOpen,$e=Y.onActiveValue,se=Y.onScroll,_e=Y.onMouseEnter,Te="".concat(ae,"-item"),Se=Object(g.a)(function(){return Oe},[We,Oe],function(Me,ve){return ve[0]&&Me[1]!==ve[1]}),Ge=U.useRef(null),Ne=function(ve){ve.preventDefault()},Fe=function(ve){Ge.current&&Ge.current.scrollTo({index:ve})},Ke=function(ve){for(var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,fe=Se.length,ne=0;ne1&&arguments[1]!==void 0?arguments[1]:!1;return Object(L.a)(b).map(function(ee,ae){if(!U.isValidElement(ee)||!ee.type)return null;var ue=ee.type.isSelectOptGroup,Oe=ee.key,Ee=ee.props,xe=Ee.children,Ae=Object(G.a)(Ee,["children"]);return Y||!ue?O(ee):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(Oe===null?ae:Oe,"__"),label:Oe},Ae),{},{options:C(xe)})}).filter(function(ee){return ee})}var T=Z("2Qr1"),x=Z("qNPg"),c=Z("U8pU"),w=Z("Kwbf"),v=Z("WKfj");function y(b){var Y=b.mode,ee=b.options,ae=b.children,ue=b.backfill,Oe=b.allowClear,Ee=b.placeholder,xe=b.getInputElement,Ae=b.showSearch,Re=b.onSearch,pe=b.defaultOpen,he=b.autoFocus,ke=b.labelInValue,et=b.value,We=b.inputValue,it=b.optionLabelProp,at=Y==="multiple"||Y==="tags",Pe=Ae!==void 0?Ae:at||Y==="combobox",je=ee||C(ae);if(Object(w.a)(Y!=="tags"||je.every(function(Te){return!Te.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Y==="tags"||Y==="combobox"){var $e=je.some(function(Te){return Te.options?Te.options.some(function(Se){return typeof("value"in Se?Se.value:Se.key)=="number"}):typeof("value"in Te?Te.value:Te.key)=="number"});Object(w.a)(!$e,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(w.a)(Y!=="combobox"||!it,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(w.a)(Y==="combobox"||!ue,"`backfill` only works with `combobox` mode."),Object(w.a)(Y==="combobox"||!xe,"`getInputElement` only work with `combobox` mode."),Object(w.b)(Y!=="combobox"||!xe||!Oe||!Ee,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Re&&!Pe&&Y!=="combobox"&&Y!=="tags"&&Object(w.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(w.b)(!pe||he,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),et!=null){var se=Object(v.d)(et);Object(w.a)(!ke||se.every(function(Te){return Object(c.a)(Te)==="object"&&("key"in Te||"value"in Te)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(w.a)(!at||Array.isArray(et),"`value` should be array when `mode` is `multiple` or `tags`")}if(ae){var _e=null;Object(L.a)(ae).some(function(Te){if(!U.isValidElement(Te)||!Te.type)return!1;var Se=Te.type;if(Se.isSelectOption)return!1;if(Se.isSelectOptGroup){var Ge=Object(L.a)(Te.props.children).every(function(Ne){return!U.isValidElement(Ne)||!Te.type||Ne.type.isSelectOption?!0:(_e=Ne.type,!1)});return!Ge}return _e=Se,!0}),_e&&Object(w.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(_e.displayName||_e.name||_e,"`.")),Object(w.a)(We===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var F=y,B=Object(x.a)({prefixCls:"rc-select",components:{optionList:h},convertChildrenToData:C,flattenOptions:T.d,getLabeledValue:T.e,filterOptions:T.b,isValueDisabled:T.g,findValueOption:T.c,warningProps:F,fillOptionsWithMissingValue:T.a}),R=function(b){Object(P.a)(ee,b);var Y=Object(X.a)(ee);function ee(){var ae;return Object(re.a)(this,ee),ae=Y.apply(this,arguments),ae.selectRef=U.createRef(),ae.focus=function(){ae.selectRef.current.focus()},ae.blur=function(){ae.selectRef.current.blur()},ae}return Object($.a)(ee,[{key:"render",value:function(){return U.createElement(B,Object.assign({ref:this.selectRef},this.props))}}]),ee}(U.Component);R.Option=s,R.OptGroup=E;var j=R,N=be.c=j},M8RZ:function(ht,be,Z){"use strict";Z.d(be,"a",function(){return i});var re=Z("fWQN"),$=Z("mtLc"),P=Z("yKVA"),X=Z("879j"),U=Z("q1tI"),k=Z.n(U),G=Z("i8i4"),W=Z.n(G),i=function(D){Object(P.a)(p,D);var g=Object(X.a)(p);function p(m){var u;Object(re.a)(this,p),u=g.call(this,m);var o=window.document;return u.node=o.createElement("div"),o.body.appendChild(u.node),u}return Object($.a)(p,[{key:"render",value:function(){var u=this.props.children;return Object(G.createPortal)(u,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),p}(k.a.Component)},MI8n:function(ht,be,Z){"use strict";Z.d(be,"c",function(){return U}),Z.d(be,"b",function(){return i}),Z.d(be,"e",function(){return D}),Z.d(be,"a",function(){return g}),Z.d(be,"d",function(){return p}),Z.d(be,"f",function(){return m});var re=Z("/cxE"),$=Z("pmY6"),P=Z("24hK"),X=Z("5Y4S"),U;(function(u){u.None=()=>$.a.None;function o(y){return(F,B=null,R)=>{let j=!1,N;return N=y(b=>j?void 0:(N?N.dispose():j=!0,F.call(B,b)),null,R),j&&N.dispose(),N}}u.once=o;function f(y,F){return E((B,R=null,j)=>y(N=>B.call(R,F(N)),null,j))}u.map=f;function l(y,F){return E((B,R=null,j)=>y(N=>{F(N),B.call(R,N)},null,j))}u.forEach=l;function h(y,F){return E((B,R=null,j)=>y(N=>F(N)&&B.call(R,N),null,j))}u.filter=h;function a(y){return y}u.signal=a;function s(...y){return(F,B=null,R)=>Object($.e)(...y.map(j=>j(N=>F.call(B,N),null,R)))}u.any=s;function A(y,F,B){let R=B;return f(y,j=>(R=F(R,j),R))}u.reduce=A;function E(y){let F;const B=new i({onFirstListenerAdd(){F=y(B.fire,B)},onLastListenerRemove(){F.dispose()}});return B.event}function S(y,F,B=100,R=!1,j){let N,b,Y,ee=0;const ae=new i({leakWarningThreshold:j,onFirstListenerAdd(){N=y(ue=>{ee++,b=F(b,ue),R&&!Y&&(ae.fire(b),b=void 0),clearTimeout(Y),Y=setTimeout(()=>{const Oe=b;b=void 0,Y=void 0,(!R||ee>1)&&ae.fire(Oe),ee=0},B)})},onLastListenerRemove(){N.dispose()}});return ae.event}u.debounce=S;function L(y,F=(B,R)=>B===R){let B=!0,R;return h(y,j=>{const N=B||!F(j,R);return B=!1,R=j,N})}u.latch=L;function O(y,F){return[u.filter(y,F),u.filter(y,B=>!F(B))]}u.split=O;function C(y,F=!1,B=[]){let R=B.slice(),j=y(Y=>{R?R.push(Y):b.fire(Y)});const N=()=>{R&&R.forEach(Y=>b.fire(Y)),R=null},b=new i({onFirstListenerAdd(){j||(j=y(Y=>b.fire(Y)))},onFirstListenerDidAdd(){R&&(F?setTimeout(N):N())},onLastListenerRemove(){j&&j.dispose(),j=null}});return b.event}u.buffer=C;class T{constructor(y){this.event=y}map(y){return new T(f(this.event,y))}forEach(y){return new T(l(this.event,y))}filter(y){return new T(h(this.event,y))}reduce(y,F){return new T(A(this.event,y,F))}latch(){return new T(L(this.event))}debounce(y,F=100,B=!1,R){return new T(S(this.event,y,F,B,R))}on(y,F,B){return this.event(y,F,B)}once(y,F,B){return o(this.event)(y,F,B)}}function x(y){return new T(y)}u.chain=x;function c(y,F,B=R=>R){const R=(...Y)=>b.fire(B(...Y)),j=()=>y.on(F,R),N=()=>y.removeListener(F,R),b=new i({onFirstListenerAdd:j,onLastListenerRemove:N});return b.event}u.fromNodeEventEmitter=c;function w(y,F,B=R=>R){const R=(...Y)=>b.fire(B(...Y)),j=()=>y.addEventListener(F,R),N=()=>y.removeEventListener(F,R),b=new i({onFirstListenerAdd:j,onLastListenerRemove:N});return b.event}u.fromDOMEventEmitter=w;function v(y){return new Promise(F=>o(y)(F))}u.toPromise=v})(U||(U={}));class k{constructor(u){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${u}_${k._idPool++}`}start(u){this._stopWatch=new X.a(!0),this._listenerCount=u}stop(){if(this._stopWatch){const u=this._stopWatch.elapsed();this._elapsedOverall+=u,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${u.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}k._idPool=0;let G=-1;class W{constructor(u,o=Math.random().toString(18).slice(2,5)){this.customThreshold=u,this.name=o,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(u){let o=G;if(typeof this.customThreshold=="number"&&(o=this.customThreshold),o<=0||u{const h=this._stacks.get(f)||0;this._stacks.set(f,h-1)}}}class i{constructor(u){var o;this._disposed=!1,this._options=u,this._leakageMon=G>0?new W(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((o=this._options)===null||o===void 0?void 0:o._profName)?new k(this._options._profName):void 0}get event(){return this._event||(this._event=(u,o,f)=>{var l;this._listeners||(this._listeners=new P.a);const h=this._listeners.isEmpty();h&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const a=this._listeners.push(o?[u,o]:u);h&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,u,o);const s=(l=this._leakageMon)===null||l===void 0?void 0:l.check(this._listeners.size),A=Object($.i)(()=>{if(s&&s(),!this._disposed&&(a(),this._options&&this._options.onLastListenerRemove)){const E=this._listeners&&!this._listeners.isEmpty();E||this._options.onLastListenerRemove(this)}});return f instanceof $.b?f.add(A):Array.isArray(f)&&f.push(A),A}),this._event}fire(u){var o,f;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new P.a);for(let l of this._listeners)this._deliveryQueue.push([l,u]);for((o=this._perfMon)===null||o===void 0||o.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[l,h]=this._deliveryQueue.shift();try{typeof l=="function"?l.call(void 0,h):l[0].call(l[1],h)}catch(a){Object(re.f)(a)}}(f=this._perfMon)===null||f===void 0||f.stop()}}dispose(){var u,o,f,l,h;this._disposed||(this._disposed=!0,(u=this._listeners)===null||u===void 0||u.clear(),(o=this._deliveryQueue)===null||o===void 0||o.clear(),(l=(f=this._options)===null||f===void 0?void 0:f.onLastListenerRemove)===null||l===void 0||l.call(f),(h=this._leakageMon)===null||h===void 0||h.dispose())}}class D extends i{constructor(u){super(u);this._isPaused=0,this._eventQueue=new P.a,this._mergeFn=u==null?void 0:u.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const u=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(u))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(u){this._listeners&&(this._isPaused!==0?this._eventQueue.push(u):super.fire(u))}}class g extends D{constructor(u){var o;super(u);this._delay=(o=u.delay)!==null&&o!==void 0?o:100}fire(u){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(u)}}class p{constructor(){this.buffers=[]}wrapEvent(u){return(o,f,l)=>u(h=>{const a=this.buffers[this.buffers.length-1];a?a.push(()=>o.call(f,h)):o.call(f,h)},void 0,l)}bufferEvents(u){const o=[];this.buffers.push(o);const f=u();return this.buffers.pop(),o.forEach(l=>l()),f}}class m{constructor(){this.listening=!1,this.inputEvent=U.None,this.inputEventListener=$.a.None,this.emitter=new i({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(u){this.inputEvent=u,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=u(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(ht,be,Z){"use strict";(function(re,$){Z.d(be,"b",function(){return f}),Z.d(be,"i",function(){return s}),Z.d(be,"f",function(){return A}),Z.d(be,"d",function(){return E}),Z.d(be,"g",function(){return S}),Z.d(be,"h",function(){return L}),Z.d(be,"c",function(){return O}),Z.d(be,"k",function(){return C}),Z.d(be,"j",function(){return T}),Z.d(be,"a",function(){return x}),Z.d(be,"e",function(){return v});var P;const X="en";let U=!1,k=!1,G=!1,W=!1,i=!1,D=!1,g=!1,p,m=X,u,o;const f=typeof self=="object"?self:typeof re=="object"?re:{};let l;typeof f.vscode!="undefined"&&typeof f.vscode.process!="undefined"?l=f.vscode.process:typeof $!="undefined"&&(l=$);const h=typeof((P=l==null?void 0:l.versions)===null||P===void 0?void 0:P.electron)=="string"&&l.type==="renderer";if(typeof navigator=="object"&&!h)o=navigator.userAgent,U=o.indexOf("Windows")>=0,k=o.indexOf("Macintosh")>=0,g=(o.indexOf("Macintosh")>=0||o.indexOf("iPad")>=0||o.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,G=o.indexOf("Linux")>=0,D=!0,p=navigator.language,m=p;else if(typeof l=="object"){U=l.platform==="win32",k=l.platform==="darwin",G=l.platform==="linux",W=G&&!!l.env.SNAP&&!!l.env.SNAP_REVISION,p=X,m=X;const y=l.env.VSCODE_NLS_CONFIG;if(y)try{const F=JSON.parse(y),B=F.availableLanguages["*"];p=F.locale,m=B||X,u=F._translationsConfigFile}catch(F){}i=!0}else console.error("Unable to resolve platform.");let a=0;k?a=1:U?a=3:G&&(a=2);const s=U,A=k,E=G,S=i,L=D,O=g,C=o,T=function(){if(f.setImmediate)return f.setImmediate.bind(f);if(typeof f.postMessage=="function"&&!f.importScripts){let B=[];f.addEventListener("message",j=>{if(j.data&&j.data.vscodeSetImmediateId)for(let N=0,b=B.length;N{const N=++R;B.push({id:N,callback:j}),f.postMessage({vscodeSetImmediateId:N},"*")}}if(typeof(l==null?void 0:l.nextTick)=="function")return l.nextTick.bind(l);const F=Promise.resolve();return B=>F.then(B)}(),x=k||g?2:U?1:3;let c=!0,w=!1;function v(){if(!w){w=!0;const y=new Uint8Array(2);y[0]=1,y[1]=2;const F=new Uint16Array(y.buffer);c=F[0]===(2<<8)+1}return c}}).call(this,Z("IyRk"),Z("Q2Ig"))},N0LK:function(ht,be,Z){"use strict";Z.d(be,"C",function(){return re}),Z.d(be,"v",function(){return P}),Z.d(be,"s",function(){return X}),Z.d(be,"t",function(){return U}),Z.d(be,"U",function(){return k}),Z.d(be,"J",function(){return G}),Z.d(be,"O",function(){return W}),Z.d(be,"p",function(){return i}),Z.d(be,"T",function(){return D}),Z.d(be,"q",function(){return g}),Z.d(be,"N",function(){return p}),Z.d(be,"M",function(){return m}),Z.d(be,"Q",function(){return u}),Z.d(be,"u",function(){return o}),Z.d(be,"x",function(){return f}),Z.d(be,"I",function(){return l}),Z.d(be,"f",function(){return h}),Z.d(be,"h",function(){return a}),Z.d(be,"g",function(){return s}),Z.d(be,"i",function(){return A}),Z.d(be,"G",function(){return E}),Z.d(be,"H",function(){return S}),Z.d(be,"r",function(){return L}),Z.d(be,"R",function(){return O}),Z.d(be,"d",function(){return C}),Z.d(be,"e",function(){return T}),Z.d(be,"E",function(){return x}),Z.d(be,"F",function(){return c}),Z.d(be,"j",function(){return w}),Z.d(be,"z",function(){return v}),Z.d(be,"K",function(){return F}),Z.d(be,"L",function(){return B}),Z.d(be,"m",function(){return j}),Z.d(be,"k",function(){return b}),Z.d(be,"A",function(){return ee}),Z.d(be,"a",function(){return ae}),Z.d(be,"n",function(){return ue}),Z.d(be,"l",function(){return Oe}),Z.d(be,"D",function(){return Ee}),Z.d(be,"B",function(){return xe}),Z.d(be,"b",function(){return Ae}),Z.d(be,"S",function(){return Re}),Z.d(be,"o",function(){return pe}),Z.d(be,"P",function(){return he}),Z.d(be,"w",function(){return ke}),Z.d(be,"c",function(){return et}),Z.d(be,"y",function(){return at});function re(se){return!se||typeof se!="string"?!0:se.trim().length===0}const $=/{(\d+)}/g;function P(se,..._e){return _e.length===0?se:se.replace($,function(Te,Se){const Ge=parseInt(Se,10);return isNaN(Ge)||Ge<0||Ge>=_e.length?Te:_e[Ge]})}function X(se){return se.replace(/[<>&]/g,function(_e){switch(_e){case"<":return"<";case">":return">";case"&":return"&";default:return _e}})}function U(se){return se.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function k(se,_e=" "){const Te=G(se,_e);return W(Te,_e)}function G(se,_e){if(!se||!_e)return se;const Te=_e.length;if(Te===0||se.length===0)return se;let Se=0;for(;se.indexOf(_e,Se)===Se;)Se=Se+Te;return se.substring(Se)}function W(se,_e){if(!se||!_e)return se;const Te=_e.length,Se=se.length;if(Te===0||Se===0)return se;let Ge=Se,Ne=-1;for(;!(Ne=se.lastIndexOf(_e,Ge-1),Ne===-1||Ne+Te!==Ge);){if(Ne===0)return"";Ge=Ne}return se.substring(0,Ge)}function i(se){return se.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function D(se){return se.replace(/\*/g,"")}function g(se,_e,Te={}){if(!se)throw new Error("Cannot create regex from empty string");_e||(se=U(se)),Te.wholeWord&&(/\B/.test(se.charAt(0))||(se="\\b"+se),/\B/.test(se.charAt(se.length-1))||(se=se+"\\b"));let Se="";return Te.global&&(Se+="g"),Te.matchCase||(Se+="i"),Te.multiline&&(Se+="m"),Te.unicode&&(Se+="u"),new RegExp(se,Se)}function p(se){if(se.source==="^"||se.source==="^$"||se.source==="$"||se.source==="^\\s*$")return!1;const _e=se.exec("");return!!(_e&&se.lastIndex===0)}function m(se){return(se.global?"g":"")+(se.ignoreCase?"i":"")+(se.multiline?"m":"")+(se.unicode?"u":"")}function u(se){return se.split(/\r\n|\r|\n/)}function o(se){for(let _e=0,Te=se.length;_e=0;Te--){const Se=se.charCodeAt(Te);if(Se!==32&&Se!==9)return Te}return-1}function h(se,_e){return se<_e?-1:se>_e?1:0}function a(se,_e,Te=0,Se=se.length,Ge=0,Ne=_e.length){for(;TeVe)return 1}const Fe=Se-Te,Ke=Ne-Ge;return FeKe?1:0}function s(se,_e){return A(se,_e,0,se.length,0,_e.length)}function A(se,_e,Te=0,Se=se.length,Ge=0,Ne=_e.length){for(;Te=128||Ve>=128)return a(se.toLowerCase(),_e.toLowerCase(),Te,Se,Ge,Ne);E(Je)&&(Je-=32),E(Ve)&&(Ve-=32);const tt=Je-Ve;if(tt===0)continue;return tt}const Fe=Se-Te,Ke=Ne-Ge;return FeKe?1:0}function E(se){return se>=97&&se<=122}function S(se){return se>=65&&se<=90}function L(se,_e){return se.length===_e.length&&A(se,_e)===0}function O(se,_e){const Te=_e.length;return _e.length>se.length?!1:A(se,_e,0,Te)===0}function C(se,_e){let Te,Se=Math.min(se.length,_e.length);for(Te=0;Te1){const Se=se.charCodeAt(_e-2);if(x(Se))return w(Se,Te)}return Te}function F(se,_e){const Te=We.getInstance(),Se=_e,Ge=se.length,Ne=v(se,Ge,_e);_e+=Ne>=65536?2:1;let Fe=Te.getGraphemeBreakType(Ne);for(;_e=65536?2:1,Fe=Je}return _e-Se}function B(se,_e){const Te=We.getInstance(),Se=_e,Ge=y(se,_e);_e-=Ge>=65536?2:1;let Ne=Te.getGraphemeBreakType(Ge);for(;_e>0;){const Fe=y(se,_e),Ke=Te.getGraphemeBreakType(Fe);if(et(Ke,Ne))break;_e-=Fe>=65536?2:1,Ne=Ke}return Se-_e}const R=/(?:[\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 j(se){return R.test(se)}const N=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function b(se){return N.test(se)}const Y=/^[\t\n\r\x20-\x7E]*$/;function ee(se){return Y.test(se)}const ae=/[\u2028\u2029]/;function ue(se){return ae.test(se)}function Oe(se){for(let _e=0,Te=se.length;_e=11904&&se<=55215||se>=63744&&se<=64255||se>=65281&&se<=65374}function xe(se){return se>=127462&&se<=127487||se===8986||se===8987||se===9200||se===9203||se>=9728&&se<=10175||se===11088||se===11093||se>=127744&&se<=128591||se>=128640&&se<=128764||se>=128992&&se<=129003||se>=129280&&se<=129535||se>=129648&&se<=129750}const Ae=String.fromCharCode(65279);function Re(se){return!!(se&&se.length>0&&se.charCodeAt(0)===65279)}function pe(se,_e=!1){return se?(_e&&(se=se.replace(/\\./g,"")),se.toLowerCase()!==se):!1}function he(se){const _e=90-65+1;return se=se%(2*_e),se<_e?String.fromCharCode(97+se):String.fromCharCode(65+se-_e)}function ke(se){const _e=We.getInstance();return _e.getGraphemeBreakType(se)}function et(se,_e){return se===0?_e!==5&&_e!==7:se===2&&_e===3?!1:se===4||se===2||se===3||(_e===4||_e===2||_e===3)?!0:se===8&&(_e===8||_e===9||_e===11||_e===12)||((se===11||se===9)&&(_e===9||_e===10)||((se===12||se===10)&&_e===10||(_e===5||_e===13||(_e===7||(se===1||se===13&&_e===14)))))?!1:!(se===6&&_e===6)}class We{constructor(){this._data=it()}static getInstance(){return We._INSTANCE||(We._INSTANCE=new We),We._INSTANCE}getGraphemeBreakType(se){if(se<32)return se===10?3:se===13?2:4;if(se<127)return 0;const _e=this._data,Te=_e.length/3;let Se=1;for(;Se<=Te;)if(se<_e[3*Se])Se=2*Se;else if(se>_e[3*Se+1])Se=2*Se+1;else return _e[3*Se+2];return 0}}We._INSTANCE=null;function it(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function at(se,_e){if(se===0)return 0;const Te=Pe(se,_e);if(Te!==void 0)return Te;const Se=y(_e,se);return se-=je(Se),se}function Pe(se,_e){let Te=y(_e,se);for(se-=je(Te);$e(Te)||Te===65039||Te===8419;){if(se===0)return;Te=y(_e,se),se-=je(Te)}if(!xe(Te))return;if(se>=0){const Se=y(_e,se);Se===8205&&(se-=je(Se))}return se}function je(se){return se>=65536?2:1}function $e(se){return 127995<=se&&se<=127999}},Ot1p:function(ht,be,Z){"use strict";var re=Z("2qtc"),$=Z("kLXV"),P=Z("rAM+"),X=Z("miYZ"),U=Z("tsqr"),k=Z("9og8"),G=Z("tJVT"),W=Z("jrin"),i=Z("WmNS"),D=Z.n(i),g=Z("q1tI"),p=Z.n(g),m=Z("VrN/"),u=Z.n(m),o=Z("bdgK"),f=Z("p77/"),l=Z("Bd2K"),h=Z("ELLl"),a=Z("19Vz"),s=Z("lZu9"),A=Z("+NIl"),E=Z("kSUc"),S=Z("9Bee"),L=function(ye){var Le=ye.value,Ue=Le===void 0?"":Le,Ze=ye.className,mt=ye.showTextOnly,ft=ye.showLines,Ct=ye.style,xt=Ct===void 0?{}:Ct,Qe=Object(g.useMemo)(function(){return""},[Ue]);return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:Qe}}))},O=Z("0Owb"),C=Z("dejd"),T=Z("C+DQ"),x=Z("1vsH"),c=Z("m3rI"),w=[{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 v(ye){var Le=ye.onActionCallback,Ue=ye.title,Ze=ye.icon,mt=ye.actionName,ft=ye.className,Ct=ft===void 0?"":ft,xt=ye.children;function Qe(){Le(mt)}return p.a.createElement("a",{title:Ue,className:Ct,onClick:Qe},p.a.createElement("i",{className:"md-iconfont ".concat(Ze)}),xt)}var y=function(ye){var Le=ye.watch,Ue=ye.showNullButton,Ze=ye.onActionCallback,mt=ye.fullScreen,ft=ye.insertTemp,Ct=ye.hidetoolBar,xt=ye.uuid,Qe=ye.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(x.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(x.F)("_educoder_session"),"&key=").concat(xt,"&api=").concat(encodeURIComponent(c.a.PROXY_SERVER)));var Lt=[].concat(w,[{title:"".concat(Le?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Le?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return p.a.createElement("ul",{className:"markdown-toolbar-container"},!Ct&&Lt.map(function(vt,Ft){return p.a.createElement("li",{key:Ft},vt.actionName?p.a.createElement(v,Object(O.a)({},vt,{onActionCallback:Ze})):p.a.createElement("span",{className:"v-line"}))}),Ue?p.a.createElement("li",null,p.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ze},p.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ft&&p.a.createElement("li",null,p.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ft),onActionCallback:Ze},p.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),p.a.createElement("li",{className:"btn-full-screen"},p.a.createElement(v,{icon:"".concat(mt?"icon-shrink":"icon-enlarge"),title:mt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Ze})))},F=Z("M8RZ"),B=Z("+L6B"),R=Z("2/Rp"),j=Z("y8nQ"),N=Z("Vl3Y"),b=Z("5NDa"),Y=Z("5rEg"),ee={labelCol:{span:4},wrapperCol:{span:20}},ae=function(ye){var Le=ye.callback,Ue=ye.onCancel;function Ze(mt){Le(mt)}return p.a.createElement(N.a,Object(O.a)({},ee,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ze}),p.a.createElement(N.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},p.a.createElement(Y.a,null)),p.a.createElement(N.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},p.a.createElement(Y.a,null)),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(R.a,{type:"ghost",onClick:Ue},"\u53D6\u6D88")))},ue=Z("7ahc"),Oe=Z("HmJG"),Ee=Z("BjJ7"),xe=N.a.useForm,Ae={width:280,marginRight:10},Re={labelCol:{span:5},wrapperCol:{span:19}},pe=function(ye){var Le=ye.callback,Ue=ye.onCancel,Ze=xe(),mt=Object(G.a)(Ze,1),ft=mt[0];function Ct(Lt){Le(Lt)}function xt(Lt,vt){if(Lt.status===-1){U.b.error(Lt.message);return}ft.setFieldsValue({src:"/api/attachments/".concat(Lt.id),type:vt.type})}function Qe(Lt){var vt=Lt.target.files[0];ke(vt,xt)}return p.a.createElement(N.a,Object(O.a)({form:ft},Re,{className:"upload-image-panel",onFinish:Ct}),p.a.createElement(N.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},p.a.createElement("div",{className:"flex-container"},p.a.createElement(N.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},p.a.createElement(Y.a,{style:Ae})),p.a.createElement(he,{onFileChange:Qe}))),p.a.createElement(N.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},p.a.createElement(Y.a,{style:{width:264}})),p.a.createElement(N.a.Item,{style:{textAlign:"right"}},p.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(R.a,{type:"ghost",onClick:Ue},"\u53D6\u6D88")))};function he(ye){var Le=ye.onFileChange;return p.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",p.a.createElement("input",{type:"file",onChange:Le}))}function ke(ye,Le){if(!ye)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ue=new FormData;Ue.append("editormd-image-file",ye),Ue.append("file_param_name","editormd-image-file"),Ue.append("byxhr","true");var Ze=new window.XMLHttpRequest;Ze.withCredentials=!0,Ze.addEventListener("load",function(mt){Le(JSON.parse(mt.target.responseText),ye)},!1),Ze.addEventListener("error",function(mt){console.error(mt)},!1),Ze.open("POST","".concat(Ee.a,"/api/attachments.json")),Ze.send(Ue)}var et=Z("giR+"),We=Z("fyUT"),it=Z("7Kak"),at=Z("9yH6"),Pe=at.a.Group,je={margin:"0 8px"},$e=function(ye){var Le=ye.callback,Ue=ye.onCancel;function Ze(mt){Le(mt)}return p.a.createElement(N.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ze},p.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},p.a.createElement("span",{style:je},"\u5355\u5143\u683C\u6570\uFF1A"),p.a.createElement("span",{style:je},"\u884C\u6570"),p.a.createElement(N.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},p.a.createElement(We.a,null)),p.a.createElement("span",{style:je},"\u5217\u6570"),p.a.createElement(N.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},p.a.createElement(We.a,null))),p.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},p.a.createElement("span",{style:je},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),p.a.createElement(N.a.Item,{name:"align"},p.a.createElement(Pe,null,p.a.createElement(at.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(at.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(at.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(at.a,{value:"right"},p.a.createElement("i",{className:"fa fa-align-right"}))))),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(R.a,{type:"ghost",onClick:Ue},"\u53D6\u6D88")))},se=Z("ErOA"),_e=Z("7Cbv"),Te="link",Se="upload-image",Ge="code-block",Ne="add-table",Fe="------------",Ke={default:Fe,left:":".concat(Fe),center:":".concat(Fe,":"),right:"".concat(Fe,":")},Je=Z("9VGf"),Ve,tt;function Ie(){}var nt=0,st=1e4,De="\u2581",Me=`
**\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 ve(ye){return/^\d+$/.test(ye)?"".concat(ye,"px"):ye}var ce=navigator.platform.toUpperCase().indexOf("MAC")>=0,fe=ce?"Cmd":"Ctrl",ne=["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"],ie=(Ve={},Object(W.a)(Ve,fe+"-B","bold"),Object(W.a)(Ve,fe+"-I","italic"),Ve),oe=(tt={},Object(W.a)(tt,Te,"\u6DFB\u52A0\u94FE\u63A5"),Object(W.a)(tt,Ge,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(W.a)(tt,Se,"\u6DFB\u52A0\u6587\u4EF6"),Object(W.a)(tt,Ne,"\u6DFB\u52A0\u8868\u683C"),tt),le=be.a=function(ye){var Le=ye.defaultValue,Ue=Le===void 0?"":Le,Ze=ye.onChange,mt=ye.width,ft=mt===void 0?"100%":mt,Ct=ye.height,xt=Ct===void 0?400:Ct,Qe=ye.miniToolbar,Lt=Qe===void 0?!1:Qe,vt=ye.isFocus,Ft=vt===void 0?!1:vt,Pt=ye.watch,Rt=ye.insertTemp,pi=ye.mode,ai=pi===void 0?"markdown":pi,bt=ye.id,ti=bt===void 0?"markdown-editor-id":bt,_t=ye.showResizeBar,Tt=_t===void 0?!1:_t,Wt=ye.noStorage,ii=Wt===void 0?!1:Wt,ui=ye.showNullButton,dt=ui===void 0?!1:ui,ut=ye.hidetoolBar,qt=ut===void 0?!1:ut,Ot=ye.fullScreen,Mt=Ot===void 0?!1:Ot,Dt=ye.onBlur,Ut=ye.onCMBeforeChange,hi=ye.onFullScreen,Yi=ye.className,Ye=Yi===void 0?"":Yi,It=ye.disablePaste,mn=It===void 0?!1:It,gn=ye.placeholder,vn=gn===void 0?"":gn,yn=ye.values,V=yn===void 0?"":yn,_=Object(g.useState)(null),I=Object(G.a)(_,2),H=I[0],q=I[1],z=Object(g.useState)(Ue),ge=Object(G.a)(z,2),He=ge[0],rt=ge[1],gt=Object(g.useState)(Pt),ze=Object(G.a)(gt,2),wt=ze[0],zt=ze[1],ei=Object(g.useState)(Mt),Hi=Object(G.a)(ei,2),Ci=Hi[0],Ai=Hi[1],Zi=Object(g.useState)(""),Dn=Object(G.a)(Zi,2),vi=Dn[0],zi=Dn[1],un=Object(g.useState)(0),hn=Object(G.a)(un,2),Wi=hn[0],kn=hn[1],bn=Object(g.useState)(xt),zn=Object(G.a)(bn,2),Vn=zn[0],Qi=zn[1],$i=Object(g.useState)(!1),_n=Object(G.a)($i,2),dr=_n[0],En=_n[1],oi=Object(g.useRef)(Object(_e.a)()),Vt=Object(g.useRef)(!1),Ti=Object(g.useRef)(),jt=Object(g.useRef)(),di=Object(g.useRef)(),$t=Object(g.useRef)(),rn=Object(g.useRef)(),yi=function(){var yt=Object(k.a)(D.a.mark(function kt(){var St,Bt;return D.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Zt.next=2,Object(se.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:oi.current}});case 2:Bt=Zt.sent,Bt!=null&&(St=Bt.attachments)!==null&&St!==void 0&&St.length&&(console.log("cm:",H,jt),Bt.attachments.map(function(Gt){Gt.content_type.indexOf("image")>-1?H.replaceSelection(".concat(Gt.content_type,")")):Gt.content_type.indexOf("video")>-1?H.replaceSelection('')):Gt.content_type.indexOf("pdf")>-1?H.replaceSelection('').concat(Gt.name,"")):H.replaceSelection("[".concat(Gt.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Gt.content_type,")"))}));case 4:case"end":return Zt.stop()}},kt)}));return function(){return yt.apply(this,arguments)}}();Object(g.useEffect)(function(){rt(V),H==null||H.setValue(V)},[V]),Object(g.useEffect)(function(){hi==null||hi(Ci)},[Ci]),Object(g.useEffect)(function(){if(jt.current){var yt=u.a.fromTextArea(jt.current,{mode:ai,lineNumbers:!Lt,lineWrapping:!0,value:Ue,autoCloseTags:!0,autoCloseBrackets:!0});Ft&&yt.focus();function kt(St,Bt){if(mn){Bt.preventDefault();return}var Kt=Bt.clipboardData;if(Kt){var Zt=Kt.types.toString(),Gt=Kt.items;if(Zt==="Files"||Kt.types.indexOf("Files")>-1){if(Bt.preventDefault(),ai=="stex")return;try{var mi,Mi=Gt[1];((mi=Gt[0])===null||mi===void 0?void 0:mi.kind)==="file"&&(Mi=Gt[0]);var Ht=Mi.getAsFile(),dn=Ht.name.split(".").pop();ke(Ht,function(Xt){if(Xt.id){var Pi,Ri,Ji;(Ht==null||((Pi=Ht.type)===null||Pi===void 0)?void 0:Pi.indexOf("image"))>-1?yt.replaceSelection(".concat(Xt.content_type,")")):(Ht==null||((Ri=Ht.type)===null||Ri===void 0)?void 0:Ri.indexOf("video"))>-1?yt.replaceSelection('')):(Ht==null||((Ji=Ht.type)===null||Ji===void 0)?void 0:Ji.indexOf("pdf"))>-1?yt.replaceSelection('').concat(Ht.name,"")):ne.includes(dn)?yt.replaceSelection('').concat(Ht.name,"")):yt.replaceSelection("[".concat(Ht.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Xt.id,"?type=").concat(Xt.content_type,")"))}else(Xt==null?void 0:Xt.status)===401&&(document.location.href="/user/login")})}catch(Xt){U.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return yt.on("paste",kt),yt.on("dragleave",function(St,Bt){di.current.classList.remove("mouse-hover-md")}),yt.on("dragover",function(St,Bt){di.current.classList.add("mouse-hover-md")}),yt.on("drop",function(St,Bt){di.current.classList.add("mouse-hover-md");var Kt;if(Kt=Bt.dataTransfer.files,Kt.length>0){Bt.preventDefault(),Bt.stopPropagation();for(var Zt=function(Mi){var Ht=Kt[Mi],dn=Ht.name.split(".").pop();ke(Ht,function(Xt){if(Xt.id){var Pi,Ri,Ji;(Ht==null||((Pi=Ht.type)===null||Pi===void 0)?void 0:Pi.indexOf("image"))>-1?yt.replaceSelection(".concat(Xt.content_type,")")):(Ht==null||((Ri=Ht.type)===null||Ri===void 0)?void 0:Ri.indexOf("video"))>-1?yt.replaceSelection('')):(Ht==null||((Ji=Ht.type)===null||Ji===void 0)?void 0:Ji.indexOf("pdf"))>-1?yt.replaceSelection('').concat(Ht.name,"")):ne.includes(dn)?yt.replaceSelection('').concat(Ht.name,"")):yt.replaceSelection("[".concat(Ht.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Xt.id,"?type=").concat(Xt.content_type,")"))}else(Xt==null?void 0:Xt.status)===401&&(document.location.href="/user/login")})},Gt=0;Gt0||Gt.target.offsetWidth>0)&&(Ii(),H.setSize("100%","100%"),H.refresh())}}catch(mi){Kt.e(mi)}finally{Kt.f()}});return St.observe(jt.current.parentElement),St}if(H){var kt=yt();return function(){kt.unobserve(jt.current.parentElement)}}},[H,Ii]),Object(g.useEffect)(function(){if(H){for(var yt=[],kt=function(){var Gt=Bt[St];Kt=Object(G.a)(Gt,2);var mi=Kt[0],Mi=Kt[1],Ht=Object(W.a)({},mi,function(){Xn(Mi)});yt.push(Ht),H.addKeyMap(Ht)},St=0,Bt=Object.entries(ie);St0){var yt=new Date().getTime(),kt=window.sessionStorage.getItem(ti);yt>=Wi+st&&(!kt||kt!==He)&&(window.sessionStorage.setItem(ti,He),En(!0))}},st),Object(g.useEffect)(function(){zt(Pt)},[H,Pt]),Object(g.useEffect)(function(){H&&(Ft&&H.focus())},[H,Ft]),Object(g.useEffect)(function(){if(wt&&H){var yt=H.getScrollerElement();function kt(St){var Bt=St.target;if(rn.current){var Kt=Bt.scrollTop/Bt.scrollHeight;rn.current.scrollTop=rn.current.scrollHeight*Kt}}return yt.addEventListener("scroll",kt),function(){yt.removeEventListener("scroll",kt)}}},[H,wt]),Object(g.useEffect)(function(){if(H&&Ut){function yt(kt,St){Ut(kt,St)}return H.on("beforeChange",yt),function(){H.off("beforeChange",yt)}}},[H,Ut]),Object(g.useEffect)(function(){if(H&&Dt){function yt(){Dt(H.getValue())}return H.on("blur",yt),function(){H.off("blur",yt)}}},[H,Dt]),Object(g.useEffect)(function(){if(H){function yt(kt){var St=kt.getValue();rt(St),kn(new Date().getTime()),kt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ze&&Ze(St)}return H.on("change",yt),function(){H.off("change",yt)}}},[H,Ze]),Object(g.useEffect)(function(){H&&(Ue==null?(H.setValue(""),rt("")):Ue!==H.getValue()&&(H.setValue(Ue),rt(Ue),H.setCursor(H.lineCount(),0)))},[H,Ue]);var Xn=Object(g.useCallback)(function(yt){var kt=H.getCursor(),St=H.getSelection(),Bt=St.split(`
`);switch(yt){case"bold":return H.replaceSelection("**"+St+"**"),St===""&&H.setCursor(kt.line,kt.ch+2),H.focus();case"italic":return H.replaceSelection("*"+St+"*"),St===""&&H.setCursor(kt.line,kt.ch+1),H.focus();case"code":return H.replaceSelection("`"+St+"`"),St===""&&H.setCursor(kt.line,kt.ch+1),H.focus();case"inline-latex":return H.replaceSelection("`$$"+St+"$$`"),St===""&&H.setCursor(kt.line,kt.ch+3),H.focus();case"latex":return H.replaceSelection("```latex\n"+St+"\n```"),H.setCursor(kt.line+1,St.length+1),H.focus();case"line-break":return H.replaceSelection(`
`),H.focus();case"list-ul":return St===""?H.replaceSelection("- "+St):H.replaceSelection(Bt.map(function(Kt){return Kt===""?"":"- ".concat(Kt)}).join(`
`)),H.focus();case"list-ol":return St===""?H.replaceSelection("1. "+St):H.replaceSelection(Bt.map(function(Kt,Zt){return Kt===""?"":"".concat(Zt+1,". ").concat(Kt)}).join(`
`)),H.focus();case"add-null-ch":return St===""&&H.setCursor(kt.line,kt.ch+1),H.replaceSelection(De),H.focus();case"inster-template-1":return St===""&&H.setCursor(kt.line,kt.ch),H.replaceSelection(Me),H.focus();case"eraser":return H.setValue(""),H.focus();case"trigger-watch":return zt(!wt),H.focus();case"trigger-full-screen":return Ai(!Ci),H.focus();case Te:zi(Te);return;case Ge:zi(Ge);return;case Se:zi(Se);return;case Ne:zi(Ne);return;default:throw new Error}},[H,wt,Ci]),xn=Object(g.useCallback)(function(yt){zi("");switch(vi){case Te:var kt=yt.title,St=yt.link;return H.replaceSelection("[".concat(kt,"](").concat(St,")")),H.focus();case Ge:var Bt=yt.language,Kt=yt.content;return H.replaceSelection(["```"+Bt,Kt,"```"].join(`
`)),H.focus();case Se:var Zt=yt.src,Gt=yt.alt;return Gt?H.replaceSelection(".concat(Zt,' "').concat(Gt,'" )')):H.replaceSelection("")),H.focus();case Ne:for(var mi=yt.row,Mi=yt.col,Ht=yt.align,dn=`
`,Xt=0;Xt300&&(mi=300);var Mi=xt+mi+"px";Qi(Mi)}}return yt.addEventListener("mousedown",Bt),document.addEventListener("mousemove",Zt),document.addEventListener("mouseup",Kt),function(){yt.removeEventListener("mousedown",Bt),document.removeEventListener("mousemove",Zt),document.removeEventListener("mouseup",Kt)}}},[H,$t]),Object(g.useEffect)(function(){Qi(xt)},[xt]);var an=ve(ft),fr=ve(Vn),qi={width:an,height:fr},pr=Object(g.useMemo)(function(){if(Wi){var yt=new Date(Wi),kt=yt.getHours(),St=yt.getMinutes(),Bt=yt.getSeconds();return kt=kt<10?"0"+kt:kt,St=St<10?"0"+St:St,Bt=Bt<10?"0"+Bt:Bt,"".concat(kt,":").concat(St,":").concat(Bt)}return 0},[Wi]);function jr(){window.sessionStorage.removeItem(ti),En(!1),kn(0)}function Mn(){En(!1),kn(0),H.setValue(window.sessionStorage.getItem(ti))}function ua(yt,kt){var St=H.getValue();St=St.replace(yt,kt),rt(St),H==null||H.setValue(St)}return p.a.createElement(g.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:di},p.a.createElement("div",{className:"markdown-editor-container ".concat(Ye," ").concat(wt?"on-preview":""," ").concat(Lt?"mini":""," ").concat(Ci?"full-screen":""),style:qi},p.a.createElement(y,{insertTemp:Rt,watch:wt,fullScreen:Ci,showNullButton:dt,onActionCallback:Xn,hidetoolBar:qt,uuid:oi.current,setOpenPhones:function(){Vt.current=!0}}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:jt,placeholder:vn})),wt?p.a.createElement("div",{ref:rn,className:"preview-container"},ai==="stex"&&p.a.createElement(L,{value:He}),ai!=="stex"&&p.a.createElement(S.a,{edit:!0,value:He,replaces:ua})):null))),Tt?p.a.createElement("a",{ref:$t,className:"editor-resize"}):null,p.a.createElement(F.a,null,oe[vi]?p.a.createElement($.a,{centered:!0,title:oe[vi],visible:!0,onCancel:Tn,footer:null,className:"markdown-popup-form"},cr):null))}},SJMd:function(ht,be){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var Z,re,$,P=!1,X,U;window.PR_SHOULD_USE_CONTINUATION=!0;var k,G;(function(){var W=window,i=["break,continue,do,else,for,if,return,while"],D=[i,"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"],g=[D,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],p=[g,"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"],m=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],u=[g,"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"],o="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",f=[g,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],l="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",h=[i,"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"],a=[i,"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"],s=[i,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],A=[p,u,m,f,l,h,a,s],E=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,S="str",L="kwd",O="com",C="typ",T="lit",x="pun",c="pln",w="tag",v="dec",y="src",F="atn",B="atv",R="nocode",j="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function N(Pe){for(var je=0,$e=!1,se=!1,_e=0,Te=Pe.length;_e122||(ne<65||fe>90||nt.push([Math.max(65,fe)|32,Math.min(ne,90)|32]),ne<97||fe>122||nt.push([Math.max(97,fe)&~32,Math.min(ne,122)&~32]))}}nt.sort(function(ye,Le){return ye[0]-Le[0]||Le[1]-ye[1]});for(var ie=[],oe=[],Me=0;Mele[0]&&(le[1]+1>le[0]&&De.push("-"),De.push(Fe(le[1])))}return De.push("]"),De.join("")}function Je(tt){for(var Ie=tt.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")),nt=Ie.length,st=[],De=0,Me=0;De=2&&fe==="["?Ie[De]=Ke(ve):fe!=="\\"&&(Ie[De]=ve.replace(/[a-zA-Z]/g,function(oe){var le=oe.charCodeAt(0);return"["+String.fromCharCode(le&~32,le|32)+"]"}))}return Ie.join("")}for(var Ve=[],_e=0,Te=Pe.length;_e=0;)$e[Ve.charAt(tt)]=Je;var Ie=Je[1],nt=""+Ie;Ne.hasOwnProperty(nt)||(Ge.push(Ie),Ne[nt]=null)}Ge.push(/[\0-\uffff]/),se=N(Ge)})();var _e=je.length,Te=function(Se){for(var Ge=Se.sourceCode,Ne=Se.basePos,Fe=Se.sourceNode,Ke=[Ne,c],Je=0,Ve=Ge.match(se)||[],tt={},Ie=0,nt=Ve.length;Ie=5&&De.substring(0,5)==="lang-",ve&&!(Me&&typeof Me[1]=="string")&&(ve=!1,De=y),ve||(tt[st]=De)}var ne=Je;if(Je+=st.length,!ve)Ke.push(Ne+ne,De);else{var ie=Me[1],oe=st.indexOf(ie),le=oe+ie.length;Me[2]&&(le=st.length-Me[2].length,oe=le-ie.length);var ye=De.substring(5);Y(Fe,Ne+ne,st.substring(0,oe),Te,Ke),Y(Fe,Ne+ne+oe,ie,he(ye,ie),Ke),Y(Fe,Ne+ne+le,st.substring(le),Te,Ke)}}Se.decorations=Ke};return Te}function Oe(Pe){var je=[],$e=[];Pe.tripleQuotedStrings?je.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Pe.multiLineStrings?je.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):je.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Pe.verbatimStrings&&$e.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var se=Pe.hashComments;se&&(Pe.cStyleComments?(se>1?je.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):je.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),$e.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):je.push([O,/^#[^\r\n]*/,null,"#"])),Pe.cStyleComments&&($e.push([O,/^\/\/[^\r\n]*/,null]),$e.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var _e=Pe.regexLiterals;if(_e){var Te=_e>1?"":`
\r`,Se=Te?".":"[\\S\\s]",Ge="/(?=[^/*"+Te+"])(?:[^/\\x5B\\x5C"+Te+"]|\\x5C"+Se+"|\\x5B(?:[^\\x5C\\x5D"+Te+"]|\\x5C"+Se+")*(?:\\x5D|$))+/";$e.push(["lang-regex",RegExp("^"+j+"("+Ge+")")])}var Ne=Pe.types;Ne&&$e.push([C,Ne]);var Fe=(""+Pe.keywords).replace(/^ | $/g,"");Fe.length&&$e.push([L,new RegExp("^(?:"+Fe.replace(/[\s,]+/g,"|")+")\\b"),null]),je.push([c,/^\s+/,null,` \r
\xA0`]);var Ke="^.[^\\s\\w.$@'\"`/\\\\]*";return Pe.regexLiterals&&(Ke+="(?!s*/)"),$e.push([T,/^@[a-z_$][a-z_$@0-9]*/i,null],[C,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[a-z_$][a-z_$@0-9]*/i,null],[T,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[c,/^\\[\s\S]?/,null],[x,new RegExp(Ke),null]),ue(je,$e)}var Ee=Oe({keywords:A,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function xe(Pe,je,$e){for(var se=/(?:^|\s)nocode(?:\s|$)/,_e=/\r\n?|\n/,Te=Pe.ownerDocument,Se=Te.createElement("li");Pe.firstChild;)Se.appendChild(Pe.firstChild);var Ge=[Se];function Ne(Ie){var nt=Ie.nodeType;if(nt==1&&!se.test(Ie.className))if(Ie.nodeName==="br")Fe(Ie),Ie.parentNode&&Ie.parentNode.removeChild(Ie);else for(var st=Ie.firstChild;st;st=st.nextSibling)Ne(st);else if((nt==3||nt==4)&&$e){var De=Ie.nodeValue,Me=De.match(_e);if(Me){var ve=De.substring(0,Me.index);Ie.nodeValue=ve;var ce=De.substring(Me.index+Me[0].length);if(ce){var fe=Ie.parentNode;fe.insertBefore(Te.createTextNode(ce),Ie.nextSibling)}Fe(Ie),ve||Ie.parentNode.removeChild(Ie)}}}function Fe(Ie){for(;!Ie.nextSibling;)if(Ie=Ie.parentNode,!Ie)return;function nt(Me,ve){var ce=ve?Me.cloneNode(!1):Me,fe=Me.parentNode;if(fe){var ne=nt(fe,1),ie=Me.nextSibling;ne.appendChild(ce);for(var oe=ie;oe;oe=ie)ie=oe.nextSibling,ne.appendChild(oe)}return ce}for(var st=nt(Ie.nextSibling,0),De;(De=st.parentNode)&&De.nodeType===1;)st=De;Ge.push(st)}for(var Ke=0;Ke=fe&&(Ne+=2),Te>=ne&&(Je+=2)}}finally{De&&(De.style.display=Me)}}var Re={};function pe(Pe,je){for(var $e=je.length;--$e>=0;){var se=je[$e];Re.hasOwnProperty(se)?W.console&&console.warn("cannot override language handler %s",se):Re[se]=Pe}}function he(Pe,je){return Pe&&Re.hasOwnProperty(Pe)||(Pe=/^\s*]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[x,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^