(window.webpackJsonp=window.webpackJsonp||[]).push([[217,5,7],{"+ua5":function(et,We,J){},"55Ip":function(et,We,J){"use strict";J.d(We,"a",function(){return t});var de=J("Ty5D"),H=J("dI71"),C=J("q1tI"),j=J.n(C),L=J("YS25"),A=J("17x9"),B=J.n(A),M=J("wx14"),w=J("zLVn"),S=J("9R94"),m=function(l){Object(H.a)(h,l);function h(){for(var b,p=arguments.length,x=new Array(p),R=0;R
V&&(V=P.line_indent_level));var re={mode:K,parent:P,last_token:P?P.last_token:new s(t.START_BLOCK,""),last_word:P?P.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:V,alignment:0,line_indent_level:P?P.line_indent_level:V,start_line_index:this._output.get_line_number(),ternary_depth:0};return re},U.prototype._reset=function(P){var K=P.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new g(this._options,K),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(d.BlockStatement);var V=new o(P,this._options);return this._tokens=V.tokenize(),P},U.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var P,K=this._reset(this._source_text),V=this._options.eol;this._options.eol==="auto"&&(V=`
`,K&&a.lineBreak.test(K||"")&&(V=K.match(a.lineBreak)[0]));for(var re=this._tokens.next();re;)this.handle_token(re),this._last_last_text=this._flags.last_token.text,this._flags.last_token=re,re=this._tokens.next();return P=this._output.get_code(V),P},U.prototype.handle_token=function(P,K){P.type===t.START_EXPR?this.handle_start_expr(P):P.type===t.END_EXPR?this.handle_end_expr(P):P.type===t.START_BLOCK?this.handle_start_block(P):P.type===t.END_BLOCK?this.handle_end_block(P):P.type===t.WORD?this.handle_word(P):P.type===t.RESERVED?this.handle_word(P):P.type===t.SEMICOLON?this.handle_semicolon(P):P.type===t.STRING?this.handle_string(P):P.type===t.EQUALS?this.handle_equals(P):P.type===t.OPERATOR?this.handle_operator(P):P.type===t.COMMA?this.handle_comma(P):P.type===t.BLOCK_COMMENT?this.handle_block_comment(P,K):P.type===t.COMMENT?this.handle_comment(P,K):P.type===t.DOT?this.handle_dot(P):P.type===t.EOF?this.handle_eof(P):P.type===t.UNKNOWN?this.handle_unknown(P,K):this.handle_unknown(P,K)},U.prototype.handle_whitespace_and_comments=function(P,K){var V=P.newlines,re=this._options.keep_array_indentation&&x(this._flags.mode);if(P.comments_before)for(var ee=P.comments_before.next();ee;)this.handle_whitespace_and_comments(ee,K),this.handle_token(ee,K),ee=P.comments_before.next();if(re)for(var le=0;le0,K);else if(this._options.max_preserve_newlines&&V>this._options.max_preserve_newlines&&(V=this._options.max_preserve_newlines),this._options.preserve_newlines&&V>1){this.print_newline(!1,K);for(var oe=1;oe0&&(!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))},U.prototype.set_mode=function(P){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,P),this._flags=this.create_flags(this._previous_flags,P),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},U.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))},U.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||E(this._flags.last_token,["get","set"]))},U.prototype.start_of_statement=function(P){var K=!1;return K=K||E(this._flags.last_token,["var","let","const"])&&P.type===t.WORD,K=K||f(this._flags.last_token,"do"),K=K||!(this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement)&&E(this._flags.last_token,W)&&!P.newlines,K=K||f(this._flags.last_token,"else")&&!(f(P,"if")&&!P.comments_before),K=K||this._flags.last_token.type===t.END_EXPR&&(this._previous_flags.mode===d.ForInitializer||this._previous_flags.mode===d.Conditional),K=K||this._flags.last_token.type===t.WORD&&this._flags.mode===d.BlockStatement&&!this._flags.in_case&&!(P.text==="--"||P.text==="++")&&this._last_last_text!=="function"&&P.type!==t.WORD&&P.type!==t.RESERVED,K=K||this._flags.mode===d.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||E(this._flags.last_token,["get","set"])),K?(this.set_mode(d.Statement),this.indent(),this.handle_whitespace_and_comments(P,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(P,E(P,["do","for","if","while"])),!0):!1},U.prototype.handle_start_expr=function(P){this.start_of_statement(P)||this.handle_whitespace_and_comments(P);var K=d.Expression;if(P.text==="["){if(this._flags.last_token.type===t.WORD||this._flags.last_token.text===")"){E(this._flags.last_token,n)&&(this._output.space_before_token=!0),this.print_token(P),this.set_mode(K),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}K=d.ArrayLiteral,x(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())),r(this._flags.last_token.type,[t.START_EXPR,t.END_EXPR,t.WORD,t.OPERATOR,t.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===t.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,K=d.ForInitializer):r(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,K=d.Conditional):r(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&P.whitespace_before===""?this._output.space_before_token=!1:(r(this._flags.last_token.text,n)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===t.EQUALS||this._flags.last_token.type===t.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(P);else if(this._flags.last_token.type===t.WORD){this._output.space_before_token=!1;var V=this._tokens.peek(-3);if(this._options.space_after_named_function&&V){var re=this._tokens.peek(-4);E(V,["async","function"])||V.text==="*"&&E(re,["async","function"])?this._output.space_before_token=!0:this._flags.mode===d.ObjectLiteral?(V.text==="{"||V.text===","||V.text==="*"&&(re.text==="{"||re.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(P);(this._flags.last_token.type===t.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(r(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&r(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===t.START_BLOCK?this.print_newline():(this._flags.last_token.type===t.END_EXPR||this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===t.COMMA)&&this.allow_wrap_or_preserved_newline(P,P.newlines),this.print_token(P),this.set_mode(K),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},U.prototype.handle_end_expr=function(P){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(P),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(P,P.text==="]"&&x(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===t.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(P),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)},U.prototype.handle_start_block=function(P){this.handle_whitespace_and_comments(P);var K=this._tokens.peek(),V=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===t.END_EXPR?(this.set_mode(d.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(d.BlockStatement):V&&(r(V.text,[":",","])&&r(K.type,[t.STRING,t.WORD,t.RESERVED])||r(K.text,["get","set","..."])&&r(V.type,[t.WORD,t.RESERVED]))?r(this._last_last_text,["class","interface"])&&!r(V.text,[":",","])?this.set_mode(d.BlockStatement):this.set_mode(d.ObjectLiteral):this._flags.last_token.type===t.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(d.BlockStatement):r(this._flags.last_token.type,[t.EQUALS,t.START_EXPR,t.COMMA,t.OPERATOR])||E(this._flags.last_token,["return","throw","import","default"])?this.set_mode(d.ObjectLiteral):this.set_mode(d.BlockStatement),this._flags.last_token&&(E(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var re=!K.comments_before&&K.text==="}",ee=re&&this._flags.last_word==="function"&&this._flags.last_token.type===t.END_EXPR;if(this._options.brace_preserve_inline){var le=0,oe=null;this._flags.inline_frame=!0;do if(le+=1,oe=this._tokens.peek(le-1),oe.newlines){this._flags.inline_frame=!1;break}while(oe.type!==t.EOF&&!(oe.type===t.END_BLOCK&&oe.opened===P))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&P.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==t.OPERATOR&&(ee||this._flags.last_token.type===t.EQUALS||E(this._flags.last_token,y)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(x(this._previous_flags.mode)&&(this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.COMMA)&&((this._flags.last_token.type===t.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(P),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==t.OPERATOR&&this._flags.last_token.type!==t.START_EXPR&&(this._flags.last_token.type===t.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(P),this.indent(),!re&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},U.prototype.handle_end_block=function(P){for(this.handle_whitespace_and_comments(P);this._flags.mode===d.Statement;)this.restore_mode();var K=this._flags.last_token.type===t.START_BLOCK;this._flags.inline_frame&&!K?this._output.space_before_token=!0:this._options.brace_style==="expand"?K||this.print_newline():K||(x(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(P)},U.prototype.handle_word=function(P){if(P.type===t.RESERVED){if(r(P.text,["set","get"])&&this._flags.mode!==d.ObjectLiteral)P.type=t.WORD;else if(P.text==="import"&&r(this._tokens.peek().text,["(","."]))P.type=t.WORD;else if(r(P.text,["as","from"])&&!this._flags.import_block)P.type=t.WORD;else if(this._flags.mode===d.ObjectLiteral){var K=this._tokens.peek();K.text===":"&&(P.type=t.WORD)}}if(this.start_of_statement(P)?E(this._flags.last_token,["var","let","const"])&&P.type===t.WORD&&(this._flags.declaration_statement=!0):P.newlines&&!R(this._flags.mode)&&(this._flags.last_token.type!==t.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==t.EQUALS&&(this._options.preserve_newlines||!E(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(P),this.print_newline()):this.handle_whitespace_and_comments(P),this._flags.do_block&&!this._flags.do_while)if(f(P,"while")){this._output.space_before_token=!0,this.print_token(P),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&&f(P,"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&&E(P,["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(P),this._flags.in_case=!0;return}if((this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.EQUALS||this._flags.last_token.type===t.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(P)),f(P,"function")){(r(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(r(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===t.OPERATOR))&&(!this._output.just_added_blankline()&&!P.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===t.RESERVED||this._flags.last_token.type===t.WORD?E(this._flags.last_token,["get","set","new","export"])||E(this._flags.last_token,W)?this._output.space_before_token=!0:f(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===t.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(R(this._flags.mode)||x(this._flags.mode))||this.print_newline(),this.print_token(P),this._flags.last_word=P.text;return}var V="NONE";if(this._flags.last_token.type===t.END_BLOCK?this._previous_flags.inline_frame?V="SPACE":E(P,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&P.newlines?V="NEWLINE":(V="SPACE",this._output.space_before_token=!0):V="NEWLINE":this._flags.last_token.type===t.SEMICOLON&&this._flags.mode===d.BlockStatement?V="NEWLINE":this._flags.last_token.type===t.SEMICOLON&&R(this._flags.mode)?V="SPACE":this._flags.last_token.type===t.STRING?V="NEWLINE":this._flags.last_token.type===t.RESERVED||this._flags.last_token.type===t.WORD||this._flags.last_token.text==="*"&&(r(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&r(this._last_last_text,["{",","]))?V="SPACE":this._flags.last_token.type===t.START_BLOCK?this._flags.inline_frame?V="SPACE":V="NEWLINE":this._flags.last_token.type===t.END_EXPR&&(this._output.space_before_token=!0,V="NEWLINE"),E(P,n)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?V="SPACE":V="NEWLINE"),E(P,["else","catch","finally"]))if((!(this._flags.last_token.type===t.END_BLOCK&&this._previous_flags.mode===d.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&P.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var re=this._output.current_line;re.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else V==="NEWLINE"?E(this._flags.last_token,y)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&E(P,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==t.END_EXPR?(this._flags.last_token.type!==t.START_EXPR||!E(P,["var","let","const"]))&&this._flags.last_token.text!==":"&&(f(P,"if")&&f(P.previous,"else")?this._output.space_before_token=!0:this.print_newline()):E(P,n)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&x(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():V==="SPACE"&&(this._output.space_before_token=!0);P.previous&&(P.previous.type===t.WORD||P.previous.type===t.RESERVED)&&(this._output.space_before_token=!0),this.print_token(P),this._flags.last_word=P.text,P.type===t.RESERVED&&(P.text==="do"?this._flags.do_block=!0:P.text==="if"?this._flags.if_block=!0:P.text==="import"?this._flags.import_block=!0:this._flags.import_block&&f(P,"from")&&(this._flags.import_block=!1))},U.prototype.handle_semicolon=function(P){this.start_of_statement(P)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(P);for(var K=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&f(K,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(P)},U.prototype.handle_string=function(P){P.text.startsWith("`")&&P.newlines===0&&P.whitespace_before===""&&(P.previous.text===")"||this._flags.last_token.type===t.WORD)||(this.start_of_statement(P)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(P),this._flags.last_token.type===t.RESERVED||this._flags.last_token.type===t.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.EQUALS||this._flags.last_token.type===t.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(P):P.text.startsWith("`")&&this._flags.last_token.type===t.END_EXPR&&(P.previous.text==="]"||P.previous.text===")")&&P.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(P)},U.prototype.handle_equals=function(P){this.start_of_statement(P)||this.handle_whitespace_and_comments(P),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(P),this._output.space_before_token=!0},U.prototype.handle_comma=function(P){this.handle_whitespace_and_comments(P,!0),this.print_token(P),this._output.space_before_token=!0,this._flags.declaration_statement?(R(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(P)):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(P)},U.prototype.handle_operator=function(P){var K=P.text==="*"&&(E(this._flags.last_token,["function","yield"])||r(this._flags.last_token.type,[t.START_BLOCK,t.COMMA,t.END_BLOCK,t.SEMICOLON])),V=r(P.text,["-","+"])&&(r(this._flags.last_token.type,[t.START_BLOCK,t.START_EXPR,t.EQUALS,t.OPERATOR])||r(this._flags.last_token.text,n)||this._flags.last_token.text===",");if(!this.start_of_statement(P)){var re=!K;this.handle_whitespace_and_comments(P,re)}if(P.text==="*"&&this._flags.last_token.type===t.DOT){this.print_token(P);return}if(P.text==="::"){this.print_token(P);return}if(this._flags.last_token.type===t.OPERATOR&&r(this._options.operator_position,h)&&this.allow_wrap_or_preserved_newline(P),P.text===":"&&this._flags.in_case){this.print_token(P),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==t.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 ee=!0,le=!0,oe=!1;if(P.text===":"?this._flags.ternary_depth===0?ee=!1:(this._flags.ternary_depth-=1,oe=!0):P.text==="?"&&(this._flags.ternary_depth+=1),!V&&!K&&this._options.preserve_newlines&&r(P.text,e)){var $=P.text===":",Z=$&&oe,ne=$&&!oe;switch(this._options.operator_position){case l.before_newline:this._output.space_before_token=!ne,this.print_token(P),(!$||Z)&&this.allow_wrap_or_preserved_newline(P),this._output.space_before_token=!0;return;case l.after_newline:this._output.space_before_token=!0,!$||Z?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(P):this._output.space_before_token=!1,this.print_token(P),this._output.space_before_token=!0;return;case l.preserve_newline:ne||this.allow_wrap_or_preserved_newline(P),ee=!(this._output.just_added_newline()||ne),this._output.space_before_token=ee,this.print_token(P),this._output.space_before_token=!0;return}}if(K){this.allow_wrap_or_preserved_newline(P),ee=!1;var X=this._tokens.peek();le=X&&r(X.type,[t.WORD,t.RESERVED])}else if(P.text==="...")this.allow_wrap_or_preserved_newline(P),ee=this._flags.last_token.type===t.START_BLOCK,le=!1;else if(r(P.text,["--","++","!","~"])||V){if((this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.START_EXPR)&&this.allow_wrap_or_preserved_newline(P),ee=!1,le=!1,P.newlines&&(P.text==="--"||P.text==="++"||P.text==="~")){var z=E(this._flags.last_token,y)&&P.newlines;z&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(z,!0)}this._flags.last_token.text===";"&&R(this._flags.mode)&&(ee=!0),this._flags.last_token.type===t.RESERVED?ee=!0:this._flags.last_token.type===t.END_EXPR?ee=!(this._flags.last_token.text==="]"&&(P.text==="--"||P.text==="++")):this._flags.last_token.type===t.OPERATOR&&(ee=r(P.text,["--","-","++","+"])&&r(this._flags.last_token.text,["--","-","++","+"]),r(P.text,["+","-"])&&r(this._flags.last_token.text,["--","++"])&&(le=!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||ee,this.print_token(P),this._output.space_before_token=le},U.prototype.handle_block_comment=function(P,K){if(this._output.raw){this._output.add_raw_token(P),P.directives&&P.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(P.directives){this.print_newline(!1,K),this.print_token(P),P.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!a.newline.test(P.text)&&!P.newlines){this._output.space_before_token=!0,this.print_token(P),this._output.space_before_token=!0;return}else this.print_block_commment(P,K)},U.prototype.print_block_commment=function(P,K){var V=p(P.text),re,ee=!1,le=!1,oe=P.whitespace_before,$=oe.length;if(this.print_newline(!1,K),this.print_token_line_indentation(P),this._output.add_token(V[0]),this.print_newline(!1,K),V.length>1){for(V=V.slice(1),ee=O(V,"*"),le=N(V,oe),ee&&(this._flags.alignment=1),re=0;re=0;a--)if(this.__items[a].match(s))return!0;return!1},S.prototype.set_indent=function(s,a){this.is_empty()&&(this.__indent_count=s||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},S.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)},S.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},S.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var s=this.__parent.current_line;return s.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),s.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),s.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,s.__items[0]===" "&&(s.__items.splice(0,1),s.__character_count-=1),!0}return!1},S.prototype.is_empty=function(){return this.__items.length===0},S.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},S.prototype.push=function(s){this.__items.push(s);var a=s.lastIndexOf(`
`);a!==-1?this.__character_count=s.length-a:this.__character_count+=s.length},S.prototype.pop=function(){var s=null;return this.is_empty()||(s=this.__items.pop(),this.__character_count-=s.length),s},S.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},S.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},S.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},S.prototype.toString=function(){var s="";return this.is_empty()?this.__parent.indent_empty_lines&&(s=this.__parent.get_indent_string(this.__indent_count)):(s=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),s+=this.__items.join("")),s};function m(s,a){this.__cache=[""],this.__indent_size=s.indent_size,this.__indent_string=s.indent_char,s.indent_with_tabs||(this.__indent_string=new Array(s.indent_size+1).join(s.indent_char)),a=a||"",s.indent_level>0&&(a=new Array(s.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}m.prototype.get_indent_size=function(s,a){var i=this.__base_string_length;return a=a||0,s<0&&(i=0),i+=s*this.__indent_size,i+=a,i},m.prototype.get_indent_string=function(s,a){var i=this.__base_string;return a=a||0,s<0&&(s=0,i=""),a+=s*this.__indent_size,this.__ensure_cache(a),i+=this.__cache[a],i},m.prototype.__ensure_cache=function(s){for(;s>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var s=this.__cache.length,a=0,i="";this.__indent_size&&s>=this.__indent_size&&(a=Math.floor(s/this.__indent_size),s-=a*this.__indent_size,i=new Array(a+1).join(this.__indent_string)),s&&(i+=new Array(s+1).join(" ")),this.__cache.push(i)};function g(s,a){this.__indent_cache=new m(s,a),this.raw=!1,this._end_with_newline=s.end_with_newline,this.indent_size=s.indent_size,this.wrap_line_length=s.wrap_line_length,this.indent_empty_lines=s.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new S(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}g.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},g.prototype.get_line_number=function(){return this.__lines.length},g.prototype.get_indent_string=function(s,a){return this.__indent_cache.get_indent_string(s,a)},g.prototype.get_indent_size=function(s,a){return this.__indent_cache.get_indent_size(s,a)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(s){return this.is_empty()||!s&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.prototype.get_code=function(s){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
`);return s!==`
`&&(i=i.replace(/[\n]/g,s)),i},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.prototype.set_indent=function(s,a){return s=s||0,a=a||0,this.next_line.set_indent(s,a),this.__lines.length>1?(this.current_line.set_indent(s,a),!0):(this.current_line.set_indent(),!1)},g.prototype.add_raw_token=function(s){for(var a=0;a1&&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},g.prototype.just_added_newline=function(){return this.current_line.is_empty()},g.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},g.prototype.ensure_empty_line_above=function(s,a){for(var i=this.__lines.length-2;i>=0;){var o=this.__lines[i];if(o.is_empty())break;if(o.item(0).indexOf(s)!==0&&o.item(-1)!==a){this.__lines.splice(i+1,0,new S(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},w.exports.Output=g},function(w){function S(m,g,s,a){this.type=m,this.text=g,this.comments_before=null,this.newlines=s||0,this.whitespace_before=a||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}w.exports.Token=S},function(w,S){var m="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",g="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",s="\\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",a="\\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",i="(?:\\\\u[0-9a-fA-F]{4}|["+m+s+"])",o="(?:\\\\u[0-9a-fA-F]{4}|["+g+s+a+"])*";S.identifier=new RegExp(i+o,"g"),S.identifierStart=new RegExp(i),S.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+g+s+a+"])+");var n=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;S.newline=/[\n\r\u2028\u2029]/,S.lineBreak=new RegExp(`\r
|`+S.newline.source),S.allLineBreaks=new RegExp(S.lineBreak.source,"g")},function(w,S,m){var g=m(6).Options,s=["before-newline","after-newline","preserve-newline"];function a(i){g.call(this,i,"js");var o=this.raw_options.brace_style||null;o==="expand-strict"?this.raw_options.brace_style="expand":o==="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 n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var e=0;e>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),u=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";u=u.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),u="\\?\\.(?!\\d) "+u,u=u.replace(/ /g,"|");var l=new RegExp(u),h="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),d=h.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),b=new RegExp("^(?:"+d.join("|")+")$"),p,x=function(O,N){s.call(this,O,N),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var U=new n(this._input),W=new e(this._input).read_options(this._options);this.__patterns={template:W,identifier:W.starting_with(o.identifier).matching(o.identifierMatch),number:U.matching(v),punct:U.matching(l),comment:U.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:U.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:U.matching(//),include:U.starting_with(/#include/).until_after(o.lineBreak),shebang:U.starting_with(/#!/).until_after(o.lineBreak),xml:U.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:W.until(/['\\\n\r\u2028\u2029]/),double_quote:W.until(/["\\\n\r\u2028\u2029]/),template_text:W.until(/[`\\$]/),template_expression:W.until(/[`}\\]/)}};x.prototype=new s,x.prototype._is_comment=function(O){return O.type===r.COMMENT||O.type===r.BLOCK_COMMENT||O.type===r.UNKNOWN},x.prototype._is_opening=function(O){return O.type===r.START_BLOCK||O.type===r.START_EXPR},x.prototype._is_closing=function(O,N){return(O.type===r.END_BLOCK||O.type===r.END_EXPR)&&N&&(O.text==="]"&&N.text==="["||O.text===")"&&N.text==="("||O.text==="}"&&N.text==="{")},x.prototype._reset=function(){p=!1},x.prototype._get_next_token=function(O,N){var U=null;this._readWhitespace();var W=this._input.peek();return W===null?this._create_token(r.EOF,""):(U=U||this._read_non_javascript(W),U=U||this._read_string(W),U=U||this._read_word(O),U=U||this._read_singles(W),U=U||this._read_comment(W),U=U||this._read_regexp(W,O),U=U||this._read_xml(W,O),U=U||this._read_punctuation(),U=U||this._create_token(r.UNKNOWN,this._input.next()),U)},x.prototype._read_word=function(O){var N;if(N=this.__patterns.identifier.read(),N!=="")return N=N.replace(o.allLineBreaks,`
`),!(O.type===r.DOT||O.type===r.RESERVED&&(O.text==="set"||O.text==="get"))&&b.test(N)?(N==="in"||N==="of")&&(O.type===r.WORD||O.type===r.STRING)?this._create_token(r.OPERATOR,N):this._create_token(r.RESERVED,N):this._create_token(r.WORD,N);if(N=this.__patterns.number.read(),N!=="")return this._create_token(r.WORD,N)},x.prototype._read_singles=function(O){var N=null;return O==="("||O==="["?N=this._create_token(r.START_EXPR,O):O===")"||O==="]"?N=this._create_token(r.END_EXPR,O):O==="{"?N=this._create_token(r.START_BLOCK,O):O==="}"?N=this._create_token(r.END_BLOCK,O):O===";"?N=this._create_token(r.SEMICOLON,O):O==="."&&E.test(this._input.peek(1))?N=this._create_token(r.DOT,O):O===","&&(N=this._create_token(r.COMMA,O)),N&&this._input.next(),N},x.prototype._read_punctuation=function(){var O=this.__patterns.punct.read();if(O!=="")return O==="="?this._create_token(r.EQUALS,O):O==="?."?this._create_token(r.DOT,O):this._create_token(r.OPERATOR,O)},x.prototype._read_non_javascript=function(O){var N="";if(O==="#"){if(this._is_first_token()&&(N=this.__patterns.shebang.read(),N))return this._create_token(r.UNKNOWN,N.trim()+`
`);if(N=this.__patterns.include.read(),N)return this._create_token(r.UNKNOWN,N.trim()+`
`);O=this._input.next();var U="#";if(this._input.hasNext()&&this._input.testChar(f)){do O=this._input.next(),U+=O;while(this._input.hasNext()&&O!=="#"&&O!=="=");return O==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(U+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(U+="{}",this._input.next(),this._input.next())),this._create_token(r.WORD,U)}this._input.back()}else if(O==="<"&&this._is_first_token()){if(N=this.__patterns.html_comment_start.read(),N){for(;this._input.hasNext()&&!this._input.testChar(o.newline);)N+=this._input.next();return p=!0,this._create_token(r.COMMENT,N)}}else if(p&&O==="-"&&(N=this.__patterns.html_comment_end.read(),N))return p=!1,this._create_token(r.COMMENT,N);return null},x.prototype._read_comment=function(O){var N=null;if(O==="/"){var U="";if(this._input.peek(1)==="*"){U=this.__patterns.block_comment.read();var W=T.get_directives(U);W&&W.ignore==="start"&&(U+=T.readIgnored(this._input)),U=U.replace(o.allLineBreaks,`
`),N=this._create_token(r.BLOCK_COMMENT,U),N.directives=W}else this._input.peek(1)==="/"&&(U=this.__patterns.comment.read(),N=this._create_token(r.COMMENT,U))}return N},x.prototype._read_string=function(O){if(O==="`"||O==="'"||O==='"'){var N=this._input.next();return this.has_char_escapes=!1,O==="`"?N+=this._read_string_recursive("`",!0,"${"):N+=this._read_string_recursive(O),this.has_char_escapes&&this._options.unescape_strings&&(N=R(N)),this._input.peek()===O&&(N+=this._input.next()),N=N.replace(o.allLineBreaks,`
`),this._create_token(r.STRING,N)}return null},x.prototype._allow_regexp_or_xml=function(O){return O.type===r.RESERVED&&t(O.text,["return","case","throw","else","do","typeof","yield"])||O.type===r.END_EXPR&&O.text===")"&&O.opened.previous.type===r.RESERVED&&t(O.opened.previous.text,["if","while","for"])||t(O.type,[r.COMMENT,r.START_EXPR,r.START_BLOCK,r.START,r.END_BLOCK,r.OPERATOR,r.EQUALS,r.EOF,r.SEMICOLON,r.COMMA])},x.prototype._read_regexp=function(O,N){if(O==="/"&&this._allow_regexp_or_xml(N)){for(var U=this._input.next(),W=!1,P=!1;this._input.hasNext()&&(W||P||this._input.peek()!==O)&&!this._input.testChar(o.newline);)U+=this._input.peek(),W?W=!1:(W=this._input.peek()==="\\",this._input.peek()==="["?P=!0:this._input.peek()==="]"&&(P=!1)),this._input.next();return this._input.peek()===O&&(U+=this._input.next(),U+=this._input.read(o.identifier)),this._create_token(r.STRING,U)}return null},x.prototype._read_xml=function(O,N){if(this._options.e4x&&O==="<"&&this._allow_regexp_or_xml(N)){var U="",W=this.__patterns.xml.read_match();if(W){for(var P=W[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),K=P.indexOf("{")===0,V=0;W;){var re=!!W[1],ee=W[2],le=!!W[W.length-1]||ee.slice(0,8)==="![CDATA[";if(!le&&(ee===P||K&&ee.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(re?--V:++V),U+=W[0],V<=0)break;W=this.__patterns.xml.read_match()}return W||(U+=this._input.match(/[\s\S]*/g)[0]),U=U.replace(o.allLineBreaks,`
`),this._create_token(r.STRING,U)}}return null};function R(O){for(var N="",U=0,W=new g(O),P=null;W.hasNext();)if(P=W.match(/([\s]|[^\\]|\\\\)+/g),P&&(N+=P[0]),W.peek()==="\\"){if(W.next(),W.peek()==="x")P=W.match(/x([0-9A-Fa-f]{2})/g);else if(W.peek()==="u")P=W.match(/u([0-9A-Fa-f]{4})/g);else{N+="\\",W.hasNext()&&(N+=W.next());continue}if(!P)return O;if(U=parseInt(P[1],16),U>126&&U<=255&&P[0].indexOf("x")===0)return O;if(U>=0&&U<32){N+="\\"+P[0];continue}else U===34||U===39||U===92?N+="\\"+String.fromCharCode(U):N+=String.fromCharCode(U)}return N}x.prototype._read_string_recursive=function(O,N,U){var W,P;O==="'"?P=this.__patterns.single_quote:O==='"'?P=this.__patterns.double_quote:O==="`"?P=this.__patterns.template_text:O==="}"&&(P=this.__patterns.template_expression);for(var K=P.read(),V="";this._input.hasNext();){if(V=this._input.next(),V===O||!N&&o.newline.test(V)){this._input.back();break}else V==="\\"&&this._input.hasNext()?(W=this._input.peek(),W==="x"||W==="u"?this.has_char_escapes=!0:W==="\r"&&this._input.peek(1)===`
`&&this._input.next(),V+=this._input.next()):U&&(U==="${"&&V==="$"&&this._input.peek()==="{"&&(V+=this._input.next()),U===V&&(O==="`"?V+=this._read_string_recursive("}",N,"`"):V+=this._read_string_recursive("`",N,"${"),this._input.hasNext()&&(V+=this._input.next())));V+=P.read(),K+=V}return K},w.exports.Tokenizer=x,w.exports.TOKEN=r,w.exports.positionable_operators=y.slice(),w.exports.line_starters=h.slice()},function(w){var S=RegExp.prototype.hasOwnProperty("sticky");function m(g){this.__input=g||"",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&&g=0&&s=g.length&&this.__input.substring(s-g.length,s).toLowerCase()===g},w.exports.InputScanner=m},function(w,S,m){var g=m(8).InputScanner,s=m(3).Token,a=m(10).TokenStream,i=m(11).WhitespacePattern,o={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},n=function(e,t){this._input=new g(e),this._options=t||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new i(this._input)};n.prototype.tokenize=function(){this._input.restart(),this.__tokens=new a,this._reset();for(var e,t=new s(o.START,""),r=null,T=[],v=new a;t.type!==o.EOF;){for(e=this._get_next_token(t,r);this._is_comment(e);)v.add(e),e=this._get_next_token(t,r);v.isEmpty()||(e.comments_before=v,v=new a),e.parent=r,this._is_opening(e)?(T.push(r),r=e):r&&this._is_closing(e,r)&&(e.opened=r,r.closed=e,r=T.pop(),e.parent=r),e.previous=t,t.next=e,this.__tokens.add(e),t=e}return this.__tokens},n.prototype._is_first_token=function(){return this.__tokens.isEmpty()},n.prototype._reset=function(){},n.prototype._get_next_token=function(e,t){this._readWhitespace();var r=this._input.read(/.+/g);return r?this._create_token(o.RAW,r):this._create_token(o.EOF,"")},n.prototype._is_comment=function(e){return!1},n.prototype._is_opening=function(e){return!1},n.prototype._is_closing=function(e,t){return!1},n.prototype._create_token=function(e,t){var r=new s(e,t,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return r},n.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},w.exports.Tokenizer=n,w.exports.TOKEN=o},function(w){function S(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}S.prototype.restart=function(){this.__position=0},S.prototype.isEmpty=function(){return this.__tokens_length===0},S.prototype.hasNext=function(){return this.__position=0&&m/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}a.prototype=new g,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(i){var o=this._create();return o._disabled[i]=!0,o._update(),o},a.prototype.read_options=function(i){var o=this._create();for(var n in s)o._disabled[n]=i.templating.indexOf(n)===-1;return o._update(),o},a.prototype.exclude=function(i){var o=this._create();return o._excluded[i]=!0,o._update(),o},a.prototype.read=function(){var i="";this._match_pattern?i=this._input.read(this._starting_pattern):i=this._input.read(this._starting_pattern,this.__template_pattern);for(var o=this._read_template();o;)this._match_pattern?o+=this._input.read(this._match_pattern):o+=this._input.readUntil(this.__template_pattern),i+=o,o=this._read_template();return this._until_after&&(i+=this._input.readUntilAfter(this._until_pattern)),i},a.prototype.__set_templated_pattern=function(){var i=[];this._disabled.php||i.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||i.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||i.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(i.push(this.__patterns.django._starting_pattern.source),i.push(this.__patterns.django_value._starting_pattern.source),i.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||i.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&i.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+i.join("|")+")")},a.prototype._read_template=function(){var i="",o=this._input.peek();if(o==="<"){var n=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&n==="?"&&(i=i||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&n==="%"&&(i=i||this.__patterns.erb.read())}else o==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(i=i||this.__patterns.handlebars_comment.read(),i=i||this.__patterns.handlebars_unescaped.read(),i=i||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(i=i||this.__patterns.django_value.read()),this._excluded.django||(i=i||this.__patterns.django_comment.read(),i=i||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(i=i||this.__patterns.smarty_comment.read(),i=i||this.__patterns.smarty_literal.read(),i=i||this.__patterns.smarty.read()));return i},w.exports.TemplatablePattern=a}],A={};function B(w){var S=A[w];if(S!==void 0)return S.exports;var m=A[w]={exports:{}};return L[w](m,m.exports,B),m.exports}var M=B(0);C=M})();var j=C;!(de=[],H=function(){return{js_beautify:j}}.apply(We,de),H!==void 0&&(et.exports=H))})()},"815F":function(et,We,J){"use strict";J.d(We,"e",function(){return B}),J.d(We,"c",function(){return w}),J.d(We,"d",function(){return S}),J.d(We,"a",function(){return g}),J.d(We,"f",function(){return s}),J.d(We,"b",function(){return a});var de=J("KQm4"),H=J("VTBJ"),C=J("Ff2n"),j=J("Zm9Q"),L=J("Kwbf"),A=J("OZM5");function B(i,o){return i!=null?i:o}function M(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=new Map;function n(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(e||[]).forEach(function(r){var T=r.key,v=r.children;Object(L.a)(T!=null,"Tree node must have a certain key: [".concat(t).concat(T,"]"));var f=String(T);Object(L.a)(!o.has(f)||T===null||T===void 0,"Same 'key' exist in the Tree: ".concat(f)),o.set(f,!0),n(v,"".concat(t).concat(f," > "))})}n(i)}function w(i){function o(n){var e=Object(j.a)(n);return e.map(function(t){if(!Object(A.i)(t))return Object(L.a)(!t,"Tree/TreeNode can only accept TreeNode as children."),null;var r=t.key,T=t.props,v=T.children,f=Object(C.a)(T,["children"]),E=Object(H.a)({key:r},f),y=o(v);return y.length&&(E.children=y),E}).filter(function(t){return t})}return o(i)}function S(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=new Set(o===!0?[]:o),e=[];function t(r){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return r.map(function(v,f){var E=Object(A.h)(T?T.pos:"0",f),y=B(v.key,E),u=Object(H.a)(Object(H.a)({},v),{},{parent:T,pos:E,children:null,data:v,isStart:[].concat(Object(de.a)(T?T.isStart:[]),[f===0]),isEnd:[].concat(Object(de.a)(T?T.isEnd:[]),[f===r.length-1])});return e.push(u),o===!0||n.has(y)?u.children=t(v.children||[],u):u.children=[],u})}return t(i),e}function m(i,o,n){var e;n?typeof n=="string"?e=function(T){return T[n]}:typeof n=="function"&&(e=function(T){return n(T)}):e=function(T,v){return B(T.key,v)};function t(r,T,v){var f=r?r.children:i,E=r?Object(A.h)(v.pos,T):"0";if(r){var y=e(r,E),u={node:r,index:T,pos:E,key:y,parentPos:v.node?v.pos:null,level:v.level+1};o(u)}f&&f.forEach(function(l,h){t(l,h,{node:r,pos:E,level:v?v.level+1:-1})})}t(null)}function g(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=o.initWrapper,e=o.processEntity,t=o.onProcessFinished,r=arguments.length>2?arguments[2]:void 0,T={},v={},f={posEntities:T,keyEntities:v};return n&&(f=n(f)||f),m(i,function(E){var y=E.node,u=E.index,l=E.pos,h=E.key,d=E.parentPos,b=E.level,p={node:y,index:u,key:h,pos:l,level:b},x=B(h,l);T[l]=p,v[x]=p,p.parent=T[d],p.parent&&(p.parent.children=p.parent.children||[],p.parent.children.push(p)),e&&e(p,f)},r),t&&t(f),f}function s(i,o){var n=o.expandedKeys,e=o.selectedKeys,t=o.loadedKeys,r=o.loadingKeys,T=o.checkedKeys,v=o.halfCheckedKeys,f=o.dragOverNodeKey,E=o.dropPosition,y=o.keyEntities,u=y[i],l={eventKey:i,expanded:n.indexOf(i)!==-1,selected:e.indexOf(i)!==-1,loaded:t.indexOf(i)!==-1,loading:r.indexOf(i)!==-1,checked:T.indexOf(i)!==-1,halfChecked:v.indexOf(i)!==-1,pos:String(u?u.pos:""),dragOver:f===i&&E===0,dragOverGapTop:f===i&&E===-1,dragOverGapBottom:f===i&&E===1};return l}function a(i){var o=i.data,n=i.expanded,e=i.selected,t=i.checked,r=i.loaded,T=i.loading,v=i.halfChecked,f=i.dragOver,E=i.dragOverGapTop,y=i.dragOverGapBottom,u=i.pos,l=i.active,h=Object(H.a)(Object(H.a)({},o),{},{expanded:n,selected:e,checked:t,loaded:r,loading:T,halfChecked:v,dragOver:f,dragOverGapTop:E,dragOverGapBottom:y,pos:u,active:l});return"props"in h||Object.defineProperty(h,"props",{get:function(){return Object(L.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),i}}),h}},"8Jsi":function(et,We,J){"use strict";J.d(We,"d",function(){return d}),J.d(We,"a",function(){return Oe}),J.d(We,"b",function(){return Pe}),J.d(We,"c",function(){return Ae});var de=J("1OyB"),H=J("vuIU"),C=J("Ji7U"),j=J("LK+K"),L=J("KQm4"),A=J("U8pU"),B=J("ODXe"),M=J("VTBJ"),w=J("q1tI"),S=J("qNPg"),m=J("2Qr1"),g=J("815F"),s=J("NvD2"),a=J("wPlo"),i=J("6cGi"),o=J("Kwbf"),n=J("4IlW"),e=J("YrtM"),t=J("fAei"),r=w.createContext(null);function T(ue,pe){if(!ue)return!0;var ye=ue.data,Te=ye.disabled,we=ye.disableCheckbox;switch(pe){case"select":return Te;case"checkbox":return Te||we}return!1}function v(ue,pe){var ye=w.useCallback(function(we){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"select",ve=arguments.length>2?arguments[2]:void 0,Ne=ue.get(we);return!ve&&T(Ne,xe)?null:Ne},[ue]),Te=w.useCallback(function(we){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"select",ve=arguments.length>2?arguments[2]:void 0,Ne=pe.get(we);return!ve&&T(Ne,xe)?null:Ne},[pe]);return[ye,Te]}function f(ue){return w.useMemo(function(){var pe=new Map,ye=new Map;return ue.forEach(function(Te){pe.set(Te.key,Te),ye.set(Te.data.value,Te)}),[pe,ye]},[ue])}var E={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},y=function(pe,ye){var Te=pe.prefixCls,we=pe.height,xe=pe.itemHeight,ve=pe.virtual,Ne=pe.options,Ue=pe.flattenOptions,he=pe.multiple,Le=pe.searchValue,se=pe.onSelect,te=pe.onToggleOpen,ae=pe.open,G=pe.notFoundContent,Y=pe.onMouseEnter,Q=w.useContext(r),q=Q.checkable,ce=Q.checkedKeys,_e=Q.halfCheckedKeys,ke=Q.treeExpandedKeys,Ke=Q.treeDefaultExpandAll,Xe=Q.treeDefaultExpandedKeys,ze=Q.onTreeExpand,qe=Q.treeIcon,it=Q.showTreeIcon,Ye=Q.switcherIcon,mt=Q.treeLine,at=Q.treeNodeFilterProp,yt=Q.loadData,dt=Q.treeLoadedKeys,tt=Q.treeMotion,_t=Q.onTreeLoad,Et=w.useRef(),Be=Object(e.a)(function(){return Ne},[ae,Ne],function(He,Ce){return Ce[0]&&He[1]!==Ce[1]}),$e=f(Ue),Qe=Object(B.a)($e,2),Je=Qe[0],ft=Qe[1],Tt=v(Je,ft),Rt=Object(B.a)(Tt,2),ot=Rt[0],rt=Rt[1],Ze=w.useMemo(function(){return ce.map(function(He){var Ce=rt(He);return Ce?Ce.key:null})},[ce]),ut=w.useMemo(function(){return q?{checked:Ze,halfChecked:_e}:null},[Ze,_e,q]);w.useEffect(function(){if(ae&&!he&&Ze.length){var He;(He=Et.current)===null||He===void 0||He.scrollTo({key:Ze[0]})}},[ae]);var ct=String(Le).toLowerCase(),st=function(Ce){return ct?String(Ce[at]).toLowerCase().includes(ct):!1},lt=w.useState(Xe),gt=Object(B.a)(lt,2),It=gt[0],Ft=gt[1],Mt=w.useState(null),Wt=Object(B.a)(Mt,2),jt=Wt[0],Vt=Wt[1],Kt=w.useMemo(function(){return ke?Object(L.a)(ke):Le?jt:It},[It,jt,ct,ke]);w.useEffect(function(){Le&&Vt(Ue.map(function(He){return He.key}))},[Le]);var k=function(Ce){Ft(Ce),Vt(Ce),ze&&ze(Ce)},c=function(Ce){Ce.preventDefault()},_=function(Ce,Ve){var Ge=Ve.node.key,nt=ot(Ge,q?"checkbox":"select");nt!==null&&se(nt.data.value,{selected:!ce.includes(nt.data.value)}),he||te(!1)},I=w.useState(null),F=Object(B.a)(I,2),D=F[0],ie=F[1],Re=ot(D);if(w.useImperativeHandle(ye,function(){return{onKeyDown:function(Ce){var Ve,Ge=Ce.which;switch(Ge){case n.a.UP:case n.a.DOWN:case n.a.LEFT:case n.a.RIGHT:(Ve=Et.current)===null||Ve===void 0||Ve.onKeyDown(Ce);break;case n.a.ENTER:{Re!==null&&_(null,{node:{key:D},selected:!ce.includes(Re.data.value)});break}case n.a.ESC:te(!1)}},onKeyUp:function(){}}}),Be.length===0)return w.createElement("div",{role:"listbox",className:"".concat(Te,"-empty"),onMouseDown:c},G);var je={};return dt&&(je.loadedKeys=dt),Kt&&(je.expandedKeys=Kt),w.createElement("div",{onMouseDown:c,onMouseEnter:Y},Re&&ae&&w.createElement("span",{style:E,"aria-live":"assertive"},Re.data.value),w.createElement(t.b,Object.assign({ref:Et,focusable:!1,prefixCls:"".concat(Te,"-tree"),treeData:Be,height:we,itemHeight:xe,virtual:ve,multiple:he,icon:qe,showIcon:it,switcherIcon:Ye,showLine:mt,loadData:Le?null:yt,motion:tt,checkable:q,checkStrictly:!0,checkedKeys:ut,selectedKeys:q?[]:Ze,defaultExpandAll:Ke},je,{onActiveChange:ie,onSelect:_,onCheck:_,onExpand:k,onLoad:_t,filterTreeNode:st})))},u=w.forwardRef(y);u.displayName="OptionList";var l=u,h=function(){return null},d=h,b=J("Ff2n"),p=J("Zm9Q");function x(ue){return Object(p.a)(ue).map(function(pe){if(!w.isValidElement(pe)||!pe.type)return null;var ye=pe.key,Te=pe.props,we=Te.children,xe=Te.value,ve=Object(b.a)(Te,["children","value"]),Ne=Object(M.a)({key:ye,value:xe},ve),Ue=x(we);return Ue.length&&(Ne.children=Ue),Ne}).filter(function(pe){return pe})}function R(ue){if(!ue)return ue;var pe=Object(M.a)({},ue);return"props"in pe||Object.defineProperty(pe,"props",{get:function(){return Object(o.a)(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),pe}}),pe}function O(ue,pe,ye,Te,we){var xe=null,ve=null;function Ne(){function Ue(he){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0",se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return he.map(function(te,ae){var G="".concat(Le,"-").concat(ae),Y=ye.includes(te.value),Q=Ue(te.children||[],G,Y),q=w.createElement(d,Object.assign({},te),Q.map(function(_e){return _e.node}));if(pe===te.value&&(xe=q),Y){var ce={pos:G,node:q,children:Q};return se||ve.push(ce),ce}return null}).filter(function(te){return te})}ve||(ve=[],Ue(Te),ve.sort(function(he,Le){var se=he.node.props.value,te=Le.node.props.value,ae=ye.indexOf(se),G=ye.indexOf(te);return ae-G}))}Object.defineProperty(ue,"triggerNode",{get:function(){return Object(o.a)(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),Ne(),xe}}),Object.defineProperty(ue,"allCheckedNodes",{get:function(){return Object(o.a)(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),Ne(),we?ve:ve.map(function(he){var Le=he.node;return Le})}})}function N(ue){return Array.isArray(ue)?ue:ue!==void 0?[ue]:[]}function U(ue,pe){var ye=new Map;return pe.forEach(function(Te){var we=Te.data;ye.set(we.value,we)}),ue.map(function(Te){return R(ye.get(Te))})}function W(ue,pe){var ye=U([ue],pe)[0];return ye?ye.disabled:!1}function P(ue){return ue.disabled||ue.disableCheckbox||ue.checkable===!1}function K(ue){for(var pe=ue.parent,ye=0,Te=pe;Te;)Te=Te.parent,ye+=1;return ye}function V(ue){function pe(Te){return(Te||[]).map(function(we){var xe=we.value,ve=we.key,Ne=we.children,Ue=Object(M.a)(Object(M.a)({},we),{},{key:"key"in we?ve:xe});return Ne&&(Ue.children=pe(Ne)),Ue})}var ye=Object(g.d)(pe(ue),!0);return ye.map(function(Te){return{key:Te.data.key,data:Te.data,level:K(Te)}})}function re(ue){return function(pe,ye){var Te=ye[ue];return String(Te).toLowerCase().includes(String(pe).toLowerCase())}}function ee(ue,pe,ye){var Te=ye.optionFilterProp,we=ye.filterOption;if(we===!1)return pe;var xe;typeof we=="function"?xe=we:xe=re(Te);function ve(Ne){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Ne.map(function(he){var Le=he.children,se=Ue||xe(ue,R(he)),te=ve(Le||[],se);return se||te.length?Object(M.a)(Object(M.a)({},he),{},{children:te}):null}).filter(function(he){return he})}return ve(pe)}function le(ue,pe,ye,Te){var we=new Map;return N(pe).forEach(function(xe){xe&&Object(A.a)(xe)==="object"&&"value"in xe&&we.set(xe.value,xe)}),ue.map(function(xe){var ve={value:xe},Ne=ye(xe,"select",!0),Ue=Ne?Te(Ne.data):xe;if(we.has(xe)){var he=we.get(xe);ve.label="label"in he?he.label:Ue,"halfChecked"in he&&(ve.halfChecked=he.halfChecked)}else ve.label=Ue;return ve})}function oe(ue,pe){var ye=new Set(ue);return ye.add(pe),Array.from(ye)}function $(ue,pe){var ye=new Set(ue);return ye.delete(pe),Array.from(ye)}function Z(ue){var pe=ue.searchPlaceholder,ye=ue.treeCheckStrictly,Te=ue.treeCheckable,we=ue.labelInValue,xe=ue.value,ve=ue.multiple;Object(o.a)(!pe,"`searchPlaceholder` has been removed."),ye&&we===!1&&Object(o.a)(!1,"`treeCheckStrictly` will force set `labelInValue` to `true`."),(we||ye)&&Object(o.a)(N(xe).every(function(Ne){return Ne&&Object(A.a)(Ne)==="object"&&"value"in Ne}),"Invalid prop `value` supplied to `TreeSelect`. You should use { label: string, value: string | number } or [{ label: string, value: string | number }] instead."),ye||ve||Te?Object(o.a)(!xe||Array.isArray(xe),"`value` should be an array when `TreeSelect` is checkable or multiple."):Object(o.a)(!Array.isArray(xe),"`value` should not be array when `TreeSelect` is single mode.")}var ne=Z,X=10;function z(ue,pe){var ye=pe.id,Te=pe.pId,we=pe.rootPId,xe={},ve=[],Ne=ue.map(function(Ue){var he=Object(M.a)({},Ue),Le=he[ye];return xe[Le]=he,he.key=he.key||Le,he});return Ne.forEach(function(Ue){var he=Ue[Te],Le=xe[he];Le&&(Le.children=Le.children||[],Le.children.push(Ue)),(he===we||!Le&&we===null)&&ve.push(Ue)}),ve}function fe(ue,pe){var ye=0,Te=new Set;function we(xe){return(xe||[]).map(function(ve){var Ne=ve.key,Ue=ve.value,he=ve.children,Le=Object(b.a)(ve,["key","value","children"]),se="value"in ve?Ue:Ne,te=Object(M.a)(Object(M.a)({},Le),{},{key:Ne!=null?Ne:se,value:se,title:pe(ve)});return"children"in ve&&(te.children=we(he)),te})}return we(ue)}function Se(ue,pe,ye){var Te=ye.getLabelProp,we=ye.simpleMode,xe=w.useRef({});return ue?(xe.current.formatTreeData=xe.current.treeData===ue?xe.current.formatTreeData:fe(we?z(ue,Object(M.a)({id:"id",pId:"pId",rootPId:null},we!==!0?we:{})):ue,Te),xe.current.treeData=ue):xe.current.formatTreeData=xe.current.children===pe?xe.current.formatTreeData:fe(x(pe),Te),xe.current.formatTreeData}var Oe="SHOW_ALL",Ae="SHOW_PARENT",Pe="SHOW_CHILD";function me(ue,pe,ye){var Te=new Set(ue);return pe===Pe?ue.filter(function(we){var xe=ye[we];return!(xe&&xe.children&&xe.children.every(function(ve){var Ne=ve.node;return P(Ne)||Te.has(Ne.key)}))}):pe===Ae?ue.filter(function(we){var xe=ye[we],ve=xe?xe.parent:null;return!(ve&&!P(ve.node)&&Te.has(ve.node.key))}):ue}function ge(ue,pe){var ye=pe.value,Te=pe.getEntityByValue,we=pe.getEntityByKey,xe=pe.treeConduction,ve=pe.showCheckedStrategy,Ne=pe.conductKeyEntities,Ue=pe.getLabelProp;return w.useMemo(function(){var he=ue;if(xe){var Le=me(ue.map(function(se){var te=Te(se);return te?te.key:se}),ve,Ne);he=Le.map(function(se){var te=we(se);return te?te.data.value:se})}return le(he,ye,Te,Ue)},[ue,ye,xe,ve,Te])}var be=["expandedKeys","treeData","treeCheckable","showCheckedStrategy","searchPlaceholder","treeLine","treeIcon","showTreeIcon","switcherIcon","treeNodeFilterProp","filterTreeNode","dropdownPopupAlign","treeDefaultExpandAll","treeCheckStrictly","treeExpandedKeys","treeLoadedKeys","treeMotion","onTreeExpand","onTreeLoad","loadData","treeDataSimpleMode","treeNodeLabelProp","treeDefaultExpandedKeys"],Ee=Object(S.a)({prefixCls:"rc-tree-select",components:{optionList:l},convertChildrenToData:function(){return null},flattenOptions:V,getLabeledValue:m.e,filterOptions:ee,isValueDisabled:W,findValueOption:U,omitDOMProps:function(pe){var ye=Object(M.a)({},pe);return be.forEach(function(Te){delete ye[Te]}),ye}});Ee.displayName="Select";var Ie=w.forwardRef(function(ue,pe){var ye=ue.multiple,Te=ue.treeCheckable,we=ue.treeCheckStrictly,xe=ue.showCheckedStrategy,ve=xe===void 0?"SHOW_CHILD":xe,Ne=ue.labelInValue,Ue=ue.loadData,he=ue.treeLoadedKeys,Le=ue.treeNodeFilterProp,se=Le===void 0?"value":Le,te=ue.treeNodeLabelProp,ae=ue.treeDataSimpleMode,G=ue.treeData,Y=ue.treeExpandedKeys,Q=ue.treeDefaultExpandedKeys,q=ue.treeDefaultExpandAll,ce=ue.children,_e=ue.treeIcon,ke=ue.showTreeIcon,Ke=ue.switcherIcon,Xe=ue.treeLine,ze=ue.treeMotion,qe=ue.filterTreeNode,it=ue.dropdownPopupAlign,Ye=ue.onChange,mt=ue.onTreeExpand,at=ue.onTreeLoad,yt=ue.onDropdownVisibleChange,dt=ue.onSelect,tt=ue.onDeselect,_t=Te||we,Et=ye||_t,Be=Te&&!we,$e=we||Ne,Qe=w.useRef(null);w.useImperativeHandle(pe,function(){return{focus:Qe.current.focus,blur:Qe.current.blur}});var Je=function(Ge){return G&&Ge.label||Ge.title},ft=function(Ge){return te?Ge[te]:Je(Ge)},Tt=Se(G,ce,{getLabelProp:Je,simpleMode:ae}),Rt=Object(w.useMemo)(function(){return V(Tt)},[Tt]),ot=f(Rt),rt=Object(B.a)(ot,2),Ze=rt[0],ut=rt[1],ct=v(Ze,ut),st=Object(B.a)(ct,2),lt=st[0],gt=st[1],It=Object(w.useMemo)(function(){return Be?Object(g.a)(Tt):{keyEntities:null}},[Tt,Te,we]),Ft=It.keyEntities,Mt=Object(i.a)(ue.defaultValue,{value:ue.value}),Wt=Object(B.a)(Mt,2),jt=Wt[0],Vt=Wt[1],Kt=function(Ge){var nt=[],St=[];return Ge.forEach(function(xt){gt(xt)?St.push(xt):nt.push(xt)}),{missingRawValues:nt,existRawValues:St}},k=Object(w.useMemo)(function(){var Ve=[],Ge=[];if(N(jt).forEach(function(vt){if(vt&&Object(A.a)(vt)==="object"&&"value"in vt)if(vt.halfChecked&&we){var Ot=gt(vt.value);Ve.push(Ot?Ot.key:vt.value)}else Ge.push(vt.value);else Ge.push(vt)}),Be){var nt=Kt(Ge),St=nt.missingRawValues,xt=nt.existRawValues,bt=xt.map(function(vt){return gt(vt).key}),Ct=Object(s.a)(bt,!0,Ft),Ht=Ct.checkedKeys,Nt=Ct.halfCheckedKeys;return[[].concat(Object(L.a)(St),Object(L.a)(Ht.map(function(vt){return lt(vt).data.value}))),Nt]}return[Ge,Ve]},[jt,Et,$e,Te,we]),c=Object(B.a)(k,2),_=c[0],I=c[1],F=ge(_,{treeConduction:Be,value:jt,showCheckedStrategy:ve,conductKeyEntities:Ft,getEntityByValue:gt,getEntityByKey:lt,getLabelProp:ft}),D=function(Ge,nt,St){if(Vt(Et?Ge:Ge[0]),Ye){var xt=Ge;if(Be&&ve!=="SHOW_ALL"){var bt=Ge.map(function(At){var Pt=gt(At);return Pt?Pt.key:At}),Ct=me(bt,ve,Ft);xt=Ct.map(function(At){var Pt=lt(At);return Pt?Pt.data.value:At})}var Ht=nt||{triggerValue:void 0,selected:void 0},Nt=Ht.triggerValue,vt=Ht.selected,Ot=$e?le(xt,jt,gt,ft):xt;if(we){var Gt=I.map(function(At){var Pt=lt(At);return Pt?Pt.data.value:At}).filter(function(At){return!xt.includes(At)});Ot=[].concat(Object(L.a)(Ot),Object(L.a)(le(Gt,jt,gt,ft)))}var Lt={preValue:F,triggerValue:Nt},Yt=!0;(we||St==="selection"&&!vt)&&(Yt=!1),O(Lt,Nt,Ge,Tt,Yt),_t?Lt.checked=vt:Lt.selected=vt,Ye(Et?Ot:Ot[0],$e?null:xt.map(function(At){var Pt=gt(At);return Pt?ft(Pt.data):null}),Lt)}},ie=function(Ge,nt,St){var xt=Ge;if(!Et)D([Ge],{selected:!0,triggerValue:Ge},St);else{var bt=oe(_,Ge);if(Be){var Ct=Kt(bt),Ht=Ct.missingRawValues,Nt=Ct.existRawValues,vt=Nt.map(function(Lt){return gt(Lt).key}),Ot=Object(s.a)(vt,!0,Ft),Gt=Ot.checkedKeys;bt=[].concat(Object(L.a)(Ht),Object(L.a)(Gt.map(function(Lt){return lt(Lt).data.value})))}D(bt,{selected:!0,triggerValue:Ge},St)}dt&&dt(xt,nt)},Re=function(Ge,nt,St){var xt=Ge,bt=$(_,Ge);if(Be){var Ct=Kt(bt),Ht=Ct.missingRawValues,Nt=Ct.existRawValues,vt=Nt.map(function(Lt){return gt(Lt).key}),Ot=Object(s.a)(vt,{checked:!1,halfCheckedKeys:I},Ft),Gt=Ot.checkedKeys;bt=[].concat(Object(L.a)(Ht),Object(L.a)(Gt.map(function(Lt){return lt(Lt).data.value})))}D(bt,{selected:!1,triggerValue:Ge},St),tt&&tt(xt,nt)},je=function(){D([],null,"clear")},He=w.useCallback(function(Ve){if(yt){var Ge={};Object.defineProperty(Ge,"documentClickClose",{get:function(){return Object(o.a)(!1,"Second param of `onDropdownVisibleChange` has been removed."),!1}}),yt(Ve,Ge)}},[yt]),Ce={optionLabelProp:null,optionFilterProp:se,dropdownAlign:it,internalProps:{mark:a.a,onClear:je,skipTriggerChange:!0,skipTriggerSelect:!0,onRawSelect:ie,onRawDeselect:Re}};return"filterTreeNode"in ue&&(Ce.filterOption=qe),w.createElement(r.Provider,{value:{checkable:_t,loadData:Ue,treeLoadedKeys:he,onTreeLoad:at,checkedKeys:_,halfCheckedKeys:I,treeDefaultExpandAll:q,treeExpandedKeys:Y,treeDefaultExpandedKeys:Q,onTreeExpand:mt,treeIcon:_e,treeMotion:ze,showTreeIcon:ke,switcherIcon:Ke,treeLine:Xe,treeNodeFilterProp:se}},w.createElement(Ee,Object.assign({ref:Qe,mode:Et?"multiple":null},ue,Ce,{value:F,labelInValue:!0,options:Tt,onChange:null,onSelect:null,onDeselect:null,onDropdownVisibleChange:He})))}),Me=function(ue){Object(C.a)(ye,ue);var pe=Object(j.a)(ye);function ye(){var Te;return Object(de.a)(this,ye),Te=pe.apply(this,arguments),Te.selectRef=w.createRef(),Te.focus=function(){Te.selectRef.current.focus()},Te.blur=function(){Te.selectRef.current.blur()},Te}return Object(H.a)(ye,[{key:"render",value:function(){return w.createElement(Ie,Object.assign({ref:this.selectRef},this.props))}}]),ye}(w.Component);Me.TreeNode=d,Me.SHOW_ALL=Oe,Me.SHOW_PARENT=Ae,Me.SHOW_CHILD=Pe;var De=Me,Fe=We.e=De},"8hTe":function(et,We,J){et.exports={button:"button___1wy9m"}},"9Bee":function(et,We,J){"use strict";var de=J("DYRE"),H=J("zeV3"),C=J("+L6B"),j=J("2/Rp"),L=J("k1fw"),A=J("9og8"),B=J("tJVT"),M=J("WmNS"),w=J.n(M),S=J("q1tI"),m=J.n(S),g=J("vg9a"),s=J("DlQD"),a=J.n(s),i=J("rUJ1");function o(k,c){var _=k.match(/^(\s+)(?:```)/);if(_===null)return c;var I=_[1];return c.split(`
`).map(function(F){var D=F.match(/^\s+/);if(D===null)return F;var ie=Object(B.a)(D,1),Re=ie[0];return Re.length>=I.length?F.slice(I.length):F}).join(`
`)}var n=[],e=[""],t=new a.a.Renderer,r=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function T(){n.length=0,e=[""]}var v={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function f(k,c,_,I){if(c>=k.length||k[c].level<=_)return c;var F=k[c];I.push("- "+F.text+""),c++;var D=[];return c=f(k,c,F.level,D),D.length>0&&(I.push("
"),D.forEach(function(ie){I.push(ie)}),I.push("
")),I.push(" "),c=f(k,c,_,I),c}function E(){return f(n,0,0,e),e.push("
"),e.join("")}var y={heading:function(c){var _=r.exec(c);if(_)return{type:"heading",raw:_[0],depth:_[1].length,text:_[2]}},fences:function(c){var _=this.rules.block.fences.exec(c);if(_){var I=_[0],F=o(I,_[3]||""),D=_[2]?_[2].trim():_[2];if(["latex","katex","math"].indexOf(D)>=0){var ie=h(),Re=F;F=ie,d[ie]={type:"block",expression:Re}}return{type:"code",raw:I,lang:D,text:F}}}},u=/(?:\${2})([^\n`]+?)(?:\${2})/gi,l=0,h=function(){return"__special_katext_id_".concat(l++,"__")},d={};function b(){return d}function p(){l=0,d={}}function x(k){return k=k.replace(u,function(c,_){var I=h();return d[I]={type:"inline",expression:_},I}),k}var R=t.listitem;t.listitem=function(k){return R(x(k))};var O=t.paragraph;t.paragraph=function(k){return O(x(k))};var N=t.tablecell;t.tablecell=function(k,c){return N(x(k),c)},t.code=function(k,c,_){var I=(c||"").match(/\S*/)[0];return I?["latex","katex","math"].indexOf(I)>=0?"".concat(k,"
"):'
').concat(_?k:Object(i.escape)(k,!0),`
`):''+(_?k:Object(i.escape)(k,!0))+"
"},t.heading=function(k,c,_){var I=this.options.headerPrefix+_.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return n.push({anchor:I,level:c,text:k}),"'+k+""},a.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),a.a.use({tokenizer:y,renderer:t});var U=a.a,W=J("SJMd"),P=J("ulZh"),K=J.n(P),V=J("m3rI"),re=J("Oy/b"),ee=J("p5ED"),le=J("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 oe=function(k,c){return(oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,I){_.__proto__=I}||function(_,I){for(var F in I)Object.prototype.hasOwnProperty.call(I,F)&&(_[F]=I[F])})(k,c)};function $(k,c){function _(){this.constructor=k}oe(k,c),k.prototype=c===null?Object.create(c):(_.prototype=c.prototype,new _)}function Z(k,c,_,I){return new(_||(_=Promise))(function(F,D){function ie(He){try{je(I.next(He))}catch(Ce){D(Ce)}}function Re(He){try{je(I.throw(He))}catch(Ce){D(Ce)}}function je(He){var Ce;He.done?F(He.value):(Ce=He.value,Ce instanceof _?Ce:new _(function(Ve){Ve(Ce)})).then(ie,Re)}je((I=I.apply(k,c||[])).next())})}function ne(k,c){var _,I,F,D,ie={label:0,sent:function(){if(1&F[0])throw F[1];return F[1]},trys:[],ops:[]};return D={next:Re(0),throw:Re(1),return:Re(2)},typeof Symbol=="function"&&(D[Symbol.iterator]=function(){return this}),D;function Re(je){return function(He){return function(Ce){if(_)throw new TypeError("Generator is already executing.");for(;ie;)try{if(_=1,I&&(F=2&Ce[0]?I.return:Ce[0]?I.throw||((F=I.return)&&F.call(I),0):I.next)&&!(F=F.call(I,Ce[1])).done)return F;switch(I=0,F&&(Ce=[2&Ce[0],F.value]),Ce[0]){case 0:case 1:F=Ce;break;case 4:return ie.label++,{value:Ce[1],done:!1};case 5:ie.label++,I=Ce[1],Ce=[0];continue;case 7:Ce=ie.ops.pop(),ie.trys.pop();continue;default:if(!(F=ie.trys,(F=F.length>0&&F[F.length-1])||Ce[0]!==6&&Ce[0]!==2)){ie=0;continue}if(Ce[0]===3&&(!F||Ce[1]>F[0]&&Ce[1]',"select"),this.addActionButton(I,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(I,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(I,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(I,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(I,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(I,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(I,'',"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(D){var ie=document.createElement("div");ie.className=""+_.toolbarButtonStyleClass.name,ie.setAttribute("data-type-name",D.typeName),ie.innerHTML=D.icon,ie.addEventListener("click",function(){_.markerToolbarButtonClicked(ie,D)}),_.buttons.push(ie),_.markerButtons.push(ie)}),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 F=document.createElement("div");F.className=this.toolbarBlockStyleClass.name,F.style.whiteSpace="nowrap",F.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(F),this.addActionButton(F,'',"render"),this.addActionButton(F,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},k.prototype.addButtonClickListener=function(c){this.buttonClickListeners.push(c)},k.prototype.removeButtonClickListener=function(c){this.buttonClickListeners.indexOf(c)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(c),1)},k.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},k.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var c=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var _=0;_0&&this.buttonClickListeners.forEach(function(I){return I("marker",_)}),this.markerButtonOverflowBlock.style.display="none"},k.prototype.actionToolbarButtonClicked=function(c,_){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(I){return I("action",_)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},k.prototype.setActiveButton=function(c){this.resetButtonStyles(),c.className=c.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),c.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},k.prototype.setActiveMarkerButton=function(c){var _=this.markerButtons.find(function(I){return I.getAttribute("data-type-name")===c});_&&this.setActiveButton(_)},k.prototype.setCurrentMarker=function(c){var _=this;this.currentMarker=c,this.buttons.filter(function(I){return/delete|notes/.test(I.getAttribute("data-action"))}).forEach(function(I){_.currentMarker===void 0?(I.style.fillOpacity="0.4",I.style.pointerEvents="none"):(I.style.fillOpacity="1",I.style.pointerEvents="all")})},k}(),be=function(){function k(c,_,I,F){this.panels=[],this.panelButtons=[],this.markerjsContainer=c,this.displayMode=_,this.uiStyleSettings=I,this.styles=F,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return k.prototype.addStyles=function(){var c;this.toolboxStyleClass=this.styles.addClass(new me("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 me("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var _=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new me("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new me("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new me("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 me("toolbox-panel-row_colors",`
background-color: `+((c=this.uiStyleSettings.toolboxBackgroundColor)!==null&&c!==void 0?c:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new me("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*_)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*_)+`px;
padding: `+_+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new me("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new me("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Pe("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Pe("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},k.prototype.show=function(c){var _;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=c,this.uiContainer.className=this.toolboxStyleClass.name+" "+((_=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&_!==void 0?_:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},k.prototype.setPanelButtons=function(c){var _,I,F=this;this.panels=c,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((_=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&_!==void 0?_:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((I=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&I!==void 0?I:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(D){var ie;D.uiStyleSettings=F.uiStyleSettings;var Re=document.createElement("div");Re.className=F.toolboxButtonStyleClass.name+" "+((ie=F.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ie!==void 0?ie:F.toolboxButtonStyleColorsClass.name),Re.innerHTML=D.icon,Re.title=D.title,Re.addEventListener("click",function(){F.panelButtonClick(D)}),F.panelButtons.push(Re),F.buttonRow.appendChild(Re)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},k.prototype.panelButtonClick=function(c){var _=this,I=-1;if(c!==this.activePanel){I=this.panels.indexOf(c),this.panelRow.innerHTML="";var F=c.getUi();F.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(F),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=c}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){_.displayMode==="inline"?_.panelRow.style.display="none":_.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(D,ie){var Re,je;D.className=_.toolboxButtonStyleClass.name+" "+(ie===I?""+((Re=_.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Re!==void 0?Re:_.toolboxActiveButtonStyleColorsClass.name):""+((je=_.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&je!==void 0?je:_.toolboxButtonStyleColorsClass.name))})},k}(),Ee=function(k,c){this.title=k,this.icon=c},Ie=function(k){function c(_,I,F,D){var ie=k.call(this,_,D||'')||this;return ie.colors=[],ie.addTransparent=!1,ie.colorBoxes=[],ie.colors=I,ie.currentColor=F,ie.setCurrentColor=ie.setCurrentColor.bind(ie),ie.getColorBox=ie.getColorBox.bind(ie),ie}return $(c,k),c.prototype.getUi=function(){var _=this,I=document.createElement("div");return I.style.overflow="hidden",I.style.whiteSpace="nowrap",this.colors.forEach(function(F){var D=_.getColorBox(F);I.appendChild(D),_.colorBoxes.push(D)}),I},c.prototype.getColorBox=function(_){var I=this,F=this.uiStyleSettings.toolbarHeight/4,D=this.uiStyleSettings.toolbarHeight-F,ie=document.createElement("div");ie.style.display="inline-block",ie.style.boxSizing="content-box",ie.style.width=D-2+"px",ie.style.height=D-2+"px",ie.style.padding="1px",ie.style.marginRight="2px",ie.style.marginBottom="2px",ie.style.borderWidth="2px",ie.style.borderStyle="solid",ie.style.borderRadius=(D+2)/2+"px",ie.style.borderColor=_===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ie.addEventListener("click",function(){I.setCurrentColor(_,ie)});var Re=document.createElement("div");return Re.style.display="inline-block",Re.style.width=D-2+"px",Re.style.height=D-2+"px",Re.style.backgroundColor=_,Re.style.borderRadius=D/2+"px",_==="transparent"&&(Re.style.fill=this.uiStyleSettings.toolboxAccentColor,Re.innerHTML=``),ie.appendChild(Re),ie},c.prototype.setCurrentColor=function(_,I){var F=this;this.currentColor=_,this.colorBoxes.forEach(function(D){D.style.borderColor=D===I?F.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(_)},c}(Ee),Me=function(){function k(c,_,I){this._state="new",this._isSelected=!1,this._container=c,this._overlayContainer=_,this.globalSettings=I,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(k.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),k.prototype.ownsTarget=function(c){return!1},Object.defineProperty(k.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),k.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},k.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},k.prototype.pointerDown=function(c,_){},k.prototype.dblClick=function(c,_){},k.prototype.manipulate=function(c){},k.prototype.pointerUp=function(c){this.stateChanged()},k.prototype.dispose=function(){},k.prototype.addMarkerVisualToContainer=function(c){this.container.childNodes.length>0?this.container.insertBefore(c,this.container.childNodes[0]):this.container.appendChild(c)},k.prototype.getState=function(){return{typeName:k.typeName,state:this.state,notes:this.notes}},k.prototype.restoreState=function(c){this._state=c.state,this.notes=c.notes},k.prototype.scale=function(c,_){},k.prototype.colorChanged=function(c){this.onColorChanged&&this.onColorChanged(c),this.stateChanged()},k.prototype.fillColorChanged=function(c){this.onFillColorChanged&&this.onFillColorChanged(c),this.stateChanged()},k.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var c=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),c.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(c)&&this.onStateChanged(this)}},k.typeName="MarkerBase",k}(),De=function(){function k(){this.findGripByVisual=this.findGripByVisual.bind(this)}return k.prototype.findGripByVisual=function(c){return this.topLeft.ownsTarget(c)?this.topLeft:this.topCenter.ownsTarget(c)?this.topCenter:this.topRight.ownsTarget(c)?this.topRight:this.centerLeft.ownsTarget(c)?this.centerLeft:this.centerRight.ownsTarget(c)?this.centerRight:this.bottomLeft.ownsTarget(c)?this.bottomLeft:this.bottomCenter.ownsTarget(c)?this.bottomCenter:this.bottomRight.ownsTarget(c)?this.bottomRight:void 0},k}(),Fe=function(){function k(){this.GRIP_SIZE=10,this.visual=z.createGroup(),this.visual.appendChild(z.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(z.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return k.prototype.ownsTarget=function(c){return c===this.visual||c===this.visual.childNodes[0]||c===this.visual.childNodes[1]},k}(),ue=function(){function k(){}return k.toITransformMatrix=function(c){return{a:c.a,b:c.b,c:c.c,d:c.d,e:c.e,f:c.f}},k.toSVGMatrix=function(c,_){return c.a=_.a,c.b=_.b,c.c=_.c,c.d=_.d,c.e=_.e,c.f=_.f,c},k}(),pe=function(k){function c(_,I,F){var D=k.call(this,_,I,F)||this;return D.left=0,D.top=0,D.width=0,D.height=0,D.defaultSize={x:50,y:20},D.offsetX=0,D.offsetY=0,D.rotationAngle=0,D.CB_DISTANCE=10,D._suppressMarkerCreateEvent=!1,D.container.transform.baseVal.appendItem(z.createTransform()),D.setupControlBox(),D}return $(c,k),Object.defineProperty(c.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"visual",{get:function(){return this._visual},set:function(_){this._visual=_;var I=z.createTransform();this._visual.transform.baseVal.appendItem(I)},enumerable:!1,configurable:!0}),c.prototype.ownsTarget=function(_){return!!k.prototype.ownsTarget.call(this,_)||!!(this.controlGrips.findGripByVisual(_)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(_))},c.prototype.pointerDown=function(_,I){k.prototype.pointerDown.call(this,_,I),this.state==="new"&&(this.left=_.x,this.top=_.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var F=this.unrotatePoint(_);if(this.manipulationStartX=F.x,this.manipulationStartY=F.y,this.offsetX=F.x-this.left,this.offsetY=F.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(I),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(I)){this.activeGrip=this.rotatorGrip;var D=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=D.x-this.width/2,this.top=D.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ie=this.container.transform.baseVal.getItem(0);ie.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ie,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},c.prototype.pointerUp=function(_){var I=this.state;k.prototype.pointerUp.call(this,_),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(_),this._state="select",I==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},c.prototype.moveVisual=function(_){this.visual.style.transform="translate("+_.x+"px, "+_.y+"px)"},c.prototype.manipulate=function(_){var I=this.unrotatePoint(_);this.state==="creating"?this.resize(_):this.state==="move"?(this.left=this.manipulationStartLeft+(I.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(I.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(I):this.state==="rotate"&&this.rotate(_)},c.prototype.resize=function(_){var I=this.manipulationStartLeft,F=this.manipulationStartWidth,D=this.manipulationStartTop,ie=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:I=this.manipulationStartLeft+_.x-this.manipulationStartX,F=this.manipulationStartWidth+this.manipulationStartLeft-I;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:F=this.manipulationStartWidth+_.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:D=this.manipulationStartTop+_.y-this.manipulationStartY,ie=this.manipulationStartHeight+this.manipulationStartTop-D;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ie=this.manipulationStartHeight+_.y-this.manipulationStartY}F>=0?(this.left=I,this.width=F):(this.left=I+F,this.width=-F),ie>=0?(this.top=D,this.height=ie):(this.top=D+ie,this.height=-ie),this.setSize()},c.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},c.prototype.rotate=function(_){if(Math.abs(_.x-this.centerX)>.1){var I=Math.sign(_.x-this.centerX);this.rotationAngle=180*Math.atan((_.y-this.centerY)/(_.x-this.centerX))/Math.PI+90*I,this.applyRotation()}},c.prototype.applyRotation=function(){var _=this.container.transform.baseVal.getItem(0);_.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(_,0)},c.prototype.rotatePoint=function(_){if(this.rotationAngle===0)return _;var I=this.container.getCTM(),F=z.createPoint(_.x,_.y);return{x:(F=F.matrixTransform(I)).x,y:F.y}},c.prototype.unrotatePoint=function(_){if(this.rotationAngle===0)return _;var I=this.container.getCTM();I=I.inverse();var F=z.createPoint(_.x,_.y);return{x:(F=F.matrixTransform(I)).x,y:F.y}},c.prototype.select=function(){k.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},c.prototype.deselect=function(){k.prototype.deselect.call(this),this.controlBox.style.display="none"},c.prototype.setupControlBox=function(){this.controlBox=z.createGroup();var _=z.createTransform();_.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(_),this.container.appendChild(this.controlBox),this.controlRect=z.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=z.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new De,this.addControlGrips(),this.controlBox.style.display="none"},c.prototype.adjustControlBox=function(){var _=this.controlBox.transform.baseVal.getItem(0);_.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(_,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},c.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},c.prototype.createGrip=function(){var _=new Fe;return _.visual.transform.baseVal.appendItem(z.createTransform()),this.controlBox.appendChild(_.visual),_},c.prototype.positionGrips=function(){var _=this.controlGrips.topLeft.GRIP_SIZE,I=-_/2,F=I,D=(this.width+this.CB_DISTANCE)/2-_/2,ie=(this.height+this.CB_DISTANCE)/2-_/2,Re=this.height+this.CB_DISTANCE-_/2,je=this.width+this.CB_DISTANCE-_/2;this.positionGrip(this.controlGrips.topLeft.visual,I,F),this.positionGrip(this.controlGrips.topCenter.visual,D,F),this.positionGrip(this.controlGrips.topRight.visual,je,F),this.positionGrip(this.controlGrips.centerLeft.visual,I,ie),this.positionGrip(this.controlGrips.centerRight.visual,je,ie),this.positionGrip(this.controlGrips.bottomLeft.visual,I,Re),this.positionGrip(this.controlGrips.bottomCenter.visual,D,Re),this.positionGrip(this.controlGrips.bottomRight.visual,je,Re),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,D,F-3*this.CB_DISTANCE)},c.prototype.positionGrip=function(_,I,F){var D=_.transform.baseVal.getItem(0);D.setTranslate(I,F),_.transform.baseVal.replaceItem(D,0)},c.prototype.hideControlBox=function(){this.controlBox.style.display="none"},c.prototype.showControlBox=function(){this.controlBox.style.display=""},c.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:ue.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:ue.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},k.prototype.getState.call(this))},c.prototype.restoreState=function(_){k.prototype.restoreState.call(this,_);var I=_;this.left=I.left,this.top=I.top,this.width=I.width,this.height=I.height,this.rotationAngle=I.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(ue.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,I.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(ue.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,I.containerTransformMatrix))},c.prototype.scale=function(_,I){k.prototype.scale.call(this,_,I);var F=this.rotatePoint({x:this.left,y:this.top}),D=this.unrotatePoint({x:F.x*_,y:F.y*I});this.left=D.x,this.top=D.y,this.width=this.width*_,this.height=this.height*I,this.adjustControlBox()},c}(Me),ye=function(k){function c(_,I,F){var D=k.call(this,_,I,F)||this;return D.fillColor="transparent",D.strokeColor="transparent",D.strokeWidth=0,D.strokeDasharray="",D.opacity=1,D.setStrokeColor=D.setStrokeColor.bind(D),D.setFillColor=D.setFillColor.bind(D),D.setStrokeWidth=D.setStrokeWidth.bind(D),D.setStrokeDasharray=D.setStrokeDasharray.bind(D),D.createVisual=D.createVisual.bind(D),D}return $(c,k),c.prototype.ownsTarget=function(_){return!(!k.prototype.ownsTarget.call(this,_)&&_!==this.visual)},c.prototype.createVisual=function(){this.visual=z.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},c.prototype.pointerDown=function(_,I){k.prototype.pointerDown.call(this,_,I),this.state==="new"&&(this.createVisual(),this.moveVisual(_),this._state="creating")},c.prototype.manipulate=function(_){k.prototype.manipulate.call(this,_)},c.prototype.resize=function(_){k.prototype.resize.call(this,_),this.setSize()},c.prototype.setSize=function(){k.prototype.setSize.call(this),z.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},c.prototype.pointerUp=function(_){k.prototype.pointerUp.call(this,_),this.setSize()},c.prototype.setStrokeColor=function(_){this.strokeColor=_,this.visual&&z.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(_),this.stateChanged()},c.prototype.setFillColor=function(_){this.fillColor=_,this.visual&&z.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},c.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.visual&&z.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},c.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.visual&&z.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},c.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},k.prototype.getState.call(this))},c.prototype.restoreState=function(_){var I=_;this.fillColor=I.fillColor,this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.opacity=I.opacity,this.createVisual(),k.prototype.restoreState.call(this,_),this.setSize()},c.prototype.scale=function(_,I){k.prototype.scale.call(this,_,I),this.setSize()},c.title="Rectangle marker",c}(pe),Te=function(k){function c(_,I,F,D){var ie=k.call(this,_,D||'')||this;return ie.widths=[],ie.widthBoxes=[],ie.widths=I,ie.currentWidth=F,ie.setCurrentWidth=ie.setCurrentWidth.bind(ie),ie}return $(c,k),c.prototype.getUi=function(){var _=this,I=document.createElement("div");return I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2",this.widths.forEach(function(F){var D=document.createElement("div");D.style.display="flex",D.style.flexGrow="2",D.style.alignItems="center",D.style.justifyContent="space-between",D.style.padding="5px",D.style.borderWidth="2px",D.style.borderStyle="solid",D.style.borderColor=F===_.currentWidth?_.uiStyleSettings.toolboxAccentColor:"transparent",D.addEventListener("click",function(){_.setCurrentWidth(F,D)}),I.appendChild(D);var ie=document.createElement("div");ie.innerText=F.toString(),ie.style.marginRight="5px",D.appendChild(ie);var Re=document.createElement("div");Re.style.minHeight="20px",Re.style.flexGrow="2",Re.style.display="flex",Re.style.alignItems="center";var je=document.createElement("hr");je.style.minWidth="20px",je.style.border="0px",je.style.borderTop=F+"px solid "+_.uiStyleSettings.toolboxColor,je.style.flexGrow="2",Re.appendChild(je),D.appendChild(Re),_.widthBoxes.push(D)}),I},c.prototype.setCurrentWidth=function(_,I){var F=this;this.currentWidth=_,this.widthBoxes.forEach(function(D){D.style.borderColor=D===I?F.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},c}(Ee),we=function(k){function c(_,I,F,D){var ie=k.call(this,_,D||'')||this;return ie.styles=[],ie.styleBoxes=[],ie.styles=I,ie.currentStyle=F,ie.setCurrentStyle=ie.setCurrentStyle.bind(ie),ie}return $(c,k),c.prototype.getUi=function(){var _=this,I=document.createElement("div");return I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2",this.styles.forEach(function(F){var D=document.createElement("div");D.style.display="flex",D.style.alignItems="center",D.style.justifyContent="space-between",D.style.padding="5px",D.style.borderWidth="2px",D.style.borderStyle="solid",D.style.overflow="hidden",D.style.maxWidth=100/_.styles.length-5+"%",D.style.borderColor=F===_.currentStyle?_.uiStyleSettings.toolboxAccentColor:"transparent",D.addEventListener("click",function(){_.setCurrentStyle(F,D)}),I.appendChild(D);var ie=document.createElement("div");ie.style.minHeight="20px",ie.style.flexGrow="2",ie.style.overflow="hidden";var Re=``;ie.innerHTML=Re,D.appendChild(ie),_.styleBoxes.push(D)}),I},c.prototype.setCurrentStyle=function(_,I){var F=this;this.currentStyle=_,this.styleBoxes.forEach(function(D){D.style.borderColor=D===I?F.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},c}(Ee),xe=function(k){function c(_,I,F){var D=k.call(this,_,I,F)||this;return D.strokeColor=F.defaultColor,D.strokeWidth=F.defaultStrokeWidth,D.strokeDasharray=F.defaultStrokeDasharray,D.strokePanel=new Ie("Line color",F.defaultColorSet,F.defaultColor),D.strokePanel.onColorChanged=D.setStrokeColor,D.strokeWidthPanel=new Te("Line width",F.defaultStrokeWidths,F.defaultStrokeWidth),D.strokeWidthPanel.onWidthChanged=D.setStrokeWidth,D.strokeStylePanel=new we("Line style",F.defaultStrokeDasharrays,F.defaultStrokeDasharray),D.strokeStylePanel.onStyleChanged=D.setStrokeDasharray,D}return $(c,k),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var _=k.prototype.getState.call(this);return _.typeName=c.typeName,_},c.typeName="FrameMarker",c.title="Frame marker",c.icon='',c}(ye),ve=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},Ne=function(k){function c(_,I,F){var D=k.call(this,_,I,F)||this;return D.x1=0,D.y1=0,D.x2=0,D.y2=0,D.defaultLength=50,D.manipulationStartX=0,D.manipulationStartY=0,D.manipulationStartX1=0,D.manipulationStartY1=0,D.manipulationStartX2=0,D.manipulationStartY2=0,D.setupControlBox(),D}return $(c,k),c.prototype.ownsTarget=function(_){return!!k.prototype.ownsTarget.call(this,_)||!(!this.grip1.ownsTarget(_)&&!this.grip2.ownsTarget(_))},c.prototype.pointerDown=function(_,I){k.prototype.pointerDown.call(this,_,I),this.manipulationStartX=_.x,this.manipulationStartY=_.y,this.state==="new"&&(this.x1=_.x,this.y1=_.y,this.x2=_.x,this.y2=_.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(I)?this.activeGrip=this.grip1:this.grip2.ownsTarget(I)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},c.prototype.pointerUp=function(_){var I=this.state;k.prototype.pointerUp.call(this,_),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(_),this._state="select",I==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},c.prototype.adjustVisual=function(){},c.prototype.manipulate=function(_){this.state==="creating"?this.resize(_):this.state==="move"?(this.x1=this.manipulationStartX1+_.x-this.manipulationStartX,this.y1=this.manipulationStartY1+_.y-this.manipulationStartY,this.x2=this.manipulationStartX2+_.x-this.manipulationStartX,this.y2=this.manipulationStartY2+_.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(_)},c.prototype.resize=function(_){switch(this.activeGrip){case this.grip1:this.x1=_.x,this.y1=_.y;break;case this.grip2:case void 0:this.x2=_.x,this.y2=_.y}this.adjustVisual(),this.adjustControlBox()},c.prototype.select=function(){k.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},c.prototype.deselect=function(){k.prototype.deselect.call(this),this.controlBox.style.display="none"},c.prototype.setupControlBox=function(){this.controlBox=z.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},c.prototype.adjustControlBox=function(){this.positionGrips()},c.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},c.prototype.createGrip=function(){var _=new Fe;return _.visual.transform.baseVal.appendItem(z.createTransform()),this.controlBox.appendChild(_.visual),_},c.prototype.positionGrips=function(){var _=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-_/2,this.y1-_/2),this.positionGrip(this.grip2.visual,this.x2-_/2,this.y2-_/2)},c.prototype.positionGrip=function(_,I,F){var D=_.transform.baseVal.getItem(0);D.setTranslate(I,F),_.transform.baseVal.replaceItem(D,0)},c.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},k.prototype.getState.call(this))},c.prototype.restoreState=function(_){k.prototype.restoreState.call(this,_);var I=_;this.x1=I.x1,this.y1=I.y1,this.x2=I.x2,this.y2=I.y2},c.prototype.scale=function(_,I){k.prototype.scale.call(this,_,I),this.x1=this.x1*_,this.y1=this.y1*I,this.x2=this.x2*_,this.y2=this.y2*I,this.adjustVisual(),this.adjustControlBox()},c}(Me),Ue=function(k){function c(_,I,F){var D=k.call(this,_,I,F)||this;return D.strokeColor="transparent",D.strokeWidth=0,D.strokeDasharray="",D.setStrokeColor=D.setStrokeColor.bind(D),D.setStrokeWidth=D.setStrokeWidth.bind(D),D.setStrokeDasharray=D.setStrokeDasharray.bind(D),D.strokeColor=F.defaultColor,D.strokeWidth=F.defaultStrokeWidth,D.strokeDasharray=F.defaultStrokeDasharray,D.strokePanel=new Ie("Line color",F.defaultColorSet,F.defaultColor),D.strokePanel.onColorChanged=D.setStrokeColor,D.strokeWidthPanel=new Te("Line width",F.defaultStrokeWidths,F.defaultStrokeWidth),D.strokeWidthPanel.onWidthChanged=D.setStrokeWidth,D.strokeStylePanel=new we("Line style",F.defaultStrokeDasharrays,F.defaultStrokeDasharray),D.strokeStylePanel.onStyleChanged=D.setStrokeDasharray,D}return $(c,k),c.prototype.ownsTarget=function(_){return!(!k.prototype.ownsTarget.call(this,_)&&_!==this.visual&&_!==this.selectorLine&&_!==this.visibleLine)},c.prototype.createVisual=function(){this.visual=z.createGroup(),this.selectorLine=z.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=z.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},c.prototype.pointerDown=function(_,I){k.prototype.pointerDown.call(this,_,I),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},c.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),z.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),z.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),z.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},c.prototype.setStrokeColor=function(_){this.strokeColor=_,this.adjustVisual(),this.colorChanged(_)},c.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.adjustVisual()},c.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.adjustVisual(),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var _=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},k.prototype.getState.call(this));return _.typeName=c.typeName,_},c.prototype.restoreState=function(_){k.prototype.restoreState.call(this,_);var I=_;this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.createVisual(),this.adjustVisual()},c.typeName="LineMarker",c.title="Line marker",c.icon='',c}(Ne),he=function(k){function c(_,I,F,D){var ie=k.call(this,_,D||'')||this;return ie.fonts=[],ie.fontBoxes=[],ie.fonts=I,ie.currentFont=F,ie.setCurrentFont=ie.setCurrentFont.bind(ie),ie}return $(c,k),c.prototype.getUi=function(){var _=this,I=document.createElement("div");return I.style.overflow="hidden",I.style.flexGrow="2",this.fonts.forEach(function(F){var D=document.createElement("div");D.style.display="inline-block",D.style.alignItems="center",D.style.justifyContent="space-between",D.style.padding="5px",D.style.borderWidth="2px",D.style.borderStyle="solid",D.style.overflow="hidden",D.style.maxWidth=100/_.fonts.length-5+"%",D.style.borderColor=F===_.currentFont?_.uiStyleSettings.toolboxAccentColor:"transparent",D.addEventListener("click",function(){_.setCurrentFont(F,D)}),I.appendChild(D);var ie=document.createElement("div");ie.style.display="flex",ie.style.minHeight="20px",ie.style.flexGrow="2",ie.style.fontFamily=F,ie.style.overflow="hidden";var Re=document.createElement("div");Re.style.whiteSpace="nowrap",Re.style.overflow="hidden",Re.style.textOverflow="ellipsis",Re.innerHTML="The quick brown fox jumps over the lazy dog",ie.appendChild(Re),D.appendChild(ie),_.fontBoxes.push(D)}),I},c.prototype.setCurrentFont=function(_,I){var F=this;this.currentFont=_,this.fontBoxes.forEach(function(D){D.style.borderColor=D===I?F.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},c}(Ee),Le=function(k){function c(_,I,F){var D=k.call(this,_,I,F)||this;return D.color="transparent",D.padding=5,D.DEFAULT_TEXT="your text here",D.text=D.DEFAULT_TEXT,D.isMoved=!1,D.color=F.defaultColor,D.fontFamily=F.defaultFontFamily,D.defaultSize={x:100,y:30},D.setColor=D.setColor.bind(D),D.setFont=D.setFont.bind(D),D.renderText=D.renderText.bind(D),D.sizeText=D.sizeText.bind(D),D.textEditDivClicked=D.textEditDivClicked.bind(D),D.showTextEditor=D.showTextEditor.bind(D),D.setSize=D.setSize.bind(D),D.positionTextEditor=D.positionTextEditor.bind(D),D.colorPanel=new Ie("Color",F.defaultColorSet,F.defaultColor),D.colorPanel.onColorChanged=D.setColor,D.fontFamilyPanel=new he("Font",F.defaultFontFamilies,F.defaultFontFamily),D.fontFamilyPanel.onFontChanged=D.setFont,D}return $(c,k),c.prototype.ownsTarget=function(_){if(k.prototype.ownsTarget.call(this,_)||_===this.visual||_===this.textElement||_===this.bgRectangle)return!0;var I=!1;return this.textElement.childNodes.forEach(function(F){F===_&&(I=!0)}),I},c.prototype.createVisual=function(){this.visual=z.createGroup(),this.bgRectangle=z.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=z.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(z.createTransform()),this.textElement.transform.baseVal.appendItem(z.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},c.prototype.pointerDown=function(_,I){k.prototype.pointerDown.call(this,_,I),this.isMoved=!1,this.pointerDownPoint=_,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(_),this._state="creating")},c.prototype.renderText=function(){var _=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(I){_.textElement.appendChild(z.createTSpan(I.trim()===""?" ":I.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},c.prototype.getTextScale=function(){var _=this.textElement.getBBox(),I=1;if(_.width>0&&_.height>0){var F=(1*this.width-this.width*this.padding*2/100)/_.width,D=(1*this.height-this.height*this.padding*2/100)/_.height;I=Math.min(F,D)}return I},c.prototype.getTextPosition=function(_){var I=this.textElement.getBBox(),F=0,D=0;return I.width>0&&I.height>0&&(F=(this.width-I.width*_)/2,D=this.height/2-I.height*_/2),{x:F,y:D}},c.prototype.sizeText=function(){var _=this.textElement.getBBox(),I=this.getTextScale(),F=this.getTextPosition(I);F.y-=_.y*I,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+F.x+"px, "+F.y+"px) scale("+I+", "+I+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(F.x,F.y),this.textElement.transform.baseVal.getItem(1).setScale(I,I))},c.prototype.manipulate=function(_){k.prototype.manipulate.call(this,_),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(_.x-this.pointerDownPoint.x)>5||Math.abs(_.y-this.pointerDownPoint.y)>5)},c.prototype.resize=function(_){k.prototype.resize.call(this,_),this.isMoved=!0,this.setSize(),this.sizeText()},c.prototype.setSize=function(){k.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(z.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),z.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},c.prototype.pointerUp=function(_){var I=this.state;I==="creating"&&(this._suppressMarkerCreateEvent=!0),k.prototype.pointerUp.call(this,_),this.setSize(),(I==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},c.prototype.showTextEditor=function(){var _=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(I){I.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var I=Number.parseFloat(_.textEditor.style.fontSize);_.textEditor.clientWidth>=Number.parseInt(_.textEditor.style.maxWidth)&&I>.9;)I-=.1,_.textEditor.style.fontSize=Math.max(I,.9)+"em"}),this.textEditor.addEventListener("keyup",function(I){I.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(I){if(I.clipboardData){var F=I.clipboardData.getData("text"),D=window.getSelection();if(!D.rangeCount)return!1;D.deleteFromDocument(),D.getRangeAt(0).insertNode(document.createTextNode(F)),I.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){_.textEditDivClicked(_.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},c.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var _=this.getTextScale(),I=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),F=this.textElement.getBBox(),D={x:F.width*_,y:F.height*_};I.x-=D.x/2,I.y-=D.y/2,this.textEditor.style.top=I.y+"px",this.textEditor.style.left=I.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-I.x+"px",this.textEditor.style.fontSize=Math.max(16*_,12)+"px",this.textElement.style.display="none"}},c.prototype.textEditDivClicked=function(_){this.text=_.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},c.prototype.select=function(){k.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},c.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),k.prototype.deselect.call(this)},c.prototype.dblClick=function(_,I){k.prototype.dblClick.call(this,_,I),this.showTextEditor()},c.prototype.setColor=function(_){this.textElement&&z.setAttributes(this.textElement,[["fill",_]]),this.color=_,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(_)},c.prototype.setFont=function(_){this.textElement&&z.setAttributes(this.textElement,[["font-family",_]]),this.fontFamily=_,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},c.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},c.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var _=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},k.prototype.getState.call(this));return _.typeName=c.typeName,_},c.prototype.restoreState=function(_){var I=_;this.color=I.color,this.fontFamily=I.fontFamily,this.padding=I.padding,this.text=I.text,this.createVisual(),k.prototype.restoreState.call(this,_),this.setSize()},c.prototype.scale=function(_,I){k.prototype.scale.call(this,_,I),this.setSize(),this.sizeText(),this.positionTextEditor()},c.typeName="TextMarker",c.title="Text marker",c.icon='',c}(pe),se=function(k){function c(_,I,F){var D=k.call(this,_,I,F)||this;return D.color="transparent",D.lineWidth=3,D.drawing=!1,D.pixelRatio=1,D.color=F.defaultColor,D.lineWidth=F.defaultStrokeWidth,D.pixelRatio=F.freehandPixelRatio,D.setColor=D.setColor.bind(D),D.addCanvas=D.addCanvas.bind(D),D.finishCreation=D.finishCreation.bind(D),D.setLineWidth=D.setLineWidth.bind(D),D.colorPanel=new Ie("Color",F.defaultColorSet,F.defaultColor),D.colorPanel.onColorChanged=D.setColor,D.lineWidthPanel=new Te("Line width",F.defaultStrokeWidths,F.defaultStrokeWidth),D.lineWidthPanel.onWidthChanged=D.setLineWidth,D}return $(c,k),c.prototype.ownsTarget=function(_){return!(!k.prototype.ownsTarget.call(this,_)&&_!==this.visual&&_!==this.drawingImage)},c.prototype.createVisual=function(){this.visual=z.createGroup(),this.drawingImage=z.createImage(),this.visual.appendChild(this.drawingImage);var _=z.createTransform();this.visual.transform.baseVal.appendItem(_),this.addMarkerVisualToContainer(this.visual)},c.prototype.pointerDown=function(_,I){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(_.x,_.y),this.drawing=!0):k.prototype.pointerDown.call(this,_,I)},c.prototype.manipulate=function(_){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(_.x,_.y),this.canvasContext.stroke()):k.prototype.manipulate.call(this,_)},c.prototype.resize=function(_){k.prototype.resize.call(this,_),z.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),z.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},c.prototype.pointerUp=function(_){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):k.prototype.pointerUp.call(this,_)},c.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},c.prototype.select=function(){this.state==="creating"&&this.finishCreation(),k.prototype.select.call(this)},c.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),k.prototype.deselect.call(this)},c.prototype.finishCreation=function(){for(var _=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),I=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],F=I[0],D=I[1],ie=I[2],Re=I[3],je=!1,He=0;He0&&(je=!0,HeRe&&(Re=He),Ce>ie&&(ie=Ce));if(je){this.left=F/this.pixelRatio,this.top=D/this.pixelRatio,this.width=(ie-F)/this.pixelRatio,this.height=(Re-D)/this.pixelRatio;var Ve=document.createElement("canvas");Ve.width=ie-F,Ve.height=Re-D,Ve.getContext("2d").putImageData(this.canvasContext.getImageData(F,D,ie-F,Re-D),0,0),this.drawingImgUrl=Ve.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},c.prototype.setDrawingImage=function(){z.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),z.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},c.prototype.setColor=function(_){this.color=_,this.colorChanged(_)},c.prototype.setLineWidth=function(_){this.lineWidth=_},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var _=Object.assign({drawingImgUrl:this.drawingImgUrl},k.prototype.getState.call(this));return _.typeName=c.typeName,_},c.prototype.restoreState=function(_){this.createVisual(),k.prototype.restoreState.call(this,_),this.drawingImgUrl=_.drawingImgUrl,this.setDrawingImage()},c.prototype.scale=function(_,I){k.prototype.scale.call(this,_,I),this.setDrawingImage()},c.typeName="FreehandMarker",c.title="Freehand marker",c.icon='',c}(pe),te=function(k){function c(_,I,F){var D=k.call(this,_,F||'')||this;return D.typeBoxes=[],D.currentType=I,D.setCurrentType=D.setCurrentType.bind(D),D}return $(c,k),c.prototype.getUi=function(){var _=this,I=document.createElement("div");I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2";for(var F=function(Re){var je="both";switch(Re){case 0:je="both";break;case 1:je="start";break;case 2:je="end";break;case 3:je="none"}var He=document.createElement("div");if(He.style.display="flex",He.style.flexGrow="2",He.style.alignItems="center",He.style.justifyContent="space-between",He.style.padding="5px",He.style.borderWidth="2px",He.style.borderStyle="solid",He.style.borderColor=je===D.currentType?D.uiStyleSettings.toolboxAccentColor:"transparent",He.addEventListener("click",function(){_.setCurrentType(je,He)}),I.appendChild(He),je==="both"||je==="start"){var Ce=document.createElement("div");Ce.style.display="flex",Ce.style.alignItems="center",Ce.style.minHeight="20px",Ce.innerHTML=``,Ce.style.marginLeft="5px",He.appendChild(Ce)}var Ve=document.createElement("div");Ve.style.display="flex",Ve.style.alignItems="center",Ve.style.minHeight="20px",Ve.style.flexGrow="2";var Ge=document.createElement("hr");if(Ge.style.minWidth="20px",Ge.style.border="0px",Ge.style.borderTop="3px solid "+(D.uiStyleSettings!==void 0?D.uiStyleSettings.toolboxColor:"#eeeeee"),Ge.style.flexGrow="2",Ve.appendChild(Ge),He.appendChild(Ve),je==="both"||je==="end"){var nt=document.createElement("div");nt.style.display="flex",nt.style.alignItems="center",nt.style.minHeight="20px",nt.innerHTML=``,nt.style.marginRight="5px",He.appendChild(nt)}D.typeBoxes.push(He)},D=this,ie=0;ie<4;ie++)F(ie);return I},c.prototype.setCurrentType=function(_,I){var F=this;this.currentType=_,this.typeBoxes.forEach(function(D){D.style.borderColor=D===I?F.uiStyleSettings!==void 0?F.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},c}(Ee),ae=function(k){function c(_,I,F){var D=k.call(this,_,I,F)||this;return D.arrowType="end",D.arrowBaseHeight=10,D.arrowBaseWidth=10,D.getArrowPoints=D.getArrowPoints.bind(D),D.setArrowType=D.setArrowType.bind(D),D.arrowTypePanel=new te("Arrow type","end"),D.arrowTypePanel.onArrowTypeChanged=D.setArrowType,D}return $(c,k),c.prototype.ownsTarget=function(_){return!(!k.prototype.ownsTarget.call(this,_)&&_!==this.arrow1&&_!==this.arrow2)},c.prototype.getArrowPoints=function(_,I){var F=this.arrowBaseWidth+2*this.strokeWidth,D=this.arrowBaseHeight+2*this.strokeWidth;return _-F/2+","+(I+D/2)+" "+_+","+(I-D/2)+" "+(_+F/2)+","+(I+D/2)},c.prototype.createTips=function(){this.arrow1=z.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(z.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=z.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(z.createTransform()),this.visual.appendChild(this.arrow2)},c.prototype.pointerDown=function(_,I){k.prototype.pointerDown.call(this,_,I),this.state==="creating"&&this.createTips()},c.prototype.adjustVisual=function(){if(k.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",z.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),z.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var _=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),I=this.arrow1.transform.baseVal.getItem(0);I.setRotate(_,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(I,0);var F=this.arrow2.transform.baseVal.getItem(0);F.setRotate(_+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(F,0)}},c.prototype.setArrowType=function(_){this.arrowType=_,this.adjustVisual(),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var _=Object.assign({arrowType:this.arrowType},k.prototype.getState.call(this));return _.typeName=c.typeName,_},c.prototype.restoreState=function(_){k.prototype.restoreState.call(this,_);var I=_;this.arrowType=I.arrowType,this.createTips(),this.adjustVisual()},c.typeName="ArrowMarker",c.title="Arrow marker",c.icon='',c}(Ue),G=function(k){function c(_,I,F){var D=k.call(this,_,I,F)||this;return D.fillColor=F.defaultFillColor,D.strokeWidth=0,D.fillPanel=new Ie("Color",F.defaultColorSet,F.defaultFillColor),D.fillPanel.onColorChanged=D.setFillColor,D}return $(c,k),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var _=k.prototype.getState.call(this);return _.typeName=c.typeName,_},c.typeName="CoverMarker",c.title="Cover marker",c.icon='',c}(ye),Y=function(k){function c(_,I,F,D){var ie=k.call(this,_,D||'')||this;return ie.opacities=[],ie.opacityBoxes=[],ie.opacities=I,ie.currentOpacity=F,ie.setCurrentOpacity=ie.setCurrentOpacity.bind(ie),ie}return $(c,k),c.prototype.getUi=function(){var _=this,I=document.createElement("div");return I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2",I.style.justifyContent="space-between",this.opacities.forEach(function(F){var D=document.createElement("div");D.style.display="flex",D.style.alignItems="center",D.style.justifyContent="center",D.style.padding="5px",D.style.borderWidth="2px",D.style.borderStyle="solid",D.style.borderColor=F===_.currentOpacity?_.uiStyleSettings.toolboxAccentColor:"transparent",D.addEventListener("click",function(){_.setCurrentOpacity(F,D)}),I.appendChild(D);var ie=document.createElement("div");ie.innerText=100*F+"%",D.appendChild(ie),_.opacityBoxes.push(D)}),I},c.prototype.setCurrentOpacity=function(_,I){var F=this;this.currentOpacity=_,this.opacityBoxes.forEach(function(D){D.style.borderColor=D===I?F.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},c}(Ee),Q=function(k){function c(_,I,F){var D=k.call(this,_,I,F)||this;return D.setOpacity=D.setOpacity.bind(D),D.fillColor=F.defaultHighlightColor,D.strokeWidth=0,D.opacity=F.defaultHighlightOpacity,D.fillPanel=new Ie("Color",F.defaultColorSet,D.fillColor),D.fillPanel.onColorChanged=D.setFillColor,D.opacityPanel=new Y("Opacity",F.defaultOpacitySteps,D.opacity),D.opacityPanel.onOpacityChanged=D.setOpacity,D}return $(c,k),c.prototype.setOpacity=function(_){this.opacity=_,this.visual&&z.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var _=k.prototype.getState.call(this);return _.typeName=c.typeName,_},c.typeName="HighlightMarker",c.title="Highlight marker",c.icon='',c}(G),q='',ce=function(k){function c(_,I,F){var D=k.call(this,_,I,F)||this;return D.bgColor="transparent",D.tipPosition={x:0,y:0},D.tipBase1Position={x:0,y:0},D.tipBase2Position={x:0,y:0},D.tipMoving=!1,D.color=F.defaultStrokeColor,D.bgColor=F.defaultFillColor,D.fontFamily=F.defaultFontFamily,D.defaultSize={x:100,y:30},D.setBgColor=D.setBgColor.bind(D),D.getTipPoints=D.getTipPoints.bind(D),D.positionTip=D.positionTip.bind(D),D.setTipPoints=D.setTipPoints.bind(D),D.colorPanel=new Ie("Text color",F.defaultColorSet,D.color,''),D.colorPanel.onColorChanged=D.setColor,D.bgColorPanel=new Ie("Fill color",F.defaultColorSet,D.bgColor,q),D.bgColorPanel.onColorChanged=D.setBgColor,D.fontFamilyPanel=new he("Font",F.defaultFontFamilies,F.defaultFontFamily),D.fontFamilyPanel.onFontChanged=D.setFont,D.tipGrip=new Fe,D.tipGrip.visual.transform.baseVal.appendItem(z.createTransform()),D.controlBox.appendChild(D.tipGrip.visual),D}return $(c,k),c.prototype.ownsTarget=function(_){return k.prototype.ownsTarget.call(this,_)||this.tipGrip.ownsTarget(_)||this.tip===_},c.prototype.createTip=function(){z.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=z.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},c.prototype.pointerDown=function(_,I){this.state==="new"&&k.prototype.pointerDown.call(this,_,I),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(I)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):k.prototype.pointerDown.call(this,_,I)},c.prototype.pointerUp=function(_){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,k.prototype.pointerUp.call(this,_);else{var I=this.state==="creating";k.prototype.pointerUp.call(this,_),this.setTipPoints(I),this.positionTip()}},c.prototype.manipulate=function(_){if(this.tipMoving){var I=this.unrotatePoint(_);this.tipPosition={x:I.x-this.manipulationStartLeft,y:I.y-this.manipulationStartTop},this.positionTip()}else k.prototype.manipulate.call(this,_)},c.prototype.setBgColor=function(_){this.bgRectangle&&this.tip&&(z.setAttributes(this.bgRectangle,[["fill",_]]),z.setAttributes(this.tip,[["fill",_]])),this.bgColor=_,this.fillColorChanged(_)},c.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},c.prototype.setTipPoints=function(_){_===void 0&&(_=!1);var I=Math.min(this.height/2,15),F=this.height/5;_&&(this.tipPosition={x:I+F/2,y:this.height+20});var D=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?D',c}(Le),_e=function(k){function c(_,I,F){var D=k.call(this,_,I,F)||this;return D.fillColor="transparent",D.strokeColor="transparent",D.strokeWidth=0,D.strokeDasharray="",D.opacity=1,D.strokeColor=F.defaultColor,D.strokeWidth=F.defaultStrokeWidth,D.strokeDasharray=F.defaultStrokeDasharray,D.fillColor=F.defaultFillColor,D.setStrokeColor=D.setStrokeColor.bind(D),D.setFillColor=D.setFillColor.bind(D),D.setStrokeWidth=D.setStrokeWidth.bind(D),D.setStrokeDasharray=D.setStrokeDasharray.bind(D),D.setOpacity=D.setOpacity.bind(D),D.createVisual=D.createVisual.bind(D),D.strokePanel=new Ie("Line color",X(F.defaultColorSet,["transparent"]),F.defaultColor),D.strokePanel.onColorChanged=D.setStrokeColor,D.fillPanel=new Ie("Fill color",X(F.defaultColorSet,["transparent"]),D.fillColor,q),D.fillPanel.onColorChanged=D.setFillColor,D.strokeWidthPanel=new Te("Line width",F.defaultStrokeWidths,F.defaultStrokeWidth),D.strokeWidthPanel.onWidthChanged=D.setStrokeWidth,D.strokeStylePanel=new we("Line style",F.defaultStrokeDasharrays,F.defaultStrokeDasharray),D.strokeStylePanel.onStyleChanged=D.setStrokeDasharray,D.opacityPanel=new Y("Opacity",F.defaultOpacitySteps,D.opacity),D.opacityPanel.onOpacityChanged=D.setOpacity,D}return $(c,k),c.prototype.ownsTarget=function(_){return!(!k.prototype.ownsTarget.call(this,_)&&_!==this.visual)},c.prototype.createVisual=function(){this.visual=z.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},c.prototype.pointerDown=function(_,I){k.prototype.pointerDown.call(this,_,I),this.state==="new"&&(this.createVisual(),this.moveVisual(_),this._state="creating")},c.prototype.manipulate=function(_){k.prototype.manipulate.call(this,_)},c.prototype.resize=function(_){k.prototype.resize.call(this,_),this.setSize()},c.prototype.setSize=function(){k.prototype.setSize.call(this),z.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},c.prototype.pointerUp=function(_){k.prototype.pointerUp.call(this,_),this.setSize()},c.prototype.setStrokeColor=function(_){this.strokeColor=_,this.visual&&z.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(_),this.stateChanged()},c.prototype.setFillColor=function(_){this.fillColor=_,this.visual&&z.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(_),this.stateChanged()},c.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.visual&&z.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},c.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.visual&&z.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},c.prototype.setOpacity=function(_){this.opacity=_,this.visual&&z.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var _=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},k.prototype.getState.call(this));return _.typeName=c.typeName,_},c.prototype.restoreState=function(_){var I=_;this.fillColor=I.fillColor,this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.opacity=I.opacity,this.createVisual(),k.prototype.restoreState.call(this,_),this.setSize()},c.prototype.scale=function(_,I){k.prototype.scale.call(this,_,I),this.setSize()},c.typeName="EllipseMarker",c.title="Ellipse marker",c.icon='',c}(pe),ke=function(k){function c(_,I,F){return k.call(this,_,I,F)||this}return $(c,k),Object.defineProperty(c.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),c.prototype.ownsTarget=function(_){return!(!k.prototype.ownsTarget.call(this,_)&&_!==this.tip1&&_!==this.tip2)},c.prototype.createTips=function(){this.tip1=z.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(z.createTransform()),this.visual.appendChild(this.tip1),this.tip2=z.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(z.createTransform()),this.visual.appendChild(this.tip2)},c.prototype.pointerDown=function(_,I){k.prototype.pointerDown.call(this,_,I),this.state==="creating"&&this.createTips()},c.prototype.adjustVisual=function(){if(k.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(z.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()]]),z.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 _=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),I=this.tip1.transform.baseVal.getItem(0);I.setRotate(_,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(I,0);var F=this.tip2.transform.baseVal.getItem(0);F.setRotate(_+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(F,0)}},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var _=k.prototype.getState.call(this);return _.typeName=c.typeName,_},c.prototype.restoreState=function(_){k.prototype.restoreState.call(this,_),this.createTips(),this.adjustVisual()},c.typeName="MeasurementMarker",c.title="Measurement marker",c.icon='',c}(Ue),Ke=function(k){function c(_,I,F){var D=k.call(this,_,I,F)||this;return D.strokePanel.colors=F.defaultColorSet,D.fillColor="transparent",D}return $(c,k),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var _=k.prototype.getState.call(this);return _.typeName=c.typeName,_},c.typeName="EllipseFrameMarker",c.title="Ellipse frame marker",c.icon='',c}(_e),Xe=function(){function k(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(k.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),k.prototype.addUndoStep=function(c){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(c)||(this.undoStack.push(c),JSON.stringify(this.lastRedoStep)!==JSON.stringify(c)&&this.redoStack.splice(0,this.redoStack.length))},k.prototype.replaceLastUndoStep=function(c){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=c)},k.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},k.prototype.undo=function(){if(this.undoStack.length>1){var c=this.undoStack.pop();return c!==void 0&&this.redoStack.push(c),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},k.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},k}(),ze=function(k){function c(_,I,F){var D=k.call(this,_,I,F)||this;return D.strokeColor="transparent",D.strokeWidth=0,D.strokeDasharray="",D.curveX=0,D.curveY=0,D.manipulationStartCurveX=0,D.manipulationStartCurveY=0,D.setStrokeColor=D.setStrokeColor.bind(D),D.setStrokeWidth=D.setStrokeWidth.bind(D),D.setStrokeDasharray=D.setStrokeDasharray.bind(D),D.positionGrips=D.positionGrips.bind(D),D.addControlGrips=D.addControlGrips.bind(D),D.adjustVisual=D.adjustVisual.bind(D),D.setupControlBox=D.setupControlBox.bind(D),D.resize=D.resize.bind(D),D.strokeColor=F.defaultColor,D.strokeWidth=F.defaultStrokeWidth,D.strokeDasharray=F.defaultStrokeDasharray,D.strokePanel=new Ie("Line color",F.defaultColorSet,F.defaultColor),D.strokePanel.onColorChanged=D.setStrokeColor,D.strokeWidthPanel=new Te("Line width",F.defaultStrokeWidths,F.defaultStrokeWidth),D.strokeWidthPanel.onWidthChanged=D.setStrokeWidth,D.strokeStylePanel=new we("Line style",F.defaultStrokeDasharrays,F.defaultStrokeDasharray),D.strokeStylePanel.onStyleChanged=D.setStrokeDasharray,D}return $(c,k),c.prototype.ownsTarget=function(_){return!(!k.prototype.ownsTarget.call(this,_)&&_!==this.visual&&_!==this.selectorCurve&&_!==this.visibleCurve&&!this.curveGrip.ownsTarget(_))},c.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},c.prototype.createVisual=function(){this.visual=z.createGroup(),this.selectorCurve=z.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=z.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},c.prototype.pointerDown=function(_,I){k.prototype.pointerDown.call(this,_,I),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=_.x,this.curveY=_.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(I)&&(this.activeGrip=this.curveGrip,this._state="resize")},c.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),z.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),z.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),z.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},c.prototype.setupControlBox=function(){k.prototype.setupControlBox.call(this),this.curveControlLine1=z.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=z.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},c.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,k.prototype.addControlGrips.call(this)},c.prototype.positionGrips=function(){k.prototype.positionGrips.call(this);var _=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-_/2,this.curveY-_/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},c.prototype.manipulate=function(_){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+_.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+_.y-this.manipulationStartY),k.prototype.manipulate.call(this,_)},c.prototype.resize=function(_){this.activeGrip===this.curveGrip&&(this.curveX=_.x,this.curveY=_.y),k.prototype.resize.call(this,_),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},c.prototype.setStrokeColor=function(_){this.strokeColor=_,this.adjustVisual(),this.colorChanged(_)},c.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.adjustVisual()},c.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.adjustVisual()},c.prototype.scale=function(_,I){this.curveX=this.curveX*_,this.curveY=this.curveY*I,k.prototype.scale.call(this,_,I)},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var _=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},k.prototype.getState.call(this));return _.typeName=c.typeName,_},c.prototype.restoreState=function(_){k.prototype.restoreState.call(this,_);var I=_;this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.curveX=I.curveX,this.curveY=I.curveY,this.createVisual(),this.adjustVisual()},c.typeName="CurveMarker",c.title="Curve marker",c.icon='',c}(Ne),qe=function(){function k(c,_){_===void 0&&(_=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=c,this.cancelable=_}return Object.defineProperty(k.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),k.prototype.preventDefault=function(){this._defaultPrevented=!0},k}(),it=function(k){function c(_,I,F){var D=k.call(this,_,!1)||this;return D.dataUrl=I,D.state=F,D}return $(c,k),c}(qe),Ye=function(k){function c(_,I,F){F===void 0&&(F=!1);var D=k.call(this,_,F)||this;return D.marker=I,D}return $(c,k),c}(qe),mt=function(){function k(){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 k.prototype.addEventListener=function(c,_){this[c].push(_)},k.prototype.removeEventListener=function(c,_){var I=this[c].indexOf(_);I>-1&&this[c].splice(I,1)},k}(),at=function(){function k(c){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new ve,this._isOpen=!1,this.undoRedoManager=new Xe,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 mt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=k.instanceCounter++,this.styles=new Ae(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=c,this.targetRoot=document.body,this.width=c.clientWidth,this.height=c.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(k.prototype,"ALL_MARKER_TYPES",{get:function(){return[xe,se,ae,Le,Ke,_e,Q,ce,ke,G,Ue,ze]},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[xe,se,ae,Le,_e,Q,ce]},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"BASIC_MARKER_TYPES",{get:function(){return[xe,se,ae,Le,Q]},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(c){var _=this;this._availableMarkerTypes.splice(0),c.forEach(function(I){if(typeof I=="string"){var F=_.ALL_MARKER_TYPES.find(function(D){return D.typeName===I});F!==void 0&&_._availableMarkerTypes.push(F)}else _._availableMarkerTypes.push(I)})},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(c){this._zoomLevel=c,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),k.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),fe.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},k.prototype.show=function(){var c=this;this.styles.styleSheetRoot===void 0&&Oe.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Oe.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(_){return _(new qe(c))})},k.prototype.render=function(){return Z(this,void 0,void 0,function(){var c;return ne(this,function(_){switch(_.label){case 0:return this.setCurrentMarker(),(c=new Se).naturalSize=this.renderAtNaturalSize,c.imageType=this.renderImageType,c.imageQuality=this.renderImageQuality,c.markersOnly=this.renderMarkersOnly,c.width=this.renderWidth,c.height=this.renderHeight,[4,c.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return _.sent(),[4,c.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,_.sent()]}})})},k.prototype.close=function(c){var _=this;if(c===void 0&&(c=!1),this.isOpen){var I=!1;c||this.eventListeners.beforeclose.forEach(function(F){var D=new qe(_,!0);F(D),D.defaultPrevented&&(I=!0)}),I||(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(F){return F(new qe(_))}),this.detachEvents(),this._isOpen=!1)}},k.prototype.addMarkersToToolbar=function(){for(var c,_=[],I=0;Ithis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*c:this.editorCanvas.clientWidth,I=_',c.title="Powered by marker.js",c.style.display="grid",c.style.alignItems="center",c.style.justifyItems="center",c.style.padding="3px",c.style.width="20px",c.style.height="20px",this.logoUI.appendChild(c),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},k.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")},k.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"},k.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},k.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var c=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=c+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new ge(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(c),1),c.dispose()},k.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())},k.prototype.toolbarButtonClicked=function(c,_){if(c==="marker"&&_!==void 0)this.createNewMarker(_);else if(c==="action")switch(_){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()}},k.prototype.deleteSelectedMarker=function(){var c=this;if(this._currentMarker!==void 0){var _=!1;if(this.eventListeners.markerbeforedelete.forEach(function(F){var D=new Ye(c,c._currentMarker,!0);F(D),D.defaultPrevented&&(_=!0)}),!_){var I=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(F){return F(new Ye(c,I))})}}},k.prototype.clear=function(){var c=this,_=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ie){var Re=new Ye(c,void 0,!0);ie(Re),Re.defaultPrevented&&(_=!0)}),!_)){this.setCurrentMarker();for(var I=function(ie){var Re=F.markers[ie];F.setCurrentMarker(F.markers[ie]),F._currentMarker.dispose(),F.markerImage.removeChild(F._currentMarker.container),F.markers.splice(F.markers.indexOf(F._currentMarker),1),F.eventListeners.markerdelete.forEach(function(je){return je(new Ye(c,Re))})},F=this,D=this.markers.length-1;D>=0;D--)I(D);this.addUndoStep()}},Object.defineProperty(k.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),k.prototype.showNotesEditor=function(){var c;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(c=this._currentMarker.notes)!==null&&c!==void 0?c:"",this.overlayContainer.appendChild(this.notesArea))},k.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)},k.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},k.prototype.addUndoStep=function(){var c=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var _=this.getState(),I=this.undoRedoManager.getLastUndoStep();if(!I||I.width===_.width&&I.height===_.height){var F=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(_),F1&&this.panTo({x:c.clientX,y:c.clientY}))},k.prototype.onPointerUp=function(c){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(c.clientX,c.clientY)),this.isDragging=!1,this.addUndoStep()},k.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},k.prototype.onKeyUp=function(c){this._currentMarker===void 0||this.notesArea!==void 0||c.key!=="Delete"&&c.key!=="Backspace"||this.deleteSelectedMarker()},k.prototype.clientToLocalCoordinates=function(c,_){var I=this.markerImage.getBoundingClientRect();return{x:(c-I.left)/this.zoomLevel,y:(_-I.top)/this.zoomLevel}},k.prototype.onWindowResize=function(){this.positionUI()},k.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var c=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=c+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},k.prototype.addLicenseKey=function(c){fe.addKey(c)},k.prototype.addEventListener=function(c,_){this.eventListeners.addEventListener(c,_)},k.prototype.removeEventListener=function(c,_){this.eventListeners.removeEventListener(c,_)},k.prototype.renderState=function(c){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(c),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(k.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),k.prototype.focus=function(){var c=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(_){return _(new qe(c))}))},k.prototype.blur=function(){var c=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(_){return _(new qe(c))}))},k.instanceCounter=0,k}();/* **********************************
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 yt=function(k,c){return(yt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,I){_.__proto__=I}||function(_,I){for(var F in I)Object.prototype.hasOwnProperty.call(I,F)&&(_[F]=I[F])})(k,c)};function dt(k,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");function _(){this.constructor=k}yt(k,c),k.prototype=c===null?Object.create(c):(_.prototype=c.prototype,new _)}function tt(k,c,_,I){return new(_||(_=Promise))(function(F,D){function ie(He){try{je(I.next(He))}catch(Ce){D(Ce)}}function Re(He){try{je(I.throw(He))}catch(Ce){D(Ce)}}function je(He){var Ce;He.done?F(He.value):(Ce=He.value,Ce instanceof _?Ce:new _(function(Ve){Ve(Ce)})).then(ie,Re)}je((I=I.apply(k,c||[])).next())})}function _t(k,c){var _,I,F,D,ie={label:0,sent:function(){if(1&F[0])throw F[1];return F[1]},trys:[],ops:[]};return D={next:Re(0),throw:Re(1),return:Re(2)},typeof Symbol=="function"&&(D[Symbol.iterator]=function(){return this}),D;function Re(je){return function(He){return function(Ce){if(_)throw new TypeError("Generator is already executing.");for(;ie;)try{if(_=1,I&&(F=2&Ce[0]?I.return:Ce[0]?I.throw||((F=I.return)&&F.call(I),0):I.next)&&!(F=F.call(I,Ce[1])).done)return F;switch(I=0,F&&(Ce=[2&Ce[0],F.value]),Ce[0]){case 0:case 1:F=Ce;break;case 4:return ie.label++,{value:Ce[1],done:!1};case 5:ie.label++,I=Ce[1],Ce=[0];continue;case 7:Ce=ie.ops.pop(),ie.trys.pop();continue;default:if(!(F=ie.trys,(F=F.length>0&&F[F.length-1])||Ce[0]!==6&&Ce[0]!==2)){ie=0;continue}if(Ce[0]===3&&(!F||Ce[1]>F[0]&&Ce[1]0&&_>0){var I=new Ze(c,_),F=I.ratio>=1?20:I.getHorizontalLength(20),D=I.ratio<1?20:I.getVerticalLength(20),ie=document.createElementNS("http://www.w3.org/2000/svg","svg");ie.setAttribute("xmlns","http://www.w3.org/2000/svg"),ie.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ie);var Re=Be.createDefs();ie.appendChild(Re);var je=Be.createElement("clipPath",[["id","text-bg-clip"]]);Re.appendChild(je);var He=Be.createPath(Be.getHollowRectanglePath((24-F)/2,(24-D)/2,F,D,(24-F)/2+2,(24-D)/2+2,F-4,D-4));ie.appendChild(He);var Ce=Be.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ce.appendChild(Be.createTSpan(c+":"+_)),ie.appendChild(Ce);var Ve=Ce.getBBox();Be.setAttributes(Ce,[["x",((24-Ve.width)/2).toString()],["y",((24-Ve.height)/2-Ve.y).toString()]]);var Ge=Be.createPath(Be.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ve.width))/2,(24-Math.ceil(Ve.height))/2,Math.ceil(Ve.width),Math.ceil(Ve.height)));return je.appendChild(Ge),Be.setAttributes(He,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ie),ie.outerHTML}return''},k}(),ct=function(k){function c(_,I,F){var D=k.call(this,_,I)||this;return D.isDropdownOpen=!1,D.onClick=D.dropdownButtonClicked,D.dropdownButtons=F,D}return dt(c,k),c.prototype.setupDropdown=function(){var _=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(I){I.className=_.className,I.colorsClassName=_.colorsClassName,_.dropdownBlock.appendChild(I.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},c.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},c.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},c.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},c.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},c.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},c}(ot),st=function(){function k(c,_){this.GRIP_SIZE=10,this.color=c,this.fillColor=_,this.visual=Be.createGroup(),this.visual.appendChild(Be.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Be.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return k.prototype.ownsTarget=function(c){return c===this.visual||c===this.visual.childNodes[0]||c===this.visual.childNodes[1]},k.prototype.setCenter=function(c,_){this.visual.childNodes.forEach(function(I){return Be.setAttributes(I,[["cx",c.toString()],["cy",_.toString()]])})},k}(),lt=function(){function k(c,_,I,F){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=c,this.canvasHeight=_,this.margin=I,this.container=F,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(k.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(c){this._aspectRatio=c,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(c){this._isGridVisible=c,this.gridContainer&&Be.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(c){this._zoomFactor=c,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),k.prototype.open=function(){var c=this;this.cropShadeElement=Be.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Be.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var _=0;_this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-_.height/2),Be.setAttributes(this.cropRectElement,[["x",_.x.toString()],["y",_.y.toString()],["width",_.width.toString()],["height",_.height.toString()]]);var I=_.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(D,ie){var Re=_.y+I*(ie+1);Be.setAttributes(D,[["x1",""+_.x],["y1",""+Re],["x2",""+(_.x+_.width)],["y2",""+Re]])});var F=_.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(D,ie){var Re=_.x+F*(ie+1);Be.setAttributes(D,[["x1",""+Re],["y1",""+_.y],["x2",""+Re],["y2",""+(_.y+_.height)]])}),Be.setAttributes(this.cropShadeElement,[["d",Be.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,_.x,_.y,_.width,_.height)]]),this.topLeftGrip.setCenter(_.x,_.y),this.topRightGrip.setCenter(_.x+_.width,_.y),this.bottomLeftGrip.setCenter(_.x,_.y+_.height),this.bottomRightGrip.setCenter(_.x+_.width,_.y+_.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},k.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)},k.prototype.clientToLocalCoordinates=function(c,_){var I=this.container.getBoundingClientRect();return{x:c-I.left+this.margin,y:_-I.top+this.margin}},k.prototype.onPointerDown=function(c){this.container.setPointerCapture(c.pointerId),this.previousPoint=this.clientToLocalCoordinates(c.clientX,c.clientY),this.cropRectElement===c.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(c.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(c.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(c.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(c.target)&&(this.activeGrip=this.bottomRightGrip)},k.prototype.onPointerMove=function(c){if(this.isMoving)this.move(this.clientToLocalCoordinates(c.clientX,c.clientY));else if(this.activeGrip){var _=this.clientToLocalCoordinates(c.clientX,c.clientY);this.resize(_)}c.preventDefault()},k.prototype.onPointerUp=function(c){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(c.pointerId)},k.prototype.move=function(c){var _=c.x-this.previousPoint.x,I=c.y-this.previousPoint.y;this.zoomFactor!==1&&(_=-_/this.zoomFactor,I=-I/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+_),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+I),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=c},k.prototype.resize=function(c){var _=Object.assign({},this.cropRect),I=c.x-this.previousPoint.x,F=c.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:_.x+Ithis.canvasWidth*this.zoomFactor&&(I=this.canvasWidth*this.zoomFactor-_.width),_.width+=I}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(_.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(I),_.height=this.aspectRatio.getVerticalLength(_.width)):(_.y+=F,_.height=this.cropRect.y+this.cropRect.height-_.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?_.height=this.aspectRatio.getVerticalLength(_.width):_.height+=F}_.width<10&&(_.x=this.cropRect.x,_.width=10),_.height<10&&(_.y=this.cropRect.y,_.height=10),this.previousPoint=c,_.x>=this.margin&&_.y>=this.margin&&_.x-this.margin+_.width<=this.canvasWidth&&_.y-this.margin+_.height<=this.canvasHeight&&(this.cropRect=_,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},k.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var c=this.cropRect.x+this.cropRect.width/2,_=this.cropRect.y+this.cropRect.height/2,I=this.aspectRatio.getHorizontalLength(this.cropRect.height),F=this.aspectRatio.getVerticalLength(this.cropRect.width);I/this.canvasWidththis.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=c-this.cropRect.width/2,this.cropRect.y=_-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)}},k.prototype.getRescaledRect=function(c,_,I,F,D,ie){var Re=I/c,je=F/_;return{x:(D.x-ie)*Re+ie,y:(D.y-ie)*je+ie,width:D.width*Re,height:D.height*je}},k.prototype.scaleCanvas=function(c,_){var I=this.getRescaledRect(this.canvasWidth,this.canvasHeight,c,_,this.cropRect,this.margin);this.canvasWidth=c,this.canvasHeight=_,this.onCropChange&&this.onCropChange(I),this.setCropRectangle(I)},k}(),gt=function(){function k(c){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=c,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(k.prototype,"angle",{get:function(){return this._angle},set:function(c){this._angle=c,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),k.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},k.prototype.onPointerDown=function(c){this.controlContainer.setPointerCapture(c.pointerId),this.isDragging=!0,this.previousPoint={x:c.clientX,y:c.clientY}},k.prototype.onPointerMove=function(c){this.isDragging&&(this.onAngleChange&&this.onAngleChange((c.clientX-this.previousPoint.x)/5),this.previousPoint.x=c.clientX)},k.prototype.onPointerUp=function(c){this.isDragging&&this.onAngleChange&&this.onAngleChange((c.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(c.pointerId)},k.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var c=this.angleLabelText.getBBox();Be.setAttributes(this.angleLabelElement,[["x",((this.width-c.width)/2).toString()],["y",(this.height/2).toString()]])}},k.prototype.positionScaleShape=function(){if(this.scaleShape){var c=this.scaleShape.transform.baseVal.getItem(0);c.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(c,0)}},k.prototype.getVisual=function(){var c=document.createElementNS("http://www.w3.org/2000/svg","svg");c.setAttribute("xmlns","http://www.w3.org/2000/svg"),c.setAttribute("width",this.width+"px"),c.setAttribute("height",this.height+"px"),c.setAttribute("viewBox","0 0 "+this.width+" "+this.height),c.style.flexShrink="0",document.body.appendChild(c);for(var _="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,I=1;I<=this.width/5+10;I++){var F=I%5==0?this.height/3:this.height/6;_+="h4v"+-F+"h1v"+F}_+="v1H0Z",this.scaleShape=Be.createPath(_);var D=Be.createTransform();this.scaleShape.transform.baseVal.appendItem(D),c.appendChild(this.scaleShape),this.angleLabelElement=Be.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Be.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ie=Be.createTSpan("");return ie.innerHTML="°",this.angleLabelElement.appendChild(ie),c.appendChild(this.angleLabelElement),document.body.removeChild(c),c},k}(),It=function(){function k(){this.naturalSize=!1,this.imageType="image/png"}return k.prototype.rasterize=function(c,_,I,F,D,ie,Re){var je=this;return new Promise(function(He){var Ce=document.createElement("canvas");Ce.width=c.width.baseVal.value-2*F,Ce.height=c.height.baseVal.value-2*F;var Ve=1,Ge=1;je.naturalSize===!0?(Ve=_.naturalWidth/(c.width.baseVal.value-2*F)/ie,Ge=_.naturalHeight/(c.height.baseVal.value-2*F)/Re,Ce.width=_.naturalWidth/ie,Ce.height=_.naturalHeight/Re):je.width!==void 0&&je.height!==void 0&&(Ve=je.width/I.width,Ge=je.height/I.height,Ce.width*=Ve,Ce.height*=Ge);var nt=Ce.getContext("2d");nt.translate(Ce.width/2,Ce.height/2),nt.rotate(D*Math.PI/180),nt.scale(ie,Re),nt.translate(-Ce.width/2,-Ce.height/2),nt.drawImage(_,0,0,Ce.width,Ce.height);var St=document.createElement("canvas");St.width=I.width*Ve,St.height=I.height*Ge,St.getContext("2d").putImageData(nt.getImageData((I.x-F)*Ve,(I.y-F)*Ge,I.width*Ve,I.height*Ge),0,0),He(St.toDataURL(je.imageType,je.imageQuality))})},k}(),Ft=function(){function k(c){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=k.instanceCounter++,this.styles=new $e(this.instanceNo),this.target=c,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(k.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(c){this._zoomToCropEnabled=c,c?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(c){this._isGridVisible=c,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"gridLines",{get:function(){return this._gridLines},set:function(c){this._gridLines=c,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(c){this._rotationAngle=c,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"aspectRatio",{get:function(){var c;return(c=this._aspectRatio)!==null&&c!==void 0?c:this.aspectRatios[0]},set:function(c){this._aspectRatio=c},enumerable:!1,configurable:!0}),k.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},k.prototype.show=function(){this.showUI(),this.open()},k.prototype.close=function(c){c===void 0&&(c=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),c||this.closeEventListeners.forEach(function(_){return _()}),this._isOpen=!1)},k.prototype.addRenderEventListener=function(c){this.renderEventListeners.push(c)},k.prototype.removeRenderEventListener=function(c){this.renderEventListeners.indexOf(c)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(c),1)},k.prototype.addCloseEventListener=function(c){this.closeEventListeners.push(c)},k.prototype.removeCloseEventListener=function(c){this.closeEventListeners.indexOf(c)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(c),1)},k.prototype.setupResizeObserver=function(){var c=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){c.resize(c.target.clientWidth,c.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},k.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var c=1*this.target.clientWidth/this.target.clientHeight,_=this.contentDiv.clientWidth/c>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*c:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,I=_+2*this.CANVAS_MARGINc+this.CANVAS_MARGIN?this.target.offsetTop-(c+this.CANVAS_MARGIN):0;this.coverDiv.style.top=_+"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},k.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},k.prototype.addTopToolbar=function(){var c=this;this.topToolbar=new ft,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var _=new Rt;_.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(_);var I=[];this.aspectRatios.forEach(function(Ge){var nt=new ot(ut.getIcon(Ge.horizontal,Ge.vertical),Ge.horizontal===0&&Ge.vertical===0?"FREE":Ge.horizontal+":"+Ge.vertical);nt.onClick=function(){return c.ratioButtonClicked(Ge)},I.push(nt)}),this.aspectRatioButton=new ct(ut.getIcon(0,0),"Aspect ratio",I),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,_.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var F=new ot('',"Toggle grid");F.isActive=this.isGridVisible,F.onClick=function(){c.isGridVisible=!c.isGridVisible,F.isActive=c.isGridVisible},_.addButton(F);var D=new ot('',"Zoom to selection");if(D.isActive=this.zoomToCropEnabled,D.onClick=function(){c.zoomToCropEnabled=!c.zoomToCropEnabled,D.isActive=c.zoomToCropEnabled},_.addButton(D),!Et.isLicensed){var ie=new rt;this.topToolbar.addElementBlock(ie);var Re=document.createElement("div");Re.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var je=document.createElement("a");je.style.color="currentColor",je.href="https://markerjs.com/products/cropro",je.target="_blank",je.innerHTML='',Re.appendChild(je),ie.addElement(Re)}var He=new Rt;He.minWidth=3*this.toolbarHeight+"px",He.contentAlign="end",this.topToolbar.addButtonBlock(He);var Ce=new ot('',"OK");Ce.onClick=this.startRenderAndClose,He.addButton(Ce),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ce.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ve=new ot('',"Close");Ve.onClick=this.close,He.addButton(Ve),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ve.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},k.prototype.addBottomToolbar=function(){var c=this;this.bottomToolbar=new ft,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var _=new Rt;_.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(_);var I=new ot('',"Rotate left");I.onClick=this.rotateLeftButtonClicked,_.addButton(I);var F=new ot('',"Rotate right");F.onClick=this.rotateRightButtonClicked,_.addButton(F);var D=new rt;D.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(D),this.straightener=new gt("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(He){c.rotateBy(He),c.straightener.angle=c.rotationAngle},D.addElement(this.straightener.getUI());var ie=new Rt;ie.minWidth=2*this.toolbarHeight+"px",ie.contentAlign="end",this.bottomToolbar.addButtonBlock(ie);var Re=new ot('',"Flip horizontal");Re.onClick=this.flipHorizontallyButtonClicked,ie.addButton(Re);var je=new ot('',"Flip vertical");je.onClick=this.flipVerticallyButtonClicked,ie.addButton(je)},k.prototype.ratioButtonClicked=function(c){this.aspectRatio=c,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},k.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ut.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},k.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ze(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},k.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},k.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},k.prototype.restoreState=function(c){if(c){var _=this.cropLayer.getRescaledRect(c.width,c.height,this.imageWidth,this.imageHeight,c.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(_),this.cropRectChanged(_),this.flippedHorizontally=c.flippedHorizontally,this.flippedVertically=c.flippedVertically,this.applyFlip(),this.rotationAngle=c.rotationAngle,this.applyRotation()}},k.prototype.clientToLocalCoordinates=function(c,_){var I=this.cropImage.getBoundingClientRect();return{x:c-I.left,y:_-I.top}},k.prototype.onWindowResize=function(){this.positionUI()},k.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var c=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=c+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},k.prototype.rotateLeftButtonClicked=function(){var c=this.rotationAngle-90;this.rotationAngle%90!=0&&(c+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(c)},k.prototype.rotateRightButtonClicked=function(){var c=this.rotationAngle+90;this.rotationAngle%90!=0&&(c-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(c)},k.prototype.rotateTo=function(c){c=(c=c>180?c-360:c)<=-180?c+360:c,this.rotationAngle=c,this.applyRotation()},k.prototype.rotateBy=function(c){this.rotateTo((this.rotationAngle+c)%360)},k.prototype.applyRotation=function(){var c=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var _=this.editingTargetRotationContainer.transform.baseVal.getItem(0);_.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(_,0);var I=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/I.width,this.imageHeight/I.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=c},k.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},k.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},k.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},k.prototype.startRenderAndClose=function(){return tt(this,void 0,void 0,function(){var c,_;return _t(this,function(I){switch(I.label){case 0:return[4,this.render()];case 1:return c=I.sent(),_=this.getState(),this.renderEventListeners.forEach(function(F){return F(c,_)}),this.close(!0),[2]}})})},k.prototype.render=function(){return tt(this,void 0,void 0,function(){var c;return _t(this,function(_){switch(_.label){case 0:return(c=new It).naturalSize=this.renderAtNaturalSize,c.imageType=this.renderImageType,c.imageQuality=this.renderImageQuality,c.width=this.renderWidth,c.height=this.renderHeight,this.unzoomFromCrop(),Be.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,c.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return _.sent(),[4,c.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,_.sent()]}})})},k.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Je("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 Je("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Je("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var c=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Je("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*c)+`px;
height: `+(this.toolbarHeight-2*c)+`px;
padding: `+c+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Je("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Je("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new Qe("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new Qe("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Je("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 Je("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Je("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 Je("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*c)+`px;
padding: `+c+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Je("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},k.instanceCounter=0,k}(),Mt=J("8hTe"),Wt=J.n(Mt),jt=/]*>/g;function Vt(k){var c=document.createElement("div");return c.innerHTML=k,c.childNodes.length===0?"":c.childNodes[0].nodeValue}var Kt=We.a=function(k){var c=k.value,_=c===void 0?"":c,I=k.edit,F=I===void 0?!1:I,D=k.className,ie=k.showTextOnly,Re=k.showLines,je=k.replaces,He=k.zoomImg,Ce=k.hasMask,Ve=k.style,Ge=Ve===void 0?{}:Ve,nt=k.stylesPrev,St=nt===void 0?{}:nt,xt=String(_),bt=Object(S.useRef)(),Ct=Object(S.useRef)(),Ht=Object(S.useState)(""),Nt=Object(B.a)(Ht,2),vt=Nt[0],Ot=Nt[1],Gt=Object(S.useState)("office"),Lt=Object(B.a)(Gt,2),Yt=Lt[0],At=Lt[1],Pt=function(){var pt=new Ft(Ct.current);pt.displayMode="popup",pt.addRenderEventListener(function(){var Ut=Object(A.a)(w.a.mark(function ht(Bt){var wt;return w.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return bt.current.style.display="none",kt.next=3,Object(le.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Bt}});case 3:wt=kt.sent,wt!=null&&wt.id&&je(Ct.current.getAttribute("src").replace(V.a.API_SERVER,""),"/api/attachments/".concat(wt==null?void 0:wt.id,"?type=").concat(wt.content_type));case 5:case"end":return kt.stop()}},ht)}));return function(ht){return Ut.apply(this,arguments)}}()),pt.show()},Jt=function(){var pt=new at(Ct.current);pt.settings.displayMode="popup",pt.addEventListener("render",function(){var Ut=Object(A.a)(w.a.mark(function ht(Bt){var wt;return w.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:if(bt.current.style.display="none",!Ct.current){kt.next=6;break}return kt.next=4,Object(le.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Bt.dataUrl}});case 4:wt=kt.sent,wt!=null&&wt.id&&je(Ct.current.getAttribute("src").replace(V.a.API_SERVER,""),"/api/attachments/".concat(wt==null?void 0:wt.id,"?type=").concat(wt.content_type));case 6:case"end":return kt.stop()}},ht)}));return function(ht){return Ut.apply(this,arguments)}}()),pt.show(),window.markerArea=pt},Xt=Object(S.useMemo)(function(){bt.current&&(bt.current.style.zIndex=-1);try{var Dt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,pt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Ut=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;xt=xt.replace(Dt,"("+V.a.API_SERVER+"/api/attachments/").replace(pt,'"'+V.a.API_SERVER+"/api/attachments/").replace(Ut,'"'+V.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(Qt){}var ht=U(xt),Bt=b();if(xt.match(/\[TOC\]/)&&(ht=ht.replace("[TOC]
",E()),T()),ht=ht.replace(/(__special_katext_id_\d+__)/g,function(Qt,kt){var Zt=Bt[kt],ti=Zt.type,ii=Zt.expression;return Object(re.renderToString)(Vt(ii)||"",{displayMode:ti==="block",throwOnError:!1,output:"html"})}),ht=ht.replace(/▁/g,"\u2581\u2581\u2581"),p(),ie){var wt=document.createElement("div");return wt.innerHTML=ht,wt.innerText}return setTimeout(function(){return qt()},500),ht},[xt]),zt=Object(S.useRef)();v.WebkitLineClamp=Re,Re&&(Ge=Object(L.a)(Object(L.a)({},Ge),v));function $t(Dt){var pt=Dt.target;if(pt.tagName.toUpperCase()==="IMG"){if(He){var Ut=pt.getAttribute("src");Ot(Ut),At("image")}}else if(pt.tagName.toUpperCase()==="A"){var ht=pt.getAttribute("href");if(ht.indexOf("office")>-1)Dt.preventDefault(),Ot(ht),At("office");else if(ht.indexOf("application/pdf")>-1)Dt.preventDefault(),Ot(ht),At("pdf");else if(ht.indexOf("text/html")>-1)Dt.preventDefault(),Ot(ht),At("html");else if(ht.startsWith("#")){Dt.preventDefault();var Bt=document.getElementById(ht.replace("#",""));Bt&&Bt.scrollIntoView(!0)}}}var qt=function(){var pt,Ut=(pt=zt.current)===null||pt===void 0?void 0:pt.querySelectorAll("video");Ut==null||Ut.forEach(function(ht){if(ht.oncontextmenu=function(){return!1},ht.src.indexOf(".m3u8")>-1&&!ht.canPlayType("application/vnd.apple.mpegurl")){if(K.a.isSupported()){var Bt=new K.a;Bt.loadSource(ht.src),Bt.attachMedia(ht)}}})};Object(S.useEffect)(function(){if(zt.current&&Xt&&(Xt.match(jt)&&window.PR.prettyPrint()),zt.current)return zt.current.addEventListener("click",$t),function(){zt.current.removeEventListener("click",$t),p(),T()}},[Xt,zt.current,$t]);var ei=function(pt){if(!F)return;pt.target.nodeName==="IMG"?(bt.current.style.zIndex=1,bt.current.style.display="flex",bt.current.style.width=pt.target.clientWidth+"px",bt.current.style.height=pt.target.clientHeight+"px",bt.current.style.top=pt.target.offsetTop+"px",bt.current.style.left=pt.target.offsetLeft+"px",Ct.current.src=pt.target.getAttribute("src")):bt.current.style.display="none"};return m.a.createElement("div",{style:{position:"relative"}},m.a.createElement("div",{ref:zt,style:Object(L.a)({},Ge),className:"".concat(D||""," markdown-body ").concat(Wt.a.mdBody),onMouseOver:ei,dangerouslySetInnerHTML:{__html:Xt}}),m.a.createElement("div",{ref:bt,className:Wt.a.button},m.a.createElement(H.a,null,m.a.createElement(j.a,{onClick:function(){return Pt()}},"\u88C1\u526A"),m.a.createElement(j.a,{onClick:function(){return Jt()}},"\u7F16\u8F91"))),m.a.createElement("img",{ref:Ct,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),m.a.createElement(ee.a,{close:!0,data:vt,type:vt!=null&&vt.length?Yt:"",style:Object(L.a)({},St),onClose:function(){return Ot("")}}))}},BU3w:function(et,We,J){"use strict";J.d(We,"a",function(){return A});var de=J("MNnm"),H="rc-util-key";function C(B){if(B.attachTo)return B.attachTo;var M=document.querySelector("head");return M||document.body}function j(B){var M,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(de.a)())return null;var S=document.createElement("style");if((M=w.csp)===null||M===void 0?void 0:M.nonce){var m;S.nonce=(m=w.csp)===null||m===void 0?void 0:m.nonce}S.innerHTML=B;var g=C(w),s=g.firstChild;return w.prepend&&g.prepend?g.prepend(S):w.prepend&&s?g.insertBefore(S,s):g.appendChild(S),S}var L=new Map;function A(B,M){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},S=C(w);if(!L.has(S)){var m=j("",w),g=m.parentNode;L.set(S,g),g.removeChild(m)}var s=Array.from(L.get(S).children).find(function(e){return e.tagName==="STYLE"&&e[H]===M});if(s){var a,i;if(((a=w.csp)===null||a===void 0?void 0:a.nonce)&&s.nonce!==((i=w.csp)===null||i===void 0?void 0:i.nonce)){var o;s.nonce=(o=w.csp)===null||o===void 0?void 0:o.nonce}return s.innerHTML!==B&&(s.innerHTML=B),s}var n=j(B,w);return n[H]=M,n}},DlQD:function(et,We,J){(function(de,H){et.exports=H()})(this,function(){"use strict";function de(se,te){for(var ae=0;aese.length)&&(te=se.length);for(var ae=0,G=new Array(te);ae=se.length?{done:!0}:{done:!1,value:se[G++]}}}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 ae=se[Symbol.iterator](),ae.next.bind(ae)}function A(se,te){return te={exports:{}},se(te,te.exports),te.exports}var B=A(function(se){function te(){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 ae(G){se.exports.defaults=G}se.exports={defaults:te(),getDefaults:te,changeDefaults:ae}}),M=B.defaults,w=B.getDefaults,S=B.changeDefaults,m=/[&<>"']/,g=/[&<>"']/g,s=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,i={"&":"&","<":"<",">":">",'"':""","'":"'"},o=function(te){return i[te]};function n(se,te){if(te){if(m.test(se))return se.replace(g,o)}else if(s.test(se))return se.replace(a,o);return se}var e=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function t(se){return se.replace(e,function(te,ae){return ae=ae.toLowerCase(),ae==="colon"?":":ae.charAt(0)==="#"?ae.charAt(1)==="x"?String.fromCharCode(parseInt(ae.substring(2),16)):String.fromCharCode(+ae.substring(1)):""})}var r=/(^|[^\[])\^/g;function T(se,te){se=se.source||se,te=te||"";var ae={replace:function(Y,Q){return Q=Q.source||Q,Q=Q.replace(r,"$1"),se=se.replace(Y,Q),ae},getRegex:function(){return new RegExp(se,te)}};return ae}var v=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function E(se,te,ae){if(se){var G;try{G=decodeURIComponent(t(ae)).replace(v,"").toLowerCase()}catch(Y){return null}if(G.indexOf("javascript:")===0||G.indexOf("vbscript:")===0||G.indexOf("data:")===0)return null}te&&!f.test(ae)&&(ae=d(te,ae));try{ae=encodeURI(ae).replace(/%25/g,"%")}catch(Y){return null}return ae}var y={},u=/^[^:]+:\/*[^/]*$/,l=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function d(se,te){y[" "+se]||(u.test(se)?y[" "+se]=se+"/":y[" "+se]=R(se,"/",!0)),se=y[" "+se];var ae=se.indexOf(":")===-1;return te.substring(0,2)==="//"?ae?te:se.replace(l,"$1")+te:te.charAt(0)==="/"?ae?te:se.replace(h,"$1")+te:se+te}var b={exec:function(){}};function p(se){for(var te=1,ae,G;te=0&&ce[ke]==="\\";)_e=!_e;return _e?"|":" |"}),G=ae.split(/ \|/),Y=0;if(G.length>te)G.splice(te);else for(;G.length=G.length?Y.slice(G.length):Y}).join(`
`)}var oe=function(){function se(ae){this.options=ae||W}var te=se.prototype;return te.space=function(G){var Y=this.rules.block.newline.exec(G);if(Y)return Y[0].length>1?{type:"space",raw:Y[0]}:{raw:`
`}},te.code=function(G,Y){var Q=this.rules.block.code.exec(G);if(Q){var q=Y[Y.length-1];if(q&&q.type==="paragraph")return{raw:Q[0],text:Q[0].trimRight()};var ce=Q[0].replace(/^ {4}/gm,"");return{type:"code",raw:Q[0],codeBlockStyle:"indented",text:this.options.pedantic?ce:P(ce,`
`)}}},te.fences=function(G){var Y=this.rules.block.fences.exec(G);if(Y){var Q=Y[0],q=le(Q,Y[3]||"");return{type:"code",raw:Q,lang:Y[2]?Y[2].trim():Y[2],text:q}}},te.heading=function(G){var Y=this.rules.block.heading.exec(G);if(Y)return{type:"heading",raw:Y[0],depth:Y[1].length,text:Y[2]}},te.nptable=function(G){var Y=this.rules.block.nptable.exec(G);if(Y){var Q={type:"table",header:K(Y[1].replace(/^ *| *\| *$/g,"")),align:Y[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Y[3]?Y[3].replace(/\n$/,"").split(`
`):[],raw:Y[0]};if(Q.header.length===Q.align.length){var q=Q.align.length,ce;for(ce=0;ce ?/gm,"");return{type:"blockquote",raw:Y[0],text:Q}}},te.list=function(G){var Y=this.rules.block.list.exec(G);if(Y){for(var Q=Y[0],q=Y[2],ce=q.length>1,_e=q[q.length-1]===")",ke={type:"list",raw:Q,ordered:ce,start:ce?+q.slice(0,-1):"",loose:!1,items:[]},Ke=Y[0].match(this.rules.block.item),Xe=!1,ze,qe,it,Ye,mt,at,yt,dt=Ke.length,tt=0;tt1||this.options.smartLists&&it!==q)&&(Ye=Ke.slice(tt+1).join(`
`),ke.raw=ke.raw.substring(0,ke.raw.length-Ye.length),tt=dt-1)),mt=Xe||/\n\n(?!\s*$)/.test(ze),tt!==dt-1&&(Xe=ze.charAt(ze.length-1)===`
`,mt||(mt=Xe)),mt&&(ke.loose=!0),at=/^\[[ xX]\] /.test(ze),yt=void 0,at&&(yt=ze[1]!==" ",ze=ze.replace(/^\[[ xX]\] +/,"")),ke.items.push({type:"list_item",raw:Q,task:at,checked:yt,loose:mt,text:ze});return ke}},te.html=function(G){var Y=this.rules.block.html.exec(G);if(Y)return{type:this.options.sanitize?"paragraph":"html",raw:Y[0],pre:!this.options.sanitizer&&(Y[1]==="pre"||Y[1]==="script"||Y[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Y[0]):V(Y[0]):Y[0]}},te.def=function(G){var Y=this.rules.block.def.exec(G);if(Y){Y[3]&&(Y[3]=Y[3].substring(1,Y[3].length-1));var Q=Y[1].toLowerCase().replace(/\s+/g," ");return{tag:Q,raw:Y[0],href:Y[2],title:Y[3]}}},te.table=function(G){var Y=this.rules.block.table.exec(G);if(Y){var Q={type:"table",header:K(Y[1].replace(/^ *| *\| *$/g,"")),align:Y[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Y[3]?Y[3].replace(/\n$/,"").split(`
`):[]};if(Q.header.length===Q.align.length){Q.raw=Y[0];var q=Q.align.length,ce;for(ce=0;ce/i.test(q[0])&&(Y=!1),!Q&&/^<(pre|code|kbd|script)(\s|>)/i.test(q[0])?Q=!0:Q&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(q[0])&&(Q=!1),{type:this.options.sanitize?"text":"html",raw:q[0],inLink:Y,inRawBlock:Q,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(q[0]):V(q[0]):q[0]}},te.link=function(G){var Y=this.rules.inline.link.exec(G);if(Y){var Q=re(Y[2],"()");if(Q>-1){var q=Y[0].indexOf("!")===0?5:4,ce=q+Y[1].length+Q;Y[2]=Y[2].substring(0,Q),Y[0]=Y[0].substring(0,ce).trim(),Y[3]=""}var _e=Y[2],ke="";if(this.options.pedantic){var Ke=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(_e);Ke?(_e=Ke[1],ke=Ke[3]):ke=""}else ke=Y[3]?Y[3].slice(1,-1):"";_e=_e.trim().replace(/^<([\s\S]*)>$/,"$1");var Xe=ee(Y,{href:_e&&_e.replace(this.rules.inline._escapes,"$1"),title:ke&&ke.replace(this.rules.inline._escapes,"$1")},Y[0]);return Xe}},te.reflink=function(G,Y){var Q;if((Q=this.rules.inline.reflink.exec(G))||(Q=this.rules.inline.nolink.exec(G))){var q=(Q[2]||Q[1]).replace(/\s+/g," ");if(q=Y[q.toLowerCase()],!q||!q.href){var ce=Q[0].charAt(0);return{type:"text",raw:ce,text:ce}}var _e=ee(Q,q,Q[0]);return _e}},te.strong=function(G,Y,Q){Q===void 0&&(Q="");var q=this.rules.inline.strong.start.exec(G);if(q&&(!q[1]||q[1]&&(Q===""||this.rules.inline.punctuation.exec(Q)))){Y=Y.slice(-1*G.length);var ce=q[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ce.lastIndex=0;for(var _e;(q=ce.exec(Y))!=null;)if(_e=this.rules.inline.strong.middle.exec(Y.slice(0,q.index+3)),_e)return{type:"strong",raw:G.slice(0,_e[0].length),text:G.slice(2,_e[0].length-2)}}},te.em=function(G,Y,Q){Q===void 0&&(Q="");var q=this.rules.inline.em.start.exec(G);if(q&&(!q[1]||q[1]&&(Q===""||this.rules.inline.punctuation.exec(Q)))){Y=Y.slice(-1*G.length);var ce=q[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ce.lastIndex=0;for(var _e;(q=ce.exec(Y))!=null;)if(_e=this.rules.inline.em.middle.exec(Y.slice(0,q.index+2)),_e)return{type:"em",raw:G.slice(0,_e[0].length),text:G.slice(1,_e[0].length-1)}}},te.codespan=function(G){var Y=this.rules.inline.code.exec(G);if(Y){var Q=Y[2].replace(/\n/g," "),q=/[^ ]/.test(Q),ce=Q.startsWith(" ")&&Q.endsWith(" ");return q&&ce&&(Q=Q.substring(1,Q.length-1)),Q=V(Q,!0),{type:"codespan",raw:Y[0],text:Q}}},te.br=function(G){var Y=this.rules.inline.br.exec(G);if(Y)return{type:"br",raw:Y[0]}},te.del=function(G){var Y=this.rules.inline.del.exec(G);if(Y)return{type:"del",raw:Y[0],text:Y[1]}},te.autolink=function(G,Y){var Q=this.rules.inline.autolink.exec(G);if(Q){var q,ce;return Q[2]==="@"?(q=V(this.options.mangle?Y(Q[1]):Q[1]),ce="mailto:"+q):(q=V(Q[1]),ce=q),{type:"link",raw:Q[0],text:q,href:ce,tokens:[{type:"text",raw:q,text:q}]}}},te.url=function(G,Y){var Q;if(Q=this.rules.inline.url.exec(G)){var q,ce;if(Q[2]==="@")q=V(this.options.mangle?Y(Q[0]):Q[0]),ce="mailto:"+q;else{var _e;do _e=Q[0],Q[0]=this.rules.inline._backpedal.exec(Q[0])[0];while(_e!==Q[0]);q=V(Q[0]),Q[1]==="www."?ce="http://"+q:ce=q}return{type:"link",raw:Q[0],text:q,href:ce,tokens:[{type:"text",raw:q,text:q}]}}},te.inlineText=function(G,Y,Q){var q=this.rules.inline.text.exec(G);if(q){var ce;return Y?ce=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(q[0]):V(q[0]):q[0]:ce=V(this.options.smartypants?Q(q[0]):q[0]),{type:"text",raw:q[0],text:ce}}},se}(),$=U.noopTest,Z=U.edit,ne=U.merge,X={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:$,table:$,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};X._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,X._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,X.def=Z(X.def).replace("label",X._label).replace("title",X._title).getRegex(),X.bullet=/(?:[*+-]|\d{1,9}[.)])/,X.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,X.item=Z(X.item,"gm").replace(/bull/g,X.bullet).getRegex(),X.list=Z(X.list).replace(/bull/g,X.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+X.def.source+")").getRegex(),X._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",X._comment=//,X.html=Z(X.html,"i").replace("comment",X._comment).replace("tag",X._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),X.paragraph=Z(X._paragraph).replace("hr",X.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",X._tag).getRegex(),X.blockquote=Z(X.blockquote).replace("paragraph",X.paragraph).getRegex(),X.normal=ne({},X),X.gfm=ne({},X.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*|$)"}),X.gfm.nptable=Z(X.gfm.nptable).replace("hr",X.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",X._tag).getRegex(),X.gfm.table=Z(X.gfm.table).replace("hr",X.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",X._tag).getRegex(),X.pedantic=ne({},X.normal,{html:Z(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",X._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:$,paragraph:Z(X.normal._paragraph).replace("hr",X.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",X.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:$,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:$,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",z.punctuation=Z(z.punctuation).replace(/punctuation/g,z._punctuation).getRegex(),z._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",z._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",z.em.start=Z(z.em.start).replace(/punctuation/g,z._punctuation).getRegex(),z.em.middle=Z(z.em.middle).replace(/punctuation/g,z._punctuation).replace(/overlapSkip/g,z._overlapSkip).getRegex(),z.em.endAst=Z(z.em.endAst,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.em.endUnd=Z(z.em.endUnd,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.strong.start=Z(z.strong.start).replace(/punctuation/g,z._punctuation).getRegex(),z.strong.middle=Z(z.strong.middle).replace(/punctuation/g,z._punctuation).replace(/blockSkip/g,z._blockSkip).getRegex(),z.strong.endAst=Z(z.strong.endAst,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.strong.endUnd=Z(z.strong.endUnd,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.blockSkip=Z(z._blockSkip,"g").getRegex(),z.overlapSkip=Z(z._overlapSkip,"g").getRegex(),z._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,z._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,z._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])?)+(?![-_])/,z.autolink=Z(z.autolink).replace("scheme",z._scheme).replace("email",z._email).getRegex(),z._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,z.tag=Z(z.tag).replace("comment",X._comment).replace("attribute",z._attribute).getRegex(),z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,z._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,z.link=Z(z.link).replace("label",z._label).replace("href",z._href).replace("title",z._title).getRegex(),z.reflink=Z(z.reflink).replace("label",z._label).getRegex(),z.reflinkSearch=Z(z.reflinkSearch,"g").replace("reflink",z.reflink).replace("nolink",z.nolink).getRegex(),z.normal=ne({},z),z.pedantic=ne({},z.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:Z(/^!?\[(label)\]\((.*?)\)/).replace("label",z._label).getRegex(),reflink:Z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",z._label).getRegex()}),z.gfm=ne({},z.normal,{escape:Z(z.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&&(G="x"+G.toString(16)),te+=""+G+";";return te}var ge=function(){function se(ae){this.tokens=[],this.tokens.links=Object.create(null),this.options=ae||Se,this.options.tokenizer=this.options.tokenizer||new oe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var G={block:Oe.normal,inline:Ae.normal};this.options.pedantic?(G.block=Oe.pedantic,G.inline=Ae.pedantic):this.options.gfm&&(G.block=Oe.gfm,this.options.breaks?G.inline=Ae.breaks:G.inline=Ae.gfm),this.tokenizer.rules=G}se.lex=function(G,Y){var Q=new se(Y);return Q.lex(G)};var te=se.prototype;return te.lex=function(G){return G=G.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(G,this.tokens,!0),this.inline(this.tokens),this.tokens},te.blockTokens=function(G,Y,Q){Y===void 0&&(Y=[]),Q===void 0&&(Q=!0),G=G.replace(/^ +$/gm,"");for(var q,ce,_e,ke;G;){if(q=this.tokenizer.space(G)){G=G.substring(q.raw.length),q.type&&Y.push(q);continue}if(q=this.tokenizer.code(G,Y)){G=G.substring(q.raw.length),q.type?Y.push(q):(ke=Y[Y.length-1],ke.raw+=`
`+q.raw,ke.text+=`
`+q.text);continue}if(q=this.tokenizer.fences(G)){G=G.substring(q.raw.length),Y.push(q);continue}if(q=this.tokenizer.heading(G)){G=G.substring(q.raw.length),Y.push(q);continue}if(q=this.tokenizer.nptable(G)){G=G.substring(q.raw.length),Y.push(q);continue}if(q=this.tokenizer.hr(G)){G=G.substring(q.raw.length),Y.push(q);continue}if(q=this.tokenizer.blockquote(G)){G=G.substring(q.raw.length),q.tokens=this.blockTokens(q.text,[],Q),Y.push(q);continue}if(q=this.tokenizer.list(G)){for(G=G.substring(q.raw.length),_e=q.items.length,ce=0;ce<_e;ce++)q.items[ce].tokens=this.blockTokens(q.items[ce].text,[],!1);Y.push(q);continue}if(q=this.tokenizer.html(G)){G=G.substring(q.raw.length),Y.push(q);continue}if(Q&&(q=this.tokenizer.def(G))){G=G.substring(q.raw.length),this.tokens.links[q.tag]||(this.tokens.links[q.tag]={href:q.href,title:q.title});continue}if(q=this.tokenizer.table(G)){G=G.substring(q.raw.length),Y.push(q);continue}if(q=this.tokenizer.lheading(G)){G=G.substring(q.raw.length),Y.push(q);continue}if(Q&&(q=this.tokenizer.paragraph(G))){G=G.substring(q.raw.length),Y.push(q);continue}if(q=this.tokenizer.text(G,Y)){G=G.substring(q.raw.length),q.type?Y.push(q):(ke=Y[Y.length-1],ke.raw+=`
`+q.raw,ke.text+=`
`+q.text);continue}if(G){var Ke="Infinite loop on byte: "+G.charCodeAt(0);if(this.options.silent){console.error(Ke);break}else throw new Error(Ke)}}return Y},te.inline=function(G){var Y,Q,q,ce,_e,ke,Ke=G.length;for(Y=0;Y0)for(;(Ke=this.tokenizer.rules.inline.reflinkSearch.exec(ke))!=null;)Xe.includes(Ke[0].slice(Ke[0].lastIndexOf("[")+1,-1))&&(ke=ke.slice(0,Ke.index)+"["+"a".repeat(Ke[0].length-2)+"]"+ke.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ke=this.tokenizer.rules.inline.blockSkip.exec(ke))!=null;)ke=ke.slice(0,Ke.index)+"["+"a".repeat(Ke[0].length-2)+"]"+ke.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;G;){if(_e=this.tokenizer.escape(G)){G=G.substring(_e.raw.length),Y.push(_e);continue}if(_e=this.tokenizer.tag(G,Q,q)){G=G.substring(_e.raw.length),Q=_e.inLink,q=_e.inRawBlock,Y.push(_e);continue}if(_e=this.tokenizer.link(G)){G=G.substring(_e.raw.length),_e.type==="link"&&(_e.tokens=this.inlineTokens(_e.text,[],!0,q)),Y.push(_e);continue}if(_e=this.tokenizer.reflink(G,this.tokens.links)){G=G.substring(_e.raw.length),_e.type==="link"&&(_e.tokens=this.inlineTokens(_e.text,[],!0,q)),Y.push(_e);continue}if(_e=this.tokenizer.strong(G,ke,ce)){G=G.substring(_e.raw.length),_e.tokens=this.inlineTokens(_e.text,[],Q,q),Y.push(_e);continue}if(_e=this.tokenizer.em(G,ke,ce)){G=G.substring(_e.raw.length),_e.tokens=this.inlineTokens(_e.text,[],Q,q),Y.push(_e);continue}if(_e=this.tokenizer.codespan(G)){G=G.substring(_e.raw.length),Y.push(_e);continue}if(_e=this.tokenizer.br(G)){G=G.substring(_e.raw.length),Y.push(_e);continue}if(_e=this.tokenizer.del(G)){G=G.substring(_e.raw.length),_e.tokens=this.inlineTokens(_e.text,[],Q,q),Y.push(_e);continue}if(_e=this.tokenizer.autolink(G,me)){G=G.substring(_e.raw.length),Y.push(_e);continue}if(!Q&&(_e=this.tokenizer.url(G,me))){G=G.substring(_e.raw.length),Y.push(_e);continue}if(_e=this.tokenizer.inlineText(G,q,Pe)){G=G.substring(_e.raw.length),ce=_e.raw.slice(-1),Y.push(_e);continue}if(G){var ze="Infinite loop on byte: "+G.charCodeAt(0);if(this.options.silent){console.error(ze);break}else throw new Error(ze)}}return Y},H(se,null,[{key:"rules",get:function(){return{block:Oe,inline:Ae}}}]),se}(),be=B.defaults,Ee=U.cleanUrl,Ie=U.escape,Me=function(){function se(ae){this.options=ae||be}var te=se.prototype;return te.code=function(G,Y,Q){var q=(Y||"").match(/\S*/)[0];if(this.options.highlight){var ce=this.options.highlight(G,q);ce!=null&&ce!==G&&(Q=!0,G=ce)}return q?''+(Q?G:Ie(G,!0))+`
`:""+(Q?G:Ie(G,!0))+`
`},te.blockquote=function(G){return`
`+G+`
`},te.html=function(G){return G},te.heading=function(G,Y,Q,q){return this.options.headerIds?"
`:""+G+"
`},te.hr=function(){return this.options.xhtml?`
`:`
`},te.list=function(G,Y,Q){var q=Y?"ol":"ul",ce=Y&&Q!==1?' start="'+Q+'"':"";return"<"+q+ce+`>
`+G+""+q+`>
`},te.listitem=function(G){return""+G+`
`},te.checkbox=function(G){return" "},te.paragraph=function(G){return""+G+`
`},te.table=function(G,Y){return Y&&(Y=""+Y+""),`
`},te.tablerow=function(G){return`
`+G+`
`},te.tablecell=function(G,Y){var Q=Y.header?"th":"td",q=Y.align?"<"+Q+' align="'+Y.align+'">':"<"+Q+">";return q+G+""+Q+`>
`},te.strong=function(G){return""+G+""},te.em=function(G){return""+G+""},te.codespan=function(G){return""+G+""},te.br=function(){return this.options.xhtml?"
":"
"},te.del=function(G){return""+G+""},te.link=function(G,Y,Q){if(G=Ee(this.options.sanitize,this.options.baseUrl,G),G===null)return Q;var q='"+Q+"",q},te.image=function(G,Y,Q){if(G=Ee(this.options.sanitize,this.options.baseUrl,G),G===null)return Q;var q='
":">",q},te.text=function(G){return G},se}(),De=function(){function se(){}var te=se.prototype;return te.strong=function(G){return G},te.em=function(G){return G},te.codespan=function(G){return G},te.del=function(G){return G},te.html=function(G){return G},te.text=function(G){return G},te.link=function(G,Y,Q){return""+Q},te.image=function(G,Y,Q){return""+Q},te.br=function(){return""},se}(),Fe=function(){function se(){this.seen={}}var te=se.prototype;return te.slug=function(G){var Y=G.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Y)){var Q=Y;do this.seen[Q]++,Y=Q+"-"+this.seen[Q];while(this.seen.hasOwnProperty(Y))}return this.seen[Y]=0,Y},se}(),ue=B.defaults,pe=U.unescape,ye=function(){function se(ae){this.options=ae||ue,this.options.renderer=this.options.renderer||new Me,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new De,this.slugger=new Fe}se.parse=function(G,Y){var Q=new se(Y);return Q.parse(G)};var te=se.prototype;return te.parse=function(G,Y){Y===void 0&&(Y=!0);var Q="",q,ce,_e,ke,Ke,Xe,ze,qe,it,Ye,mt,at,yt,dt,tt,_t,Et,Be,$e=G.length;for(q=0;q<$e;q++){Ye=G[q];switch(Ye.type){case"space":continue;case"hr":{Q+=this.renderer.hr();continue}case"heading":{Q+=this.renderer.heading(this.parseInline(Ye.tokens),Ye.depth,pe(this.parseInline(Ye.tokens,this.textRenderer)),this.slugger);continue}case"code":{Q+=this.renderer.code(Ye.text,Ye.lang,Ye.escaped);continue}case"table":{for(qe="",ze="",ke=Ye.header.length,ce=0;ce0&&tt.tokens[0].type==="text"?(tt.tokens[0].text=Be+" "+tt.tokens[0].text,tt.tokens[0].tokens&&tt.tokens[0].tokens.length>0&&tt.tokens[0].tokens[0].type==="text"&&(tt.tokens[0].tokens[0].text=Be+" "+tt.tokens[0].tokens[0].text)):tt.tokens.unshift({type:"text",text:Be}):dt+=Be),dt+=this.parse(tt.tokens,yt),it+=this.renderer.listitem(dt,Et,_t);Q+=this.renderer.list(it,mt,at);continue}case"html":{Q+=this.renderer.html(Ye.text);continue}case"paragraph":{Q+=this.renderer.paragraph(this.parseInline(Ye.tokens));continue}case"text":{for(it=Ye.tokens?this.parseInline(Ye.tokens):Ye.text;q+1<$e&&G[q+1].type==="text";)Ye=G[++q],it+=`
`+(Ye.tokens?this.parseInline(Ye.tokens):Ye.text);Q+=Y?this.renderer.paragraph(it):it;continue}default:{var Qe='Token with "'+Ye.type+'" type was not found.';if(this.options.silent){console.error(Qe);return}else throw new Error(Qe)}}}return Q},te.parseInline=function(G,Y){Y=Y||this.renderer;var Q="",q,ce,_e=G.length;for(q=0;q<_e;q++){ce=G[q];switch(ce.type){case"escape":{Q+=Y.text(ce.text);break}case"html":{Q+=Y.html(ce.text);break}case"link":{Q+=Y.link(ce.href,ce.title,this.parseInline(ce.tokens,Y));break}case"image":{Q+=Y.image(ce.href,ce.title,ce.text);break}case"strong":{Q+=Y.strong(this.parseInline(ce.tokens,Y));break}case"em":{Q+=Y.em(this.parseInline(ce.tokens,Y));break}case"codespan":{Q+=Y.codespan(ce.text);break}case"br":{Q+=Y.br();break}case"del":{Q+=Y.del(this.parseInline(ce.tokens,Y));break}case"text":{Q+=Y.text(ce.text);break}default:{var ke='Token with "'+ce.type+'" type was not found.';if(this.options.silent){console.error(ke);return}else throw new Error(ke)}}}return Q},se}(),Te=U.merge,we=U.checkSanitizeDeprecation,xe=U.escape,ve=B.getDefaults,Ne=B.changeDefaults,Ue=B.defaults;function he(se,te,ae){if(typeof se=="undefined"||se===null)throw new Error("marked(): input parameter is undefined or null");if(typeof se!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(se)+", string expected");if(typeof te=="function"&&(ae=te,te=null),te=Te({},he.defaults,te||{}),we(te),ae){var G=te.highlight,Y;try{Y=ge.lex(se,te)}catch(_e){return ae(_e)}var Q=function(ke){var Ke;if(!ke)try{Ke=ye.parse(Y,te)}catch(Xe){ke=Xe}return te.highlight=G,ke?ae(ke):ae(null,Ke)};if(!G||G.length<3)return Q();if(delete te.highlight,!Y.length)return Q();var q=0;he.walkTokens(Y,function(_e){_e.type==="code"&&(q++,setTimeout(function(){G(_e.text,_e.lang,function(ke,Ke){if(ke)return Q(ke);Ke!=null&&Ke!==_e.text&&(_e.text=Ke,_e.escaped=!0),q--,q===0&&Q()})},0))}),q===0&&Q();return}try{var ce=ge.lex(se,te);return te.walkTokens&&he.walkTokens(ce,te.walkTokens),ye.parse(ce,te)}catch(_e){if(_e.message+=`
Please report this to https://github.com/markedjs/marked.`,te.silent)return"An error occurred:
"+xe(_e.message+"",!0)+"
";throw _e}}he.options=he.setOptions=function(se){return Te(he.defaults,se),Ne(he.defaults),he},he.getDefaults=ve,he.defaults=Ue,he.use=function(se){var te=Te({},se);if(se.renderer&&function(){var G=he.defaults.renderer||new Me,Y=function(ce){var _e=G[ce];G[ce]=function(){for(var ke=arguments.length,Ke=new Array(ke),Xe=0;Xe3:Ze.key!=4}))},ft=function ot(rt){return rt.map(function(Ze){var ut=Ze.title.indexOf(G),ct=Ze.title.substr(0,ut),st=Ze.title.substr(ut+G.length),lt=e.a.createElement("span",null,ct,e.a.createElement("span",{className:"c-blue"},G),st,Object(v.o)()&&e.a.createElement(u.a,{placement:"right",title:G,content:function(){return Je(Ze)},trigger:"hover"},e.a.createElement("span",{className:"iconfont icon-sandian ".concat(z.a.actions)})));if(G!==""){var gt;if(ut===-1&&!((gt=Ze.children)!==null&>!==void 0&>.length))return null}return Ze.children&&Ze.file_type===1?Object(w.a)(Object(w.a)({},Ze),{},{title:lt,key:Ze.key,children:ot(Ze.children)}):Object(w.a)(Object(w.a)({},Ze),{},{title:lt,key:Ze.key,isLeaf:!0})}).filter(function(Ze){return!!Ze})},Tt=function ot(rt,Ze){for(var ut,ct=0;ct-1}))!==null&&st!==void 0&&st.length?ct.id:null}return null});Y(Ze),dt(!0),console.log("expandedKeys:",ut),Xe(ut)};return console.log("loop(treeData):",ft(Et)),e.a.createElement("div",{className:z.a.tree},e.a.createElement(fe,{style:{marginBottom:8},placeholder:"\u8F93\u5165\u5173\u952E\u5B57\u68C0\u7D22",onChange:Rt}),e.a.createElement(Se,{multiple:!0,defaultExpandAll:!0,onSelect:$e,onExpand:Qe,expandedKeys:Ke,selectedKeys:it,autoExpandParent:yt,treeData:ft(Et)}),e.a.createElement(le,null),e.a.createElement(Z,null))},Ae=Object(r.a)(function(ge){var be=ge.user,Ee=ge.loading,Ie=ge.globalSetting,Me=ge.restful;return{user:be,globalSetting:Ie,restful:Me,loading:Ee.models.index}})(Oe),Pe=function(be){var Ee,Ie,Me=be.user,De=be.globalSetting,Fe=be.loading,ue=be.dispatch,pe=be.restful,ye=Object(a.a)(be,["user","globalSetting","loading","dispatch","restful"]),Te=Object(n.useState)({content:"",message:"",status:0,contacts:[],address:"",data:[]}),we=Object(s.a)(Te,2),xe=we[0],ve=we[1],Ne=Object(n.useState)(!0),Ue=Object(s.a)(Ne,2),he=Ue[0],Le=Ue[1],se=g.a.useForm(),te=Object(s.a)(se,1),ae=te[0],G=ye.match.params,Y=function(){var ce=Object(S.a)(o.a.mark(function _e(){return o.a.wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:ue({type:"restful/getRestful"}),G.id&&ue({type:"restful/getRestfulDetail",payload:Object(w.a)({},G)});case 2:case"end":return Ke.stop()}},_e)}));return function(){return ce.apply(this,arguments)}}();Object(n.useEffect)(function(){Le(!0),Y()},[G.id]);var Q=function(){ue({type:"restful/setActionTabs",payload:{key:"\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"}})},q=function(){var _e;if((_e=pe.restful)!==null&&_e!==void 0&&_e.data){var ke,Ke,Xe=0;return(ke=pe.restful)===null||ke===void 0||((Ke=ke.data)===null||Ke===void 0)||Ke.map(function(ze){var qe;ze==null||((qe=ze.children)===null||qe===void 0)||qe.map(function(it){it.id==ye.match.params.id&&(Xe=ze.id)}),!ze.children&&!Xe&&(Xe=ze.id)}),Xe}return 0};return e.a.createElement("section",null,e.a.createElement("aside",{className:"edu-container mt20"},e.a.createElement(M.a,null,e.a.createElement(M.a.Item,null,e.a.createElement(t.a,{to:"/"},"\u9996\u9875")),e.a.createElement(M.a.Item,null,e.a.createElement(t.a,{to:"/ch/rest"},"API\u6587\u6863"))),e.a.createElement("div",{className:"mt20"},e.a.createElement(j.a,{gutter:[20,20]},e.a.createElement(A.a,{flex:"300px"},e.a.createElement(Ae,ye)),e.a.createElement(A.a,{flex:"1"},e.a.createElement("div",{className:E.a.info},e.a.createElement("h1",{style:{fontSize:28,paddingBottom:15,borderBottom:"1px solid #eaeaea",textAlign:"center"}},(Ee=pe.restfulDetail)===null||Ee===void 0?void 0:Ee.name),e.a.createElement(T.a,{value:(Ie=pe.restfulDetail)===null||Ie===void 0?void 0:Ie.description}))))),Object(v.o)()&&e.a.createElement("div",{className:E.a.bar},e.a.createElement(j.a,null,!!q()&&e.a.createElement(A.a,null,e.a.createElement(H.a,{title:"\u7F16\u8F91\u6587\u4EF6"},e.a.createElement(t.a,{to:"/ch/rest/edit/".concat(q(),"/").concat(ye.match.params.id),className:"icon-zhongmingming current"}))),e.a.createElement(A.a,null,e.a.createElement(H.a,{title:"\u6DFB\u52A0\u6587\u4EF6"},e.a.createElement(t.a,{to:"/ch/rest/edit/".concat(q(),"/0"),className:"icon-tianjiatimu current"}))),e.a.createElement(A.a,null,e.a.createElement(H.a,{title:"\u65B0\u5EFA\u6587\u4EF6\u5939"},e.a.createElement("span",{className:"icon-wenjianjia1 current",onClick:Q})))))))},me=We.default=Object(r.a)(function(ge){var be=ge.user,Ee=ge.loading,Ie=ge.globalSetting,Me=ge.restful;return{user:be,globalSetting:Ie,restful:Me,loading:Ee.models.index}})(Pe)},NvD2:function(et,We,J){"use strict";J.d(We,"a",function(){return A});var de=J("Kwbf");function H(B,M){var w=new Set;return B.forEach(function(S){M.has(S)||w.add(S)}),w}function C(B){var M=B||{},w=M.disabled,S=M.disableCheckbox,m=M.checkable;return!!(w||S)||m===!1}function j(B,M,w,S){for(var m=new Set(B),g=new Set,s=0;s<=w;s+=1){var a=M.get(s)||new Set;a.forEach(function(e){var t=e.key,r=e.node,T=e.children,v=T===void 0?[]:T;m.has(t)&&!S(r)&&v.filter(function(f){return!S(f.node)}).forEach(function(f){m.add(f.key)})})}for(var i=new Set,o=w;o>=0;o-=1){var n=M.get(o)||new Set;n.forEach(function(e){var t=e.parent,r=e.node;if(S(r)||!e.parent||i.has(e.parent.key))return;if(S(e.parent.node)){i.add(t.key);return}var T=!0,v=!1;(t.children||[]).filter(function(f){return!S(f.node)}).forEach(function(f){var E=f.key,y=m.has(E);T&&!y&&(T=!1),!v&&(y||g.has(E))&&(v=!0)}),T&&m.add(t.key),v&&g.add(t.key),i.add(t.key)})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(H(g,m))}}function L(B,M,w,S,m){for(var g=new Set(B),s=new Set(M),a=0;a<=S;a+=1){var i=w.get(a)||new Set;i.forEach(function(t){var r=t.key,T=t.node,v=t.children,f=v===void 0?[]:v;!g.has(r)&&!s.has(r)&&!m(T)&&f.filter(function(E){return!m(E.node)}).forEach(function(E){g.delete(E.key)})})}s=new Set;for(var o=new Set,n=S;n>=0;n-=1){var e=w.get(n)||new Set;e.forEach(function(t){var r=t.parent,T=t.node;if(m(T)||!t.parent||o.has(t.parent.key))return;if(m(t.parent.node)){o.add(r.key);return}var v=!0,f=!1;(r.children||[]).filter(function(E){return!m(E.node)}).forEach(function(E){var y=E.key,u=g.has(y);v&&!u&&(v=!1),!f&&(u||s.has(y))&&(f=!0)}),v||g.delete(r.key),f&&s.add(r.key),o.add(r.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(H(s,g))}}function A(B,M,w,S){var m=[],g;S?g=S:g=C;var s=new Set(B.filter(function(n){var e=!!w[n];return e||m.push(n),e})),a=new Map,i=0;Object.keys(w).forEach(function(n){var e=w[n],t=e.level,r=a.get(t);r||(r=new Set,a.set(t,r)),r.add(e),i=Math.max(i,t)}),Object(de.a)(!m.length,"Tree missing follow keys: ".concat(m.slice(0,100).map(function(n){return"'".concat(n,"'")}).join(", ")));var o;return M===!0?o=j(s,a,i,g):o=L(s,M.halfCheckedKeys,a,i,g),o}},OZM5:function(et,We,J){"use strict";J.d(We,"b",function(){return S}),J.d(We,"a",function(){return m}),J.d(We,"k",function(){return g}),J.d(We,"h",function(){return s}),J.d(We,"i",function(){return a}),J.d(We,"g",function(){return i}),J.d(We,"c",function(){return o}),J.d(We,"d",function(){return n}),J.d(We,"j",function(){return r}),J.d(We,"e",function(){return T}),J.d(We,"f",function(){return v});var de=J("KQm4"),H=J("U8pU"),C=J("Ff2n"),j=J("q1tI"),L=J.n(j),A=J("Kwbf"),B=J("WaYH"),M=.25,w=2;function S(f,E){var y=f.slice(),u=y.indexOf(E);return u>=0&&y.splice(u,1),y}function m(f,E){var y=f.slice();return y.indexOf(E)===-1&&y.push(E),y}function g(f){return f.split("-")}function s(f,E){return"".concat(f,"-").concat(E)}function a(f){return f&&f.type&&f.type.isTreeNode}function i(f,E){var y=[f],u=E[f];function l(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];h.forEach(function(d){var b=d.key,p=d.children;y.push(b),l(p)})}return l(u.children),y}function o(f,E){var y=f.clientY,u=E.selectHandle.getBoundingClientRect(),l=u.top,h=u.bottom,d=u.height,b=Math.max(d*M,w);return y<=l+b?-1:y>=h-b?1:0}function n(f,E){if(!f)return;var y=E.multiple;return y?f.slice():f.length?[f[0]]:f}var e=function(E){return E};function t(f,E){if(!f)return[];var y=E||{},u=y.processProps,l=u===void 0?e:u,h=Array.isArray(f)?f:[f];return h.map(function(d){var b=d.children,p=Object(C.a)(d,["children"]),x=t(b,E);return L.a.createElement(B.a,Object.assign({},l(p)),x)})}function r(f){if(!f)return null;var E;if(Array.isArray(f))E={checkedKeys:f,halfCheckedKeys:void 0};else if(Object(H.a)(f)==="object")E={checkedKeys:f.checked||void 0,halfCheckedKeys:f.halfChecked||void 0};else return Object(A.a)(!1,"`checkedKeys` is not an array or an object"),null;return E}function T(f,E){var y=new Set;function u(l){if(y.has(l))return;var h=E[l];if(!h)return;y.add(l);var d=h.parent,b=h.node;if(b.disabled)return;d&&u(d.key)}return(f||[]).forEach(function(l){u(l)}),Object(de.a)(y)}function v(f){var E={};return Object.keys(f).forEach(function(y){(y.startsWith("data-")||y.startsWith("aria-"))&&(E[y]=f[y])}),E}},P48q:function(et,We,J){et.exports={flex_box_center:"flex_box_center___BHtvi",flex_space_between:"flex_space_between___1noDr",flex_box_vertical_center:"flex_box_vertical_center___2UDAc",flex_box_center_end:"flex_box_center_end___2j8--",flex_box_column:"flex_box_column___3X60k",tree:"tree___2kCYs",actions:"actions___10Q_6"}},SJMd:function(et,We){/**
* @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 J,de,H,C=!1,j,L;window.PR_SHOULD_USE_CONTINUATION=!0;var A,B;(function(){var M=window,w=["break,continue,do,else,for,if,return,while"],S=[w,"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=[S,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],g=[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"],s=[m,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],a=[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"],i="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",o=[m,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],n="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",e=[w,"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"],t=[w,"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"],r=[w,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],T=[g,a,s,o,n,e,t,r],v=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,f="str",E="kwd",y="com",u="typ",l="lit",h="pun",d="pln",b="tag",p="dec",x="src",R="atn",O="atv",N="nocode",U="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function W(me){for(var ge=0,be=!1,Ee=!1,Ie=0,Me=me.length;Ie122||(G<65||ae>90||Ne.push([Math.max(65,ae)|32,Math.min(G,90)|32]),G<97||ae>122||Ne.push([Math.max(97,ae)&~32,Math.min(G,122)&~32]))}}Ne.sort(function(ce,_e){return ce[0]-_e[0]||_e[1]-ce[1]});for(var Y=[],Q=[],Le=0;Leq[0]&&(q[1]+1>q[0]&&he.push("-"),he.push(pe(q[1])))}return he.push("]"),he.join("")}function Te(xe){for(var ve=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")),Ne=ve.length,Ue=[],he=0,Le=0;he=2&&ae==="["?ve[he]=ye(se):ae!=="\\"&&(ve[he]=se.replace(/[a-zA-Z]/g,function(Q){var q=Q.charCodeAt(0);return"["+String.fromCharCode(q&~32,q|32)+"]"}))}return ve.join("")}for(var we=[],Ie=0,Me=me.length;Ie=0;)be[we.charAt(xe)]=Te;var ve=Te[1],Ne=""+ve;ue.hasOwnProperty(Ne)||(Fe.push(ve),ue[Ne]=null)}Fe.push(/[\0-\uffff]/),Ee=W(Fe)})();var Ie=ge.length,Me=function(De){for(var Fe=De.sourceCode,ue=De.basePos,pe=De.sourceNode,ye=[ue,d],Te=0,we=Fe.match(Ee)||[],xe={},ve=0,Ne=we.length;ve=5&&he.substring(0,5)==="lang-",se&&!(Le&&typeof Le[1]=="string")&&(se=!1,he=x),se||(xe[Ue]=he)}var G=Te;if(Te+=Ue.length,!se)ye.push(ue+G,he);else{var Y=Le[1],Q=Ue.indexOf(Y),q=Q+Y.length;Le[2]&&(q=Ue.length-Le[2].length,Q=q-Y.length);var ce=he.substring(5);K(pe,ue+G,Ue.substring(0,Q),Me,ye),K(pe,ue+G+Q,Y,z(ce,Y),ye),K(pe,ue+G+q,Ue.substring(q),Me,ye)}}De.decorations=ye};return Me}function le(me){var ge=[],be=[];me.tripleQuotedStrings?ge.push([f,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):me.multiLineStrings?ge.push([f,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):ge.push([f,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),me.verbatimStrings&&be.push([f,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ee=me.hashComments;Ee&&(me.cStyleComments?(Ee>1?ge.push([y,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):ge.push([y,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),be.push([f,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):ge.push([y,/^#[^\r\n]*/,null,"#"])),me.cStyleComments&&(be.push([y,/^\/\/[^\r\n]*/,null]),be.push([y,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ie=me.regexLiterals;if(Ie){var Me=Ie>1?"":`
\r`,De=Me?".":"[\\S\\s]",Fe="/(?=[^/*"+Me+"])(?:[^/\\x5B\\x5C"+Me+"]|\\x5C"+De+"|\\x5B(?:[^\\x5C\\x5D"+Me+"]|\\x5C"+De+")*(?:\\x5D|$))+/";be.push(["lang-regex",RegExp("^"+U+"("+Fe+")")])}var ue=me.types;ue&&be.push([u,ue]);var pe=(""+me.keywords).replace(/^ | $/g,"");pe.length&&be.push([E,new RegExp("^(?:"+pe.replace(/[\s,]+/g,"|")+")\\b"),null]),ge.push([d,/^\s+/,null,` \r
\xA0`]);var ye="^.[^\\s\\w.$@'\"`/\\\\]*";return me.regexLiterals&&(ye+="(?!s*/)"),be.push([l,/^@[a-z_$][a-z_$@0-9]*/i,null],[u,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[d,/^[a-z_$][a-z_$@0-9]*/i,null],[l,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[d,/^\\[\s\S]?/,null],[h,new RegExp(ye),null]),ee(ge,be)}var oe=le({keywords:T,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function $(me,ge,be){for(var Ee=/(?:^|\s)nocode(?:\s|$)/,Ie=/\r\n?|\n/,Me=me.ownerDocument,De=Me.createElement("li");me.firstChild;)De.appendChild(me.firstChild);var Fe=[De];function ue(ve){var Ne=ve.nodeType;if(Ne==1&&!Ee.test(ve.className))if(ve.nodeName==="br")pe(ve),ve.parentNode&&ve.parentNode.removeChild(ve);else for(var Ue=ve.firstChild;Ue;Ue=Ue.nextSibling)ue(Ue);else if((Ne==3||Ne==4)&&be){var he=ve.nodeValue,Le=he.match(Ie);if(Le){var se=he.substring(0,Le.index);ve.nodeValue=se;var te=he.substring(Le.index+Le[0].length);if(te){var ae=ve.parentNode;ae.insertBefore(Me.createTextNode(te),ve.nextSibling)}pe(ve),se||ve.parentNode.removeChild(ve)}}}function pe(ve){for(;!ve.nextSibling;)if(ve=ve.parentNode,!ve)return;function Ne(Le,se){var te=se?Le.cloneNode(!1):Le,ae=Le.parentNode;if(ae){var G=Ne(ae,1),Y=Le.nextSibling;G.appendChild(te);for(var Q=Y;Q;Q=Y)Y=Q.nextSibling,G.appendChild(Q)}return te}for(var Ue=Ne(ve.nextSibling,0),he;(he=Ue.parentNode)&&he.nodeType===1;)Ue=he;Fe.push(Ue)}for(var ye=0;ye=ae&&(ue+=2),Me>=G&&(Te+=2)}}finally{he&&(he.style.display=Le)}}var ne={};function X(me,ge){for(var be=ge.length;--be>=0;){var Ee=ge[be];ne.hasOwnProperty(Ee)?M.console&&console.warn("cannot override language handler %s",Ee):ne[Ee]=me}}function z(me,ge){return me&&ne.hasOwnProperty(me)||(me=/^\s*]*(?:>|$)/],[y,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[h,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^