(window.webpackJsonp=window.webpackJsonp||[]).push([[254,5,6,7],{"+NIl":function(_t,ot,le){(function(ue){ue(le("VrN/"))})(function(ue){"use strict";ue.defineMode("stex",function(Z,M){"use strict";function Q(h,s){h.cmdState.push(s)}function B(h){return h.cmdState.length>0?h.cmdState[h.cmdState.length-1]:null}function N(h){var s=h.cmdState.pop();s&&s.closeBracket()}function K(h){for(var s=h.cmdState,u=s.length-1;u>=0;u--){var l=s[u];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function W(h,s,u){return function(){this.name=h,this.bracketNo=0,this.style=s,this.styles=u,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var P={};P.importmodule=W("importmodule","tag",["string","builtin"]),P.documentclass=W("documentclass","tag",["","atom"]),P.usepackage=W("usepackage","tag",["atom"]),P.begin=W("begin","tag",["atom"]),P.end=W("end","tag",["atom"]),P.label=W("label","tag",["atom"]),P.ref=W("ref","tag",["atom"]),P.eqref=W("eqref","tag",["atom"]),P.cite=W("cite","tag",["atom"]),P.bibitem=W("bibitem","tag",["atom"]),P.Bibitem=W("Bibitem","tag",["atom"]),P.RBibitem=W("RBibitem","tag",["atom"]),P.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function R(h,s){h.f=s}function m(h,s){var u;if(h.match(/^\\[a-zA-Z@]+/)){var l=h.current().slice(1);return u=P.hasOwnProperty(l)?P[l]:P.DEFAULT,u=new u,Q(s,u),R(s,f),u.style}if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/\\]/))return"tag";if(h.match("\\["))return R(s,function(o,c){return p(o,c,"\\]")}),"keyword";if(h.match("\\("))return R(s,function(o,c){return p(o,c,"\\)")}),"keyword";if(h.match("$$"))return R(s,function(o,c){return p(o,c,"$$")}),"keyword";if(h.match("$"))return R(s,function(o,c){return p(o,c,"$")}),"keyword";var a=h.next();if(a=="%")return h.skipToEnd(),"comment";if(a=="}"||a=="]"){if(u=B(s),u)u.closeBracket(a),R(s,f);else return"error";return"bracket"}else return a=="{"||a=="["?(u=P.DEFAULT,u=new u,Q(s,u),"bracket"):/\d/.test(a)?(h.eatWhile(/[\w.%]/),"atom"):(h.eatWhile(/[\w\-_]/),u=K(s),u.name=="begin"&&(u.argument=h.current()),u.styleIdentifier())}function p(h,s,u){if(h.eatSpace())return null;if(u&&h.match(u))return R(s,m),"keyword";if(h.match(/^\\[a-zA-Z@]+/))return"tag";if(h.match(/^[a-zA-Z]+/))return"variable-2";if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/]/))return"tag";if(h.match(/^[\^_&]/))return"tag";if(h.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(h.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var l=h.next();return l=="{"||l=="}"||l=="["||l=="]"||l=="("||l==")"?"bracket":l=="%"?(h.skipToEnd(),"comment"):"error"}function f(h,s){var u=h.peek(),l;return u=="{"||u=="["?(l=B(s),l.openBracket(u),h.eat(u),R(s,m),"bracket"):/[ \t\r]/.test(u)?(h.eat(u),null):(R(s,m),N(s),m(h,s))}return{startState:function(){var h=M.inMathMode?function(s,u){return p(s,u)}:m;return{cmdState:[],f:h}},copyState:function(h){return{cmdState:h.cmdState.slice(),f:h.f}},token:function(h,s){return s.f(h,s)},blankLine:function(h){h.f=m,h.cmdState.length=0},lineComment:"%"}}),ue.defineMIME("text/x-stex","stex"),ue.defineMIME("text/x-latex","stex")})},"+ua5":function(_t,ot,le){},"19Vz":function(_t,ot,le){(function(ue){ue(le("VrN/"))})(function(ue){ue.defineOption("placeholder","",function(W,P,R){var m=R&&R!=ue.Init;if(P&&!m)W.on("blur",B),W.on("change",N),W.on("swapDoc",N),ue.on(W.getInputField(),"compositionupdate",W.state.placeholderCompose=function(){Q(W)}),N(W);else if(!P&&m){W.off("blur",B),W.off("change",N),W.off("swapDoc",N),ue.off(W.getInputField(),"compositionupdate",W.state.placeholderCompose),Z(W);var p=W.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}P&&!W.hasFocus()&&B(W)});function Z(W){W.state.placeholder&&(W.state.placeholder.parentNode.removeChild(W.state.placeholder),W.state.placeholder=null)}function M(W){Z(W);var P=W.state.placeholder=document.createElement("pre");P.style.cssText="height: 0; overflow: visible",P.style.direction=W.getOption("direction"),P.className="CodeMirror-placeholder CodeMirror-line-like";var R=W.getOption("placeholder");typeof R=="string"&&(R=document.createTextNode(R)),P.appendChild(R),W.display.lineSpace.insertBefore(P,W.display.lineSpace.firstChild)}function Q(W){setTimeout(function(){var P=!1,R=W.getInputField();R.nodeName=="TEXTAREA"?P=!R.value:W.lineCount()==1&&(P=!/[^\u200b]/.test(R.querySelector(".CodeMirror-line").textContent)),P?M(W):Z(W)},20)}function B(W){K(W)&&M(W)}function N(W){var P=W.getWrapperElement(),R=K(W);P.className=P.className.replace(" CodeMirror-empty","")+(R?" CodeMirror-empty":""),R?M(W):Z(W)}function K(W){return W.lineCount()===1&&W.getLine(0)===""}})},"1eCo":function(_t,ot,le){(function(ue){ue(le("VrN/"))})(function(ue){"use strict";var Z={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},M={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ue.defineMode("xml",function(Q,B){var N=Q.indentUnit,K={},W=B.htmlMode?Z:M;for(var P in W)K[P]=W[P];for(var P in B)K[P]=B[P];var R,m;function p(d,b){function g(D){return b.tokenize=D,D(d,b)}var _=d.next();if(_=="<")return d.eat("!")?d.eat("[")?d.match("CDATA[")?g(s("atom","]]>")):null:d.match("--")?g(s("comment","-->")):d.match("DOCTYPE",!0,!0)?(d.eatWhile(/[\w\._\-]/),g(u(1))):null:d.eat("?")?(d.eatWhile(/[\w\._\-]/),b.tokenize=s("meta","?>"),"meta"):(R=d.eat("/")?"closeTag":"openTag",b.tokenize=f,"tag bracket");if(_=="&"){var F;return d.eat("#")?d.eat("x")?F=d.eatWhile(/[a-fA-F\d]/)&&d.eat(";"):F=d.eatWhile(/[\d]/)&&d.eat(";"):F=d.eatWhile(/[\w\.\-:]/)&&d.eat(";"),F?"atom":"error"}else return d.eatWhile(/[^&<]/),null}p.isInText=!0;function f(d,b){var g=d.next();if(g==">"||g=="/"&&d.eat(">"))return b.tokenize=p,R=g==">"?"endTag":"selfcloseTag","tag bracket";if(g=="=")return R="equals",null;if(g=="<"){b.tokenize=p,b.state=c,b.tagName=b.tagStart=null;var _=b.tokenize(d,b);return _?_+" tag error":"tag error"}else return/[\'\"]/.test(g)?(b.tokenize=h(g),b.stringStartCol=d.column(),b.tokenize(d,b)):(d.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(d){var b=function(g,_){for(;!g.eol();)if(g.next()==d){_.tokenize=f;break}return"string"};return b.isInAttribute=!0,b}function s(d,b){return function(g,_){for(;!g.eol();){if(g.match(b)){_.tokenize=p;break}g.next()}return d}}function u(d){return function(b,g){for(var _;(_=b.next())!=null;){if(_=="<")return g.tokenize=u(d+1),g.tokenize(b,g);if(_==">")if(d==1){g.tokenize=p;break}else return g.tokenize=u(d-1),g.tokenize(b,g)}return"meta"}}function l(d,b,g){this.prev=d.context,this.tagName=b,this.indent=d.indented,this.startOfLine=g,(K.doNotIndent.hasOwnProperty(b)||d.context&&d.context.noIndent)&&(this.noIndent=!0)}function a(d){d.context&&(d.context=d.context.prev)}function o(d,b){for(var g;;){if(!d.context)return;if(g=d.context.tagName,!K.contextGrabbers.hasOwnProperty(g)||!K.contextGrabbers[g].hasOwnProperty(b))return;a(d)}}function c(d,b,g){return d=="openTag"?(g.tagStart=b.column(),L):d=="closeTag"?w:c}function L(d,b,g){return d=="word"?(g.tagName=b.current(),m="tag",A):K.allowMissingTagName&&d=="endTag"?(m="tag bracket",A(d,b,g)):(m="error",L)}function w(d,b,g){if(d=="word"){var _=b.current();return g.context&&g.context.tagName!=_&&K.implicitlyClosed.hasOwnProperty(g.context.tagName)&&a(g),g.context&&g.context.tagName==_||K.matchClosing===!1?(m="tag",T):(m="tag error",O)}else return K.allowMissingTagName&&d=="endTag"?(m="tag bracket",T(d,b,g)):(m="error",O)}function T(d,b,g){return d!="endTag"?(m="error",T):(a(g),c)}function O(d,b,g){return m="error",T(d,b,g)}function A(d,b,g){if(d=="word")return m="attribute",x;if(d=="endTag"||d=="selfcloseTag"){var _=g.tagName,F=g.tagStart;return g.tagName=g.tagStart=null,d=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(_)?o(g,_):(o(g,_),g.context=new l(g,_,F==g.indented)),c}return m="error",A}function x(d,b,g){return d=="equals"?S:(K.allowMissing||(m="error"),A(d,b,g))}function S(d,b,g){return d=="string"?E:d=="word"&&K.allowUnquoted?(m="string",A):(m="error",A(d,b,g))}function E(d,b,g){return d=="string"?E:A(d,b,g)}return{startState:function(d){var b={tokenize:p,state:c,indented:d||0,tagName:null,tagStart:null,context:null};return d!=null&&(b.baseIndent=d),b},token:function(d,b){if(!b.tagName&&d.sol()&&(b.indented=d.indentation()),d.eatSpace())return null;R=null;var g=b.tokenize(d,b);return(g||R)&&g!="comment"&&(m=null,b.state=b.state(R||g,d,b),m&&(g=m=="error"?g+" error":m)),g},indent:function(d,b,g){var _=d.context;if(d.tokenize.isInAttribute)return d.tagStart==d.indented?d.stringStartCol+1:d.indented+N;if(_&&_.noIndent)return ue.Pass;if(d.tokenize!=f&&d.tokenize!=p)return g?g.match(/^(\s*)/)[0].length:0;if(d.tagName)return K.multilineTagIndentPastTag!==!1?d.tagStart+d.tagName.length+2:d.tagStart+N*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/$/,blockCommentStart:"",configuration:K.htmlMode?"html":"xml",helperType:K.htmlMode?"html":"xml",skipAttribute:function(d){d.state==S&&(d.state=A)},xmlCurrentTag:function(d){return d.tagName?{name:d.tagName,close:d.type=="closeTag"}:null},xmlCurrentContext:function(d){for(var b=[],g=d.context;g;g=g.prev)g.tagName&&b.push(g.tagName);return b.reverse()}}}),ue.defineMIME("text/xml","xml"),ue.defineMIME("application/xml","xml"),ue.mimeModes.hasOwnProperty("text/html")||ue.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"5VLF":function(_t,ot,le){"use strict";var ue,Z;function M(Q,B,N){var K=function(W,P){return Q.js_beautify(W,P)};return K.js=Q.js_beautify,K.css=B.css_beautify,K.html=N.html_beautify,K.js_beautify=Q.js_beautify,K.css_beautify=B.css_beautify,K.html_beautify=N.html_beautify,K}!(ue=[le("6UM0"),le("TXwP"),le("psGv")],Z=function(Q,B,N){return M(Q,B,N)}.apply(ot,ue),Z!==void 0&&(_t.exports=Z))},"6UM0":function(_t,ot,le){var ue,Z;(function(){var M;(function(){"use strict";var B=[function(P,R,m){var p=m(1).Beautifier,f=m(5).Options;function h(s,u){var l=new p(s,u);return l.beautify()}P.exports=h,P.exports.defaultOptions=function(){return new f}},function(P,R,m){var p=m(2).Output,f=m(3).Token,h=m(4),s=m(5).Options,u=m(7).Tokenizer,l=m(7).line_starters,a=m(7).positionable_operators,o=m(7).TOKEN;function c(y,G){return G.indexOf(y)!==-1}function L(y){return y.replace(/^\s+/g,"")}function w(y){for(var G={},Y=0;YY&&(Y=y.line_indent_level));var ie={mode:G,parent:y,last_token:y?y.last_token:new f(o.START_BLOCK,""),last_word:y?y.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:Y,alignment:0,line_indent_level:y?y.line_indent_level:Y,start_line_index:this._output.get_line_number(),ternary_depth:0};return ie},H.prototype._reset=function(y){var G=y.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new p(this._options,G),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(d.BlockStatement);var Y=new u(y,this._options);return this._tokens=Y.tokenize(),y},H.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var y,G=this._reset(this._source_text),Y=this._options.eol;this._options.eol==="auto"&&(Y=`
`,G&&h.lineBreak.test(G||"")&&(Y=G.match(h.lineBreak)[0]));for(var ie=this._tokens.next();ie;)this.handle_token(ie),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ie,ie=this._tokens.next();return y=this._output.get_code(Y),y},H.prototype.handle_token=function(y,G){y.type===o.START_EXPR?this.handle_start_expr(y):y.type===o.END_EXPR?this.handle_end_expr(y):y.type===o.START_BLOCK?this.handle_start_block(y):y.type===o.END_BLOCK?this.handle_end_block(y):y.type===o.WORD?this.handle_word(y):y.type===o.RESERVED?this.handle_word(y):y.type===o.SEMICOLON?this.handle_semicolon(y):y.type===o.STRING?this.handle_string(y):y.type===o.EQUALS?this.handle_equals(y):y.type===o.OPERATOR?this.handle_operator(y):y.type===o.COMMA?this.handle_comma(y):y.type===o.BLOCK_COMMENT?this.handle_block_comment(y,G):y.type===o.COMMENT?this.handle_comment(y,G):y.type===o.DOT?this.handle_dot(y):y.type===o.EOF?this.handle_eof(y):y.type===o.UNKNOWN?this.handle_unknown(y,G):this.handle_unknown(y,G)},H.prototype.handle_whitespace_and_comments=function(y,G){var Y=y.newlines,ie=this._options.keep_array_indentation&&_(this._flags.mode);if(y.comments_before)for(var se=y.comments_before.next();se;)this.handle_whitespace_and_comments(se,G),this.handle_token(se,G),se=y.comments_before.next();if(ie)for(var we=0;we0,G);else if(this._options.max_preserve_newlines&&Y>this._options.max_preserve_newlines&&(Y=this._options.max_preserve_newlines),this._options.preserve_newlines&&Y>1){this.print_newline(!1,G);for(var ve=1;ve0&&(!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))},H.prototype.set_mode=function(y){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,y),this._flags=this.create_flags(this._previous_flags,y),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},H.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===d.Statement&&b(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},H.prototype.start_of_object_property=function(){return this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"]))},H.prototype.start_of_statement=function(y){var G=!1;return G=G||O(this._flags.last_token,["var","let","const"])&&y.type===o.WORD,G=G||T(this._flags.last_token,"do"),G=G||!(this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement)&&O(this._flags.last_token,k)&&!y.newlines,G=G||T(this._flags.last_token,"else")&&!(T(y,"if")&&!y.comments_before),G=G||this._flags.last_token.type===o.END_EXPR&&(this._previous_flags.mode===d.ForInitializer||this._previous_flags.mode===d.Conditional),G=G||this._flags.last_token.type===o.WORD&&this._flags.mode===d.BlockStatement&&!this._flags.in_case&&!(y.text==="--"||y.text==="++")&&this._last_last_text!=="function"&&y.type!==o.WORD&&y.type!==o.RESERVED,G=G||this._flags.mode===d.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"])),G?(this.set_mode(d.Statement),this.indent(),this.handle_whitespace_and_comments(y,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y,O(y,["do","for","if","while"])),!0):!1},H.prototype.handle_start_expr=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y);var G=d.Expression;if(y.text==="["){if(this._flags.last_token.type===o.WORD||this._flags.last_token.text===")"){O(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(y),this.set_mode(G),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}G=d.ArrayLiteral,_(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())),c(this._flags.last_token.type,[o.START_EXPR,o.END_EXPR,o.WORD,o.OPERATOR,o.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===o.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,G=d.ForInitializer):c(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,G=d.Conditional):c(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&y.whitespace_before===""?this._output.space_before_token=!1:(c(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===o.EQUALS||this._flags.last_token.type===o.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y);else if(this._flags.last_token.type===o.WORD){this._output.space_before_token=!1;var Y=this._tokens.peek(-3);if(this._options.space_after_named_function&&Y){var ie=this._tokens.peek(-4);O(Y,["async","function"])||Y.text==="*"&&O(ie,["async","function"])?this._output.space_before_token=!0:this._flags.mode===d.ObjectLiteral?(Y.text==="{"||Y.text===","||Y.text==="*"&&(ie.text==="{"||ie.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(y);(this._flags.last_token.type===o.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(c(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&c(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===o.START_BLOCK?this.print_newline():(this._flags.last_token.type===o.END_EXPR||this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===o.COMMA)&&this.allow_wrap_or_preserved_newline(y,y.newlines),this.print_token(y),this.set_mode(G),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},H.prototype.handle_end_expr=function(y){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(y),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(y,y.text==="]"&&_(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===o.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(y),this.restore_mode(),b(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===d.Conditional&&(this._previous_flags.mode=d.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},H.prototype.handle_start_block=function(y){this.handle_whitespace_and_comments(y);var G=this._tokens.peek(),Y=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===o.END_EXPR?(this.set_mode(d.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(d.BlockStatement):Y&&(c(Y.text,[":",","])&&c(G.type,[o.STRING,o.WORD,o.RESERVED])||c(G.text,["get","set","..."])&&c(Y.type,[o.WORD,o.RESERVED]))?c(this._last_last_text,["class","interface"])&&!c(Y.text,[":",","])?this.set_mode(d.BlockStatement):this.set_mode(d.ObjectLiteral):this._flags.last_token.type===o.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(d.BlockStatement):c(this._flags.last_token.type,[o.EQUALS,o.START_EXPR,o.COMMA,o.OPERATOR])||O(this._flags.last_token,["return","throw","import","default"])?this.set_mode(d.ObjectLiteral):this.set_mode(d.BlockStatement),this._flags.last_token&&(O(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ie=!G.comments_before&&G.text==="}",se=ie&&this._flags.last_word==="function"&&this._flags.last_token.type===o.END_EXPR;if(this._options.brace_preserve_inline){var we=0,ve=null;this._flags.inline_frame=!0;do if(we+=1,ve=this._tokens.peek(we-1),ve.newlines){this._flags.inline_frame=!1;break}while(ve.type!==o.EOF&&!(ve.type===o.END_BLOCK&&ve.opened===y))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&y.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==o.OPERATOR&&(se||this._flags.last_token.type===o.EQUALS||O(this._flags.last_token,A)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(_(this._previous_flags.mode)&&(this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.COMMA)&&((this._flags.last_token.type===o.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(y),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==o.OPERATOR&&this._flags.last_token.type!==o.START_EXPR&&(this._flags.last_token.type===o.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(y),this.indent(),!ie&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},H.prototype.handle_end_block=function(y){for(this.handle_whitespace_and_comments(y);this._flags.mode===d.Statement;)this.restore_mode();var G=this._flags.last_token.type===o.START_BLOCK;this._flags.inline_frame&&!G?this._output.space_before_token=!0:this._options.brace_style==="expand"?G||this.print_newline():G||(_(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(y)},H.prototype.handle_word=function(y){if(y.type===o.RESERVED){if(c(y.text,["set","get"])&&this._flags.mode!==d.ObjectLiteral)y.type=o.WORD;else if(y.text==="import"&&c(this._tokens.peek().text,["(","."]))y.type=o.WORD;else if(c(y.text,["as","from"])&&!this._flags.import_block)y.type=o.WORD;else if(this._flags.mode===d.ObjectLiteral){var G=this._tokens.peek();G.text===":"&&(y.type=o.WORD)}}if(this.start_of_statement(y)?O(this._flags.last_token,["var","let","const"])&&y.type===o.WORD&&(this._flags.declaration_statement=!0):y.newlines&&!F(this._flags.mode)&&(this._flags.last_token.type!==o.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==o.EQUALS&&(this._options.preserve_newlines||!O(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(y),this.print_newline()):this.handle_whitespace_and_comments(y),this._flags.do_block&&!this._flags.do_while)if(T(y,"while")){this._output.space_before_token=!0,this.print_token(y),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&&T(y,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===d.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&O(y,["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(y),this._flags.in_case=!0;return}if((this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.EQUALS||this._flags.last_token.type===o.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y)),T(y,"function")){(c(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(c(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===o.OPERATOR))&&(!this._output.just_added_blankline()&&!y.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD?O(this._flags.last_token,["get","set","new","export"])||O(this._flags.last_token,k)?this._output.space_before_token=!0:T(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===o.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(F(this._flags.mode)||_(this._flags.mode))||this.print_newline(),this.print_token(y),this._flags.last_word=y.text;return}var Y="NONE";if(this._flags.last_token.type===o.END_BLOCK?this._previous_flags.inline_frame?Y="SPACE":O(y,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&y.newlines?Y="NEWLINE":(Y="SPACE",this._output.space_before_token=!0):Y="NEWLINE":this._flags.last_token.type===o.SEMICOLON&&this._flags.mode===d.BlockStatement?Y="NEWLINE":this._flags.last_token.type===o.SEMICOLON&&F(this._flags.mode)?Y="SPACE":this._flags.last_token.type===o.STRING?Y="NEWLINE":this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD||this._flags.last_token.text==="*"&&(c(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&c(this._last_last_text,["{",","]))?Y="SPACE":this._flags.last_token.type===o.START_BLOCK?this._flags.inline_frame?Y="SPACE":Y="NEWLINE":this._flags.last_token.type===o.END_EXPR&&(this._output.space_before_token=!0,Y="NEWLINE"),O(y,l)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Y="SPACE":Y="NEWLINE"),O(y,["else","catch","finally"]))if((!(this._flags.last_token.type===o.END_BLOCK&&this._previous_flags.mode===d.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&y.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ie=this._output.current_line;ie.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Y==="NEWLINE"?O(this._flags.last_token,A)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&O(y,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==o.END_EXPR?(this._flags.last_token.type!==o.START_EXPR||!O(y,["var","let","const"]))&&this._flags.last_token.text!==":"&&(T(y,"if")&&T(y.previous,"else")?this._output.space_before_token=!0:this.print_newline()):O(y,l)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&_(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Y==="SPACE"&&(this._output.space_before_token=!0);y.previous&&(y.previous.type===o.WORD||y.previous.type===o.RESERVED)&&(this._output.space_before_token=!0),this.print_token(y),this._flags.last_word=y.text,y.type===o.RESERVED&&(y.text==="do"?this._flags.do_block=!0:y.text==="if"?this._flags.if_block=!0:y.text==="import"?this._flags.import_block=!0:this._flags.import_block&&T(y,"from")&&(this._flags.import_block=!1))},H.prototype.handle_semicolon=function(y){this.start_of_statement(y)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(y);for(var G=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&T(G,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(y)},H.prototype.handle_string=function(y){y.text.startsWith("`")&&y.newlines===0&&y.whitespace_before===""&&(y.previous.text===")"||this._flags.last_token.type===o.WORD)||(this.start_of_statement(y)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(y),this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.EQUALS||this._flags.last_token.type===o.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y):y.text.startsWith("`")&&this._flags.last_token.type===o.END_EXPR&&(y.previous.text==="]"||y.previous.text===")")&&y.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(y)},H.prototype.handle_equals=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0},H.prototype.handle_comma=function(y){this.handle_whitespace_and_comments(y,!0),this.print_token(y),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(y)):this._flags.mode===d.ObjectLiteral||this._flags.mode===d.Statement&&this._flags.parent.mode===d.ObjectLiteral?(this._flags.mode===d.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(y)},H.prototype.handle_operator=function(y){var G=y.text==="*"&&(O(this._flags.last_token,["function","yield"])||c(this._flags.last_token.type,[o.START_BLOCK,o.COMMA,o.END_BLOCK,o.SEMICOLON])),Y=c(y.text,["-","+"])&&(c(this._flags.last_token.type,[o.START_BLOCK,o.START_EXPR,o.EQUALS,o.OPERATOR])||c(this._flags.last_token.text,l)||this._flags.last_token.text===",");if(!this.start_of_statement(y)){var ie=!G;this.handle_whitespace_and_comments(y,ie)}if(y.text==="*"&&this._flags.last_token.type===o.DOT){this.print_token(y);return}if(y.text==="::"){this.print_token(y);return}if(this._flags.last_token.type===o.OPERATOR&&c(this._options.operator_position,E)&&this.allow_wrap_or_preserved_newline(y),y.text===":"&&this._flags.in_case){this.print_token(y),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==o.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 se=!0,we=!0,ve=!1;if(y.text===":"?this._flags.ternary_depth===0?se=!1:(this._flags.ternary_depth-=1,ve=!0):y.text==="?"&&(this._flags.ternary_depth+=1),!Y&&!G&&this._options.preserve_newlines&&c(y.text,a)){var Se=y.text===":",Ce=Se&&ve,pe=Se&&!ve;switch(this._options.operator_position){case S.before_newline:this._output.space_before_token=!pe,this.print_token(y),(!Se||Ce)&&this.allow_wrap_or_preserved_newline(y),this._output.space_before_token=!0;return;case S.after_newline:this._output.space_before_token=!0,!Se||Ce?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(y):this._output.space_before_token=!1,this.print_token(y),this._output.space_before_token=!0;return;case S.preserve_newline:pe||this.allow_wrap_or_preserved_newline(y),se=!(this._output.just_added_newline()||pe),this._output.space_before_token=se,this.print_token(y),this._output.space_before_token=!0;return}}if(G){this.allow_wrap_or_preserved_newline(y),se=!1;var fe=this._tokens.peek();we=fe&&c(fe.type,[o.WORD,o.RESERVED])}else if(y.text==="...")this.allow_wrap_or_preserved_newline(y),se=this._flags.last_token.type===o.START_BLOCK,we=!1;else if(c(y.text,["--","++","!","~"])||Y){if((this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR)&&this.allow_wrap_or_preserved_newline(y),se=!1,we=!1,y.newlines&&(y.text==="--"||y.text==="++"||y.text==="~")){var oe=O(this._flags.last_token,A)&&y.newlines;oe&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(oe,!0)}this._flags.last_token.text===";"&&F(this._flags.mode)&&(se=!0),this._flags.last_token.type===o.RESERVED?se=!0:this._flags.last_token.type===o.END_EXPR?se=!(this._flags.last_token.text==="]"&&(y.text==="--"||y.text==="++")):this._flags.last_token.type===o.OPERATOR&&(se=c(y.text,["--","-","++","+"])&&c(this._flags.last_token.text,["--","-","++","+"]),c(y.text,["+","-"])&&c(this._flags.last_token.text,["--","++"])&&(we=!0)),(this._flags.mode===d.BlockStatement&&!this._flags.inline_frame||this._flags.mode===d.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||se,this.print_token(y),this._output.space_before_token=we},H.prototype.handle_block_comment=function(y,G){if(this._output.raw){this._output.add_raw_token(y),y.directives&&y.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(y.directives){this.print_newline(!1,G),this.print_token(y),y.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!h.newline.test(y.text)&&!y.newlines){this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0;return}else this.print_block_commment(y,G)},H.prototype.print_block_commment=function(y,G){var Y=g(y.text),ie,se=!1,we=!1,ve=y.whitespace_before,Se=ve.length;if(this.print_newline(!1,G),this.print_token_line_indentation(y),this._output.add_token(Y[0]),this.print_newline(!1,G),Y.length>1){for(Y=Y.slice(1),se=D(Y,"*"),we=j(Y,ve),se&&(this._flags.alignment=1),ie=0;ie=0;h--)if(this.__items[h].match(f))return!0;return!1},R.prototype.set_indent=function(f,h){this.is_empty()&&(this.__indent_count=f||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},R.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},R.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},R.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var f=this.__parent.current_line;return f.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),f.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),f.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,f.__items[0]===" "&&(f.__items.splice(0,1),f.__character_count-=1),!0}return!1},R.prototype.is_empty=function(){return this.__items.length===0},R.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},R.prototype.push=function(f){this.__items.push(f);var h=f.lastIndexOf(`
`);h!==-1?this.__character_count=f.length-h:this.__character_count+=f.length},R.prototype.pop=function(){var f=null;return this.is_empty()||(f=this.__items.pop(),this.__character_count-=f.length),f},R.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},R.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},R.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},R.prototype.toString=function(){var f="";return this.is_empty()?this.__parent.indent_empty_lines&&(f=this.__parent.get_indent_string(this.__indent_count)):(f=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),f+=this.__items.join("")),f};function m(f,h){this.__cache=[""],this.__indent_size=f.indent_size,this.__indent_string=f.indent_char,f.indent_with_tabs||(this.__indent_string=new Array(f.indent_size+1).join(f.indent_char)),h=h||"",f.indent_level>0&&(h=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}m.prototype.get_indent_size=function(f,h){var s=this.__base_string_length;return h=h||0,f<0&&(s=0),s+=f*this.__indent_size,s+=h,s},m.prototype.get_indent_string=function(f,h){var s=this.__base_string;return h=h||0,f<0&&(f=0,s=""),h+=f*this.__indent_size,this.__ensure_cache(h),s+=this.__cache[h],s},m.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var f=this.__cache.length,h=0,s="";this.__indent_size&&f>=this.__indent_size&&(h=Math.floor(f/this.__indent_size),f-=h*this.__indent_size,s=new Array(h+1).join(this.__indent_string)),f&&(s+=new Array(f+1).join(" ")),this.__cache.push(s)};function p(f,h){this.__indent_cache=new m(f,h),this.raw=!1,this._end_with_newline=f.end_with_newline,this.indent_size=f.indent_size,this.wrap_line_length=f.wrap_line_length,this.indent_empty_lines=f.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new R(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}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(f,h){return this.__indent_cache.get_indent_string(f,h)},p.prototype.get_indent_size=function(f,h){return this.__indent_cache.get_indent_size(f,h)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(f){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===`
`&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
`);return f!==`
`&&(s=s.replace(/[\n]/g,f)),s},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(f,h){return f=f||0,h=h||0,this.next_line.set_indent(f,h),this.__lines.length>1?(this.current_line.set_indent(f,h),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(f){for(var h=0;h1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},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(f,h){for(var s=this.__lines.length-2;s>=0;){var u=this.__lines[s];if(u.is_empty())break;if(u.item(0).indexOf(f)!==0&&u.item(-1)!==h){this.__lines.splice(s+1,0,new R(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},P.exports.Output=p},function(P){function R(m,p,f,h){this.type=m,this.text=p,this.comments_before=null,this.newlines=f||0,this.whitespace_before=h||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}P.exports.Token=R},function(P,R){var m="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",h="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",s="(?:\\\\u[0-9a-fA-F]{4}|["+m+f+"])",u="(?:\\\\u[0-9a-fA-F]{4}|["+p+f+h+"])*";R.identifier=new RegExp(s+u,"g"),R.identifierStart=new RegExp(s),R.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+f+h+"])+");var l=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;R.newline=/[\n\r\u2028\u2029]/,R.lineBreak=new RegExp(`\r
|`+R.newline.source),R.allLineBreaks=new RegExp(R.lineBreak.source,"g")},function(P,R,m){var p=m(6).Options,f=["before-newline","after-newline","preserve-newline"];function h(s){p.call(this,s,"js");var u=this.raw_options.brace_style||null;u==="expand-strict"?this.raw_options.brace_style="expand":u==="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 a=0;a>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),x=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";x=x.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),x="\\?\\.(?!\\d) "+x,x=x.replace(/ /g,"|");var S=new RegExp(x),E="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),d=E.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),b=new RegExp("^(?:"+d.join("|")+")$"),g,_=function(D,j){f.call(this,D,j),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var H=new l(this._input),k=new a(this._input).read_options(this._options);this.__patterns={template:k,identifier:k.starting_with(u.identifier).matching(u.identifierMatch),number:H.matching(w),punct:H.matching(S),comment:H.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:H.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:H.matching(//),include:H.starting_with(/#include/).until_after(u.lineBreak),shebang:H.starting_with(/#!/).until_after(u.lineBreak),xml:H.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:k.until(/['\\\n\r\u2028\u2029]/),double_quote:k.until(/["\\\n\r\u2028\u2029]/),template_text:k.until(/[`\\$]/),template_expression:k.until(/[`}\\]/)}};_.prototype=new f,_.prototype._is_comment=function(D){return D.type===c.COMMENT||D.type===c.BLOCK_COMMENT||D.type===c.UNKNOWN},_.prototype._is_opening=function(D){return D.type===c.START_BLOCK||D.type===c.START_EXPR},_.prototype._is_closing=function(D,j){return(D.type===c.END_BLOCK||D.type===c.END_EXPR)&&j&&(D.text==="]"&&j.text==="["||D.text===")"&&j.text==="("||D.text==="}"&&j.text==="{")},_.prototype._reset=function(){g=!1},_.prototype._get_next_token=function(D,j){var H=null;this._readWhitespace();var k=this._input.peek();return k===null?this._create_token(c.EOF,""):(H=H||this._read_non_javascript(k),H=H||this._read_string(k),H=H||this._read_word(D),H=H||this._read_singles(k),H=H||this._read_comment(k),H=H||this._read_regexp(k,D),H=H||this._read_xml(k,D),H=H||this._read_punctuation(),H=H||this._create_token(c.UNKNOWN,this._input.next()),H)},_.prototype._read_word=function(D){var j;if(j=this.__patterns.identifier.read(),j!=="")return j=j.replace(u.allLineBreaks,`
`),!(D.type===c.DOT||D.type===c.RESERVED&&(D.text==="set"||D.text==="get"))&&b.test(j)?(j==="in"||j==="of")&&(D.type===c.WORD||D.type===c.STRING)?this._create_token(c.OPERATOR,j):this._create_token(c.RESERVED,j):this._create_token(c.WORD,j);if(j=this.__patterns.number.read(),j!=="")return this._create_token(c.WORD,j)},_.prototype._read_singles=function(D){var j=null;return D==="("||D==="["?j=this._create_token(c.START_EXPR,D):D===")"||D==="]"?j=this._create_token(c.END_EXPR,D):D==="{"?j=this._create_token(c.START_BLOCK,D):D==="}"?j=this._create_token(c.END_BLOCK,D):D===";"?j=this._create_token(c.SEMICOLON,D):D==="."&&O.test(this._input.peek(1))?j=this._create_token(c.DOT,D):D===","&&(j=this._create_token(c.COMMA,D)),j&&this._input.next(),j},_.prototype._read_punctuation=function(){var D=this.__patterns.punct.read();if(D!=="")return D==="="?this._create_token(c.EQUALS,D):D==="?."?this._create_token(c.DOT,D):this._create_token(c.OPERATOR,D)},_.prototype._read_non_javascript=function(D){var j="";if(D==="#"){if(this._is_first_token()&&(j=this.__patterns.shebang.read(),j))return this._create_token(c.UNKNOWN,j.trim()+`
`);if(j=this.__patterns.include.read(),j)return this._create_token(c.UNKNOWN,j.trim()+`
`);D=this._input.next();var H="#";if(this._input.hasNext()&&this._input.testChar(T)){do D=this._input.next(),H+=D;while(this._input.hasNext()&&D!=="#"&&D!=="=");return D==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(H+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(H+="{}",this._input.next(),this._input.next())),this._create_token(c.WORD,H)}this._input.back()}else if(D==="<"&&this._is_first_token()){if(j=this.__patterns.html_comment_start.read(),j){for(;this._input.hasNext()&&!this._input.testChar(u.newline);)j+=this._input.next();return g=!0,this._create_token(c.COMMENT,j)}}else if(g&&D==="-"&&(j=this.__patterns.html_comment_end.read(),j))return g=!1,this._create_token(c.COMMENT,j);return null},_.prototype._read_comment=function(D){var j=null;if(D==="/"){var H="";if(this._input.peek(1)==="*"){H=this.__patterns.block_comment.read();var k=L.get_directives(H);k&&k.ignore==="start"&&(H+=L.readIgnored(this._input)),H=H.replace(u.allLineBreaks,`
`),j=this._create_token(c.BLOCK_COMMENT,H),j.directives=k}else this._input.peek(1)==="/"&&(H=this.__patterns.comment.read(),j=this._create_token(c.COMMENT,H))}return j},_.prototype._read_string=function(D){if(D==="`"||D==="'"||D==='"'){var j=this._input.next();return this.has_char_escapes=!1,D==="`"?j+=this._read_string_recursive("`",!0,"${"):j+=this._read_string_recursive(D),this.has_char_escapes&&this._options.unescape_strings&&(j=F(j)),this._input.peek()===D&&(j+=this._input.next()),j=j.replace(u.allLineBreaks,`
`),this._create_token(c.STRING,j)}return null},_.prototype._allow_regexp_or_xml=function(D){return D.type===c.RESERVED&&o(D.text,["return","case","throw","else","do","typeof","yield"])||D.type===c.END_EXPR&&D.text===")"&&D.opened.previous.type===c.RESERVED&&o(D.opened.previous.text,["if","while","for"])||o(D.type,[c.COMMENT,c.START_EXPR,c.START_BLOCK,c.START,c.END_BLOCK,c.OPERATOR,c.EQUALS,c.EOF,c.SEMICOLON,c.COMMA])},_.prototype._read_regexp=function(D,j){if(D==="/"&&this._allow_regexp_or_xml(j)){for(var H=this._input.next(),k=!1,y=!1;this._input.hasNext()&&(k||y||this._input.peek()!==D)&&!this._input.testChar(u.newline);)H+=this._input.peek(),k?k=!1:(k=this._input.peek()==="\\",this._input.peek()==="["?y=!0:this._input.peek()==="]"&&(y=!1)),this._input.next();return this._input.peek()===D&&(H+=this._input.next(),H+=this._input.read(u.identifier)),this._create_token(c.STRING,H)}return null},_.prototype._read_xml=function(D,j){if(this._options.e4x&&D==="<"&&this._allow_regexp_or_xml(j)){var H="",k=this.__patterns.xml.read_match();if(k){for(var y=k[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),G=y.indexOf("{")===0,Y=0;k;){var ie=!!k[1],se=k[2],we=!!k[k.length-1]||se.slice(0,8)==="![CDATA[";if(!we&&(se===y||G&&se.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ie?--Y:++Y),H+=k[0],Y<=0)break;k=this.__patterns.xml.read_match()}return k||(H+=this._input.match(/[\s\S]*/g)[0]),H=H.replace(u.allLineBreaks,`
`),this._create_token(c.STRING,H)}}return null};function F(D){for(var j="",H=0,k=new p(D),y=null;k.hasNext();)if(y=k.match(/([\s]|[^\\]|\\\\)+/g),y&&(j+=y[0]),k.peek()==="\\"){if(k.next(),k.peek()==="x")y=k.match(/x([0-9A-Fa-f]{2})/g);else if(k.peek()==="u")y=k.match(/u([0-9A-Fa-f]{4})/g);else{j+="\\",k.hasNext()&&(j+=k.next());continue}if(!y)return D;if(H=parseInt(y[1],16),H>126&&H<=255&&y[0].indexOf("x")===0)return D;if(H>=0&&H<32){j+="\\"+y[0];continue}else H===34||H===39||H===92?j+="\\"+String.fromCharCode(H):j+=String.fromCharCode(H)}return j}_.prototype._read_string_recursive=function(D,j,H){var k,y;D==="'"?y=this.__patterns.single_quote:D==='"'?y=this.__patterns.double_quote:D==="`"?y=this.__patterns.template_text:D==="}"&&(y=this.__patterns.template_expression);for(var G=y.read(),Y="";this._input.hasNext();){if(Y=this._input.next(),Y===D||!j&&u.newline.test(Y)){this._input.back();break}else Y==="\\"&&this._input.hasNext()?(k=this._input.peek(),k==="x"||k==="u"?this.has_char_escapes=!0:k==="\r"&&this._input.peek(1)===`
`&&this._input.next(),Y+=this._input.next()):H&&(H==="${"&&Y==="$"&&this._input.peek()==="{"&&(Y+=this._input.next()),H===Y&&(D==="`"?Y+=this._read_string_recursive("}",j,"`"):Y+=this._read_string_recursive("`",j,"${"),this._input.hasNext()&&(Y+=this._input.next())));Y+=y.read(),G+=Y}return G},P.exports.Tokenizer=_,P.exports.TOKEN=c,P.exports.positionable_operators=A.slice(),P.exports.line_starters=E.slice()},function(P){var R=RegExp.prototype.hasOwnProperty("sticky");function m(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position=0&&p=0&&f=p.length&&this.__input.substring(f-p.length,f).toLowerCase()===p},P.exports.InputScanner=m},function(P,R,m){var p=m(8).InputScanner,f=m(3).Token,h=m(10).TokenStream,s=m(11).WhitespacePattern,u={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(a,o){this._input=new p(a),this._options=o||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new h,this._reset();for(var a,o=new f(u.START,""),c=null,L=[],w=new h;o.type!==u.EOF;){for(a=this._get_next_token(o,c);this._is_comment(a);)w.add(a),a=this._get_next_token(o,c);w.isEmpty()||(a.comments_before=w,w=new h),a.parent=c,this._is_opening(a)?(L.push(c),c=a):c&&this._is_closing(a,c)&&(a.opened=c,c.closed=a,c=L.pop(),a.parent=c),a.previous=o,o.next=a,this.__tokens.add(a),o=a}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(a,o){this._readWhitespace();var c=this._input.read(/.+/g);return c?this._create_token(u.RAW,c):this._create_token(u.EOF,"")},l.prototype._is_comment=function(a){return!1},l.prototype._is_opening=function(a){return!1},l.prototype._is_closing=function(a,o){return!1},l.prototype._create_token=function(a,o){var c=new f(a,o,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return c},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},P.exports.Tokenizer=l,P.exports.TOKEN=u},function(P){function R(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}R.prototype.restart=function(){this.__position=0},R.prototype.isEmpty=function(){return this.__tokens_length===0},R.prototype.hasNext=function(){return this.__position=0&&m/),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}/)}}h.prototype=new p,h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){this.__set_templated_pattern()},h.prototype.disable=function(s){var u=this._create();return u._disabled[s]=!0,u._update(),u},h.prototype.read_options=function(s){var u=this._create();for(var l in f)u._disabled[l]=s.templating.indexOf(l)===-1;return u._update(),u},h.prototype.exclude=function(s){var u=this._create();return u._excluded[s]=!0,u._update(),u},h.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var u=this._read_template();u;)this._match_pattern?u+=this._input.read(this._match_pattern):u+=this._input.readUntil(this.__template_pattern),s+=u,u=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},h.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},h.prototype._read_template=function(){var s="",u=this._input.peek();if(u==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(s=s||this.__patterns.erb.read())}else u==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},P.exports.TemplatablePattern=h}],N={};function K(P){var R=N[P];if(R!==void 0)return R.exports;var m=N[P]={exports:{}};return B[P](m,m.exports,K),m.exports}var W=K(0);M=W})();var Q=M;!(ue=[],Z=function(){return{js_beautify:Q}}.apply(ot,ue),Z!==void 0&&(_t.exports=Z))})()},"7Cbv":function(_t,ot,le){"use strict";var ue=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Z=new Uint8Array(16);function M(){if(!ue)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ue(Z)}var Q=/^(?:[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 B(f){return typeof f=="string"&&Q.test(f)}for(var N=B,K=[],W=0;W<256;++W)K.push((W+256).toString(16).substr(1));function P(f){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=(K[f[h+0]]+K[f[h+1]]+K[f[h+2]]+K[f[h+3]]+"-"+K[f[h+4]]+K[f[h+5]]+"-"+K[f[h+6]]+K[f[h+7]]+"-"+K[f[h+8]]+K[f[h+9]]+"-"+K[f[h+10]]+K[f[h+11]]+K[f[h+12]]+K[f[h+13]]+K[f[h+14]]+K[f[h+15]]).toLowerCase();if(!N(s))throw TypeError("Stringified UUID is invalid");return s}var R=P;function m(f,h,s){f=f||{};var u=f.random||(f.rng||M)();if(u[6]=u[6]&15|64,u[8]=u[8]&63|128,h){s=s||0;for(var l=0;l<16;++l)h[s+l]=u[l];return h}return R(u)}var p=ot.a=m},"7ahc":function(_t,ot,le){"use strict";le.d(ot,"a",function(){return L});var ue=le("k1fw"),Z=le("0Owb"),M=le("+L6B"),Q=le("2/Rp"),B=le("y8nQ"),N=le("Vl3Y"),K=le("tJVT"),W=le("OaEy"),P=le("2fM7"),R=le("q1tI"),m=le.n(R),p=le("VrN/"),f=le.n(p),h=le("p77/"),s=le.n(h),u=le("c5Ni"),l=le.n(u),a=P.a.Option,o={labelCol:{span:4},wrapperCol:{span:20}},c={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"]};ot.b=function(w){var T=w.callback,O=w.onCancel,A=Object(R.useState)("python"),x=Object(K.a)(A,2),S=x[0],E=x[1];function d(g){E(c[g][1])}function b(g){T(g)}return m.a.createElement(N.a,Object(Z.a)({},o,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:b}),m.a.createElement(N.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},m.a.createElement(P.a,{onChange:d},Object.keys(c).map(function(g){return m.a.createElement(a,{key:g,value:g},c[g][0])}))),m.a.createElement(N.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},m.a.createElement(L,{mode:S})),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(Q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(Q.a,{type:"ghost",onClick:O},"\u53D6\u6D88")))};function L(w){var T=w.value,O=w.onChange,A=w.mode,x=w.options,S=x===void 0?{}:x,E=Object(R.useRef)(),d=Object(R.useState)(),b=Object(K.a)(d,2),g=b[0],_=b[1];return Object(R.useEffect)(function(){if(g){function F(D){var j=D.getValue();O&&O(j)}return g.on("change",F),function(){g.off("change",F)}}},[g,O]),Object(R.useEffect)(function(){g&&g.setOption("mode",A)},[g,A]),Object(R.useEffect)(function(){g&&((T!==g.getValue()||T==="")&&setTimeout(function(){g.setValue(T||" ")},300))},[g,T]),Object(R.useEffect)(function(){if(E.current&&!g){var F=f.a.fromTextArea(E.current,Object(ue.a)({mode:A,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},S));_(F)}},[E.current,g]),m.a.createElement("div",{className:"my-codemirror-container"},m.a.createElement("textarea",{ref:E}))}},"8EBN":function(_t,ot,le){(function(ue){ue(le("VrN/"))})(function(ue){"use strict";ue.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var Z=0;Z-1&&Q.substring(K+1,Q.length);if(W)return ue.findModeByExtension(W)},ue.findModeByName=function(Q){Q=Q.toLowerCase();for(var B=0;B=U.length?q.slice(U.length):q}).join(`
`)}var l=[],a=[""],o=new h.a.Renderer,c=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function L(){l.length=0,a=[""]}var w={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function T(X,v,C,U){if(v>=X.length||X[v].level<=C)return v;var q=X[v];U.push("- "+q.text+""),v++;var V=[];return v=T(X,v,q.level,V),V.length>0&&(U.push("
"),V.forEach(function(be){U.push(be)}),U.push("
")),U.push(" "),v=T(X,v,C,U),v}function O(){return T(l,0,0,a),a.push("
"),a.join("")}var A={heading:function(v){var C=c.exec(v);if(C)return{type:"heading",raw:C[0],depth:C[1].length,text:C[2]}},fences:function(v){var C=this.rules.block.fences.exec(v);if(C){var U=C[0],q=u(U,C[3]||""),V=C[2]?C[2].trim():C[2];if(["latex","katex","math"].indexOf(V)>=0){var be=E(),We=q;q=be,d[be]={type:"block",expression:We}}return{type:"code",raw:U,lang:V,text:q}}}},x=/(?:\${2})([^\n`]+?)(?:\${2})/gi,S=0,E=function(){return"__special_katext_id_".concat(S++,"__")},d={};function b(){return d}function g(){S=0,d={}}function _(X){return X=X.replace(x,function(v,C){var U=E();return d[U]={type:"inline",expression:C},U}),X}var F=o.listitem;o.listitem=function(X){return F(_(X))};var D=o.paragraph;o.paragraph=function(X){return D(_(X))};var j=o.tablecell;o.tablecell=function(X,v){return j(_(X),v)},o.code=function(X,v,C){var U=(v||"").match(/\S*/)[0];return U?["latex","katex","math"].indexOf(U)>=0?"".concat(X,"
"):'
').concat(C?X:Object(s.escape)(X,!0),`
`):''+(C?X:Object(s.escape)(X,!0))+"
"},o.heading=function(X,v,C){var U=this.options.headerPrefix+C.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return l.push({anchor:U,level:v,text:X}),"'+X+""},h.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),h.a.use({tokenizer:A,renderer:o});var H=h.a,k=le("SJMd"),y=le("ulZh"),G=le.n(y),Y=le("m3rI"),ie=le("Oy/b"),se=le("p5ED"),we=le("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 ve=function(X,v){return(ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,U){C.__proto__=U}||function(C,U){for(var q in U)Object.prototype.hasOwnProperty.call(U,q)&&(C[q]=U[q])})(X,v)};function Se(X,v){function C(){this.constructor=X}ve(X,v),X.prototype=v===null?Object.create(v):(C.prototype=v.prototype,new C)}function Ce(X,v,C,U){return new(C||(C=Promise))(function(q,V){function be(gt){try{qe(U.next(gt))}catch(Ge){V(Ge)}}function We(gt){try{qe(U.throw(gt))}catch(Ge){V(Ge)}}function qe(gt){var Ge;gt.done?q(gt.value):(Ge=gt.value,Ge instanceof C?Ge:new C(function(xt){xt(Ge)})).then(be,We)}qe((U=U.apply(X,v||[])).next())})}function pe(X,v){var C,U,q,V,be={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return V={next:We(0),throw:We(1),return:We(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function We(qe){return function(gt){return function(Ge){if(C)throw new TypeError("Generator is already executing.");for(;be;)try{if(C=1,U&&(q=2&Ge[0]?U.return:Ge[0]?U.throw||((q=U.return)&&q.call(U),0):U.next)&&!(q=q.call(U,Ge[1])).done)return q;switch(U=0,q&&(Ge=[2&Ge[0],q.value]),Ge[0]){case 0:case 1:q=Ge;break;case 4:return be.label++,{value:Ge[1],done:!1};case 5:be.label++,U=Ge[1],Ge=[0];continue;case 7:Ge=be.ops.pop(),be.trys.pop();continue;default:if(!(q=be.trys,(q=q.length>0&&q[q.length-1])||Ge[0]!==6&&Ge[0]!==2)){be=0;continue}if(Ge[0]===3&&(!q||Ge[1]>q[0]&&Ge[1]',"select"),this.addActionButton(U,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(U,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(U,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(U,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(U,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(U,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(U,'',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(V){var be=document.createElement("div");be.className=""+C.toolbarButtonStyleClass.name,be.setAttribute("data-type-name",V.typeName),be.innerHTML=V.icon,be.addEventListener("click",function(){C.markerToolbarButtonClicked(be,V)}),C.buttons.push(be),C.markerButtons.push(be)}),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()},X.prototype.addButtonClickListener=function(v){this.buttonClickListeners.push(v)},X.prototype.removeButtonClickListener=function(v){this.buttonClickListeners.indexOf(v)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(v),1)},X.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},X.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var v=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var C=0;C0&&this.buttonClickListeners.forEach(function(U){return U("marker",C)}),this.markerButtonOverflowBlock.style.display="none"},X.prototype.actionToolbarButtonClicked=function(v,C){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(U){return U("action",C)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},X.prototype.setActiveButton=function(v){this.resetButtonStyles(),v.className=v.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),v.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},X.prototype.setActiveMarkerButton=function(v){var C=this.markerButtons.find(function(U){return U.getAttribute("data-type-name")===v});C&&this.setActiveButton(C)},X.prototype.setCurrentMarker=function(v){var C=this;this.currentMarker=v,this.buttons.filter(function(U){return/delete|notes/.test(U.getAttribute("data-action"))}).forEach(function(U){C.currentMarker===void 0?(U.style.fillOpacity="0.4",U.style.pointerEvents="none"):(U.style.fillOpacity="1",U.style.pointerEvents="all")})},X}(),Pe=function(){function X(v,C,U,q){this.panels=[],this.panelButtons=[],this.markerjsContainer=v,this.displayMode=C,this.uiStyleSettings=U,this.styles=q,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return X.prototype.addStyles=function(){var v;this.toolboxStyleClass=this.styles.addClass(new Te("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 Te("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var C=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Te("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Te("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Te("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 Te("toolbox-panel-row_colors",`
background-color: `+((v=this.uiStyleSettings.toolboxBackgroundColor)!==null&&v!==void 0?v:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Te("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*C)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*C)+`px;
padding: `+C+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Te("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Te("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new ke("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new ke("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},X.prototype.show=function(v){var C;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=v,this.uiContainer.className=this.toolboxStyleClass.name+" "+((C=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&C!==void 0?C:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},X.prototype.setPanelButtons=function(v){var C,U,q=this;this.panels=v,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((C=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&C!==void 0?C:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((U=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&U!==void 0?U:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(V){var be;V.uiStyleSettings=q.uiStyleSettings;var We=document.createElement("div");We.className=q.toolboxButtonStyleClass.name+" "+((be=q.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&be!==void 0?be:q.toolboxButtonStyleColorsClass.name),We.innerHTML=V.icon,We.title=V.title,We.addEventListener("click",function(){q.panelButtonClick(V)}),q.panelButtons.push(We),q.buttonRow.appendChild(We)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},X.prototype.panelButtonClick=function(v){var C=this,U=-1;if(v!==this.activePanel){U=this.panels.indexOf(v),this.panelRow.innerHTML="";var q=v.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=v}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){C.displayMode==="inline"?C.panelRow.style.display="none":C.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(V,be){var We,qe;V.className=C.toolboxButtonStyleClass.name+" "+(be===U?""+((We=C.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&We!==void 0?We:C.toolboxActiveButtonStyleColorsClass.name):""+((qe=C.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&qe!==void 0?qe:C.toolboxButtonStyleColorsClass.name))})},X}(),He=function(X,v){this.title=X,this.icon=v},Fe=function(X){function v(C,U,q,V){var be=X.call(this,C,V||'')||this;return be.colors=[],be.addTransparent=!1,be.colorBoxes=[],be.colors=U,be.currentColor=q,be.setCurrentColor=be.setCurrentColor.bind(be),be.getColorBox=be.getColorBox.bind(be),be}return Se(v,X),v.prototype.getUi=function(){var C=this,U=document.createElement("div");return U.style.overflow="hidden",U.style.whiteSpace="nowrap",this.colors.forEach(function(q){var V=C.getColorBox(q);U.appendChild(V),C.colorBoxes.push(V)}),U},v.prototype.getColorBox=function(C){var U=this,q=this.uiStyleSettings.toolbarHeight/4,V=this.uiStyleSettings.toolbarHeight-q,be=document.createElement("div");be.style.display="inline-block",be.style.boxSizing="content-box",be.style.width=V-2+"px",be.style.height=V-2+"px",be.style.padding="1px",be.style.marginRight="2px",be.style.marginBottom="2px",be.style.borderWidth="2px",be.style.borderStyle="solid",be.style.borderRadius=(V+2)/2+"px",be.style.borderColor=C===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",be.addEventListener("click",function(){U.setCurrentColor(C,be)});var We=document.createElement("div");return We.style.display="inline-block",We.style.width=V-2+"px",We.style.height=V-2+"px",We.style.backgroundColor=C,We.style.borderRadius=V/2+"px",C==="transparent"&&(We.style.fill=this.uiStyleSettings.toolboxAccentColor,We.innerHTML=``),be.appendChild(We),be},v.prototype.setCurrentColor=function(C,U){var q=this;this.currentColor=C,this.colorBoxes.forEach(function(V){V.style.borderColor=V===U?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(C)},v}(He),Ue=function(){function X(v,C,U){this._state="new",this._isSelected=!1,this._container=v,this._overlayContainer=C,this.globalSettings=U,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(X.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),X.prototype.ownsTarget=function(v){return!1},Object.defineProperty(X.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),X.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},X.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},X.prototype.pointerDown=function(v,C){},X.prototype.dblClick=function(v,C){},X.prototype.manipulate=function(v){},X.prototype.pointerUp=function(v){this.stateChanged()},X.prototype.dispose=function(){},X.prototype.addMarkerVisualToContainer=function(v){this.container.childNodes.length>0?this.container.insertBefore(v,this.container.childNodes[0]):this.container.appendChild(v)},X.prototype.getState=function(){return{typeName:X.typeName,state:this.state,notes:this.notes}},X.prototype.restoreState=function(v){this._state=v.state,this.notes=v.notes},X.prototype.scale=function(v,C){},X.prototype.colorChanged=function(v){this.onColorChanged&&this.onColorChanged(v),this.stateChanged()},X.prototype.fillColorChanged=function(v){this.onFillColorChanged&&this.onFillColorChanged(v),this.stateChanged()},X.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var v=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),v.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(v)&&this.onStateChanged(this)}},X.typeName="MarkerBase",X}(),Ne=function(){function X(){this.findGripByVisual=this.findGripByVisual.bind(this)}return X.prototype.findGripByVisual=function(v){return this.topLeft.ownsTarget(v)?this.topLeft:this.topCenter.ownsTarget(v)?this.topCenter:this.topRight.ownsTarget(v)?this.topRight:this.centerLeft.ownsTarget(v)?this.centerLeft:this.centerRight.ownsTarget(v)?this.centerRight:this.bottomLeft.ownsTarget(v)?this.bottomLeft:this.bottomCenter.ownsTarget(v)?this.bottomCenter:this.bottomRight.ownsTarget(v)?this.bottomRight:void 0},X}(),Ze=function(){function X(){this.GRIP_SIZE=10,this.visual=oe.createGroup(),this.visual.appendChild(oe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(oe.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(v){return v===this.visual||v===this.visual.childNodes[0]||v===this.visual.childNodes[1]},X}(),st=function(){function X(){}return X.toITransformMatrix=function(v){return{a:v.a,b:v.b,c:v.c,d:v.d,e:v.e,f:v.f}},X.toSVGMatrix=function(v,C){return v.a=C.a,v.b=C.b,v.c=C.c,v.d=C.d,v.e=C.e,v.f=C.f,v},X}(),tt=function(X){function v(C,U,q){var V=X.call(this,C,U,q)||this;return V.left=0,V.top=0,V.width=0,V.height=0,V.defaultSize={x:50,y:20},V.offsetX=0,V.offsetY=0,V.rotationAngle=0,V.CB_DISTANCE=10,V._suppressMarkerCreateEvent=!1,V.container.transform.baseVal.appendItem(oe.createTransform()),V.setupControlBox(),V}return Se(v,X),Object.defineProperty(v.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"visual",{get:function(){return this._visual},set:function(C){this._visual=C;var U=oe.createTransform();this._visual.transform.baseVal.appendItem(U)},enumerable:!1,configurable:!0}),v.prototype.ownsTarget=function(C){return!!X.prototype.ownsTarget.call(this,C)||!!(this.controlGrips.findGripByVisual(C)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(C))},v.prototype.pointerDown=function(C,U){X.prototype.pointerDown.call(this,C,U),this.state==="new"&&(this.left=C.x,this.top=C.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var q=this.unrotatePoint(C);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(U),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(U)){this.activeGrip=this.rotatorGrip;var V=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=V.x-this.width/2,this.top=V.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var be=this.container.transform.baseVal.getItem(0);be.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(be,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},v.prototype.pointerUp=function(C){var U=this.state;X.prototype.pointerUp.call(this,C),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(C),this._state="select",U==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},v.prototype.moveVisual=function(C){this.visual.style.transform="translate("+C.x+"px, "+C.y+"px)"},v.prototype.manipulate=function(C){var U=this.unrotatePoint(C);this.state==="creating"?this.resize(C):this.state==="move"?(this.left=this.manipulationStartLeft+(U.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(U.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(U):this.state==="rotate"&&this.rotate(C)},v.prototype.resize=function(C){var U=this.manipulationStartLeft,q=this.manipulationStartWidth,V=this.manipulationStartTop,be=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:U=this.manipulationStartLeft+C.x-this.manipulationStartX,q=this.manipulationStartWidth+this.manipulationStartLeft-U;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:q=this.manipulationStartWidth+C.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:V=this.manipulationStartTop+C.y-this.manipulationStartY,be=this.manipulationStartHeight+this.manipulationStartTop-V;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:be=this.manipulationStartHeight+C.y-this.manipulationStartY}q>=0?(this.left=U,this.width=q):(this.left=U+q,this.width=-q),be>=0?(this.top=V,this.height=be):(this.top=V+be,this.height=-be),this.setSize()},v.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},v.prototype.rotate=function(C){if(Math.abs(C.x-this.centerX)>.1){var U=Math.sign(C.x-this.centerX);this.rotationAngle=180*Math.atan((C.y-this.centerY)/(C.x-this.centerX))/Math.PI+90*U,this.applyRotation()}},v.prototype.applyRotation=function(){var C=this.container.transform.baseVal.getItem(0);C.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(C,0)},v.prototype.rotatePoint=function(C){if(this.rotationAngle===0)return C;var U=this.container.getCTM(),q=oe.createPoint(C.x,C.y);return{x:(q=q.matrixTransform(U)).x,y:q.y}},v.prototype.unrotatePoint=function(C){if(this.rotationAngle===0)return C;var U=this.container.getCTM();U=U.inverse();var q=oe.createPoint(C.x,C.y);return{x:(q=q.matrixTransform(U)).x,y:q.y}},v.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},v.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},v.prototype.setupControlBox=function(){this.controlBox=oe.createGroup();var C=oe.createTransform();C.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(C),this.container.appendChild(this.controlBox),this.controlRect=oe.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=oe.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 Ne,this.addControlGrips(),this.controlBox.style.display="none"},v.prototype.adjustControlBox=function(){var C=this.controlBox.transform.baseVal.getItem(0);C.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(C,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},v.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},v.prototype.createGrip=function(){var C=new Ze;return C.visual.transform.baseVal.appendItem(oe.createTransform()),this.controlBox.appendChild(C.visual),C},v.prototype.positionGrips=function(){var C=this.controlGrips.topLeft.GRIP_SIZE,U=-C/2,q=U,V=(this.width+this.CB_DISTANCE)/2-C/2,be=(this.height+this.CB_DISTANCE)/2-C/2,We=this.height+this.CB_DISTANCE-C/2,qe=this.width+this.CB_DISTANCE-C/2;this.positionGrip(this.controlGrips.topLeft.visual,U,q),this.positionGrip(this.controlGrips.topCenter.visual,V,q),this.positionGrip(this.controlGrips.topRight.visual,qe,q),this.positionGrip(this.controlGrips.centerLeft.visual,U,be),this.positionGrip(this.controlGrips.centerRight.visual,qe,be),this.positionGrip(this.controlGrips.bottomLeft.visual,U,We),this.positionGrip(this.controlGrips.bottomCenter.visual,V,We),this.positionGrip(this.controlGrips.bottomRight.visual,qe,We),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,V,q-3*this.CB_DISTANCE)},v.prototype.positionGrip=function(C,U,q){var V=C.transform.baseVal.getItem(0);V.setTranslate(U,q),C.transform.baseVal.replaceItem(V,0)},v.prototype.hideControlBox=function(){this.controlBox.style.display="none"},v.prototype.showControlBox=function(){this.controlBox.style.display=""},v.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:st.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:st.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},X.prototype.getState.call(this))},v.prototype.restoreState=function(C){X.prototype.restoreState.call(this,C);var U=C;this.left=U.left,this.top=U.top,this.width=U.width,this.height=U.height,this.rotationAngle=U.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(st.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,U.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(st.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,U.containerTransformMatrix))},v.prototype.scale=function(C,U){X.prototype.scale.call(this,C,U);var q=this.rotatePoint({x:this.left,y:this.top}),V=this.unrotatePoint({x:q.x*C,y:q.y*U});this.left=V.x,this.top=V.y,this.width=this.width*C,this.height=this.height*U,this.adjustControlBox()},v}(Ue),et=function(X){function v(C,U,q){var V=X.call(this,C,U,q)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.createVisual=V.createVisual.bind(V),V}return Se(v,X),v.prototype.ownsTarget=function(C){return!(!X.prototype.ownsTarget.call(this,C)&&C!==this.visual)},v.prototype.createVisual=function(){this.visual=oe.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(C,U){X.prototype.pointerDown.call(this,C,U),this.state==="new"&&(this.createVisual(),this.moveVisual(C),this._state="creating")},v.prototype.manipulate=function(C){X.prototype.manipulate.call(this,C)},v.prototype.resize=function(C){X.prototype.resize.call(this,C),this.setSize()},v.prototype.setSize=function(){X.prototype.setSize.call(this),oe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},v.prototype.pointerUp=function(C){X.prototype.pointerUp.call(this,C),this.setSize()},v.prototype.setStrokeColor=function(C){this.strokeColor=C,this.visual&&oe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(C),this.stateChanged()},v.prototype.setFillColor=function(C){this.fillColor=C,this.visual&&oe.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},v.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.visual&&oe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},v.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.visual&&oe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},v.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this))},v.prototype.restoreState=function(C){var U=C;this.fillColor=U.fillColor,this.strokeColor=U.strokeColor,this.strokeWidth=U.strokeWidth,this.strokeDasharray=U.strokeDasharray,this.opacity=U.opacity,this.createVisual(),X.prototype.restoreState.call(this,C),this.setSize()},v.prototype.scale=function(C,U){X.prototype.scale.call(this,C,U),this.setSize()},v.title="Rectangle marker",v}(tt),ut=function(X){function v(C,U,q,V){var be=X.call(this,C,V||'')||this;return be.widths=[],be.widthBoxes=[],be.widths=U,be.currentWidth=q,be.setCurrentWidth=be.setCurrentWidth.bind(be),be}return Se(v,X),v.prototype.getUi=function(){var C=this,U=document.createElement("div");return U.style.display="flex",U.style.overflow="hidden",U.style.flexGrow="2",this.widths.forEach(function(q){var V=document.createElement("div");V.style.display="flex",V.style.flexGrow="2",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=q===C.currentWidth?C.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){C.setCurrentWidth(q,V)}),U.appendChild(V);var be=document.createElement("div");be.innerText=q.toString(),be.style.marginRight="5px",V.appendChild(be);var We=document.createElement("div");We.style.minHeight="20px",We.style.flexGrow="2",We.style.display="flex",We.style.alignItems="center";var qe=document.createElement("hr");qe.style.minWidth="20px",qe.style.border="0px",qe.style.borderTop=q+"px solid "+C.uiStyleSettings.toolboxColor,qe.style.flexGrow="2",We.appendChild(qe),V.appendChild(We),C.widthBoxes.push(V)}),U},v.prototype.setCurrentWidth=function(C,U){var q=this;this.currentWidth=C,this.widthBoxes.forEach(function(V){V.style.borderColor=V===U?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},v}(He),Ye=function(X){function v(C,U,q,V){var be=X.call(this,C,V||'')||this;return be.styles=[],be.styleBoxes=[],be.styles=U,be.currentStyle=q,be.setCurrentStyle=be.setCurrentStyle.bind(be),be}return Se(v,X),v.prototype.getUi=function(){var C=this,U=document.createElement("div");return U.style.display="flex",U.style.overflow="hidden",U.style.flexGrow="2",this.styles.forEach(function(q){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/C.styles.length-5+"%",V.style.borderColor=q===C.currentStyle?C.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){C.setCurrentStyle(q,V)}),U.appendChild(V);var be=document.createElement("div");be.style.minHeight="20px",be.style.flexGrow="2",be.style.overflow="hidden";var We=``;be.innerHTML=We,V.appendChild(be),C.styleBoxes.push(V)}),U},v.prototype.setCurrentStyle=function(C,U){var q=this;this.currentStyle=C,this.styleBoxes.forEach(function(V){V.style.borderColor=V===U?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},v}(He),Xe=function(X){function v(C,U,q){var V=X.call(this,C,U,q)||this;return V.strokeColor=q.defaultColor,V.strokeWidth=q.defaultStrokeWidth,V.strokeDasharray=q.defaultStrokeDasharray,V.strokePanel=new Fe("Line color",q.defaultColorSet,q.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new ut("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Ye("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Se(v,X),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=X.prototype.getState.call(this);return C.typeName=v.typeName,C},v.typeName="FrameMarker",v.title="Frame marker",v.icon='',v}(et),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},lt=function(X){function v(C,U,q){var V=X.call(this,C,U,q)||this;return V.x1=0,V.y1=0,V.x2=0,V.y2=0,V.defaultLength=50,V.manipulationStartX=0,V.manipulationStartY=0,V.manipulationStartX1=0,V.manipulationStartY1=0,V.manipulationStartX2=0,V.manipulationStartY2=0,V.setupControlBox(),V}return Se(v,X),v.prototype.ownsTarget=function(C){return!!X.prototype.ownsTarget.call(this,C)||!(!this.grip1.ownsTarget(C)&&!this.grip2.ownsTarget(C))},v.prototype.pointerDown=function(C,U){X.prototype.pointerDown.call(this,C,U),this.manipulationStartX=C.x,this.manipulationStartY=C.y,this.state==="new"&&(this.x1=C.x,this.y1=C.y,this.x2=C.x,this.y2=C.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(U)?this.activeGrip=this.grip1:this.grip2.ownsTarget(U)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},v.prototype.pointerUp=function(C){var U=this.state;X.prototype.pointerUp.call(this,C),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(C),this._state="select",U==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},v.prototype.adjustVisual=function(){},v.prototype.manipulate=function(C){this.state==="creating"?this.resize(C):this.state==="move"?(this.x1=this.manipulationStartX1+C.x-this.manipulationStartX,this.y1=this.manipulationStartY1+C.y-this.manipulationStartY,this.x2=this.manipulationStartX2+C.x-this.manipulationStartX,this.y2=this.manipulationStartY2+C.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(C)},v.prototype.resize=function(C){switch(this.activeGrip){case this.grip1:this.x1=C.x,this.y1=C.y;break;case this.grip2:case void 0:this.x2=C.x,this.y2=C.y}this.adjustVisual(),this.adjustControlBox()},v.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},v.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},v.prototype.setupControlBox=function(){this.controlBox=oe.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},v.prototype.adjustControlBox=function(){this.positionGrips()},v.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},v.prototype.createGrip=function(){var C=new Ze;return C.visual.transform.baseVal.appendItem(oe.createTransform()),this.controlBox.appendChild(C.visual),C},v.prototype.positionGrips=function(){var C=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-C/2,this.y1-C/2),this.positionGrip(this.grip2.visual,this.x2-C/2,this.y2-C/2)},v.prototype.positionGrip=function(C,U,q){var V=C.transform.baseVal.getItem(0);V.setTranslate(U,q),C.transform.baseVal.replaceItem(V,0)},v.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},X.prototype.getState.call(this))},v.prototype.restoreState=function(C){X.prototype.restoreState.call(this,C);var U=C;this.x1=U.x1,this.y1=U.y1,this.x2=U.x2,this.y2=U.y2},v.prototype.scale=function(C,U){X.prototype.scale.call(this,C,U),this.x1=this.x1*C,this.y1=this.y1*U,this.x2=this.x2*C,this.y2=this.y2*U,this.adjustVisual(),this.adjustControlBox()},v}(Ue),nt=function(X){function v(C,U,q){var V=X.call(this,C,U,q)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.strokeColor=q.defaultColor,V.strokeWidth=q.defaultStrokeWidth,V.strokeDasharray=q.defaultStrokeDasharray,V.strokePanel=new Fe("Line color",q.defaultColorSet,q.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new ut("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Ye("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Se(v,X),v.prototype.ownsTarget=function(C){return!(!X.prototype.ownsTarget.call(this,C)&&C!==this.visual&&C!==this.selectorLine&&C!==this.visibleLine)},v.prototype.createVisual=function(){this.visual=oe.createGroup(),this.selectorLine=oe.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=oe.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(C,U){X.prototype.pointerDown.call(this,C,U),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},v.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),oe.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),oe.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),oe.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},v.prototype.setStrokeColor=function(C){this.strokeColor=C,this.adjustVisual(),this.colorChanged(C)},v.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.adjustVisual()},v.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.adjustVisual(),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},X.prototype.getState.call(this));return C.typeName=v.typeName,C},v.prototype.restoreState=function(C){X.prototype.restoreState.call(this,C);var U=C;this.strokeColor=U.strokeColor,this.strokeWidth=U.strokeWidth,this.strokeDasharray=U.strokeDasharray,this.createVisual(),this.adjustVisual()},v.typeName="LineMarker",v.title="Line marker",v.icon='',v}(lt),De=function(X){function v(C,U,q,V){var be=X.call(this,C,V||'')||this;return be.fonts=[],be.fontBoxes=[],be.fonts=U,be.currentFont=q,be.setCurrentFont=be.setCurrentFont.bind(be),be}return Se(v,X),v.prototype.getUi=function(){var C=this,U=document.createElement("div");return U.style.overflow="hidden",U.style.flexGrow="2",this.fonts.forEach(function(q){var V=document.createElement("div");V.style.display="inline-block",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/C.fonts.length-5+"%",V.style.borderColor=q===C.currentFont?C.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){C.setCurrentFont(q,V)}),U.appendChild(V);var be=document.createElement("div");be.style.display="flex",be.style.minHeight="20px",be.style.flexGrow="2",be.style.fontFamily=q,be.style.overflow="hidden";var We=document.createElement("div");We.style.whiteSpace="nowrap",We.style.overflow="hidden",We.style.textOverflow="ellipsis",We.innerHTML="The quick brown fox jumps over the lazy dog",be.appendChild(We),V.appendChild(be),C.fontBoxes.push(V)}),U},v.prototype.setCurrentFont=function(C,U){var q=this;this.currentFont=C,this.fontBoxes.forEach(function(V){V.style.borderColor=V===U?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},v}(He),ze=function(X){function v(C,U,q){var V=X.call(this,C,U,q)||this;return V.color="transparent",V.padding=5,V.DEFAULT_TEXT="your text here",V.text=V.DEFAULT_TEXT,V.isMoved=!1,V.color=q.defaultColor,V.fontFamily=q.defaultFontFamily,V.defaultSize={x:100,y:30},V.setColor=V.setColor.bind(V),V.setFont=V.setFont.bind(V),V.renderText=V.renderText.bind(V),V.sizeText=V.sizeText.bind(V),V.textEditDivClicked=V.textEditDivClicked.bind(V),V.showTextEditor=V.showTextEditor.bind(V),V.setSize=V.setSize.bind(V),V.positionTextEditor=V.positionTextEditor.bind(V),V.colorPanel=new Fe("Color",q.defaultColorSet,q.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.fontFamilyPanel=new De("Font",q.defaultFontFamilies,q.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V}return Se(v,X),v.prototype.ownsTarget=function(C){if(X.prototype.ownsTarget.call(this,C)||C===this.visual||C===this.textElement||C===this.bgRectangle)return!0;var U=!1;return this.textElement.childNodes.forEach(function(q){q===C&&(U=!0)}),U},v.prototype.createVisual=function(){this.visual=oe.createGroup(),this.bgRectangle=oe.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=oe.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(oe.createTransform()),this.textElement.transform.baseVal.appendItem(oe.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},v.prototype.pointerDown=function(C,U){X.prototype.pointerDown.call(this,C,U),this.isMoved=!1,this.pointerDownPoint=C,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(C),this._state="creating")},v.prototype.renderText=function(){var C=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(U){C.textElement.appendChild(oe.createTSpan(U.trim()===""?" ":U.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},v.prototype.getTextScale=function(){var C=this.textElement.getBBox(),U=1;if(C.width>0&&C.height>0){var q=(1*this.width-this.width*this.padding*2/100)/C.width,V=(1*this.height-this.height*this.padding*2/100)/C.height;U=Math.min(q,V)}return U},v.prototype.getTextPosition=function(C){var U=this.textElement.getBBox(),q=0,V=0;return U.width>0&&U.height>0&&(q=(this.width-U.width*C)/2,V=this.height/2-U.height*C/2),{x:q,y:V}},v.prototype.sizeText=function(){var C=this.textElement.getBBox(),U=this.getTextScale(),q=this.getTextPosition(U);q.y-=C.y*U,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+q.x+"px, "+q.y+"px) scale("+U+", "+U+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(q.x,q.y),this.textElement.transform.baseVal.getItem(1).setScale(U,U))},v.prototype.manipulate=function(C){X.prototype.manipulate.call(this,C),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(C.x-this.pointerDownPoint.x)>5||Math.abs(C.y-this.pointerDownPoint.y)>5)},v.prototype.resize=function(C){X.prototype.resize.call(this,C),this.isMoved=!0,this.setSize(),this.sizeText()},v.prototype.setSize=function(){X.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(oe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),oe.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},v.prototype.pointerUp=function(C){var U=this.state;U==="creating"&&(this._suppressMarkerCreateEvent=!0),X.prototype.pointerUp.call(this,C),this.setSize(),(U==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},v.prototype.showTextEditor=function(){var C=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(U){U.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var U=Number.parseFloat(C.textEditor.style.fontSize);C.textEditor.clientWidth>=Number.parseInt(C.textEditor.style.maxWidth)&&U>.9;)U-=.1,C.textEditor.style.fontSize=Math.max(U,.9)+"em"}),this.textEditor.addEventListener("keyup",function(U){U.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(U){if(U.clipboardData){var q=U.clipboardData.getData("text"),V=window.getSelection();if(!V.rangeCount)return!1;V.deleteFromDocument(),V.getRangeAt(0).insertNode(document.createTextNode(q)),U.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){C.textEditDivClicked(C.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},v.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var C=this.getTextScale(),U=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),q=this.textElement.getBBox(),V={x:q.width*C,y:q.height*C};U.x-=V.x/2,U.y-=V.y/2,this.textEditor.style.top=U.y+"px",this.textEditor.style.left=U.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-U.x+"px",this.textEditor.style.fontSize=Math.max(16*C,12)+"px",this.textElement.style.display="none"}},v.prototype.textEditDivClicked=function(C){this.text=C.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},v.prototype.select=function(){X.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},v.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),X.prototype.deselect.call(this)},v.prototype.dblClick=function(C,U){X.prototype.dblClick.call(this,C,U),this.showTextEditor()},v.prototype.setColor=function(C){this.textElement&&oe.setAttributes(this.textElement,[["fill",C]]),this.color=C,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(C)},v.prototype.setFont=function(C){this.textElement&&oe.setAttributes(this.textElement,[["font-family",C]]),this.fontFamily=C,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},v.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},v.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},X.prototype.getState.call(this));return C.typeName=v.typeName,C},v.prototype.restoreState=function(C){var U=C;this.color=U.color,this.fontFamily=U.fontFamily,this.padding=U.padding,this.text=U.text,this.createVisual(),X.prototype.restoreState.call(this,C),this.setSize()},v.prototype.scale=function(C,U){X.prototype.scale.call(this,C,U),this.setSize(),this.sizeText(),this.positionTextEditor()},v.typeName="TextMarker",v.title="Text marker",v.icon='',v}(tt),xe=function(X){function v(C,U,q){var V=X.call(this,C,U,q)||this;return V.color="transparent",V.lineWidth=3,V.drawing=!1,V.pixelRatio=1,V.color=q.defaultColor,V.lineWidth=q.defaultStrokeWidth,V.pixelRatio=q.freehandPixelRatio,V.setColor=V.setColor.bind(V),V.addCanvas=V.addCanvas.bind(V),V.finishCreation=V.finishCreation.bind(V),V.setLineWidth=V.setLineWidth.bind(V),V.colorPanel=new Fe("Color",q.defaultColorSet,q.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.lineWidthPanel=new ut("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),V.lineWidthPanel.onWidthChanged=V.setLineWidth,V}return Se(v,X),v.prototype.ownsTarget=function(C){return!(!X.prototype.ownsTarget.call(this,C)&&C!==this.visual&&C!==this.drawingImage)},v.prototype.createVisual=function(){this.visual=oe.createGroup(),this.drawingImage=oe.createImage(),this.visual.appendChild(this.drawingImage);var C=oe.createTransform();this.visual.transform.baseVal.appendItem(C),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(C,U){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(C.x,C.y),this.drawing=!0):X.prototype.pointerDown.call(this,C,U)},v.prototype.manipulate=function(C){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(C.x,C.y),this.canvasContext.stroke()):X.prototype.manipulate.call(this,C)},v.prototype.resize=function(C){X.prototype.resize.call(this,C),oe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),oe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},v.prototype.pointerUp=function(C){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):X.prototype.pointerUp.call(this,C)},v.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},v.prototype.select=function(){this.state==="creating"&&this.finishCreation(),X.prototype.select.call(this)},v.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),X.prototype.deselect.call(this)},v.prototype.finishCreation=function(){for(var C=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),U=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],q=U[0],V=U[1],be=U[2],We=U[3],qe=!1,gt=0;gt0&&(qe=!0,gtWe&&(We=gt),Ge>be&&(be=Ge));if(qe){this.left=q/this.pixelRatio,this.top=V/this.pixelRatio,this.width=(be-q)/this.pixelRatio,this.height=(We-V)/this.pixelRatio;var xt=document.createElement("canvas");xt.width=be-q,xt.height=We-V,xt.getContext("2d").putImageData(this.canvasContext.getImageData(q,V,be-q,We-V),0,0),this.drawingImgUrl=xt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},v.prototype.setDrawingImage=function(){oe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),oe.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},v.prototype.setColor=function(C){this.color=C,this.colorChanged(C)},v.prototype.setLineWidth=function(C){this.lineWidth=C},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=Object.assign({drawingImgUrl:this.drawingImgUrl},X.prototype.getState.call(this));return C.typeName=v.typeName,C},v.prototype.restoreState=function(C){this.createVisual(),X.prototype.restoreState.call(this,C),this.drawingImgUrl=C.drawingImgUrl,this.setDrawingImage()},v.prototype.scale=function(C,U){X.prototype.scale.call(this,C,U),this.setDrawingImage()},v.typeName="FreehandMarker",v.title="Freehand marker",v.icon='',v}(tt),ye=function(X){function v(C,U,q){var V=X.call(this,C,q||'')||this;return V.typeBoxes=[],V.currentType=U,V.setCurrentType=V.setCurrentType.bind(V),V}return Se(v,X),v.prototype.getUi=function(){var C=this,U=document.createElement("div");U.style.display="flex",U.style.overflow="hidden",U.style.flexGrow="2";for(var q=function(We){var qe="both";switch(We){case 0:qe="both";break;case 1:qe="start";break;case 2:qe="end";break;case 3:qe="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=qe===V.currentType?V.uiStyleSettings.toolboxAccentColor:"transparent",gt.addEventListener("click",function(){C.setCurrentType(qe,gt)}),U.appendChild(gt),qe==="both"||qe==="start"){var Ge=document.createElement("div");Ge.style.display="flex",Ge.style.alignItems="center",Ge.style.minHeight="20px",Ge.innerHTML=``,Ge.style.marginLeft="5px",gt.appendChild(Ge)}var xt=document.createElement("div");xt.style.display="flex",xt.style.alignItems="center",xt.style.minHeight="20px",xt.style.flexGrow="2";var Wt=document.createElement("hr");if(Wt.style.minWidth="20px",Wt.style.border="0px",Wt.style.borderTop="3px solid "+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee"),Wt.style.flexGrow="2",xt.appendChild(Wt),gt.appendChild(xt),qe==="both"||qe==="end"){var Qt=document.createElement("div");Qt.style.display="flex",Qt.style.alignItems="center",Qt.style.minHeight="20px",Qt.innerHTML=``,Qt.style.marginRight="5px",gt.appendChild(Qt)}V.typeBoxes.push(gt)},V=this,be=0;be<4;be++)q(be);return U},v.prototype.setCurrentType=function(C,U){var q=this;this.currentType=C,this.typeBoxes.forEach(function(V){V.style.borderColor=V===U?q.uiStyleSettings!==void 0?q.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},v}(He),_e=function(X){function v(C,U,q){var V=X.call(this,C,U,q)||this;return V.arrowType="end",V.arrowBaseHeight=10,V.arrowBaseWidth=10,V.getArrowPoints=V.getArrowPoints.bind(V),V.setArrowType=V.setArrowType.bind(V),V.arrowTypePanel=new ye("Arrow type","end"),V.arrowTypePanel.onArrowTypeChanged=V.setArrowType,V}return Se(v,X),v.prototype.ownsTarget=function(C){return!(!X.prototype.ownsTarget.call(this,C)&&C!==this.arrow1&&C!==this.arrow2)},v.prototype.getArrowPoints=function(C,U){var q=this.arrowBaseWidth+2*this.strokeWidth,V=this.arrowBaseHeight+2*this.strokeWidth;return C-q/2+","+(U+V/2)+" "+C+","+(U-V/2)+" "+(C+q/2)+","+(U+V/2)},v.prototype.createTips=function(){this.arrow1=oe.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(oe.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=oe.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(oe.createTransform()),this.visual.appendChild(this.arrow2)},v.prototype.pointerDown=function(C,U){X.prototype.pointerDown.call(this,C,U),this.state==="creating"&&this.createTips()},v.prototype.adjustVisual=function(){if(X.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",oe.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),oe.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var C=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),U=this.arrow1.transform.baseVal.getItem(0);U.setRotate(C,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(U,0);var q=this.arrow2.transform.baseVal.getItem(0);q.setRotate(C+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(q,0)}},v.prototype.setArrowType=function(C){this.arrowType=C,this.adjustVisual(),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=Object.assign({arrowType:this.arrowType},X.prototype.getState.call(this));return C.typeName=v.typeName,C},v.prototype.restoreState=function(C){X.prototype.restoreState.call(this,C);var U=C;this.arrowType=U.arrowType,this.createTips(),this.adjustVisual()},v.typeName="ArrowMarker",v.title="Arrow marker",v.icon='',v}(nt),ne=function(X){function v(C,U,q){var V=X.call(this,C,U,q)||this;return V.fillColor=q.defaultFillColor,V.strokeWidth=0,V.fillPanel=new Fe("Color",q.defaultColorSet,q.defaultFillColor),V.fillPanel.onColorChanged=V.setFillColor,V}return Se(v,X),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=X.prototype.getState.call(this);return C.typeName=v.typeName,C},v.typeName="CoverMarker",v.title="Cover marker",v.icon='',v}(et),re=function(X){function v(C,U,q,V){var be=X.call(this,C,V||'')||this;return be.opacities=[],be.opacityBoxes=[],be.opacities=U,be.currentOpacity=q,be.setCurrentOpacity=be.setCurrentOpacity.bind(be),be}return Se(v,X),v.prototype.getUi=function(){var C=this,U=document.createElement("div");return U.style.display="flex",U.style.overflow="hidden",U.style.flexGrow="2",U.style.justifyContent="space-between",this.opacities.forEach(function(q){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="center",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=q===C.currentOpacity?C.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){C.setCurrentOpacity(q,V)}),U.appendChild(V);var be=document.createElement("div");be.innerText=100*q+"%",V.appendChild(be),C.opacityBoxes.push(V)}),U},v.prototype.setCurrentOpacity=function(C,U){var q=this;this.currentOpacity=C,this.opacityBoxes.forEach(function(V){V.style.borderColor=V===U?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},v}(He),de=function(X){function v(C,U,q){var V=X.call(this,C,U,q)||this;return V.setOpacity=V.setOpacity.bind(V),V.fillColor=q.defaultHighlightColor,V.strokeWidth=0,V.opacity=q.defaultHighlightOpacity,V.fillPanel=new Fe("Color",q.defaultColorSet,V.fillColor),V.fillPanel.onColorChanged=V.setFillColor,V.opacityPanel=new re("Opacity",q.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return Se(v,X),v.prototype.setOpacity=function(C){this.opacity=C,this.visual&&oe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=X.prototype.getState.call(this);return C.typeName=v.typeName,C},v.typeName="HighlightMarker",v.title="Highlight marker",v.icon='',v}(ne),me='',Ee=function(X){function v(C,U,q){var V=X.call(this,C,U,q)||this;return V.bgColor="transparent",V.tipPosition={x:0,y:0},V.tipBase1Position={x:0,y:0},V.tipBase2Position={x:0,y:0},V.tipMoving=!1,V.color=q.defaultStrokeColor,V.bgColor=q.defaultFillColor,V.fontFamily=q.defaultFontFamily,V.defaultSize={x:100,y:30},V.setBgColor=V.setBgColor.bind(V),V.getTipPoints=V.getTipPoints.bind(V),V.positionTip=V.positionTip.bind(V),V.setTipPoints=V.setTipPoints.bind(V),V.colorPanel=new Fe("Text color",q.defaultColorSet,V.color,''),V.colorPanel.onColorChanged=V.setColor,V.bgColorPanel=new Fe("Fill color",q.defaultColorSet,V.bgColor,me),V.bgColorPanel.onColorChanged=V.setBgColor,V.fontFamilyPanel=new De("Font",q.defaultFontFamilies,q.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V.tipGrip=new Ze,V.tipGrip.visual.transform.baseVal.appendItem(oe.createTransform()),V.controlBox.appendChild(V.tipGrip.visual),V}return Se(v,X),v.prototype.ownsTarget=function(C){return X.prototype.ownsTarget.call(this,C)||this.tipGrip.ownsTarget(C)||this.tip===C},v.prototype.createTip=function(){oe.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=oe.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},v.prototype.pointerDown=function(C,U){this.state==="new"&&X.prototype.pointerDown.call(this,C,U),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(U)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):X.prototype.pointerDown.call(this,C,U)},v.prototype.pointerUp=function(C){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,X.prototype.pointerUp.call(this,C);else{var U=this.state==="creating";X.prototype.pointerUp.call(this,C),this.setTipPoints(U),this.positionTip()}},v.prototype.manipulate=function(C){if(this.tipMoving){var U=this.unrotatePoint(C);this.tipPosition={x:U.x-this.manipulationStartLeft,y:U.y-this.manipulationStartTop},this.positionTip()}else X.prototype.manipulate.call(this,C)},v.prototype.setBgColor=function(C){this.bgRectangle&&this.tip&&(oe.setAttributes(this.bgRectangle,[["fill",C]]),oe.setAttributes(this.tip,[["fill",C]])),this.bgColor=C,this.fillColorChanged(C)},v.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},v.prototype.setTipPoints=function(C){C===void 0&&(C=!1);var U=Math.min(this.height/2,15),q=this.height/5;C&&(this.tipPosition={x:U+q/2,y:this.height+20});var V=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?V',v}(ze),Me=function(X){function v(C,U,q){var V=X.call(this,C,U,q)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.strokeColor=q.defaultColor,V.strokeWidth=q.defaultStrokeWidth,V.strokeDasharray=q.defaultStrokeDasharray,V.fillColor=q.defaultFillColor,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.setOpacity=V.setOpacity.bind(V),V.createVisual=V.createVisual.bind(V),V.strokePanel=new Fe("Line color",fe(q.defaultColorSet,["transparent"]),q.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.fillPanel=new Fe("Fill color",fe(q.defaultColorSet,["transparent"]),V.fillColor,me),V.fillPanel.onColorChanged=V.setFillColor,V.strokeWidthPanel=new ut("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Ye("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V.opacityPanel=new re("Opacity",q.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return Se(v,X),v.prototype.ownsTarget=function(C){return!(!X.prototype.ownsTarget.call(this,C)&&C!==this.visual)},v.prototype.createVisual=function(){this.visual=oe.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(C,U){X.prototype.pointerDown.call(this,C,U),this.state==="new"&&(this.createVisual(),this.moveVisual(C),this._state="creating")},v.prototype.manipulate=function(C){X.prototype.manipulate.call(this,C)},v.prototype.resize=function(C){X.prototype.resize.call(this,C),this.setSize()},v.prototype.setSize=function(){X.prototype.setSize.call(this),oe.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},v.prototype.pointerUp=function(C){X.prototype.pointerUp.call(this,C),this.setSize()},v.prototype.setStrokeColor=function(C){this.strokeColor=C,this.visual&&oe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(C),this.stateChanged()},v.prototype.setFillColor=function(C){this.fillColor=C,this.visual&&oe.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(C),this.stateChanged()},v.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.visual&&oe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},v.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.visual&&oe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},v.prototype.setOpacity=function(C){this.opacity=C,this.visual&&oe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this));return C.typeName=v.typeName,C},v.prototype.restoreState=function(C){var U=C;this.fillColor=U.fillColor,this.strokeColor=U.strokeColor,this.strokeWidth=U.strokeWidth,this.strokeDasharray=U.strokeDasharray,this.opacity=U.opacity,this.createVisual(),X.prototype.restoreState.call(this,C),this.setSize()},v.prototype.scale=function(C,U){X.prototype.scale.call(this,C,U),this.setSize()},v.typeName="EllipseMarker",v.title="Ellipse marker",v.icon='',v}(tt),je=function(X){function v(C,U,q){return X.call(this,C,U,q)||this}return Se(v,X),Object.defineProperty(v.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),v.prototype.ownsTarget=function(C){return!(!X.prototype.ownsTarget.call(this,C)&&C!==this.tip1&&C!==this.tip2)},v.prototype.createTips=function(){this.tip1=oe.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(oe.createTransform()),this.visual.appendChild(this.tip1),this.tip2=oe.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(oe.createTransform()),this.visual.appendChild(this.tip2)},v.prototype.pointerDown=function(C,U){X.prototype.pointerDown.call(this,C,U),this.state==="creating"&&this.createTips()},v.prototype.adjustVisual=function(){if(X.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(oe.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()]]),oe.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 C=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),U=this.tip1.transform.baseVal.getItem(0);U.setRotate(C,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(U,0);var q=this.tip2.transform.baseVal.getItem(0);q.setRotate(C+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(q,0)}},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=X.prototype.getState.call(this);return C.typeName=v.typeName,C},v.prototype.restoreState=function(C){X.prototype.restoreState.call(this,C),this.createTips(),this.adjustVisual()},v.typeName="MeasurementMarker",v.title="Measurement marker",v.icon='',v}(nt),it=function(X){function v(C,U,q){var V=X.call(this,C,U,q)||this;return V.strokePanel.colors=q.defaultColorSet,V.fillColor="transparent",V}return Se(v,X),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=X.prototype.getState.call(this);return C.typeName=v.typeName,C},v.typeName="EllipseFrameMarker",v.title="Ellipse frame marker",v.icon='',v}(Me),ft=function(){function X(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),X.prototype.addUndoStep=function(v){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(v)||(this.undoStack.push(v),JSON.stringify(this.lastRedoStep)!==JSON.stringify(v)&&this.redoStack.splice(0,this.redoStack.length))},X.prototype.replaceLastUndoStep=function(v){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=v)},X.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},X.prototype.undo=function(){if(this.undoStack.length>1){var v=this.undoStack.pop();return v!==void 0&&this.redoStack.push(v),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},X.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},X}(),ct=function(X){function v(C,U,q){var V=X.call(this,C,U,q)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.curveX=0,V.curveY=0,V.manipulationStartCurveX=0,V.manipulationStartCurveY=0,V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.positionGrips=V.positionGrips.bind(V),V.addControlGrips=V.addControlGrips.bind(V),V.adjustVisual=V.adjustVisual.bind(V),V.setupControlBox=V.setupControlBox.bind(V),V.resize=V.resize.bind(V),V.strokeColor=q.defaultColor,V.strokeWidth=q.defaultStrokeWidth,V.strokeDasharray=q.defaultStrokeDasharray,V.strokePanel=new Fe("Line color",q.defaultColorSet,q.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new ut("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Ye("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Se(v,X),v.prototype.ownsTarget=function(C){return!(!X.prototype.ownsTarget.call(this,C)&&C!==this.visual&&C!==this.selectorCurve&&C!==this.visibleCurve&&!this.curveGrip.ownsTarget(C))},v.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},v.prototype.createVisual=function(){this.visual=oe.createGroup(),this.selectorCurve=oe.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=oe.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(C,U){X.prototype.pointerDown.call(this,C,U),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=C.x,this.curveY=C.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(U)&&(this.activeGrip=this.curveGrip,this._state="resize")},v.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),oe.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),oe.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),oe.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},v.prototype.setupControlBox=function(){X.prototype.setupControlBox.call(this),this.curveControlLine1=oe.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=oe.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},v.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,X.prototype.addControlGrips.call(this)},v.prototype.positionGrips=function(){X.prototype.positionGrips.call(this);var C=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-C/2,this.curveY-C/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},v.prototype.manipulate=function(C){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+C.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+C.y-this.manipulationStartY),X.prototype.manipulate.call(this,C)},v.prototype.resize=function(C){this.activeGrip===this.curveGrip&&(this.curveX=C.x,this.curveY=C.y),X.prototype.resize.call(this,C),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},v.prototype.setStrokeColor=function(C){this.strokeColor=C,this.adjustVisual(),this.colorChanged(C)},v.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.adjustVisual()},v.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.adjustVisual()},v.prototype.scale=function(C,U){this.curveX=this.curveX*C,this.curveY=this.curveY*U,X.prototype.scale.call(this,C,U)},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},X.prototype.getState.call(this));return C.typeName=v.typeName,C},v.prototype.restoreState=function(C){X.prototype.restoreState.call(this,C);var U=C;this.strokeColor=U.strokeColor,this.strokeWidth=U.strokeWidth,this.strokeDasharray=U.strokeDasharray,this.curveX=U.curveX,this.curveY=U.curveY,this.createVisual(),this.adjustVisual()},v.typeName="CurveMarker",v.title="Curve marker",v.icon='',v}(lt),At=function(){function X(v,C){C===void 0&&(C=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=v,this.cancelable=C}return Object.defineProperty(X.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),X.prototype.preventDefault=function(){this._defaultPrevented=!0},X}(),wt=function(X){function v(C,U,q){var V=X.call(this,C,!1)||this;return V.dataUrl=U,V.state=q,V}return Se(v,X),v}(At),dt=function(X){function v(C,U,q){q===void 0&&(q=!1);var V=X.call(this,C,q)||this;return V.marker=U,V}return Se(v,X),v}(At),Ut=function(){function X(){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 X.prototype.addEventListener=function(v,C){this[v].push(C)},X.prototype.removeEventListener=function(v,C){var U=this[v].indexOf(C);U>-1&&this[v].splice(U,1)},X}(),vt=function(){function X(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 ft,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 Ut,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=X.instanceCounter++,this.styles=new Ae(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=v,this.targetRoot=document.body,this.width=v.clientWidth,this.height=v.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(X.prototype,"ALL_MARKER_TYPES",{get:function(){return[Xe,xe,_e,ze,it,Me,de,Ee,je,ne,nt,ct]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Xe,xe,_e,ze,Me,de,Ee]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Xe,xe,_e,ze,de]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(v){var C=this;this._availableMarkerTypes.splice(0),v.forEach(function(U){if(typeof U=="string"){var q=C.ALL_MARKER_TYPES.find(function(V){return V.typeName===U});q!==void 0&&C._availableMarkerTypes.push(q)}else C._availableMarkerTypes.push(U)})},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(v){this._zoomLevel=v,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),X.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),te.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},X.prototype.show=function(){var v=this;this.styles.styleSheetRoot===void 0&&ae.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ae.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(C){return C(new At(v))})},X.prototype.render=function(){return Ce(this,void 0,void 0,function(){var v;return pe(this,function(C){switch(C.label){case 0:return this.setCurrentMarker(),(v=new he).naturalSize=this.renderAtNaturalSize,v.imageType=this.renderImageType,v.imageQuality=this.renderImageQuality,v.markersOnly=this.renderMarkersOnly,v.width=this.renderWidth,v.height=this.renderHeight,[4,v.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return C.sent(),[4,v.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,C.sent()]}})})},X.prototype.close=function(v){var C=this;if(v===void 0&&(v=!1),this.isOpen){var U=!1;v||this.eventListeners.beforeclose.forEach(function(q){var V=new At(C,!0);q(V),V.defaultPrevented&&(U=!0)}),U||(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 At(C))}),this.detachEvents(),this._isOpen=!1)}},X.prototype.addMarkersToToolbar=function(){for(var v,C=[],U=0;Uthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*v:this.editorCanvas.clientWidth,U=C',v.title="Powered by marker.js",v.style.display="grid",v.style.alignItems="center",v.style.justifyItems="center",v.style.padding="3px",v.style.width="20px",v.style.height="20px",this.logoUI.appendChild(v),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},X.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")},X.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"},X.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},X.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var v=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=v+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Le(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(v),1),v.dispose()},X.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())},X.prototype.toolbarButtonClicked=function(v,C){if(v==="marker"&&C!==void 0)this.createNewMarker(C);else if(v==="action")switch(C){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()}},X.prototype.deleteSelectedMarker=function(){var v=this;if(this._currentMarker!==void 0){var C=!1;if(this.eventListeners.markerbeforedelete.forEach(function(q){var V=new dt(v,v._currentMarker,!0);q(V),V.defaultPrevented&&(C=!0)}),!C){var U=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 dt(v,U))})}}},X.prototype.clear=function(){var v=this,C=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(be){var We=new dt(v,void 0,!0);be(We),We.defaultPrevented&&(C=!0)}),!C)){this.setCurrentMarker();for(var U=function(be){var We=q.markers[be];q.setCurrentMarker(q.markers[be]),q._currentMarker.dispose(),q.markerImage.removeChild(q._currentMarker.container),q.markers.splice(q.markers.indexOf(q._currentMarker),1),q.eventListeners.markerdelete.forEach(function(qe){return qe(new dt(v,We))})},q=this,V=this.markers.length-1;V>=0;V--)U(V);this.addUndoStep()}},Object.defineProperty(X.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),X.prototype.showNotesEditor=function(){var v;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(v=this._currentMarker.notes)!==null&&v!==void 0?v:"",this.overlayContainer.appendChild(this.notesArea))},X.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)},X.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},X.prototype.addUndoStep=function(){var v=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var C=this.getState(),U=this.undoRedoManager.getLastUndoStep();if(!U||U.width===C.width&&U.height===C.height){var q=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(C),q1&&this.panTo({x:v.clientX,y:v.clientY}))},X.prototype.onPointerUp=function(v){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(v.clientX,v.clientY)),this.isDragging=!1,this.addUndoStep()},X.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},X.prototype.onKeyUp=function(v){this._currentMarker===void 0||this.notesArea!==void 0||v.key!=="Delete"&&v.key!=="Backspace"||this.deleteSelectedMarker()},X.prototype.clientToLocalCoordinates=function(v,C){var U=this.markerImage.getBoundingClientRect();return{x:(v-U.left)/this.zoomLevel,y:(C-U.top)/this.zoomLevel}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var v=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=v+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},X.prototype.addLicenseKey=function(v){te.addKey(v)},X.prototype.addEventListener=function(v,C){this.eventListeners.addEventListener(v,C)},X.prototype.removeEventListener=function(v,C){this.eventListeners.removeEventListener(v,C)},X.prototype.renderState=function(v){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(v),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(X.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),X.prototype.focus=function(){var v=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(C){return C(new At(v))}))},X.prototype.blur=function(){var v=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(C){return C(new At(v))}))},X.instanceCounter=0,X}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Rt=function(X,v){return(Rt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,U){C.__proto__=U}||function(C,U){for(var q in U)Object.prototype.hasOwnProperty.call(U,q)&&(C[q]=U[q])})(X,v)};function Lt(X,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");function C(){this.constructor=X}Rt(X,v),X.prototype=v===null?Object.create(v):(C.prototype=v.prototype,new C)}function Je(X,v,C,U){return new(C||(C=Promise))(function(q,V){function be(gt){try{qe(U.next(gt))}catch(Ge){V(Ge)}}function We(gt){try{qe(U.throw(gt))}catch(Ge){V(Ge)}}function qe(gt){var Ge;gt.done?q(gt.value):(Ge=gt.value,Ge instanceof C?Ge:new C(function(xt){xt(Ge)})).then(be,We)}qe((U=U.apply(X,v||[])).next())})}function li(X,v){var C,U,q,V,be={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return V={next:We(0),throw:We(1),return:We(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function We(qe){return function(gt){return function(Ge){if(C)throw new TypeError("Generator is already executing.");for(;be;)try{if(C=1,U&&(q=2&Ge[0]?U.return:Ge[0]?U.throw||((q=U.return)&&q.call(U),0):U.next)&&!(q=q.call(U,Ge[1])).done)return q;switch(U=0,q&&(Ge=[2&Ge[0],q.value]),Ge[0]){case 0:case 1:q=Ge;break;case 4:return be.label++,{value:Ge[1],done:!1};case 5:be.label++,U=Ge[1],Ge=[0];continue;case 7:Ge=be.ops.pop(),be.trys.pop();continue;default:if(!(q=be.trys,(q=q.length>0&&q[q.length-1])||Ge[0]!==6&&Ge[0]!==2)){be=0;continue}if(Ge[0]===3&&(!q||Ge[1]>q[0]&&Ge[1]0&&C>0){var U=new zi(v,C),q=U.ratio>=1?20:U.getHorizontalLength(20),V=U.ratio<1?20:U.getVerticalLength(20),be=document.createElementNS("http://www.w3.org/2000/svg","svg");be.setAttribute("xmlns","http://www.w3.org/2000/svg"),be.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(be);var We=Qe.createDefs();be.appendChild(We);var qe=Qe.createElement("clipPath",[["id","text-bg-clip"]]);We.appendChild(qe);var gt=Qe.createPath(Qe.getHollowRectanglePath((24-q)/2,(24-V)/2,q,V,(24-q)/2+2,(24-V)/2+2,q-4,V-4));be.appendChild(gt);var Ge=Qe.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ge.appendChild(Qe.createTSpan(v+":"+C)),be.appendChild(Ge);var xt=Ge.getBBox();Qe.setAttributes(Ge,[["x",((24-xt.width)/2).toString()],["y",((24-xt.height)/2-xt.y).toString()]]);var Wt=Qe.createPath(Qe.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(xt.width))/2,(24-Math.ceil(xt.height))/2,Math.ceil(xt.width),Math.ceil(xt.height)));return qe.appendChild(Wt),Qe.setAttributes(gt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(be),be.outerHTML}return''},X}(),bi=function(X){function v(C,U,q){var V=X.call(this,C,U)||this;return V.isDropdownOpen=!1,V.onClick=V.dropdownButtonClicked,V.dropdownButtons=q,V}return Lt(v,X),v.prototype.setupDropdown=function(){var C=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(U){U.className=C.className,U.colorsClassName=C.colorsClassName,C.dropdownBlock.appendChild(U.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},v.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},v.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},v.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},v.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},v.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},v}(jt),Pt=function(){function X(v,C){this.GRIP_SIZE=10,this.color=v,this.fillColor=C,this.visual=Qe.createGroup(),this.visual.appendChild(Qe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Qe.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(v){return v===this.visual||v===this.visual.childNodes[0]||v===this.visual.childNodes[1]},X.prototype.setCenter=function(v,C){this.visual.childNodes.forEach(function(U){return Qe.setAttributes(U,[["cx",v.toString()],["cy",C.toString()]])})},X}(),Hi=function(){function X(v,C,U,q){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=v,this.canvasHeight=C,this.margin=U,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(X.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(v){this._aspectRatio=v,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(v){this._isGridVisible=v,this.gridContainer&&Qe.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(v){this._zoomFactor=v,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),X.prototype.open=function(){var v=this;this.cropShadeElement=Qe.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Qe.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var C=0;Cthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-C.height/2),Qe.setAttributes(this.cropRectElement,[["x",C.x.toString()],["y",C.y.toString()],["width",C.width.toString()],["height",C.height.toString()]]);var U=C.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(V,be){var We=C.y+U*(be+1);Qe.setAttributes(V,[["x1",""+C.x],["y1",""+We],["x2",""+(C.x+C.width)],["y2",""+We]])});var q=C.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(V,be){var We=C.x+q*(be+1);Qe.setAttributes(V,[["x1",""+We],["y1",""+C.y],["x2",""+We],["y2",""+(C.y+C.height)]])}),Qe.setAttributes(this.cropShadeElement,[["d",Qe.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,C.x,C.y,C.width,C.height)]]),this.topLeftGrip.setCenter(C.x,C.y),this.topRightGrip.setCenter(C.x+C.width,C.y),this.bottomLeftGrip.setCenter(C.x,C.y+C.height),this.bottomRightGrip.setCenter(C.x+C.width,C.y+C.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},X.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)},X.prototype.clientToLocalCoordinates=function(v,C){var U=this.container.getBoundingClientRect();return{x:v-U.left+this.margin,y:C-U.top+this.margin}},X.prototype.onPointerDown=function(v){this.container.setPointerCapture(v.pointerId),this.previousPoint=this.clientToLocalCoordinates(v.clientX,v.clientY),this.cropRectElement===v.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(v.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(v.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(v.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(v.target)&&(this.activeGrip=this.bottomRightGrip)},X.prototype.onPointerMove=function(v){if(this.isMoving)this.move(this.clientToLocalCoordinates(v.clientX,v.clientY));else if(this.activeGrip){var C=this.clientToLocalCoordinates(v.clientX,v.clientY);this.resize(C)}v.preventDefault()},X.prototype.onPointerUp=function(v){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(v.pointerId)},X.prototype.move=function(v){var C=v.x-this.previousPoint.x,U=v.y-this.previousPoint.y;this.zoomFactor!==1&&(C=-C/this.zoomFactor,U=-U/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+C),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+U),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=v},X.prototype.resize=function(v){var C=Object.assign({},this.cropRect),U=v.x-this.previousPoint.x,q=v.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:C.x+Uthis.canvasWidth*this.zoomFactor&&(U=this.canvasWidth*this.zoomFactor-C.width),C.width+=U}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(C.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(U),C.height=this.aspectRatio.getVerticalLength(C.width)):(C.y+=q,C.height=this.cropRect.y+this.cropRect.height-C.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?C.height=this.aspectRatio.getVerticalLength(C.width):C.height+=q}C.width<10&&(C.x=this.cropRect.x,C.width=10),C.height<10&&(C.y=this.cropRect.y,C.height=10),this.previousPoint=v,C.x>=this.margin&&C.y>=this.margin&&C.x-this.margin+C.width<=this.canvasWidth&&C.y-this.margin+C.height<=this.canvasHeight&&(this.cropRect=C,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},X.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var v=this.cropRect.x+this.cropRect.width/2,C=this.cropRect.y+this.cropRect.height/2,U=this.aspectRatio.getHorizontalLength(this.cropRect.height),q=this.aspectRatio.getVerticalLength(this.cropRect.width);U/this.canvasWidththis.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=v-this.cropRect.width/2,this.cropRect.y=C-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)}},X.prototype.getRescaledRect=function(v,C,U,q,V,be){var We=U/v,qe=q/C;return{x:(V.x-be)*We+be,y:(V.y-be)*qe+be,width:V.width*We,height:V.height*qe}},X.prototype.scaleCanvas=function(v,C){var U=this.getRescaledRect(this.canvasWidth,this.canvasHeight,v,C,this.cropRect,this.margin);this.canvasWidth=v,this.canvasHeight=C,this.onCropChange&&this.onCropChange(U),this.setCropRectangle(U)},X}(),Xi=function(){function X(v){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=v,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(X.prototype,"angle",{get:function(){return this._angle},set:function(v){this._angle=v,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),X.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},X.prototype.onPointerDown=function(v){this.controlContainer.setPointerCapture(v.pointerId),this.isDragging=!0,this.previousPoint={x:v.clientX,y:v.clientY}},X.prototype.onPointerMove=function(v){this.isDragging&&(this.onAngleChange&&this.onAngleChange((v.clientX-this.previousPoint.x)/5),this.previousPoint.x=v.clientX)},X.prototype.onPointerUp=function(v){this.isDragging&&this.onAngleChange&&this.onAngleChange((v.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(v.pointerId)},X.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var v=this.angleLabelText.getBBox();Qe.setAttributes(this.angleLabelElement,[["x",((this.width-v.width)/2).toString()],["y",(this.height/2).toString()]])}},X.prototype.positionScaleShape=function(){if(this.scaleShape){var v=this.scaleShape.transform.baseVal.getItem(0);v.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(v,0)}},X.prototype.getVisual=function(){var v=document.createElementNS("http://www.w3.org/2000/svg","svg");v.setAttribute("xmlns","http://www.w3.org/2000/svg"),v.setAttribute("width",this.width+"px"),v.setAttribute("height",this.height+"px"),v.setAttribute("viewBox","0 0 "+this.width+" "+this.height),v.style.flexShrink="0",document.body.appendChild(v);for(var C="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,U=1;U<=this.width/5+10;U++){var q=U%5==0?this.height/3:this.height/6;C+="h4v"+-q+"h1v"+q}C+="v1H0Z",this.scaleShape=Qe.createPath(C);var V=Qe.createTransform();this.scaleShape.transform.baseVal.appendItem(V),v.appendChild(this.scaleShape),this.angleLabelElement=Qe.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Qe.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var be=Qe.createTSpan("");return be.innerHTML="°",this.angleLabelElement.appendChild(be),v.appendChild(this.angleLabelElement),document.body.removeChild(v),v},X}(),pn=function(){function X(){this.naturalSize=!1,this.imageType="image/png"}return X.prototype.rasterize=function(v,C,U,q,V,be,We){var qe=this;return new Promise(function(gt){var Ge=document.createElement("canvas");Ge.width=v.width.baseVal.value-2*q,Ge.height=v.height.baseVal.value-2*q;var xt=1,Wt=1;qe.naturalSize===!0?(xt=C.naturalWidth/(v.width.baseVal.value-2*q)/be,Wt=C.naturalHeight/(v.height.baseVal.value-2*q)/We,Ge.width=C.naturalWidth/be,Ge.height=C.naturalHeight/We):qe.width!==void 0&&qe.height!==void 0&&(xt=qe.width/U.width,Wt=qe.height/U.height,Ge.width*=xt,Ge.height*=Wt);var Qt=Ge.getContext("2d");Qt.translate(Ge.width/2,Ge.height/2),Qt.rotate(V*Math.PI/180),Qt.scale(be,We),Qt.translate(-Ge.width/2,-Ge.height/2),Qt.drawImage(C,0,0,Ge.width,Ge.height);var Ni=document.createElement("canvas");Ni.width=U.width*xt,Ni.height=U.height*Wt,Ni.getContext("2d").putImageData(Qt.getImageData((U.x-q)*xt,(U.y-q)*Wt,U.width*xt,U.height*Wt),0,0),gt(Ni.toDataURL(qe.imageType,qe.imageQuality))})},X}(),Ve=function(){function X(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=X.instanceCounter++,this.styles=new yt(this.instanceNo),this.target=v,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(v){this._zoomToCropEnabled=v,v?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(v){this._isGridVisible=v,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"gridLines",{get:function(){return this._gridLines},set:function(v){this._gridLines=v,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(v){this._rotationAngle=v,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"aspectRatio",{get:function(){var v;return(v=this._aspectRatio)!==null&&v!==void 0?v:this.aspectRatios[0]},set:function(v){this._aspectRatio=v},enumerable:!1,configurable:!0}),X.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},X.prototype.show=function(){this.showUI(),this.open()},X.prototype.close=function(v){v===void 0&&(v=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),v||this.closeEventListeners.forEach(function(C){return C()}),this._isOpen=!1)},X.prototype.addRenderEventListener=function(v){this.renderEventListeners.push(v)},X.prototype.removeRenderEventListener=function(v){this.renderEventListeners.indexOf(v)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(v),1)},X.prototype.addCloseEventListener=function(v){this.closeEventListeners.push(v)},X.prototype.removeCloseEventListener=function(v){this.closeEventListeners.indexOf(v)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(v),1)},X.prototype.setupResizeObserver=function(){var v=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){v.resize(v.target.clientWidth,v.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},X.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var v=1*this.target.clientWidth/this.target.clientHeight,C=this.contentDiv.clientWidth/v>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*v:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,U=C+2*this.CANVAS_MARGINv+this.CANVAS_MARGIN?this.target.offsetTop-(v+this.CANVAS_MARGIN):0;this.coverDiv.style.top=C+"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},X.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},X.prototype.addTopToolbar=function(){var v=this;this.topToolbar=new Jt,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 C=new en;C.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(C);var U=[];this.aspectRatios.forEach(function(Wt){var Qt=new jt(tn.getIcon(Wt.horizontal,Wt.vertical),Wt.horizontal===0&&Wt.vertical===0?"FREE":Wt.horizontal+":"+Wt.vertical);Qt.onClick=function(){return v.ratioButtonClicked(Wt)},U.push(Qt)}),this.aspectRatioButton=new bi(tn.getIcon(0,0),"Aspect ratio",U),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,C.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var q=new jt('',"Toggle grid");q.isActive=this.isGridVisible,q.onClick=function(){v.isGridVisible=!v.isGridVisible,q.isActive=v.isGridVisible},C.addButton(q);var V=new jt('',"Zoom to selection");if(V.isActive=this.zoomToCropEnabled,V.onClick=function(){v.zoomToCropEnabled=!v.zoomToCropEnabled,V.isActive=v.zoomToCropEnabled},C.addButton(V),!mi.isLicensed){var be=new mt;this.topToolbar.addElementBlock(be);var We=document.createElement("div");We.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var qe=document.createElement("a");qe.style.color="currentColor",qe.href="https://markerjs.com/products/cropro",qe.target="_blank",qe.innerHTML='',We.appendChild(qe),be.addElement(We)}var gt=new en;gt.minWidth=3*this.toolbarHeight+"px",gt.contentAlign="end",this.topToolbar.addButtonBlock(gt);var Ge=new jt('',"OK");Ge.onClick=this.startRenderAndClose,gt.addButton(Ge),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ge.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var xt=new jt('',"Close");xt.onClick=this.close,gt.addButton(xt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(xt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},X.prototype.addBottomToolbar=function(){var v=this;this.bottomToolbar=new Jt,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 C=new en;C.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(C);var U=new jt('',"Rotate left");U.onClick=this.rotateLeftButtonClicked,C.addButton(U);var q=new jt('',"Rotate right");q.onClick=this.rotateRightButtonClicked,C.addButton(q);var V=new mt;V.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(V),this.straightener=new Xi("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){v.rotateBy(gt),v.straightener.angle=v.rotationAngle},V.addElement(this.straightener.getUI());var be=new en;be.minWidth=2*this.toolbarHeight+"px",be.contentAlign="end",this.bottomToolbar.addButtonBlock(be);var We=new jt('',"Flip horizontal");We.onClick=this.flipHorizontallyButtonClicked,be.addButton(We);var qe=new jt('',"Flip vertical");qe.onClick=this.flipVerticallyButtonClicked,be.addButton(qe)},X.prototype.ratioButtonClicked=function(v){this.aspectRatio=v,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},X.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=tn.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},X.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new zi(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},X.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},X.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},X.prototype.restoreState=function(v){if(v){var C=this.cropLayer.getRescaledRect(v.width,v.height,this.imageWidth,this.imageHeight,v.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(C),this.cropRectChanged(C),this.flippedHorizontally=v.flippedHorizontally,this.flippedVertically=v.flippedVertically,this.applyFlip(),this.rotationAngle=v.rotationAngle,this.applyRotation()}},X.prototype.clientToLocalCoordinates=function(v,C){var U=this.cropImage.getBoundingClientRect();return{x:v-U.left,y:C-U.top}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var v=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=v+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},X.prototype.rotateLeftButtonClicked=function(){var v=this.rotationAngle-90;this.rotationAngle%90!=0&&(v+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(v)},X.prototype.rotateRightButtonClicked=function(){var v=this.rotationAngle+90;this.rotationAngle%90!=0&&(v-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(v)},X.prototype.rotateTo=function(v){v=(v=v>180?v-360:v)<=-180?v+360:v,this.rotationAngle=v,this.applyRotation()},X.prototype.rotateBy=function(v){this.rotateTo((this.rotationAngle+v)%360)},X.prototype.applyRotation=function(){var v=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var C=this.editingTargetRotationContainer.transform.baseVal.getItem(0);C.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(C,0);var U=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/U.width,this.imageHeight/U.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=v},X.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},X.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},X.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},X.prototype.startRenderAndClose=function(){return Je(this,void 0,void 0,function(){var v,C;return li(this,function(U){switch(U.label){case 0:return[4,this.render()];case 1:return v=U.sent(),C=this.getState(),this.renderEventListeners.forEach(function(q){return q(v,C)}),this.close(!0),[2]}})})},X.prototype.render=function(){return Je(this,void 0,void 0,function(){var v;return li(this,function(C){switch(C.label){case 0:return(v=new pn).naturalSize=this.renderAtNaturalSize,v.imageType=this.renderImageType,v.imageQuality=this.renderImageQuality,v.width=this.renderWidth,v.height=this.renderHeight,this.unzoomFromCrop(),Qe.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,v.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return C.sent(),[4,v.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,C.sent()]}})})},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new kt("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 kt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new kt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var v=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new kt("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*v)+`px;
height: `+(this.toolbarHeight-2*v)+`px;
padding: `+v+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new kt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new kt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new It("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new It("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new kt("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 kt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new kt("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 kt("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*v)+`px;
padding: `+v+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new kt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},X.instanceCounter=0,X}(),Ct=le("8hTe"),mn=le.n(Ct),gn=/]*>/g;function vn(X){var v=document.createElement("div");return v.innerHTML=X,v.childNodes.length===0?"":v.childNodes[0].nodeValue}var yn=ot.a=function(X){var v=X.value,C=v===void 0?"":v,U=X.edit,q=U===void 0?!1:U,V=X.className,be=X.showTextOnly,We=X.showLines,qe=X.replaces,gt=X.zoomImg,Ge=X.hasMask,xt=X.style,Wt=xt===void 0?{}:xt,Qt=X.stylesPrev,Ni=Qt===void 0?{}:Qt,_i=String(C),Ei=Object(R.useRef)(),Yi=Object(R.useRef)(),kn=Object(R.useState)(""),ui=Object(K.a)(kn,2),ji=ui[0],ln=ui[1],un=Object(R.useState)("office"),Fi=Object(K.a)(un,2),Dn=Fi[0],bn=Fi[1],Kn=function(){var Gt=new Ve(Yi.current);Gt.displayMode="popup",Gt.addRenderEventListener(function(){var gi=Object(N.a)(P.a.mark(function Nt(ni){var Vt;return P.a.wrap(function(hi){for(;;)switch(hi.prev=hi.next){case 0:return Ei.current.style.display="none",hi.next=3,Object(we.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ni}});case 3:Vt=hi.sent,Vt!=null&&Vt.id&&qe(Yi.current.getAttribute("src").replace(Y.a.API_SERVER,""),"/api/attachments/".concat(Vt==null?void 0:Vt.id,"?type=").concat(Vt.content_type));case 5:case"end":return hi.stop()}},Nt)}));return function(Nt){return gi.apply(this,arguments)}}()),Gt.show()},Vn=function(){var Gt=new vt(Yi.current);Gt.settings.displayMode="popup",Gt.addEventListener("render",function(){var gi=Object(N.a)(P.a.mark(function Nt(ni){var Vt;return P.a.wrap(function(hi){for(;;)switch(hi.prev=hi.next){case 0:if(Ei.current.style.display="none",!Yi.current){hi.next=6;break}return hi.next=4,Object(we.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ni.dataUrl}});case 4:Vt=hi.sent,Vt!=null&&Vt.id&&qe(Yi.current.getAttribute("src").replace(Y.a.API_SERVER,""),"/api/attachments/".concat(Vt==null?void 0:Vt.id,"?type=").concat(Vt.content_type));case 6:case"end":return hi.stop()}},Nt)}));return function(Nt){return gi.apply(this,arguments)}}()),Gt.show(),window.markerArea=Gt},$i=Object(R.useMemo)(function(){Ei.current&&(Ei.current.style.zIndex=-1);try{var ti=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Gt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,gi=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;_i=_i.replace(ti,"("+Y.a.API_SERVER+"/api/attachments/").replace(Gt,'"'+Y.a.API_SERVER+"/api/attachments/").replace(gi,'"'+Y.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(nn){}var Nt=H(_i),ni=b();if(_i.match(/\[TOC\]/)&&(Nt=Nt.replace("[TOC]
",O()),L()),Nt=Nt.replace(/(__special_katext_id_\d+__)/g,function(nn,hi){var Ci=ni[hi],Xn=Ci.type,xn=Ci.expression;return Object(ie.renderToString)(vn(xn)||"",{displayMode:Xn==="block",throwOnError:!1,output:"html"})}),Nt=Nt.replace(/▁/g,"\u2581\u2581\u2581"),g(),be){var Vt=document.createElement("div");return Vt.innerHTML=Nt,Vt.innerText}return setTimeout(function(){return dr()},500),Nt},[_i]),Ki=Object(R.useRef)();w.WebkitLineClamp=We,We&&(Wt=Object(B.a)(Object(B.a)({},Wt),w));function _n(ti){var Gt=ti.target;if(Gt.tagName.toUpperCase()==="IMG"){if(gt){var gi=Gt.getAttribute("src");ln(gi),bn("image")}}else if(Gt.tagName.toUpperCase()==="A"){var Nt=Gt.getAttribute("href");if(Nt.indexOf("office")>-1)ti.preventDefault(),ln(Nt),bn("office");else if(Nt.indexOf("application/pdf")>-1)ti.preventDefault(),ln(Nt),bn("pdf");else if(Nt.indexOf("text/html")>-1)ti.preventDefault(),ln(Nt),bn("html");else if(Nt.startsWith("#")){ti.preventDefault();var ni=document.getElementById(Nt.replace("#",""));ni&&ni.scrollIntoView(!0)}}}var dr=function(){var Gt,gi=(Gt=Ki.current)===null||Gt===void 0?void 0:Gt.querySelectorAll("video");gi==null||gi.forEach(function(Nt){if(Nt.oncontextmenu=function(){return!1},Nt.src.indexOf(".m3u8")>-1&&!Nt.canPlayType("application/vnd.apple.mpegurl")){if(G.a.isSupported()){var ni=new G.a;ni.loadSource(Nt.src),ni.attachMedia(Nt)}}})};Object(R.useEffect)(function(){if(Ki.current&&$i&&($i.match(gn)&&window.PR.prettyPrint()),Ki.current)return Ki.current.addEventListener("click",_n),function(){Ki.current.removeEventListener("click",_n),g(),L()}},[$i,Ki.current,_n]);var En=function(Gt){if(!q)return;Gt.target.nodeName==="IMG"?(Ei.current.style.zIndex=1,Ei.current.style.display="flex",Ei.current.style.width=Gt.target.clientWidth+"px",Ei.current.style.height=Gt.target.clientHeight+"px",Ei.current.style.top=Gt.target.offsetTop+"px",Ei.current.style.left=Gt.target.offsetLeft+"px",Yi.current.src=Gt.target.getAttribute("src")):Ei.current.style.display="none"};return m.a.createElement("div",{style:{position:"relative"}},m.a.createElement("div",{ref:Ki,style:Object(B.a)({},Wt),className:"".concat(V||""," markdown-body ").concat(mn.a.mdBody),onMouseOver:En,dangerouslySetInnerHTML:{__html:$i}}),m.a.createElement("div",{ref:Ei,className:mn.a.button},m.a.createElement(Z.a,null,m.a.createElement(Q.a,{onClick:function(){return Kn()}},"\u88C1\u526A"),m.a.createElement(Q.a,{onClick:function(){return Vn()}},"\u7F16\u8F91"))),m.a.createElement("img",{ref:Yi,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),m.a.createElement(se.a,{close:!0,data:ji,type:ji!=null&&ji.length?Dn:"",style:Object(B.a)({},Ni),onClose:function(){return ln("")}}))}},"9VGf":function(_t,ot,le){"use strict";le.d(ot,"a",function(){return M});var ue=le("q1tI"),Z=le.n(ue);function M(Q,B){var N=Object(ue.useRef)();Object(ue.useEffect)(function(){N.current=Q}),Object(ue.useEffect)(function(){function K(){N.current()}if(B!==null){var W=setInterval(K,B);return function(){return clearInterval(W)}}},[B])}},BU3w:function(_t,ot,le){"use strict";le.d(ot,"a",function(){return N});var ue=le("MNnm"),Z="rc-util-key";function M(K){if(K.attachTo)return K.attachTo;var W=document.querySelector("head");return W||document.body}function Q(K){var W,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ue.a)())return null;var R=document.createElement("style");if((W=P.csp)===null||W===void 0?void 0:W.nonce){var m;R.nonce=(m=P.csp)===null||m===void 0?void 0:m.nonce}R.innerHTML=K;var p=M(P),f=p.firstChild;return P.prepend&&p.prepend?p.prepend(R):P.prepend&&f?p.insertBefore(R,f):p.appendChild(R),R}var B=new Map;function N(K,W){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},R=M(P);if(!B.has(R)){var m=Q("",P),p=m.parentNode;B.set(R,p),p.removeChild(m)}var f=Array.from(B.get(R).children).find(function(a){return a.tagName==="STYLE"&&a[Z]===W});if(f){var h,s;if(((h=P.csp)===null||h===void 0?void 0:h.nonce)&&f.nonce!==((s=P.csp)===null||s===void 0?void 0:s.nonce)){var u;f.nonce=(u=P.csp)===null||u===void 0?void 0:u.nonce}return f.innerHTML!==K&&(f.innerHTML=K),f}var l=Q(K,P);return l[Z]=W,l}},Bd2K:function(_t,ot,le){(function(ue){ue(le("VrN/"),le("osHv"))})(function(ue){ue.defineOption("autoCloseTags",!1,function(P,R,m){if(m!=ue.Init&&m&&P.removeKeyMap("autoCloseTags"),!R)return;var p={name:"autoCloseTags"};(typeof R!="object"||R.whenClosing!==!1)&&(p["'/'"]=function(f){return N(f)}),(typeof R!="object"||R.whenOpening!==!1)&&(p["'>'"]=function(f){return Q(f)}),P.addKeyMap(p)});var Z=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],M=["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 Q(P){if(P.getOption("disableInput"))return ue.Pass;for(var R=P.listSelections(),m=[],p=P.getOption("autoCloseTags"),f=0;fh.ch&&(o=o.slice(0,o.length-s.end+h.ch));var T=o.toLowerCase();if(!o||s.type=="string"&&(s.end!=h.ch||!/[\"\']/.test(s.string.charAt(s.string.length-1))||s.string.length==1)||s.type=="tag"&&a.close||s.string.indexOf("/")==h.ch-s.start-1||L&&K(L,T)>-1||W(P,u.mode.xmlCurrentContext&&u.mode.xmlCurrentContext(l)||[],o,h,!0))return ue.Pass;var O=typeof p=="object"&&p.emptyTags;if(O&&K(O,o)>-1){m[f]={text:"/>",newPos:ue.Pos(h.line,h.ch+2)};continue}var A=w&&K(w,T)>-1;m[f]={indent:A,text:">"+(A?`
`:"")+""+o+">",newPos:A?ue.Pos(h.line+1,0):ue.Pos(h.line,h.ch+1)}}for(var x=typeof p=="object"&&p.dontIndentOnAutoClose,f=R.length-1;f>=0;f--){var S=m[f];P.replaceRange(S.text,R[f].head,R[f].anchor,"+insert");var E=P.listSelections().slice(0);E[f]={head:S.newPos,anchor:S.newPos},P.setSelections(E),!x&&S.indent&&(P.indentLine(S.newPos.line,null,!0),P.indentLine(S.newPos.line+1,null,!0))}}function B(P,R){for(var m=P.listSelections(),p=[],f=R?"/":"",h=P.getOption("autoCloseTags"),s=typeof h=="object"&&h.dontIndentOnSlash,u=0;u"&&(L+=">"),p[u]=L}if(P.replaceSelections(p),m=P.listSelections(),!s)for(var u=0;u=0&&R[l]==m;l--)++u;p=s.to;for(var l=1;l0){for(var R=0;R1&&arguments[1]!==void 0?arguments[1]:"",R=[],m=0;mxe.length)&&(ye=xe.length);for(var _e=0,ne=new Array(ye);_e=xe.length?{done:!0}:{done:!1,value:xe[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 _e=xe[Symbol.iterator](),_e.next.bind(_e)}function N(xe,ye){return ye={exports:{}},xe(ye,ye.exports),ye.exports}var K=N(function(xe){function ye(){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 _e(ne){xe.exports.defaults=ne}xe.exports={defaults:ye(),getDefaults:ye,changeDefaults:_e}}),W=K.defaults,P=K.getDefaults,R=K.changeDefaults,m=/[&<>"']/,p=/[&<>"']/g,f=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,s={"&":"&","<":"<",">":">",'"':""","'":"'"},u=function(ye){return s[ye]};function l(xe,ye){if(ye){if(m.test(xe))return xe.replace(p,u)}else if(f.test(xe))return xe.replace(h,u);return xe}var a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function o(xe){return xe.replace(a,function(ye,_e){return _e=_e.toLowerCase(),_e==="colon"?":":_e.charAt(0)==="#"?_e.charAt(1)==="x"?String.fromCharCode(parseInt(_e.substring(2),16)):String.fromCharCode(+_e.substring(1)):""})}var c=/(^|[^\[])\^/g;function L(xe,ye){xe=xe.source||xe,ye=ye||"";var _e={replace:function(re,de){return de=de.source||de,de=de.replace(c,"$1"),xe=xe.replace(re,de),_e},getRegex:function(){return new RegExp(xe,ye)}};return _e}var w=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function O(xe,ye,_e){if(xe){var ne;try{ne=decodeURIComponent(o(_e)).replace(w,"").toLowerCase()}catch(re){return null}if(ne.indexOf("javascript:")===0||ne.indexOf("vbscript:")===0||ne.indexOf("data:")===0)return null}ye&&!T.test(_e)&&(_e=d(ye,_e));try{_e=encodeURI(_e).replace(/%25/g,"%")}catch(re){return null}return _e}var A={},x=/^[^:]+:\/*[^/]*$/,S=/^([^:]+:)[\s\S]*$/,E=/^([^:]+:\/*[^/]*)[\s\S]*$/;function d(xe,ye){A[" "+xe]||(x.test(xe)?A[" "+xe]=xe+"/":A[" "+xe]=F(xe,"/",!0)),xe=A[" "+xe];var _e=xe.indexOf(":")===-1;return ye.substring(0,2)==="//"?_e?ye:xe.replace(S,"$1")+ye:ye.charAt(0)==="/"?_e?ye:xe.replace(E,"$1")+ye:xe+ye}var b={exec:function(){}};function g(xe){for(var ye=1,_e,ne;ye=0&&Ee[je]==="\\";)Me=!Me;return Me?"|":" |"}),ne=_e.split(/ \|/),re=0;if(ne.length>ye)ne.splice(ye);else for(;ne.length=ne.length?re.slice(ne.length):re}).join(`
`)}var ve=function(){function xe(_e){this.options=_e||k}var ye=xe.prototype;return ye.space=function(ne){var re=this.rules.block.newline.exec(ne);if(re)return re[0].length>1?{type:"space",raw:re[0]}:{raw:`
`}},ye.code=function(ne,re){var de=this.rules.block.code.exec(ne);if(de){var me=re[re.length-1];if(me&&me.type==="paragraph")return{raw:de[0],text:de[0].trimRight()};var Ee=de[0].replace(/^ {4}/gm,"");return{type:"code",raw:de[0],codeBlockStyle:"indented",text:this.options.pedantic?Ee:y(Ee,`
`)}}},ye.fences=function(ne){var re=this.rules.block.fences.exec(ne);if(re){var de=re[0],me=we(de,re[3]||"");return{type:"code",raw:de,lang:re[2]?re[2].trim():re[2],text:me}}},ye.heading=function(ne){var re=this.rules.block.heading.exec(ne);if(re)return{type:"heading",raw:re[0],depth:re[1].length,text:re[2]}},ye.nptable=function(ne){var re=this.rules.block.nptable.exec(ne);if(re){var de={type:"table",header:G(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(`
`):[],raw:re[0]};if(de.header.length===de.align.length){var me=de.align.length,Ee;for(Ee=0;Ee ?/gm,"");return{type:"blockquote",raw:re[0],text:de}}},ye.list=function(ne){var re=this.rules.block.list.exec(ne);if(re){for(var de=re[0],me=re[2],Ee=me.length>1,Me=me[me.length-1]===")",je={type:"list",raw:de,ordered:Ee,start:Ee?+me.slice(0,-1):"",loose:!1,items:[]},it=re[0].match(this.rules.block.item),ft=!1,ct,At,wt,dt,Ut,vt,Rt,Lt=it.length,Je=0;Je1||this.options.smartLists&&wt!==me)&&(dt=it.slice(Je+1).join(`
`),je.raw=je.raw.substring(0,je.raw.length-dt.length),Je=Lt-1)),Ut=ft||/\n\n(?!\s*$)/.test(ct),Je!==Lt-1&&(ft=ct.charAt(ct.length-1)===`
`,Ut||(Ut=ft)),Ut&&(je.loose=!0),vt=/^\[[ xX]\] /.test(ct),Rt=void 0,vt&&(Rt=ct[1]!==" ",ct=ct.replace(/^\[[ xX]\] +/,"")),je.items.push({type:"list_item",raw:de,task:vt,checked:Rt,loose:Ut,text:ct});return je}},ye.html=function(ne){var re=this.rules.block.html.exec(ne);if(re)return{type:this.options.sanitize?"paragraph":"html",raw:re[0],pre:!this.options.sanitizer&&(re[1]==="pre"||re[1]==="script"||re[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(re[0]):Y(re[0]):re[0]}},ye.def=function(ne){var re=this.rules.block.def.exec(ne);if(re){re[3]&&(re[3]=re[3].substring(1,re[3].length-1));var de=re[1].toLowerCase().replace(/\s+/g," ");return{tag:de,raw:re[0],href:re[2],title:re[3]}}},ye.table=function(ne){var re=this.rules.block.table.exec(ne);if(re){var de={type:"table",header:G(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(`
`):[]};if(de.header.length===de.align.length){de.raw=re[0];var me=de.align.length,Ee;for(Ee=0;Ee/i.test(me[0])&&(re=!1),!de&&/^<(pre|code|kbd|script)(\s|>)/i.test(me[0])?de=!0:de&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(me[0])&&(de=!1),{type:this.options.sanitize?"text":"html",raw:me[0],inLink:re,inRawBlock:de,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):Y(me[0]):me[0]}},ye.link=function(ne){var re=this.rules.inline.link.exec(ne);if(re){var de=ie(re[2],"()");if(de>-1){var me=re[0].indexOf("!")===0?5:4,Ee=me+re[1].length+de;re[2]=re[2].substring(0,de),re[0]=re[0].substring(0,Ee).trim(),re[3]=""}var Me=re[2],je="";if(this.options.pedantic){var it=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Me);it?(Me=it[1],je=it[3]):je=""}else je=re[3]?re[3].slice(1,-1):"";Me=Me.trim().replace(/^<([\s\S]*)>$/,"$1");var ft=se(re,{href:Me&&Me.replace(this.rules.inline._escapes,"$1"),title:je&&je.replace(this.rules.inline._escapes,"$1")},re[0]);return ft}},ye.reflink=function(ne,re){var de;if((de=this.rules.inline.reflink.exec(ne))||(de=this.rules.inline.nolink.exec(ne))){var me=(de[2]||de[1]).replace(/\s+/g," ");if(me=re[me.toLowerCase()],!me||!me.href){var Ee=de[0].charAt(0);return{type:"text",raw:Ee,text:Ee}}var Me=se(de,me,de[0]);return Me}},ye.strong=function(ne,re,de){de===void 0&&(de="");var me=this.rules.inline.strong.start.exec(ne);if(me&&(!me[1]||me[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){re=re.slice(-1*ne.length);var Ee=me[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ee.lastIndex=0;for(var Me;(me=Ee.exec(re))!=null;)if(Me=this.rules.inline.strong.middle.exec(re.slice(0,me.index+3)),Me)return{type:"strong",raw:ne.slice(0,Me[0].length),text:ne.slice(2,Me[0].length-2)}}},ye.em=function(ne,re,de){de===void 0&&(de="");var me=this.rules.inline.em.start.exec(ne);if(me&&(!me[1]||me[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){re=re.slice(-1*ne.length);var Ee=me[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ee.lastIndex=0;for(var Me;(me=Ee.exec(re))!=null;)if(Me=this.rules.inline.em.middle.exec(re.slice(0,me.index+2)),Me)return{type:"em",raw:ne.slice(0,Me[0].length),text:ne.slice(1,Me[0].length-1)}}},ye.codespan=function(ne){var re=this.rules.inline.code.exec(ne);if(re){var de=re[2].replace(/\n/g," "),me=/[^ ]/.test(de),Ee=de.startsWith(" ")&&de.endsWith(" ");return me&&Ee&&(de=de.substring(1,de.length-1)),de=Y(de,!0),{type:"codespan",raw:re[0],text:de}}},ye.br=function(ne){var re=this.rules.inline.br.exec(ne);if(re)return{type:"br",raw:re[0]}},ye.del=function(ne){var re=this.rules.inline.del.exec(ne);if(re)return{type:"del",raw:re[0],text:re[1]}},ye.autolink=function(ne,re){var de=this.rules.inline.autolink.exec(ne);if(de){var me,Ee;return de[2]==="@"?(me=Y(this.options.mangle?re(de[1]):de[1]),Ee="mailto:"+me):(me=Y(de[1]),Ee=me),{type:"link",raw:de[0],text:me,href:Ee,tokens:[{type:"text",raw:me,text:me}]}}},ye.url=function(ne,re){var de;if(de=this.rules.inline.url.exec(ne)){var me,Ee;if(de[2]==="@")me=Y(this.options.mangle?re(de[0]):de[0]),Ee="mailto:"+me;else{var Me;do Me=de[0],de[0]=this.rules.inline._backpedal.exec(de[0])[0];while(Me!==de[0]);me=Y(de[0]),de[1]==="www."?Ee="http://"+me:Ee=me}return{type:"link",raw:de[0],text:me,href:Ee,tokens:[{type:"text",raw:me,text:me}]}}},ye.inlineText=function(ne,re,de){var me=this.rules.inline.text.exec(ne);if(me){var Ee;return re?Ee=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):Y(me[0]):me[0]:Ee=Y(this.options.smartypants?de(me[0]):me[0]),{type:"text",raw:me[0],text:Ee}}},xe}(),Se=H.noopTest,Ce=H.edit,pe=H.merge,fe={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:Se,table:Se,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};fe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,fe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,fe.def=Ce(fe.def).replace("label",fe._label).replace("title",fe._title).getRegex(),fe.bullet=/(?:[*+-]|\d{1,9}[.)])/,fe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,fe.item=Ce(fe.item,"gm").replace(/bull/g,fe.bullet).getRegex(),fe.list=Ce(fe.list).replace(/bull/g,fe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+fe.def.source+")").getRegex(),fe._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",fe._comment=//,fe.html=Ce(fe.html,"i").replace("comment",fe._comment).replace("tag",fe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),fe.paragraph=Ce(fe._paragraph).replace("hr",fe.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",fe._tag).getRegex(),fe.blockquote=Ce(fe.blockquote).replace("paragraph",fe.paragraph).getRegex(),fe.normal=pe({},fe),fe.gfm=pe({},fe.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*|$)"}),fe.gfm.nptable=Ce(fe.gfm.nptable).replace("hr",fe.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",fe._tag).getRegex(),fe.gfm.table=Ce(fe.gfm.table).replace("hr",fe.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",fe._tag).getRegex(),fe.pedantic=pe({},fe.normal,{html:Ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",fe._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:Se,paragraph:Ce(fe.normal._paragraph).replace("hr",fe.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",fe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var oe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Se,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:Se,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",oe.punctuation=Ce(oe.punctuation).replace(/punctuation/g,oe._punctuation).getRegex(),oe._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",oe._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",oe.em.start=Ce(oe.em.start).replace(/punctuation/g,oe._punctuation).getRegex(),oe.em.middle=Ce(oe.em.middle).replace(/punctuation/g,oe._punctuation).replace(/overlapSkip/g,oe._overlapSkip).getRegex(),oe.em.endAst=Ce(oe.em.endAst,"g").replace(/punctuation/g,oe._punctuation).getRegex(),oe.em.endUnd=Ce(oe.em.endUnd,"g").replace(/punctuation/g,oe._punctuation).getRegex(),oe.strong.start=Ce(oe.strong.start).replace(/punctuation/g,oe._punctuation).getRegex(),oe.strong.middle=Ce(oe.strong.middle).replace(/punctuation/g,oe._punctuation).replace(/blockSkip/g,oe._blockSkip).getRegex(),oe.strong.endAst=Ce(oe.strong.endAst,"g").replace(/punctuation/g,oe._punctuation).getRegex(),oe.strong.endUnd=Ce(oe.strong.endUnd,"g").replace(/punctuation/g,oe._punctuation).getRegex(),oe.blockSkip=Ce(oe._blockSkip,"g").getRegex(),oe.overlapSkip=Ce(oe._overlapSkip,"g").getRegex(),oe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,oe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,oe._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])?)+(?![-_])/,oe.autolink=Ce(oe.autolink).replace("scheme",oe._scheme).replace("email",oe._email).getRegex(),oe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,oe.tag=Ce(oe.tag).replace("comment",fe._comment).replace("attribute",oe._attribute).getRegex(),oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oe._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oe.link=Ce(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex(),oe.reflink=Ce(oe.reflink).replace("label",oe._label).getRegex(),oe.reflinkSearch=Ce(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex(),oe.normal=pe({},oe),oe.pedantic=pe({},oe.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:Ce(/^!?\[(label)\]\((.*?)\)/).replace("label",oe._label).getRegex(),reflink:Ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()}),oe.gfm=pe({},oe.normal,{escape:Ce(oe.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)),ye+=""+ne+";";return ye}var Le=function(){function xe(_e){this.tokens=[],this.tokens.links=Object.create(null),this.options=_e||he,this.options.tokenizer=this.options.tokenizer||new ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ne={block:ae.normal,inline:Ae.normal};this.options.pedantic?(ne.block=ae.pedantic,ne.inline=Ae.pedantic):this.options.gfm&&(ne.block=ae.gfm,this.options.breaks?ne.inline=Ae.breaks:ne.inline=Ae.gfm),this.tokenizer.rules=ne}xe.lex=function(ne,re){var de=new xe(re);return de.lex(ne)};var ye=xe.prototype;return ye.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},ye.blockTokens=function(ne,re,de){re===void 0&&(re=[]),de===void 0&&(de=!0),ne=ne.replace(/^ +$/gm,"");for(var me,Ee,Me,je;ne;){if(me=this.tokenizer.space(ne)){ne=ne.substring(me.raw.length),me.type&&re.push(me);continue}if(me=this.tokenizer.code(ne,re)){ne=ne.substring(me.raw.length),me.type?re.push(me):(je=re[re.length-1],je.raw+=`
`+me.raw,je.text+=`
`+me.text);continue}if(me=this.tokenizer.fences(ne)){ne=ne.substring(me.raw.length),re.push(me);continue}if(me=this.tokenizer.heading(ne)){ne=ne.substring(me.raw.length),re.push(me);continue}if(me=this.tokenizer.nptable(ne)){ne=ne.substring(me.raw.length),re.push(me);continue}if(me=this.tokenizer.hr(ne)){ne=ne.substring(me.raw.length),re.push(me);continue}if(me=this.tokenizer.blockquote(ne)){ne=ne.substring(me.raw.length),me.tokens=this.blockTokens(me.text,[],de),re.push(me);continue}if(me=this.tokenizer.list(ne)){for(ne=ne.substring(me.raw.length),Me=me.items.length,Ee=0;Ee0)for(;(it=this.tokenizer.rules.inline.reflinkSearch.exec(je))!=null;)ft.includes(it[0].slice(it[0].lastIndexOf("[")+1,-1))&&(je=je.slice(0,it.index)+"["+"a".repeat(it[0].length-2)+"]"+je.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(it=this.tokenizer.rules.inline.blockSkip.exec(je))!=null;)je=je.slice(0,it.index)+"["+"a".repeat(it[0].length-2)+"]"+je.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ne;){if(Me=this.tokenizer.escape(ne)){ne=ne.substring(Me.raw.length),re.push(Me);continue}if(Me=this.tokenizer.tag(ne,de,me)){ne=ne.substring(Me.raw.length),de=Me.inLink,me=Me.inRawBlock,re.push(Me);continue}if(Me=this.tokenizer.link(ne)){ne=ne.substring(Me.raw.length),Me.type==="link"&&(Me.tokens=this.inlineTokens(Me.text,[],!0,me)),re.push(Me);continue}if(Me=this.tokenizer.reflink(ne,this.tokens.links)){ne=ne.substring(Me.raw.length),Me.type==="link"&&(Me.tokens=this.inlineTokens(Me.text,[],!0,me)),re.push(Me);continue}if(Me=this.tokenizer.strong(ne,je,Ee)){ne=ne.substring(Me.raw.length),Me.tokens=this.inlineTokens(Me.text,[],de,me),re.push(Me);continue}if(Me=this.tokenizer.em(ne,je,Ee)){ne=ne.substring(Me.raw.length),Me.tokens=this.inlineTokens(Me.text,[],de,me),re.push(Me);continue}if(Me=this.tokenizer.codespan(ne)){ne=ne.substring(Me.raw.length),re.push(Me);continue}if(Me=this.tokenizer.br(ne)){ne=ne.substring(Me.raw.length),re.push(Me);continue}if(Me=this.tokenizer.del(ne)){ne=ne.substring(Me.raw.length),Me.tokens=this.inlineTokens(Me.text,[],de,me),re.push(Me);continue}if(Me=this.tokenizer.autolink(ne,Te)){ne=ne.substring(Me.raw.length),re.push(Me);continue}if(!de&&(Me=this.tokenizer.url(ne,Te))){ne=ne.substring(Me.raw.length),re.push(Me);continue}if(Me=this.tokenizer.inlineText(ne,me,ke)){ne=ne.substring(Me.raw.length),Ee=Me.raw.slice(-1),re.push(Me);continue}if(ne){var ct="Infinite loop on byte: "+ne.charCodeAt(0);if(this.options.silent){console.error(ct);break}else throw new Error(ct)}}return re},Z(xe,null,[{key:"rules",get:function(){return{block:ae,inline:Ae}}}]),xe}(),Pe=K.defaults,He=H.cleanUrl,Fe=H.escape,Ue=function(){function xe(_e){this.options=_e||Pe}var ye=xe.prototype;return ye.code=function(ne,re,de){var me=(re||"").match(/\S*/)[0];if(this.options.highlight){var Ee=this.options.highlight(ne,me);Ee!=null&&Ee!==ne&&(de=!0,ne=Ee)}return me?''+(de?ne:Fe(ne,!0))+`
`:""+(de?ne:Fe(ne,!0))+`
`},ye.blockquote=function(ne){return`
`+ne+`
`},ye.html=function(ne){return ne},ye.heading=function(ne,re,de,me){return this.options.headerIds?"
`:""+ne+"
`},ye.hr=function(){return this.options.xhtml?`
`:`
`},ye.list=function(ne,re,de){var me=re?"ol":"ul",Ee=re&&de!==1?' start="'+de+'"':"";return"<"+me+Ee+`>
`+ne+""+me+`>
`},ye.listitem=function(ne){return""+ne+`
`},ye.checkbox=function(ne){return" "},ye.paragraph=function(ne){return""+ne+`
`},ye.table=function(ne,re){return re&&(re=""+re+""),`
`},ye.tablerow=function(ne){return`
`+ne+`
`},ye.tablecell=function(ne,re){var de=re.header?"th":"td",me=re.align?"<"+de+' align="'+re.align+'">':"<"+de+">";return me+ne+""+de+`>
`},ye.strong=function(ne){return""+ne+""},ye.em=function(ne){return""+ne+""},ye.codespan=function(ne){return""+ne+""},ye.br=function(){return this.options.xhtml?"
":"
"},ye.del=function(ne){return""+ne+""},ye.link=function(ne,re,de){if(ne=He(this.options.sanitize,this.options.baseUrl,ne),ne===null)return de;var me='"+de+"",me},ye.image=function(ne,re,de){if(ne=He(this.options.sanitize,this.options.baseUrl,ne),ne===null)return de;var me='
":">",me},ye.text=function(ne){return ne},xe}(),Ne=function(){function xe(){}var ye=xe.prototype;return ye.strong=function(ne){return ne},ye.em=function(ne){return ne},ye.codespan=function(ne){return ne},ye.del=function(ne){return ne},ye.html=function(ne){return ne},ye.text=function(ne){return ne},ye.link=function(ne,re,de){return""+de},ye.image=function(ne,re,de){return""+de},ye.br=function(){return""},xe}(),Ze=function(){function xe(){this.seen={}}var ye=xe.prototype;return ye.slug=function(ne){var re=ne.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(re)){var de=re;do this.seen[de]++,re=de+"-"+this.seen[de];while(this.seen.hasOwnProperty(re))}return this.seen[re]=0,re},xe}(),st=K.defaults,tt=H.unescape,et=function(){function xe(_e){this.options=_e||st,this.options.renderer=this.options.renderer||new Ue,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ne,this.slugger=new Ze}xe.parse=function(ne,re){var de=new xe(re);return de.parse(ne)};var ye=xe.prototype;return ye.parse=function(ne,re){re===void 0&&(re=!0);var de="",me,Ee,Me,je,it,ft,ct,At,wt,dt,Ut,vt,Rt,Lt,Je,li,mi,Qe,yt=ne.length;for(me=0;me0&&Je.tokens[0].type==="text"?(Je.tokens[0].text=Qe+" "+Je.tokens[0].text,Je.tokens[0].tokens&&Je.tokens[0].tokens.length>0&&Je.tokens[0].tokens[0].type==="text"&&(Je.tokens[0].tokens[0].text=Qe+" "+Je.tokens[0].tokens[0].text)):Je.tokens.unshift({type:"text",text:Qe}):Lt+=Qe),Lt+=this.parse(Je.tokens,Rt),wt+=this.renderer.listitem(Lt,mi,li);de+=this.renderer.list(wt,Ut,vt);continue}case"html":{de+=this.renderer.html(dt.text);continue}case"paragraph":{de+=this.renderer.paragraph(this.parseInline(dt.tokens));continue}case"text":{for(wt=dt.tokens?this.parseInline(dt.tokens):dt.text;me+1An error occurred:
"+Xe(Me.message+"",!0)+"
";throw Me}}De.options=De.setOptions=function(xe){return ut(De.defaults,xe),lt(De.defaults),De},De.getDefaults=Ie,De.defaults=nt,De.use=function(xe){var ye=ut({},xe);if(xe.renderer&&function(){var ne=De.defaults.renderer||new Ue,re=function(Ee){var Me=ne[Ee];ne[Ee]=function(){for(var je=arguments.length,it=new Array(je),ft=0;ft`,triples:"",explode:"[]{}"},M=ue.Pos;ue.defineOption("autoCloseBrackets",!1,function(s,u,l){l&&l!=ue.Init&&(s.removeKeyMap(B),s.state.closeBrackets=null),u&&(N(Q(u,"pairs")),s.state.closeBrackets=u,s.addKeyMap(B))});function Q(s,u){return u=="pairs"&&typeof s=="string"?s:typeof s=="object"&&s[u]!=null?s[u]:Z[u]}var B={Backspace:P,Enter:R};function N(s){for(var u=0;u=0;o--){var L=a[o].head;s.replaceRange("",M(L.line,L.ch-1),M(L.line,L.ch+1),"+delete")}}function R(s){var u=W(s),l=u&&Q(u,"explode");if(!l||s.getOption("disableInput"))return ue.Pass;for(var a=s.listSelections(),o=0;o0;return{anchor:new M(s.anchor.line,s.anchor.ch+(u?-1:1)),head:new M(s.head.line,s.head.ch+(u?1:-1))}}function p(s,u){var l=W(s);if(!l||s.getOption("disableInput"))return ue.Pass;var a=Q(l,"pairs"),o=a.indexOf(u);if(o==-1)return ue.Pass;for(var c=Q(l,"closeBefore"),L=Q(l,"triples"),w=a.charAt(o+1)==u,T=s.listSelections(),O=o%2==0,A,x=0;x=0&&s.getRange(E,M(E.line,E.ch+3))==u+u+u?d="skipThree":d="skip";else if(w&&E.ch>1&&L.indexOf(u)>=0&&s.getRange(M(E.line,E.ch-2),E)==u+u){if(E.ch>2&&/\bstring/.test(s.getTokenTypeAt(M(E.line,E.ch-2))))return ue.Pass;d="addFour"}else if(w){var g=E.ch==0?" ":s.getRange(M(E.line,E.ch-1),E);if(!ue.isWordChar(b)&&g!=u&&!ue.isWordChar(g))d="both";else return ue.Pass}else if(O&&(b.length===0||/\s/.test(b)||c.indexOf(b)>-1))d="both";else return ue.Pass;if(!A)A=d;else if(A!=d)return ue.Pass}var _=o%2?a.charAt(o-1):u,F=o%2?u:a.charAt(o+1);s.operation(function(){if(A=="skip")s.execCommand("goCharRight");else if(A=="skipThree")for(var D=0;D<3;D++)s.execCommand("goCharRight");else if(A=="surround"){for(var j=s.getSelections(),D=0;D0&&(ie.percent=ie.loaded/ie.total*100),H.onProgress(ie)});var y=new FormData;H.data&&Object.keys(H.data).forEach(function(Y){var ie=H.data[Y];if(Array.isArray(ie)){ie.forEach(function(se){y.append(Y+"[]",se)});return}y.append(Y,H.data[Y])}),H.file instanceof Blob?y.append(H.filename,H.file,H.file.name):y.append(H.filename,H.file),k.onerror=function(ie){H.onError(ie)},k.onload=function(){return k.status<200||k.status>=300?H.onError(B(H,k),N(k)):H.onSuccess(N(k),k)},k.open(H.method,H.action,!0),H.withCredentials&&"withCredentials"in k&&(k.withCredentials=!0);var G=H.headers||{};return G["X-Requested-With"]!==null&&k.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(G).forEach(function(Y){G[Y]!==null&&k.setRequestHeader(Y,G[Y])}),k.send(y),{abort:function(){k.abort()}}}var W=+new Date,P=0;function R(){return"rc-upload-"+W+"-"+ ++P}function m(H,k){return H.indexOf(k,H.length-k.length)!==-1}var p=function(H,k){if(H&&k){var y=Array.isArray(k)?k:k.split(","),G=H.name||"",Y=H.type||"",ie=Y.replace(/\/.*$/,"");return y.some(function(se){var we=se.trim();return we.charAt(0)==="."?m(G.toLowerCase(),we.toLowerCase()):/\/\*$/.test(we)?ie===we.replace(/\/.*$/,""):Y===we})}return!0};function f(H,k){var y=H.createReader(),G=[];function Y(){y.readEntries(function(ie){var se=Array.prototype.slice.apply(ie);G=G.concat(se);var we=!se.length;we?k(G):Y()})}Y()}var h=function(k,y,G){var Y=function ie(se,we){we=we||"",se.isFile?se.file(function(ve){G(ve)&&(se.fullPath&&!ve.webkitRelativePath&&(Object.defineProperties(ve,{webkitRelativePath:{writable:!0}}),ve.webkitRelativePath=se.fullPath.replace(/^\//,""),Object.defineProperties(ve,{webkitRelativePath:{writable:!1}})),y([ve]))}):se.isDirectory&&f(se,function(ve){ve.forEach(function(Se){ie(Se,""+we+se.name+"/")})})};k.forEach(function(ie){Y(ie.webkitGetAsEntry())})},s=h,u=Object.assign||function(H){for(var k=1;k=0)continue;if(!Object.prototype.hasOwnProperty.call(H,G))continue;y[G]=H[G]}return y}function L(H,k){if(!(H instanceof k))throw new TypeError("Cannot call a class as a function")}function w(H,k){if(!H)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:H}function T(H,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);H.prototype=Object.create(k&&k.prototype,{constructor:{value:H,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(H,k):H.__proto__=k)}var O=function(k){return Object.keys(k).reduce(function(y,G){return(G.substr(0,5)==="data-"||G.substr(0,5)==="aria-"||G==="role")&&(y[G]=k[G]),y},{})},A=function(H){T(k,H);function k(){var y,G,Y,ie;L(this,k);for(var se=arguments.length,we=Array(se),ve=0;ve1&&arguments[1]!==void 0?arguments[1]:1,_e=Ne.length,ne=0;ne<_e;ne+=1){var re=(xe+ne*ye+_e)%_e,de=Ne[re],me=de.group,Ee=de.data;if(!me&&!Ee.disabled)return re}return-1},ut=B.useState(function(){return et(0)}),Ye=Object(W.a)(ut,2),Xe=Ye[0],Ie=Ye[1],lt=function(xe){Ie(xe);var ye=Ne[xe];if(!ye){Pe(null,-1);return}Pe(ye.data.value,xe)};B.useEffect(function(){lt(fe!==!1?et(0):-1)},[Ne.length,Ce]),B.useEffect(function(){var ze=setTimeout(function(){if(!pe&&ae&&Se.size===1){var xe=Array.from(Se)[0],ye=Ne.findIndex(function(_e){var ne=_e.data;return ne.value===xe});lt(ye),tt(ye)}});return function(){return clearTimeout(ze)}},[ae]);var nt=function(xe){xe!==void 0&&Te(xe,{selected:!Se.has(xe)}),pe||Le(!1)};if(B.useImperativeHandle(Y,function(){return{onKeyDown:function(xe){var ye=xe.which;switch(ye){case P.a.UP:case P.a.DOWN:{var _e=0;if(ye===P.a.UP?_e=-1:ye===P.a.DOWN&&(_e=1),_e!==0){var ne=et(Xe+_e,_e);tt(ne),lt(ne)}break}case P.a.ENTER:{var re=Ne[Xe];re&&!re.data.disabled?nt(re.data.value):nt(void 0),ae&&xe.preventDefault();break}case P.a.ESC:Le(!1)}},onKeyUp:function(){},scrollTo:function(xe){tt(xe)}}}),Ne.length===0)return B.createElement("div",{role:"listbox",id:"".concat(se,"_list"),className:"".concat(Ue,"-empty"),onMouseDown:st},he);function De(ze){var xe=Ne[ze];if(!xe)return null;var ye=xe.data||{},_e=ye.value,ne=ye.label,re=ye.children,de=Object(R.a)(ye,!0),me=ve?re:ne;return xe?B.createElement("div",Object.assign({"aria-label":typeof me=="string"?me:null},de,{key:ze,role:"option",id:"".concat(se,"_list_").concat(ze),"aria-selected":Se.has(_e)}),_e):null}return B.createElement(B.Fragment,null,B.createElement("div",{role:"listbox",id:"".concat(se,"_list"),style:{height:0,width:0,overflow:"hidden"}},De(Xe-1),De(Xe),De(Xe+1)),B.createElement(h.a,{itemKey:"key",ref:Ze,data:Ne,height:oe,itemHeight:te,fullHeight:!1,onMouseDown:st,onScroll:He,virtual:ke,onMouseEnter:Fe},function(ze,xe){var ye,_e=ze.group,ne=ze.groupOption,re=ze.data,de=re.label,me=re.key;if(_e)return B.createElement("div",{className:f()(Ue,"".concat(Ue,"-group"))},de!==void 0?de:me);var Ee=re.disabled,Me=re.value,je=re.title,it=re.children,ft=re.style,ct=re.className,At=Object(K.a)(re,["disabled","value","title","children","style","className"]),wt=Se.has(Me),dt="".concat(Ue,"-option"),Ut=f()(Ue,dt,ct,(ye={},Object(N.a)(ye,"".concat(dt,"-grouped"),ne),Object(N.a)(ye,"".concat(dt,"-active"),Xe===xe&&!Ee),Object(N.a)(ye,"".concat(dt,"-disabled"),Ee),Object(N.a)(ye,"".concat(dt,"-selected"),wt),ye)),vt=ve?it:de,Rt=!Ae||typeof Ae=="function"||wt;return B.createElement("div",Object.assign({},At,{"aria-selected":wt,className:Ut,title:je,onMouseMove:function(){if(Xe===xe||Ee)return;lt(xe)},onClick:function(){Ee||nt(Me)},style:ft}),B.createElement("div",{className:"".concat(dt,"-content")},vt||Me),B.isValidElement(Ae)||wt,Rt&&B.createElement(s.a,{className:"".concat(Ue,"-option-state"),customizeIcon:Ae,customizeIconProps:{isSelected:wt}},wt?"\u2713":null))}))},l=B.forwardRef(u);l.displayName="OptionList";var a=l,o=function(){return null};o.isSelectOption=!0;var c=o,L=function(){return null};L.isSelectOptGroup=!0;var w=L,T=le("VTBJ"),O=le("Zm9Q");function A(y){var G=y.key,Y=y.props,ie=Y.children,se=Y.value,we=Object(K.a)(Y,["children","value"]);return Object(T.a)({key:G,value:se!==void 0?se:G,children:ie},we)}function x(y){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(O.a)(y).map(function(Y,ie){if(!B.isValidElement(Y)||!Y.type)return null;var se=Y.type.isSelectOptGroup,we=Y.key,ve=Y.props,Se=ve.children,Ce=Object(K.a)(ve,["children"]);return G||!se?A(Y):Object(T.a)(Object(T.a)({key:"__RC_SELECT_GRP__".concat(we===null?ie:we,"__"),label:we},Ce),{},{options:x(Se)})}).filter(function(Y){return Y})}var S=le("2Qr1"),E=le("qNPg"),d=le("U8pU"),b=le("Kwbf"),g=le("WKfj");function _(y){var G=y.mode,Y=y.options,ie=y.children,se=y.backfill,we=y.allowClear,ve=y.placeholder,Se=y.getInputElement,Ce=y.showSearch,pe=y.onSearch,fe=y.defaultOpen,oe=y.autoFocus,te=y.labelInValue,he=y.value,ae=y.inputValue,Ae=y.optionLabelProp,ke=G==="multiple"||G==="tags",Te=Ce!==void 0?Ce:ke||G==="combobox",Le=Y||x(ie);if(Object(b.a)(G!=="tags"||Le.every(function(Ue){return!Ue.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),G==="tags"||G==="combobox"){var Pe=Le.some(function(Ue){return Ue.options?Ue.options.some(function(Ne){return typeof("value"in Ne?Ne.value:Ne.key)=="number"}):typeof("value"in Ue?Ue.value:Ue.key)=="number"});Object(b.a)(!Pe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(b.a)(G!=="combobox"||!Ae,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(b.a)(G==="combobox"||!se,"`backfill` only works with `combobox` mode."),Object(b.a)(G==="combobox"||!Se,"`getInputElement` only work with `combobox` mode."),Object(b.b)(G!=="combobox"||!Se||!we||!ve,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),pe&&!Te&&G!=="combobox"&&G!=="tags"&&Object(b.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(b.b)(!fe||oe,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),he!=null){var He=Object(g.d)(he);Object(b.a)(!te||He.every(function(Ue){return Object(d.a)(Ue)==="object"&&("key"in Ue||"value"in Ue)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(b.a)(!ke||Array.isArray(he),"`value` should be array when `mode` is `multiple` or `tags`")}if(ie){var Fe=null;Object(O.a)(ie).some(function(Ue){if(!B.isValidElement(Ue)||!Ue.type)return!1;var Ne=Ue.type;if(Ne.isSelectOption)return!1;if(Ne.isSelectOptGroup){var Ze=Object(O.a)(Ue.props.children).every(function(st){return!B.isValidElement(st)||!Ue.type||st.type.isSelectOption?!0:(Fe=st.type,!1)});return!Ze}return Fe=Ne,!0}),Fe&&Object(b.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Fe.displayName||Fe.name||Fe,"`.")),Object(b.a)(ae===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var F=_,D=Object(E.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:x,flattenOptions:S.d,getLabeledValue:S.e,filterOptions:S.b,isValueDisabled:S.g,findValueOption:S.c,warningProps:F,fillOptionsWithMissingValue:S.a}),j=function(y){Object(M.a)(Y,y);var G=Object(Q.a)(Y);function Y(){var ie;return Object(ue.a)(this,Y),ie=G.apply(this,arguments),ie.selectRef=B.createRef(),ie.focus=function(){ie.selectRef.current.focus()},ie.blur=function(){ie.selectRef.current.blur()},ie}return Object(Z.a)(Y,[{key:"render",value:function(){return B.createElement(D,Object.assign({ref:this.selectRef},this.props))}}]),Y}(B.Component);j.Option=c,j.OptGroup=w;var H=j,k=ot.c=H},M8RZ:function(_t,ot,le){"use strict";le.d(ot,"a",function(){return P});var ue=le("fWQN"),Z=le("mtLc"),M=le("yKVA"),Q=le("879j"),B=le("q1tI"),N=le.n(B),K=le("i8i4"),W=le.n(K),P=function(R){Object(M.a)(p,R);var m=Object(Q.a)(p);function p(f){var h;Object(ue.a)(this,p),h=m.call(this,f);var s=window.document;return h.node=s.createElement("div"),s.body.appendChild(h.node),h}return Object(Z.a)(p,[{key:"render",value:function(){var h=this.props.children;return Object(K.createPortal)(h,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),p}(N.a.Component)},Ot1p:function(_t,ot,le){"use strict";var ue=le("2qtc"),Z=le("kLXV"),M=le("rAM+"),Q=le("miYZ"),B=le("tsqr"),N=le("9og8"),K=le("tJVT"),W=le("jrin"),P=le("WmNS"),R=le.n(P),m=le("q1tI"),p=le.n(m),f=le("VrN/"),h=le.n(f),s=le("bdgK"),u=le("p77/"),l=le("Bd2K"),a=le("ELLl"),o=le("19Vz"),c=le("lZu9"),L=le("+NIl"),w=le("kSUc"),T=le("9Bee"),O=function(Ee){var Me=Ee.value,je=Me===void 0?"":Me,it=Ee.className,ft=Ee.showTextOnly,ct=Ee.showLines,At=Ee.style,wt=At===void 0?{}:At,dt=Object(m.useMemo)(function(){return""},[je]);return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:dt}}))},A=le("0Owb"),x=le("dejd"),S=le("C+DQ"),E=le("1vsH"),d=le("m3rI"),b=[{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 g(Ee){var Me=Ee.onActionCallback,je=Ee.title,it=Ee.icon,ft=Ee.actionName,ct=Ee.className,At=ct===void 0?"":ct,wt=Ee.children;function dt(){Me(ft)}return p.a.createElement("a",{title:je,className:At,onClick:dt},p.a.createElement("i",{className:"md-iconfont ".concat(it)}),wt)}var _=function(Ee){var Me=Ee.watch,je=Ee.showNullButton,it=Ee.onActionCallback,ft=Ee.fullScreen,ct=Ee.insertTemp,At=Ee.hidetoolBar,wt=Ee.uuid,dt=Ee.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(E.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(E.F)("_educoder_session"),"&key=").concat(wt,"&api=").concat(encodeURIComponent(d.a.PROXY_SERVER)));var Ut=[].concat(b,[{title:"".concat(Me?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Me?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return p.a.createElement("ul",{className:"markdown-toolbar-container"},!At&&Ut.map(function(vt,Rt){return p.a.createElement("li",{key:Rt},vt.actionName?p.a.createElement(g,Object(A.a)({},vt,{onActionCallback:it})):p.a.createElement("span",{className:"v-line"}))}),je?p.a.createElement("li",null,p.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:it},p.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ct&&p.a.createElement("li",null,p.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ct),onActionCallback:it},p.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),p.a.createElement("li",{className:"btn-full-screen"},p.a.createElement(g,{icon:"".concat(ft?"icon-shrink":"icon-enlarge"),title:ft?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:it})))},F=le("M8RZ"),D=le("+L6B"),j=le("2/Rp"),H=le("y8nQ"),k=le("Vl3Y"),y=le("5NDa"),G=le("5rEg"),Y={labelCol:{span:4},wrapperCol:{span:20}},ie=function(Ee){var Me=Ee.callback,je=Ee.onCancel;function it(ft){Me(ft)}return p.a.createElement(k.a,Object(A.a)({},Y,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:it}),p.a.createElement(k.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},p.a.createElement(G.a,null)),p.a.createElement(k.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},p.a.createElement(G.a,null)),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(j.a,{type:"ghost",onClick:je},"\u53D6\u6D88")))},se=le("7ahc"),we=le("HmJG"),ve=le("BjJ7"),Se=k.a.useForm,Ce={width:280,marginRight:10},pe={labelCol:{span:5},wrapperCol:{span:19}},fe=function(Ee){var Me=Ee.callback,je=Ee.onCancel,it=Se(),ft=Object(K.a)(it,1),ct=ft[0];function At(Ut){Me(Ut)}function wt(Ut,vt){if(Ut.status===-1){B.b.error(Ut.message);return}ct.setFieldsValue({src:"/api/attachments/".concat(Ut.id),type:vt.type})}function dt(Ut){var vt=Ut.target.files[0];te(vt,wt)}return p.a.createElement(k.a,Object(A.a)({form:ct},pe,{className:"upload-image-panel",onFinish:At}),p.a.createElement(k.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},p.a.createElement("div",{className:"flex-container"},p.a.createElement(k.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},p.a.createElement(G.a,{style:Ce})),p.a.createElement(oe,{onFileChange:dt}))),p.a.createElement(k.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},p.a.createElement(G.a,{style:{width:264}})),p.a.createElement(k.a.Item,{style:{textAlign:"right"}},p.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(j.a,{type:"ghost",onClick:je},"\u53D6\u6D88")))};function oe(Ee){var Me=Ee.onFileChange;return p.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",p.a.createElement("input",{type:"file",onChange:Me}))}function te(Ee,Me){if(!Ee)throw new String("\u6CA1\u6709\u6587\u4EF6");var je=new FormData;je.append("editormd-image-file",Ee),je.append("file_param_name","editormd-image-file"),je.append("byxhr","true");var it=new window.XMLHttpRequest;it.withCredentials=!0,it.addEventListener("load",function(ft){Me(JSON.parse(ft.target.responseText),Ee)},!1),it.addEventListener("error",function(ft){console.error(ft)},!1),it.open("POST","".concat(ve.a,"/api/attachments.json")),it.send(je)}var he=le("giR+"),ae=le("fyUT"),Ae=le("7Kak"),ke=le("9yH6"),Te=ke.a.Group,Le={margin:"0 8px"},Pe=function(Ee){var Me=Ee.callback,je=Ee.onCancel;function it(ft){Me(ft)}return p.a.createElement(k.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:it},p.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},p.a.createElement("span",{style:Le},"\u5355\u5143\u683C\u6570\uFF1A"),p.a.createElement("span",{style:Le},"\u884C\u6570"),p.a.createElement(k.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},p.a.createElement(ae.a,null)),p.a.createElement("span",{style:Le},"\u5217\u6570"),p.a.createElement(k.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},p.a.createElement(ae.a,null))),p.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},p.a.createElement("span",{style:Le},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),p.a.createElement(k.a.Item,{name:"align"},p.a.createElement(Te,null,p.a.createElement(ke.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(ke.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(ke.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(ke.a,{value:"right"},p.a.createElement("i",{className:"fa fa-align-right"}))))),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(j.a,{type:"ghost",onClick:je},"\u53D6\u6D88")))},He=le("ErOA"),Fe=le("7Cbv"),Ue="link",Ne="upload-image",Ze="code-block",st="add-table",tt="------------",et={default:tt,left:":".concat(tt),center:":".concat(tt,":"),right:"".concat(tt,":")},ut=le("9VGf"),Ye,Xe;function Ie(){}var lt=0,nt=1e4,De="\u2581",ze=`
**\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 xe(Ee){return/^\d+$/.test(Ee)?"".concat(Ee,"px"):Ee}var ye=navigator.platform.toUpperCase().indexOf("MAC")>=0,_e=ye?"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"],re=(Ye={},Object(W.a)(Ye,_e+"-B","bold"),Object(W.a)(Ye,_e+"-I","italic"),Ye),de=(Xe={},Object(W.a)(Xe,Ue,"\u6DFB\u52A0\u94FE\u63A5"),Object(W.a)(Xe,Ze,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(W.a)(Xe,Ne,"\u6DFB\u52A0\u6587\u4EF6"),Object(W.a)(Xe,st,"\u6DFB\u52A0\u8868\u683C"),Xe),me=ot.a=function(Ee){var Me=Ee.defaultValue,je=Me===void 0?"":Me,it=Ee.onChange,ft=Ee.width,ct=ft===void 0?"100%":ft,At=Ee.height,wt=At===void 0?400:At,dt=Ee.miniToolbar,Ut=dt===void 0?!1:dt,vt=Ee.isFocus,Rt=vt===void 0?!1:vt,Lt=Ee.watch,Je=Ee.insertTemp,li=Ee.mode,mi=li===void 0?"markdown":li,Qe=Ee.id,yt=Qe===void 0?"markdown-editor-id":Qe,It=Ee.showResizeBar,kt=It===void 0?!1:It,Jt=Ee.noStorage,Si=Jt===void 0?!1:Jt,en=Ee.showNullButton,jt=en===void 0?!1:en,mt=Ee.hidetoolBar,zi=mt===void 0?!1:mt,tn=Ee.fullScreen,bi=tn===void 0?!1:tn,Pt=Ee.onBlur,Hi=Ee.onCMBeforeChange,Xi=Ee.onFullScreen,pn=Ee.className,Ve=pn===void 0?"":pn,Ct=Ee.disablePaste,mn=Ct===void 0?!1:Ct,gn=Ee.placeholder,vn=gn===void 0?"":gn,yn=Ee.values,X=yn===void 0?"":yn,v=Object(m.useState)(null),C=Object(K.a)(v,2),U=C[0],q=C[1],V=Object(m.useState)(je),be=Object(K.a)(V,2),We=be[0],qe=be[1],gt=Object(m.useState)(Lt),Ge=Object(K.a)(gt,2),xt=Ge[0],Wt=Ge[1],Qt=Object(m.useState)(bi),Ni=Object(K.a)(Qt,2),_i=Ni[0],Ei=Ni[1],Yi=Object(m.useState)(""),kn=Object(K.a)(Yi,2),ui=kn[0],ji=kn[1],ln=Object(m.useState)(0),un=Object(K.a)(ln,2),Fi=un[0],Dn=un[1],bn=Object(m.useState)(wt),Kn=Object(K.a)(bn,2),Vn=Kn[0],$i=Kn[1],Ki=Object(m.useState)(!1),_n=Object(K.a)(Ki,2),dr=_n[0],En=_n[1],ti=Object(m.useRef)(Object(Fe.a)()),Gt=Object(m.useRef)(!1),gi=Object(m.useRef)(),Nt=Object(m.useRef)(),ni=Object(m.useRef)(),Vt=Object(m.useRef)(),nn=Object(m.useRef)(),hi=function(){var bt=Object(N.a)(R.a.mark(function Ot(){var Tt,Mt;return R.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return Yt.next=2,Object(He.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:ti.current}});case 2:Mt=Yt.sent,Mt!=null&&(Tt=Mt.attachments)!==null&&Tt!==void 0&&Tt.length&&(console.log("cm:",U,Nt),Mt.attachments.map(function(Bt){Bt.content_type.indexOf("image")>-1?U.replaceSelection(".concat(Bt.content_type,")")):Bt.content_type.indexOf("video")>-1?U.replaceSelection('')):Bt.content_type.indexOf("pdf")>-1?U.replaceSelection('').concat(Bt.name,"")):U.replaceSelection("[".concat(Bt.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(Bt.id,"?type=").concat(Bt.content_type,")"))}));case 4:case"end":return Yt.stop()}},Ot)}));return function(){return bt.apply(this,arguments)}}();Object(m.useEffect)(function(){qe(X),U==null||U.setValue(X)},[X]),Object(m.useEffect)(function(){Xi==null||Xi(_i)},[_i]),Object(m.useEffect)(function(){if(Nt.current){var bt=h.a.fromTextArea(Nt.current,{mode:mi,lineNumbers:!Ut,lineWrapping:!0,value:je,autoCloseTags:!0,autoCloseBrackets:!0});Rt&&bt.focus();function Ot(Tt,Mt){if(mn){Mt.preventDefault();return}var Ht=Mt.clipboardData;if(Ht){var Yt=Ht.types.toString(),Bt=Ht.items;if(Yt==="Files"||Ht.types.indexOf("Files")>-1){if(Mt.preventDefault(),mi=="stex")return;try{var si,Ri=Bt[1];((si=Bt[0])===null||si===void 0?void 0:si.kind)==="file"&&(Ri=Bt[0]);var Ft=Ri.getAsFile(),hn=Ft.name.split(".").pop();te(Ft,function(zt){if(zt.id){var Li,xi,Vi;(Ft==null||((Li=Ft.type)===null||Li===void 0)?void 0:Li.indexOf("image"))>-1?bt.replaceSelection(".concat(zt.content_type,")")):(Ft==null||((xi=Ft.type)===null||xi===void 0)?void 0:xi.indexOf("video"))>-1?bt.replaceSelection('')):(Ft==null||((Vi=Ft.type)===null||Vi===void 0)?void 0:Vi.indexOf("pdf"))>-1?bt.replaceSelection('').concat(Ft.name,"")):ne.includes(hn)?bt.replaceSelection('').concat(Ft.name,"")):bt.replaceSelection("[".concat(Ft.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(zt.content_type,")"))}else(zt==null?void 0:zt.status)===401&&(document.location.href="/user/login")})}catch(zt){B.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return bt.on("paste",Ot),bt.on("dragleave",function(Tt,Mt){ni.current.classList.remove("mouse-hover-md")}),bt.on("dragover",function(Tt,Mt){ni.current.classList.add("mouse-hover-md")}),bt.on("drop",function(Tt,Mt){ni.current.classList.add("mouse-hover-md");var Ht;if(Ht=Mt.dataTransfer.files,Ht.length>0){Mt.preventDefault(),Mt.stopPropagation();for(var Yt=function(Ri){var Ft=Ht[Ri],hn=Ft.name.split(".").pop();te(Ft,function(zt){if(zt.id){var Li,xi,Vi;(Ft==null||((Li=Ft.type)===null||Li===void 0)?void 0:Li.indexOf("image"))>-1?bt.replaceSelection(".concat(zt.content_type,")")):(Ft==null||((xi=Ft.type)===null||xi===void 0)?void 0:xi.indexOf("video"))>-1?bt.replaceSelection('')):(Ft==null||((Vi=Ft.type)===null||Vi===void 0)?void 0:Vi.indexOf("pdf"))>-1?bt.replaceSelection('').concat(Ft.name,"")):ne.includes(hn)?bt.replaceSelection('').concat(Ft.name,"")):bt.replaceSelection("[".concat(Ft.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(zt.content_type,")"))}else(zt==null?void 0:zt.status)===401&&(document.location.href="/user/login")})},Bt=0;Bt0||Bt.target.offsetWidth>0)&&(Ci(),U.setSize("100%","100%"),U.refresh())}}catch(si){Ht.e(si)}finally{Ht.f()}});return Tt.observe(Nt.current.parentElement),Tt}if(U){var Ot=bt();return function(){Ot.unobserve(Nt.current.parentElement)}}},[U,Ci]),Object(m.useEffect)(function(){if(U){for(var bt=[],Ot=function(){var Bt=Mt[Tt];Ht=Object(K.a)(Bt,2);var si=Ht[0],Ri=Ht[1],Ft=Object(W.a)({},si,function(){Xn(Ri)});bt.push(Ft),U.addKeyMap(Ft)},Tt=0,Mt=Object.entries(re);Tt0){var bt=new Date().getTime(),Ot=window.sessionStorage.getItem(yt);bt>=Fi+nt&&(!Ot||Ot!==We)&&(window.sessionStorage.setItem(yt,We),En(!0))}},nt),Object(m.useEffect)(function(){Wt(Lt)},[U,Lt]),Object(m.useEffect)(function(){U&&(Rt&&U.focus())},[U,Rt]),Object(m.useEffect)(function(){if(xt&&U){var bt=U.getScrollerElement();function Ot(Tt){var Mt=Tt.target;if(nn.current){var Ht=Mt.scrollTop/Mt.scrollHeight;nn.current.scrollTop=nn.current.scrollHeight*Ht}}return bt.addEventListener("scroll",Ot),function(){bt.removeEventListener("scroll",Ot)}}},[U,xt]),Object(m.useEffect)(function(){if(U&&Hi){function bt(Ot,Tt){Hi(Ot,Tt)}return U.on("beforeChange",bt),function(){U.off("beforeChange",bt)}}},[U,Hi]),Object(m.useEffect)(function(){if(U&&Pt){function bt(){Pt(U.getValue())}return U.on("blur",bt),function(){U.off("blur",bt)}}},[U,Pt]),Object(m.useEffect)(function(){if(U){function bt(Ot){var Tt=Ot.getValue();qe(Tt),Dn(new Date().getTime()),Ot.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),it&&it(Tt)}return U.on("change",bt),function(){U.off("change",bt)}}},[U,it]),Object(m.useEffect)(function(){U&&(je==null?(U.setValue(""),qe("")):je!==U.getValue()&&(U.setValue(je),qe(je),U.setCursor(U.lineCount(),0)))},[U,je]);var Xn=Object(m.useCallback)(function(bt){var Ot=U.getCursor(),Tt=U.getSelection(),Mt=Tt.split(`
`);switch(bt){case"bold":return U.replaceSelection("**"+Tt+"**"),Tt===""&&U.setCursor(Ot.line,Ot.ch+2),U.focus();case"italic":return U.replaceSelection("*"+Tt+"*"),Tt===""&&U.setCursor(Ot.line,Ot.ch+1),U.focus();case"code":return U.replaceSelection("`"+Tt+"`"),Tt===""&&U.setCursor(Ot.line,Ot.ch+1),U.focus();case"inline-latex":return U.replaceSelection("`$$"+Tt+"$$`"),Tt===""&&U.setCursor(Ot.line,Ot.ch+3),U.focus();case"latex":return U.replaceSelection("```latex\n"+Tt+"\n```"),U.setCursor(Ot.line+1,Tt.length+1),U.focus();case"line-break":return U.replaceSelection(`
`),U.focus();case"list-ul":return Tt===""?U.replaceSelection("- "+Tt):U.replaceSelection(Mt.map(function(Ht){return Ht===""?"":"- ".concat(Ht)}).join(`
`)),U.focus();case"list-ol":return Tt===""?U.replaceSelection("1. "+Tt):U.replaceSelection(Mt.map(function(Ht,Yt){return Ht===""?"":"".concat(Yt+1,". ").concat(Ht)}).join(`
`)),U.focus();case"add-null-ch":return Tt===""&&U.setCursor(Ot.line,Ot.ch+1),U.replaceSelection(De),U.focus();case"inster-template-1":return Tt===""&&U.setCursor(Ot.line,Ot.ch),U.replaceSelection(ze),U.focus();case"eraser":return U.setValue(""),U.focus();case"trigger-watch":return Wt(!xt),U.focus();case"trigger-full-screen":return Ei(!_i),U.focus();case Ue:ji(Ue);return;case Ze:ji(Ze);return;case Ne:ji(Ne);return;case st:ji(st);return;default:throw new Error}},[U,xt,_i]),xn=Object(m.useCallback)(function(bt){ji("");switch(ui){case Ue:var Ot=bt.title,Tt=bt.link;return U.replaceSelection("[".concat(Ot,"](").concat(Tt,")")),U.focus();case Ze:var Mt=bt.language,Ht=bt.content;return U.replaceSelection(["```"+Mt,Ht,"```"].join(`
`)),U.focus();case Ne:var Yt=bt.src,Bt=bt.alt;return Bt?U.replaceSelection(".concat(Yt,' "').concat(Bt,'" )')):U.replaceSelection("")),U.focus();case st:for(var si=bt.row,Ri=bt.col,Ft=bt.align,hn=`
`,zt=0;zt300&&(si=300);var Ri=wt+si+"px";$i(Ri)}}return bt.addEventListener("mousedown",Mt),document.addEventListener("mousemove",Yt),document.addEventListener("mouseup",Ht),function(){bt.removeEventListener("mousedown",Mt),document.removeEventListener("mousemove",Yt),document.removeEventListener("mouseup",Ht)}}},[U,Vt]),Object(m.useEffect)(function(){$i(wt)},[wt]);var rn=xe(ct),fr=xe(Vn),Qi={width:rn,height:fr},pr=Object(m.useMemo)(function(){if(Fi){var bt=new Date(Fi),Ot=bt.getHours(),Tt=bt.getMinutes(),Mt=bt.getSeconds();return Ot=Ot<10?"0"+Ot:Ot,Tt=Tt<10?"0"+Tt:Tt,Mt=Mt<10?"0"+Mt:Mt,"".concat(Ot,":").concat(Tt,":").concat(Mt)}return 0},[Fi]);function Hr(){window.sessionStorage.removeItem(yt),En(!1),Dn(0)}function Mn(){En(!1),Dn(0),U.setValue(window.sessionStorage.getItem(yt))}function ua(bt,Ot){var Tt=U.getValue();Tt=Tt.replace(bt,Ot),qe(Tt),U==null||U.setValue(Tt)}return p.a.createElement(m.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:ni},p.a.createElement("div",{className:"markdown-editor-container ".concat(Ve," ").concat(xt?"on-preview":""," ").concat(Ut?"mini":""," ").concat(_i?"full-screen":""),style:Qi},p.a.createElement(_,{insertTemp:Je,watch:xt,fullScreen:_i,showNullButton:jt,onActionCallback:Xn,hidetoolBar:zi,uuid:ti.current,setOpenPhones:function(){Gt.current=!0}}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:Nt,placeholder:vn})),xt?p.a.createElement("div",{ref:nn,className:"preview-container"},mi==="stex"&&p.a.createElement(O,{value:We}),mi!=="stex"&&p.a.createElement(T.a,{edit:!0,value:We,replaces:ua})):null))),kt?p.a.createElement("a",{ref:Vt,className:"editor-resize"}):null,p.a.createElement(F.a,null,de[ui]?p.a.createElement(Z.a,{centered:!0,title:de[ui],visible:!0,onCancel:Tn,footer:null,className:"markdown-popup-form"},cr):null))}},SJMd:function(_t,ot){/**
* @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 le,ue,Z,M=!1,Q,B;window.PR_SHOULD_USE_CONTINUATION=!0;var N,K;(function(){var W=window,P=["break,continue,do,else,for,if,return,while"],R=[P,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],m=[R,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],p=[m,"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"],f=[m,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],h=[m,"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"],s="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",u=[m,"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",a=[P,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],o=[P,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],c=[P,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],L=[p,h,f,u,l,a,o,c],w=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,T="str",O="kwd",A="com",x="typ",S="lit",E="pun",d="pln",b="tag",g="dec",_="src",F="atn",D="atv",j="nocode",H="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Te){for(var Le=0,Pe=!1,He=!1,Fe=0,Ue=Te.length;Fe122||(ne<65||_e>90||lt.push([Math.max(65,_e)|32,Math.min(ne,90)|32]),ne<97||_e>122||lt.push([Math.max(97,_e)&~32,Math.min(ne,122)&~32]))}}lt.sort(function(Ee,Me){return Ee[0]-Me[0]||Me[1]-Ee[1]});for(var re=[],de=[],ze=0;zeme[0]&&(me[1]+1>me[0]&&De.push("-"),De.push(tt(me[1])))}return De.push("]"),De.join("")}function ut(Xe){for(var Ie=Xe.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")),lt=Ie.length,nt=[],De=0,ze=0;De=2&&_e==="["?Ie[De]=et(xe):_e!=="\\"&&(Ie[De]=xe.replace(/[a-zA-Z]/g,function(de){var me=de.charCodeAt(0);return"["+String.fromCharCode(me&~32,me|32)+"]"}))}return Ie.join("")}for(var Ye=[],Fe=0,Ue=Te.length;Fe=0;)Pe[Ye.charAt(Xe)]=ut;var Ie=ut[1],lt=""+Ie;st.hasOwnProperty(lt)||(Ze.push(Ie),st[lt]=null)}Ze.push(/[\0-\uffff]/),He=k(Ze)})();var Fe=Le.length,Ue=function(Ne){for(var Ze=Ne.sourceCode,st=Ne.basePos,tt=Ne.sourceNode,et=[st,d],ut=0,Ye=Ze.match(He)||[],Xe={},Ie=0,lt=Ye.length;Ie=5&&De.substring(0,5)==="lang-",xe&&!(ze&&typeof ze[1]=="string")&&(xe=!1,De=_),xe||(Xe[nt]=De)}var ne=ut;if(ut+=nt.length,!xe)et.push(st+ne,De);else{var re=ze[1],de=nt.indexOf(re),me=de+re.length;ze[2]&&(me=nt.length-ze[2].length,de=me-re.length);var Ee=De.substring(5);G(tt,st+ne,nt.substring(0,de),Ue,et),G(tt,st+ne+de,re,oe(Ee,re),et),G(tt,st+ne+me,nt.substring(me),Ue,et)}}Ne.decorations=et};return Ue}function we(Te){var Le=[],Pe=[];Te.tripleQuotedStrings?Le.push([T,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Te.multiLineStrings?Le.push([T,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Le.push([T,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Te.verbatimStrings&&Pe.push([T,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var He=Te.hashComments;He&&(Te.cStyleComments?(He>1?Le.push([A,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Le.push([A,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Pe.push([T,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Le.push([A,/^#[^\r\n]*/,null,"#"])),Te.cStyleComments&&(Pe.push([A,/^\/\/[^\r\n]*/,null]),Pe.push([A,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Fe=Te.regexLiterals;if(Fe){var Ue=Fe>1?"":`
\r`,Ne=Ue?".":"[\\S\\s]",Ze="/(?=[^/*"+Ue+"])(?:[^/\\x5B\\x5C"+Ue+"]|\\x5C"+Ne+"|\\x5B(?:[^\\x5C\\x5D"+Ue+"]|\\x5C"+Ne+")*(?:\\x5D|$))+/";Pe.push(["lang-regex",RegExp("^"+H+"("+Ze+")")])}var st=Te.types;st&&Pe.push([x,st]);var tt=(""+Te.keywords).replace(/^ | $/g,"");tt.length&&Pe.push([O,new RegExp("^(?:"+tt.replace(/[\s,]+/g,"|")+")\\b"),null]),Le.push([d,/^\s+/,null,` \r
\xA0`]);var et="^.[^\\s\\w.$@'\"`/\\\\]*";return Te.regexLiterals&&(et+="(?!s*/)"),Pe.push([S,/^@[a-z_$][a-z_$@0-9]*/i,null],[x,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[d,/^[a-z_$][a-z_$@0-9]*/i,null],[S,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[d,/^\\[\s\S]?/,null],[E,new RegExp(et),null]),se(Le,Pe)}var ve=we({keywords:L,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Se(Te,Le,Pe){for(var He=/(?:^|\s)nocode(?:\s|$)/,Fe=/\r\n?|\n/,Ue=Te.ownerDocument,Ne=Ue.createElement("li");Te.firstChild;)Ne.appendChild(Te.firstChild);var Ze=[Ne];function st(Ie){var lt=Ie.nodeType;if(lt==1&&!He.test(Ie.className))if(Ie.nodeName==="br")tt(Ie),Ie.parentNode&&Ie.parentNode.removeChild(Ie);else for(var nt=Ie.firstChild;nt;nt=nt.nextSibling)st(nt);else if((lt==3||lt==4)&&Pe){var De=Ie.nodeValue,ze=De.match(Fe);if(ze){var xe=De.substring(0,ze.index);Ie.nodeValue=xe;var ye=De.substring(ze.index+ze[0].length);if(ye){var _e=Ie.parentNode;_e.insertBefore(Ue.createTextNode(ye),Ie.nextSibling)}tt(Ie),xe||Ie.parentNode.removeChild(Ie)}}}function tt(Ie){for(;!Ie.nextSibling;)if(Ie=Ie.parentNode,!Ie)return;function lt(ze,xe){var ye=xe?ze.cloneNode(!1):ze,_e=ze.parentNode;if(_e){var ne=lt(_e,1),re=ze.nextSibling;ne.appendChild(ye);for(var de=re;de;de=re)re=de.nextSibling,ne.appendChild(de)}return ye}for(var nt=lt(Ie.nextSibling,0),De;(De=nt.parentNode)&&De.nodeType===1;)nt=De;Ze.push(nt)}for(var et=0;et=_e&&(st+=2),Ue>=ne&&(ut+=2)}}finally{De&&(De.style.display=ze)}}var pe={};function fe(Te,Le){for(var Pe=Le.length;--Pe>=0;){var He=Le[Pe];pe.hasOwnProperty(He)?W.console&&console.warn("cannot override language handler %s",He):pe[He]=Te}}function oe(Te,Le){return Te&&pe.hasOwnProperty(Te)||(Te=/^\s*]*(?:>|$)/],[A,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[E,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^