(window.webpackJsonp=window.webpackJsonp||[]).push([[276,5,6,7],{"+NIl":function(nt,xe,Z){(function(ne){ne(Z("VrN/"))})(function(ne){"use strict";ne.defineMode("stex",function(J,P){"use strict";function X(h,l){h.cmdState.push(l)}function j(h){return h.cmdState.length>0?h.cmdState[h.cmdState.length-1]:null}function B(h){var l=h.cmdState.pop();l&&l.closeBracket()}function K(h){for(var l=h.cmdState,f=l.length-1;f>=0;f--){var o=l[f];if(o.name=="DEFAULT")continue;return o}return{styleIdentifier:function(){return null}}}function G(h,l,f){return function(){this.name=h,this.bracketNo=0,this.style=l,this.styles=f,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var r={};r.importmodule=G("importmodule","tag",["string","builtin"]),r.documentclass=G("documentclass","tag",["","atom"]),r.usepackage=G("usepackage","tag",["atom"]),r.begin=G("begin","tag",["atom"]),r.end=G("end","tag",["atom"]),r.label=G("label","tag",["atom"]),r.ref=G("ref","tag",["atom"]),r.eqref=G("eqref","tag",["atom"]),r.cite=G("cite","tag",["atom"]),r.bibitem=G("bibitem","tag",["atom"]),r.Bibitem=G("Bibitem","tag",["atom"]),r.RBibitem=G("RBibitem","tag",["atom"]),r.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function L(h,l){h.f=l}function v(h,l){var f;if(h.match(/^\\[a-zA-Z@]+/)){var o=h.current().slice(1);return f=r.hasOwnProperty(o)?r[o]:r.DEFAULT,f=new f,X(l,f),L(l,p),f.style}if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/\\]/))return"tag";if(h.match("\\["))return L(l,function(a,s){return m(a,s,"\\]")}),"keyword";if(h.match("\\("))return L(l,function(a,s){return m(a,s,"\\)")}),"keyword";if(h.match("$$"))return L(l,function(a,s){return m(a,s,"$$")}),"keyword";if(h.match("$"))return L(l,function(a,s){return m(a,s,"$")}),"keyword";var u=h.next();if(u=="%")return h.skipToEnd(),"comment";if(u=="}"||u=="]"){if(f=j(l),f)f.closeBracket(u),L(l,p);else return"error";return"bracket"}else return u=="{"||u=="["?(f=r.DEFAULT,f=new f,X(l,f),"bracket"):/\d/.test(u)?(h.eatWhile(/[\w.%]/),"atom"):(h.eatWhile(/[\w\-_]/),f=K(l),f.name=="begin"&&(f.argument=h.current()),f.styleIdentifier())}function m(h,l,f){if(h.eatSpace())return null;if(f&&h.match(f))return L(l,v),"keyword";if(h.match(/^\\[a-zA-Z@]+/))return"tag";if(h.match(/^[a-zA-Z]+/))return"variable-2";if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/]/))return"tag";if(h.match(/^[\^_&]/))return"tag";if(h.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(h.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var o=h.next();return o=="{"||o=="}"||o=="["||o=="]"||o=="("||o==")"?"bracket":o=="%"?(h.skipToEnd(),"comment"):"error"}function p(h,l){var f=h.peek(),o;return f=="{"||f=="["?(o=j(l),o.openBracket(f),h.eat(f),L(l,v),"bracket"):/[ \t\r]/.test(f)?(h.eat(f),null):(L(l,v),B(l),v(h,l))}return{startState:function(){var h=P.inMathMode?function(l,f){return m(l,f)}:v;return{cmdState:[],f:h}},copyState:function(h){return{cmdState:h.cmdState.slice(),f:h.f}},token:function(h,l){return l.f(h,l)},blankLine:function(h){h.f=v,h.cmdState.length=0},lineComment:"%"}}),ne.defineMIME("text/x-stex","stex"),ne.defineMIME("text/x-latex","stex")})},"+ua5":function(nt,xe,Z){},"/cxE":function(nt,xe,Z){"use strict";Z.d(xe,"f",function(){return P}),Z.d(xe,"g",function(){return X}),Z.d(xe,"h",function(){return j}),Z.d(xe,"e",function(){return K}),Z.d(xe,"b",function(){return G}),Z.d(xe,"c",function(){return r}),Z.d(xe,"d",function(){return L}),Z.d(xe,"a",function(){return v});class ne{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(m){setTimeout(()=>{throw m.stack?new Error(m.message+` `+m.stack):m},0)}}emit(m){this.listeners.forEach(p=>{p(m)})}onUnexpectedError(m){this.unexpectedErrorHandler(m),this.emit(m)}onUnexpectedExternalError(m){this.unexpectedErrorHandler(m)}}const J=new ne;function P(m){K(m)||J.onUnexpectedError(m);return}function X(m){K(m)||J.onUnexpectedExternalError(m);return}function j(m){if(m instanceof Error){let{name:p,message:h}=m;const l=m.stacktrace||m.stack;return{$isError:!0,name:p,message:h,stack:l}}return m}const B="Canceled";function K(m){return m instanceof Error&&m.name===B&&m.message===B}function G(){const m=new Error(B);return m.name=m.message,m}function r(m){return m?new Error(`Illegal argument: ${m}`):new Error("Illegal argument")}function L(m){return m?new Error(`Illegal state: ${m}`):new Error("Illegal state")}class v extends Error{constructor(m){super("NotSupported");m&&(this.message=m)}}},"19Vz":function(nt,xe,Z){(function(ne){ne(Z("VrN/"))})(function(ne){ne.defineOption("placeholder","",function(G,r,L){var v=L&&L!=ne.Init;if(r&&!v)G.on("blur",j),G.on("change",B),G.on("swapDoc",B),ne.on(G.getInputField(),"compositionupdate",G.state.placeholderCompose=function(){X(G)}),B(G);else if(!r&&v){G.off("blur",j),G.off("change",B),G.off("swapDoc",B),ne.off(G.getInputField(),"compositionupdate",G.state.placeholderCompose),J(G);var m=G.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}r&&!G.hasFocus()&&j(G)});function J(G){G.state.placeholder&&(G.state.placeholder.parentNode.removeChild(G.state.placeholder),G.state.placeholder=null)}function P(G){J(G);var r=G.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=G.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var L=G.getOption("placeholder");typeof L=="string"&&(L=document.createTextNode(L)),r.appendChild(L),G.display.lineSpace.insertBefore(r,G.display.lineSpace.firstChild)}function X(G){setTimeout(function(){var r=!1,L=G.getInputField();L.nodeName=="TEXTAREA"?r=!L.value:G.lineCount()==1&&(r=!/[^\u200b]/.test(L.querySelector(".CodeMirror-line").textContent)),r?P(G):J(G)},20)}function j(G){K(G)&&P(G)}function B(G){var r=G.getWrapperElement(),L=K(G);r.className=r.className.replace(" CodeMirror-empty","")+(L?" CodeMirror-empty":""),L?P(G):J(G)}function K(G){return G.lineCount()===1&&G.getLine(0)===""}})},"1eCo":function(nt,xe,Z){(function(ne){ne(Z("VrN/"))})(function(ne){"use strict";var J={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},P={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ne.defineMode("xml",function(X,j){var B=X.indentUnit,K={},G=j.htmlMode?J:P;for(var r in G)K[r]=G[r];for(var r in j)K[r]=j[r];var L,v;function m(c,w){function y(F){return w.tokenize=F,F(c,w)}var b=c.next();if(b=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?y(l("atom","]]>")):null:c.match("--")?y(l("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),y(f(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),w.tokenize=l("meta","?>"),"meta"):(L=c.eat("/")?"closeTag":"openTag",w.tokenize=p,"tag bracket");if(b=="&"){var U;return c.eat("#")?c.eat("x")?U=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):U=c.eatWhile(/[\d]/)&&c.eat(";"):U=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),U?"atom":"error"}else return c.eatWhile(/[^&<]/),null}m.isInText=!0;function p(c,w){var y=c.next();if(y==">"||y=="/"&&c.eat(">"))return w.tokenize=m,L=y==">"?"endTag":"selfcloseTag","tag bracket";if(y=="=")return L="equals",null;if(y=="<"){w.tokenize=m,w.state=s,w.tagName=w.tagStart=null;var b=w.tokenize(c,w);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(y)?(w.tokenize=h(y),w.stringStartCol=c.column(),w.tokenize(c,w)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(c){var w=function(y,b){for(;!y.eol();)if(y.next()==c){b.tokenize=p;break}return"string"};return w.isInAttribute=!0,w}function l(c,w){return function(y,b){for(;!y.eol();){if(y.match(w)){b.tokenize=m;break}y.next()}return c}}function f(c){return function(w,y){for(var b;(b=w.next())!=null;){if(b=="<")return y.tokenize=f(c+1),y.tokenize(w,y);if(b==">")if(c==1){y.tokenize=m;break}else return y.tokenize=f(c-1),y.tokenize(w,y)}return"meta"}}function o(c,w,y){this.prev=c.context,this.tagName=w,this.indent=c.indented,this.startOfLine=y,(K.doNotIndent.hasOwnProperty(w)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function u(c){c.context&&(c.context=c.context.prev)}function a(c,w){for(var y;;){if(!c.context)return;if(y=c.context.tagName,!K.contextGrabbers.hasOwnProperty(y)||!K.contextGrabbers[y].hasOwnProperty(w))return;u(c)}}function s(c,w,y){return c=="openTag"?(y.tagStart=w.column(),R):c=="closeTag"?_:s}function R(c,w,y){return c=="word"?(y.tagName=w.current(),v="tag",O):K.allowMissingTagName&&c=="endTag"?(v="tag bracket",O(c,w,y)):(v="error",R)}function _(c,w,y){if(c=="word"){var b=w.current();return y.context&&y.context.tagName!=b&&K.implicitlyClosed.hasOwnProperty(y.context.tagName)&&u(y),y.context&&y.context.tagName==b||K.matchClosing===!1?(v="tag",C):(v="tag error",D)}else return K.allowMissingTagName&&c=="endTag"?(v="tag bracket",C(c,w,y)):(v="error",D)}function C(c,w,y){return c!="endTag"?(v="error",C):(u(y),s)}function D(c,w,y){return v="error",C(c,w,y)}function O(c,w,y){if(c=="word")return v="attribute",A;if(c=="endTag"||c=="selfcloseTag"){var b=y.tagName,U=y.tagStart;return y.tagName=y.tagStart=null,c=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(b)?a(y,b):(a(y,b),y.context=new o(y,b,U==y.indented)),s}return v="error",O}function A(c,w,y){return c=="equals"?S:(K.allowMissing||(v="error"),O(c,w,y))}function S(c,w,y){return c=="string"?T:c=="word"&&K.allowUnquoted?(v="string",O):(v="error",O(c,w,y))}function T(c,w,y){return c=="string"?T:O(c,w,y)}return{startState:function(c){var w={tokenize:m,state:s,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(w.baseIndent=c),w},token:function(c,w){if(!w.tagName&&c.sol()&&(w.indented=c.indentation()),c.eatSpace())return null;L=null;var y=w.tokenize(c,w);return(y||L)&&y!="comment"&&(v=null,w.state=w.state(L||y,c,w),v&&(y=v=="error"?y+" error":v)),y},indent:function(c,w,y){var b=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+B;if(b&&b.noIndent)return ne.Pass;if(c.tokenize!=p&&c.tokenize!=m)return y?y.match(/^(\s*)/)[0].length:0;if(c.tagName)return K.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+B*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/$/,blockCommentStart:"",configuration:K.htmlMode?"html":"xml",helperType:K.htmlMode?"html":"xml",skipAttribute:function(c){c.state==S&&(c.state=O)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var w=[],y=c.context;y;y=y.prev)y.tagName&&w.push(y.tagName);return w.reverse()}}}),ne.defineMIME("text/xml","xml"),ne.defineMIME("application/xml","xml"),ne.mimeModes.hasOwnProperty("text/html")||ne.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return J});class ne{constructor(P){this.element=P,this.next=ne.Undefined,this.prev=ne.Undefined}}ne.Undefined=new ne(void 0);class J{constructor(){this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ne.Undefined}clear(){let P=this._first;for(;P!==ne.Undefined;){const X=P.next;P.prev=ne.Undefined,P.next=ne.Undefined,P=X}this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}unshift(P){return this._insert(P,!1)}push(P){return this._insert(P,!0)}_insert(P,X){const j=new ne(P);if(this._first===ne.Undefined)this._first=j,this._last=j;else if(X){const K=this._last;this._last=j,j.prev=K,K.next=j}else{const K=this._first;this._first=j,j.next=K,K.prev=j}this._size+=1;let B=!1;return()=>{B||(B=!0,this._remove(j))}}shift(){if(this._first===ne.Undefined)return;{const P=this._first.element;return this._remove(this._first),P}}pop(){if(this._last===ne.Undefined)return;{const P=this._last.element;return this._remove(this._last),P}}_remove(P){if(P.prev!==ne.Undefined&&P.next!==ne.Undefined){const X=P.prev;X.next=P.next,P.next.prev=X}else P.prev===ne.Undefined&&P.next===ne.Undefined?(this._first=ne.Undefined,this._last=ne.Undefined):P.next===ne.Undefined?(this._last=this._last.prev,this._last.next=ne.Undefined):P.prev===ne.Undefined&&(this._first=this._first.next,this._first.prev=ne.Undefined);this._size-=1}*[Symbol.iterator](){let P=this._first;for(;P!==ne.Undefined;)yield P.element,P=P.next}}},"3/fG":function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return J});function ne(P,X){let j;return X.length===0?j=P:j=P.replace(/\{(\d+)\}/g,function(B,K){const G=K[0];return typeof X[G]!="undefined"?X[G]:B}),j}function J(P,X,...j){return ne(X,j)}},"55Ip":function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return a});var ne=Z("Ty5D"),J=Z("dI71"),P=Z("q1tI"),X=Z.n(P),j=Z("YS25"),B=Z("17x9"),K=Z.n(B),G=Z("wx14"),r=Z("zLVn"),L=Z("9R94"),v=function(S){Object(J.a)(T,S);function T(){for(var w,y=arguments.length,b=new Array(y),U=0;U$&&($=g.line_indent_level));var ie={mode:H,parent:g,last_token:g?g.last_token:new p(a.START_BLOCK,""),last_word:g?g.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:$,alignment:0,line_indent_level:g?g.line_indent_level:$,start_line_index:this._output.get_line_number(),ternary_depth:0};return ie},N.prototype._reset=function(g){var H=g.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,H),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(c.BlockStatement);var $=new f(g,this._options);return this._tokens=$.tokenize(),g},N.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var g,H=this._reset(this._source_text),$=this._options.eol;this._options.eol==="auto"&&($=` `,H&&h.lineBreak.test(H||"")&&($=H.match(h.lineBreak)[0]));for(var ie=this._tokens.next();ie;)this.handle_token(ie),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ie,ie=this._tokens.next();return g=this._output.get_code($),g},N.prototype.handle_token=function(g,H){g.type===a.START_EXPR?this.handle_start_expr(g):g.type===a.END_EXPR?this.handle_end_expr(g):g.type===a.START_BLOCK?this.handle_start_block(g):g.type===a.END_BLOCK?this.handle_end_block(g):g.type===a.WORD?this.handle_word(g):g.type===a.RESERVED?this.handle_word(g):g.type===a.SEMICOLON?this.handle_semicolon(g):g.type===a.STRING?this.handle_string(g):g.type===a.EQUALS?this.handle_equals(g):g.type===a.OPERATOR?this.handle_operator(g):g.type===a.COMMA?this.handle_comma(g):g.type===a.BLOCK_COMMENT?this.handle_block_comment(g,H):g.type===a.COMMENT?this.handle_comment(g,H):g.type===a.DOT?this.handle_dot(g):g.type===a.EOF?this.handle_eof(g):g.type===a.UNKNOWN?this.handle_unknown(g,H):this.handle_unknown(g,H)},N.prototype.handle_whitespace_and_comments=function(g,H){var $=g.newlines,ie=this._options.keep_array_indentation&&b(this._flags.mode);if(g.comments_before)for(var oe=g.comments_before.next();oe;)this.handle_whitespace_and_comments(oe,H),this.handle_token(oe,H),oe=g.comments_before.next();if(ie)for(var Ce=0;Ce<$;Ce+=1)this.print_newline(Ce>0,H);else if(this._options.max_preserve_newlines&&$>this._options.max_preserve_newlines&&($=this._options.max_preserve_newlines),this._options.preserve_newlines&&$>1){this.print_newline(!1,H);for(var ve=1;ve<$;ve+=1)this.print_newline(!0,H)}};var I=["async","break","continue","return","throw","yield"];N.prototype.allow_wrap_or_preserved_newline=function(g,H){if(H=H===void 0?!1:H,this._output.just_added_newline())return;var $=this._options.preserve_newlines&&g.newlines||H,ie=s(this._flags.last_token.text,u)||s(g.text,u);if(ie){var oe=s(this._flags.last_token.text,u)&&s(this._options.operator_position,T)||s(g.text,u);$=$&&oe}if($)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(D(this._flags.last_token,I))return;this._output.set_wrap_point()}},N.prototype.print_newline=function(g,H){if(!H&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==a.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var $=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&C($,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(g)&&(this._flags.multiline_frame=!0)},N.prototype.print_token_line_indentation=function(g){this._output.just_added_newline()&&(this._options.keep_array_indentation&&g.newlines&&(g.text==="["||b(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(g.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},N.prototype.print_token=function(g){if(this._output.raw){this._output.add_raw_token(g);return}if(this._options.comma_first&&g.previous&&g.previous.type===a.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var H=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(H),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(g),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(g),this._output.non_breaking_space=!0,this._output.add_token(g.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},N.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},N.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},N.prototype.set_mode=function(g){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,g),this._flags=this.create_flags(this._previous_flags,g),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},N.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===c.Statement&&w(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},N.prototype.start_of_object_property=function(){return this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"]))},N.prototype.start_of_statement=function(g){var H=!1;return H=H||D(this._flags.last_token,["var","let","const"])&&g.type===a.WORD,H=H||C(this._flags.last_token,"do"),H=H||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&D(this._flags.last_token,I)&&!g.newlines,H=H||C(this._flags.last_token,"else")&&!(C(g,"if")&&!g.comments_before),H=H||this._flags.last_token.type===a.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),H=H||this._flags.last_token.type===a.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(g.text==="--"||g.text==="++")&&this._last_last_text!=="function"&&g.type!==a.WORD&&g.type!==a.RESERVED,H=H||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"])),H?(this.set_mode(c.Statement),this.indent(),this.handle_whitespace_and_comments(g,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g,D(g,["do","for","if","while"])),!0):!1},N.prototype.handle_start_expr=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g);var H=c.Expression;if(g.text==="["){if(this._flags.last_token.type===a.WORD||this._flags.last_token.text===")"){D(this._flags.last_token,o)&&(this._output.space_before_token=!0),this.print_token(g),this.set_mode(H),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}H=c.ArrayLiteral,b(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),s(this._flags.last_token.type,[a.START_EXPR,a.END_EXPR,a.WORD,a.OPERATOR,a.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===a.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,H=c.ForInitializer):s(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,H=c.Conditional):s(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&g.whitespace_before===""?this._output.space_before_token=!1:(s(this._flags.last_token.text,o)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g);else if(this._flags.last_token.type===a.WORD){this._output.space_before_token=!1;var $=this._tokens.peek(-3);if(this._options.space_after_named_function&&$){var ie=this._tokens.peek(-4);D($,["async","function"])||$.text==="*"&&D(ie,["async","function"])?this._output.space_before_token=!0:this._flags.mode===c.ObjectLiteral?($.text==="{"||$.text===","||$.text==="*"&&(ie.text==="{"||ie.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(g);(this._flags.last_token.type===a.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&s(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===a.START_BLOCK?this.print_newline():(this._flags.last_token.type===a.END_EXPR||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===a.COMMA)&&this.allow_wrap_or_preserved_newline(g,g.newlines),this.print_token(g),this.set_mode(H),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},N.prototype.handle_end_expr=function(g){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(g,g.text==="]"&&b(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===a.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(g),this.restore_mode(),w(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===c.Conditional&&(this._previous_flags.mode=c.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},N.prototype.handle_start_block=function(g){this.handle_whitespace_and_comments(g);var H=this._tokens.peek(),$=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===a.END_EXPR?(this.set_mode(c.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(c.BlockStatement):$&&(s($.text,[":",","])&&s(H.type,[a.STRING,a.WORD,a.RESERVED])||s(H.text,["get","set","..."])&&s($.type,[a.WORD,a.RESERVED]))?s(this._last_last_text,["class","interface"])&&!s($.text,[":",","])?this.set_mode(c.BlockStatement):this.set_mode(c.ObjectLiteral):this._flags.last_token.type===a.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(c.BlockStatement):s(this._flags.last_token.type,[a.EQUALS,a.START_EXPR,a.COMMA,a.OPERATOR])||D(this._flags.last_token,["return","throw","import","default"])?this.set_mode(c.ObjectLiteral):this.set_mode(c.BlockStatement),this._flags.last_token&&(D(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ie=!H.comments_before&&H.text==="}",oe=ie&&this._flags.last_word==="function"&&this._flags.last_token.type===a.END_EXPR;if(this._options.brace_preserve_inline){var Ce=0,ve=null;this._flags.inline_frame=!0;do if(Ce+=1,ve=this._tokens.peek(Ce-1),ve.newlines){this._flags.inline_frame=!1;break}while(ve.type!==a.EOF&&!(ve.type===a.END_BLOCK&&ve.opened===g))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==a.OPERATOR&&(oe||this._flags.last_token.type===a.EQUALS||D(this._flags.last_token,O)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(b(this._previous_flags.mode)&&(this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.COMMA)&&((this._flags.last_token.type===a.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(g),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==a.OPERATOR&&this._flags.last_token.type!==a.START_EXPR&&(this._flags.last_token.type===a.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(g),this.indent(),!ie&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},N.prototype.handle_end_block=function(g){for(this.handle_whitespace_and_comments(g);this._flags.mode===c.Statement;)this.restore_mode();var H=this._flags.last_token.type===a.START_BLOCK;this._flags.inline_frame&&!H?this._output.space_before_token=!0:this._options.brace_style==="expand"?H||this.print_newline():H||(b(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(g)},N.prototype.handle_word=function(g){if(g.type===a.RESERVED){if(s(g.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)g.type=a.WORD;else if(g.text==="import"&&s(this._tokens.peek().text,["(","."]))g.type=a.WORD;else if(s(g.text,["as","from"])&&!this._flags.import_block)g.type=a.WORD;else if(this._flags.mode===c.ObjectLiteral){var H=this._tokens.peek();H.text===":"&&(g.type=a.WORD)}}if(this.start_of_statement(g)?D(this._flags.last_token,["var","let","const"])&&g.type===a.WORD&&(this._flags.declaration_statement=!0):g.newlines&&!U(this._flags.mode)&&(this._flags.last_token.type!==a.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==a.EQUALS&&(this._options.preserve_newlines||!D(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(g),this.print_newline()):this.handle_whitespace_and_comments(g),this._flags.do_block&&!this._flags.do_while)if(C(g,"while")){this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&C(g,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===c.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&D(g,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(g),this._flags.in_case=!0;return}if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g)),C(g,"function")){(s(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(s(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===a.OPERATOR))&&(!this._output.just_added_blankline()&&!g.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD?D(this._flags.last_token,["get","set","new","export"])||D(this._flags.last_token,I)?this._output.space_before_token=!0:C(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===a.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(U(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(g),this._flags.last_word=g.text;return}var $="NONE";if(this._flags.last_token.type===a.END_BLOCK?this._previous_flags.inline_frame?$="SPACE":D(g,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines?$="NEWLINE":($="SPACE",this._output.space_before_token=!0):$="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&this._flags.mode===c.BlockStatement?$="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&U(this._flags.mode)?$="SPACE":this._flags.last_token.type===a.STRING?$="NEWLINE":this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD||this._flags.last_token.text==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&s(this._last_last_text,["{",","]))?$="SPACE":this._flags.last_token.type===a.START_BLOCK?this._flags.inline_frame?$="SPACE":$="NEWLINE":this._flags.last_token.type===a.END_EXPR&&(this._output.space_before_token=!0,$="NEWLINE"),D(g,o)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?$="SPACE":$="NEWLINE"),D(g,["else","catch","finally"]))if((!(this._flags.last_token.type===a.END_BLOCK&&this._previous_flags.mode===c.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ie=this._output.current_line;ie.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else $==="NEWLINE"?D(this._flags.last_token,O)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&D(g,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==a.END_EXPR?(this._flags.last_token.type!==a.START_EXPR||!D(g,["var","let","const"]))&&this._flags.last_token.text!==":"&&(C(g,"if")&&C(g.previous,"else")?this._output.space_before_token=!0:this.print_newline()):D(g,o)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&b(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():$==="SPACE"&&(this._output.space_before_token=!0);g.previous&&(g.previous.type===a.WORD||g.previous.type===a.RESERVED)&&(this._output.space_before_token=!0),this.print_token(g),this._flags.last_word=g.text,g.type===a.RESERVED&&(g.text==="do"?this._flags.do_block=!0:g.text==="if"?this._flags.if_block=!0:g.text==="import"?this._flags.import_block=!0:this._flags.import_block&&C(g,"from")&&(this._flags.import_block=!1))},N.prototype.handle_semicolon=function(g){this.start_of_statement(g)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(g);for(var H=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&C(H,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(g)},N.prototype.handle_string=function(g){g.text.startsWith("`")&&g.newlines===0&&g.whitespace_before===""&&(g.previous.text===")"||this._flags.last_token.type===a.WORD)||(this.start_of_statement(g)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(g),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g):g.text.startsWith("`")&&this._flags.last_token.type===a.END_EXPR&&(g.previous.text==="]"||g.previous.text===")")&&g.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(g)},N.prototype.handle_equals=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0},N.prototype.handle_comma=function(g){this.handle_whitespace_and_comments(g,!0),this.print_token(g),this._output.space_before_token=!0,this._flags.declaration_statement?(U(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(g)):this._flags.mode===c.ObjectLiteral||this._flags.mode===c.Statement&&this._flags.parent.mode===c.ObjectLiteral?(this._flags.mode===c.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(g)},N.prototype.handle_operator=function(g){var H=g.text==="*"&&(D(this._flags.last_token,["function","yield"])||s(this._flags.last_token.type,[a.START_BLOCK,a.COMMA,a.END_BLOCK,a.SEMICOLON])),$=s(g.text,["-","+"])&&(s(this._flags.last_token.type,[a.START_BLOCK,a.START_EXPR,a.EQUALS,a.OPERATOR])||s(this._flags.last_token.text,o)||this._flags.last_token.text===",");if(!this.start_of_statement(g)){var ie=!H;this.handle_whitespace_and_comments(g,ie)}if(g.text==="*"&&this._flags.last_token.type===a.DOT){this.print_token(g);return}if(g.text==="::"){this.print_token(g);return}if(this._flags.last_token.type===a.OPERATOR&&s(this._options.operator_position,T)&&this.allow_wrap_or_preserved_newline(g),g.text===":"&&this._flags.in_case){this.print_token(g),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==a.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var oe=!0,Ce=!0,ve=!1;if(g.text===":"?this._flags.ternary_depth===0?oe=!1:(this._flags.ternary_depth-=1,ve=!0):g.text==="?"&&(this._flags.ternary_depth+=1),!$&&!H&&this._options.preserve_newlines&&s(g.text,u)){var Se=g.text===":",Ae=Se&&ve,Oe=Se&&!ve;switch(this._options.operator_position){case S.before_newline:this._output.space_before_token=!Oe,this.print_token(g),(!Se||Ae)&&this.allow_wrap_or_preserved_newline(g),this._output.space_before_token=!0;return;case S.after_newline:this._output.space_before_token=!0,!Se||Ae?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(g):this._output.space_before_token=!1,this.print_token(g),this._output.space_before_token=!0;return;case S.preserve_newline:Oe||this.allow_wrap_or_preserved_newline(g),oe=!(this._output.just_added_newline()||Oe),this._output.space_before_token=oe,this.print_token(g),this._output.space_before_token=!0;return}}if(H){this.allow_wrap_or_preserved_newline(g),oe=!1;var he=this._tokens.peek();Ce=he&&s(he.type,[a.WORD,a.RESERVED])}else if(g.text==="...")this.allow_wrap_or_preserved_newline(g),oe=this._flags.last_token.type===a.START_BLOCK,Ce=!1;else if(s(g.text,["--","++","!","~"])||$){if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR)&&this.allow_wrap_or_preserved_newline(g),oe=!1,Ce=!1,g.newlines&&(g.text==="--"||g.text==="++"||g.text==="~")){var ce=D(this._flags.last_token,O)&&g.newlines;ce&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ce,!0)}this._flags.last_token.text===";"&&U(this._flags.mode)&&(oe=!0),this._flags.last_token.type===a.RESERVED?oe=!0:this._flags.last_token.type===a.END_EXPR?oe=!(this._flags.last_token.text==="]"&&(g.text==="--"||g.text==="++")):this._flags.last_token.type===a.OPERATOR&&(oe=s(g.text,["--","-","++","+"])&&s(this._flags.last_token.text,["--","-","++","+"]),s(g.text,["+","-"])&&s(this._flags.last_token.text,["--","++"])&&(Ce=!0)),(this._flags.mode===c.BlockStatement&&!this._flags.inline_frame||this._flags.mode===c.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||oe,this.print_token(g),this._output.space_before_token=Ce},N.prototype.handle_block_comment=function(g,H){if(this._output.raw){this._output.add_raw_token(g),g.directives&&g.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(g.directives){this.print_newline(!1,H),this.print_token(g),g.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!h.newline.test(g.text)&&!g.newlines){this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0;return}else this.print_block_commment(g,H)},N.prototype.print_block_commment=function(g,H){var $=y(g.text),ie,oe=!1,Ce=!1,ve=g.whitespace_before,Se=ve.length;if(this.print_newline(!1,H),this.print_token_line_indentation(g),this._output.add_token($[0]),this.print_newline(!1,H),$.length>1){for($=$.slice(1),oe=F($,"*"),Ce=E($,ve),oe&&(this._flags.alignment=1),ie=0;ie<$.length;ie++)oe?(this.print_token_line_indentation(g),this._output.add_token(R($[ie]))):Ce&&$[ie]?(this.print_token_line_indentation(g),this._output.add_token($[ie].substring(Se))):(this._output.current_line.set_indent(-1),this._output.add_token($[ie])),this.print_newline(!1,H);this._flags.alignment=0}},N.prototype.handle_comment=function(g,H){g.newlines?this.print_newline(!1,H):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(g),this.print_newline(!1,H)},N.prototype.handle_dot=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),D(this._flags.last_token,O)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(g,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(g)},N.prototype.handle_unknown=function(g,H){this.print_token(g),g.text[g.text.length-1]===` `&&this.print_newline(!1,H)},N.prototype.handle_eof=function(g){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g)},r.exports.Beautifier=N},function(r){function L(p){this.__parent=p,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}L.prototype.clone_empty=function(){var p=new L(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},L.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},L.prototype.has_match=function(p){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(p))return!0;return!1},L.prototype.set_indent=function(p,h){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},L.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)},L.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},L.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},L.prototype.is_empty=function(){return this.__items.length===0},L.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},L.prototype.push=function(p){this.__items.push(p);var h=p.lastIndexOf(` `);h!==-1?this.__character_count=p.length-h:this.__character_count+=p.length},L.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},L.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},L.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},L.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},L.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function v(p,h){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),h=h||"",p.indent_level>0&&(h=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}v.prototype.get_indent_size=function(p,h){var l=this.__base_string_length;return h=h||0,p<0&&(l=0),l+=p*this.__indent_size,l+=h,l},v.prototype.get_indent_string=function(p,h){var l=this.__base_string;return h=h||0,p<0&&(p=0,l=""),h+=p*this.__indent_size,this.__ensure_cache(h),l+=this.__cache[h],l},v.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var p=this.__cache.length,h=0,l="";this.__indent_size&&p>=this.__indent_size&&(h=Math.floor(p/this.__indent_size),p-=h*this.__indent_size,l=new Array(h+1).join(this.__indent_string)),p&&(l+=new Array(p+1).join(" ")),this.__cache.push(l)};function m(p,h){this.__indent_cache=new v(p,h),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new L(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(p,h){return this.__indent_cache.get_indent_string(p,h)},m.prototype.get_indent_size=function(p,h){return this.__indent_cache.get_indent_size(p,h)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(p){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===` `&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(` `);return p!==` `&&(l=l.replace(/[\n]/g,p)),l},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,h){return p=p||0,h=h||0,this.next_line.set_indent(p,h),this.__lines.length>1?(this.current_line.set_indent(p,h),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var h=0;h1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(p,h){for(var l=this.__lines.length-2;l>=0;){var f=this.__lines[l];if(f.is_empty())break;if(f.item(0).indexOf(p)!==0&&f.item(-1)!==h){this.__lines.splice(l+1,0,new L(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},r.exports.Output=m},function(r){function L(v,m,p,h){this.type=v,this.text=m,this.comments_before=null,this.newlines=p||0,this.whitespace_before=h||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}r.exports.Token=L},function(r,L){var v="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",h="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",l="(?:\\\\u[0-9a-fA-F]{4}|["+v+p+"])",f="(?:\\\\u[0-9a-fA-F]{4}|["+m+p+h+"])*";L.identifier=new RegExp(l+f,"g"),L.identifierStart=new RegExp(l),L.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+p+h+"])+");var o=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;L.newline=/[\n\r\u2028\u2029]/,L.lineBreak=new RegExp(`\r |`+L.newline.source),L.allLineBreaks=new RegExp(L.lineBreak.source,"g")},function(r,L,v){var m=v(6).Options,p=["before-newline","after-newline","preserve-newline"];function h(l){m.call(this,l,"js");var f=this.raw_options.brace_style||null;f==="expand-strict"?this.raw_options.brace_style="expand":f==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var o=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var u=0;u>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),A=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";A=A.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),A="\\?\\.(?!\\d) "+A,A=A.replace(/ /g,"|");var S=new RegExp(A),T="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),c=T.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),w=new RegExp("^(?:"+c.join("|")+")$"),y,b=function(F,E){p.call(this,F,E),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var N=new o(this._input),I=new u(this._input).read_options(this._options);this.__patterns={template:I,identifier:I.starting_with(f.identifier).matching(f.identifierMatch),number:N.matching(_),punct:N.matching(S),comment:N.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:N.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:N.matching(//),include:N.starting_with(/#include/).until_after(f.lineBreak),shebang:N.starting_with(/#!/).until_after(f.lineBreak),xml:N.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:I.until(/['\\\n\r\u2028\u2029]/),double_quote:I.until(/["\\\n\r\u2028\u2029]/),template_text:I.until(/[`\\$]/),template_expression:I.until(/[`}\\]/)}};b.prototype=new p,b.prototype._is_comment=function(F){return F.type===s.COMMENT||F.type===s.BLOCK_COMMENT||F.type===s.UNKNOWN},b.prototype._is_opening=function(F){return F.type===s.START_BLOCK||F.type===s.START_EXPR},b.prototype._is_closing=function(F,E){return(F.type===s.END_BLOCK||F.type===s.END_EXPR)&&E&&(F.text==="]"&&E.text==="["||F.text===")"&&E.text==="("||F.text==="}"&&E.text==="{")},b.prototype._reset=function(){y=!1},b.prototype._get_next_token=function(F,E){var N=null;this._readWhitespace();var I=this._input.peek();return I===null?this._create_token(s.EOF,""):(N=N||this._read_non_javascript(I),N=N||this._read_string(I),N=N||this._read_word(F),N=N||this._read_singles(I),N=N||this._read_comment(I),N=N||this._read_regexp(I,F),N=N||this._read_xml(I,F),N=N||this._read_punctuation(),N=N||this._create_token(s.UNKNOWN,this._input.next()),N)},b.prototype._read_word=function(F){var E;if(E=this.__patterns.identifier.read(),E!=="")return E=E.replace(f.allLineBreaks,` `),!(F.type===s.DOT||F.type===s.RESERVED&&(F.text==="set"||F.text==="get"))&&w.test(E)?(E==="in"||E==="of")&&(F.type===s.WORD||F.type===s.STRING)?this._create_token(s.OPERATOR,E):this._create_token(s.RESERVED,E):this._create_token(s.WORD,E);if(E=this.__patterns.number.read(),E!=="")return this._create_token(s.WORD,E)},b.prototype._read_singles=function(F){var E=null;return F==="("||F==="["?E=this._create_token(s.START_EXPR,F):F===")"||F==="]"?E=this._create_token(s.END_EXPR,F):F==="{"?E=this._create_token(s.START_BLOCK,F):F==="}"?E=this._create_token(s.END_BLOCK,F):F===";"?E=this._create_token(s.SEMICOLON,F):F==="."&&D.test(this._input.peek(1))?E=this._create_token(s.DOT,F):F===","&&(E=this._create_token(s.COMMA,F)),E&&this._input.next(),E},b.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(s.EQUALS,F):F==="?."?this._create_token(s.DOT,F):this._create_token(s.OPERATOR,F)},b.prototype._read_non_javascript=function(F){var E="";if(F==="#"){if(this._is_first_token()&&(E=this.__patterns.shebang.read(),E))return this._create_token(s.UNKNOWN,E.trim()+` `);if(E=this.__patterns.include.read(),E)return this._create_token(s.UNKNOWN,E.trim()+` `);F=this._input.next();var N="#";if(this._input.hasNext()&&this._input.testChar(C)){do F=this._input.next(),N+=F;while(this._input.hasNext()&&F!=="#"&&F!=="=");return F==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(N+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(N+="{}",this._input.next(),this._input.next())),this._create_token(s.WORD,N)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(E=this.__patterns.html_comment_start.read(),E){for(;this._input.hasNext()&&!this._input.testChar(f.newline);)E+=this._input.next();return y=!0,this._create_token(s.COMMENT,E)}}else if(y&&F==="-"&&(E=this.__patterns.html_comment_end.read(),E))return y=!1,this._create_token(s.COMMENT,E);return null},b.prototype._read_comment=function(F){var E=null;if(F==="/"){var N="";if(this._input.peek(1)==="*"){N=this.__patterns.block_comment.read();var I=R.get_directives(N);I&&I.ignore==="start"&&(N+=R.readIgnored(this._input)),N=N.replace(f.allLineBreaks,` `),E=this._create_token(s.BLOCK_COMMENT,N),E.directives=I}else this._input.peek(1)==="/"&&(N=this.__patterns.comment.read(),E=this._create_token(s.COMMENT,N))}return E},b.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var E=this._input.next();return this.has_char_escapes=!1,F==="`"?E+=this._read_string_recursive("`",!0,"${"):E+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(E=U(E)),this._input.peek()===F&&(E+=this._input.next()),E=E.replace(f.allLineBreaks,` `),this._create_token(s.STRING,E)}return null},b.prototype._allow_regexp_or_xml=function(F){return F.type===s.RESERVED&&a(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===s.END_EXPR&&F.text===")"&&F.opened.previous.type===s.RESERVED&&a(F.opened.previous.text,["if","while","for"])||a(F.type,[s.COMMENT,s.START_EXPR,s.START_BLOCK,s.START,s.END_BLOCK,s.OPERATOR,s.EQUALS,s.EOF,s.SEMICOLON,s.COMMA])},b.prototype._read_regexp=function(F,E){if(F==="/"&&this._allow_regexp_or_xml(E)){for(var N=this._input.next(),I=!1,g=!1;this._input.hasNext()&&(I||g||this._input.peek()!==F)&&!this._input.testChar(f.newline);)N+=this._input.peek(),I?I=!1:(I=this._input.peek()==="\\",this._input.peek()==="["?g=!0:this._input.peek()==="]"&&(g=!1)),this._input.next();return this._input.peek()===F&&(N+=this._input.next(),N+=this._input.read(f.identifier)),this._create_token(s.STRING,N)}return null},b.prototype._read_xml=function(F,E){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(E)){var N="",I=this.__patterns.xml.read_match();if(I){for(var g=I[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),H=g.indexOf("{")===0,$=0;I;){var ie=!!I[1],oe=I[2],Ce=!!I[I.length-1]||oe.slice(0,8)==="![CDATA[";if(!Ce&&(oe===g||H&&oe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ie?--$:++$),N+=I[0],$<=0)break;I=this.__patterns.xml.read_match()}return I||(N+=this._input.match(/[\s\S]*/g)[0]),N=N.replace(f.allLineBreaks,` `),this._create_token(s.STRING,N)}}return null};function U(F){for(var E="",N=0,I=new m(F),g=null;I.hasNext();)if(g=I.match(/([\s]|[^\\]|\\\\)+/g),g&&(E+=g[0]),I.peek()==="\\"){if(I.next(),I.peek()==="x")g=I.match(/x([0-9A-Fa-f]{2})/g);else if(I.peek()==="u")g=I.match(/u([0-9A-Fa-f]{4})/g);else{E+="\\",I.hasNext()&&(E+=I.next());continue}if(!g)return F;if(N=parseInt(g[1],16),N>126&&N<=255&&g[0].indexOf("x")===0)return F;if(N>=0&&N<32){E+="\\"+g[0];continue}else N===34||N===39||N===92?E+="\\"+String.fromCharCode(N):E+=String.fromCharCode(N)}return E}b.prototype._read_string_recursive=function(F,E,N){var I,g;F==="'"?g=this.__patterns.single_quote:F==='"'?g=this.__patterns.double_quote:F==="`"?g=this.__patterns.template_text:F==="}"&&(g=this.__patterns.template_expression);for(var H=g.read(),$="";this._input.hasNext();){if($=this._input.next(),$===F||!E&&f.newline.test($)){this._input.back();break}else $==="\\"&&this._input.hasNext()?(I=this._input.peek(),I==="x"||I==="u"?this.has_char_escapes=!0:I==="\r"&&this._input.peek(1)===` `&&this._input.next(),$+=this._input.next()):N&&(N==="${"&&$==="$"&&this._input.peek()==="{"&&($+=this._input.next()),N===$&&(F==="`"?$+=this._read_string_recursive("}",E,"`"):$+=this._read_string_recursive("`",E,"${"),this._input.hasNext()&&($+=this._input.next())));$+=g.read(),H+=$}return H},r.exports.Tokenizer=b,r.exports.TOKEN=s,r.exports.positionable_operators=O.slice(),r.exports.line_starters=T.slice()},function(r){var L=RegExp.prototype.hasOwnProperty("sticky");function v(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position=0&&m=0&&p=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},r.exports.InputScanner=v},function(r,L,v){var m=v(8).InputScanner,p=v(3).Token,h=v(10).TokenStream,l=v(11).WhitespacePattern,f={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(u,a){this._input=new m(u),this._options=a||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new h,this._reset();for(var u,a=new p(f.START,""),s=null,R=[],_=new h;a.type!==f.EOF;){for(u=this._get_next_token(a,s);this._is_comment(u);)_.add(u),u=this._get_next_token(a,s);_.isEmpty()||(u.comments_before=_,_=new h),u.parent=s,this._is_opening(u)?(R.push(s),s=u):s&&this._is_closing(u,s)&&(u.opened=s,s.closed=u,s=R.pop(),u.parent=s),u.previous=a,a.next=u,this.__tokens.add(u),a=u}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(u,a){this._readWhitespace();var s=this._input.read(/.+/g);return s?this._create_token(f.RAW,s):this._create_token(f.EOF,"")},o.prototype._is_comment=function(u){return!1},o.prototype._is_opening=function(u){return!1},o.prototype._is_closing=function(u,a){return!1},o.prototype._create_token=function(u,a){var s=new p(u,a,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return s},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},r.exports.Tokenizer=o,r.exports.TOKEN=f},function(r){function L(v){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=v}L.prototype.restart=function(){this.__position=0},L.prototype.isEmpty=function(){return this.__tokens_length===0},L.prototype.hasNext=function(){return this.__position=0&&v/),erb:o.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:o.starting_with(/{%/).until_after(/%}/),django_value:o.starting_with(/{{/).until_after(/}}/),django_comment:o.starting_with(/{#/).until_after(/#}/),smarty:o.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:o.starting_with(/{\*/).until_after(/\*}/),smarty_literal:o.starting_with(/{literal}/).until_after(/{\/literal}/)}}h.prototype=new m,h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){this.__set_templated_pattern()},h.prototype.disable=function(l){var f=this._create();return f._disabled[l]=!0,f._update(),f},h.prototype.read_options=function(l){var f=this._create();for(var o in p)f._disabled[o]=l.templating.indexOf(o)===-1;return f._update(),f},h.prototype.exclude=function(l){var f=this._create();return f._excluded[l]=!0,f._update(),f},h.prototype.read=function(){var l="";this._match_pattern?l=this._input.read(this._starting_pattern):l=this._input.read(this._starting_pattern,this.__template_pattern);for(var f=this._read_template();f;)this._match_pattern?f+=this._input.read(this._match_pattern):f+=this._input.readUntil(this.__template_pattern),l+=f,f=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},h.prototype.__set_templated_pattern=function(){var l=[];this._disabled.php||l.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||l.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||l.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(l.push(this.__patterns.django._starting_pattern.source),l.push(this.__patterns.django_value._starting_pattern.source),l.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||l.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&l.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+l.join("|")+")")},h.prototype._read_template=function(){var l="",f=this._input.peek();if(f==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(l=l||this.__patterns.erb.read())}else f==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(l=l||this.__patterns.handlebars_comment.read(),l=l||this.__patterns.handlebars_unescaped.read(),l=l||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(l=l||this.__patterns.django_value.read()),this._excluded.django||(l=l||this.__patterns.django_comment.read(),l=l||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(l=l||this.__patterns.smarty_comment.read(),l=l||this.__patterns.smarty_literal.read(),l=l||this.__patterns.smarty.read()));return l},r.exports.TemplatablePattern=h}],B={};function K(r){var L=B[r];if(L!==void 0)return L.exports;var v=B[r]={exports:{}};return j[r](v,v.exports,K),v.exports}var G=K(0);P=G})();var X=P;!(ne=[],J=function(){return{js_beautify:X}}.apply(xe,ne),J!==void 0&&(nt.exports=J))})()},"6xqJ":function(nt,xe,Z){"use strict";Z.r(xe);var ne=Z("+L6B"),J=Z("2/Rp"),P=Z("sRBo"),X=Z("kaz8"),j=Z("14J3"),B=Z("BMrR"),K=Z("jCWc"),G=Z("kPKH"),r=Z("giR+"),L=Z("fyUT"),v=Z("DZo9"),m=Z("8z0m"),p=Z("0Owb"),h=Z("5NDa"),l=Z("5rEg"),f=Z("sPJy"),o=Z("bE4q"),u=Z("oBTY"),a=Z("k1fw"),s=Z("9og8"),R=Z("miYZ"),_=Z("tsqr"),C=Z("y8nQ"),D=Z("Vl3Y"),O=Z("tJVT"),A=Z("WmNS"),S=Z.n(A),T=Z("q1tI"),c=Z.n(T),w=Z("Ty5D"),y=Z("9kvl"),b=Z("55Ip"),U=Z("Ot1p"),F=Z("XYT7"),E=Z("m3rI"),N=Z("I98M"),I=Z.n(N),g=function($){var ie,oe=$.shixunHomeworks,Ce=$.newCourse,ve=$.globalSetting,Se=$.loading,Ae=$.dispatch,Oe=$.match,he=Object(w.i)(),ce=D.a.useForm(),re=Object(O.a)(ce,1),fe=re[0],se=Object(T.useState)({}),ke=Object(O.a)(se,2),Ne=ke[0],Re=ke[1],Pe=Object(T.useState)(!1),je=Object(O.a)(Pe,2),ue=je[0],Ee=je[1],Le=Object(T.useState)([]),Ie=Object(O.a)(Le,2),Ge=Ie[0],Xe=Ie[1],Je=Object(T.useState)([]),Qe=Object(O.a)(Je,2),at=Qe[0],qe=Qe[1],tt=oe.commonHomeWorkEditDefaultData,Be={name:"file",multiple:!0,action:E.a.API_SERVER+"/api/attachments.json",defaultFileList:Ge,onChange:function(Te){var me=Te.file.status;me!=="uploading",me==="done"?_.b.success("".concat(Te.file.name," \u6587\u4EF6\u4E0A\u4F20\u6210\u529F")):me==="error"&&_.b.error("".concat(Te.file.name," \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25"))}};Object(T.useEffect)(function(){ot()},[he.topicId]);var ut=function(Te){return Te==null?void 0:Te.map(function(me){return{uid:me.id,response:{id:me.id},name:me.title,status:"done",url:me.url}})},ot=function(){var He=Object(s.a)(S.a.mark(function Te(){var me;return S.a.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:return ae.next=2,Ae({type:"shixunHomeworks/editCommonHomeWorkDefaultBankData",payload:{id:he.topicId}});case 2:me=ae.sent,me&&(fe.setFieldsValue({name:me.name}),fe.setFieldsValue({description:me.description}),fe.setFieldsValue(Object(a.a)({},me)),Re(Object(a.a)({},me)),Xe(Object(u.a)(ut(me.attachments))),qe(Object(u.a)(ut(me.reference_attachments))),Ee(!0));case 4:case"end":return ae.stop()}},Te)}));return function(){return He.apply(this,arguments)}}(),Ue=function(){var He=Object(s.a)(S.a.mark(function Te(me){var be,ae,le,de;return S.a.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:return be=Object(a.a)({},me),be.attachment_ids&&(be.attachment_ids=be==null||((ae=be.attachment_ids.fileList)===null||ae===void 0)?void 0:ae.map(function(Fe){return Fe.response.id})),be.reference_attachment_ids&&(be.reference_attachment_ids=be==null||((le=be.reference_attachment_ids.fileList)===null||le===void 0)?void 0:le.map(function(Fe){return Fe.response.id})),we.next=5,Object(F.n)(Object(a.a)(Object(a.a)(Object(a.a)({id:he.topicId},Oe.params),be),{},{type:3}));case 5:de=we.sent,de&&y.d.push("/users/".concat(he.username,"/topics/").concat(he.topicId,"/").concat(he.topictype,"/group/detail"));case 7:case"end":return we.stop()}},Te)}));return function(me){return He.apply(this,arguments)}}();return c.a.createElement("section",{className:I.a.bg},c.a.createElement("section",{className:"animated fadeIn"},c.a.createElement("aside",{className:"mt10"},c.a.createElement(o.a,{separator:">"},c.a.createElement(o.a.Item,null,c.a.createElement(b.a,{to:"/users/".concat(he.username,"/").concat(he.topictype==="personal"?"topics":"topicbank","/").concat(he.topictype)},he.topictype==="personal"?"\u6211\u7684\u8BFE\u5802\u8D44\u6E90":"\u516C\u5171\u9898\u5E93")),c.a.createElement(o.a.Item,null,c.a.createElement(b.a,{to:"/users/".concat(he.username,"/topics/").concat(he.topicId,"/").concat(he.topictype,"/group/detail")},"\u8BE6\u60C5")),c.a.createElement(o.a.Item,null,"\u7F16\u8F91")))),c.a.createElement("aside",{className:"font24 bold mt20 mb20"},"\u7F16\u8F91\u666E\u901A\u4F5C\u4E1A"),c.a.createElement(D.a,{form:fe,className:I.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(){Re(Object(a.a)({},fe.getFieldsValue()))},onFinish:Ue},c.a.createElement("div",{className:I.a.fieldWrap},c.a.createElement(D.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u9898"}]},c.a.createElement(l.a,{maxLength:60,suffix:"".concat(((ie=Ne.name)===null||ie===void 0?void 0:ie.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),c.a.createElement("div",{className:I.a.mdWrap},c.a.createElement(D.a.Item,{name:"description",label:"\u7B80\u4ECB:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:5e3,message:"\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"}]},c.a.createElement(U.a,{watch:!0,defaultValue:tt.description})),c.a.createElement("div",null,c.a.createElement(D.a.Item,{name:"attachment_ids"},ue&&c.a.createElement(m.a,Object(p.a)({defaultFileList:Ge},Be),c.a.createElement("span",{className:"c-blue"},"\u4E0A\u4F20\u9644\u4EF6")," \uFF08\u5355\u4E2A\u6587\u4EF6150MB\u4EE5\u5185\uFF09"))),c.a.createElement(B.a,{gutter:[20,20]},c.a.createElement(G.a,{flex:"230px"},c.a.createElement(D.a.Item,{name:"min_num",label:"\u5206\u7EC4\u8BBE\u7F6E",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u6BCF\u7EC4\u6700\u5C0F\u4EBA\u6570"}]},c.a.createElement(L.a,{style:{width:200},min:1,placeholder:"\u8BF7\u586B\u5199\u6BCF\u7EC4\u6700\u5C0F\u4EBA\u6570"}))),c.a.createElement(G.a,{flex:"230px"},c.a.createElement(D.a.Item,{name:"max_num",label:c.a.createElement("div",null,"\xA0"),rules:[{required:!0,message:"\u8BF7\u586B\u5199\u6BCF\u7EC4\u6700\u5927\u4EBA\u6570"}]},c.a.createElement(L.a,{style:{width:200},max:10,placeholder:"\u8BF7\u586B\u5199\u6BCF\u7EC4\u6700\u5927\u4EBA\u6570"}))),c.a.createElement(G.a,null,c.a.createElement("div",{className:"mt30"},"\uFF08\u5B66\u751F\u63D0\u4EA4\u4F5C\u54C1\u65F6\u9700\u8981\u5173\u8054\u540C\u7EC4\u6210\u5458\uFF0C\u7EC4\u5185\u6210\u5458\u4F5C\u54C1\u5171\u4EAB\uFF09"))),c.a.createElement(B.a,null,c.a.createElement(G.a,null,c.a.createElement(D.a.Item,{name:"base_on_project",valuePropName:"checked"},c.a.createElement(X.a,{value:1,defaultChecked:!0},"\u57FA\u4E8E\u9879\u76EE\u5B9E\u65BD")),c.a.createElement("span",{className:"c-light-black"},"\uFF08\u9009\u4E2D\uFF0C\u5219\u5FC5\u987B\u5728\u672C\u5E73\u53F0\u521B\u5EFA\u9879\u76EE\uFF0C\u9879\u76EE\u7BA1\u7406\u5458\u53EF\u4EE5\u63D0\u4EA4\u4F5C\u54C1\uFF1B\u4E0D\u9009\u4E2D\uFF0C\u65E0\u9700\u5728\u5E73\u53F0\u521B\u5EFA\u9879\u76EE\uFF0C\u4EFB\u610F\u5C0F\u7EC4\u6210\u5458\u5747\u53EF\u4EE5\u63D0\u4EA4\u4F5C\u54C1\uFF09")))),c.a.createElement("div",{className:I.a.mdWrap},c.a.createElement(D.a.Item,{name:"reference_answer",label:"\u53C2\u8003\u7B54\u6848:"},c.a.createElement(U.a,{defaultValue:tt.reference_answer,watch:!0})),c.a.createElement("div",null,c.a.createElement(D.a.Item,{name:"reference_attachment_ids"},ue&&c.a.createElement(m.a,Object(p.a)({},Be,{defaultFileList:at}),c.a.createElement("span",{className:"c-blue"},"\u4E0A\u4F20\u9644\u4EF6")," \uFF08\u5355\u4E2A\u6587\u4EF6150MB\u4EE5\u5185\uFF09")))),c.a.createElement("div",{className:I.a.backgroundFa},c.a.createElement("div",{className:"pt40 mb30"},c.a.createElement(D.a.Item,null,c.a.createElement(J.a,{size:"large",type:"primary",className:"".concat(I.a.button," mr20"),htmlType:"submit"},"\u63D0\u4EA4"),c.a.createElement(J.a,{size:"large",type:"primary",ghost:!0,className:I.a.button,onClick:function(){return y.d.push("/users/".concat(he.username,"/topics/").concat(he.topicId,"/").concat(he.topictype,"/group/detail"))}},"\u53D6\u6D88"))))))};xe.default=Object(y.a)(function(H){var $=H.shixunHomeworks,ie=H.newCourse,oe=H.loading,Ce=H.globalSetting;return{shixunHomeworks:$,newCourse:ie,globalSetting:Ce,loading:oe.effects}})(g)},"746U":function(nt,xe,Z){"use strict";Z.d(xe,"f",function(){return ne}),Z.d(xe,"l",function(){return J}),Z.d(xe,"k",function(){return P}),Z.d(xe,"j",function(){return X}),Z.d(xe,"g",function(){return j}),Z.d(xe,"m",function(){return B}),Z.d(xe,"h",function(){return K}),Z.d(xe,"n",function(){return G}),Z.d(xe,"c",function(){return r}),Z.d(xe,"a",function(){return L}),Z.d(xe,"i",function(){return v}),Z.d(xe,"o",function(){return m}),Z.d(xe,"e",function(){return l}),Z.d(xe,"d",function(){return f}),Z.d(xe,"p",function(){return o}),Z.d(xe,"b",function(){return u});function ne(a){return Array.isArray(a)}function J(a){return typeof a=="string"}function P(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)&&!(a instanceof RegExp)&&!(a instanceof Date)}function X(a){return typeof a=="number"&&!isNaN(a)}function j(a){return a===!0||a===!1}function B(a){return typeof a=="undefined"}function K(a){return!G(a)}function G(a){return B(a)||a===null}function r(a,s){if(!a)throw new Error(s?`Unexpected type, expected '${s}'`:"Unexpected type")}function L(a){if(G(a))throw new Error("Assertion Failed: argument is undefined or null");return a}function v(a){return typeof a=="function"}function m(a,s){const R=Math.min(a.length,s.length);for(let _=0;_function(){const D=Array.prototype.slice.call(arguments,0);return s(C,D)};let _={};for(const C of a)_[C]=R(C);return _}function o(a){return a===null?void 0:a}function u(a,s="Unreachable"){throw new Error(s)}},"7Cbv":function(nt,xe,Z){"use strict";var ne=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),J=new Uint8Array(16);function P(){if(!ne)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ne(J)}var X=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function j(p){return typeof p=="string"&&X.test(p)}for(var B=j,K=[],G=0;G<256;++G)K.push((G+256).toString(16).substr(1));function r(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,l=(K[p[h+0]]+K[p[h+1]]+K[p[h+2]]+K[p[h+3]]+"-"+K[p[h+4]]+K[p[h+5]]+"-"+K[p[h+6]]+K[p[h+7]]+"-"+K[p[h+8]]+K[p[h+9]]+"-"+K[p[h+10]]+K[p[h+11]]+K[p[h+12]]+K[p[h+13]]+K[p[h+14]]+K[p[h+15]]).toLowerCase();if(!B(l))throw TypeError("Stringified UUID is invalid");return l}var L=r;function v(p,h,l){p=p||{};var f=p.random||(p.rng||P)();if(f[6]=f[6]&15|64,f[8]=f[8]&63|128,h){l=l||0;for(var o=0;o<16;++o)h[l+o]=f[o];return h}return L(f)}var m=xe.a=v},"7ahc":function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return R});var ne=Z("k1fw"),J=Z("0Owb"),P=Z("+L6B"),X=Z("2/Rp"),j=Z("y8nQ"),B=Z("Vl3Y"),K=Z("tJVT"),G=Z("OaEy"),r=Z("2fM7"),L=Z("q1tI"),v=Z.n(L),m=Z("VrN/"),p=Z.n(m),h=Z("p77/"),l=Z.n(h),f=Z("c5Ni"),o=Z.n(f),u=r.a.Option,a={labelCol:{span:4},wrapperCol:{span:20}},s={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};xe.b=function(_){var C=_.callback,D=_.onCancel,O=Object(L.useState)("python"),A=Object(K.a)(O,2),S=A[0],T=A[1];function c(y){T(s[y][1])}function w(y){C(y)}return v.a.createElement(B.a,Object(J.a)({},a,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:w}),v.a.createElement(B.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},v.a.createElement(r.a,{onChange:c},Object.keys(s).map(function(y){return v.a.createElement(u,{key:y,value:y},s[y][0])}))),v.a.createElement(B.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},v.a.createElement(R,{mode:S})),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(X.a,{type:"ghost",onClick:D},"\u53D6\u6D88")))};function R(_){var C=_.value,D=_.onChange,O=_.mode,A=_.options,S=A===void 0?{}:A,T=Object(L.useRef)(),c=Object(L.useState)(),w=Object(K.a)(c,2),y=w[0],b=w[1];return Object(L.useEffect)(function(){if(y){function U(F){var E=F.getValue();D&&D(E)}return y.on("change",U),function(){y.off("change",U)}}},[y,D]),Object(L.useEffect)(function(){y&&y.setOption("mode",O)},[y,O]),Object(L.useEffect)(function(){y&&((C!==y.getValue()||C==="")&&setTimeout(function(){y.setValue(C||" ")},300))},[y,C]),Object(L.useEffect)(function(){if(T.current&&!y){var U=p.a.fromTextArea(T.current,Object(ne.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},S));b(U)}},[T.current,y]),v.a.createElement("div",{className:"my-codemirror-container"},v.a.createElement("textarea",{ref:T}))}},"8EBN":function(nt,xe,Z){(function(ne){ne(Z("VrN/"))})(function(ne){"use strict";ne.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var J=0;J-1&&X.substring(K+1,X.length);if(G)return ne.findModeByExtension(G)},ne.findModeByName=function(X){X=X.toLowerCase();for(var j=0;j=W.length?ee.slice(W.length):ee}).join(` `)}var o=[],u=["
    "],a=new h.a.Renderer,s=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function R(){o.length=0,u=["
      "]}var _={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function C(Y,x,k,W){if(x>=Y.length||Y[x].level<=k)return x;var ee=Y[x];W.push("
    • "+ee.text+""),x++;var V=[];return x=C(Y,x,ee.level,V),V.length>0&&(W.push("
        "),V.forEach(function(_e){W.push(_e)}),W.push("
      ")),W.push("
    • "),x=C(Y,x,k,W),x}function D(){return C(o,0,0,u),u.push("
    "),u.join("")}var O={heading:function(x){var k=s.exec(x);if(k)return{type:"heading",raw:k[0],depth:k[1].length,text:k[2]}},fences:function(x){var k=this.rules.block.fences.exec(x);if(k){var W=k[0],ee=f(W,k[3]||""),V=k[2]?k[2].trim():k[2];if(["latex","katex","math"].indexOf(V)>=0){var _e=T(),Ke=ee;ee=_e,c[_e]={type:"block",expression:Ke}}return{type:"code",raw:W,lang:V,text:ee}}}},A=/(?:\${2})([^\n`]+?)(?:\${2})/gi,S=0,T=function(){return"__special_katext_id_".concat(S++,"__")},c={};function w(){return c}function y(){S=0,c={}}function b(Y){return Y=Y.replace(A,function(x,k){var W=T();return c[W]={type:"inline",expression:k},W}),Y}var U=a.listitem;a.listitem=function(Y){return U(b(Y))};var F=a.paragraph;a.paragraph=function(Y){return F(b(Y))};var E=a.tablecell;a.tablecell=function(Y,x){return E(b(Y),x)},a.code=function(Y,x,k){var W=(x||"").match(/\S*/)[0];return W?["latex","katex","math"].indexOf(W)>=0?"

    ".concat(Y,"

    "):'
    ').concat(k?Y:Object(l.escape)(Y,!0),`
    `):'
    '+(k?Y:Object(l.escape)(Y,!0))+"
    "},a.heading=function(Y,x,k){var W=this.options.headerPrefix+k.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return o.push({anchor:W,level:x,text:Y}),"'+Y+""},h.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),h.a.use({tokenizer:O,renderer:a});var N=h.a,I=Z("SJMd"),g=Z("ulZh"),H=Z.n(g),$=Z("m3rI"),ie=Z("Oy/b"),oe=Z("p5ED"),Ce=Z("ErOA");/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var ve=function(Y,x){return(ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,W){k.__proto__=W}||function(k,W){for(var ee in W)Object.prototype.hasOwnProperty.call(W,ee)&&(k[ee]=W[ee])})(Y,x)};function Se(Y,x){function k(){this.constructor=Y}ve(Y,x),Y.prototype=x===null?Object.create(x):(k.prototype=x.prototype,new k)}function Ae(Y,x,k,W){return new(k||(k=Promise))(function(ee,V){function _e(pt){try{et(W.next(pt))}catch(Ve){V(Ve)}}function Ke(pt){try{et(W.throw(pt))}catch(Ve){V(Ve)}}function et(pt){var Ve;pt.done?ee(pt.value):(Ve=pt.value,Ve instanceof k?Ve:new k(function(_t){_t(Ve)})).then(_e,Ke)}et((W=W.apply(Y,x||[])).next())})}function Oe(Y,x){var k,W,ee,V,_e={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return V={next:Ke(0),throw:Ke(1),return:Ke(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function Ke(et){return function(pt){return function(Ve){if(k)throw new TypeError("Generator is already executing.");for(;_e;)try{if(k=1,W&&(ee=2&Ve[0]?W.return:Ve[0]?W.throw||((ee=W.return)&&ee.call(W),0):W.next)&&!(ee=ee.call(W,Ve[1])).done)return ee;switch(W=0,ee&&(Ve=[2&Ve[0],ee.value]),Ve[0]){case 0:case 1:ee=Ve;break;case 4:return _e.label++,{value:Ve[1],done:!1};case 5:_e.label++,W=Ve[1],Ve=[0];continue;case 7:Ve=_e.ops.pop(),_e.trys.pop();continue;default:if(!(ee=_e.trys,(ee=ee.length>0&&ee[ee.length-1])||Ve[0]!==6&&Ve[0]!==2)){_e=0;continue}if(Ve[0]===3&&(!ee||Ve[1]>ee[0]&&Ve[1]',"select"),this.addActionButton(W,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(W,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(W,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(W,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(W,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(W,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(W,'',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(V){var _e=document.createElement("div");_e.className=""+k.toolbarButtonStyleClass.name,_e.setAttribute("data-type-name",V.typeName),_e.innerHTML=V.icon,_e.addEventListener("click",function(){k.markerToolbarButtonClicked(_e,V)}),k.buttons.push(_e),k.markerButtons.push(_e)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var ee=document.createElement("div");ee.className=this.toolbarBlockStyleClass.name,ee.style.whiteSpace="nowrap",ee.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ee),this.addActionButton(ee,'',"render"),this.addActionButton(ee,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},Y.prototype.addButtonClickListener=function(x){this.buttonClickListeners.push(x)},Y.prototype.removeButtonClickListener=function(x){this.buttonClickListeners.indexOf(x)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(x),1)},Y.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Y.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var x=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var k=0;k0&&this.buttonClickListeners.forEach(function(W){return W("marker",k)}),this.markerButtonOverflowBlock.style.display="none"},Y.prototype.actionToolbarButtonClicked=function(x,k){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(W){return W("action",k)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Y.prototype.setActiveButton=function(x){this.resetButtonStyles(),x.className=x.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),x.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Y.prototype.setActiveMarkerButton=function(x){var k=this.markerButtons.find(function(W){return W.getAttribute("data-type-name")===x});k&&this.setActiveButton(k)},Y.prototype.setCurrentMarker=function(x){var k=this;this.currentMarker=x,this.buttons.filter(function(W){return/delete|notes/.test(W.getAttribute("data-action"))}).forEach(function(W){k.currentMarker===void 0?(W.style.fillOpacity="0.4",W.style.pointerEvents="none"):(W.style.fillOpacity="1",W.style.pointerEvents="all")})},Y}(),je=function(){function Y(x,k,W,ee){this.panels=[],this.panelButtons=[],this.markerjsContainer=x,this.displayMode=k,this.uiStyleSettings=W,this.styles=ee,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Y.prototype.addStyles=function(){var x;this.toolboxStyleClass=this.styles.addClass(new Re("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 Re("toolbox_colors",` color: `+this.uiStyleSettings.toolboxColor+`; `));var k=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Re("toolbox-button-row",` display: flex; cursor: default; box-sizing: content-box; `)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Re("toolbox-button-row_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`; `)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Re("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 Re("toolbox-panel-row_colors",` background-color: `+((x=this.uiStyleSettings.toolboxBackgroundColor)!==null&&x!==void 0?x:this.uiStyleSettings.toolbarBackgroundHoverColor)+`; `)),this.toolboxButtonStyleClass=this.styles.addClass(new Re("toolbox_button",` display: inline-block; width: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px; height: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px; padding: `+k+`px; box-sizing: content-box; `)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Re("toolbox-button_colors",` fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Re("toolbox-active-button_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`; fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.styles.addRule(new Ne("."+this.toolboxButtonStyleColorsClass.name+":hover",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+` `)),this.styles.addRule(new Ne("."+this.toolboxButtonStyleClass.name+" svg",` height: `+this.uiStyleSettings.toolbarHeight/2+`px; `))},Y.prototype.show=function(x){var k;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=x,this.uiContainer.className=this.toolboxStyleClass.name+" "+((k=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Y.prototype.setPanelButtons=function(x){var k,W,ee=this;this.panels=x,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((k=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((W=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&W!==void 0?W:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(V){var _e;V.uiStyleSettings=ee.uiStyleSettings;var Ke=document.createElement("div");Ke.className=ee.toolboxButtonStyleClass.name+" "+((_e=ee.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&_e!==void 0?_e:ee.toolboxButtonStyleColorsClass.name),Ke.innerHTML=V.icon,Ke.title=V.title,Ke.addEventListener("click",function(){ee.panelButtonClick(V)}),ee.panelButtons.push(Ke),ee.buttonRow.appendChild(Ke)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Y.prototype.panelButtonClick=function(x){var k=this,W=-1;if(x!==this.activePanel){W=this.panels.indexOf(x),this.panelRow.innerHTML="";var ee=x.getUi();ee.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ee),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=x}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){k.displayMode==="inline"?k.panelRow.style.display="none":k.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(V,_e){var Ke,et;V.className=k.toolboxButtonStyleClass.name+" "+(_e===W?""+((Ke=k.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ke!==void 0?Ke:k.toolboxActiveButtonStyleColorsClass.name):""+((et=k.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&et!==void 0?et:k.toolboxButtonStyleColorsClass.name))})},Y}(),ue=function(Y,x){this.title=Y,this.icon=x},Ee=function(Y){function x(k,W,ee,V){var _e=Y.call(this,k,V||'')||this;return _e.colors=[],_e.addTransparent=!1,_e.colorBoxes=[],_e.colors=W,_e.currentColor=ee,_e.setCurrentColor=_e.setCurrentColor.bind(_e),_e.getColorBox=_e.getColorBox.bind(_e),_e}return Se(x,Y),x.prototype.getUi=function(){var k=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.whiteSpace="nowrap",this.colors.forEach(function(ee){var V=k.getColorBox(ee);W.appendChild(V),k.colorBoxes.push(V)}),W},x.prototype.getColorBox=function(k){var W=this,ee=this.uiStyleSettings.toolbarHeight/4,V=this.uiStyleSettings.toolbarHeight-ee,_e=document.createElement("div");_e.style.display="inline-block",_e.style.boxSizing="content-box",_e.style.width=V-2+"px",_e.style.height=V-2+"px",_e.style.padding="1px",_e.style.marginRight="2px",_e.style.marginBottom="2px",_e.style.borderWidth="2px",_e.style.borderStyle="solid",_e.style.borderRadius=(V+2)/2+"px",_e.style.borderColor=k===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",_e.addEventListener("click",function(){W.setCurrentColor(k,_e)});var Ke=document.createElement("div");return Ke.style.display="inline-block",Ke.style.width=V-2+"px",Ke.style.height=V-2+"px",Ke.style.backgroundColor=k,Ke.style.borderRadius=V/2+"px",k==="transparent"&&(Ke.style.fill=this.uiStyleSettings.toolboxAccentColor,Ke.innerHTML=` `),_e.appendChild(Ke),_e},x.prototype.setCurrentColor=function(k,W){var ee=this;this.currentColor=k,this.colorBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(k)},x}(ue),Le=function(){function Y(x,k,W){this._state="new",this._isSelected=!1,this._container=x,this._overlayContainer=k,this.globalSettings=W,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Y.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Y.prototype.ownsTarget=function(x){return!1},Object.defineProperty(Y.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Y.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Y.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Y.prototype.pointerDown=function(x,k){},Y.prototype.dblClick=function(x,k){},Y.prototype.manipulate=function(x){},Y.prototype.pointerUp=function(x){this.stateChanged()},Y.prototype.dispose=function(){},Y.prototype.addMarkerVisualToContainer=function(x){this.container.childNodes.length>0?this.container.insertBefore(x,this.container.childNodes[0]):this.container.appendChild(x)},Y.prototype.getState=function(){return{typeName:Y.typeName,state:this.state,notes:this.notes}},Y.prototype.restoreState=function(x){this._state=x.state,this.notes=x.notes},Y.prototype.scale=function(x,k){},Y.prototype.colorChanged=function(x){this.onColorChanged&&this.onColorChanged(x),this.stateChanged()},Y.prototype.fillColorChanged=function(x){this.onFillColorChanged&&this.onFillColorChanged(x),this.stateChanged()},Y.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var x=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),x.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(x)&&this.onStateChanged(this)}},Y.typeName="MarkerBase",Y}(),Ie=function(){function Y(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Y.prototype.findGripByVisual=function(x){return this.topLeft.ownsTarget(x)?this.topLeft:this.topCenter.ownsTarget(x)?this.topCenter:this.topRight.ownsTarget(x)?this.topRight:this.centerLeft.ownsTarget(x)?this.centerLeft:this.centerRight.ownsTarget(x)?this.centerRight:this.bottomLeft.ownsTarget(x)?this.bottomLeft:this.bottomCenter.ownsTarget(x)?this.bottomCenter:this.bottomRight.ownsTarget(x)?this.bottomRight:void 0},Y}(),Ge=function(){function Y(){this.GRIP_SIZE=10,this.visual=ce.createGroup(),this.visual.appendChild(ce.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ce.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Y.prototype.ownsTarget=function(x){return x===this.visual||x===this.visual.childNodes[0]||x===this.visual.childNodes[1]},Y}(),Xe=function(){function Y(){}return Y.toITransformMatrix=function(x){return{a:x.a,b:x.b,c:x.c,d:x.d,e:x.e,f:x.f}},Y.toSVGMatrix=function(x,k){return x.a=k.a,x.b=k.b,x.c=k.c,x.d=k.d,x.e=k.e,x.f=k.f,x},Y}(),Je=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.left=0,V.top=0,V.width=0,V.height=0,V.defaultSize={x:50,y:20},V.offsetX=0,V.offsetY=0,V.rotationAngle=0,V.CB_DISTANCE=10,V._suppressMarkerCreateEvent=!1,V.container.transform.baseVal.appendItem(ce.createTransform()),V.setupControlBox(),V}return Se(x,Y),Object.defineProperty(x.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"visual",{get:function(){return this._visual},set:function(k){this._visual=k;var W=ce.createTransform();this._visual.transform.baseVal.appendItem(W)},enumerable:!1,configurable:!0}),x.prototype.ownsTarget=function(k){return!!Y.prototype.ownsTarget.call(this,k)||!!(this.controlGrips.findGripByVisual(k)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(k))},x.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.state==="new"&&(this.left=k.x,this.top=k.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ee=this.unrotatePoint(k);if(this.manipulationStartX=ee.x,this.manipulationStartY=ee.y,this.offsetX=ee.x-this.left,this.offsetY=ee.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(W),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(W)){this.activeGrip=this.rotatorGrip;var V=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=V.x-this.width/2,this.top=V.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var _e=this.container.transform.baseVal.getItem(0);_e.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(_e,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},x.prototype.pointerUp=function(k){var W=this.state;Y.prototype.pointerUp.call(this,k),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(k),this._state="select",W==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},x.prototype.moveVisual=function(k){this.visual.style.transform="translate("+k.x+"px, "+k.y+"px)"},x.prototype.manipulate=function(k){var W=this.unrotatePoint(k);this.state==="creating"?this.resize(k):this.state==="move"?(this.left=this.manipulationStartLeft+(W.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(W.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(W):this.state==="rotate"&&this.rotate(k)},x.prototype.resize=function(k){var W=this.manipulationStartLeft,ee=this.manipulationStartWidth,V=this.manipulationStartTop,_e=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:W=this.manipulationStartLeft+k.x-this.manipulationStartX,ee=this.manipulationStartWidth+this.manipulationStartLeft-W;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ee=this.manipulationStartWidth+k.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:V=this.manipulationStartTop+k.y-this.manipulationStartY,_e=this.manipulationStartHeight+this.manipulationStartTop-V;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:_e=this.manipulationStartHeight+k.y-this.manipulationStartY}ee>=0?(this.left=W,this.width=ee):(this.left=W+ee,this.width=-ee),_e>=0?(this.top=V,this.height=_e):(this.top=V+_e,this.height=-_e),this.setSize()},x.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},x.prototype.rotate=function(k){if(Math.abs(k.x-this.centerX)>.1){var W=Math.sign(k.x-this.centerX);this.rotationAngle=180*Math.atan((k.y-this.centerY)/(k.x-this.centerX))/Math.PI+90*W,this.applyRotation()}},x.prototype.applyRotation=function(){var k=this.container.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(k,0)},x.prototype.rotatePoint=function(k){if(this.rotationAngle===0)return k;var W=this.container.getCTM(),ee=ce.createPoint(k.x,k.y);return{x:(ee=ee.matrixTransform(W)).x,y:ee.y}},x.prototype.unrotatePoint=function(k){if(this.rotationAngle===0)return k;var W=this.container.getCTM();W=W.inverse();var ee=ce.createPoint(k.x,k.y);return{x:(ee=ee.matrixTransform(W)).x,y:ee.y}},x.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},x.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},x.prototype.setupControlBox=function(){this.controlBox=ce.createGroup();var k=ce.createTransform();k.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(k),this.container.appendChild(this.controlBox),this.controlRect=ce.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=ce.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Ie,this.addControlGrips(),this.controlBox.style.display="none"},x.prototype.adjustControlBox=function(){var k=this.controlBox.transform.baseVal.getItem(0);k.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(k,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},x.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()},x.prototype.createGrip=function(){var k=new Ge;return k.visual.transform.baseVal.appendItem(ce.createTransform()),this.controlBox.appendChild(k.visual),k},x.prototype.positionGrips=function(){var k=this.controlGrips.topLeft.GRIP_SIZE,W=-k/2,ee=W,V=(this.width+this.CB_DISTANCE)/2-k/2,_e=(this.height+this.CB_DISTANCE)/2-k/2,Ke=this.height+this.CB_DISTANCE-k/2,et=this.width+this.CB_DISTANCE-k/2;this.positionGrip(this.controlGrips.topLeft.visual,W,ee),this.positionGrip(this.controlGrips.topCenter.visual,V,ee),this.positionGrip(this.controlGrips.topRight.visual,et,ee),this.positionGrip(this.controlGrips.centerLeft.visual,W,_e),this.positionGrip(this.controlGrips.centerRight.visual,et,_e),this.positionGrip(this.controlGrips.bottomLeft.visual,W,Ke),this.positionGrip(this.controlGrips.bottomCenter.visual,V,Ke),this.positionGrip(this.controlGrips.bottomRight.visual,et,Ke),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,V,ee-3*this.CB_DISTANCE)},x.prototype.positionGrip=function(k,W,ee){var V=k.transform.baseVal.getItem(0);V.setTranslate(W,ee),k.transform.baseVal.replaceItem(V,0)},x.prototype.hideControlBox=function(){this.controlBox.style.display="none"},x.prototype.showControlBox=function(){this.controlBox.style.display=""},x.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Xe.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Xe.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Y.prototype.getState.call(this))},x.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var W=k;this.left=W.left,this.top=W.top,this.width=W.width,this.height=W.height,this.rotationAngle=W.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Xe.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,W.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Xe.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,W.containerTransformMatrix))},x.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W);var ee=this.rotatePoint({x:this.left,y:this.top}),V=this.unrotatePoint({x:ee.x*k,y:ee.y*W});this.left=V.x,this.top=V.y,this.width=this.width*k,this.height=this.height*W,this.adjustControlBox()},x}(Le),Qe=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.createVisual=V.createVisual.bind(V),V}return Se(x,Y),x.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual)},x.prototype.createVisual=function(){this.visual=ce.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)},x.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},x.prototype.manipulate=function(k){Y.prototype.manipulate.call(this,k)},x.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.setSize()},x.prototype.setSize=function(){Y.prototype.setSize.call(this),ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},x.prototype.pointerUp=function(k){Y.prototype.pointerUp.call(this,k),this.setSize()},x.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&ce.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},x.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&ce.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},x.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&ce.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},x.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&ce.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},x.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Y.prototype.getState.call(this))},x.prototype.restoreState=function(k){var W=k;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),Y.prototype.restoreState.call(this,k),this.setSize()},x.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W),this.setSize()},x.title="Rectangle marker",x}(Je),at=function(Y){function x(k,W,ee,V){var _e=Y.call(this,k,V||'')||this;return _e.widths=[],_e.widthBoxes=[],_e.widths=W,_e.currentWidth=ee,_e.setCurrentWidth=_e.setCurrentWidth.bind(_e),_e}return Se(x,Y),x.prototype.getUi=function(){var k=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.widths.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.flexGrow="2",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=ee===k.currentWidth?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentWidth(ee,V)}),W.appendChild(V);var _e=document.createElement("div");_e.innerText=ee.toString(),_e.style.marginRight="5px",V.appendChild(_e);var Ke=document.createElement("div");Ke.style.minHeight="20px",Ke.style.flexGrow="2",Ke.style.display="flex",Ke.style.alignItems="center";var et=document.createElement("hr");et.style.minWidth="20px",et.style.border="0px",et.style.borderTop=ee+"px solid "+k.uiStyleSettings.toolboxColor,et.style.flexGrow="2",Ke.appendChild(et),V.appendChild(Ke),k.widthBoxes.push(V)}),W},x.prototype.setCurrentWidth=function(k,W){var ee=this;this.currentWidth=k,this.widthBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},x}(ue),qe=function(Y){function x(k,W,ee,V){var _e=Y.call(this,k,V||'')||this;return _e.styles=[],_e.styleBoxes=[],_e.styles=W,_e.currentStyle=ee,_e.setCurrentStyle=_e.setCurrentStyle.bind(_e),_e}return Se(x,Y),x.prototype.getUi=function(){var k=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.styles.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/k.styles.length-5+"%",V.style.borderColor=ee===k.currentStyle?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentStyle(ee,V)}),W.appendChild(V);var _e=document.createElement("div");_e.style.minHeight="20px",_e.style.flexGrow="2",_e.style.overflow="hidden";var Ke=` `;_e.innerHTML=Ke,V.appendChild(_e),k.styleBoxes.push(V)}),W},x.prototype.setCurrentStyle=function(k,W){var ee=this;this.currentStyle=k,this.styleBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},x}(ue),tt=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new Ee("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new at("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new qe("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Se(x,Y),Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=x.typeName,k},x.typeName="FrameMarker",x.title="Frame marker",x.icon='',x}(Qe),Be=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},ut=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.x1=0,V.y1=0,V.x2=0,V.y2=0,V.defaultLength=50,V.manipulationStartX=0,V.manipulationStartY=0,V.manipulationStartX1=0,V.manipulationStartY1=0,V.manipulationStartX2=0,V.manipulationStartY2=0,V.setupControlBox(),V}return Se(x,Y),x.prototype.ownsTarget=function(k){return!!Y.prototype.ownsTarget.call(this,k)||!(!this.grip1.ownsTarget(k)&&!this.grip2.ownsTarget(k))},x.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.manipulationStartX=k.x,this.manipulationStartY=k.y,this.state==="new"&&(this.x1=k.x,this.y1=k.y,this.x2=k.x,this.y2=k.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(W)?this.activeGrip=this.grip1:this.grip2.ownsTarget(W)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},x.prototype.pointerUp=function(k){var W=this.state;Y.prototype.pointerUp.call(this,k),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(k),this._state="select",W==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},x.prototype.adjustVisual=function(){},x.prototype.manipulate=function(k){this.state==="creating"?this.resize(k):this.state==="move"?(this.x1=this.manipulationStartX1+k.x-this.manipulationStartX,this.y1=this.manipulationStartY1+k.y-this.manipulationStartY,this.x2=this.manipulationStartX2+k.x-this.manipulationStartX,this.y2=this.manipulationStartY2+k.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(k)},x.prototype.resize=function(k){switch(this.activeGrip){case this.grip1:this.x1=k.x,this.y1=k.y;break;case this.grip2:case void 0:this.x2=k.x,this.y2=k.y}this.adjustVisual(),this.adjustControlBox()},x.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},x.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},x.prototype.setupControlBox=function(){this.controlBox=ce.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},x.prototype.adjustControlBox=function(){this.positionGrips()},x.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},x.prototype.createGrip=function(){var k=new Ge;return k.visual.transform.baseVal.appendItem(ce.createTransform()),this.controlBox.appendChild(k.visual),k},x.prototype.positionGrips=function(){var k=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-k/2,this.y1-k/2),this.positionGrip(this.grip2.visual,this.x2-k/2,this.y2-k/2)},x.prototype.positionGrip=function(k,W,ee){var V=k.transform.baseVal.getItem(0);V.setTranslate(W,ee),k.transform.baseVal.replaceItem(V,0)},x.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Y.prototype.getState.call(this))},x.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var W=k;this.x1=W.x1,this.y1=W.y1,this.x2=W.x2,this.y2=W.y2},x.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W),this.x1=this.x1*k,this.y1=this.y1*W,this.x2=this.x2*k,this.y2=this.y2*W,this.adjustVisual(),this.adjustControlBox()},x}(Le),ot=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new Ee("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new at("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new qe("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Se(x,Y),x.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorLine&&k!==this.visibleLine)},x.prototype.createVisual=function(){this.visual=ce.createGroup(),this.selectorLine=ce.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ce.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)},x.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},x.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()),ce.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ce.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},x.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},x.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},x.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Y.prototype.getState.call(this));return k.typeName=x.typeName,k},x.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var W=k;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.createVisual(),this.adjustVisual()},x.typeName="LineMarker",x.title="Line marker",x.icon='',x}(ut),Ue=function(Y){function x(k,W,ee,V){var _e=Y.call(this,k,V||'')||this;return _e.fonts=[],_e.fontBoxes=[],_e.fonts=W,_e.currentFont=ee,_e.setCurrentFont=_e.setCurrentFont.bind(_e),_e}return Se(x,Y),x.prototype.getUi=function(){var k=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.flexGrow="2",this.fonts.forEach(function(ee){var V=document.createElement("div");V.style.display="inline-block",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/k.fonts.length-5+"%",V.style.borderColor=ee===k.currentFont?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentFont(ee,V)}),W.appendChild(V);var _e=document.createElement("div");_e.style.display="flex",_e.style.minHeight="20px",_e.style.flexGrow="2",_e.style.fontFamily=ee,_e.style.overflow="hidden";var Ke=document.createElement("div");Ke.style.whiteSpace="nowrap",Ke.style.overflow="hidden",Ke.style.textOverflow="ellipsis",Ke.innerHTML="The quick brown fox jumps over the lazy dog",_e.appendChild(Ke),V.appendChild(_e),k.fontBoxes.push(V)}),W},x.prototype.setCurrentFont=function(k,W){var ee=this;this.currentFont=k,this.fontBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},x}(ue),He=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.color="transparent",V.padding=5,V.DEFAULT_TEXT="your text here",V.text=V.DEFAULT_TEXT,V.isMoved=!1,V.color=ee.defaultColor,V.fontFamily=ee.defaultFontFamily,V.defaultSize={x:100,y:30},V.setColor=V.setColor.bind(V),V.setFont=V.setFont.bind(V),V.renderText=V.renderText.bind(V),V.sizeText=V.sizeText.bind(V),V.textEditDivClicked=V.textEditDivClicked.bind(V),V.showTextEditor=V.showTextEditor.bind(V),V.setSize=V.setSize.bind(V),V.positionTextEditor=V.positionTextEditor.bind(V),V.colorPanel=new Ee("Color",ee.defaultColorSet,ee.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.fontFamilyPanel=new Ue("Font",ee.defaultFontFamilies,ee.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V}return Se(x,Y),x.prototype.ownsTarget=function(k){if(Y.prototype.ownsTarget.call(this,k)||k===this.visual||k===this.textElement||k===this.bgRectangle)return!0;var W=!1;return this.textElement.childNodes.forEach(function(ee){ee===k&&(W=!0)}),W},x.prototype.createVisual=function(){this.visual=ce.createGroup(),this.bgRectangle=ce.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ce.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ce.createTransform()),this.textElement.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},x.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.isMoved=!1,this.pointerDownPoint=k,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},x.prototype.renderText=function(){var k=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(W){k.textElement.appendChild(ce.createTSpan(W.trim()===""?" ":W.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},x.prototype.getTextScale=function(){var k=this.textElement.getBBox(),W=1;if(k.width>0&&k.height>0){var ee=(1*this.width-this.width*this.padding*2/100)/k.width,V=(1*this.height-this.height*this.padding*2/100)/k.height;W=Math.min(ee,V)}return W},x.prototype.getTextPosition=function(k){var W=this.textElement.getBBox(),ee=0,V=0;return W.width>0&&W.height>0&&(ee=(this.width-W.width*k)/2,V=this.height/2-W.height*k/2),{x:ee,y:V}},x.prototype.sizeText=function(){var k=this.textElement.getBBox(),W=this.getTextScale(),ee=this.getTextPosition(W);ee.y-=k.y*W,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ee.x+"px, "+ee.y+"px) scale("+W+", "+W+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ee.x,ee.y),this.textElement.transform.baseVal.getItem(1).setScale(W,W))},x.prototype.manipulate=function(k){Y.prototype.manipulate.call(this,k),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(k.x-this.pointerDownPoint.x)>5||Math.abs(k.y-this.pointerDownPoint.y)>5)},x.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.isMoved=!0,this.setSize(),this.sizeText()},x.prototype.setSize=function(){Y.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},x.prototype.pointerUp=function(k){var W=this.state;W==="creating"&&(this._suppressMarkerCreateEvent=!0),Y.prototype.pointerUp.call(this,k),this.setSize(),(W==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},x.prototype.showTextEditor=function(){var k=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(W){W.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var W=Number.parseFloat(k.textEditor.style.fontSize);k.textEditor.clientWidth>=Number.parseInt(k.textEditor.style.maxWidth)&&W>.9;)W-=.1,k.textEditor.style.fontSize=Math.max(W,.9)+"em"}),this.textEditor.addEventListener("keyup",function(W){W.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(W){if(W.clipboardData){var ee=W.clipboardData.getData("text"),V=window.getSelection();if(!V.rangeCount)return!1;V.deleteFromDocument(),V.getRangeAt(0).insertNode(document.createTextNode(ee)),W.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){k.textEditDivClicked(k.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},x.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var k=this.getTextScale(),W=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ee=this.textElement.getBBox(),V={x:ee.width*k,y:ee.height*k};W.x-=V.x/2,W.y-=V.y/2,this.textEditor.style.top=W.y+"px",this.textEditor.style.left=W.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-W.x+"px",this.textEditor.style.fontSize=Math.max(16*k,12)+"px",this.textElement.style.display="none"}},x.prototype.textEditDivClicked=function(k){this.text=k.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},x.prototype.select=function(){Y.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},x.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Y.prototype.deselect.call(this)},x.prototype.dblClick=function(k,W){Y.prototype.dblClick.call(this,k,W),this.showTextEditor()},x.prototype.setColor=function(k){this.textElement&&ce.setAttributes(this.textElement,[["fill",k]]),this.color=k,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(k)},x.prototype.setFont=function(k){this.textElement&&ce.setAttributes(this.textElement,[["font-family",k]]),this.fontFamily=k,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},x.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},x.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Y.prototype.getState.call(this));return k.typeName=x.typeName,k},x.prototype.restoreState=function(k){var W=k;this.color=W.color,this.fontFamily=W.fontFamily,this.padding=W.padding,this.text=W.text,this.createVisual(),Y.prototype.restoreState.call(this,k),this.setSize()},x.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W),this.setSize(),this.sizeText(),this.positionTextEditor()},x.typeName="TextMarker",x.title="Text marker",x.icon='',x}(Je),Te=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.color="transparent",V.lineWidth=3,V.drawing=!1,V.pixelRatio=1,V.color=ee.defaultColor,V.lineWidth=ee.defaultStrokeWidth,V.pixelRatio=ee.freehandPixelRatio,V.setColor=V.setColor.bind(V),V.addCanvas=V.addCanvas.bind(V),V.finishCreation=V.finishCreation.bind(V),V.setLineWidth=V.setLineWidth.bind(V),V.colorPanel=new Ee("Color",ee.defaultColorSet,ee.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.lineWidthPanel=new at("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.lineWidthPanel.onWidthChanged=V.setLineWidth,V}return Se(x,Y),x.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.drawingImage)},x.prototype.createVisual=function(){this.visual=ce.createGroup(),this.drawingImage=ce.createImage(),this.visual.appendChild(this.drawingImage);var k=ce.createTransform();this.visual.transform.baseVal.appendItem(k),this.addMarkerVisualToContainer(this.visual)},x.prototype.pointerDown=function(k,W){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(k.x,k.y),this.drawing=!0):Y.prototype.pointerDown.call(this,k,W)},x.prototype.manipulate=function(k){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(k.x,k.y),this.canvasContext.stroke()):Y.prototype.manipulate.call(this,k)},x.prototype.resize=function(k){Y.prototype.resize.call(this,k),ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},x.prototype.pointerUp=function(k){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Y.prototype.pointerUp.call(this,k)},x.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)},x.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.select.call(this)},x.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.deselect.call(this)},x.prototype.finishCreation=function(){for(var k=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),W=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ee=W[0],V=W[1],_e=W[2],Ke=W[3],et=!1,pt=0;pt0&&(et=!0,ptKe&&(Ke=pt),Ve>_e&&(_e=Ve));if(et){this.left=ee/this.pixelRatio,this.top=V/this.pixelRatio,this.width=(_e-ee)/this.pixelRatio,this.height=(Ke-V)/this.pixelRatio;var _t=document.createElement("canvas");_t.width=_e-ee,_t.height=Ke-V,_t.getContext("2d").putImageData(this.canvasContext.getImageData(ee,V,_e-ee,Ke-V),0,0),this.drawingImgUrl=_t.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},x.prototype.setDrawingImage=function(){ce.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ce.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},x.prototype.setColor=function(k){this.color=k,this.colorChanged(k)},x.prototype.setLineWidth=function(k){this.lineWidth=k},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Object.assign({drawingImgUrl:this.drawingImgUrl},Y.prototype.getState.call(this));return k.typeName=x.typeName,k},x.prototype.restoreState=function(k){this.createVisual(),Y.prototype.restoreState.call(this,k),this.drawingImgUrl=k.drawingImgUrl,this.setDrawingImage()},x.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W),this.setDrawingImage()},x.typeName="FreehandMarker",x.title="Freehand marker",x.icon='',x}(Je),me=function(Y){function x(k,W,ee){var V=Y.call(this,k,ee||'')||this;return V.typeBoxes=[],V.currentType=W,V.setCurrentType=V.setCurrentType.bind(V),V}return Se(x,Y),x.prototype.getUi=function(){var k=this,W=document.createElement("div");W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2";for(var ee=function(Ke){var et="both";switch(Ke){case 0:et="both";break;case 1:et="start";break;case 2:et="end";break;case 3:et="none"}var pt=document.createElement("div");if(pt.style.display="flex",pt.style.flexGrow="2",pt.style.alignItems="center",pt.style.justifyContent="space-between",pt.style.padding="5px",pt.style.borderWidth="2px",pt.style.borderStyle="solid",pt.style.borderColor=et===V.currentType?V.uiStyleSettings.toolboxAccentColor:"transparent",pt.addEventListener("click",function(){k.setCurrentType(et,pt)}),W.appendChild(pt),et==="both"||et==="start"){var Ve=document.createElement("div");Ve.style.display="flex",Ve.style.alignItems="center",Ve.style.minHeight="20px",Ve.innerHTML=` `,Ve.style.marginLeft="5px",pt.appendChild(Ve)}var _t=document.createElement("div");_t.style.display="flex",_t.style.alignItems="center",_t.style.minHeight="20px",_t.style.flexGrow="2";var jt=document.createElement("hr");if(jt.style.minWidth="20px",jt.style.border="0px",jt.style.borderTop="3px solid "+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee"),jt.style.flexGrow="2",_t.appendChild(jt),pt.appendChild(_t),et==="both"||et==="end"){var $t=document.createElement("div");$t.style.display="flex",$t.style.alignItems="center",$t.style.minHeight="20px",$t.innerHTML=` `,$t.style.marginRight="5px",pt.appendChild($t)}V.typeBoxes.push(pt)},V=this,_e=0;_e<4;_e++)ee(_e);return W},x.prototype.setCurrentType=function(k,W){var ee=this;this.currentType=k,this.typeBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings!==void 0?ee.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},x}(ue),be=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.arrowType="end",V.arrowBaseHeight=10,V.arrowBaseWidth=10,V.getArrowPoints=V.getArrowPoints.bind(V),V.setArrowType=V.setArrowType.bind(V),V.arrowTypePanel=new me("Arrow type","end"),V.arrowTypePanel.onArrowTypeChanged=V.setArrowType,V}return Se(x,Y),x.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.arrow1&&k!==this.arrow2)},x.prototype.getArrowPoints=function(k,W){var ee=this.arrowBaseWidth+2*this.strokeWidth,V=this.arrowBaseHeight+2*this.strokeWidth;return k-ee/2+","+(W+V/2)+" "+k+","+(W-V/2)+" "+(k+ee/2)+","+(W+V/2)},x.prototype.createTips=function(){this.arrow1=ce.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ce.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ce.createTransform()),this.visual.appendChild(this.arrow2)},x.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.state==="creating"&&this.createTips()},x.prototype.adjustVisual=function(){if(Y.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",ce.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ce.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.arrow1.transform.baseVal.getItem(0);W.setRotate(k,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(W,0);var ee=this.arrow2.transform.baseVal.getItem(0);ee.setRotate(k+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ee,0)}},x.prototype.setArrowType=function(k){this.arrowType=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Object.assign({arrowType:this.arrowType},Y.prototype.getState.call(this));return k.typeName=x.typeName,k},x.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var W=k;this.arrowType=W.arrowType,this.createTips(),this.adjustVisual()},x.typeName="ArrowMarker",x.title="Arrow marker",x.icon='',x}(ot),ae=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.fillColor=ee.defaultFillColor,V.strokeWidth=0,V.fillPanel=new Ee("Color",ee.defaultColorSet,ee.defaultFillColor),V.fillPanel.onColorChanged=V.setFillColor,V}return Se(x,Y),Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=x.typeName,k},x.typeName="CoverMarker",x.title="Cover marker",x.icon='',x}(Qe),le=function(Y){function x(k,W,ee,V){var _e=Y.call(this,k,V||'')||this;return _e.opacities=[],_e.opacityBoxes=[],_e.opacities=W,_e.currentOpacity=ee,_e.setCurrentOpacity=_e.setCurrentOpacity.bind(_e),_e}return Se(x,Y),x.prototype.getUi=function(){var k=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",W.style.justifyContent="space-between",this.opacities.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="center",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=ee===k.currentOpacity?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentOpacity(ee,V)}),W.appendChild(V);var _e=document.createElement("div");_e.innerText=100*ee+"%",V.appendChild(_e),k.opacityBoxes.push(V)}),W},x.prototype.setCurrentOpacity=function(k,W){var ee=this;this.currentOpacity=k,this.opacityBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},x}(ue),de=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.setOpacity=V.setOpacity.bind(V),V.fillColor=ee.defaultHighlightColor,V.strokeWidth=0,V.opacity=ee.defaultHighlightOpacity,V.fillPanel=new Ee("Color",ee.defaultColorSet,V.fillColor),V.fillPanel.onColorChanged=V.setFillColor,V.opacityPanel=new le("Opacity",ee.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return Se(x,Y),x.prototype.setOpacity=function(k){this.opacity=k,this.visual&&ce.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=x.typeName,k},x.typeName="HighlightMarker",x.title="Highlight marker",x.icon='',x}(ae),ge='',we=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.bgColor="transparent",V.tipPosition={x:0,y:0},V.tipBase1Position={x:0,y:0},V.tipBase2Position={x:0,y:0},V.tipMoving=!1,V.color=ee.defaultStrokeColor,V.bgColor=ee.defaultFillColor,V.fontFamily=ee.defaultFontFamily,V.defaultSize={x:100,y:30},V.setBgColor=V.setBgColor.bind(V),V.getTipPoints=V.getTipPoints.bind(V),V.positionTip=V.positionTip.bind(V),V.setTipPoints=V.setTipPoints.bind(V),V.colorPanel=new Ee("Text color",ee.defaultColorSet,V.color,''),V.colorPanel.onColorChanged=V.setColor,V.bgColorPanel=new Ee("Fill color",ee.defaultColorSet,V.bgColor,ge),V.bgColorPanel.onColorChanged=V.setBgColor,V.fontFamilyPanel=new Ue("Font",ee.defaultFontFamilies,ee.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V.tipGrip=new Ge,V.tipGrip.visual.transform.baseVal.appendItem(ce.createTransform()),V.controlBox.appendChild(V.tipGrip.visual),V}return Se(x,Y),x.prototype.ownsTarget=function(k){return Y.prototype.ownsTarget.call(this,k)||this.tipGrip.ownsTarget(k)||this.tip===k},x.prototype.createTip=function(){ce.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ce.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},x.prototype.pointerDown=function(k,W){this.state==="new"&&Y.prototype.pointerDown.call(this,k,W),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(W)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Y.prototype.pointerDown.call(this,k,W)},x.prototype.pointerUp=function(k){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Y.prototype.pointerUp.call(this,k);else{var W=this.state==="creating";Y.prototype.pointerUp.call(this,k),this.setTipPoints(W),this.positionTip()}},x.prototype.manipulate=function(k){if(this.tipMoving){var W=this.unrotatePoint(k);this.tipPosition={x:W.x-this.manipulationStartLeft,y:W.y-this.manipulationStartTop},this.positionTip()}else Y.prototype.manipulate.call(this,k)},x.prototype.setBgColor=function(k){this.bgRectangle&&this.tip&&(ce.setAttributes(this.bgRectangle,[["fill",k]]),ce.setAttributes(this.tip,[["fill",k]])),this.bgColor=k,this.fillColorChanged(k)},x.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},x.prototype.setTipPoints=function(k){k===void 0&&(k=!1);var W=Math.min(this.height/2,15),ee=this.height/5;k&&(this.tipPosition={x:W+ee/2,y:this.height+20});var V=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?V.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.tip1.transform.baseVal.getItem(0);W.setRotate(k,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(W,0);var ee=this.tip2.transform.baseVal.getItem(0);ee.setRotate(k+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ee,0)}},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=x.typeName,k},x.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k),this.createTips(),this.adjustVisual()},x.typeName="MeasurementMarker",x.title="Measurement marker",x.icon='',x}(ot),st=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.strokePanel.colors=ee.defaultColorSet,V.fillColor="transparent",V}return Se(x,Y),Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=x.typeName,k},x.typeName="EllipseFrameMarker",x.title="Ellipse frame marker",x.icon='',x}(Fe),mt=function(){function Y(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Y.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Y.prototype.addUndoStep=function(x){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(x)||(this.undoStack.push(x),JSON.stringify(this.lastRedoStep)!==JSON.stringify(x)&&this.redoStack.splice(0,this.redoStack.length))},Y.prototype.replaceLastUndoStep=function(x){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=x)},Y.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Y.prototype.undo=function(){if(this.undoStack.length>1){var x=this.undoStack.pop();return x!==void 0&&this.redoStack.push(x),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Y.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Y}(),ft=function(Y){function x(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.curveX=0,V.curveY=0,V.manipulationStartCurveX=0,V.manipulationStartCurveY=0,V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.positionGrips=V.positionGrips.bind(V),V.addControlGrips=V.addControlGrips.bind(V),V.adjustVisual=V.adjustVisual.bind(V),V.setupControlBox=V.setupControlBox.bind(V),V.resize=V.resize.bind(V),V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new Ee("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new at("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new qe("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Se(x,Y),x.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorCurve&&k!==this.visibleCurve&&!this.curveGrip.ownsTarget(k))},x.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},x.prototype.createVisual=function(){this.visual=ce.createGroup(),this.selectorCurve=ce.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ce.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)},x.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=k.x,this.curveY=k.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(W)&&(this.activeGrip=this.curveGrip,this._state="resize")},x.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ce.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ce.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ce.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},x.prototype.setupControlBox=function(){Y.prototype.setupControlBox.call(this),this.curveControlLine1=ce.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ce.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)},x.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Y.prototype.addControlGrips.call(this)},x.prototype.positionGrips=function(){Y.prototype.positionGrips.call(this);var k=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-k/2,this.curveY-k/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},x.prototype.manipulate=function(k){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+k.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+k.y-this.manipulationStartY),Y.prototype.manipulate.call(this,k)},x.prototype.resize=function(k){this.activeGrip===this.curveGrip&&(this.curveX=k.x,this.curveY=k.y),Y.prototype.resize.call(this,k),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},x.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},x.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},x.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual()},x.prototype.scale=function(k,W){this.curveX=this.curveX*k,this.curveY=this.curveY*W,Y.prototype.scale.call(this,k,W)},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Y.prototype.getState.call(this));return k.typeName=x.typeName,k},x.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var W=k;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.curveX=W.curveX,this.curveY=W.curveY,this.createVisual(),this.adjustVisual()},x.typeName="CurveMarker",x.title="Curve marker",x.icon='',x}(ut),wt=function(){function Y(x,k){k===void 0&&(k=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=x,this.cancelable=k}return Object.defineProperty(Y.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Y.prototype.preventDefault=function(){this._defaultPrevented=!0},Y}(),St=function(Y){function x(k,W,ee){var V=Y.call(this,k,!1)||this;return V.dataUrl=W,V.state=ee,V}return Se(x,Y),x}(wt),ct=function(Y){function x(k,W,ee){ee===void 0&&(ee=!1);var V=Y.call(this,k,ee)||this;return V.marker=W,V}return Se(x,Y),x}(wt),Ut=function(){function Y(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return Y.prototype.addEventListener=function(x,k){this[x].push(k)},Y.prototype.removeEventListener=function(x,k){var W=this[x].indexOf(k);W>-1&&this[x].splice(W,1)},Y}(),Lt=function(){function Y(x){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Be,this._isOpen=!1,this.undoRedoManager=new mt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Ut,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Y.instanceCounter++,this.styles=new ke(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=x,this.targetRoot=document.body,this.width=x.clientWidth,this.height=x.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(Y.prototype,"ALL_MARKER_TYPES",{get:function(){return[tt,Te,be,He,st,Fe,de,we,ze,ae,ot,ft]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[tt,Te,be,He,Fe,de,we]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"BASIC_MARKER_TYPES",{get:function(){return[tt,Te,be,He,de]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(x){var k=this;this._availableMarkerTypes.splice(0),x.forEach(function(W){if(typeof W=="string"){var ee=k.ALL_MARKER_TYPES.find(function(V){return V.typeName===W});ee!==void 0&&k._availableMarkerTypes.push(ee)}else k._availableMarkerTypes.push(W)})},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(x){this._zoomLevel=x,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Y.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),re.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Y.prototype.show=function(){var x=this;this.styles.styleSheetRoot===void 0&&se.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=se.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(k){return k(new wt(x))})},Y.prototype.render=function(){return Ae(this,void 0,void 0,function(){var x;return Oe(this,function(k){switch(k.label){case 0:return this.setCurrentMarker(),(x=new fe).naturalSize=this.renderAtNaturalSize,x.imageType=this.renderImageType,x.imageQuality=this.renderImageQuality,x.markersOnly=this.renderMarkersOnly,x.width=this.renderWidth,x.height=this.renderHeight,[4,x.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return k.sent(),[4,x.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,k.sent()]}})})},Y.prototype.close=function(x){var k=this;if(x===void 0&&(x=!1),this.isOpen){var W=!1;x||this.eventListeners.beforeclose.forEach(function(ee){var V=new wt(k,!0);ee(V),V.defaultPrevented&&(W=!0)}),W||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(ee){return ee(new wt(k))}),this.detachEvents(),this._isOpen=!1)}},Y.prototype.addMarkersToToolbar=function(){for(var x,k=[],W=0;Wthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*x:this.editorCanvas.clientWidth,W=k',x.title="Powered by marker.js",x.style.display="grid",x.style.alignItems="center",x.style.justifyItems="center",x.style.padding="3px",x.style.width="20px",x.style.height="20px",this.logoUI.appendChild(x),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Y.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},Y.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},Y.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Y.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var x=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=x+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Pe(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(x),1),x.dispose()},Y.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},Y.prototype.toolbarButtonClicked=function(x,k){if(x==="marker"&&k!==void 0)this.createNewMarker(k);else if(x==="action")switch(k){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},Y.prototype.deleteSelectedMarker=function(){var x=this;if(this._currentMarker!==void 0){var k=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ee){var V=new ct(x,x._currentMarker,!0);ee(V),V.defaultPrevented&&(k=!0)}),!k){var W=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(ee){return ee(new ct(x,W))})}}},Y.prototype.clear=function(){var x=this,k=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(_e){var Ke=new ct(x,void 0,!0);_e(Ke),Ke.defaultPrevented&&(k=!0)}),!k)){this.setCurrentMarker();for(var W=function(_e){var Ke=ee.markers[_e];ee.setCurrentMarker(ee.markers[_e]),ee._currentMarker.dispose(),ee.markerImage.removeChild(ee._currentMarker.container),ee.markers.splice(ee.markers.indexOf(ee._currentMarker),1),ee.eventListeners.markerdelete.forEach(function(et){return et(new ct(x,Ke))})},ee=this,V=this.markers.length-1;V>=0;V--)W(V);this.addUndoStep()}},Object.defineProperty(Y.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Y.prototype.showNotesEditor=function(){var x;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=(x=this._currentMarker.notes)!==null&&x!==void 0?x:"",this.overlayContainer.appendChild(this.notesArea))},Y.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},Y.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Y.prototype.addUndoStep=function(){var x=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var k=this.getState(),W=this.undoRedoManager.getLastUndoStep();if(!W||W.width===k.width&&W.height===k.height){var ee=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(k),ee1&&this.panTo({x:x.clientX,y:x.clientY}))},Y.prototype.onPointerUp=function(x){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(x.clientX,x.clientY)),this.isDragging=!1,this.addUndoStep()},Y.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Y.prototype.onKeyUp=function(x){this._currentMarker===void 0||this.notesArea!==void 0||x.key!=="Delete"&&x.key!=="Backspace"||this.deleteSelectedMarker()},Y.prototype.clientToLocalCoordinates=function(x,k){var W=this.markerImage.getBoundingClientRect();return{x:(x-W.left)/this.zoomLevel,y:(k-W.top)/this.zoomLevel}},Y.prototype.onWindowResize=function(){this.positionUI()},Y.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var x=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=x+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},Y.prototype.addLicenseKey=function(x){re.addKey(x)},Y.prototype.addEventListener=function(x,k){this.eventListeners.addEventListener(x,k)},Y.prototype.removeEventListener=function(x,k){this.eventListeners.removeEventListener(x,k)},Y.prototype.renderState=function(x){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(x),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Y.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Y.prototype.focus=function(){var x=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(k){return k(new wt(x))}))},Y.prototype.blur=function(){var x=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(k){return k(new wt(x))}))},Y.instanceCounter=0,Y}();/* ********************************** cropro version 1.2.0 @license SEE LICENSE IN LICENSE copyright Alan Mendelevich see README and LICENSE for details ********************************** *//*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var qt=function(Y,x){return(qt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,W){k.__proto__=W}||function(k,W){for(var ee in W)Object.prototype.hasOwnProperty.call(W,ee)&&(k[ee]=W[ee])})(Y,x)};function Qt(Y,x){if(typeof x!="function"&&x!==null)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");function k(){this.constructor=Y}qt(Y,x),Y.prototype=x===null?Object.create(x):(k.prototype=x.prototype,new k)}function It(Y,x,k,W){return new(k||(k=Promise))(function(ee,V){function _e(pt){try{et(W.next(pt))}catch(Ve){V(Ve)}}function Ke(pt){try{et(W.throw(pt))}catch(Ve){V(Ve)}}function et(pt){var Ve;pt.done?ee(pt.value):(Ve=pt.value,Ve instanceof k?Ve:new k(function(_t){_t(Ve)})).then(_e,Ke)}et((W=W.apply(Y,x||[])).next())})}function Cr(Y,x){var k,W,ee,V,_e={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return V={next:Ke(0),throw:Ke(1),return:Ke(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function Ke(et){return function(pt){return function(Ve){if(k)throw new TypeError("Generator is already executing.");for(;_e;)try{if(k=1,W&&(ee=2&Ve[0]?W.return:Ve[0]?W.throw||((ee=W.return)&&ee.call(W),0):W.next)&&!(ee=ee.call(W,Ve[1])).done)return ee;switch(W=0,ee&&(Ve=[2&Ve[0],ee.value]),Ve[0]){case 0:case 1:ee=Ve;break;case 4:return _e.label++,{value:Ve[1],done:!1};case 5:_e.label++,W=Ve[1],Ve=[0];continue;case 7:Ve=_e.ops.pop(),_e.trys.pop();continue;default:if(!(ee=_e.trys,(ee=ee.length>0&&ee[ee.length-1])||Ve[0]!==6&&Ve[0]!==2)){_e=0;continue}if(Ve[0]===3&&(!ee||Ve[1]>ee[0]&&Ve[1]0&&k>0){var W=new Ur(x,k),ee=W.ratio>=1?20:W.getHorizontalLength(20),V=W.ratio<1?20:W.getVerticalLength(20),_e=document.createElementNS("http://www.w3.org/2000/svg","svg");_e.setAttribute("xmlns","http://www.w3.org/2000/svg"),_e.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(_e);var Ke=yt.createDefs();_e.appendChild(Ke);var et=yt.createElement("clipPath",[["id","text-bg-clip"]]);Ke.appendChild(et);var pt=yt.createPath(yt.getHollowRectanglePath((24-ee)/2,(24-V)/2,ee,V,(24-ee)/2+2,(24-V)/2+2,ee-4,V-4));_e.appendChild(pt);var Ve=yt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ve.appendChild(yt.createTSpan(x+":"+k)),_e.appendChild(Ve);var _t=Ve.getBBox();yt.setAttributes(Ve,[["x",((24-_t.width)/2).toString()],["y",((24-_t.height)/2-_t.y).toString()]]);var jt=yt.createPath(yt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(_t.width))/2,(24-Math.ceil(_t.height))/2,Math.ceil(_t.width),Math.ceil(_t.height)));return et.appendChild(jt),yt.setAttributes(pt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(_e),_e.outerHTML}return''},Y}(),Jt=function(Y){function x(k,W,ee){var V=Y.call(this,k,W)||this;return V.isDropdownOpen=!1,V.onClick=V.dropdownButtonClicked,V.dropdownButtons=ee,V}return Qt(x,Y),x.prototype.setupDropdown=function(){var k=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(W){W.className=k.className,W.colorsClassName=k.colorsClassName,k.dropdownBlock.appendChild(W.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},x.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},x.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},x.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},x.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},x.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},x}(Pt),Rt=function(){function Y(x,k){this.GRIP_SIZE=10,this.color=x,this.fillColor=k,this.visual=yt.createGroup(),this.visual.appendChild(yt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(yt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Y.prototype.ownsTarget=function(x){return x===this.visual||x===this.visual.childNodes[0]||x===this.visual.childNodes[1]},Y.prototype.setCenter=function(x,k){this.visual.childNodes.forEach(function(W){return yt.setAttributes(W,[["cx",x.toString()],["cy",k.toString()]])})},Y}(),lr=function(){function Y(x,k,W,ee){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=x,this.canvasHeight=k,this.margin=W,this.container=ee,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(Y.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(x){this._aspectRatio=x,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(x){this._isGridVisible=x,this.gridContainer&&yt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(x){this._zoomFactor=x,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Y.prototype.open=function(){var x=this;this.cropShadeElement=yt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=yt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var k=0;kthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-k.height/2),yt.setAttributes(this.cropRectElement,[["x",k.x.toString()],["y",k.y.toString()],["width",k.width.toString()],["height",k.height.toString()]]);var W=k.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(V,_e){var Ke=k.y+W*(_e+1);yt.setAttributes(V,[["x1",""+k.x],["y1",""+Ke],["x2",""+(k.x+k.width)],["y2",""+Ke]])});var ee=k.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(V,_e){var Ke=k.x+ee*(_e+1);yt.setAttributes(V,[["x1",""+Ke],["y1",""+k.y],["x2",""+Ke],["y2",""+(k.y+k.height)]])}),yt.setAttributes(this.cropShadeElement,[["d",yt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,k.x,k.y,k.width,k.height)]]),this.topLeftGrip.setCenter(k.x,k.y),this.topRightGrip.setCenter(k.x+k.width,k.y),this.bottomLeftGrip.setCenter(k.x,k.y+k.height),this.bottomRightGrip.setCenter(k.x+k.width,k.y+k.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},Y.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},Y.prototype.clientToLocalCoordinates=function(x,k){var W=this.container.getBoundingClientRect();return{x:x-W.left+this.margin,y:k-W.top+this.margin}},Y.prototype.onPointerDown=function(x){this.container.setPointerCapture(x.pointerId),this.previousPoint=this.clientToLocalCoordinates(x.clientX,x.clientY),this.cropRectElement===x.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(x.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(x.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(x.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(x.target)&&(this.activeGrip=this.bottomRightGrip)},Y.prototype.onPointerMove=function(x){if(this.isMoving)this.move(this.clientToLocalCoordinates(x.clientX,x.clientY));else if(this.activeGrip){var k=this.clientToLocalCoordinates(x.clientX,x.clientY);this.resize(k)}x.preventDefault()},Y.prototype.onPointerUp=function(x){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(x.pointerId)},Y.prototype.move=function(x){var k=x.x-this.previousPoint.x,W=x.y-this.previousPoint.y;this.zoomFactor!==1&&(k=-k/this.zoomFactor,W=-W/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+k),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+W),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=x},Y.prototype.resize=function(x){var k=Object.assign({},this.cropRect),W=x.x-this.previousPoint.x,ee=x.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:k.x+Wthis.canvasWidth*this.zoomFactor&&(W=this.canvasWidth*this.zoomFactor-k.width),k.width+=W}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(k.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(W),k.height=this.aspectRatio.getVerticalLength(k.width)):(k.y+=ee,k.height=this.cropRect.y+this.cropRect.height-k.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?k.height=this.aspectRatio.getVerticalLength(k.width):k.height+=ee}k.width<10&&(k.x=this.cropRect.x,k.width=10),k.height<10&&(k.y=this.cropRect.y,k.height=10),this.previousPoint=x,k.x>=this.margin&&k.y>=this.margin&&k.x-this.margin+k.width<=this.canvasWidth&&k.y-this.margin+k.height<=this.canvasHeight&&(this.cropRect=k,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},Y.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var x=this.cropRect.x+this.cropRect.width/2,k=this.cropRect.y+this.cropRect.height/2,W=this.aspectRatio.getHorizontalLength(this.cropRect.height),ee=this.aspectRatio.getVerticalLength(this.cropRect.width);W/this.canvasWidththis.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=x-this.cropRect.width/2,this.cropRect.y=k-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},Y.prototype.getRescaledRect=function(x,k,W,ee,V,_e){var Ke=W/x,et=ee/k;return{x:(V.x-_e)*Ke+_e,y:(V.y-_e)*et+_e,width:V.width*Ke,height:V.height*et}},Y.prototype.scaleCanvas=function(x,k){var W=this.getRescaledRect(this.canvasWidth,this.canvasHeight,x,k,this.cropRect,this.margin);this.canvasWidth=x,this.canvasHeight=k,this.onCropChange&&this.onCropChange(W),this.setCropRectangle(W)},Y}(),Ir=function(){function Y(x){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=x,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(Y.prototype,"angle",{get:function(){return this._angle},set:function(x){this._angle=x,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),Y.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},Y.prototype.onPointerDown=function(x){this.controlContainer.setPointerCapture(x.pointerId),this.isDragging=!0,this.previousPoint={x:x.clientX,y:x.clientY}},Y.prototype.onPointerMove=function(x){this.isDragging&&(this.onAngleChange&&this.onAngleChange((x.clientX-this.previousPoint.x)/5),this.previousPoint.x=x.clientX)},Y.prototype.onPointerUp=function(x){this.isDragging&&this.onAngleChange&&this.onAngleChange((x.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(x.pointerId)},Y.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var x=this.angleLabelText.getBBox();yt.setAttributes(this.angleLabelElement,[["x",((this.width-x.width)/2).toString()],["y",(this.height/2).toString()]])}},Y.prototype.positionScaleShape=function(){if(this.scaleShape){var x=this.scaleShape.transform.baseVal.getItem(0);x.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(x,0)}},Y.prototype.getVisual=function(){var x=document.createElementNS("http://www.w3.org/2000/svg","svg");x.setAttribute("xmlns","http://www.w3.org/2000/svg"),x.setAttribute("width",this.width+"px"),x.setAttribute("height",this.height+"px"),x.setAttribute("viewBox","0 0 "+this.width+" "+this.height),x.style.flexShrink="0",document.body.appendChild(x);for(var k="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,W=1;W<=this.width/5+10;W++){var ee=W%5==0?this.height/3:this.height/6;k+="h4v"+-ee+"h1v"+ee}k+="v1H0Z",this.scaleShape=yt.createPath(k);var V=yt.createTransform();this.scaleShape.transform.baseVal.appendItem(V),x.appendChild(this.scaleShape),this.angleLabelElement=yt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=yt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var _e=yt.createTSpan("");return _e.innerHTML="°",this.angleLabelElement.appendChild(_e),x.appendChild(this.angleLabelElement),document.body.removeChild(x),x},Y}(),Xr=function(){function Y(){this.naturalSize=!1,this.imageType="image/png"}return Y.prototype.rasterize=function(x,k,W,ee,V,_e,Ke){var et=this;return new Promise(function(pt){var Ve=document.createElement("canvas");Ve.width=x.width.baseVal.value-2*ee,Ve.height=x.height.baseVal.value-2*ee;var _t=1,jt=1;et.naturalSize===!0?(_t=k.naturalWidth/(x.width.baseVal.value-2*ee)/_e,jt=k.naturalHeight/(x.height.baseVal.value-2*ee)/Ke,Ve.width=k.naturalWidth/_e,Ve.height=k.naturalHeight/Ke):et.width!==void 0&&et.height!==void 0&&(_t=et.width/W.width,jt=et.height/W.height,Ve.width*=_t,Ve.height*=jt);var $t=Ve.getContext("2d");$t.translate(Ve.width/2,Ve.height/2),$t.rotate(V*Math.PI/180),$t.scale(_e,Ke),$t.translate(-Ve.width/2,-Ve.height/2),$t.drawImage(k,0,0,Ve.width,Ve.height);var jr=document.createElement("canvas");jr.width=W.width*_t,jr.height=W.height*jt,jr.getContext("2d").putImageData($t.getImageData((W.x-ee)*_t,(W.y-ee)*jt,W.width*_t,W.height*jt),0,0),pt(jr.toDataURL(et.imageType,et.imageQuality))})},Y}(),$e=function(){function Y(x){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=Y.instanceCounter++,this.styles=new Lr(this.instanceNo),this.target=x,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(Y.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(x){this._zoomToCropEnabled=x,x?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(x){this._isGridVisible=x,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"gridLines",{get:function(){return this._gridLines},set:function(x){this._gridLines=x,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(x){this._rotationAngle=x,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"aspectRatio",{get:function(){var x;return(x=this._aspectRatio)!==null&&x!==void 0?x:this.aspectRatios[0]},set:function(x){this._aspectRatio=x},enumerable:!1,configurable:!0}),Y.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},Y.prototype.show=function(){this.showUI(),this.open()},Y.prototype.close=function(x){x===void 0&&(x=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),x||this.closeEventListeners.forEach(function(k){return k()}),this._isOpen=!1)},Y.prototype.addRenderEventListener=function(x){this.renderEventListeners.push(x)},Y.prototype.removeRenderEventListener=function(x){this.renderEventListeners.indexOf(x)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(x),1)},Y.prototype.addCloseEventListener=function(x){this.closeEventListeners.push(x)},Y.prototype.removeCloseEventListener=function(x){this.closeEventListeners.indexOf(x)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(x),1)},Y.prototype.setupResizeObserver=function(){var x=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){x.resize(x.target.clientWidth,x.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},Y.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var x=1*this.target.clientWidth/this.target.clientHeight,k=this.contentDiv.clientWidth/x>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*x:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,W=k+2*this.CANVAS_MARGINx+this.CANVAS_MARGIN?this.target.offsetTop-(x+this.CANVAS_MARGIN):0;this.coverDiv.style.top=k+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},Y.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},Y.prototype.addTopToolbar=function(){var x=this;this.topToolbar=new Ft,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var k=new cr;k.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(k);var W=[];this.aspectRatios.forEach(function(jt){var $t=new Pt(Vt.getIcon(jt.horizontal,jt.vertical),jt.horizontal===0&&jt.vertical===0?"FREE":jt.horizontal+":"+jt.vertical);$t.onClick=function(){return x.ratioButtonClicked(jt)},W.push($t)}),this.aspectRatioButton=new Jt(Vt.getIcon(0,0),"Aspect ratio",W),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,k.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ee=new Pt('',"Toggle grid");ee.isActive=this.isGridVisible,ee.onClick=function(){x.isGridVisible=!x.isGridVisible,ee.isActive=x.isGridVisible},k.addButton(ee);var V=new Pt('',"Zoom to selection");if(V.isActive=this.zoomToCropEnabled,V.onClick=function(){x.zoomToCropEnabled=!x.zoomToCropEnabled,V.isActive=x.zoomToCropEnabled},k.addButton(V),!Kr.isLicensed){var _e=new dt;this.topToolbar.addElementBlock(_e);var Ke=document.createElement("div");Ke.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var et=document.createElement("a");et.style.color="currentColor",et.href="https://markerjs.com/products/cropro",et.target="_blank",et.innerHTML='',Ke.appendChild(et),_e.addElement(Ke)}var pt=new cr;pt.minWidth=3*this.toolbarHeight+"px",pt.contentAlign="end",this.topToolbar.addButtonBlock(pt);var Ve=new Pt('',"OK");Ve.onClick=this.startRenderAndClose,pt.addButton(Ve),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ve.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var _t=new Pt('',"Close");_t.onClick=this.close,pt.addButton(_t),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(_t.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},Y.prototype.addBottomToolbar=function(){var x=this;this.bottomToolbar=new Ft,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var k=new cr;k.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(k);var W=new Pt('',"Rotate left");W.onClick=this.rotateLeftButtonClicked,k.addButton(W);var ee=new Pt('',"Rotate right");ee.onClick=this.rotateRightButtonClicked,k.addButton(ee);var V=new dt;V.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(V),this.straightener=new Ir("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(pt){x.rotateBy(pt),x.straightener.angle=x.rotationAngle},V.addElement(this.straightener.getUI());var _e=new cr;_e.minWidth=2*this.toolbarHeight+"px",_e.contentAlign="end",this.bottomToolbar.addButtonBlock(_e);var Ke=new Pt('',"Flip horizontal");Ke.onClick=this.flipHorizontallyButtonClicked,_e.addButton(Ke);var et=new Pt('',"Flip vertical");et.onClick=this.flipVerticallyButtonClicked,_e.addButton(et)},Y.prototype.ratioButtonClicked=function(x){this.aspectRatio=x,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},Y.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Vt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},Y.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ur(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},Y.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Y.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},Y.prototype.restoreState=function(x){if(x){var k=this.cropLayer.getRescaledRect(x.width,x.height,this.imageWidth,this.imageHeight,x.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(k),this.cropRectChanged(k),this.flippedHorizontally=x.flippedHorizontally,this.flippedVertically=x.flippedVertically,this.applyFlip(),this.rotationAngle=x.rotationAngle,this.applyRotation()}},Y.prototype.clientToLocalCoordinates=function(x,k){var W=this.cropImage.getBoundingClientRect();return{x:x-W.left,y:k-W.top}},Y.prototype.onWindowResize=function(){this.positionUI()},Y.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var x=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=x+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},Y.prototype.rotateLeftButtonClicked=function(){var x=this.rotationAngle-90;this.rotationAngle%90!=0&&(x+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(x)},Y.prototype.rotateRightButtonClicked=function(){var x=this.rotationAngle+90;this.rotationAngle%90!=0&&(x-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(x)},Y.prototype.rotateTo=function(x){x=(x=x>180?x-360:x)<=-180?x+360:x,this.rotationAngle=x,this.applyRotation()},Y.prototype.rotateBy=function(x){this.rotateTo((this.rotationAngle+x)%360)},Y.prototype.applyRotation=function(){var x=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var k=this.editingTargetRotationContainer.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(k,0);var W=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/W.width,this.imageHeight/W.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=x},Y.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},Y.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},Y.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},Y.prototype.startRenderAndClose=function(){return It(this,void 0,void 0,function(){var x,k;return Cr(this,function(W){switch(W.label){case 0:return[4,this.render()];case 1:return x=W.sent(),k=this.getState(),this.renderEventListeners.forEach(function(ee){return ee(x,k)}),this.close(!0),[2]}})})},Y.prototype.render=function(){return It(this,void 0,void 0,function(){var x;return Cr(this,function(k){switch(k.label){case 0:return(x=new Xr).naturalSize=this.renderAtNaturalSize,x.imageType=this.renderImageType,x.imageQuality=this.renderImageQuality,x.width=this.renderWidth,x.height=this.renderHeight,this.unzoomFromCrop(),yt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,x.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return k.sent(),[4,x.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,k.sent()]}})})},Y.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new xt("toolbar",` width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`; flex-shrink: 0; display: flex; flex-direction: row; justify-content: space-between; height: `+this.toolbarHeight+`px; box-sizing: content-box; overflow: hidden; line-height: 0px; `)),this.toolbarStyleColorsClass=this.styles.addClass(new xt("toolbar_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarBlockStyleClass=this.styles.addClass(new xt("toolbar-block",` display: flex; align-items: center; box-sizing: content-box; `));var x=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new xt("toolbar_button",` display: inline-block; width: `+(this.toolbarHeight-2*x)+`px; height: `+(this.toolbarHeight-2*x)+`px; padding: `+x+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new xt("toolbar_button_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new xt("toolbar_active_button",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; background-color: `+this.styles.settings.toolbarBackgroundActiveColor+` `)),this.styles.addRule(new bt("."+this.toolbarButtonStyleClass.name+" svg",` height: `+this.toolbarHeight/2+`px; `)),this.styles.addRule(new bt("."+this.toolbarButtonStyleColorsClass.name+":hover",` background-color: `+this.styles.settings.toolbarBackgroundHoverColor+` `)),this.toolbarDropdownStyleClass=this.styles.addClass(new xt("toolbar_dropdown",` position: absolute; max-width: `+4*this.toolbarHeight+`px; z-index: 20; white-space: normal; box-sizing: content-box; box-shadow: 3px 3px rgba(33, 33, 33, 0.1); margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px; line-height: 0px; `)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new xt("toolbar_dropdown_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new xt("toolbar_straightener_block",` display: flex; overflow: hidden; justify-content: center; -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%); `)),this.toolbarStraightenerStyleClass=this.styles.addClass(new xt("toolbar_straightener",` display: flex; overflow: hidden; justify-content: center; height: `+(this.toolbarHeight-2*x)+`px; padding: `+x+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new xt("toolbar_straightener_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `))},Y.instanceCounter=0,Y}(),Ct=Z("8hTe"),pi=Z.n(Ct),mi=/]*>/g;function gi(Y){var x=document.createElement("div");return x.innerHTML=Y,x.childNodes.length===0?"":x.childNodes[0].nodeValue}var vi=xe.a=function(Y){var x=Y.value,k=x===void 0?"":x,W=Y.edit,ee=W===void 0?!1:W,V=Y.className,_e=Y.showTextOnly,Ke=Y.showLines,et=Y.replaces,pt=Y.zoomImg,Ve=Y.hasMask,_t=Y.style,jt=_t===void 0?{}:_t,$t=Y.stylesPrev,jr=$t===void 0?{}:$t,Er=String(k),xr=Object(L.useRef)(),Qr=Object(L.useRef)(),Ii=Object(L.useState)(""),dr=Object(K.a)(Ii,2),zr=dr[0],li=dr[1],ui=Object(L.useState)("office"),Hr=Object(K.a)(ui,2),Di=Hr[0],yi=Hr[1],Ki=function(){var Ht=new $e(Qr.current);Ht.displayMode="popup",Ht.addRenderEventListener(function(){var yr=Object(B.a)(r.a.mark(function kt(ar){var Kt;return r.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:return xr.current.style.display="none",fr.next=3,Object(Ce.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ar}});case 3:Kt=fr.sent,Kt!=null&&Kt.id&&et(Qr.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 5:case"end":return fr.stop()}},kt)}));return function(kt){return yr.apply(this,arguments)}}()),Ht.show()},zi=function(){var Ht=new Lt(Qr.current);Ht.settings.displayMode="popup",Ht.addEventListener("render",function(){var yr=Object(B.a)(r.a.mark(function kt(ar){var Kt;return r.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:if(xr.current.style.display="none",!Qr.current){fr.next=6;break}return fr.next=4,Object(Ce.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ar.dataUrl}});case 4:Kt=fr.sent,Kt!=null&&Kt.id&&et(Qr.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 6:case"end":return fr.stop()}},kt)}));return function(kt){return yr.apply(this,arguments)}}()),Ht.show(),window.markerArea=Ht},Zr=Object(L.useMemo)(function(){xr.current&&(xr.current.style.zIndex=-1);try{var ir=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ht=/\"\/api\/attachments\/|\"\/attachments\/download\//g,yr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Er=Er.replace(ir,"("+$.a.API_SERVER+"/api/attachments/").replace(Ht,'"'+$.a.API_SERVER+"/api/attachments/").replace(yr,'"'+$.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,` `)}catch(ii){}var kt=N(Er),ar=w();if(Er.match(/\[TOC\]/)&&(kt=kt.replace("

    [TOC]

    ",D()),R()),kt=kt.replace(/(__special_katext_id_\d+__)/g,function(ii,fr){var Ar=ar[fr],Vi=Ar.type,Ei=Ar.expression;return Object(ie.renderToString)(gi(Ei)||"",{displayMode:Vi==="block",throwOnError:!1,output:"html"})}),kt=kt.replace(/▁/g,"\u2581\u2581\u2581"),y(),_e){var Kt=document.createElement("div");return Kt.innerHTML=kt,Kt.innerText}return setTimeout(function(){return cn()},500),kt},[Er]),$r=Object(L.useRef)();_.WebkitLineClamp=Ke,Ke&&(jt=Object(j.a)(Object(j.a)({},jt),_));function bi(ir){var Ht=ir.target;if(Ht.tagName.toUpperCase()==="IMG"){if(pt){var yr=Ht.getAttribute("src");li(yr),yi("image")}}else if(Ht.tagName.toUpperCase()==="A"){var kt=Ht.getAttribute("href");if(kt.indexOf("office")>-1)ir.preventDefault(),li(kt),yi("office");else if(kt.indexOf("application/pdf")>-1)ir.preventDefault(),li(kt),yi("pdf");else if(kt.indexOf("text/html")>-1)ir.preventDefault(),li(kt),yi("html");else if(kt.startsWith("#")){ir.preventDefault();var ar=document.getElementById(kt.replace("#",""));ar&&ar.scrollIntoView(!0)}}}var cn=function(){var Ht,yr=(Ht=$r.current)===null||Ht===void 0?void 0:Ht.querySelectorAll("video");yr==null||yr.forEach(function(kt){if(kt.oncontextmenu=function(){return!1},kt.src.indexOf(".m3u8")>-1&&!kt.canPlayType("application/vnd.apple.mpegurl")){if(H.a.isSupported()){var ar=new H.a;ar.loadSource(kt.src),ar.attachMedia(kt)}}})};Object(L.useEffect)(function(){if($r.current&&Zr&&(Zr.match(mi)&&window.PR.prettyPrint()),$r.current)return $r.current.addEventListener("click",bi),function(){$r.current.removeEventListener("click",bi),y(),R()}},[Zr,$r.current,bi]);var _i=function(Ht){if(!ee)return;Ht.target.nodeName==="IMG"?(xr.current.style.zIndex=1,xr.current.style.display="flex",xr.current.style.width=Ht.target.clientWidth+"px",xr.current.style.height=Ht.target.clientHeight+"px",xr.current.style.top=Ht.target.offsetTop+"px",xr.current.style.left=Ht.target.offsetLeft+"px",Qr.current.src=Ht.target.getAttribute("src")):xr.current.style.display="none"};return v.a.createElement("div",{style:{position:"relative"}},v.a.createElement("div",{ref:$r,style:Object(j.a)({},jt),className:"".concat(V||""," markdown-body ").concat(pi.a.mdBody),onMouseOver:_i,dangerouslySetInnerHTML:{__html:Zr}}),v.a.createElement("div",{ref:xr,className:pi.a.button},v.a.createElement(J.a,null,v.a.createElement(X.a,{onClick:function(){return Ki()}},"\u88C1\u526A"),v.a.createElement(X.a,{onClick:function(){return zi()}},"\u7F16\u8F91"))),v.a.createElement("img",{ref:Qr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),v.a.createElement(oe.a,{close:!0,data:zr,type:zr!=null&&zr.length?Di:"",style:Object(j.a)({},jr),onClose:function(){return li("")}}))}},"9VGf":function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return P});var ne=Z("q1tI"),J=Z.n(ne);function P(X,j){var B=Object(ne.useRef)();Object(ne.useEffect)(function(){B.current=X}),Object(ne.useEffect)(function(){function K(){B.current()}if(j!==null){var G=setInterval(K,j);return function(){return clearInterval(G)}}},[j])}},BU3w:function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return B});var ne=Z("MNnm"),J="rc-util-key";function P(K){if(K.attachTo)return K.attachTo;var G=document.querySelector("head");return G||document.body}function X(K){var G,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ne.a)())return null;var L=document.createElement("style");if((G=r.csp)===null||G===void 0?void 0:G.nonce){var v;L.nonce=(v=r.csp)===null||v===void 0?void 0:v.nonce}L.innerHTML=K;var m=P(r),p=m.firstChild;return r.prepend&&m.prepend?m.prepend(L):r.prepend&&p?m.insertBefore(L,p):m.appendChild(L),L}var j=new Map;function B(K,G){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},L=P(r);if(!j.has(L)){var v=X("",r),m=v.parentNode;j.set(L,m),m.removeChild(v)}var p=Array.from(j.get(L).children).find(function(u){return u.tagName==="STYLE"&&u[J]===G});if(p){var h,l;if(((h=r.csp)===null||h===void 0?void 0:h.nonce)&&p.nonce!==((l=r.csp)===null||l===void 0?void 0:l.nonce)){var f;p.nonce=(f=r.csp)===null||f===void 0?void 0:f.nonce}return p.innerHTML!==K&&(p.innerHTML=K),p}var o=X(K,r);return o[J]=G,o}},Bd2K:function(nt,xe,Z){(function(ne){ne(Z("VrN/"),Z("osHv"))})(function(ne){ne.defineOption("autoCloseTags",!1,function(r,L,v){if(v!=ne.Init&&v&&r.removeKeyMap("autoCloseTags"),!L)return;var m={name:"autoCloseTags"};(typeof L!="object"||L.whenClosing!==!1)&&(m["'/'"]=function(p){return B(p)}),(typeof L!="object"||L.whenOpening!==!1)&&(m["'>'"]=function(p){return X(p)}),r.addKeyMap(m)});var J=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function X(r){if(r.getOption("disableInput"))return ne.Pass;for(var L=r.listSelections(),v=[],m=r.getOption("autoCloseTags"),p=0;ph.ch&&(a=a.slice(0,a.length-l.end+h.ch));var C=a.toLowerCase();if(!a||l.type=="string"&&(l.end!=h.ch||!/[\"\']/.test(l.string.charAt(l.string.length-1))||l.string.length==1)||l.type=="tag"&&u.close||l.string.indexOf("/")==h.ch-l.start-1||R&&K(R,C)>-1||G(r,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(o)||[],a,h,!0))return ne.Pass;var D=typeof m=="object"&&m.emptyTags;if(D&&K(D,a)>-1){v[p]={text:"/>",newPos:ne.Pos(h.line,h.ch+2)};continue}var O=_&&K(_,C)>-1;v[p]={indent:O,text:">"+(O?` `:"")+"",newPos:O?ne.Pos(h.line+1,0):ne.Pos(h.line,h.ch+1)}}for(var A=typeof m=="object"&&m.dontIndentOnAutoClose,p=L.length-1;p>=0;p--){var S=v[p];r.replaceRange(S.text,L[p].head,L[p].anchor,"+insert");var T=r.listSelections().slice(0);T[p]={head:S.newPos,anchor:S.newPos},r.setSelections(T),!A&&S.indent&&(r.indentLine(S.newPos.line,null,!0),r.indentLine(S.newPos.line+1,null,!0))}}function j(r,L){for(var v=r.listSelections(),m=[],p=L?"/":""&&(R+=">"),m[f]=R}if(r.replaceSelections(m),v=r.listSelections(),!l)for(var f=0;f=0&&L[o]==v;o--)++f;m=l.to;for(var o=1;o0){for(var L=0;L1&&arguments[1]!==void 0?arguments[1]:"",L=[],v=0;vB,ne.serviceIds.set(B,K),K}function j(B){return function(K,G,r){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");P(B,K,r,!0)}}},DlQD:function(nt,xe,Z){(function(ne,J){nt.exports=J()})(this,function(){"use strict";function ne(Te,me){for(var be=0;beTe.length)&&(me=Te.length);for(var be=0,ae=new Array(me);be=Te.length?{done:!0}:{done:!1,value:Te[ae++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return be=Te[Symbol.iterator](),be.next.bind(be)}function B(Te,me){return me={exports:{}},Te(me,me.exports),me.exports}var K=B(function(Te){function me(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function be(ae){Te.exports.defaults=ae}Te.exports={defaults:me(),getDefaults:me,changeDefaults:be}}),G=K.defaults,r=K.getDefaults,L=K.changeDefaults,v=/[&<>"']/,m=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"},f=function(me){return l[me]};function o(Te,me){if(me){if(v.test(Te))return Te.replace(m,f)}else if(p.test(Te))return Te.replace(h,f);return Te}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function a(Te){return Te.replace(u,function(me,be){return be=be.toLowerCase(),be==="colon"?":":be.charAt(0)==="#"?be.charAt(1)==="x"?String.fromCharCode(parseInt(be.substring(2),16)):String.fromCharCode(+be.substring(1)):""})}var s=/(^|[^\[])\^/g;function R(Te,me){Te=Te.source||Te,me=me||"";var be={replace:function(le,de){return de=de.source||de,de=de.replace(s,"$1"),Te=Te.replace(le,de),be},getRegex:function(){return new RegExp(Te,me)}};return be}var _=/[^\w:]/g,C=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(Te,me,be){if(Te){var ae;try{ae=decodeURIComponent(a(be)).replace(_,"").toLowerCase()}catch(le){return null}if(ae.indexOf("javascript:")===0||ae.indexOf("vbscript:")===0||ae.indexOf("data:")===0)return null}me&&!C.test(be)&&(be=c(me,be));try{be=encodeURI(be).replace(/%25/g,"%")}catch(le){return null}return be}var O={},A=/^[^:]+:\/*[^/]*$/,S=/^([^:]+:)[\s\S]*$/,T=/^([^:]+:\/*[^/]*)[\s\S]*$/;function c(Te,me){O[" "+Te]||(A.test(Te)?O[" "+Te]=Te+"/":O[" "+Te]=U(Te,"/",!0)),Te=O[" "+Te];var be=Te.indexOf(":")===-1;return me.substring(0,2)==="//"?be?me:Te.replace(S,"$1")+me:me.charAt(0)==="/"?be?me:Te.replace(T,"$1")+me:Te+me}var w={exec:function(){}};function y(Te){for(var me=1,be,ae;me=0&&we[ze]==="\\";)Fe=!Fe;return Fe?"|":" |"}),ae=be.split(/ \|/),le=0;if(ae.length>me)ae.splice(me);else for(;ae.length=ae.length?le.slice(ae.length):le}).join(` `)}var ve=function(){function Te(be){this.options=be||I}var me=Te.prototype;return me.space=function(ae){var le=this.rules.block.newline.exec(ae);if(le)return le[0].length>1?{type:"space",raw:le[0]}:{raw:` `}},me.code=function(ae,le){var de=this.rules.block.code.exec(ae);if(de){var ge=le[le.length-1];if(ge&&ge.type==="paragraph")return{raw:de[0],text:de[0].trimRight()};var we=de[0].replace(/^ {4}/gm,"");return{type:"code",raw:de[0],codeBlockStyle:"indented",text:this.options.pedantic?we:g(we,` `)}}},me.fences=function(ae){var le=this.rules.block.fences.exec(ae);if(le){var de=le[0],ge=Ce(de,le[3]||"");return{type:"code",raw:de,lang:le[2]?le[2].trim():le[2],text:ge}}},me.heading=function(ae){var le=this.rules.block.heading.exec(ae);if(le)return{type:"heading",raw:le[0],depth:le[1].length,text:le[2]}},me.nptable=function(ae){var le=this.rules.block.nptable.exec(ae);if(le){var de={type:"table",header:H(le[1].replace(/^ *| *\| *$/g,"")),align:le[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:le[3]?le[3].replace(/\n$/,"").split(` `):[],raw:le[0]};if(de.header.length===de.align.length){var ge=de.align.length,we;for(we=0;we ?/gm,"");return{type:"blockquote",raw:le[0],text:de}}},me.list=function(ae){var le=this.rules.block.list.exec(ae);if(le){for(var de=le[0],ge=le[2],we=ge.length>1,Fe=ge[ge.length-1]===")",ze={type:"list",raw:de,ordered:we,start:we?+ge.slice(0,-1):"",loose:!1,items:[]},st=le[0].match(this.rules.block.item),mt=!1,ft,wt,St,ct,Ut,Lt,qt,Qt=st.length,It=0;It1||this.options.smartLists&&St!==ge)&&(ct=st.slice(It+1).join(` `),ze.raw=ze.raw.substring(0,ze.raw.length-ct.length),It=Qt-1)),Ut=mt||/\n\n(?!\s*$)/.test(ft),It!==Qt-1&&(mt=ft.charAt(ft.length-1)===` `,Ut||(Ut=mt)),Ut&&(ze.loose=!0),Lt=/^\[[ xX]\] /.test(ft),qt=void 0,Lt&&(qt=ft[1]!==" ",ft=ft.replace(/^\[[ xX]\] +/,"")),ze.items.push({type:"list_item",raw:de,task:Lt,checked:qt,loose:Ut,text:ft});return ze}},me.html=function(ae){var le=this.rules.block.html.exec(ae);if(le)return{type:this.options.sanitize?"paragraph":"html",raw:le[0],pre:!this.options.sanitizer&&(le[1]==="pre"||le[1]==="script"||le[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):$(le[0]):le[0]}},me.def=function(ae){var le=this.rules.block.def.exec(ae);if(le){le[3]&&(le[3]=le[3].substring(1,le[3].length-1));var de=le[1].toLowerCase().replace(/\s+/g," ");return{tag:de,raw:le[0],href:le[2],title:le[3]}}},me.table=function(ae){var le=this.rules.block.table.exec(ae);if(le){var de={type:"table",header:H(le[1].replace(/^ *| *\| *$/g,"")),align:le[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:le[3]?le[3].replace(/\n$/,"").split(` `):[]};if(de.header.length===de.align.length){de.raw=le[0];var ge=de.align.length,we;for(we=0;we/i.test(ge[0])&&(le=!1),!de&&/^<(pre|code|kbd|script)(\s|>)/i.test(ge[0])?de=!0:de&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ge[0])&&(de=!1),{type:this.options.sanitize?"text":"html",raw:ge[0],inLink:le,inRawBlock:de,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):$(ge[0]):ge[0]}},me.link=function(ae){var le=this.rules.inline.link.exec(ae);if(le){var de=ie(le[2],"()");if(de>-1){var ge=le[0].indexOf("!")===0?5:4,we=ge+le[1].length+de;le[2]=le[2].substring(0,de),le[0]=le[0].substring(0,we).trim(),le[3]=""}var Fe=le[2],ze="";if(this.options.pedantic){var st=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Fe);st?(Fe=st[1],ze=st[3]):ze=""}else ze=le[3]?le[3].slice(1,-1):"";Fe=Fe.trim().replace(/^<([\s\S]*)>$/,"$1");var mt=oe(le,{href:Fe&&Fe.replace(this.rules.inline._escapes,"$1"),title:ze&&ze.replace(this.rules.inline._escapes,"$1")},le[0]);return mt}},me.reflink=function(ae,le){var de;if((de=this.rules.inline.reflink.exec(ae))||(de=this.rules.inline.nolink.exec(ae))){var ge=(de[2]||de[1]).replace(/\s+/g," ");if(ge=le[ge.toLowerCase()],!ge||!ge.href){var we=de[0].charAt(0);return{type:"text",raw:we,text:we}}var Fe=oe(de,ge,de[0]);return Fe}},me.strong=function(ae,le,de){de===void 0&&(de="");var ge=this.rules.inline.strong.start.exec(ae);if(ge&&(!ge[1]||ge[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){le=le.slice(-1*ae.length);var we=ge[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;we.lastIndex=0;for(var Fe;(ge=we.exec(le))!=null;)if(Fe=this.rules.inline.strong.middle.exec(le.slice(0,ge.index+3)),Fe)return{type:"strong",raw:ae.slice(0,Fe[0].length),text:ae.slice(2,Fe[0].length-2)}}},me.em=function(ae,le,de){de===void 0&&(de="");var ge=this.rules.inline.em.start.exec(ae);if(ge&&(!ge[1]||ge[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){le=le.slice(-1*ae.length);var we=ge[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;we.lastIndex=0;for(var Fe;(ge=we.exec(le))!=null;)if(Fe=this.rules.inline.em.middle.exec(le.slice(0,ge.index+2)),Fe)return{type:"em",raw:ae.slice(0,Fe[0].length),text:ae.slice(1,Fe[0].length-1)}}},me.codespan=function(ae){var le=this.rules.inline.code.exec(ae);if(le){var de=le[2].replace(/\n/g," "),ge=/[^ ]/.test(de),we=de.startsWith(" ")&&de.endsWith(" ");return ge&&we&&(de=de.substring(1,de.length-1)),de=$(de,!0),{type:"codespan",raw:le[0],text:de}}},me.br=function(ae){var le=this.rules.inline.br.exec(ae);if(le)return{type:"br",raw:le[0]}},me.del=function(ae){var le=this.rules.inline.del.exec(ae);if(le)return{type:"del",raw:le[0],text:le[1]}},me.autolink=function(ae,le){var de=this.rules.inline.autolink.exec(ae);if(de){var ge,we;return de[2]==="@"?(ge=$(this.options.mangle?le(de[1]):de[1]),we="mailto:"+ge):(ge=$(de[1]),we=ge),{type:"link",raw:de[0],text:ge,href:we,tokens:[{type:"text",raw:ge,text:ge}]}}},me.url=function(ae,le){var de;if(de=this.rules.inline.url.exec(ae)){var ge,we;if(de[2]==="@")ge=$(this.options.mangle?le(de[0]):de[0]),we="mailto:"+ge;else{var Fe;do Fe=de[0],de[0]=this.rules.inline._backpedal.exec(de[0])[0];while(Fe!==de[0]);ge=$(de[0]),de[1]==="www."?we="http://"+ge:we=ge}return{type:"link",raw:de[0],text:ge,href:we,tokens:[{type:"text",raw:ge,text:ge}]}}},me.inlineText=function(ae,le,de){var ge=this.rules.inline.text.exec(ae);if(ge){var we;return le?we=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):$(ge[0]):ge[0]:we=$(this.options.smartypants?de(ge[0]):ge[0]),{type:"text",raw:ge[0],text:we}}},Te}(),Se=N.noopTest,Ae=N.edit,Oe=N.merge,he={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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Se,table:Se,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};he._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,he._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,he.def=Ae(he.def).replace("label",he._label).replace("title",he._title).getRegex(),he.bullet=/(?:[*+-]|\d{1,9}[.)])/,he.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,he.item=Ae(he.item,"gm").replace(/bull/g,he.bullet).getRegex(),he.list=Ae(he.list).replace(/bull/g,he.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+he.def.source+")").getRegex(),he._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",he._comment=//,he.html=Ae(he.html,"i").replace("comment",he._comment).replace("tag",he._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),he.paragraph=Ae(he._paragraph).replace("hr",he.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",")|<(?:script|pre|style|!--)").replace("tag",he._tag).getRegex(),he.blockquote=Ae(he.blockquote).replace("paragraph",he.paragraph).getRegex(),he.normal=Oe({},he),he.gfm=Oe({},he.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*|$)"}),he.gfm.nptable=Ae(he.gfm.nptable).replace("hr",he.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",")|<(?:script|pre|style|!--)").replace("tag",he._tag).getRegex(),he.gfm.table=Ae(he.gfm.table).replace("hr",he.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",")|<(?:script|pre|style|!--)").replace("tag",he._tag).getRegex(),he.pedantic=Oe({},he.normal,{html:Ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",he._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Se,paragraph:Ae(he.normal._paragraph).replace("hr",he.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",he.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ce={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Se,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Se,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",ce.punctuation=Ae(ce.punctuation).replace(/punctuation/g,ce._punctuation).getRegex(),ce._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ce._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ce.em.start=Ae(ce.em.start).replace(/punctuation/g,ce._punctuation).getRegex(),ce.em.middle=Ae(ce.em.middle).replace(/punctuation/g,ce._punctuation).replace(/overlapSkip/g,ce._overlapSkip).getRegex(),ce.em.endAst=Ae(ce.em.endAst,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.em.endUnd=Ae(ce.em.endUnd,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.start=Ae(ce.strong.start).replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.middle=Ae(ce.strong.middle).replace(/punctuation/g,ce._punctuation).replace(/blockSkip/g,ce._blockSkip).getRegex(),ce.strong.endAst=Ae(ce.strong.endAst,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.strong.endUnd=Ae(ce.strong.endUnd,"g").replace(/punctuation/g,ce._punctuation).getRegex(),ce.blockSkip=Ae(ce._blockSkip,"g").getRegex(),ce.overlapSkip=Ae(ce._overlapSkip,"g").getRegex(),ce._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ce._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ce._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])?)+(?![-_])/,ce.autolink=Ae(ce.autolink).replace("scheme",ce._scheme).replace("email",ce._email).getRegex(),ce._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ce.tag=Ae(ce.tag).replace("comment",he._comment).replace("attribute",ce._attribute).getRegex(),ce._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ce._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ce._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ce.link=Ae(ce.link).replace("label",ce._label).replace("href",ce._href).replace("title",ce._title).getRegex(),ce.reflink=Ae(ce.reflink).replace("label",ce._label).getRegex(),ce.reflinkSearch=Ae(ce.reflinkSearch,"g").replace("reflink",ce.reflink).replace("nolink",ce.nolink).getRegex(),ce.normal=Oe({},ce),ce.pedantic=Oe({},ce.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ae(/^!?\[(label)\]\((.*?)\)/).replace("label",ce._label).getRegex(),reflink:Ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ce._label).getRegex()}),ce.gfm=Oe({},ce.normal,{escape:Ae(ce.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(ae="x"+ae.toString(16)),me+="&#"+ae+";";return me}var Pe=function(){function Te(be){this.tokens=[],this.tokens.links=Object.create(null),this.options=be||fe,this.options.tokenizer=this.options.tokenizer||new ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ae={block:se.normal,inline:ke.normal};this.options.pedantic?(ae.block=se.pedantic,ae.inline=ke.pedantic):this.options.gfm&&(ae.block=se.gfm,this.options.breaks?ae.inline=ke.breaks:ae.inline=ke.gfm),this.tokenizer.rules=ae}Te.lex=function(ae,le){var de=new Te(le);return de.lex(ae)};var me=Te.prototype;return me.lex=function(ae){return ae=ae.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(ae,this.tokens,!0),this.inline(this.tokens),this.tokens},me.blockTokens=function(ae,le,de){le===void 0&&(le=[]),de===void 0&&(de=!0),ae=ae.replace(/^ +$/gm,"");for(var ge,we,Fe,ze;ae;){if(ge=this.tokenizer.space(ae)){ae=ae.substring(ge.raw.length),ge.type&&le.push(ge);continue}if(ge=this.tokenizer.code(ae,le)){ae=ae.substring(ge.raw.length),ge.type?le.push(ge):(ze=le[le.length-1],ze.raw+=` `+ge.raw,ze.text+=` `+ge.text);continue}if(ge=this.tokenizer.fences(ae)){ae=ae.substring(ge.raw.length),le.push(ge);continue}if(ge=this.tokenizer.heading(ae)){ae=ae.substring(ge.raw.length),le.push(ge);continue}if(ge=this.tokenizer.nptable(ae)){ae=ae.substring(ge.raw.length),le.push(ge);continue}if(ge=this.tokenizer.hr(ae)){ae=ae.substring(ge.raw.length),le.push(ge);continue}if(ge=this.tokenizer.blockquote(ae)){ae=ae.substring(ge.raw.length),ge.tokens=this.blockTokens(ge.text,[],de),le.push(ge);continue}if(ge=this.tokenizer.list(ae)){for(ae=ae.substring(ge.raw.length),Fe=ge.items.length,we=0;we0)for(;(st=this.tokenizer.rules.inline.reflinkSearch.exec(ze))!=null;)mt.includes(st[0].slice(st[0].lastIndexOf("[")+1,-1))&&(ze=ze.slice(0,st.index)+"["+"a".repeat(st[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(st=this.tokenizer.rules.inline.blockSkip.exec(ze))!=null;)ze=ze.slice(0,st.index)+"["+"a".repeat(st[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ae;){if(Fe=this.tokenizer.escape(ae)){ae=ae.substring(Fe.raw.length),le.push(Fe);continue}if(Fe=this.tokenizer.tag(ae,de,ge)){ae=ae.substring(Fe.raw.length),de=Fe.inLink,ge=Fe.inRawBlock,le.push(Fe);continue}if(Fe=this.tokenizer.link(ae)){ae=ae.substring(Fe.raw.length),Fe.type==="link"&&(Fe.tokens=this.inlineTokens(Fe.text,[],!0,ge)),le.push(Fe);continue}if(Fe=this.tokenizer.reflink(ae,this.tokens.links)){ae=ae.substring(Fe.raw.length),Fe.type==="link"&&(Fe.tokens=this.inlineTokens(Fe.text,[],!0,ge)),le.push(Fe);continue}if(Fe=this.tokenizer.strong(ae,ze,we)){ae=ae.substring(Fe.raw.length),Fe.tokens=this.inlineTokens(Fe.text,[],de,ge),le.push(Fe);continue}if(Fe=this.tokenizer.em(ae,ze,we)){ae=ae.substring(Fe.raw.length),Fe.tokens=this.inlineTokens(Fe.text,[],de,ge),le.push(Fe);continue}if(Fe=this.tokenizer.codespan(ae)){ae=ae.substring(Fe.raw.length),le.push(Fe);continue}if(Fe=this.tokenizer.br(ae)){ae=ae.substring(Fe.raw.length),le.push(Fe);continue}if(Fe=this.tokenizer.del(ae)){ae=ae.substring(Fe.raw.length),Fe.tokens=this.inlineTokens(Fe.text,[],de,ge),le.push(Fe);continue}if(Fe=this.tokenizer.autolink(ae,Re)){ae=ae.substring(Fe.raw.length),le.push(Fe);continue}if(!de&&(Fe=this.tokenizer.url(ae,Re))){ae=ae.substring(Fe.raw.length),le.push(Fe);continue}if(Fe=this.tokenizer.inlineText(ae,ge,Ne)){ae=ae.substring(Fe.raw.length),we=Fe.raw.slice(-1),le.push(Fe);continue}if(ae){var ft="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(ft);break}else throw new Error(ft)}}return le},J(Te,null,[{key:"rules",get:function(){return{block:se,inline:ke}}}]),Te}(),je=K.defaults,ue=N.cleanUrl,Ee=N.escape,Le=function(){function Te(be){this.options=be||je}var me=Te.prototype;return me.code=function(ae,le,de){var ge=(le||"").match(/\S*/)[0];if(this.options.highlight){var we=this.options.highlight(ae,ge);we!=null&&we!==ae&&(de=!0,ae=we)}return ge?'
    '+(de?ae:Ee(ae,!0))+`
    `:"
    "+(de?ae:Ee(ae,!0))+`
    `},me.blockquote=function(ae){return`
    `+ae+`
    `},me.html=function(ae){return ae},me.heading=function(ae,le,de,ge){return this.options.headerIds?"'+ae+" `:""+ae+" `},me.hr=function(){return this.options.xhtml?`
    `:`
    `},me.list=function(ae,le,de){var ge=le?"ol":"ul",we=le&&de!==1?' start="'+de+'"':"";return"<"+ge+we+`> `+ae+" `},me.listitem=function(ae){return"
  • "+ae+`
  • `},me.checkbox=function(ae){return" "},me.paragraph=function(ae){return"

    "+ae+`

    `},me.table=function(ae,le){return le&&(le=""+le+""),` `+ae+` `+le+`
    `},me.tablerow=function(ae){return` `+ae+` `},me.tablecell=function(ae,le){var de=le.header?"th":"td",ge=le.align?"<"+de+' align="'+le.align+'">':"<"+de+">";return ge+ae+" `},me.strong=function(ae){return""+ae+""},me.em=function(ae){return""+ae+""},me.codespan=function(ae){return""+ae+""},me.br=function(){return this.options.xhtml?"
    ":"
    "},me.del=function(ae){return""+ae+""},me.link=function(ae,le,de){if(ae=ue(this.options.sanitize,this.options.baseUrl,ae),ae===null)return de;var ge='",ge},me.image=function(ae,le,de){if(ae=ue(this.options.sanitize,this.options.baseUrl,ae),ae===null)return de;var ge=''+de+'":">",ge},me.text=function(ae){return ae},Te}(),Ie=function(){function Te(){}var me=Te.prototype;return me.strong=function(ae){return ae},me.em=function(ae){return ae},me.codespan=function(ae){return ae},me.del=function(ae){return ae},me.html=function(ae){return ae},me.text=function(ae){return ae},me.link=function(ae,le,de){return""+de},me.image=function(ae,le,de){return""+de},me.br=function(){return""},Te}(),Ge=function(){function Te(){this.seen={}}var me=Te.prototype;return me.slug=function(ae){var le=ae.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(le)){var de=le;do this.seen[de]++,le=de+"-"+this.seen[de];while(this.seen.hasOwnProperty(le))}return this.seen[le]=0,le},Te}(),Xe=K.defaults,Je=N.unescape,Qe=function(){function Te(be){this.options=be||Xe,this.options.renderer=this.options.renderer||new Le,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ie,this.slugger=new Ge}Te.parse=function(ae,le){var de=new Te(le);return de.parse(ae)};var me=Te.prototype;return me.parse=function(ae,le){le===void 0&&(le=!0);var de="",ge,we,Fe,ze,st,mt,ft,wt,St,ct,Ut,Lt,qt,Qt,It,Cr,Kr,yt,Lr=ae.length;for(ge=0;ge0&&It.tokens[0].type==="text"?(It.tokens[0].text=yt+" "+It.tokens[0].text,It.tokens[0].tokens&&It.tokens[0].tokens.length>0&&It.tokens[0].tokens[0].type==="text"&&(It.tokens[0].tokens[0].text=yt+" "+It.tokens[0].tokens[0].text)):It.tokens.unshift({type:"text",text:yt}):Qt+=yt),Qt+=this.parse(It.tokens,qt),St+=this.renderer.listitem(Qt,Kr,Cr);de+=this.renderer.list(St,Ut,Lt);continue}case"html":{de+=this.renderer.html(ct.text);continue}case"paragraph":{de+=this.renderer.paragraph(this.parseInline(ct.tokens));continue}case"text":{for(St=ct.tokens?this.parseInline(ct.tokens):ct.text;ge+1An error occurred:

    "+tt(Fe.message+"",!0)+"
    ";throw Fe}}Ue.options=Ue.setOptions=function(Te){return at(Ue.defaults,Te),ut(Ue.defaults),Ue},Ue.getDefaults=Be,Ue.defaults=ot,Ue.use=function(Te){var me=at({},Te);if(Te.renderer&&function(){var ae=Ue.defaults.renderer||new Le,le=function(we){var Fe=ae[we];ae[we]=function(){for(var ze=arguments.length,st=new Array(ze),mt=0;mt`,triples:"",explode:"[]{}"},P=ne.Pos;ne.defineOption("autoCloseBrackets",!1,function(l,f,o){o&&o!=ne.Init&&(l.removeKeyMap(j),l.state.closeBrackets=null),f&&(B(X(f,"pairs")),l.state.closeBrackets=f,l.addKeyMap(j))});function X(l,f){return f=="pairs"&&typeof l=="string"?l:typeof l=="object"&&l[f]!=null?l[f]:J[f]}var j={Backspace:r,Enter:L};function B(l){for(var f=0;f=0;a--){var R=u[a].head;l.replaceRange("",P(R.line,R.ch-1),P(R.line,R.ch+1),"+delete")}}function L(l){var f=G(l),o=f&&X(f,"explode");if(!o||l.getOption("disableInput"))return ne.Pass;for(var u=l.listSelections(),a=0;a0;return{anchor:new P(l.anchor.line,l.anchor.ch+(f?-1:1)),head:new P(l.head.line,l.head.ch+(f?1:-1))}}function m(l,f){var o=G(l);if(!o||l.getOption("disableInput"))return ne.Pass;var u=X(o,"pairs"),a=u.indexOf(f);if(a==-1)return ne.Pass;for(var s=X(o,"closeBefore"),R=X(o,"triples"),_=u.charAt(a+1)==f,C=l.listSelections(),D=a%2==0,O,A=0;A=0&&l.getRange(T,P(T.line,T.ch+3))==f+f+f?c="skipThree":c="skip";else if(_&&T.ch>1&&R.indexOf(f)>=0&&l.getRange(P(T.line,T.ch-2),T)==f+f){if(T.ch>2&&/\bstring/.test(l.getTokenTypeAt(P(T.line,T.ch-2))))return ne.Pass;c="addFour"}else if(_){var y=T.ch==0?" ":l.getRange(P(T.line,T.ch-1),T);if(!ne.isWordChar(w)&&y!=f&&!ne.isWordChar(y))c="both";else return ne.Pass}else if(D&&(w.length===0||/\s/.test(w)||s.indexOf(w)>-1))c="both";else return ne.Pass;if(!O)O=c;else if(O!=c)return ne.Pass}var b=a%2?u.charAt(a-1):f,U=a%2?f:u.charAt(a+1);l.operation(function(){if(O=="skip")l.execCommand("goCharRight");else if(O=="skipThree")for(var F=0;F<3;F++)l.execCommand("goCharRight");else if(O=="surround"){for(var E=l.getSelections(),F=0;F0&&(ie.percent=ie.loaded/ie.total*100),N.onProgress(ie)});var g=new FormData;N.data&&Object.keys(N.data).forEach(function($){var ie=N.data[$];if(Array.isArray(ie)){ie.forEach(function(oe){g.append($+"[]",oe)});return}g.append($,N.data[$])}),N.file instanceof Blob?g.append(N.filename,N.file,N.file.name):g.append(N.filename,N.file),I.onerror=function(ie){N.onError(ie)},I.onload=function(){return I.status<200||I.status>=300?N.onError(j(N,I),B(I)):N.onSuccess(B(I),I)},I.open(N.method,N.action,!0),N.withCredentials&&"withCredentials"in I&&(I.withCredentials=!0);var H=N.headers||{};return H["X-Requested-With"]!==null&&I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(H).forEach(function($){H[$]!==null&&I.setRequestHeader($,H[$])}),I.send(g),{abort:function(){I.abort()}}}var G=+new Date,r=0;function L(){return"rc-upload-"+G+"-"+ ++r}function v(N,I){return N.indexOf(I,N.length-I.length)!==-1}var m=function(N,I){if(N&&I){var g=Array.isArray(I)?I:I.split(","),H=N.name||"",$=N.type||"",ie=$.replace(/\/.*$/,"");return g.some(function(oe){var Ce=oe.trim();return Ce.charAt(0)==="."?v(H.toLowerCase(),Ce.toLowerCase()):/\/\*$/.test(Ce)?ie===Ce.replace(/\/.*$/,""):$===Ce})}return!0};function p(N,I){var g=N.createReader(),H=[];function $(){g.readEntries(function(ie){var oe=Array.prototype.slice.apply(ie);H=H.concat(oe);var Ce=!oe.length;Ce?I(H):$()})}$()}var h=function(I,g,H){var $=function ie(oe,Ce){Ce=Ce||"",oe.isFile?oe.file(function(ve){H(ve)&&(oe.fullPath&&!ve.webkitRelativePath&&(Object.defineProperties(ve,{webkitRelativePath:{writable:!0}}),ve.webkitRelativePath=oe.fullPath.replace(/^\//,""),Object.defineProperties(ve,{webkitRelativePath:{writable:!1}})),g([ve]))}):oe.isDirectory&&p(oe,function(ve){ve.forEach(function(Se){ie(Se,""+Ce+oe.name+"/")})})};I.forEach(function(ie){$(ie.webkitGetAsEntry())})},l=h,f=Object.assign||function(N){for(var I=1;I=0)continue;if(!Object.prototype.hasOwnProperty.call(N,H))continue;g[H]=N[H]}return g}function R(N,I){if(!(N instanceof I))throw new TypeError("Cannot call a class as a function")}function _(N,I){if(!N)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:N}function C(N,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);N.prototype=Object.create(I&&I.prototype,{constructor:{value:N,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(N,I):N.__proto__=I)}var D=function(I){return Object.keys(I).reduce(function(g,H){return(H.substr(0,5)==="data-"||H.substr(0,5)==="aria-"||H==="role")&&(g[H]=I[H]),g},{})},O=function(N){C(I,N);function I(){var g,H,$,ie;R(this,I);for(var oe=arguments.length,Ce=Array(oe),ve=0;ves.length&&(_=s.length);R<_;R++)yield s[R]}J.slice=o;function u(s,R=Number.POSITIVE_INFINITY){const _=[];if(R===0)return[_,s];const C=s[Symbol.iterator]();for(let D=0;DC===D){const C=s[Symbol.iterator](),D=R[Symbol.iterator]();for(;;){const O=C.next(),A=D.next();if(O.done!==A.done)return!1;if(O.done)return!0;if(!_(O.value,A.value))return!1}}J.equals=a})(ne||(ne={}))},LdHM:function(nt,xe,Z){"use strict";Z.d(xe,"b",function(){return s}),Z.d(xe,"a",function(){return _});var ne=Z("1OyB"),J=Z("vuIU"),P=Z("Ji7U"),X=Z("LK+K"),j=Z("q1tI"),B=Z("rePB"),K=Z("Ff2n"),G=Z("ODXe"),r=Z("4IlW"),L=Z("bX4T"),v=Z("YrtM"),m=Z("TSYQ"),p=Z.n(m),h=Z("+nKL"),l=Z("8OUc"),f=function(H,$){var ie=H.prefixCls,oe=H.id,Ce=H.flattenOptions,ve=H.childrenAsData,Se=H.values,Ae=H.searchValue,Oe=H.multiple,he=H.defaultActiveFirstOption,ce=H.height,re=H.itemHeight,fe=H.notFoundContent,se=H.open,ke=H.menuItemSelectedIcon,Ne=H.virtual,Re=H.onSelect,Pe=H.onToggleOpen,je=H.onActiveValue,ue=H.onScroll,Ee=H.onMouseEnter,Le="".concat(ie,"-item"),Ie=Object(v.a)(function(){return Ce},[se,Ce],function(He,Te){return Te[0]&&He[1]!==Te[1]}),Ge=j.useRef(null),Xe=function(Te){Te.preventDefault()},Je=function(Te){Ge.current&&Ge.current.scrollTo({index:Te})},Qe=function(Te){for(var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,be=Ie.length,ae=0;ae1&&arguments[1]!==void 0?arguments[1]:!1;return Object(D.a)(g).map(function($,ie){if(!j.isValidElement($)||!$.type)return null;var oe=$.type.isSelectOptGroup,Ce=$.key,ve=$.props,Se=ve.children,Ae=Object(K.a)(ve,["children"]);return H||!oe?O($):Object(C.a)(Object(C.a)({key:"__RC_SELECT_GRP__".concat(Ce===null?ie:Ce,"__"),label:Ce},Ae),{},{options:A(Se)})}).filter(function($){return $})}var S=Z("2Qr1"),T=Z("qNPg"),c=Z("U8pU"),w=Z("Kwbf"),y=Z("WKfj");function b(g){var H=g.mode,$=g.options,ie=g.children,oe=g.backfill,Ce=g.allowClear,ve=g.placeholder,Se=g.getInputElement,Ae=g.showSearch,Oe=g.onSearch,he=g.defaultOpen,ce=g.autoFocus,re=g.labelInValue,fe=g.value,se=g.inputValue,ke=g.optionLabelProp,Ne=H==="multiple"||H==="tags",Re=Ae!==void 0?Ae:Ne||H==="combobox",Pe=$||A(ie);if(Object(w.a)(H!=="tags"||Pe.every(function(Le){return!Le.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),H==="tags"||H==="combobox"){var je=Pe.some(function(Le){return Le.options?Le.options.some(function(Ie){return typeof("value"in Ie?Ie.value:Ie.key)=="number"}):typeof("value"in Le?Le.value:Le.key)=="number"});Object(w.a)(!je,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(w.a)(H!=="combobox"||!ke,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(w.a)(H==="combobox"||!oe,"`backfill` only works with `combobox` mode."),Object(w.a)(H==="combobox"||!Se,"`getInputElement` only work with `combobox` mode."),Object(w.b)(H!=="combobox"||!Se||!Ce||!ve,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Oe&&!Re&&H!=="combobox"&&H!=="tags"&&Object(w.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(w.b)(!he||ce,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),fe!=null){var ue=Object(y.d)(fe);Object(w.a)(!re||ue.every(function(Le){return Object(c.a)(Le)==="object"&&("key"in Le||"value"in Le)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(w.a)(!Ne||Array.isArray(fe),"`value` should be array when `mode` is `multiple` or `tags`")}if(ie){var Ee=null;Object(D.a)(ie).some(function(Le){if(!j.isValidElement(Le)||!Le.type)return!1;var Ie=Le.type;if(Ie.isSelectOption)return!1;if(Ie.isSelectOptGroup){var Ge=Object(D.a)(Le.props.children).every(function(Xe){return!j.isValidElement(Xe)||!Le.type||Xe.type.isSelectOption?!0:(Ee=Xe.type,!1)});return!Ge}return Ee=Ie,!0}),Ee&&Object(w.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ee.displayName||Ee.name||Ee,"`.")),Object(w.a)(se===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var U=b,F=Object(T.a)({prefixCls:"rc-select",components:{optionList:u},convertChildrenToData:A,flattenOptions:S.d,getLabeledValue:S.e,filterOptions:S.b,isValueDisabled:S.g,findValueOption:S.c,warningProps:U,fillOptionsWithMissingValue:S.a}),E=function(g){Object(P.a)($,g);var H=Object(X.a)($);function $(){var ie;return Object(ne.a)(this,$),ie=H.apply(this,arguments),ie.selectRef=j.createRef(),ie.focus=function(){ie.selectRef.current.focus()},ie.blur=function(){ie.selectRef.current.blur()},ie}return Object(J.a)($,[{key:"render",value:function(){return j.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),$}(j.Component);E.Option=s,E.OptGroup=_;var N=E,I=xe.c=N},M8RZ:function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return r});var ne=Z("fWQN"),J=Z("mtLc"),P=Z("yKVA"),X=Z("879j"),j=Z("q1tI"),B=Z.n(j),K=Z("i8i4"),G=Z.n(K),r=function(L){Object(P.a)(m,L);var v=Object(X.a)(m);function m(p){var h;Object(ne.a)(this,m),h=v.call(this,p);var l=window.document;return h.node=l.createElement("div"),l.body.appendChild(h.node),h}return Object(J.a)(m,[{key:"render",value:function(){var h=this.props.children;return Object(K.createPortal)(h,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(B.a.Component)},MI8n:function(nt,xe,Z){"use strict";Z.d(xe,"c",function(){return j}),Z.d(xe,"b",function(){return r}),Z.d(xe,"e",function(){return L}),Z.d(xe,"a",function(){return v}),Z.d(xe,"d",function(){return m}),Z.d(xe,"f",function(){return p});var ne=Z("/cxE"),J=Z("pmY6"),P=Z("24hK"),X=Z("5Y4S"),j;(function(h){h.None=()=>J.a.None;function l(b){return(U,F=null,E)=>{let N=!1,I;return I=b(g=>N?void 0:(I?I.dispose():N=!0,U.call(F,g)),null,E),N&&I.dispose(),I}}h.once=l;function f(b,U){return _((F,E=null,N)=>b(I=>F.call(E,U(I)),null,N))}h.map=f;function o(b,U){return _((F,E=null,N)=>b(I=>{U(I),F.call(E,I)},null,N))}h.forEach=o;function u(b,U){return _((F,E=null,N)=>b(I=>U(I)&&F.call(E,I),null,N))}h.filter=u;function a(b){return b}h.signal=a;function s(...b){return(U,F=null,E)=>Object(J.e)(...b.map(N=>N(I=>U.call(F,I),null,E)))}h.any=s;function R(b,U,F){let E=F;return f(b,N=>(E=U(E,N),E))}h.reduce=R;function _(b){let U;const F=new r({onFirstListenerAdd(){U=b(F.fire,F)},onLastListenerRemove(){U.dispose()}});return F.event}function C(b,U,F=100,E=!1,N){let I,g,H,$=0;const ie=new r({leakWarningThreshold:N,onFirstListenerAdd(){I=b(oe=>{$++,g=U(g,oe),E&&!H&&(ie.fire(g),g=void 0),clearTimeout(H),H=setTimeout(()=>{const Ce=g;g=void 0,H=void 0,(!E||$>1)&&ie.fire(Ce),$=0},F)})},onLastListenerRemove(){I.dispose()}});return ie.event}h.debounce=C;function D(b,U=(F,E)=>F===E){let F=!0,E;return u(b,N=>{const I=F||!U(N,E);return F=!1,E=N,I})}h.latch=D;function O(b,U){return[h.filter(b,U),h.filter(b,F=>!U(F))]}h.split=O;function A(b,U=!1,F=[]){let E=F.slice(),N=b(H=>{E?E.push(H):g.fire(H)});const I=()=>{E&&E.forEach(H=>g.fire(H)),E=null},g=new r({onFirstListenerAdd(){N||(N=b(H=>g.fire(H)))},onFirstListenerDidAdd(){E&&(U?setTimeout(I):I())},onLastListenerRemove(){N&&N.dispose(),N=null}});return g.event}h.buffer=A;class S{constructor(b){this.event=b}map(b){return new S(f(this.event,b))}forEach(b){return new S(o(this.event,b))}filter(b){return new S(u(this.event,b))}reduce(b,U){return new S(R(this.event,b,U))}latch(){return new S(D(this.event))}debounce(b,U=100,F=!1,E){return new S(C(this.event,b,U,F,E))}on(b,U,F){return this.event(b,U,F)}once(b,U,F){return l(this.event)(b,U,F)}}function T(b){return new S(b)}h.chain=T;function c(b,U,F=E=>E){const E=(...H)=>g.fire(F(...H)),N=()=>b.on(U,E),I=()=>b.removeListener(U,E),g=new r({onFirstListenerAdd:N,onLastListenerRemove:I});return g.event}h.fromNodeEventEmitter=c;function w(b,U,F=E=>E){const E=(...H)=>g.fire(F(...H)),N=()=>b.addEventListener(U,E),I=()=>b.removeEventListener(U,E),g=new r({onFirstListenerAdd:N,onLastListenerRemove:I});return g.event}h.fromDOMEventEmitter=w;function y(b){return new Promise(U=>l(b)(U))}h.toPromise=y})(j||(j={}));class B{constructor(h){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${h}_${B._idPool++}`}start(h){this._stopWatch=new X.a(!0),this._listenerCount=h}stop(){if(this._stopWatch){const h=this._stopWatch.elapsed();this._elapsedOverall+=h,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${h.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}B._idPool=0;let K=-1;class G{constructor(h,l=Math.random().toString(18).slice(2,5)){this.customThreshold=h,this.name=l,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(h){let l=K;if(typeof this.customThreshold=="number"&&(l=this.customThreshold),l<=0||h{const u=this._stacks.get(f)||0;this._stacks.set(f,u-1)}}}class r{constructor(h){var l;this._disposed=!1,this._options=h,this._leakageMon=K>0?new G(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((l=this._options)===null||l===void 0?void 0:l._profName)?new B(this._options._profName):void 0}get event(){return this._event||(this._event=(h,l,f)=>{var o;this._listeners||(this._listeners=new P.a);const u=this._listeners.isEmpty();u&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const a=this._listeners.push(l?[h,l]:h);u&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,h,l);const s=(o=this._leakageMon)===null||o===void 0?void 0:o.check(this._listeners.size),R=Object(J.i)(()=>{if(s&&s(),!this._disposed&&(a(),this._options&&this._options.onLastListenerRemove)){const _=this._listeners&&!this._listeners.isEmpty();_||this._options.onLastListenerRemove(this)}});return f instanceof J.b?f.add(R):Array.isArray(f)&&f.push(R),R}),this._event}fire(h){var l,f;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new P.a);for(let o of this._listeners)this._deliveryQueue.push([o,h]);for((l=this._perfMon)===null||l===void 0||l.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[o,u]=this._deliveryQueue.shift();try{typeof o=="function"?o.call(void 0,u):o[0].call(o[1],u)}catch(a){Object(ne.f)(a)}}(f=this._perfMon)===null||f===void 0||f.stop()}}dispose(){var h,l,f,o,u;this._disposed||(this._disposed=!0,(h=this._listeners)===null||h===void 0||h.clear(),(l=this._deliveryQueue)===null||l===void 0||l.clear(),(o=(f=this._options)===null||f===void 0?void 0:f.onLastListenerRemove)===null||o===void 0||o.call(f),(u=this._leakageMon)===null||u===void 0||u.dispose())}}class L extends r{constructor(h){super(h);this._isPaused=0,this._eventQueue=new P.a,this._mergeFn=h==null?void 0:h.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const h=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(h))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(h){this._listeners&&(this._isPaused!==0?this._eventQueue.push(h):super.fire(h))}}class v extends L{constructor(h){var l;super(h);this._delay=(l=h.delay)!==null&&l!==void 0?l:100}fire(h){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(h)}}class m{constructor(){this.buffers=[]}wrapEvent(h){return(l,f,o)=>h(u=>{const a=this.buffers[this.buffers.length-1];a?a.push(()=>l.call(f,u)):l.call(f,u)},void 0,o)}bufferEvents(h){const l=[];this.buffers.push(l);const f=h();return this.buffers.pop(),l.forEach(o=>o()),f}}class p{constructor(){this.listening=!1,this.inputEvent=j.None,this.inputEventListener=J.a.None,this.emitter=new r({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(h){this.inputEvent=h,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=h(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(nt,xe,Z){"use strict";(function(ne,J){Z.d(xe,"b",function(){return f}),Z.d(xe,"i",function(){return s}),Z.d(xe,"f",function(){return R}),Z.d(xe,"d",function(){return _}),Z.d(xe,"g",function(){return C}),Z.d(xe,"h",function(){return D}),Z.d(xe,"c",function(){return O}),Z.d(xe,"k",function(){return A}),Z.d(xe,"j",function(){return S}),Z.d(xe,"a",function(){return T}),Z.d(xe,"e",function(){return y});var P;const X="en";let j=!1,B=!1,K=!1,G=!1,r=!1,L=!1,v=!1,m,p=X,h,l;const f=typeof self=="object"?self:typeof ne=="object"?ne:{};let o;typeof f.vscode!="undefined"&&typeof f.vscode.process!="undefined"?o=f.vscode.process:typeof J!="undefined"&&(o=J);const u=typeof((P=o==null?void 0:o.versions)===null||P===void 0?void 0:P.electron)=="string"&&o.type==="renderer";if(typeof navigator=="object"&&!u)l=navigator.userAgent,j=l.indexOf("Windows")>=0,B=l.indexOf("Macintosh")>=0,v=(l.indexOf("Macintosh")>=0||l.indexOf("iPad")>=0||l.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,K=l.indexOf("Linux")>=0,L=!0,m=navigator.language,p=m;else if(typeof o=="object"){j=o.platform==="win32",B=o.platform==="darwin",K=o.platform==="linux",G=K&&!!o.env.SNAP&&!!o.env.SNAP_REVISION,m=X,p=X;const b=o.env.VSCODE_NLS_CONFIG;if(b)try{const U=JSON.parse(b),F=U.availableLanguages["*"];m=U.locale,p=F||X,h=U._translationsConfigFile}catch(U){}r=!0}else console.error("Unable to resolve platform.");let a=0;B?a=1:j?a=3:K&&(a=2);const s=j,R=B,_=K,C=r,D=L,O=v,A=l,S=function(){if(f.setImmediate)return f.setImmediate.bind(f);if(typeof f.postMessage=="function"&&!f.importScripts){let F=[];f.addEventListener("message",N=>{if(N.data&&N.data.vscodeSetImmediateId)for(let I=0,g=F.length;I{const I=++E;F.push({id:I,callback:N}),f.postMessage({vscodeSetImmediateId:I},"*")}}if(typeof(o==null?void 0:o.nextTick)=="function")return o.nextTick.bind(o);const U=Promise.resolve();return F=>U.then(F)}(),T=B||v?2:j?1:3;let c=!0,w=!1;function y(){if(!w){w=!0;const b=new Uint8Array(2);b[0]=1,b[1]=2;const U=new Uint16Array(b.buffer);c=U[0]===(2<<8)+1}return c}}).call(this,Z("IyRk"),Z("Q2Ig"))},N0LK:function(nt,xe,Z){"use strict";Z.d(xe,"C",function(){return ne}),Z.d(xe,"v",function(){return P}),Z.d(xe,"s",function(){return X}),Z.d(xe,"t",function(){return j}),Z.d(xe,"U",function(){return B}),Z.d(xe,"J",function(){return K}),Z.d(xe,"O",function(){return G}),Z.d(xe,"p",function(){return r}),Z.d(xe,"T",function(){return L}),Z.d(xe,"q",function(){return v}),Z.d(xe,"N",function(){return m}),Z.d(xe,"M",function(){return p}),Z.d(xe,"Q",function(){return h}),Z.d(xe,"u",function(){return l}),Z.d(xe,"x",function(){return f}),Z.d(xe,"I",function(){return o}),Z.d(xe,"f",function(){return u}),Z.d(xe,"h",function(){return a}),Z.d(xe,"g",function(){return s}),Z.d(xe,"i",function(){return R}),Z.d(xe,"G",function(){return _}),Z.d(xe,"H",function(){return C}),Z.d(xe,"r",function(){return D}),Z.d(xe,"R",function(){return O}),Z.d(xe,"d",function(){return A}),Z.d(xe,"e",function(){return S}),Z.d(xe,"E",function(){return T}),Z.d(xe,"F",function(){return c}),Z.d(xe,"j",function(){return w}),Z.d(xe,"z",function(){return y}),Z.d(xe,"K",function(){return U}),Z.d(xe,"L",function(){return F}),Z.d(xe,"m",function(){return N}),Z.d(xe,"k",function(){return g}),Z.d(xe,"A",function(){return $}),Z.d(xe,"a",function(){return ie}),Z.d(xe,"n",function(){return oe}),Z.d(xe,"l",function(){return Ce}),Z.d(xe,"D",function(){return ve}),Z.d(xe,"B",function(){return Se}),Z.d(xe,"b",function(){return Ae}),Z.d(xe,"S",function(){return Oe}),Z.d(xe,"o",function(){return he}),Z.d(xe,"P",function(){return ce}),Z.d(xe,"w",function(){return re}),Z.d(xe,"c",function(){return fe}),Z.d(xe,"y",function(){return Ne});function ne(ue){return!ue||typeof ue!="string"?!0:ue.trim().length===0}const J=/{(\d+)}/g;function P(ue,...Ee){return Ee.length===0?ue:ue.replace(J,function(Le,Ie){const Ge=parseInt(Ie,10);return isNaN(Ge)||Ge<0||Ge>=Ee.length?Le:Ee[Ge]})}function X(ue){return ue.replace(/[<>&]/g,function(Ee){switch(Ee){case"<":return"<";case">":return">";case"&":return"&";default:return Ee}})}function j(ue){return ue.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function B(ue,Ee=" "){const Le=K(ue,Ee);return G(Le,Ee)}function K(ue,Ee){if(!ue||!Ee)return ue;const Le=Ee.length;if(Le===0||ue.length===0)return ue;let Ie=0;for(;ue.indexOf(Ee,Ie)===Ie;)Ie=Ie+Le;return ue.substring(Ie)}function G(ue,Ee){if(!ue||!Ee)return ue;const Le=Ee.length,Ie=ue.length;if(Le===0||Ie===0)return ue;let Ge=Ie,Xe=-1;for(;!(Xe=ue.lastIndexOf(Ee,Ge-1),Xe===-1||Xe+Le!==Ge);){if(Xe===0)return"";Ge=Xe}return ue.substring(0,Ge)}function r(ue){return ue.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function L(ue){return ue.replace(/\*/g,"")}function v(ue,Ee,Le={}){if(!ue)throw new Error("Cannot create regex from empty string");Ee||(ue=j(ue)),Le.wholeWord&&(/\B/.test(ue.charAt(0))||(ue="\\b"+ue),/\B/.test(ue.charAt(ue.length-1))||(ue=ue+"\\b"));let Ie="";return Le.global&&(Ie+="g"),Le.matchCase||(Ie+="i"),Le.multiline&&(Ie+="m"),Le.unicode&&(Ie+="u"),new RegExp(ue,Ie)}function m(ue){if(ue.source==="^"||ue.source==="^$"||ue.source==="$"||ue.source==="^\\s*$")return!1;const Ee=ue.exec("");return!!(Ee&&ue.lastIndex===0)}function p(ue){return(ue.global?"g":"")+(ue.ignoreCase?"i":"")+(ue.multiline?"m":"")+(ue.unicode?"u":"")}function h(ue){return ue.split(/\r\n|\r|\n/)}function l(ue){for(let Ee=0,Le=ue.length;Ee=0;Le--){const Ie=ue.charCodeAt(Le);if(Ie!==32&&Ie!==9)return Le}return-1}function u(ue,Ee){return ueEe?1:0}function a(ue,Ee,Le=0,Ie=ue.length,Ge=0,Xe=Ee.length){for(;Leqe)return 1}const Je=Ie-Le,Qe=Xe-Ge;return JeQe?1:0}function s(ue,Ee){return R(ue,Ee,0,ue.length,0,Ee.length)}function R(ue,Ee,Le=0,Ie=ue.length,Ge=0,Xe=Ee.length){for(;Le=128||qe>=128)return a(ue.toLowerCase(),Ee.toLowerCase(),Le,Ie,Ge,Xe);_(at)&&(at-=32),_(qe)&&(qe-=32);const tt=at-qe;if(tt===0)continue;return tt}const Je=Ie-Le,Qe=Xe-Ge;return JeQe?1:0}function _(ue){return ue>=97&&ue<=122}function C(ue){return ue>=65&&ue<=90}function D(ue,Ee){return ue.length===Ee.length&&R(ue,Ee)===0}function O(ue,Ee){const Le=Ee.length;return Ee.length>ue.length?!1:R(ue,Ee,0,Le)===0}function A(ue,Ee){let Le,Ie=Math.min(ue.length,Ee.length);for(Le=0;Le1){const Ie=ue.charCodeAt(Ee-2);if(T(Ie))return w(Ie,Le)}return Le}function U(ue,Ee){const Le=se.getInstance(),Ie=Ee,Ge=ue.length,Xe=y(ue,Ge,Ee);Ee+=Xe>=65536?2:1;let Je=Le.getGraphemeBreakType(Xe);for(;Ee=65536?2:1,Je=at}return Ee-Ie}function F(ue,Ee){const Le=se.getInstance(),Ie=Ee,Ge=b(ue,Ee);Ee-=Ge>=65536?2:1;let Xe=Le.getGraphemeBreakType(Ge);for(;Ee>0;){const Je=b(ue,Ee),Qe=Le.getGraphemeBreakType(Je);if(fe(Qe,Xe))break;Ee-=Je>=65536?2:1,Xe=Qe}return Ie-Ee}const E=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function N(ue){return E.test(ue)}const I=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function g(ue){return I.test(ue)}const H=/^[\t\n\r\x20-\x7E]*$/;function $(ue){return H.test(ue)}const ie=/[\u2028\u2029]/;function oe(ue){return ie.test(ue)}function Ce(ue){for(let Ee=0,Le=ue.length;Ee=11904&&ue<=55215||ue>=63744&&ue<=64255||ue>=65281&&ue<=65374}function Se(ue){return ue>=127462&&ue<=127487||ue===8986||ue===8987||ue===9200||ue===9203||ue>=9728&&ue<=10175||ue===11088||ue===11093||ue>=127744&&ue<=128591||ue>=128640&&ue<=128764||ue>=128992&&ue<=129003||ue>=129280&&ue<=129535||ue>=129648&&ue<=129750}const Ae=String.fromCharCode(65279);function Oe(ue){return!!(ue&&ue.length>0&&ue.charCodeAt(0)===65279)}function he(ue,Ee=!1){return ue?(Ee&&(ue=ue.replace(/\\./g,"")),ue.toLowerCase()!==ue):!1}function ce(ue){const Ee=90-65+1;return ue=ue%(2*Ee),ueEe[3*Ie+1])Ie=2*Ie+1;else return Ee[3*Ie+2];return 0}}se._INSTANCE=null;function ke(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function Ne(ue,Ee){if(ue===0)return 0;const Le=Re(ue,Ee);if(Le!==void 0)return Le;const Ie=b(Ee,ue);return ue-=Pe(Ie),ue}function Re(ue,Ee){let Le=b(Ee,ue);for(ue-=Pe(Le);je(Le)||Le===65039||Le===8419;){if(ue===0)return;Le=b(Ee,ue),ue-=Pe(Le)}if(!Se(Le))return;if(ue>=0){const Ie=b(Ee,ue);Ie===8205&&(ue-=Pe(Ie))}return ue}function Pe(ue){return ue>=65536?2:1}function je(ue){return 127995<=ue&&ue<=127999}},Ot1p:function(nt,xe,Z){"use strict";var ne=Z("2qtc"),J=Z("kLXV"),P=Z("rAM+"),X=Z("miYZ"),j=Z("tsqr"),B=Z("9og8"),K=Z("tJVT"),G=Z("jrin"),r=Z("WmNS"),L=Z.n(r),v=Z("q1tI"),m=Z.n(v),p=Z("VrN/"),h=Z.n(p),l=Z("bdgK"),f=Z("p77/"),o=Z("Bd2K"),u=Z("ELLl"),a=Z("19Vz"),s=Z("lZu9"),R=Z("+NIl"),_=Z("kSUc"),C=Z("9Bee"),D=function(we){var Fe=we.value,ze=Fe===void 0?"":Fe,st=we.className,mt=we.showTextOnly,ft=we.showLines,wt=we.style,St=wt===void 0?{}:wt,ct=Object(v.useMemo)(function(){return""},[ze]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:ct}}))},O=Z("0Owb"),A=Z("dejd"),S=Z("C+DQ"),T=Z("1vsH"),c=Z("m3rI"),w=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function y(we){var Fe=we.onActionCallback,ze=we.title,st=we.icon,mt=we.actionName,ft=we.className,wt=ft===void 0?"":ft,St=we.children;function ct(){Fe(mt)}return m.a.createElement("a",{title:ze,className:wt,onClick:ct},m.a.createElement("i",{className:"md-iconfont ".concat(st)}),St)}var b=function(we){var Fe=we.watch,ze=we.showNullButton,st=we.onActionCallback,mt=we.fullScreen,ft=we.insertTemp,wt=we.hidetoolBar,St=we.uuid,ct=we.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(T.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(T.F)("_educoder_session"),"&key=").concat(St,"&api=").concat(encodeURIComponent(c.a.PROXY_SERVER)));var Ut=[].concat(w,[{title:"".concat(Fe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Fe?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!wt&&Ut.map(function(Lt,qt){return m.a.createElement("li",{key:qt},Lt.actionName?m.a.createElement(y,Object(O.a)({},Lt,{onActionCallback:st})):m.a.createElement("span",{className:"v-line"}))}),ze?m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:st},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ft&&m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ft),onActionCallback:st},m.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),m.a.createElement("li",{className:"btn-full-screen"},m.a.createElement(y,{icon:"".concat(mt?"icon-shrink":"icon-enlarge"),title:mt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:st})))},U=Z("M8RZ"),F=Z("+L6B"),E=Z("2/Rp"),N=Z("y8nQ"),I=Z("Vl3Y"),g=Z("5NDa"),H=Z("5rEg"),$={labelCol:{span:4},wrapperCol:{span:20}},ie=function(we){var Fe=we.callback,ze=we.onCancel;function st(mt){Fe(mt)}return m.a.createElement(I.a,Object(O.a)({},$,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:st}),m.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(H.a,null)),m.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(H.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(E.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(E.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))},oe=Z("7ahc"),Ce=Z("HmJG"),ve=Z("BjJ7"),Se=I.a.useForm,Ae={width:280,marginRight:10},Oe={labelCol:{span:5},wrapperCol:{span:19}},he=function(we){var Fe=we.callback,ze=we.onCancel,st=Se(),mt=Object(K.a)(st,1),ft=mt[0];function wt(Ut){Fe(Ut)}function St(Ut,Lt){if(Ut.status===-1){j.b.error(Ut.message);return}ft.setFieldsValue({src:"/api/attachments/".concat(Ut.id),type:Lt.type})}function ct(Ut){var Lt=Ut.target.files[0];re(Lt,St)}return m.a.createElement(I.a,Object(O.a)({form:ft},Oe,{className:"upload-image-panel",onFinish:wt}),m.a.createElement(I.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(I.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(H.a,{style:Ae})),m.a.createElement(ce,{onFileChange:ct}))),m.a.createElement(I.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(H.a,{style:{width:264}})),m.a.createElement(I.a.Item,{style:{textAlign:"right"}},m.a.createElement(E.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(E.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))};function ce(we){var Fe=we.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:Fe}))}function re(we,Fe){if(!we)throw new String("\u6CA1\u6709\u6587\u4EF6");var ze=new FormData;ze.append("editormd-image-file",we),ze.append("file_param_name","editormd-image-file"),ze.append("byxhr","true");var st=new window.XMLHttpRequest;st.withCredentials=!0,st.addEventListener("load",function(mt){Fe(JSON.parse(mt.target.responseText),we)},!1),st.addEventListener("error",function(mt){console.error(mt)},!1),st.open("POST","".concat(ve.a,"/api/attachments.json")),st.send(ze)}var fe=Z("giR+"),se=Z("fyUT"),ke=Z("7Kak"),Ne=Z("9yH6"),Re=Ne.a.Group,Pe={margin:"0 8px"},je=function(we){var Fe=we.callback,ze=we.onCancel;function st(mt){Fe(mt)}return m.a.createElement(I.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:st},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:Pe},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:Pe},"\u884C\u6570"),m.a.createElement(I.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(se.a,null)),m.a.createElement("span",{style:Pe},"\u5217\u6570"),m.a.createElement(I.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(se.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:Pe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(I.a.Item,{name:"align"},m.a.createElement(Re,null,m.a.createElement(Ne.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(Ne.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(Ne.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(Ne.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(E.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(E.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))},ue=Z("ErOA"),Ee=Z("7Cbv"),Le="link",Ie="upload-image",Ge="code-block",Xe="add-table",Je="------------",Qe={default:Je,left:":".concat(Je),center:":".concat(Je,":"),right:"".concat(Je,":")},at=Z("9VGf"),qe,tt;function Be(){}var ut=0,ot=1e4,Ue="\u2581",He=` **\u6A21\u677F\u6807\u9898** \u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Te(we){return/^\d+$/.test(we)?"".concat(we,"px"):we}var me=navigator.platform.toUpperCase().indexOf("MAC")>=0,be=me?"Cmd":"Ctrl",ae=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],le=(qe={},Object(G.a)(qe,be+"-B","bold"),Object(G.a)(qe,be+"-I","italic"),qe),de=(tt={},Object(G.a)(tt,Le,"\u6DFB\u52A0\u94FE\u63A5"),Object(G.a)(tt,Ge,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(G.a)(tt,Ie,"\u6DFB\u52A0\u6587\u4EF6"),Object(G.a)(tt,Xe,"\u6DFB\u52A0\u8868\u683C"),tt),ge=xe.a=function(we){var Fe=we.defaultValue,ze=Fe===void 0?"":Fe,st=we.onChange,mt=we.width,ft=mt===void 0?"100%":mt,wt=we.height,St=wt===void 0?400:wt,ct=we.miniToolbar,Ut=ct===void 0?!1:ct,Lt=we.isFocus,qt=Lt===void 0?!1:Lt,Qt=we.watch,It=we.insertTemp,Cr=we.mode,Kr=Cr===void 0?"markdown":Cr,yt=we.id,Lr=yt===void 0?"markdown-editor-id":yt,bt=we.showResizeBar,xt=bt===void 0?!1:bt,Ft=we.noStorage,tr=Ft===void 0?!1:Ft,cr=we.showNullButton,Pt=cr===void 0?!1:cr,dt=we.hidetoolBar,Ur=dt===void 0?!1:dt,Vt=we.fullScreen,Jt=Vt===void 0?!1:Vt,Rt=we.onBlur,lr=we.onCMBeforeChange,Ir=we.onFullScreen,Xr=we.className,$e=Xr===void 0?"":Xr,Ct=we.disablePaste,pi=Ct===void 0?!1:Ct,mi=we.placeholder,gi=mi===void 0?"":mi,vi=we.values,Y=vi===void 0?"":vi,x=Object(v.useState)(null),k=Object(K.a)(x,2),W=k[0],ee=k[1],V=Object(v.useState)(ze),_e=Object(K.a)(V,2),Ke=_e[0],et=_e[1],pt=Object(v.useState)(Qt),Ve=Object(K.a)(pt,2),_t=Ve[0],jt=Ve[1],$t=Object(v.useState)(Jt),jr=Object(K.a)($t,2),Er=jr[0],xr=jr[1],Qr=Object(v.useState)(""),Ii=Object(K.a)(Qr,2),dr=Ii[0],zr=Ii[1],li=Object(v.useState)(0),ui=Object(K.a)(li,2),Hr=ui[0],Di=ui[1],yi=Object(v.useState)(St),Ki=Object(K.a)(yi,2),zi=Ki[0],Zr=Ki[1],$r=Object(v.useState)(!1),bi=Object(K.a)($r,2),cn=bi[0],_i=bi[1],ir=Object(v.useRef)(Object(Ee.a)()),Ht=Object(v.useRef)(!1),yr=Object(v.useRef)(),kt=Object(v.useRef)(),ar=Object(v.useRef)(),Kt=Object(v.useRef)(),ii=Object(v.useRef)(),fr=function(){var gt=Object(B.a)(L.a.mark(function At(){var Et,Dt;return L.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return Yt.next=2,Object(ue.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:ir.current}});case 2:Dt=Yt.sent,Dt!=null&&(Et=Dt.attachments)!==null&&Et!==void 0&&Et.length&&(console.log("cm:",W,kt),Dt.attachments.map(function(Nt){Nt.content_type.indexOf("image")>-1?W.replaceSelection("![,](/api/attachments/".concat(Nt.id,"?type=").concat(Nt.content_type,")")):Nt.content_type.indexOf("video")>-1?W.replaceSelection('')):Nt.content_type.indexOf("pdf")>-1?W.replaceSelection('
    ').concat(Nt.name,"")):W.replaceSelection("[".concat(Nt.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Nt.id,"?type=").concat(Nt.content_type,")"))}));case 4:case"end":return Yt.stop()}},At)}));return function(){return gt.apply(this,arguments)}}();Object(v.useEffect)(function(){et(Y),W==null||W.setValue(Y)},[Y]),Object(v.useEffect)(function(){Ir==null||Ir(Er)},[Er]),Object(v.useEffect)(function(){if(kt.current){var gt=h.a.fromTextArea(kt.current,{mode:Kr,lineNumbers:!Ut,lineWrapping:!0,value:ze,autoCloseTags:!0,autoCloseBrackets:!0});qt&>.focus();function At(Et,Dt){if(pi){Dt.preventDefault();return}var Bt=Dt.clipboardData;if(Bt){var Yt=Bt.types.toString(),Nt=Bt.items;if(Yt==="Files"||Bt.types.indexOf("Files")>-1){if(Dt.preventDefault(),Kr=="stex")return;try{var ur,Dr=Nt[1];((ur=Nt[0])===null||ur===void 0?void 0:ur.kind)==="file"&&(Dr=Nt[0]);var Mt=Dr.getAsFile(),hi=Mt.name.split(".").pop();re(Mt,function(Wt){if(Wt.id){var kr,Tr,Jr;(Mt==null||((kr=Mt.type)===null||kr===void 0)?void 0:kr.indexOf("image"))>-1?gt.replaceSelection("![,](/api/attachments/".concat(Wt.id,"?type=").concat(Wt.content_type,")")):(Mt==null||((Tr=Mt.type)===null||Tr===void 0)?void 0:Tr.indexOf("video"))>-1?gt.replaceSelection('')):(Mt==null||((Jr=Mt.type)===null||Jr===void 0)?void 0:Jr.indexOf("pdf"))>-1?gt.replaceSelection('').concat(Mt.name,"")):ae.includes(hi)?gt.replaceSelection('').concat(Mt.name,"")):gt.replaceSelection("[".concat(Mt.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})}catch(Wt){j.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return gt.on("paste",At),gt.on("dragleave",function(Et,Dt){ar.current.classList.remove("mouse-hover-md")}),gt.on("dragover",function(Et,Dt){ar.current.classList.add("mouse-hover-md")}),gt.on("drop",function(Et,Dt){ar.current.classList.add("mouse-hover-md");var Bt;if(Bt=Dt.dataTransfer.files,Bt.length>0){Dt.preventDefault(),Dt.stopPropagation();for(var Yt=function(Dr){var Mt=Bt[Dr],hi=Mt.name.split(".").pop();re(Mt,function(Wt){if(Wt.id){var kr,Tr,Jr;(Mt==null||((kr=Mt.type)===null||kr===void 0)?void 0:kr.indexOf("image"))>-1?gt.replaceSelection("![,](/api/attachments/".concat(Wt.id,"?type=").concat(Wt.content_type,")")):(Mt==null||((Tr=Mt.type)===null||Tr===void 0)?void 0:Tr.indexOf("video"))>-1?gt.replaceSelection('')):(Mt==null||((Jr=Mt.type)===null||Jr===void 0)?void 0:Jr.indexOf("pdf"))>-1?gt.replaceSelection('').concat(Mt.name,"")):ae.includes(hi)?gt.replaceSelection('').concat(Mt.name,"")):gt.replaceSelection("[".concat(Mt.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})},Nt=0;Nt0||Nt.target.offsetWidth>0)&&(Ar(),W.setSize("100%","100%"),W.refresh())}}catch(ur){Bt.e(ur)}finally{Bt.f()}});return Et.observe(kt.current.parentElement),Et}if(W){var At=gt();return function(){At.unobserve(kt.current.parentElement)}}},[W,Ar]),Object(v.useEffect)(function(){if(W){for(var gt=[],At=function(){var Nt=Dt[Et];Bt=Object(K.a)(Nt,2);var ur=Bt[0],Dr=Bt[1],Mt=Object(G.a)({},ur,function(){Vi(Dr)});gt.push(Mt),W.addKeyMap(Mt)},Et=0,Dt=Object.entries(le);Et0){var gt=new Date().getTime(),At=window.sessionStorage.getItem(Lr);gt>=Hr+ot&&(!At||At!==Ke)&&(window.sessionStorage.setItem(Lr,Ke),_i(!0))}},ot),Object(v.useEffect)(function(){jt(Qt)},[W,Qt]),Object(v.useEffect)(function(){W&&(qt&&W.focus())},[W,qt]),Object(v.useEffect)(function(){if(_t&&W){var gt=W.getScrollerElement();function At(Et){var Dt=Et.target;if(ii.current){var Bt=Dt.scrollTop/Dt.scrollHeight;ii.current.scrollTop=ii.current.scrollHeight*Bt}}return gt.addEventListener("scroll",At),function(){gt.removeEventListener("scroll",At)}}},[W,_t]),Object(v.useEffect)(function(){if(W&&lr){function gt(At,Et){lr(At,Et)}return W.on("beforeChange",gt),function(){W.off("beforeChange",gt)}}},[W,lr]),Object(v.useEffect)(function(){if(W&&Rt){function gt(){Rt(W.getValue())}return W.on("blur",gt),function(){W.off("blur",gt)}}},[W,Rt]),Object(v.useEffect)(function(){if(W){function gt(At){var Et=At.getValue();et(Et),Di(new Date().getTime()),At.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),st&&st(Et)}return W.on("change",gt),function(){W.off("change",gt)}}},[W,st]),Object(v.useEffect)(function(){W&&(ze==null?(W.setValue(""),et("")):ze!==W.getValue()&&(W.setValue(ze),et(ze),W.setCursor(W.lineCount(),0)))},[W,ze]);var Vi=Object(v.useCallback)(function(gt){var At=W.getCursor(),Et=W.getSelection(),Dt=Et.split(` `);switch(gt){case"bold":return W.replaceSelection("**"+Et+"**"),Et===""&&W.setCursor(At.line,At.ch+2),W.focus();case"italic":return W.replaceSelection("*"+Et+"*"),Et===""&&W.setCursor(At.line,At.ch+1),W.focus();case"code":return W.replaceSelection("`"+Et+"`"),Et===""&&W.setCursor(At.line,At.ch+1),W.focus();case"inline-latex":return W.replaceSelection("`$$"+Et+"$$`"),Et===""&&W.setCursor(At.line,At.ch+3),W.focus();case"latex":return W.replaceSelection("```latex\n"+Et+"\n```"),W.setCursor(At.line+1,Et.length+1),W.focus();case"line-break":return W.replaceSelection(`
    `),W.focus();case"list-ul":return Et===""?W.replaceSelection("- "+Et):W.replaceSelection(Dt.map(function(Bt){return Bt===""?"":"- ".concat(Bt)}).join(` `)),W.focus();case"list-ol":return Et===""?W.replaceSelection("1. "+Et):W.replaceSelection(Dt.map(function(Bt,Yt){return Bt===""?"":"".concat(Yt+1,". ").concat(Bt)}).join(` `)),W.focus();case"add-null-ch":return Et===""&&W.setCursor(At.line,At.ch+1),W.replaceSelection(Ue),W.focus();case"inster-template-1":return Et===""&&W.setCursor(At.line,At.ch),W.replaceSelection(He),W.focus();case"eraser":return W.setValue(""),W.focus();case"trigger-watch":return jt(!_t),W.focus();case"trigger-full-screen":return xr(!Er),W.focus();case Le:zr(Le);return;case Ge:zr(Ge);return;case Ie:zr(Ie);return;case Xe:zr(Xe);return;default:throw new Error}},[W,_t,Er]),Ei=Object(v.useCallback)(function(gt){zr("");switch(dr){case Le:var At=gt.title,Et=gt.link;return W.replaceSelection("[".concat(At,"](").concat(Et,")")),W.focus();case Ge:var Dt=gt.language,Bt=gt.content;return W.replaceSelection(["```"+Dt,Bt,"```"].join(` `)),W.focus();case Ie:var Yt=gt.src,Nt=gt.alt;return Nt?W.replaceSelection("![ ".concat(Nt," ]( ").concat(Yt,' "').concat(Nt,'" )')):W.replaceSelection("![,](".concat(Yt,")")),W.focus();case Xe:for(var ur=gt.row,Dr=gt.col,Mt=gt.align,hi=` `,Wt=0;Wt300&&(ur=300);var Dr=St+ur+"px";Zr(Dr)}}return gt.addEventListener("mousedown",Dt),document.addEventListener("mousemove",Yt),document.addEventListener("mouseup",Bt),function(){gt.removeEventListener("mousedown",Dt),document.removeEventListener("mousemove",Yt),document.removeEventListener("mouseup",Bt)}}},[W,Kt]),Object(v.useEffect)(function(){Zr(St)},[St]);var ni=Te(ft),fn=Te(zi),qr={width:ni,height:fn},pn=Object(v.useMemo)(function(){if(Hr){var gt=new Date(Hr),At=gt.getHours(),Et=gt.getMinutes(),Dt=gt.getSeconds();return At=At<10?"0"+At:At,Et=Et<10?"0"+Et:Et,Dt=Dt<10?"0"+Dt:Dt,"".concat(At,":").concat(Et,":").concat(Dt)}return 0},[Hr]);function jn(){window.sessionStorage.removeItem(Lr),_i(!1),Di(0)}function ki(){_i(!1),Di(0),W.setValue(window.sessionStorage.getItem(Lr))}function ua(gt,At){var Et=W.getValue();Et=Et.replace(gt,At),et(Et),W==null||W.setValue(Et)}return m.a.createElement(v.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:ar},m.a.createElement("div",{className:"markdown-editor-container ".concat($e," ").concat(_t?"on-preview":""," ").concat(Ut?"mini":""," ").concat(Er?"full-screen":""),style:qr},m.a.createElement(b,{insertTemp:It,watch:_t,fullScreen:Er,showNullButton:Pt,onActionCallback:Vi,hidetoolBar:Ur,uuid:ir.current,setOpenPhones:function(){Ht.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:kt,placeholder:gi})),_t?m.a.createElement("div",{ref:ii,className:"preview-container"},Kr==="stex"&&m.a.createElement(D,{value:Ke}),Kr!=="stex"&&m.a.createElement(C.a,{edit:!0,value:Ke,replaces:ua})):null))),xt?m.a.createElement("a",{ref:Kt,className:"editor-resize"}):null,m.a.createElement(U.a,null,de[dr]?m.a.createElement(J.a,{centered:!0,title:de[dr],visible:!0,onCancel:xi,footer:null,className:"markdown-popup-form"},dn):null))}},SJMd:function(nt,xe){/** * @license * Copyright (C) 2006 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */var Z,ne,J,P=!1,X,j;window.PR_SHOULD_USE_CONTINUATION=!0;var B,K;(function(){var G=window,r=["break,continue,do,else,for,if,return,while"],L=[r,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],v=[L,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[v,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],p=[v,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],h=[v,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],l="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",f=[v,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],o="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",u=[r,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],a=[r,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],s=[r,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=[m,h,p,f,o,u,a,s],_=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,C="str",D="kwd",O="com",A="typ",S="lit",T="pun",c="pln",w="tag",y="dec",b="src",U="atn",F="atv",E="nocode",N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function I(Re){for(var Pe=0,je=!1,ue=!1,Ee=0,Le=Re.length;Ee122||(ae<65||be>90||ut.push([Math.max(65,be)|32,Math.min(ae,90)|32]),ae<97||be>122||ut.push([Math.max(97,be)&~32,Math.min(ae,122)&~32]))}}ut.sort(function(we,Fe){return we[0]-Fe[0]||Fe[1]-we[1]});for(var le=[],de=[],He=0;Hege[0]&&(ge[1]+1>ge[0]&&Ue.push("-"),Ue.push(Je(ge[1])))}return Ue.push("]"),Ue.join("")}function at(tt){for(var Be=tt.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),ut=Be.length,ot=[],Ue=0,He=0;Ue=2&&be==="["?Be[Ue]=Qe(Te):be!=="\\"&&(Be[Ue]=Te.replace(/[a-zA-Z]/g,function(de){var ge=de.charCodeAt(0);return"["+String.fromCharCode(ge&~32,ge|32)+"]"}))}return Be.join("")}for(var qe=[],Ee=0,Le=Re.length;Ee=0;)je[qe.charAt(tt)]=at;var Be=at[1],ut=""+Be;Xe.hasOwnProperty(ut)||(Ge.push(Be),Xe[ut]=null)}Ge.push(/[\0-\uffff]/),ue=I(Ge)})();var Ee=Pe.length,Le=function(Ie){for(var Ge=Ie.sourceCode,Xe=Ie.basePos,Je=Ie.sourceNode,Qe=[Xe,c],at=0,qe=Ge.match(ue)||[],tt={},Be=0,ut=qe.length;Be=5&&Ue.substring(0,5)==="lang-",Te&&!(He&&typeof He[1]=="string")&&(Te=!1,Ue=b),Te||(tt[ot]=Ue)}var ae=at;if(at+=ot.length,!Te)Qe.push(Xe+ae,Ue);else{var le=He[1],de=ot.indexOf(le),ge=de+le.length;He[2]&&(ge=ot.length-He[2].length,de=ge-le.length);var we=Ue.substring(5);H(Je,Xe+ae,ot.substring(0,de),Le,Qe),H(Je,Xe+ae+de,le,ce(we,le),Qe),H(Je,Xe+ae+ge,ot.substring(ge),Le,Qe)}}Ie.decorations=Qe};return Le}function Ce(Re){var Pe=[],je=[];Re.tripleQuotedStrings?Pe.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Re.multiLineStrings?Pe.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Pe.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Re.verbatimStrings&&je.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var ue=Re.hashComments;ue&&(Re.cStyleComments?(ue>1?Pe.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Pe.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),je.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Pe.push([O,/^#[^\r\n]*/,null,"#"])),Re.cStyleComments&&(je.push([O,/^\/\/[^\r\n]*/,null]),je.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ee=Re.regexLiterals;if(Ee){var Le=Ee>1?"":` \r`,Ie=Le?".":"[\\S\\s]",Ge="/(?=[^/*"+Le+"])(?:[^/\\x5B\\x5C"+Le+"]|\\x5C"+Ie+"|\\x5B(?:[^\\x5C\\x5D"+Le+"]|\\x5C"+Ie+")*(?:\\x5D|$))+/";je.push(["lang-regex",RegExp("^"+N+"("+Ge+")")])}var Xe=Re.types;Xe&&je.push([A,Xe]);var Je=(""+Re.keywords).replace(/^ | $/g,"");Je.length&&je.push([D,new RegExp("^(?:"+Je.replace(/[\s,]+/g,"|")+")\\b"),null]),Pe.push([c,/^\s+/,null,` \r \xA0`]);var Qe="^.[^\\s\\w.$@'\"`/\\\\]*";return Re.regexLiterals&&(Qe+="(?!s*/)"),je.push([S,/^@[a-z_$][a-z_$@0-9]*/i,null],[A,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[a-z_$][a-z_$@0-9]*/i,null],[S,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[c,/^\\[\s\S]?/,null],[T,new RegExp(Qe),null]),oe(Pe,je)}var ve=Ce({keywords:R,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Se(Re,Pe,je){for(var ue=/(?:^|\s)nocode(?:\s|$)/,Ee=/\r\n?|\n/,Le=Re.ownerDocument,Ie=Le.createElement("li");Re.firstChild;)Ie.appendChild(Re.firstChild);var Ge=[Ie];function Xe(Be){var ut=Be.nodeType;if(ut==1&&!ue.test(Be.className))if(Be.nodeName==="br")Je(Be),Be.parentNode&&Be.parentNode.removeChild(Be);else for(var ot=Be.firstChild;ot;ot=ot.nextSibling)Xe(ot);else if((ut==3||ut==4)&&je){var Ue=Be.nodeValue,He=Ue.match(Ee);if(He){var Te=Ue.substring(0,He.index);Be.nodeValue=Te;var me=Ue.substring(He.index+He[0].length);if(me){var be=Be.parentNode;be.insertBefore(Le.createTextNode(me),Be.nextSibling)}Je(Be),Te||Be.parentNode.removeChild(Be)}}}function Je(Be){for(;!Be.nextSibling;)if(Be=Be.parentNode,!Be)return;function ut(He,Te){var me=Te?He.cloneNode(!1):He,be=He.parentNode;if(be){var ae=ut(be,1),le=He.nextSibling;ae.appendChild(me);for(var de=le;de;de=le)le=de.nextSibling,ae.appendChild(de)}return me}for(var ot=ut(Be.nextSibling,0),Ue;(Ue=ot.parentNode)&&Ue.nodeType===1;)ot=Ue;Ge.push(ot)}for(var Qe=0;Qe=be&&(Xe+=2),Le>=ae&&(at+=2)}}finally{Ue&&(Ue.style.display=He)}}var Oe={};function he(Re,Pe){for(var je=Pe.length;--je>=0;){var ue=Pe[je];Oe.hasOwnProperty(ue)?G.console&&console.warn("cannot override language handler %s",ue):Oe[ue]=Re}}function ce(Re,Pe){return Re&&Oe.hasOwnProperty(Re)||(Re=/^\s*]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[T,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),he(oe([[c,/^[\s]+/,null,` \r `],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[w,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[U,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[T,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),he(oe([],[[F,/^[\s\S]+/]]),["uq.val"]),he(Ce({keywords:m,hashComments:!0,cStyleComments:!0,types:_}),["c","cc","cpp","cxx","cyc","m"]),he(Ce({keywords:"null,true,false"}),["json"]),he(Ce({keywords:h,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:_}),["cs"]),he(Ce({keywords:p,cStyleComments:!0}),["java"]),he(Ce({keywords:s,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),he(Ce({keywords:u,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),he(Ce({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),he(Ce({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),he(Ce({keywords:f,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),he(Ce({keywords:l,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),he(oe([],[[C,/^[\s\S]+/]]),["regex"]);function re(Re){var Pe=Re.langExtension;try{var je=g(Re.sourceNode,Re.pre),ue=je.sourceCode;Re.sourceCode=ue,Re.spans=je.spans,Re.basePos=0,ce(Pe,ue)(Re),Ae(Re)}catch(Ee){G.console&&console.log(Ee&&Ee.stack||Ee)}}function fe(Re,Pe,je){var ue=je||!1,Ee=Pe||null,Le=document.createElement("div");Le.innerHTML="
    "+Re+"
    ",Le=Le.firstChild,ue&&Se(Le,ue,!0);var Ie={langExtension:Ee,numberLines:ue,sourceNode:Le,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return re(Ie),Le.innerHTML}function se(Re,Pe){var je=Pe||document.body,ue=je.ownerDocument||document;function Ee(me){return je.getElementsByTagName(me)}for(var Le=[Ee("pre"),Ee("code"),Ee("xmp")],Ie=[],Ge=0;Ge=0),j.set("isFirefox",X.indexOf("Firefox")>=0),j.set("isChrome",X.indexOf("Chrome")>=0),j.set("isSafari",X.indexOf("Safari")>=0);const B=Object.prototype.hasOwnProperty;class K{static has(E){return m.create(E)}static equals(E,N){return p.create(E,N)}static regex(E,N){return C.create(E,N)}static not(E){return o.create(E)}static and(...E){return A.create(E,null)}static or(...E){return S.create(E,null,!0)}static deserialize(E,N=!1){return E?this._deserializeOrExpression(E,N):void 0}static _deserializeOrExpression(E,N){let I=E.split("||");return S.create(I.map(g=>this._deserializeAndExpression(g,N)),null,!0)}static _deserializeAndExpression(E,N){let I=E.split("&&");return A.create(I.map(g=>this._deserializeOne(g,N)),null)}static _deserializeOne(E,N){if(E=E.trim(),E.indexOf("!=")>=0){let I=E.split("!=");return f.create(I[0].trim(),this._deserializeValue(I[1],N))}if(E.indexOf("==")>=0){let I=E.split("==");return p.create(I[0].trim(),this._deserializeValue(I[1],N))}if(E.indexOf("=~")>=0){let I=E.split("=~");return C.create(I[0].trim(),this._deserializeRegexValue(I[1],N))}if(E.indexOf(" in ")>=0){let I=E.split(" in ");return h.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(E)){const I=E.split(">=");return s.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(E)){const I=E.split(">");return a.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(E)){const I=E.split("<=");return _.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(E)){const I=E.split("<");return R.create(I[0].trim(),I[1].trim())}return/^\!\s*/.test(E)?o.create(E.substr(1).trim()):m.create(E)}static _deserializeValue(E,N){if(E=E.trim(),E==="true")return!0;if(E==="false")return!1;let I=/^'([^']*)'$/.exec(E);return I?I[1].trim():E}static _deserializeRegexValue(E,N){if(Object(J.C)(E)){if(N)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let I=E.indexOf("/"),g=E.lastIndexOf("/");if(I===g||I<0){if(N)throw new Error(`bad regexp-value '${E}', missing /-enclosure`);return console.warn(`bad regexp-value '${E}', missing /-enclosure`),null}let H=E.slice(I+1,g),$=E[g+1]==="i"?"i":"";try{return new RegExp(H,$)}catch(ie){if(N)throw new Error(`bad regexp-value '${E}', parse error: ${ie}`);return console.warn(`bad regexp-value '${E}', parse error: ${ie}`),null}}}function G(E,N){const I=E?E.substituteConstants():void 0,g=N?N.substituteConstants():void 0;return!I&&!g?!0:!I||!g?!1:I.equals(g)}function r(E,N){return E.cmp(N)}class L{constructor(){this.type=0}cmp(E){return this.type-E.type}equals(E){return E.type===this.type}substituteConstants(){return this}evaluate(E){return!1}serialize(){return"false"}keys(){return[]}negate(){return v.INSTANCE}}L.INSTANCE=new L;class v{constructor(){this.type=1}cmp(E){return this.type-E.type}equals(E){return E.type===this.type}substituteConstants(){return this}evaluate(E){return!0}serialize(){return"true"}keys(){return[]}negate(){return L.INSTANCE}}v.INSTANCE=new v;class m{constructor(E,N){this.key=E,this.negated=N,this.type=2}static create(E,N=null){const I=j.get(E);return typeof I=="boolean"?I?v.INSTANCE:L.INSTANCE:new m(E,N)}cmp(E){return E.type!==this.type?this.type-E.type:y(this.key,E.key)}equals(E){return E.type===this.type?this.key===E.key:!1}substituteConstants(){const E=j.get(this.key);return typeof E=="boolean"?E?v.INSTANCE:L.INSTANCE:this}evaluate(E){return!!E.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this)),this.negated}}class p{constructor(E,N,I){this.key=E,this.value=N,this.negated=I,this.type=4}static create(E,N,I=null){if(typeof N=="boolean")return N?m.create(E,I):o.create(E,I);const g=j.get(E);if(typeof g=="boolean"){const H=g?"true":"false";return N===H?v.INSTANCE:L.INSTANCE}return new p(E,N,I)}cmp(E){return E.type!==this.type?this.type-E.type:b(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){const E=j.get(this.key);if(typeof E=="boolean"){const N=E?"true":"false";return this.value===N?v.INSTANCE:L.INSTANCE}return this}evaluate(E){return E.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this.value,this)),this.negated}}class h{constructor(E,N){this.key=E,this.valueKey=N,this.type=10,this.negated=null}static create(E,N){return new h(E,N)}cmp(E){return E.type!==this.type?this.type-E.type:b(this.key,this.valueKey,E.key,E.valueKey)}equals(E){return E.type===this.type?this.key===E.key&&this.valueKey===E.valueKey:!1}substituteConstants(){return this}evaluate(E){const N=E.getValue(this.valueKey),I=E.getValue(this.key);return Array.isArray(N)?N.indexOf(I)>=0:typeof I=="string"&&typeof N=="object"&&N!==null?B.call(N,I):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=l.create(this)),this.negated}}class l{constructor(E){this._actual=E,this.type=11}static create(E){return new l(E)}cmp(E){return E.type!==this.type?this.type-E.type:this._actual.cmp(E._actual)}equals(E){return E.type===this.type?this._actual.equals(E._actual):!1}substituteConstants(){return this}evaluate(E){return!this._actual.evaluate(E)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class f{constructor(E,N,I){this.key=E,this.value=N,this.negated=I,this.type=5}static create(E,N,I=null){if(typeof N=="boolean")return N?o.create(E,I):m.create(E,I);const g=j.get(E);if(typeof g=="boolean"){const H=g?"true":"false";return N===H?L.INSTANCE:v.INSTANCE}return new f(E,N,I)}cmp(E){return E.type!==this.type?this.type-E.type:b(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){const E=j.get(this.key);if(typeof E=="boolean"){const N=E?"true":"false";return this.value===N?L.INSTANCE:v.INSTANCE}return this}evaluate(E){return E.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this.value,this)),this.negated}}class o{constructor(E,N){this.key=E,this.negated=N,this.type=3}static create(E,N=null){const I=j.get(E);return typeof I=="boolean"?I?L.INSTANCE:v.INSTANCE:new o(E,N)}cmp(E){return E.type!==this.type?this.type-E.type:y(this.key,E.key)}equals(E){return E.type===this.type?this.key===E.key:!1}substituteConstants(){const E=j.get(this.key);return typeof E=="boolean"?E?L.INSTANCE:v.INSTANCE:this}evaluate(E){return!E.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this)),this.negated}}function u(E,N){if(typeof E=="string"){const I=parseFloat(E);isNaN(I)||(E=I)}return typeof E=="string"||typeof E=="number"?N(E):L.INSTANCE}class a{constructor(E,N,I){this.key=E,this.value=N,this.negated=I,this.type=12}static create(E,N,I=null){return u(N,g=>new a(E,g,I))}cmp(E){return E.type!==this.type?this.type-E.type:b(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){return this}evaluate(E){return typeof this.value=="string"?!1:parseFloat(E.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=_.create(this.key,this.value,this)),this.negated}}class s{constructor(E,N,I){this.key=E,this.value=N,this.negated=I,this.type=13}static create(E,N,I=null){return u(N,g=>new s(E,g,I))}cmp(E){return E.type!==this.type?this.type-E.type:b(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){return this}evaluate(E){return typeof this.value=="string"?!1:parseFloat(E.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=R.create(this.key,this.value,this)),this.negated}}class R{constructor(E,N,I){this.key=E,this.value=N,this.negated=I,this.type=14}static create(E,N,I=null){return u(N,g=>new R(E,g,I))}cmp(E){return E.type!==this.type?this.type-E.type:b(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){return this}evaluate(E){return typeof this.value=="string"?!1:parseFloat(E.getValue(this.key))new _(E,g,I))}cmp(E){return E.type!==this.type?this.type-E.type:b(this.key,this.value,E.key,E.value)}equals(E){return E.type===this.type?this.key===E.key&&this.value===E.value:!1}substituteConstants(){return this}evaluate(E){return typeof this.value=="string"?!1:parseFloat(E.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=a.create(this.key,this.value,this)),this.negated}}class C{constructor(E,N){this.key=E,this.regexp=N,this.type=7,this.negated=null}static create(E,N){return new C(E,N)}cmp(E){if(E.type!==this.type)return this.type-E.type;if(this.keyE.key)return 1;const N=this.regexp?this.regexp.source:"",I=E.regexp?E.regexp.source:"";return NI?1:0}equals(E){if(E.type===this.type){const N=this.regexp?this.regexp.source:"",I=E.regexp?E.regexp.source:"";return this.key===E.key&&N===I}return!1}substituteConstants(){return this}evaluate(E){let N=E.getValue(this.key);return this.regexp?this.regexp.test(N):!1}serialize(){const E=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${E}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=D.create(this)),this.negated}}class D{constructor(E){this._actual=E,this.type=8}static create(E){return new D(E)}cmp(E){return E.type!==this.type?this.type-E.type:this._actual.cmp(E._actual)}equals(E){return E.type===this.type?this._actual.equals(E._actual):!1}substituteConstants(){return this}evaluate(E){return!this._actual.evaluate(E)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function O(E){let N=null;for(let I=0,g=E.length;IE.expr.length)return 1;for(let N=0,I=this.expr.length;N1;){const H=I[I.length-1];if(H.type!==9)break;I.pop();const $=I.pop(),ie=I.length===0,oe=S.create(H.expr.map(Ce=>A.create([Ce,$],null)),null,ie);oe&&(I.push(oe),I.sort(r))}return I.length===1?I[0]:new A(I,N)}serialize(){return this.expr.map(E=>E.serialize()).join(" && ")}keys(){const E=[];for(let N of this.expr)E.push(...N.keys());return E}negate(){if(!this.negated){const E=[];for(let N of this.expr)E.push(N.negate());this.negated=S.create(E,this,!0)}return this.negated}}class S{constructor(E,N){this.expr=E,this.negated=N,this.type=9}static create(E,N,I){return S._normalizeArr(E,N,I)}cmp(E){if(E.type!==this.type)return this.type-E.type;if(this.expr.lengthE.expr.length)return 1;for(let N=0,I=this.expr.length;NE.serialize()).join(" || ")}keys(){const E=[];for(let N of this.expr)E.push(...N.keys());return E}negate(){if(!this.negated){let E=[];for(let N of this.expr)E.push(N.negate());for(;E.length>1;){const N=E.shift(),I=E.shift(),g=[];for(const $ of F(N))for(const ie of F(I))g.push(A.create([$,ie],null));const H=E.length===0;E.unshift(S.create(g,null,H))}this.negated=E[0]}return this.negated}}class T extends m{constructor(E,N,I){super(E,null);this._defaultValue=N,typeof I=="object"?T._info.push(Object.assign(Object.assign({},I),{key:E})):I!==!0&&T._info.push({key:E,description:I,type:N!=null?typeof N:void 0})}static all(){return T._info.values()}bindTo(E){return E.createKey(this.key,this._defaultValue)}getValue(E){return E.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(E){return p.create(this.key,E)}}T._info=[];const c=Object(P.c)("contextKeyService"),w="setContext";function y(E,N){return EN?1:0}function b(E,N,I,g){return EI?1:Ng?1:0}function U(E,N){if(N.type===6&&E.type!==9&&E.type!==6){for(const H of N.expr)if(E.equals(H))return!0}const I=E.negate(),g=F(I).concat(F(N));g.sort(r);for(let H=0;H=0;h--)if(this.__items[h].match(p))return!0;return!1},L.prototype.set_indent=function(p,h){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},L.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)},L.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},L.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},L.prototype.is_empty=function(){return this.__items.length===0},L.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},L.prototype.push=function(p){this.__items.push(p);var h=p.lastIndexOf(` `);h!==-1?this.__character_count=p.length-h:this.__character_count+=p.length},L.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},L.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},L.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},L.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},L.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function v(p,h){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),h=h||"",p.indent_level>0&&(h=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}v.prototype.get_indent_size=function(p,h){var l=this.__base_string_length;return h=h||0,p<0&&(l=0),l+=p*this.__indent_size,l+=h,l},v.prototype.get_indent_string=function(p,h){var l=this.__base_string;return h=h||0,p<0&&(p=0,l=""),h+=p*this.__indent_size,this.__ensure_cache(h),l+=this.__cache[h],l},v.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var p=this.__cache.length,h=0,l="";this.__indent_size&&p>=this.__indent_size&&(h=Math.floor(p/this.__indent_size),p-=h*this.__indent_size,l=new Array(h+1).join(this.__indent_string)),p&&(l+=new Array(p+1).join(" ")),this.__cache.push(l)};function m(p,h){this.__indent_cache=new v(p,h),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new L(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(p,h){return this.__indent_cache.get_indent_string(p,h)},m.prototype.get_indent_size=function(p,h){return this.__indent_cache.get_indent_size(p,h)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(p){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===` `&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(` `);return p!==` `&&(l=l.replace(/[\n]/g,p)),l},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,h){return p=p||0,h=h||0,this.next_line.set_indent(p,h),this.__lines.length>1?(this.current_line.set_indent(p,h),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var h=0;h1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(p,h){for(var l=this.__lines.length-2;l>=0;){var f=this.__lines[l];if(f.is_empty())break;if(f.item(0).indexOf(p)!==0&&f.item(-1)!==h){this.__lines.splice(l+1,0,new L(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},r.exports.Output=m},,,,function(r){function L(p,h){this.raw_options=v(p,h),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}L.prototype._get_array=function(p,h){var l=this.raw_options[p],f=h||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(f=l.concat()):typeof l=="string"&&(f=l.split(/[^a-zA-Z0-9_\/\-]+/)),f},L.prototype._get_boolean=function(p,h){var l=this.raw_options[p],f=l===void 0?!!h:!!l;return f},L.prototype._get_characters=function(p,h){var l=this.raw_options[p],f=h||"";return typeof l=="string"&&(f=l.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),f},L.prototype._get_number=function(p,h){var l=this.raw_options[p];h=parseInt(h,10),isNaN(h)&&(h=0);var f=parseInt(l,10);return isNaN(f)&&(f=h),f},L.prototype._get_selection=function(p,h,l){var f=this._get_selection_list(p,h,l);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values: `+h+` You passed in: '`+this.raw_options[p]+"'");return f[0]},L.prototype._get_selection_list=function(p,h,l){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[h[0]],!this._is_valid_selection(l,h))throw new Error("Invalid Default Value!");var f=this._get_array(p,l);if(!this._is_valid_selection(f,h))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values: `+h+` You passed in: '`+this.raw_options[p]+"'");return f},L.prototype._is_valid_selection=function(p,h){return p.length&&h.length&&!p.some(function(l){return h.indexOf(l)===-1})};function v(p,h){var l={};p=m(p);var f;for(f in p)f!==h&&(l[f]=p[f]);if(h&&p[h])for(f in p[h])l[f]=p[h][f];return l}function m(p){var h={},l;for(l in p){var f=l.replace(/-/g,"_");h[f]=p[l]}return h}r.exports.Options=L,r.exports.normalizeOpts=m,r.exports.mergeOpts=v},,function(r){var L=RegExp.prototype.hasOwnProperty("sticky");function v(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position=0&&m=0&&p=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},r.exports.InputScanner=v},,,,,function(r){function L(v,m){v=typeof v=="string"?v:v.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+m,"g")}L.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(v);p;)m[p[1]]=p[2],p=this.__directive_pattern.exec(v);return m},L.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=L},,function(r,L,v){var m=v(16).Beautifier,p=v(17).Options;function h(l,f){var o=new m(l,f);return o.beautify()}r.exports=h,r.exports.defaultOptions=function(){return new p}},function(r,L,v){var m=v(17).Options,p=v(2).Output,h=v(8).InputScanner,l=v(13).Directives,f=new l(/\/\*/,/\*\//),o=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,a=/\s/,s=/(?:\s|\n)+/g,R=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,_=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function C(D,O){this._source_text=D||"",this._options=new m(O),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}C.prototype.eatString=function(D){var O="";for(this._ch=this._input.next();this._ch;){if(O+=this._ch,this._ch==="\\")O+=this._input.next();else if(D.indexOf(this._ch)!==-1||this._ch===` `)break;this._ch=this._input.next()}return O},C.prototype.eatWhitespace=function(D){for(var O=a.test(this._input.peek()),A=0;a.test(this._input.peek());)this._ch=this._input.next(),D&&this._ch===` `&&((A===0||A0&&this._indentLevel--},C.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var D=this._source_text,O=this._options.eol;O==="auto"&&(O=` `,D&&o.test(D||"")&&(O=D.match(o)[0])),D=D.replace(u,` `);var A=D.match(/^[\t ]*/)[0];this._output=new p(this._options,A),this._input=new h(D),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var S=0,T=!1,c=!1,w=!1,y=!1,b=!1,U=!1,F=this._ch,E=!1,N,I,g;N=this._input.read(s),I=N!=="",g=F,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),F=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var H=this._input.read(R),$=f.get_directives(H);$&&$.ignore==="start"&&(H+=f.readIgnored(this._input)),this.print_string(H),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(_)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(I),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ie=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ie.match(/[ :]$/)&&(ie=this.eatString(": ").replace(/\s$/,""),this.print_string(ie),this._output.space_before_token=!0),ie=ie.replace(/\s$/,""),ie==="extend"?y=!0:ie==="import"&&(b=!0),ie in this.NESTED_AT_RULE?(this._nestedLevel+=1,ie in this.CONDITIONAL_GROUP_RULE&&(w=!0)):!T&&S===0&&ie.indexOf(":")!==-1&&(c=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(I),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")c&&(c=!1,this.outdent()),w?(w=!1,T=this._indentLevel>=this._nestedLevel):T=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&T&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(g==="("?this._output.space_before_token=!1:g!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),g==="{"&&this._output.trim(!0),b=!1,y=!1,c&&(this.outdent(),c=!1),this.print_string(this._ch),T=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var oe=0;oe"||this._ch==="+"||this._ch==="~")&&!c&&S===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&a.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(I),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),a.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Se=g==='"'||g==="'";this.preserveSingleSpace(Se||I),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===` `&&E&&this._output.add_new_line()}var Ae=this._output.get_code(O);return Ae},r.exports.Beautifier=C},function(r,L,v){var m=v(6).Options;function p(h){m.call(this,h,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var l=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||l;var f=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var o=0;o` ${v} `).trim():""}class K{constructor(r,L,v){this.id=r,this.definition=L,this.description=v,P.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var G;(function(r){r.iconNameSegment="[A-Za-z0-9]+",r.iconNameExpression="[A-Za-z0-9\\-]+",r.iconModifierExpression="~[A-Za-z]+";const L=new RegExp(`^(${r.iconNameExpression})(${r.iconModifierExpression})?$`);function v(h){if(h instanceof K)return["codicon","codicon-"+h.id];const l=L.exec(h.id);if(!l)return v(K.error);let[,f,o]=l;const u=["codicon","codicon-"+f];return o&&u.push("codicon-modifier-"+o.substr(1)),u}r.asClassNameArray=v;function m(h){return v(h).join(" ")}r.asClassName=m;function p(h){return"."+v(h).join(".")}r.asCSSSelector=p})(G||(G={})),function(r){r.add=new r("add",{fontCharacter:"\\ea60"}),r.plus=new r("plus",r.add.definition),r.gistNew=new r("gist-new",r.add.definition),r.repoCreate=new r("repo-create",r.add.definition),r.lightbulb=new r("lightbulb",{fontCharacter:"\\ea61"}),r.lightBulb=new r("light-bulb",{fontCharacter:"\\ea61"}),r.repo=new r("repo",{fontCharacter:"\\ea62"}),r.repoDelete=new r("repo-delete",{fontCharacter:"\\ea62"}),r.gistFork=new r("gist-fork",{fontCharacter:"\\ea63"}),r.repoForked=new r("repo-forked",{fontCharacter:"\\ea63"}),r.gitPullRequest=new r("git-pull-request",{fontCharacter:"\\ea64"}),r.gitPullRequestAbandoned=new r("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),r.recordKeys=new r("record-keys",{fontCharacter:"\\ea65"}),r.keyboard=new r("keyboard",{fontCharacter:"\\ea65"}),r.tag=new r("tag",{fontCharacter:"\\ea66"}),r.tagAdd=new r("tag-add",{fontCharacter:"\\ea66"}),r.tagRemove=new r("tag-remove",{fontCharacter:"\\ea66"}),r.person=new r("person",{fontCharacter:"\\ea67"}),r.personFollow=new r("person-follow",{fontCharacter:"\\ea67"}),r.personOutline=new r("person-outline",{fontCharacter:"\\ea67"}),r.personFilled=new r("person-filled",{fontCharacter:"\\ea67"}),r.gitBranch=new r("git-branch",{fontCharacter:"\\ea68"}),r.gitBranchCreate=new r("git-branch-create",{fontCharacter:"\\ea68"}),r.gitBranchDelete=new r("git-branch-delete",{fontCharacter:"\\ea68"}),r.sourceControl=new r("source-control",{fontCharacter:"\\ea68"}),r.mirror=new r("mirror",{fontCharacter:"\\ea69"}),r.mirrorPublic=new r("mirror-public",{fontCharacter:"\\ea69"}),r.star=new r("star",{fontCharacter:"\\ea6a"}),r.starAdd=new r("star-add",{fontCharacter:"\\ea6a"}),r.starDelete=new r("star-delete",{fontCharacter:"\\ea6a"}),r.starEmpty=new r("star-empty",{fontCharacter:"\\ea6a"}),r.comment=new r("comment",{fontCharacter:"\\ea6b"}),r.commentAdd=new r("comment-add",{fontCharacter:"\\ea6b"}),r.alert=new r("alert",{fontCharacter:"\\ea6c"}),r.warning=new r("warning",{fontCharacter:"\\ea6c"}),r.search=new r("search",{fontCharacter:"\\ea6d"}),r.searchSave=new r("search-save",{fontCharacter:"\\ea6d"}),r.logOut=new r("log-out",{fontCharacter:"\\ea6e"}),r.signOut=new r("sign-out",{fontCharacter:"\\ea6e"}),r.logIn=new r("log-in",{fontCharacter:"\\ea6f"}),r.signIn=new r("sign-in",{fontCharacter:"\\ea6f"}),r.eye=new r("eye",{fontCharacter:"\\ea70"}),r.eyeUnwatch=new r("eye-unwatch",{fontCharacter:"\\ea70"}),r.eyeWatch=new r("eye-watch",{fontCharacter:"\\ea70"}),r.circleFilled=new r("circle-filled",{fontCharacter:"\\ea71"}),r.primitiveDot=new r("primitive-dot",{fontCharacter:"\\ea71"}),r.closeDirty=new r("close-dirty",{fontCharacter:"\\ea71"}),r.debugBreakpoint=new r("debug-breakpoint",{fontCharacter:"\\ea71"}),r.debugBreakpointDisabled=new r("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),r.debugHint=new r("debug-hint",{fontCharacter:"\\ea71"}),r.primitiveSquare=new r("primitive-square",{fontCharacter:"\\ea72"}),r.edit=new r("edit",{fontCharacter:"\\ea73"}),r.pencil=new r("pencil",{fontCharacter:"\\ea73"}),r.info=new r("info",{fontCharacter:"\\ea74"}),r.issueOpened=new r("issue-opened",{fontCharacter:"\\ea74"}),r.gistPrivate=new r("gist-private",{fontCharacter:"\\ea75"}),r.gitForkPrivate=new r("git-fork-private",{fontCharacter:"\\ea75"}),r.lock=new r("lock",{fontCharacter:"\\ea75"}),r.mirrorPrivate=new r("mirror-private",{fontCharacter:"\\ea75"}),r.close=new r("close",{fontCharacter:"\\ea76"}),r.removeClose=new r("remove-close",{fontCharacter:"\\ea76"}),r.x=new r("x",{fontCharacter:"\\ea76"}),r.repoSync=new r("repo-sync",{fontCharacter:"\\ea77"}),r.sync=new r("sync",{fontCharacter:"\\ea77"}),r.clone=new r("clone",{fontCharacter:"\\ea78"}),r.desktopDownload=new r("desktop-download",{fontCharacter:"\\ea78"}),r.beaker=new r("beaker",{fontCharacter:"\\ea79"}),r.microscope=new r("microscope",{fontCharacter:"\\ea79"}),r.vm=new r("vm",{fontCharacter:"\\ea7a"}),r.deviceDesktop=new r("device-desktop",{fontCharacter:"\\ea7a"}),r.file=new r("file",{fontCharacter:"\\ea7b"}),r.fileText=new r("file-text",{fontCharacter:"\\ea7b"}),r.more=new r("more",{fontCharacter:"\\ea7c"}),r.ellipsis=new r("ellipsis",{fontCharacter:"\\ea7c"}),r.kebabHorizontal=new r("kebab-horizontal",{fontCharacter:"\\ea7c"}),r.mailReply=new r("mail-reply",{fontCharacter:"\\ea7d"}),r.reply=new r("reply",{fontCharacter:"\\ea7d"}),r.organization=new r("organization",{fontCharacter:"\\ea7e"}),r.organizationFilled=new r("organization-filled",{fontCharacter:"\\ea7e"}),r.organizationOutline=new r("organization-outline",{fontCharacter:"\\ea7e"}),r.newFile=new r("new-file",{fontCharacter:"\\ea7f"}),r.fileAdd=new r("file-add",{fontCharacter:"\\ea7f"}),r.newFolder=new r("new-folder",{fontCharacter:"\\ea80"}),r.fileDirectoryCreate=new r("file-directory-create",{fontCharacter:"\\ea80"}),r.trash=new r("trash",{fontCharacter:"\\ea81"}),r.trashcan=new r("trashcan",{fontCharacter:"\\ea81"}),r.history=new r("history",{fontCharacter:"\\ea82"}),r.clock=new r("clock",{fontCharacter:"\\ea82"}),r.folder=new r("folder",{fontCharacter:"\\ea83"}),r.fileDirectory=new r("file-directory",{fontCharacter:"\\ea83"}),r.symbolFolder=new r("symbol-folder",{fontCharacter:"\\ea83"}),r.logoGithub=new r("logo-github",{fontCharacter:"\\ea84"}),r.markGithub=new r("mark-github",{fontCharacter:"\\ea84"}),r.github=new r("github",{fontCharacter:"\\ea84"}),r.terminal=new r("terminal",{fontCharacter:"\\ea85"}),r.console=new r("console",{fontCharacter:"\\ea85"}),r.repl=new r("repl",{fontCharacter:"\\ea85"}),r.zap=new r("zap",{fontCharacter:"\\ea86"}),r.symbolEvent=new r("symbol-event",{fontCharacter:"\\ea86"}),r.error=new r("error",{fontCharacter:"\\ea87"}),r.stop=new r("stop",{fontCharacter:"\\ea87"}),r.variable=new r("variable",{fontCharacter:"\\ea88"}),r.symbolVariable=new r("symbol-variable",{fontCharacter:"\\ea88"}),r.array=new r("array",{fontCharacter:"\\ea8a"}),r.symbolArray=new r("symbol-array",{fontCharacter:"\\ea8a"}),r.symbolModule=new r("symbol-module",{fontCharacter:"\\ea8b"}),r.symbolPackage=new r("symbol-package",{fontCharacter:"\\ea8b"}),r.symbolNamespace=new r("symbol-namespace",{fontCharacter:"\\ea8b"}),r.symbolObject=new r("symbol-object",{fontCharacter:"\\ea8b"}),r.symbolMethod=new r("symbol-method",{fontCharacter:"\\ea8c"}),r.symbolFunction=new r("symbol-function",{fontCharacter:"\\ea8c"}),r.symbolConstructor=new r("symbol-constructor",{fontCharacter:"\\ea8c"}),r.symbolBoolean=new r("symbol-boolean",{fontCharacter:"\\ea8f"}),r.symbolNull=new r("symbol-null",{fontCharacter:"\\ea8f"}),r.symbolNumeric=new r("symbol-numeric",{fontCharacter:"\\ea90"}),r.symbolNumber=new r("symbol-number",{fontCharacter:"\\ea90"}),r.symbolStructure=new r("symbol-structure",{fontCharacter:"\\ea91"}),r.symbolStruct=new r("symbol-struct",{fontCharacter:"\\ea91"}),r.symbolParameter=new r("symbol-parameter",{fontCharacter:"\\ea92"}),r.symbolTypeParameter=new r("symbol-type-parameter",{fontCharacter:"\\ea92"}),r.symbolKey=new r("symbol-key",{fontCharacter:"\\ea93"}),r.symbolText=new r("symbol-text",{fontCharacter:"\\ea93"}),r.symbolReference=new r("symbol-reference",{fontCharacter:"\\ea94"}),r.goToFile=new r("go-to-file",{fontCharacter:"\\ea94"}),r.symbolEnum=new r("symbol-enum",{fontCharacter:"\\ea95"}),r.symbolValue=new r("symbol-value",{fontCharacter:"\\ea95"}),r.symbolRuler=new r("symbol-ruler",{fontCharacter:"\\ea96"}),r.symbolUnit=new r("symbol-unit",{fontCharacter:"\\ea96"}),r.activateBreakpoints=new r("activate-breakpoints",{fontCharacter:"\\ea97"}),r.archive=new r("archive",{fontCharacter:"\\ea98"}),r.arrowBoth=new r("arrow-both",{fontCharacter:"\\ea99"}),r.arrowDown=new r("arrow-down",{fontCharacter:"\\ea9a"}),r.arrowLeft=new r("arrow-left",{fontCharacter:"\\ea9b"}),r.arrowRight=new r("arrow-right",{fontCharacter:"\\ea9c"}),r.arrowSmallDown=new r("arrow-small-down",{fontCharacter:"\\ea9d"}),r.arrowSmallLeft=new r("arrow-small-left",{fontCharacter:"\\ea9e"}),r.arrowSmallRight=new r("arrow-small-right",{fontCharacter:"\\ea9f"}),r.arrowSmallUp=new r("arrow-small-up",{fontCharacter:"\\eaa0"}),r.arrowUp=new r("arrow-up",{fontCharacter:"\\eaa1"}),r.bell=new r("bell",{fontCharacter:"\\eaa2"}),r.bold=new r("bold",{fontCharacter:"\\eaa3"}),r.book=new r("book",{fontCharacter:"\\eaa4"}),r.bookmark=new r("bookmark",{fontCharacter:"\\eaa5"}),r.debugBreakpointConditionalUnverified=new r("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),r.debugBreakpointConditional=new r("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),r.debugBreakpointConditionalDisabled=new r("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),r.debugBreakpointDataUnverified=new r("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),r.debugBreakpointData=new r("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),r.debugBreakpointDataDisabled=new r("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),r.debugBreakpointLogUnverified=new r("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),r.debugBreakpointLog=new r("debug-breakpoint-log",{fontCharacter:"\\eaab"}),r.debugBreakpointLogDisabled=new r("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),r.briefcase=new r("briefcase",{fontCharacter:"\\eaac"}),r.broadcast=new r("broadcast",{fontCharacter:"\\eaad"}),r.browser=new r("browser",{fontCharacter:"\\eaae"}),r.bug=new r("bug",{fontCharacter:"\\eaaf"}),r.calendar=new r("calendar",{fontCharacter:"\\eab0"}),r.caseSensitive=new r("case-sensitive",{fontCharacter:"\\eab1"}),r.check=new r("check",{fontCharacter:"\\eab2"}),r.checklist=new r("checklist",{fontCharacter:"\\eab3"}),r.chevronDown=new r("chevron-down",{fontCharacter:"\\eab4"}),r.dropDownButton=new r("drop-down-button",r.chevronDown.definition),r.chevronLeft=new r("chevron-left",{fontCharacter:"\\eab5"}),r.chevronRight=new r("chevron-right",{fontCharacter:"\\eab6"}),r.chevronUp=new r("chevron-up",{fontCharacter:"\\eab7"}),r.chromeClose=new r("chrome-close",{fontCharacter:"\\eab8"}),r.chromeMaximize=new r("chrome-maximize",{fontCharacter:"\\eab9"}),r.chromeMinimize=new r("chrome-minimize",{fontCharacter:"\\eaba"}),r.chromeRestore=new r("chrome-restore",{fontCharacter:"\\eabb"}),r.circleOutline=new r("circle-outline",{fontCharacter:"\\eabc"}),r.debugBreakpointUnverified=new r("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),r.circleSlash=new r("circle-slash",{fontCharacter:"\\eabd"}),r.circuitBoard=new r("circuit-board",{fontCharacter:"\\eabe"}),r.clearAll=new r("clear-all",{fontCharacter:"\\eabf"}),r.clippy=new r("clippy",{fontCharacter:"\\eac0"}),r.closeAll=new r("close-all",{fontCharacter:"\\eac1"}),r.cloudDownload=new r("cloud-download",{fontCharacter:"\\eac2"}),r.cloudUpload=new r("cloud-upload",{fontCharacter:"\\eac3"}),r.code=new r("code",{fontCharacter:"\\eac4"}),r.collapseAll=new r("collapse-all",{fontCharacter:"\\eac5"}),r.colorMode=new r("color-mode",{fontCharacter:"\\eac6"}),r.commentDiscussion=new r("comment-discussion",{fontCharacter:"\\eac7"}),r.compareChanges=new r("compare-changes",{fontCharacter:"\\eafd"}),r.creditCard=new r("credit-card",{fontCharacter:"\\eac9"}),r.dash=new r("dash",{fontCharacter:"\\eacc"}),r.dashboard=new r("dashboard",{fontCharacter:"\\eacd"}),r.database=new r("database",{fontCharacter:"\\eace"}),r.debugContinue=new r("debug-continue",{fontCharacter:"\\eacf"}),r.debugDisconnect=new r("debug-disconnect",{fontCharacter:"\\ead0"}),r.debugPause=new r("debug-pause",{fontCharacter:"\\ead1"}),r.debugRestart=new r("debug-restart",{fontCharacter:"\\ead2"}),r.debugStart=new r("debug-start",{fontCharacter:"\\ead3"}),r.debugStepInto=new r("debug-step-into",{fontCharacter:"\\ead4"}),r.debugStepOut=new r("debug-step-out",{fontCharacter:"\\ead5"}),r.debugStepOver=new r("debug-step-over",{fontCharacter:"\\ead6"}),r.debugStop=new r("debug-stop",{fontCharacter:"\\ead7"}),r.debug=new r("debug",{fontCharacter:"\\ead8"}),r.deviceCameraVideo=new r("device-camera-video",{fontCharacter:"\\ead9"}),r.deviceCamera=new r("device-camera",{fontCharacter:"\\eada"}),r.deviceMobile=new r("device-mobile",{fontCharacter:"\\eadb"}),r.diffAdded=new r("diff-added",{fontCharacter:"\\eadc"}),r.diffIgnored=new r("diff-ignored",{fontCharacter:"\\eadd"}),r.diffModified=new r("diff-modified",{fontCharacter:"\\eade"}),r.diffRemoved=new r("diff-removed",{fontCharacter:"\\eadf"}),r.diffRenamed=new r("diff-renamed",{fontCharacter:"\\eae0"}),r.diff=new r("diff",{fontCharacter:"\\eae1"}),r.discard=new r("discard",{fontCharacter:"\\eae2"}),r.editorLayout=new r("editor-layout",{fontCharacter:"\\eae3"}),r.emptyWindow=new r("empty-window",{fontCharacter:"\\eae4"}),r.exclude=new r("exclude",{fontCharacter:"\\eae5"}),r.extensions=new r("extensions",{fontCharacter:"\\eae6"}),r.eyeClosed=new r("eye-closed",{fontCharacter:"\\eae7"}),r.fileBinary=new r("file-binary",{fontCharacter:"\\eae8"}),r.fileCode=new r("file-code",{fontCharacter:"\\eae9"}),r.fileMedia=new r("file-media",{fontCharacter:"\\eaea"}),r.filePdf=new r("file-pdf",{fontCharacter:"\\eaeb"}),r.fileSubmodule=new r("file-submodule",{fontCharacter:"\\eaec"}),r.fileSymlinkDirectory=new r("file-symlink-directory",{fontCharacter:"\\eaed"}),r.fileSymlinkFile=new r("file-symlink-file",{fontCharacter:"\\eaee"}),r.fileZip=new r("file-zip",{fontCharacter:"\\eaef"}),r.files=new r("files",{fontCharacter:"\\eaf0"}),r.filter=new r("filter",{fontCharacter:"\\eaf1"}),r.flame=new r("flame",{fontCharacter:"\\eaf2"}),r.foldDown=new r("fold-down",{fontCharacter:"\\eaf3"}),r.foldUp=new r("fold-up",{fontCharacter:"\\eaf4"}),r.fold=new r("fold",{fontCharacter:"\\eaf5"}),r.folderActive=new r("folder-active",{fontCharacter:"\\eaf6"}),r.folderOpened=new r("folder-opened",{fontCharacter:"\\eaf7"}),r.gear=new r("gear",{fontCharacter:"\\eaf8"}),r.gift=new r("gift",{fontCharacter:"\\eaf9"}),r.gistSecret=new r("gist-secret",{fontCharacter:"\\eafa"}),r.gist=new r("gist",{fontCharacter:"\\eafb"}),r.gitCommit=new r("git-commit",{fontCharacter:"\\eafc"}),r.gitCompare=new r("git-compare",{fontCharacter:"\\eafd"}),r.gitMerge=new r("git-merge",{fontCharacter:"\\eafe"}),r.githubAction=new r("github-action",{fontCharacter:"\\eaff"}),r.githubAlt=new r("github-alt",{fontCharacter:"\\eb00"}),r.globe=new r("globe",{fontCharacter:"\\eb01"}),r.grabber=new r("grabber",{fontCharacter:"\\eb02"}),r.graph=new r("graph",{fontCharacter:"\\eb03"}),r.gripper=new r("gripper",{fontCharacter:"\\eb04"}),r.heart=new r("heart",{fontCharacter:"\\eb05"}),r.home=new r("home",{fontCharacter:"\\eb06"}),r.horizontalRule=new r("horizontal-rule",{fontCharacter:"\\eb07"}),r.hubot=new r("hubot",{fontCharacter:"\\eb08"}),r.inbox=new r("inbox",{fontCharacter:"\\eb09"}),r.issueClosed=new r("issue-closed",{fontCharacter:"\\eba4"}),r.issueReopened=new r("issue-reopened",{fontCharacter:"\\eb0b"}),r.issues=new r("issues",{fontCharacter:"\\eb0c"}),r.italic=new r("italic",{fontCharacter:"\\eb0d"}),r.jersey=new r("jersey",{fontCharacter:"\\eb0e"}),r.json=new r("json",{fontCharacter:"\\eb0f"}),r.kebabVertical=new r("kebab-vertical",{fontCharacter:"\\eb10"}),r.key=new r("key",{fontCharacter:"\\eb11"}),r.law=new r("law",{fontCharacter:"\\eb12"}),r.lightbulbAutofix=new r("lightbulb-autofix",{fontCharacter:"\\eb13"}),r.linkExternal=new r("link-external",{fontCharacter:"\\eb14"}),r.link=new r("link",{fontCharacter:"\\eb15"}),r.listOrdered=new r("list-ordered",{fontCharacter:"\\eb16"}),r.listUnordered=new r("list-unordered",{fontCharacter:"\\eb17"}),r.liveShare=new r("live-share",{fontCharacter:"\\eb18"}),r.loading=new r("loading",{fontCharacter:"\\eb19"}),r.location=new r("location",{fontCharacter:"\\eb1a"}),r.mailRead=new r("mail-read",{fontCharacter:"\\eb1b"}),r.mail=new r("mail",{fontCharacter:"\\eb1c"}),r.markdown=new r("markdown",{fontCharacter:"\\eb1d"}),r.megaphone=new r("megaphone",{fontCharacter:"\\eb1e"}),r.mention=new r("mention",{fontCharacter:"\\eb1f"}),r.milestone=new r("milestone",{fontCharacter:"\\eb20"}),r.mortarBoard=new r("mortar-board",{fontCharacter:"\\eb21"}),r.move=new r("move",{fontCharacter:"\\eb22"}),r.multipleWindows=new r("multiple-windows",{fontCharacter:"\\eb23"}),r.mute=new r("mute",{fontCharacter:"\\eb24"}),r.noNewline=new r("no-newline",{fontCharacter:"\\eb25"}),r.note=new r("note",{fontCharacter:"\\eb26"}),r.octoface=new r("octoface",{fontCharacter:"\\eb27"}),r.openPreview=new r("open-preview",{fontCharacter:"\\eb28"}),r.package_=new r("package",{fontCharacter:"\\eb29"}),r.paintcan=new r("paintcan",{fontCharacter:"\\eb2a"}),r.pin=new r("pin",{fontCharacter:"\\eb2b"}),r.play=new r("play",{fontCharacter:"\\eb2c"}),r.run=new r("run",{fontCharacter:"\\eb2c"}),r.plug=new r("plug",{fontCharacter:"\\eb2d"}),r.preserveCase=new r("preserve-case",{fontCharacter:"\\eb2e"}),r.preview=new r("preview",{fontCharacter:"\\eb2f"}),r.project=new r("project",{fontCharacter:"\\eb30"}),r.pulse=new r("pulse",{fontCharacter:"\\eb31"}),r.question=new r("question",{fontCharacter:"\\eb32"}),r.quote=new r("quote",{fontCharacter:"\\eb33"}),r.radioTower=new r("radio-tower",{fontCharacter:"\\eb34"}),r.reactions=new r("reactions",{fontCharacter:"\\eb35"}),r.references=new r("references",{fontCharacter:"\\eb36"}),r.refresh=new r("refresh",{fontCharacter:"\\eb37"}),r.regex=new r("regex",{fontCharacter:"\\eb38"}),r.remoteExplorer=new r("remote-explorer",{fontCharacter:"\\eb39"}),r.remote=new r("remote",{fontCharacter:"\\eb3a"}),r.remove=new r("remove",{fontCharacter:"\\eb3b"}),r.replaceAll=new r("replace-all",{fontCharacter:"\\eb3c"}),r.replace=new r("replace",{fontCharacter:"\\eb3d"}),r.repoClone=new r("repo-clone",{fontCharacter:"\\eb3e"}),r.repoForcePush=new r("repo-force-push",{fontCharacter:"\\eb3f"}),r.repoPull=new r("repo-pull",{fontCharacter:"\\eb40"}),r.repoPush=new r("repo-push",{fontCharacter:"\\eb41"}),r.report=new r("report",{fontCharacter:"\\eb42"}),r.requestChanges=new r("request-changes",{fontCharacter:"\\eb43"}),r.rocket=new r("rocket",{fontCharacter:"\\eb44"}),r.rootFolderOpened=new r("root-folder-opened",{fontCharacter:"\\eb45"}),r.rootFolder=new r("root-folder",{fontCharacter:"\\eb46"}),r.rss=new r("rss",{fontCharacter:"\\eb47"}),r.ruby=new r("ruby",{fontCharacter:"\\eb48"}),r.saveAll=new r("save-all",{fontCharacter:"\\eb49"}),r.saveAs=new r("save-as",{fontCharacter:"\\eb4a"}),r.save=new r("save",{fontCharacter:"\\eb4b"}),r.screenFull=new r("screen-full",{fontCharacter:"\\eb4c"}),r.screenNormal=new r("screen-normal",{fontCharacter:"\\eb4d"}),r.searchStop=new r("search-stop",{fontCharacter:"\\eb4e"}),r.server=new r("server",{fontCharacter:"\\eb50"}),r.settingsGear=new r("settings-gear",{fontCharacter:"\\eb51"}),r.settings=new r("settings",{fontCharacter:"\\eb52"}),r.shield=new r("shield",{fontCharacter:"\\eb53"}),r.smiley=new r("smiley",{fontCharacter:"\\eb54"}),r.sortPrecedence=new r("sort-precedence",{fontCharacter:"\\eb55"}),r.splitHorizontal=new r("split-horizontal",{fontCharacter:"\\eb56"}),r.splitVertical=new r("split-vertical",{fontCharacter:"\\eb57"}),r.squirrel=new r("squirrel",{fontCharacter:"\\eb58"}),r.starFull=new r("star-full",{fontCharacter:"\\eb59"}),r.starHalf=new r("star-half",{fontCharacter:"\\eb5a"}),r.symbolClass=new r("symbol-class",{fontCharacter:"\\eb5b"}),r.symbolColor=new r("symbol-color",{fontCharacter:"\\eb5c"}),r.symbolConstant=new r("symbol-constant",{fontCharacter:"\\eb5d"}),r.symbolEnumMember=new r("symbol-enum-member",{fontCharacter:"\\eb5e"}),r.symbolField=new r("symbol-field",{fontCharacter:"\\eb5f"}),r.symbolFile=new r("symbol-file",{fontCharacter:"\\eb60"}),r.symbolInterface=new r("symbol-interface",{fontCharacter:"\\eb61"}),r.symbolKeyword=new r("symbol-keyword",{fontCharacter:"\\eb62"}),r.symbolMisc=new r("symbol-misc",{fontCharacter:"\\eb63"}),r.symbolOperator=new r("symbol-operator",{fontCharacter:"\\eb64"}),r.symbolProperty=new r("symbol-property",{fontCharacter:"\\eb65"}),r.wrench=new r("wrench",{fontCharacter:"\\eb65"}),r.wrenchSubaction=new r("wrench-subaction",{fontCharacter:"\\eb65"}),r.symbolSnippet=new r("symbol-snippet",{fontCharacter:"\\eb66"}),r.tasklist=new r("tasklist",{fontCharacter:"\\eb67"}),r.telescope=new r("telescope",{fontCharacter:"\\eb68"}),r.textSize=new r("text-size",{fontCharacter:"\\eb69"}),r.threeBars=new r("three-bars",{fontCharacter:"\\eb6a"}),r.thumbsdown=new r("thumbsdown",{fontCharacter:"\\eb6b"}),r.thumbsup=new r("thumbsup",{fontCharacter:"\\eb6c"}),r.tools=new r("tools",{fontCharacter:"\\eb6d"}),r.triangleDown=new r("triangle-down",{fontCharacter:"\\eb6e"}),r.triangleLeft=new r("triangle-left",{fontCharacter:"\\eb6f"}),r.triangleRight=new r("triangle-right",{fontCharacter:"\\eb70"}),r.triangleUp=new r("triangle-up",{fontCharacter:"\\eb71"}),r.twitter=new r("twitter",{fontCharacter:"\\eb72"}),r.unfold=new r("unfold",{fontCharacter:"\\eb73"}),r.unlock=new r("unlock",{fontCharacter:"\\eb74"}),r.unmute=new r("unmute",{fontCharacter:"\\eb75"}),r.unverified=new r("unverified",{fontCharacter:"\\eb76"}),r.verified=new r("verified",{fontCharacter:"\\eb77"}),r.versions=new r("versions",{fontCharacter:"\\eb78"}),r.vmActive=new r("vm-active",{fontCharacter:"\\eb79"}),r.vmOutline=new r("vm-outline",{fontCharacter:"\\eb7a"}),r.vmRunning=new r("vm-running",{fontCharacter:"\\eb7b"}),r.watch=new r("watch",{fontCharacter:"\\eb7c"}),r.whitespace=new r("whitespace",{fontCharacter:"\\eb7d"}),r.wholeWord=new r("whole-word",{fontCharacter:"\\eb7e"}),r.window=new r("window",{fontCharacter:"\\eb7f"}),r.wordWrap=new r("word-wrap",{fontCharacter:"\\eb80"}),r.zoomIn=new r("zoom-in",{fontCharacter:"\\eb81"}),r.zoomOut=new r("zoom-out",{fontCharacter:"\\eb82"}),r.listFilter=new r("list-filter",{fontCharacter:"\\eb83"}),r.listFlat=new r("list-flat",{fontCharacter:"\\eb84"}),r.listSelection=new r("list-selection",{fontCharacter:"\\eb85"}),r.selection=new r("selection",{fontCharacter:"\\eb85"}),r.listTree=new r("list-tree",{fontCharacter:"\\eb86"}),r.debugBreakpointFunctionUnverified=new r("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),r.debugBreakpointFunction=new r("debug-breakpoint-function",{fontCharacter:"\\eb88"}),r.debugBreakpointFunctionDisabled=new r("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),r.debugStackframeActive=new r("debug-stackframe-active",{fontCharacter:"\\eb89"}),r.debugStackframeDot=new r("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),r.debugStackframe=new r("debug-stackframe",{fontCharacter:"\\eb8b"}),r.debugStackframeFocused=new r("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),r.debugBreakpointUnsupported=new r("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),r.symbolString=new r("symbol-string",{fontCharacter:"\\eb8d"}),r.debugReverseContinue=new r("debug-reverse-continue",{fontCharacter:"\\eb8e"}),r.debugStepBack=new r("debug-step-back",{fontCharacter:"\\eb8f"}),r.debugRestartFrame=new r("debug-restart-frame",{fontCharacter:"\\eb90"}),r.callIncoming=new r("call-incoming",{fontCharacter:"\\eb92"}),r.callOutgoing=new r("call-outgoing",{fontCharacter:"\\eb93"}),r.menu=new r("menu",{fontCharacter:"\\eb94"}),r.expandAll=new r("expand-all",{fontCharacter:"\\eb95"}),r.feedback=new r("feedback",{fontCharacter:"\\eb96"}),r.groupByRefType=new r("group-by-ref-type",{fontCharacter:"\\eb97"}),r.ungroupByRefType=new r("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),r.account=new r("account",{fontCharacter:"\\eb99"}),r.bellDot=new r("bell-dot",{fontCharacter:"\\eb9a"}),r.debugConsole=new r("debug-console",{fontCharacter:"\\eb9b"}),r.library=new r("library",{fontCharacter:"\\eb9c"}),r.output=new r("output",{fontCharacter:"\\eb9d"}),r.runAll=new r("run-all",{fontCharacter:"\\eb9e"}),r.syncIgnored=new r("sync-ignored",{fontCharacter:"\\eb9f"}),r.pinned=new r("pinned",{fontCharacter:"\\eba0"}),r.githubInverted=new r("github-inverted",{fontCharacter:"\\eba1"}),r.debugAlt=new r("debug-alt",{fontCharacter:"\\eb91"}),r.serverProcess=new r("server-process",{fontCharacter:"\\eba2"}),r.serverEnvironment=new r("server-environment",{fontCharacter:"\\eba3"}),r.pass=new r("pass",{fontCharacter:"\\eba4"}),r.stopCircle=new r("stop-circle",{fontCharacter:"\\eba5"}),r.playCircle=new r("play-circle",{fontCharacter:"\\eba6"}),r.record=new r("record",{fontCharacter:"\\eba7"}),r.debugAltSmall=new r("debug-alt-small",{fontCharacter:"\\eba8"}),r.vmConnect=new r("vm-connect",{fontCharacter:"\\eba9"}),r.cloud=new r("cloud",{fontCharacter:"\\ebaa"}),r.merge=new r("merge",{fontCharacter:"\\ebab"}),r.exportIcon=new r("export",{fontCharacter:"\\ebac"}),r.graphLeft=new r("graph-left",{fontCharacter:"\\ebad"}),r.magnet=new r("magnet",{fontCharacter:"\\ebae"}),r.notebook=new r("notebook",{fontCharacter:"\\ebaf"}),r.redo=new r("redo",{fontCharacter:"\\ebb0"}),r.checkAll=new r("check-all",{fontCharacter:"\\ebb1"}),r.pinnedDirty=new r("pinned-dirty",{fontCharacter:"\\ebb2"}),r.passFilled=new r("pass-filled",{fontCharacter:"\\ebb3"}),r.circleLargeFilled=new r("circle-large-filled",{fontCharacter:"\\ebb4"}),r.circleLargeOutline=new r("circle-large-outline",{fontCharacter:"\\ebb5"}),r.combine=new r("combine",{fontCharacter:"\\ebb6"}),r.gather=new r("gather",{fontCharacter:"\\ebb6"}),r.table=new r("table",{fontCharacter:"\\ebb7"}),r.variableGroup=new r("variable-group",{fontCharacter:"\\ebb8"}),r.typeHierarchy=new r("type-hierarchy",{fontCharacter:"\\ebb9"}),r.typeHierarchySub=new r("type-hierarchy-sub",{fontCharacter:"\\ebba"}),r.typeHierarchySuper=new r("type-hierarchy-super",{fontCharacter:"\\ebbb"}),r.gitPullRequestCreate=new r("git-pull-request-create",{fontCharacter:"\\ebbc"}),r.runAbove=new r("run-above",{fontCharacter:"\\ebbd"}),r.runBelow=new r("run-below",{fontCharacter:"\\ebbe"}),r.notebookTemplate=new r("notebook-template",{fontCharacter:"\\ebbf"}),r.debugRerun=new r("debug-rerun",{fontCharacter:"\\ebc0"}),r.workspaceTrusted=new r("workspace-trusted",{fontCharacter:"\\ebc1"}),r.workspaceUntrusted=new r("workspace-untrusted",{fontCharacter:"\\ebc2"}),r.workspaceUnspecified=new r("workspace-unspecified",{fontCharacter:"\\ebc3"}),r.terminalCmd=new r("terminal-cmd",{fontCharacter:"\\ebc4"}),r.terminalDebian=new r("terminal-debian",{fontCharacter:"\\ebc5"}),r.terminalLinux=new r("terminal-linux",{fontCharacter:"\\ebc6"}),r.terminalPowershell=new r("terminal-powershell",{fontCharacter:"\\ebc7"}),r.terminalTmux=new r("terminal-tmux",{fontCharacter:"\\ebc8"}),r.terminalUbuntu=new r("terminal-ubuntu",{fontCharacter:"\\ebc9"}),r.terminalBash=new r("terminal-bash",{fontCharacter:"\\ebca"}),r.arrowSwap=new r("arrow-swap",{fontCharacter:"\\ebcb"}),r.copy=new r("copy",{fontCharacter:"\\ebcc"}),r.personAdd=new r("person-add",{fontCharacter:"\\ebcd"}),r.filterFilled=new r("filter-filled",{fontCharacter:"\\ebce"}),r.wand=new r("wand",{fontCharacter:"\\ebcf"}),r.debugLineByLine=new r("debug-line-by-line",{fontCharacter:"\\ebd0"}),r.inspect=new r("inspect",{fontCharacter:"\\ebd1"}),r.layers=new r("layers",{fontCharacter:"\\ebd2"}),r.layersDot=new r("layers-dot",{fontCharacter:"\\ebd3"}),r.layersActive=new r("layers-active",{fontCharacter:"\\ebd4"}),r.compass=new r("compass",{fontCharacter:"\\ebd5"}),r.compassDot=new r("compass-dot",{fontCharacter:"\\ebd6"}),r.compassActive=new r("compass-active",{fontCharacter:"\\ebd7"}),r.azure=new r("azure",{fontCharacter:"\\ebd8"}),r.issueDraft=new r("issue-draft",{fontCharacter:"\\ebd9"}),r.gitPullRequestClosed=new r("git-pull-request-closed",{fontCharacter:"\\ebda"}),r.gitPullRequestDraft=new r("git-pull-request-draft",{fontCharacter:"\\ebdb"}),r.debugAll=new r("debug-all",{fontCharacter:"\\ebdc"}),r.debugCoverage=new r("debug-coverage",{fontCharacter:"\\ebdd"}),r.runErrors=new r("run-errors",{fontCharacter:"\\ebde"}),r.folderLibrary=new r("folder-library",{fontCharacter:"\\ebdf"}),r.debugContinueSmall=new r("debug-continue-small",{fontCharacter:"\\ebe0"}),r.beakerStop=new r("beaker-stop",{fontCharacter:"\\ebe1"}),r.graphLine=new r("graph-line",{fontCharacter:"\\ebe2"}),r.graphScatter=new r("graph-scatter",{fontCharacter:"\\ebe3"}),r.pieChart=new r("pie-chart",{fontCharacter:"\\ebe4"}),r.bracket=new r("bracket",r.json.definition),r.bracketDot=new r("bracket-dot",{fontCharacter:"\\ebe5"}),r.bracketError=new r("bracket-error",{fontCharacter:"\\ebe6"}),r.lockSmall=new r("lock-small",{fontCharacter:"\\ebe7"}),r.azureDevops=new r("azure-devops",{fontCharacter:"\\ebe8"}),r.verifiedFilled=new r("verified-filled",{fontCharacter:"\\ebe9"})}(K||(K={}))},"VrN/":function(nt,xe,Z){(function(ne,J){nt.exports=J()})(this,function(){"use strict";var ne=navigator.userAgent,J=navigator.platform,P=/gecko\/\d/i.test(ne),X=/MSIE \d/.test(ne),j=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ne),B=/Edge\/(\d+)/.exec(ne),K=X||j||B,G=K&&(X?document.documentMode||6:+(B||j)[1]),r=!B&&/WebKit\//.test(ne),L=r&&/Qt\/\d+\.\d+/.test(ne),v=!B&&/Chrome\//.test(ne),m=/Opera\//.test(ne),p=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ne),l=/PhantomJS/.test(ne),f=!B&&/AppleWebKit/.test(ne)&&/Mobile\/\w+/.test(ne),o=/Android/.test(ne),u=f||o||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ne),a=f||/Mac/.test(J),s=/\bCrOS\b/.test(ne),R=/win/i.test(J),_=m&&ne.match(/Version\/(\d*\.\d*)/);_&&(_=Number(_[1])),_&&_>=15&&(m=!1,r=!0);var C=a&&(L||m&&(_==null||_<12.11)),D=P||K&&G>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var A=function(e,t){var n=e.className,i=O(t).exec(n);if(i){var d=n.slice(i.index+i[0].length);e.className=n.slice(0,i.index)+(d?i[1]+d:"")}};function S(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function T(e,t){return S(e).appendChild(t)}function c(e,t,n,i){var d=document.createElement(e);if(n&&(d.className=n),i&&(d.style.cssText=i),typeof t=="string")d.appendChild(document.createTextNode(t));else if(t)for(var M=0;M=t)return z+(t-M);z+=Q-M,z+=n-z%n,M=Q+1}}var $=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};$.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},$.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n=t)return i+Math.min(z,t-d);if(d+=M-i,d+=n-d%n,i=M+1,d>=t)return i}}var he=[""];function ce(e){for(;he.length<=e;)he.push(re(he)+" ");return he[e]}function re(e){return e[e.length-1]}function fe(e,t){for(var n=[],i=0;i"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Re.test(e))}function je(e,t){return t?t.source.indexOf("\\w")>-1&&Pe(e)?!0:t.test(e):Pe(e)}function ue(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ee=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Le(e){return e.charCodeAt(0)>=768&&Ee.test(e)}function Ie(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var d=(t+n)/2,M=i<0?Math.ceil(d):Math.floor(d);if(M==t)return e(M)?t:n;e(M)?n=M:t=M+i}}function Xe(e,t,n,i){if(!e)return i(t,n,"ltr",0);for(var d=!1,M=0;Mt||t==n&&z.to==t)&&(i(Math.max(z.from,t),Math.min(z.to,n),z.level==1?"rtl":"ltr",M),d=!0)}d||i(t,n,"ltr")}var Je=null;function Qe(e,t,n){var i;Je=null;for(var d=0;dt)return d;M.to==t&&(M.from!=M.to&&n=="before"?i=d:Je=d),M.from==t&&(M.from!=M.to&&n!="before"?i=d:Je=d)}return i!=null?i:Je}var at=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(te){return te<=247?e.charAt(te):1424<=te&&te<=1524?"R":1536<=te&&te<=1785?t.charAt(te-1536):1774<=te&&te<=2220?"r":8192<=te&&te<=8203?"w":te==8204?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,d=/[stwN]/,M=/[LRr]/,z=/[Lb1n]/,Q=/[1n]/;function q(te,pe,ye){this.level=te,this.from=pe,this.to=ye}return function(te,pe){var ye=pe=="ltr"?"L":"R";if(te.length==0||pe=="ltr"&&!i.test(te))return!1;for(var Me=te.length,De=[],We=0;We-1&&(i[t]=d.slice(0,M).concat(d.slice(M+1)))}}}function Ue(e,t){var n=ut(e,t);if(!n.length)return;for(var i=Array.prototype.slice.call(arguments,2),d=0;d0}function be(e){e.prototype.on=function(t,n){Be(this,t,n)},e.prototype.off=function(t,n){ot(this,t,n)}}function ae(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function le(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function de(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ge(e){ae(e),le(e)}function we(e){return e.target||e.srcElement}function Fe(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),a&&e.ctrlKey&&t==1&&(t=3),t}var ze=function(){if(K&&G<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),st;function mt(e){if(st==null){var t=c("span","\u200B");T(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(st=t.offsetWidth<=1&&t.offsetHeight>2&&!(K&&G<8))}var n=st?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var ft;function wt(e){if(ft!=null)return ft;var t=T(e,document.createTextNode("A\u062EA")),n=y(t,0,1).getBoundingClientRect(),i=y(t,1,2).getBoundingClientRect();return S(e),!n||n.left==n.right?!1:ft=i.right-n.right<3}var St=` b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],i=e.length;t<=i;){var d=e.indexOf(` `,t);d==-1&&(d=e.length);var M=e.slice(t,e.charAt(d-1)=="\r"?d-1:d),z=M.indexOf("\r");z!=-1?(n.push(M.slice(0,z)),t+=z+1):(n.push(M),t=d+1)}return n}:function(e){return e.split(/\r\n?|\n/)},ct=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ut=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Lt=null;function qt(e){if(Lt!=null)return Lt;var t=T(e,c("span","x")),n=t.getBoundingClientRect(),i=y(t,0,1).getBoundingClientRect();return Lt=Math.abs(n.left-i.left)>1}var Qt={},It={};function Cr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Qt[e]=t}function Kr(e,t){It[e]=t}function yt(e){if(typeof e=="string"&&It.hasOwnProperty(e))e=It[e];else if(e&&typeof e.name=="string"&&It.hasOwnProperty(e.name)){var t=It[e.name];typeof t=="string"&&(t={name:t}),e=Ne(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return yt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return yt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Lr(e,t){t=yt(t);var n=Qt[t.name];if(!n)return Lr(e,"text/plain");var i=n(e,t);if(bt.hasOwnProperty(t.name)){var d=bt[t.name];for(var M in d){if(!d.hasOwnProperty(M))continue;i.hasOwnProperty(M)&&(i["_"+M]=i[M]),i[M]=d[M]}}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var z in t.modeProps)i[z]=t.modeProps[z];return i}var bt={};function xt(e,t){var n=bt.hasOwnProperty(e)?bt[e]:bt[e]={};g(t,n)}function Ft(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var i in t){var d=t[i];d instanceof Array&&(d=d.concat([])),n[i]=d}return n}function tr(e,t){for(var n;e.innerMode&&!(n=e.innerMode(t),!n||n.mode==e);)t=n.state,e=n.mode;return n||{mode:e,state:t}}function cr(e,t,n){return e.startState?e.startState(t,n):!0}var Pt=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Pt.prototype.eol=function(){return this.pos>=this.string.length},Pt.prototype.sol=function(){return this.pos==this.lineStart},Pt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Pt.prototype.next=function(){if(this.post},Pt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Pt.prototype.skipToEnd=function(){this.pos=this.string.length},Pt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Pt.prototype.backUp=function(e){this.pos-=e},Pt.prototype.column=function(){return this.lastColumnPos0?null:(M&&t!==!1&&(this.pos+=M[0].length),M)}},Pt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Pt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Pt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Pt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function dt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var i=0;;++i){var d=n.children[i],M=d.chunkSize();if(t=e.first&&tn?$e(n,dt(e,n).text.length):k(t,dt(e,t.line).text.length)}function k(e,t){var n=e.ch;return n==null||n>t?$e(e.line,t):n<0?$e(e.line,0):e}function W(e,t){for(var n=[],i=0;ithis.maxLookAhead&&(this.maxLookAhead=e),t},V.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},V.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},V.fromSaved=function(e,t,n){return t instanceof ee?new V(e,Ft(e.mode,t.state),n,t.lookAhead):new V(e,Ft(e.mode,t),n)},V.prototype.save=function(e){var t=e!==!1?Ft(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ee(t,this.maxLookAhead):t};function _e(e,t,n,i){var d=[e.state.modeGen],M={};Er(e,t.text,e.doc.mode,n,function(te,pe){return d.push(te,pe)},M,i);for(var z=n.state,Q=function(te){n.baseTokens=d;var pe=e.state.overlays[te],ye=1,Me=0;n.state=!0,Er(e,t.text,pe.mode,n,function(De,We){for(var Ye=ye;MeDe&&d.splice(ye,1,De,d[ye+1],Ze),ye+=2,Me=Math.min(De,Ze)}if(!We)return;if(pe.opaque)d.splice(Ye,ye-Ye,De,"overlay "+We),ye=Ye+2;else for(;Yee.options.maxHighlightLength&&Ft(e.doc.mode,i.state),M=_e(e,t,i);d&&(i.state=d),t.stateAfter=i.save(!d),t.styles=M.styles,M.classes?t.styleClasses=M.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function et(e,t,n){var i=e.doc,d=e.display;if(!i.mode.startState)return new V(i,!0,t);var M=xr(e,t,n),z=M>i.first&&dt(i,M-1).stateAfter,Q=z?V.fromSaved(i,z,M):new V(i,cr(i.mode),M);return i.iter(M,t,function(q){pt(e,q.text,Q);var te=Q.line;q.stateAfter=te==t-1||te%5==0||te>=d.viewFrom&&tet.start)return M}throw new Error("Mode "+e.name+" failed to advance stream.")}var jt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function $t(e,t,n,i){var d=e.doc,M=d.mode,z;t=x(d,t);var Q=dt(d,t.line),q=et(e,t.line,n),te=new Pt(Q.text,e.options.tabSize,q),pe;for(i&&(pe=[]);(i||te.pose.options.maxHighlightLength?(Q=!1,z&&pt(e,t,i,pe.pos),pe.pos=t.length,ye=null):ye=jr(_t(n,pe,i.state,Me),M),Me){var De=Me[0].name;De&&(ye="m-"+(ye?De+" "+ye:De))}if(!Q||te!=ye){for(;qz;--Q){if(Q<=M.first)return M.first;var q=dt(M,Q-1),te=q.stateAfter;if(te&&(!n||Q+(te instanceof ee?te.lookAhead:0)<=M.modeFrontier))return Q;var pe=H(q.text,null,e.options.tabSize);(d==null||i>pe)&&(d=Q-1,i=pe)}return d}function Qr(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontiern;i--){var d=dt(e,i).stateAfter;if(d&&(!(d instanceof ee)||i+d.lookAhead=t:M.to>t);(i||(i=[])).push(new ui(z,M.from,q?null:M.to))}}return i}function zi(e,t,n){var i;if(e)for(var d=0;d=t:M.to>t);if(Q||M.from==t&&z.type=="bookmark"&&(!n||M.marker.insertLeft)){var q=M.from==null||(z.inclusiveLeft?M.from<=t:M.from0&&Q)for(var ht=0;ht0)continue;var pe=[q,1],ye=Ct(te.from,Q.from),Me=Ct(te.to,Q.to);(ye<0||!z.inclusiveLeft&&!ye)&&pe.push({from:te.from,to:Q.from}),(Me>0||!z.inclusiveRight&&!Me)&&pe.push({from:Q.to,to:te.to}),d.splice.apply(d,pe),q+=pe.length-3}return d}function cn(e){var t=e.markedSpans;if(!t)return;for(var n=0;nt)&&(!i||yr(i,M.marker)<0)&&(i=M.marker)}return i}function fr(e,t,n,i,d){var M=dt(e,t),z=dr&&M.markedSpans;if(z)for(var Q=0;Q=0&&ye<=0||pe<=0&&ye>=0)continue;if(pe<=0&&(q.marker.inclusiveRight&&d.inclusiveLeft?Ct(te.to,n)>=0:Ct(te.to,n)>0)||pe>=0&&(q.marker.inclusiveRight&&d.inclusiveLeft?Ct(te.from,i)<=0:Ct(te.from,i)<0))return!0}}function Ar(e){for(var t;t=ar(e);)e=t.find(-1,!0).line;return e}function Vi(e){for(var t;t=Kt(e);)e=t.find(1,!0).line;return e}function Ei(e){for(var t,n;t=Kt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function dn(e,t){var n=dt(e,t),i=Ar(n);return n==i?t:Rt(i)}function xi(e,t){if(t>e.lastLine())return t;var n=dt(e,t),i;if(!ni(e,n))return t;for(;i=Kt(n);)n=i.find(1,!0).line;return Rt(n)+1}function ni(e,t){var n=dr&&t.markedSpans;if(n)for(var i=void 0,d=0;dt.maxLineLength&&(t.maxLineLength=d,t.maxLine=i)})}var ki=function(e,t,n){this.text=e,_i(this,t),this.height=n?n(this):1};ki.prototype.lineNo=function(){return Rt(this)},be(ki);function ua(e,t,n,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),cn(e),_i(e,n);var d=i?i(e):1;d!=e.height&&Jt(e,d)}function gt(e){e.parent=null,cn(e)}var At={},Et={};function Dt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Et:At;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Bt(e,t){var n=w("span",null,null,r?"padding-right: .1px":null),i={pre:w("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var d=0;d<=(t.rest?t.rest.length:0);d++){var M=d?t.rest[d-1]:t.line,z=void 0;i.pos=0,i.addToken=Nt,wt(e.display.measure)&&(z=qe(M,e.doc.direction))&&(i.addToken=Dr(i.addToken,z)),i.map=[];var Q=t!=e.display.externalMeasured&&Rt(M);hi(M,i,Ke(e,M,Q)),M.styleClasses&&(M.styleClasses.bgClass&&(i.bgClass=E(M.styleClasses.bgClass,i.bgClass||"")),M.styleClasses.textClass&&(i.textClass=E(M.styleClasses.textClass,i.textClass||""))),i.map.length==0&&i.map.push(0,0,i.content.appendChild(mt(e.display.measure))),d==0?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(r){var q=i.content.lastChild;(/\bcm-tab\b/.test(q.className)||q.querySelector&&q.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return Ue(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=E(i.pre.className,i.textClass||"")),i}function Yt(e){var t=c("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Nt(e,t,n,i,d,M,z){if(!t)return;var Q=e.splitSpaces?ur(t,e.trailingSpace):t,q=e.cm.state.specialChars,te=!1,pe;if(!q.test(t))e.col+=t.length,pe=document.createTextNode(Q),e.map.push(e.pos,e.pos+t.length,pe),K&&G<9&&(te=!0),e.pos+=t.length;else{pe=document.createDocumentFragment();for(var ye=0;;){q.lastIndex=ye;var Me=q.exec(t),De=Me?Me.index-ye:t.length-ye;if(De){var We=document.createTextNode(Q.slice(ye,ye+De));K&&G<9?pe.appendChild(c("span",[We])):pe.appendChild(We),e.map.push(e.pos,e.pos+De,We),e.col+=De,e.pos+=De}if(!Me)break;ye+=De+1;var Ye=void 0;if(Me[0]==" "){var Ze=e.cm.options.tabSize,rt=Ze-e.col%Ze;Ye=pe.appendChild(c("span",ce(rt),"cm-tab")),Ye.setAttribute("role","presentation"),Ye.setAttribute("cm-text"," "),e.col+=rt}else Me[0]=="\r"||Me[0]==` `?(Ye=pe.appendChild(c("span",Me[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ye.setAttribute("cm-text",Me[0]),e.col+=1):(Ye=e.cm.options.specialCharPlaceholder(Me[0]),Ye.setAttribute("cm-text",Me[0]),K&&G<9?pe.appendChild(c("span",[Ye])):pe.appendChild(Ye),e.col+=1);e.map.push(e.pos,e.pos+1,Ye),e.pos++}}if(e.trailingSpace=Q.charCodeAt(t.length-1)==32,n||i||d||te||M||z){var lt=n||"";i&&(lt+=i),d&&(lt+=d);var it=c("span",[pe],lt,M);if(z)for(var ht in z)z.hasOwnProperty(ht)&&ht!="style"&&ht!="class"&&it.setAttribute(ht,z[ht]);return e.content.appendChild(it)}e.content.appendChild(pe)}function ur(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,i="",d=0;dte&&ye.from<=te);Me++);if(ye.to>=pe)return e(n,i,d,M,z,Q,q);e(n,i.slice(0,ye.to-te),d,M,null,Q,q),M=null,i=i.slice(ye.to-te),te=ye.to}}}function Mt(e,t,n,i){var d=!i&&n.widgetNode;d&&e.map.push(e.pos,e.pos+t,d),!i&&e.cm.display.input.needsContentAttribute&&(d||(d=e.content.appendChild(document.createElement("span"))),d.setAttribute("cm-marker",n.id)),d&&(e.cm.display.input.setUneditable(d),e.content.appendChild(d)),e.pos+=t,e.trailingSpace=!1}function hi(e,t,n){var i=e.markedSpans,d=e.text,M=0;if(!i){for(var z=1;zq||Ot.collapsed&&vt.to==q&&vt.from==q)){if(vt.to!=null&&vt.to!=q&&De>vt.to&&(De=vt.to,Ye=""),Ot.className&&(We+=" "+Ot.className),Ot.css&&(Me=(Me?Me+";":"")+Ot.css),Ot.startStyle&&vt.from==q&&(Ze+=" "+Ot.startStyle),Ot.endStyle&&vt.to==De&&(ht||(ht=[])).push(Ot.endStyle,vt.to),Ot.title&&((lt||(lt={})).title=Ot.title),Ot.attributes)for(var Xt in Ot.attributes)(lt||(lt={}))[Xt]=Ot.attributes[Xt];Ot.collapsed&&(!rt||yr(rt.marker,Ot)<0)&&(rt=vt)}else vt.from>q&&De>vt.from&&(De=vt.from)}if(ht)for(var gr=0;gr=Q)break;for(var Gr=Math.min(Q,De);;){if(pe){var Nr=q+pe.length;if(!rt){var sr=Nr>Gr?pe.slice(0,Gr-q):pe;t.addToken(t,sr,ye?ye+We:We,Ze,q+sr.length==De?Ye:"",Me,lt)}if(Nr>=Gr){pe=pe.slice(Gr-q),q=Gr;break}q=Nr,Ze=""}pe=d.slice(M,M=n[te++]),ye=Dt(n[te++],t.cm.options)}}}function Wt(e,t,n){this.line=t,this.rest=Ei(t),this.size=this.rest?Rt(re(this.rest))-n+1:1,this.node=this.text=null,this.hidden=ni(e,t)}function kr(e,t,n){for(var i=[],d,M=t;M2&&M.push((q.bottom+te.top)/2-n.top)}}M.push(n.bottom-n.top)}}function es(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;in)return{map:e.measure.maps[d],cache:e.measure.caches[d],before:!0}}function Uo(e,t){t=Ar(t);var n=Rt(t),i=e.display.externalMeasured=new Wt(e.doc,t,n);i.lineN=n;var d=i.built=Bt(e,i);return i.text=d.pre,T(e.display.lineMeasure,d.pre),i}function ts(e,t,n,i){return si(e,Yi(e,t),n,i)}function fa(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(M=q-Q,d=M-1,t>=q&&(z="right")),d!=null){if(i=e[te+2],Q==q&&n==(i.insertLeft?"left":"right")&&(z=n),n=="left"&&d==0)for(;te&&e[te-2]==e[te-3]&&e[te-1].insertLeft;)i=e[(te-=3)+2],z="left";if(n=="right"&&d==q-Q)for(;te=0&&!((n=e[d]).left!=n.right);d--);return n}function Ho(e,t,n,i){var d=is(t.map,n,i),M=d.node,z=d.start,Q=d.end,q=d.collapse,te;if(M.nodeType==3){for(var pe=0;pe<4;pe++){for(;z&&Le(t.line.text.charAt(d.coverStart+z));)--z;for(;d.coverStart+Q0&&(q=i="right");var ye;e.options.lineWrapping&&(ye=M.getClientRects()).length>1?te=ye[i=="right"?ye.length-1:0]:te=M.getBoundingClientRect()}if(K&&G<9&&!z&&(!te||!te.left&&!te.right)){var Me=M.parentNode.getClientRects()[0];Me?te={left:Me.left,right:Me.left+$i(e.display),top:Me.top,bottom:Me.bottom}:te=rs}for(var De=te.top-t.rect.top,We=te.bottom-t.rect.top,Ye=(De+We)/2,Ze=t.view.measure.heights,rt=0;rt=i.text.length?(q=i.text.length,te="before"):q<=0&&(q=0,te="after"),!Q)return z(te=="before"?q-1:q,te=="before");function pe(We,Ye,Ze){var rt=Q[Ye],lt=rt.level==1;return z(Ze?We-1:We,lt!=Ze)}var ye=Qe(Q,q,te),Me=Je,De=pe(q,ye,te=="before");return Me!=null&&(De.other=pe(q,Me,te!="before")),De}function us(e,t){var n=0;t=x(e.doc,t),e.options.lineWrapping||(n=$i(e.display)*t.ch);var i=dt(e.doc,t.line),d=qr(i)+Hn(e.display);return{left:n,right:n,top:d,bottom:d+i.height}}function ga(e,t,n,i,d){var M=$e(e,t,n);return M.xRel=d,i&&(M.outside=i),M}function va(e,t,n){var i=e.doc;if(n+=e.display.viewOffset,n<0)return ga(i.first,0,null,-1,-1);var d=lr(i,n),M=i.first+i.size-1;if(d>M)return ga(i.first+i.size-1,dt(i,M).text.length,null,1,1);t<0&&(t=0);for(var z=dt(i,d);;){var Q=Go(e,z,d,t,n),q=ii(z,Q.ch+(Q.xRel>0||Q.outside>0?1:0));if(!q)return Q;var te=q.find(1);if(te.line==d)return te;z=dt(i,d=te.line)}}function hs(e,t,n,i){i-=pa(t);var d=t.text.length,M=Ge(function(z){return si(e,n,z-1).bottom<=i},d,0);return d=Ge(function(z){return si(e,n,z).top>i},M,d),{begin:M,end:d}}function cs(e,t,n,i){n||(n=Yi(e,t));var d=Wn(e,t,si(e,n,i),"line").top;return hs(e,t,n,d)}function ya(e,t,n,i){return e.bottom<=n?!1:e.top>n?!0:(i?e.left:e.right)>t}function Go(e,t,n,i,d){d-=qr(t);var M=Yi(e,t),z=pa(t),Q=0,q=t.text.length,te=!0,pe=qe(t,e.doc.direction);if(pe){var ye=(e.options.lineWrapping?zo:Ko)(e,t,n,M,pe,i,d);te=ye.level!=1,Q=te?ye.from:ye.to-1,q=te?ye.to:ye.from-1}var Me=null,De=null,We=Ge(function(Tt){var vt=si(e,M,Tt);return vt.top+=z,vt.bottom+=z,ya(vt,i,d,!1)?(vt.top<=d&&vt.left<=i&&(Me=Tt,De=vt),!0):!1},Q,q),Ye,Ze,rt=!1;if(De){var lt=i-De.left=ht.bottom?1:0}return We=Ie(t.text,We,1),ga(n,We,Ze,rt,i-Ye)}function Ko(e,t,n,i,d,M,z){var Q=Ge(function(ye){var Me=d[ye],De=Me.level!=1;return ya(ei(e,$e(n,De?Me.to:Me.from,De?"before":"after"),"line",t,i),M,z,!0)},0,d.length-1),q=d[Q];if(Q>0){var te=q.level!=1,pe=ei(e,$e(n,te?q.from:q.to,te?"after":"before"),"line",t,i);ya(pe,M,z,!0)&&pe.top>z&&(q=d[Q-1])}return q}function zo(e,t,n,i,d,M,z){var Q=hs(e,t,i,z),q=Q.begin,te=Q.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var pe=null,ye=null,Me=0;Me=te||De.to<=q)continue;var We=De.level!=1,Ye=si(e,i,We?Math.min(te,De.to)-1:Math.max(q,De.from)).right,Ze=YeZe)&&(pe=De,ye=Ze)}return pe||(pe=d[d.length-1]),pe.fromte&&(pe={from:pe.from,to:te,level:pe.level}),pe}var Pi;function Xi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Pi==null){Pi=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Pi.appendChild(document.createTextNode("x")),Pi.appendChild(c("br"));Pi.appendChild(document.createTextNode("x"))}T(e.measure,Pi);var n=Pi.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),S(e.measure),n||1}function $i(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),n=c("pre",[t],"CodeMirror-line-like");T(e.measure,n);var i=t.getBoundingClientRect(),d=(i.right-i.left)/10;return d>2&&(e.cachedCharWidth=d),d||10}function ba(e){for(var t=e.display,n={},i={},d=t.gutters.clientLeft,M=t.gutters.firstChild,z=0;M;M=M.nextSibling,++z){var Q=e.display.gutterSpecs[z].className;n[Q]=M.offsetLeft+M.clientLeft+d,i[Q]=M.clientWidth}return{fixedPos:_a(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function _a(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ds(e){var t=Xi(e.display),n=e.options.lineWrapping,i=n&&Math.max(5,e.display.scroller.clientWidth/$i(e.display)-3);return function(d){if(ni(e.doc,d))return 0;var M=0;if(d.widgets)for(var z=0;z0&&(te=dt(e.doc,q.line).text).length==q.ch){var pe=H(te,te.length,e.options.tabSize)-te.length;q=$e(q.line,Math.max(0,Math.round((M-qa(e.display).left)/$i(e.display))-pe))}return q}function Fi(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,i=0;it)&&(d.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=d.viewTo)dr&&dn(e.doc,t)d.viewFrom?wi(e):(d.viewFrom+=i,d.viewTo+=i);else if(t<=d.viewFrom&&n>=d.viewTo)wi(e);else if(t<=d.viewFrom){var M=Gn(e,n,n+i,1);M?(d.view=d.view.slice(M.index),d.viewFrom=M.lineN,d.viewTo+=i):wi(e)}else if(n>=d.viewTo){var z=Gn(e,t,t,-1);z?(d.view=d.view.slice(0,z.index),d.viewTo=z.lineN):wi(e)}else{var Q=Gn(e,t,t,-1),q=Gn(e,n,n+i,1);Q&&q?(d.view=d.view.slice(0,Q.index).concat(kr(e,Q.lineN,q.lineN)).concat(d.view.slice(q.index)),d.viewTo+=i):wi(e)}var te=d.externalMeasured;te&&(n=d.lineN&&t=i.viewTo)return;var M=i.view[Fi(e,t)];if(M.node==null)return;var z=M.changes||(M.changes=[]);ie(z,n)==-1&&z.push(n)}function wi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gn(e,t,n,i){var d=Fi(e,t),M,z=e.display.view;if(!dr||n==e.doc.first+e.doc.size)return{index:d,lineN:n};for(var Q=e.display.viewFrom,q=0;q0){if(d==z.length-1)return null;M=Q+z[d].size-t,d++}else M=Q-t;t+=M,n+=M}for(;dn(e.doc,n)!=n;){if(d==(i<0?0:z.length-1))return null;n+=i*z[d-(i<0?1:0)].size,d+=i}return{index:d,lineN:n}}function Vo(e,t,n){var i=e.display,d=i.view;d.length==0||t>=i.viewTo||n<=i.viewFrom?(i.view=kr(e,t,n),i.viewFrom=t):(i.viewFrom>t?i.view=kr(e,t,i.viewFrom).concat(i.view):i.viewFromn&&(i.view=i.view.slice(0,Fi(e,n)))),i.viewTo=n}function fs(e){for(var t=e.display.view,n=0,i=0;i=e.display.viewTo||Q.to().line0?t.blinker=setInterval(function(){e.hasFocus()||Ji(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function gs(e){e.state.focused||(e.display.input.focus(),Ta(e))}function vs(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ji(e))},100)}function Ta(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ue(e,"focus",e,t),e.state.focused=!0,F(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),r&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),xa(e)}function Ji(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ue(e,"blur",e,t),e.state.focused=!1,A(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function zn(e){for(var t=e.display,n=t.lineDiv.offsetTop,i=0;i.005||pe<-.005)&&(Jt(d.line,z),ys(d.line),d.rest))for(var ye=0;yee.display.sizerWidth){var Me=Math.ceil(Q/$i(e.display));Me>e.display.maxLineLength&&(e.display.maxLineLength=Me,e.display.maxLine=d.line,e.display.maxLineChanged=!0)}}}function ys(e){if(e.widgets)for(var t=0;t=z&&(M=lr(t,qr(dt(t,q))-e.wrapper.clientHeight),z=q)}return{from:M,to:Math.max(z,M+1)}}function Xo(e,t){if(He(e,"scrollCursorIntoView"))return;var n=e.display,i=n.sizer.getBoundingClientRect(),d=null;if(t.top+i.top<0?d=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(d=!1),d!=null&&!l){var M=c("div","\u200B",null,`position: absolute; top: `+(t.top-n.viewOffset-Hn(e.display))+`px; height: `+(t.bottom-t.top+ai(e)+n.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(M),M.scrollIntoView(d),e.display.lineSpace.removeChild(M)}}function $o(e,t,n,i){i==null&&(i=0);var d;!e.options.lineWrapping&&t==n&&(t=t.ch?$e(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,n=t.sticky=="before"?$e(t.line,t.ch+1,"before"):t);for(var M=0;M<5;M++){var z=!1,Q=ei(e,t),q=!n||n==t?Q:ei(e,n);d={left:Math.min(Q.left,q.left),top:Math.min(Q.top,q.top)-i,right:Math.max(Q.left,q.left),bottom:Math.max(Q.bottom,q.bottom)+i};var te=wa(e,d),pe=e.doc.scrollTop,ye=e.doc.scrollLeft;if(te.scrollTop!=null&&(En(e,te.scrollTop),Math.abs(e.doc.scrollTop-pe)>1&&(z=!0)),te.scrollLeft!=null&&(Bi(e,te.scrollLeft),Math.abs(e.doc.scrollLeft-ye)>1&&(z=!0)),!z)break}return d}function Jo(e,t){var n=wa(e,t);n.scrollTop!=null&&En(e,n.scrollTop),n.scrollLeft!=null&&Bi(e,n.scrollLeft)}function wa(e,t){var n=e.display,i=Xi(e.display);t.top<0&&(t.top=0);var d=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,M=da(e),z={};t.bottom-t.top>M&&(t.bottom=t.top+M);var Q=e.doc.height+ca(n),q=t.topQ-i;if(t.topd+M){var pe=Math.min(t.top,(te?Q:t.bottom)-M);pe!=d&&(z.scrollTop=pe)}var ye=e.options.fixedGutter?0:n.gutters.offsetWidth,Me=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-ye,De=Mi(e)-n.gutters.offsetWidth,We=t.right-t.left>De;return We&&(t.right=t.left+De),t.left<10?z.scrollLeft=0:t.leftDe+Me-3&&(z.scrollLeft=t.right+(We?0:10)-De),z}function Sa(e,t){if(t==null)return;Yn(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Qi(e){Yn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function _n(e,t,n){(t!=null||n!=null)&&Yn(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Qo(e,t){Yn(e),e.curOp.scrollToPos=t}function Yn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=us(e,t.from),i=us(e,t.to);bs(e,n,i,t.margin)}}function bs(e,t,n,i){var d=wa(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-i,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+i});_n(e,d.scrollLeft,d.scrollTop)}function En(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;P||Aa(e,{top:t}),_s(e,t,!0),P&&Aa(e),wn(e,100)}function _s(e,t,n){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!n)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Bi(e,t,n,i){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i)return;e.doc.scrollLeft=t,Ss(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function xn(e){var t=e.display,n=t.gutters.offsetWidth,i=Math.round(e.doc.height+ca(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+ai(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Ui=function(e,t,n){this.cm=n;var i=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),d=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=d.tabIndex=-1,e(i),e(d),Be(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),Be(d,"scroll",function(){d.clientWidth&&t(d.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,K&&G<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ui.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var d=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+d)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var M=e.viewWidth-e.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+M)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(i==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:t?i:0}},Ui.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ui.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ui.prototype.zeroWidthHack=function(){var e=a&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new $,this.disableVert=new $},Ui.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto";function i(){var d=e.getBoundingClientRect(),M=n=="vert"?document.elementFromPoint(d.right-1,(d.top+d.bottom)/2):document.elementFromPoint((d.right+d.left)/2,d.bottom-1);M!=e?e.style.pointerEvents="none":t.set(1e3,i)}t.set(1e3,i)},Ui.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Tn=function(){};Tn.prototype.update=function(){return{bottom:0,right:0}},Tn.prototype.setScrollLeft=function(){},Tn.prototype.setScrollTop=function(){},Tn.prototype.clear=function(){};function Zi(e,t){t||(t=xn(e));var n=e.display.barWidth,i=e.display.barHeight;Es(e,t);for(var d=0;d<4&&n!=e.display.barWidth||i!=e.display.barHeight;d++)n!=e.display.barWidth&&e.options.lineWrapping&&zn(e),Es(e,xn(e)),n=e.display.barWidth,i=e.display.barHeight}function Es(e,t){var n=e.display,i=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var xs={native:Ui,null:Tn};function Ts(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&A(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new xs[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Be(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Bi(e,t):En(e,t)},e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Zo=0;function ji(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Zo},Jr(e.curOp)}function Hi(e){var t=e.curOp;t&&Io(t,function(n){for(var i=0;i=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Xn(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ca(e.cm,e.update)}function rl(e){var t=e.cm,n=t.display;e.updatedDisplay&&zn(t),e.barMeasure=xn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ts(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+ai(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Mi(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var n=+new Date+e.options.workTime,i=et(e,t.highlightFrontier),d=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),function(M){if(i.line>=e.display.viewFrom){var z=M.styles,Q=M.text.length>e.options.maxHighlightLength?Ft(t.mode,i.state):null,q=_e(e,M,i,!0);Q&&(i.state=Q),M.styles=q.styles;var te=M.styleClasses,pe=q.classes;pe?M.styleClasses=pe:te&&(M.styleClasses=null);for(var ye=!z||z.length!=M.styles.length||te!=pe&&(!te||!pe||te.bgClass!=pe.bgClass||te.textClass!=pe.textClass),Me=0;!ye&&Men)return wn(e,e.options.workDelay),!0}),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),d.length&&Wr(e,function(){for(var M=0;M=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&fs(e)==0)return!1;Cs(e)&&(wi(e),t.dims=ba(e));var d=i.first+i.size,M=Math.max(t.visible.from-e.options.viewportMargin,i.first),z=Math.min(d,t.visible.to+e.options.viewportMargin);n.viewFromz&&n.viewTo-z<20&&(z=Math.min(d,n.viewTo)),dr&&(M=dn(e.doc,M),z=xi(e.doc,z));var Q=M!=n.viewFrom||z!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Vo(e,M,z),n.viewOffset=qr(dt(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var q=fs(e);if(!Q&&q==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var te=ol(e);return q>4&&(n.lineDiv.style.display="none"),ul(e,n.updateLineNumbers,t.dims),q>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ll(te),S(n.cursorDiv),S(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,Q&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,wn(e,400)),n.updateLineNumbers=null,!0}function ws(e,t){for(var n=t.viewport,i=!0;;i=!1){if(!i||!e.options.lineWrapping||t.oldDisplayWidth==Mi(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+ca(e.display)-da(e),n.top)}),t.visible=Vn(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else i&&(t.visible=Vn(e.display,e.doc,n));if(!Ca(e,t))break;zn(e);var d=xn(e);bn(e),Zi(e,d),Oa(e,d),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Aa(e,t){var n=new Xn(e,t);if(Ca(e,n)){zn(e),ws(e,n);var i=xn(e);bn(e),Zi(e,i),Oa(e,i),n.finish()}}function ul(e,t,n){var i=e.display,d=e.options.lineNumbers,M=i.lineDiv,z=M.firstChild;function Q(We){var Ye=We.nextSibling;return r&&a&&e.display.currentWheelTarget==We?We.style.display="none":We.parentNode.removeChild(We),Ye}for(var q=i.view,te=i.viewFrom,pe=0;pe-1&&(De=!1),Xa(e,ye,te,n)),De&&(S(ye.lineNumber),ye.lineNumber.appendChild(document.createTextNode(Xr(e.options,te)))),z=ye.node.nextSibling}te+=ye.size}for(;z;)z=Q(z)}function Ra(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Oa(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+ai(e)+"px"}function Ss(e){var t=e.display,n=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var i=_a(t)-t.scroller.scrollLeft+e.doc.scrollLeft,d=t.gutters.offsetWidth,M=i+"px",z=0;zz.clientWidth,q=z.scrollHeight>z.clientHeight;if(!(i&&Q||d&&q))return;if(d&&a&&r){e:for(var te=t.target,pe=M.view;te!=z;te=te.parentNode)for(var ye=0;ye=0&&Ct(e,i.to())<=0)return n}return-1};var Gt=function(e,t){this.anchor=e,this.head=t};Gt.prototype.from=function(){return vi(this.anchor,this.head)},Gt.prototype.to=function(){return gi(this.anchor,this.head)},Gt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ti(e,t,n){var i=e&&e.options.selectionsMayTouch,d=t[n];t.sort(function(Me,De){return Ct(Me.from(),De.from())}),n=ie(t,d);for(var M=1;M0:q>=0){var te=vi(Q.from(),z.from()),pe=gi(Q.to(),z.to()),ye=Q.empty()?z.from()==z.head:Q.from()==Q.head;M<=n&&--n,t.splice(--M,2,new Gt(ye?pe:te,ye?te:pe))}}return new Yr(t,n)}function Si(e,t){return new Yr([new Gt(e,t||e)],0)}function Ci(e){return e.text?$e(e.from.line+e.text.length-1,re(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ls(e,t){if(Ct(e,t.from)<0)return e;if(Ct(e,t.to)<=0)return Ci(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=Ci(t).ch-t.to.ch),$e(n,i)}function Ia(e,t){for(var n=[],i=0;i1&&e.remove(Q.line+1,We-1),e.insert(Q.line+1,rt)}br(e,"change",e,t)}function Ai(e,t,n){function i(d,M,z){if(d.linked)for(var Q=0;Q1&&!e.done[e.done.length-2].ranges)return e.done.pop(),re(e.done)}function Ns(e,t,n,i){var d=e.history;d.undone.length=0;var M=+new Date,z,Q;if((d.lastOp==i||d.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&d.lastModTime>M-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(z=pl(d,d.lastOp==i)))Q=re(z.changes),Ct(t.from,t.to)==0&&Ct(t.from,Q.to)==0?Q.to=Ci(t):z.changes.push(Ma(e,t));else{var q=re(d.done);for((!q||!q.ranges)&&Qn(e.sel,d.done),z={changes:[Ma(e,t)],generation:d.generation},d.done.push(z);d.done.length>d.undoDepth;)d.done.shift(),d.done[0].ranges||d.done.shift()}d.done.push(n),d.generation=++d.maxGeneration,d.lastModTime=d.lastSelTime=M,d.lastOp=d.lastSelOp=i,d.lastOrigin=d.lastSelOrigin=t.origin,Q||Ue(e,"historyAdded")}function ml(e,t,n,i){var d=t.charAt(0);return d=="*"||d=="+"&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,n,i){var d=e.history,M=i&&i.origin;n==d.lastSelOp||M&&d.lastSelOrigin==M&&(d.lastModTime==d.lastSelTime&&d.lastOrigin==M||ml(e,M,re(d.done),t))?d.done[d.done.length-1]=t:Qn(t,d.done),d.lastSelTime=+new Date,d.lastSelOrigin=M,d.lastSelOp=n,i&&i.clearRedo!==!1&&Ps(d.undone)}function Qn(e,t){var n=re(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Fs(e,t,n,i){var d=t["spans_"+e.id],M=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,i),function(z){z.markedSpans&&((d||(d=t["spans_"+e.id]={}))[M]=z.markedSpans),++M})}function vl(e){if(!e)return null;for(var t,n=0;n-1&&(re(Q)[ye]=te[ye],delete te[ye]))}}return i}function Pa(e,t,n,i){if(i){var d=e.anchor;if(n){var M=Ct(t,d)<0;M!=Ct(n,d)<0?(d=t,t=n):M!=Ct(t,n)<0&&(t=n)}return new Gt(d,t)}else return new Gt(n||t,t)}function Zn(e,t,n,i,d){d==null&&(d=e.cm&&(e.cm.display.shift||e.extend)),wr(e,new Yr([Pa(e.sel.primary(),t,n,d)],0),i)}function Us(e,t,n){for(var i=[],d=e.cm&&(e.cm.display.shift||e.extend),M=0;M=t.ch:Q.to>t.ch))){if(d&&(Ue(q,"beforeCursorEnter"),q.explicitlyCleared))if(M.markedSpans){--z;continue}else break;if(!q.atomic)continue;if(n){var ye=q.find(i<0?1:-1),Me=void 0;if((i<0?pe:te)&&(ye=zs(e,ye,-i,ye&&ye.line==t.line?M:null)),ye&&ye.line==t.line&&(Me=Ct(ye,n))&&(i<0?Me<0:Me>0))return en(e,ye,t,i,d)}var De=q.find(i<0?-1:1);return(i<0?te:pe)&&(De=zs(e,De,i,De.line==t.line?M:null)),De?en(e,De,t,i,d):null}}return t}function ea(e,t,n,i,d){var M=i||1,z=en(e,t,n,M,d)||!d&&en(e,t,n,M,!0)||en(e,t,n,-M,d)||!d&&en(e,t,n,-M,!0);return z||(e.cantEdit=!0,$e(e.first,0))}function zs(e,t,n,i){return n<0&&t.ch==0?t.line>e.first?x(e,$e(t.line-1)):null:n>0&&t.ch==(i||dt(e,t.line)).text.length?t.line=0;--d)Xs(e,{from:i[d].from,to:i[d].to,text:d?[""]:t.text,origin:t.origin});else Xs(e,t)}function Xs(e,t){if(t.text.length==1&&t.text[0]==""&&Ct(t.from,t.to)==0)return;var n=Ia(e,t);Ns(e,t,n,e.cm?e.cm.curOp.id:NaN),An(e,t,n,Zr(e,t));var i=[];Ai(e,function(d,M){!M&&ie(i,d.history)==-1&&(Zs(d.history,t),i.push(d.history)),An(d,t,null,Zr(d,t))})}function ta(e,t,n){var i=e.cm&&e.cm.state.suppressEdits;if(i&&!n)return;for(var d=e.history,M,z=e.sel,Q=t=="undo"?d.done:d.undone,q=t=="undo"?d.undone:d.done,te=0;te=0;--De){var We=Me(De);if(We)return We.v}}function $s(e,t){if(t==0)return;if(e.first+=t,e.sel=new Yr(fe(e.sel.ranges,function(d){return new Gt($e(d.anchor.line+t,d.anchor.ch),$e(d.head.line+t,d.head.ch))}),e.sel.primIndex),e.cm){Mr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,i=n.viewFrom;ie.lastLine())return;if(t.from.lineM&&(t={from:t.from,to:$e(M,dt(e,M).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ur(e,t.from,t.to),n||(n=Ia(e,t)),e.cm?_l(e.cm,t,i):ka(e,t,i),qn(e,n,ve),e.cantEdit&&ea(e,$e(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,n){var i=e.doc,d=e.display,M=t.from,z=t.to,Q=!1,q=M.line;e.options.lineWrapping||(q=Rt(Ar(dt(i,M.line))),i.iter(q,z.line+1,function(De){if(De==d.maxLine)return Q=!0,!0})),i.sel.contains(t.from,t.to)>-1&&Te(e),ka(i,t,n,ds(e)),e.options.lineWrapping||(i.iter(q,M.line+t.text.length,function(De){var We=pn(De);We>d.maxLineLength&&(d.maxLine=De,d.maxLineLength=We,d.maxLineChanged=!0,Q=!1)}),Q&&(e.curOp.updateMaxLine=!0)),Qr(i,M.line),wn(e,400);var te=t.text.length-(z.line-M.line)-1;t.full?Mr(e):M.line==z.line&&t.text.length==1&&!Ds(e.doc,t)?Ti(e,M.line,"text"):Mr(e,M.line,z.line+1,te);var pe=me(e,"changes"),ye=me(e,"change");if(ye||pe){var Me={from:M,to:z,text:t.text,removed:t.removed,origin:t.origin};ye&&br(e,"change",e,Me),pe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Me)}e.display.selForContextMenu=null}function rn(e,t,n,i,d){var M;i||(i=n),Ct(i,n)<0&&(M=[i,n],n=M[0],i=M[1]),typeof t=="string"&&(t=e.splitLines(t)),tn(e,{from:n,to:i,text:t,origin:d})}function Js(e,t,n,i){n1||!(this.children[0]instanceof On))){var Q=[];this.collapse(Q),this.children=[new On(Q)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var z=d.lines.length%25+25,Q=z;Q10);e.parent.maybeSpill()},iterN:function(e,t,n){for(var i=0;ie.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=pe,e.display.maxLineChanged=!0)}i!=null&&e&&this.collapsed&&Mr(e,i,d+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Gs(e.doc)),e&&br(e,"markerCleared",e,this,i,d),t&&Hi(e),this.parent&&this.parent.clear()},Ri.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,i,d=0;d0||z==0&&M.clearWhenEmpty!==!1)return M;if(M.replacedWith&&(M.collapsed=!0,M.widgetNode=w("span",[M.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||M.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(M.widgetNode.insertLeft=!0)),M.collapsed){if(fr(e,t.line,t,n,M)||t.line!=n.line&&fr(e,n.line,t,n,M))throw new Error("Inserting collapsed marker partially overlapping an existing one");li()}M.addToHistory&&Ns(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var Q=t.line,q=e.cm,te;if(e.iter(Q,n.line+1,function(ye){q&&M.collapsed&&!q.options.lineWrapping&&Ar(ye)==q.display.maxLine&&(te=!0),M.collapsed&&Q!=t.line&&Jt(ye,0),yi(ye,new ui(M,Q==t.line?t.ch:null,Q==n.line?n.ch:null)),++Q}),M.collapsed&&e.iter(t.line,n.line+1,function(ye){ni(e,ye)&&Jt(ye,0)}),M.clearOnEnter&&Be(M,"beforeCursorEnter",function(){return M.clear()}),M.readOnly&&(zr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),M.collapsed&&(M.id=++eo,M.atomic=!0),q){if(te&&(q.curOp.updateMaxLine=!0),M.collapsed)Mr(q,t.line,n.line+1);else if(M.className||M.startStyle||M.endStyle||M.css||M.attributes||M.title)for(var pe=t.line;pe<=n.line;pe++)Ti(q,pe,"text");M.atomic&&Gs(q.doc),br(q,"markerAdded",q,M)}return M}var Dn=function(e,t){this.markers=e,this.primary=t;for(var n=0;n=0;q--)tn(this,i[q]);Q?Hs(this,Q):this.cm&&Qi(this.cm)}),undo:mr(function(){ta(this,"undo")}),redo:mr(function(){ta(this,"redo")}),undoSelection:mr(function(){ta(this,"undo",!0)}),redoSelection:mr(function(){ta(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,i=0;i=e.ch)&&t.push(d.marker.parent||d.marker)}return t},findMarks:function(e,t,n){e=x(this,e),t=x(this,t);var i=[],d=e.line;return this.iter(e.line,t.line+1,function(M){var z=M.markedSpans;if(z)for(var Q=0;Q=q.to||q.from==null&&d!=e.line||q.from!=null&&d==t.line&&q.from>=t.ch)&&(!n||n(q.marker))&&i.push(q.marker.parent||q.marker)}++d}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var i=0;ie)return t=e,!0;e-=M,++n}),x(this,$e(n,t))},indexFromPos:function(e){e=x(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var pe=e.dataTransfer.getData("Text");if(pe){var ye;if(t.state.draggingText&&!t.state.draggingText.copy&&(ye=t.listSelections()),qn(t.doc,Si(n,n)),ye)for(var Me=0;Me=0;Q--)rn(e.doc,"",i[Q].from,i[Q].to,"+delete");Qi(e)})}function Fa(e,t,n){var i=Ie(e.text,t+n,n);return i<0||i>e.text.length?null:i}function Ba(e,t,n){var i=Fa(e,t.ch,n);return i==null?null:new $e(t.line,i,n<0?"after":"before")}function Ua(e,t,n,i,d){if(e){t.doc.direction=="rtl"&&(d=-d);var M=qe(n,t.doc.direction);if(M){var z=d<0?re(M):M[0],Q=d<0==(z.level==1),q=Q?"after":"before",te;if(z.level>0||t.doc.direction=="rtl"){var pe=Yi(t,n);te=d<0?n.text.length-1:0;var ye=si(t,pe,te).top;te=Ge(function(Me){return si(t,pe,Me).top==ye},d<0==(z.level==1)?z.from:z.to-1,te),q=="before"&&(te=Fa(n,te,1))}else te=d<0?z.to:z.from;return new $e(i,te,q)}}return new $e(i,d<0?n.text.length:0,d<0?"before":"after")}function Ml(e,t,n,i){var d=qe(t,e.doc.direction);if(!d)return Ba(t,n,i);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var M=Qe(d,n.ch,n.sticky),z=d[M];if(e.doc.direction=="ltr"&&z.level%2==0&&(i>0?z.to>n.ch:z.from=z.from&&Me>=pe.begin)){var De=ye?"before":"after";return new $e(n.line,Me,De)}}var We=function(rt,lt,it){for(var ht=function(Xt,gr){return gr?new $e(n.line,Q(Xt,1),"before"):new $e(n.line,Xt,"after")};rt>=0&&rt0==(Tt.level!=1),Ot=vt?it.begin:Q(it.end,-1);if(Tt.from<=Ot&&Ot0?pe.end:Q(pe.begin,-1);return Ze!=null&&!(i>0&&Ze==t.text.length)&&(Ye=We(i>0?0:d.length-1,i,te(Ze)),Ye)?Ye:null}var Pn={selectAll:Vs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ve)},killLine:function(e){return sn(e,function(t){if(t.empty()){var n=dt(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)d=new $e(d.line,d.ch+1),e.replaceRange(M.charAt(d.ch-1)+M.charAt(d.ch-2),$e(d.line,d.ch-2),d,"+transpose");else if(d.line>e.doc.first){var z=dt(e.doc,d.line-1).text;z&&(d=new $e(d.line,1),e.replaceRange(M.charAt(0)+e.doc.lineSeparator()+z.charAt(z.length-1),$e(d.line-1,z.length-1),d,"+transpose"))}}n.push(new Gt(d,d))}e.setSelections(n)})},newlineAndIndent:function(e){return Wr(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var i=0;ie&&Ct(t,this.pos)==0&&n==this.button};var Fn,Bn;function Hl(e,t){var n=+new Date;return Bn&&Bn.compare(n,e,t)?(Fn=Bn=null,"triple"):Fn&&Fn.compare(n,e,t)?(Bn=new Ha(n,e,t),Fn=null,"double"):(Fn=new Ha(n,e,t),Bn=null,"single")}function vo(e){var t=this,n=t.display;if(He(t,e)||n.activeTouch&&n.input.supportsTouch())return;if(n.input.ensurePolled(),n.shift=e.shiftKey,ci(n,e)){r||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(Wa(t,e))return;var i=Ni(t,e),d=Fe(e),M=i?Hl(i,d):"single";if(window.focus(),d==1&&t.state.selectingText&&t.state.selectingText(e),i&&Wl(t,d,i,M,e))return;d==1?i?Kl(t,i,M,e):we(e)==n.scroller&&ae(e):d==2?(i&&Zn(t.doc,i),setTimeout(function(){return n.input.focus()},20)):d==3&&(D?t.display.input.onContextMenu(e):vs(t))}function Wl(e,t,n,i,d){var M="Click";return i=="double"?M="Double"+M:i=="triple"&&(M="Triple"+M),M=(t==1?"Left":t==2?"Middle":"Right")+M,Nn(e,oo(M,d),d,function(z){if(typeof z=="string"&&(z=Pn[z]),!z)return!1;var Q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Q=z(e,n)!=Ce}finally{e.state.suppressEdits=!1}return Q})}function Gl(e,t,n){var i=e.getOption("configureMouse"),d=i?i(e,t,n):{};if(d.unit==null){var M=s?n.shiftKey&&n.metaKey:n.altKey;d.unit=M?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(d.extend==null||e.doc.extend)&&(d.extend=e.doc.extend||n.shiftKey),d.addNew==null&&(d.addNew=a?n.metaKey:n.ctrlKey),d.moveOnDrag==null&&(d.moveOnDrag=!(a?n.altKey:n.ctrlKey)),d}function Kl(e,t,n,i){K?setTimeout(I(gs,e),0):e.curOp.focus=U();var d=Gl(e,n,i),M=e.doc.sel,z;e.options.dragDrop&&ze&&!e.isReadOnly()&&n=="single"&&(z=M.contains(t))>-1&&(Ct((z=M.ranges[z]).from(),t)<0||t.xRel>0)&&(Ct(z.to(),t)>0||t.xRel<0)?zl(e,i,t,d):Vl(e,i,t,d)}function zl(e,t,n,i){var d=e.display,M=!1,z=pr(e,function(te){r&&(d.scroller.draggable=!1),e.state.draggingText=!1,ot(d.wrapper.ownerDocument,"mouseup",z),ot(d.wrapper.ownerDocument,"mousemove",Q),ot(d.scroller,"dragstart",q),ot(d.scroller,"drop",z),M||(ae(te),i.addNew||Zn(e.doc,n,null,null,i.extend),r&&!p||K&&G==9?setTimeout(function(){d.wrapper.ownerDocument.body.focus({preventScroll:!0}),d.input.focus()},20):d.input.focus())}),Q=function(te){M=M||Math.abs(t.clientX-te.clientX)+Math.abs(t.clientY-te.clientY)>=10},q=function(){return M=!0};r&&(d.scroller.draggable=!0),e.state.draggingText=z,z.copy=!i.moveOnDrag,d.scroller.dragDrop&&d.scroller.dragDrop(),Be(d.wrapper.ownerDocument,"mouseup",z),Be(d.wrapper.ownerDocument,"mousemove",Q),Be(d.scroller,"dragstart",q),Be(d.scroller,"drop",z),vs(e),setTimeout(function(){return d.input.focus()},20)}function yo(e,t,n){if(n=="char")return new Gt(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Gt($e(t.line,0),x(e.doc,$e(t.line+1,0)));var i=n(e,t);return new Gt(i.from,i.to)}function Vl(e,t,n,i){var d=e.display,M=e.doc;ae(t);var z,Q,q=M.sel,te=q.ranges;if(i.addNew&&!i.extend?(Q=M.sel.contains(n),Q>-1?z=te[Q]:z=new Gt(n,n)):(z=M.sel.primary(),Q=M.sel.primIndex),i.unit=="rectangle")i.addNew||(z=new Gt(n,n)),n=Ni(e,t,!0,!0),Q=-1;else{var pe=yo(e,n,i.unit);i.extend?z=Pa(z,pe.anchor,pe.head,i.extend):z=pe}i.addNew?Q==-1?(Q=te.length,wr(M,ti(e,te.concat([z]),Q),{scroll:!1,origin:"*mouse"})):te.length>1&&te[Q].empty()&&i.unit=="char"&&!i.extend?(wr(M,ti(e,te.slice(0,Q).concat(te.slice(Q+1)),0),{scroll:!1,origin:"*mouse"}),q=M.sel):Na(M,Q,z,Se):(Q=0,wr(M,new Yr([z],0),Se),q=M.sel);var ye=n;function Me(it){if(Ct(ye,it)==0)return;if(ye=it,i.unit=="rectangle"){for(var ht=[],Tt=e.options.tabSize,vt=H(dt(M,n.line).text,n.ch,Tt),Ot=H(dt(M,it.line).text,it.ch,Tt),Xt=Math.min(vt,Ot),gr=Math.max(vt,Ot),er=Math.min(n.line,it.line),Gr=Math.min(e.lastLine(),Math.max(n.line,it.line));er<=Gr;er++){var Nr=dt(M,er).text,sr=Oe(Nr,Xt,Tt);Xt==gr?ht.push(new Gt($e(er,sr),$e(er,sr))):Nr.length>sr&&ht.push(new Gt($e(er,sr),$e(er,Oe(Nr,gr,Tt))))}ht.length||ht.push(new Gt(n,n)),wr(M,ti(e,q.ranges.slice(0,Q).concat(ht),Q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(it)}else{var Fr=z,_r=yo(e,it,i.unit),hr=Fr.anchor,or;Ct(_r.anchor,hr)>0?(or=_r.head,hr=vi(Fr.from(),_r.anchor)):(or=_r.anchor,hr=gi(Fr.to(),_r.head));var rr=q.ranges.slice(0);rr[Q]=Yl(e,new Gt(x(M,hr),or)),wr(M,ti(e,rr,Q),Se)}}var De=d.wrapper.getBoundingClientRect(),We=0;function Ye(it){var ht=++We,Tt=Ni(e,it,!0,i.unit=="rectangle");if(!Tt)return;if(Ct(Tt,ye)!=0){e.curOp.focus=U(),Me(Tt);var vt=Vn(d,M);(Tt.line>=vt.to||Tt.lineDe.bottom?20:0;Ot&&setTimeout(pr(e,function(){if(We!=ht)return;d.scroller.scrollTop+=Ot,Ye(it)}),50)}}function Ze(it){e.state.selectingText=!1,We=Infinity,it&&(ae(it),d.input.focus()),ot(d.wrapper.ownerDocument,"mousemove",rt),ot(d.wrapper.ownerDocument,"mouseup",lt),M.history.lastSelOrigin=null}var rt=pr(e,function(it){it.buttons===0||!Fe(it)?Ze(it):Ye(it)}),lt=pr(e,Ze);e.state.selectingText=lt,Be(d.wrapper.ownerDocument,"mousemove",rt),Be(d.wrapper.ownerDocument,"mouseup",lt)}function Yl(e,t){var n=t.anchor,i=t.head,d=dt(e.doc,n.line);if(Ct(n,i)==0&&n.sticky==i.sticky)return t;var M=qe(d);if(!M)return t;var z=Qe(M,n.ch,n.sticky),Q=M[z];if(Q.from!=n.ch&&Q.to!=n.ch)return t;var q=z+(Q.from==n.ch==(Q.level!=1)?0:1);if(q==0||q==M.length)return t;var te;if(i.line!=n.line)te=(i.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var pe=Qe(M,i.ch,i.sticky),ye=pe-z||(i.ch-n.ch)*(Q.level==1?-1:1);pe==q-1||pe==q?te=ye<0:te=ye>0}var Me=M[q+(te?-1:0)],De=te==(Me.level==1),We=De?Me.from:Me.to,Ye=De?"after":"before";return n.ch==We&&n.sticky==Ye?t:new Gt(new $e(n.line,We,Ye),i)}function bo(e,t,n,i){var d,M;if(t.touches)d=t.touches[0].clientX,M=t.touches[0].clientY;else try{d=t.clientX,M=t.clientY}catch(Me){return!1}if(d>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&ae(t);var z=e.display,Q=z.lineDiv.getBoundingClientRect();if(M>Q.bottom||!me(e,n))return de(t);M-=Q.top-z.viewOffset;for(var q=0;q=d){var pe=lr(e.doc,M),ye=e.display.gutterSpecs[q];return Ue(e,n,e,pe,ye.className,t),de(t)}}}function Wa(e,t){return bo(e,t,"gutterClick",!0)}function _o(e,t){if(ci(e.display,t)||Xl(e,t))return;if(He(e,t,"contextmenu"))return;D||e.display.input.onContextMenu(t)}function Xl(e,t){return me(e,"gutterContextMenu")?bo(e,t,"gutterContextMenu",!1):!1}function Eo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),yn(e)}var on={toString:function(){return"CodeMirror.Init"}},xo={},aa={};function $l(e){var t=e.optionHandlers;function n(i,d,M,z){e.defaults[i]=d,M&&(t[i]=z?function(Q,q,te){te!=on&&M(Q,q,te)}:M)}e.defineOption=n,e.Init=on,n("value","",function(i,d){return i.setValue(d)},!0),n("mode",null,function(i,d){i.doc.modeOption=d,Da(i)},!0),n("indentUnit",2,Da,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(i){Cn(i),yn(i),Mr(i)},!0),n("lineSeparator",null,function(i,d){if(i.doc.lineSep=d,!d)return;var M=[],z=i.doc.first;i.doc.iter(function(q){for(var te=0;;){var pe=q.text.indexOf(d,te);if(pe==-1)break;te=pe+d.length,M.push($e(z,pe))}z++});for(var Q=M.length-1;Q>=0;Q--)rn(i.doc,d,M[Q],$e(M[Q].line,M[Q].ch+d.length))}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(i,d,M){i.state.specialChars=new RegExp(d.source+(d.test(" ")?"":"| "),"g"),M!=on&&i.refresh()}),n("specialCharPlaceholder",Yt,function(i){return i.refresh()},!0),n("electricChars",!0),n("inputStyle",u?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(i,d){return i.getInputField().spellcheck=d},!0),n("autocorrect",!1,function(i,d){return i.getInputField().autocorrect=d},!0),n("autocapitalize",!1,function(i,d){return i.getInputField().autocapitalize=d},!0),n("rtlMoveVisually",!R),n("wholeLineUpdateBefore",!0),n("theme","default",function(i){Eo(i),Sn(i)},!0),n("keyMap","default",function(i,d,M){var z=ia(d),Q=M!=on&&ia(M);Q&&Q.detach&&Q.detach(i,z),z.attach&&z.attach(i,Q||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ql,!0),n("gutters",[],function(i,d){i.display.gutterSpecs=La(d,i.options.lineNumbers),Sn(i)},!0),n("fixedGutter",!0,function(i,d){i.display.gutters.style.left=d?_a(i.display)+"px":"0",i.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(i){return Zi(i)},!0),n("scrollbarStyle","native",function(i){Ts(i),Zi(i),i.display.scrollbars.setScrollTop(i.doc.scrollTop),i.display.scrollbars.setScrollLeft(i.doc.scrollLeft)},!0),n("lineNumbers",!1,function(i,d){i.display.gutterSpecs=La(i.options.gutters,d),Sn(i)},!0),n("firstLineNumber",1,Sn,!0),n("lineNumberFormatter",function(i){return i},Sn,!0),n("showCursorWhenSelecting",!1,bn,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(i,d){d=="nocursor"&&(Ji(i),i.display.input.blur()),i.display.input.readOnlyChanged(d)}),n("screenReaderLabel",null,function(i,d){d=d===""?null:d,i.display.input.screenReaderLabelChanged(d)}),n("disableInput",!1,function(i,d){d||i.display.input.reset()},!0),n("dragDrop",!0,Jl),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,bn,!0),n("singleCursorHeightPerLine",!0,bn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Cn,!0),n("addModeClass",!1,Cn,!0),n("pollInterval",100),n("undoDepth",200,function(i,d){return i.doc.history.undoDepth=d}),n("historyEventDelay",1250),n("viewportMargin",10,function(i){return i.refresh()},!0),n("maxHighlightLength",1e4,Cn,!0),n("moveInputWithCursor",!0,function(i,d){d||i.display.input.resetPosition()}),n("tabindex",null,function(i,d){return i.display.input.getField().tabIndex=d||""}),n("autofocus",null),n("direction","ltr",function(i,d){return i.doc.setDirection(d)},!0),n("phrases",null)}function Jl(e,t,n){var i=n&&n!=on;if(!t!=!i){var d=e.display.dragFunctions,M=t?Be:ot;M(e.display.scroller,"dragstart",d.start),M(e.display.scroller,"dragenter",d.enter),M(e.display.scroller,"dragover",d.over),M(e.display.scroller,"dragleave",d.leave),M(e.display.scroller,"drop",d.drop)}}function Ql(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(A(e.display.wrapper,"CodeMirror-wrap"),jn(e)),Ea(e),Mr(e),yn(e),setTimeout(function(){return Zi(e)},100)}function Zt(e,t){var n=this;if(!(this instanceof Zt))return new Zt(e,t);this.options=t=t?g(t):{},g(xo,t,!1);var i=t.value;typeof i=="string"?i=new Pr(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var d=new Zt.inputStyles[t.inputStyle](this),M=this.display=new hl(e,i,d,t);M.wrapper.CodeMirror=this,Eo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ts(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new $,keySeq:null,specialChars:null},t.autofocus&&!u&&M.input.focus(),K&&G<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Zl(this),Ol(),ji(this),this.curOp.forceUpdate=!0,ks(this,i),t.autofocus&&!u||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Ta(n)},20):Ji(this);for(var z in aa)aa.hasOwnProperty(z)&&aa[z](this,t[z],on);Cs(this),t.finishInit&&t.finishInit(this);for(var Q=0;Q20*20}Be(t.scroller,"touchstart",function(q){if(!He(e,q)&&!M(q)&&!Wa(e,q)){t.input.ensurePolled(),clearTimeout(n);var te=+new Date;t.activeTouch={start:te,moved:!1,prev:te-i.end<=300?i:null},q.touches.length==1&&(t.activeTouch.left=q.touches[0].pageX,t.activeTouch.top=q.touches[0].pageY)}}),Be(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Be(t.scroller,"touchend",function(q){var te=t.activeTouch;if(te&&!ci(t,q)&&te.left!=null&&!te.moved&&new Date-te.start<300){var pe=e.coordsChar(t.activeTouch,"page"),ye;!te.prev||z(te,te.prev)?ye=new Gt(pe,pe):!te.prev.prev||z(te,te.prev.prev)?ye=e.findWordAt(pe):ye=new Gt($e(pe.line,0),x(e.doc,$e(pe.line+1,0))),e.setSelection(ye.anchor,ye.head),e.focus(),ae(q)}d()}),Be(t.scroller,"touchcancel",d),Be(t.scroller,"scroll",function(){t.scroller.clientHeight&&(En(e,t.scroller.scrollTop),Bi(e,t.scroller.scrollLeft,!0),Ue(e,"scroll",e))}),Be(t.scroller,"mousewheel",function(q){return Os(e,q)}),Be(t.scroller,"DOMMouseScroll",function(q){return Os(e,q)}),Be(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(q){He(e,q)||ge(q)},over:function(q){He(e,q)||(Rl(e,q),ge(q))},start:function(q){return Al(e,q)},drop:pr(e,Cl),leave:function(q){He(e,q)||io(e)}};var Q=t.input.getField();Be(Q,"keyup",function(q){return mo.call(e,q)}),Be(Q,"keydown",pr(e,po)),Be(Q,"keypress",pr(e,go)),Be(Q,"focus",function(q){return Ta(e,q)}),Be(Q,"blur",function(q){return Ji(e,q)})}var Ga=[];Zt.defineInitHook=function(e){return Ga.push(e)};function Un(e,t,n,i){var d=e.doc,M;n==null&&(n="add"),n=="smart"&&(d.mode.indent?M=et(e,t).state:n="prev");var z=e.options.tabSize,Q=dt(d,t),q=H(Q.text,null,z);Q.stateAfter&&(Q.stateAfter=null);var te=Q.text.match(/^\s*/)[0],pe;if(!i&&!/\S/.test(Q.text))pe=0,n="not";else if(n=="smart"&&(pe=d.mode.indent(M,Q.text.slice(te.length),Q.text),pe==Ce||pe>150)){if(!i)return;n="prev"}n=="prev"?t>d.first?pe=H(dt(d,t-1).text,null,z):pe=0:n=="add"?pe=q+e.options.indentUnit:n=="subtract"?pe=q-e.options.indentUnit:typeof n=="number"&&(pe=q+n),pe=Math.max(0,pe);var ye="",Me=0;if(e.options.indentWithTabs)for(var De=Math.floor(pe/z);De;--De)Me+=z,ye+=" ";if(Mez,q=St(t),te=null;if(Q&&i.ranges.length>1)if(ri&&ri.text.join(` `)==t){if(i.ranges.length%ri.text.length==0){te=[];for(var pe=0;pe=0;Me--){var De=i.ranges[Me],We=De.from(),Ye=De.to();De.empty()&&(n&&n>0?We=$e(We.line,We.ch-n):e.state.overwrite&&!Q?Ye=$e(Ye.line,Math.min(dt(M,Ye.line).text.length,Ye.ch+re(q).length)):Q&&ri&&ri.lineWise&&ri.text.join(` `)==q.join(` `)&&(We=Ye=$e(We.line,0)));var Ze={from:We,to:Ye,text:te?te[Me%te.length]:q,origin:d||(Q?"paste":e.state.cutIncoming>z?"cut":"+input")};tn(e.doc,Ze),br(e,"inputRead",e,Ze)}t&&!Q&&wo(e,t),Qi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=ye),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function To(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Wr(t,function(){return Ka(t,n,0,null,"paste")}),!0}function wo(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var n=e.doc.sel,i=n.ranges.length-1;i>=0;i--){var d=n.ranges[i];if(d.head.ch>100||i&&n.ranges[i-1].head.line==d.head.line)continue;var M=e.getModeAt(d.head),z=!1;if(M.electricChars){for(var Q=0;Q-1){z=Un(e,d.head.line,"smart");break}}else M.electricInput&&(M.electricInput.test(dt(e.doc,d.head.line).text.slice(0,d.head.ch))&&(z=Un(e,d.head.line,"smart")));z&&br(e,"electricInput",e,d.head.line)}}function So(e){for(var t=[],n=[],i=0;iM&&(Un(this,Q.head.line,i,!0),M=Q.head.line,z==this.doc.sel.primIndex&&Qi(this));else{var q=Q.from(),te=Q.to(),pe=Math.max(M,q.line);M=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var ye=pe;ye0&&Na(this.doc,z,new Gt(q,Me[z].to()),ve)}}}),getTokenAt:function(i,d){return $t(this,i,d)},getLineTokens:function(i,d){return $t(this,$e(i),d,!0)},getTokenTypeAt:function(i){i=x(this.doc,i);var d=Ke(this,dt(this.doc,i.line)),M=0,z=(d.length-1)/2,Q=i.ch,q;if(Q==0)q=d[2];else for(;;){var te=M+z>>1;if((te?d[te*2-1]:0)>=Q)z=te;else if(d[te*2+1]q&&(i=q,z=!0),Q=dt(this.doc,i)}else Q=i;return Wn(this,Q,{top:0,left:0},d||"page",M||z).top+(z?this.doc.height-qr(Q):0)},defaultTextHeight:function(){return Xi(this.display)},defaultCharWidth:function(){return $i(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(i,d,M,z,Q){var q=this.display;i=ei(this,x(this.doc,i));var te=i.bottom,pe=i.left;if(d.style.position="absolute",d.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(d),q.sizer.appendChild(d),z=="over")te=i.top;else if(z=="above"||z=="near"){var ye=Math.max(q.wrapper.clientHeight,this.doc.height),Me=Math.max(q.sizer.clientWidth,q.lineSpace.clientWidth);(z=="above"||i.bottom+d.offsetHeight>ye)&&i.top>d.offsetHeight?te=i.top-d.offsetHeight:i.bottom+d.offsetHeight<=ye&&(te=i.bottom),pe+d.offsetWidth>Me&&(pe=Me-d.offsetWidth)}d.style.top=te+"px",d.style.left=d.style.right="",Q=="right"?(pe=q.sizer.clientWidth-d.offsetWidth,d.style.right="0px"):(Q=="left"?pe=0:Q=="middle"&&(pe=(q.sizer.clientWidth-d.offsetWidth)/2),d.style.left=pe+"px"),M&&Jo(this,{left:pe,top:te,right:pe+d.offsetWidth,bottom:te+d.offsetHeight})},triggerOnKeyDown:Rr(po),triggerOnKeyPress:Rr(go),triggerOnKeyUp:mo,triggerOnMouseDown:Rr(vo),execCommand:function(i){if(Pn.hasOwnProperty(i))return Pn[i].call(null,this)},triggerElectric:Rr(function(i){wo(this,i)}),findPosH:function(i,d,M,z){var Q=1;d<0&&(Q=-1,d=-d);for(var q=x(this.doc,i),te=0;te0&&pe(M.charAt(z-1));)--z;for(;Q.5||this.options.lineWrapping)&&Ea(this),Ue(this,"refresh",this)}),swapDoc:Rr(function(i){var d=this.doc;return d.cm=null,this.state.selectingText&&this.state.selectingText(),ks(this,i),yn(this),this.display.input.reset(),_n(this,i.scrollLeft,i.scrollTop),this.curOp.forceScroll=!0,br(this,"swapDoc",this,d),d}),phrase:function(i){var d=this.options.phrases;return d&&Object.prototype.hasOwnProperty.call(d,i)?d[i]:i},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},be(e),e.registerHelper=function(i,d,M){n.hasOwnProperty(i)||(n[i]=e[i]={_global:[]}),n[i][d]=M},e.registerGlobalHelper=function(i,d,M,z){e.registerHelper(i,d,z),n[i]._global.push({pred:M,val:z})}}function za(e,t,n,i,d){var M=t,z=n,Q=dt(e,t.line),q=d&&e.direction=="rtl"?-n:n;function te(){var lt=t.line+q;return lt=e.first+e.size?!1:(t=new $e(lt,t.ch,t.sticky),Q=dt(e,lt))}function pe(lt){var it;if(i=="codepoint"){var ht=Q.text.charCodeAt(t.ch+(i>0?0:-1));isNaN(ht)?it=null:it=new $e(t.line,Math.max(0,Math.min(Q.text.length,t.ch+n*(ht>=55296&&ht<56320?2:1))),-n)}else d?it=Ml(e.cm,Q,t,n):it=Ba(Q,t,n);if(it==null)if(!lt&&te())t=Ua(d,e.cm,Q,t.line,q);else return!1;else t=it;return!0}if(i=="char"||i=="codepoint")pe();else if(i=="column")pe(!0);else if(i=="word"||i=="group")for(var ye=null,Me=i=="group",De=e.cm&&e.cm.getHelper(t,"wordChars"),We=!0;!(n<0&&!pe(!We));We=!1){var Ye=Q.text.charAt(t.ch)||` `,Ze=je(Ye,De)?"w":Me&&Ye==` `?"n":!Me||/\s/.test(Ye)?null:"p";if(Me&&!We&&!Ze&&(Ze="s"),ye&&ye!=Ze){n<0&&(n=1,pe(),t.sticky="after");break}if(Ze&&(ye=Ze),n>0&&!pe(!We))break}var rt=ea(e,t,M,z,!0);return pi(M,rt)&&(rt.hitSide=!0),rt}function Ro(e,t,n,i){var d=e.doc,M=t.left,z;if(i=="page"){var Q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),q=Math.max(Q-.5*Xi(e.display),3);z=(n>0?t.bottom:t.top)+n*q}else i=="line"&&(z=n>0?t.bottom+3:t.top-3);for(var te;!(te=va(e,M,z),!te.outside);){if(n<0?z<=0:z>=d.height){te.hitSide=!0;break}z+=n*5}return te}var zt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new $,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};zt.prototype.init=function(e){var t=this,n=this,i=n.cm,d=n.div=e.lineDiv;Co(d,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function M(Q){for(var q=Q.target;q;q=q.parentNode){if(q==d)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(q.className))break}return!1}Be(d,"paste",function(Q){if(!M(Q)||He(i,Q)||To(Q,i))return;G<=11&&setTimeout(pr(i,function(){return t.updateFromDOM()}),20)}),Be(d,"compositionstart",function(Q){t.composing={data:Q.data,done:!1}}),Be(d,"compositionupdate",function(Q){t.composing||(t.composing={data:Q.data,done:!1})}),Be(d,"compositionend",function(Q){t.composing&&(Q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Be(d,"touchstart",function(){return n.forceCompositionEnd()}),Be(d,"input",function(){t.composing||t.readFromDOMSoon()});function z(Q){if(!M(Q)||He(i,Q))return;if(i.somethingSelected())sa({lineWise:!1,text:i.getSelections()}),Q.type=="cut"&&i.replaceSelection("",null,"cut");else if(i.options.lineWiseCopyCut){var q=So(i);sa({lineWise:!0,text:q.text}),Q.type=="cut"&&i.operation(function(){i.setSelections(q.ranges,0,ve),i.replaceSelection("",null,"cut")})}else return;if(Q.clipboardData){Q.clipboardData.clearData();var te=ri.text.join(` `);if(Q.clipboardData.setData("Text",te),Q.clipboardData.getData("Text")==te){Q.preventDefault();return}}var pe=Ao(),ye=pe.firstChild;i.display.lineSpace.insertBefore(pe,i.display.lineSpace.firstChild),ye.value=ri.text.join(` `);var Me=document.activeElement;N(ye),setTimeout(function(){i.display.lineSpace.removeChild(pe),Me.focus(),Me==d&&n.showPrimarySelection()},50)}Be(d,"copy",z),Be(d,"cut",z)},zt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},zt.prototype.prepareSelection=function(){var e=ps(this.cm,!1);return e.focus=document.activeElement==this.div,e},zt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},zt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},zt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),i=n.from(),d=n.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||d.line=t.display.viewFrom&&Oo(t,i)||{node:Q[0].measure.map[2],offset:0},te=d.linee.firstLine()&&(i=$e(i.line-1,dt(e.doc,i.line-1).length)),d.ch==dt(e.doc,d.line).text.length&&d.linet.viewTo-1)return!1;var M,z,Q;i.line==t.viewFrom||(M=Fi(e,i.line))==0?(z=Rt(t.view[0].line),Q=t.view[0].node):(z=Rt(t.view[M].line),Q=t.view[M-1].node.nextSibling);var q=Fi(e,d.line),te,pe;if(q==t.view.length-1?(te=t.viewTo-1,pe=t.lineDiv.lastChild):(te=Rt(t.view[q+1].line)-1,pe=t.view[q+1].node.previousSibling),!Q)return!1;for(var ye=e.doc.splitLines(tu(e,Q,pe,z,te)),Me=Ur(e.doc,$e(z,0),$e(te,dt(e.doc,te).text.length));ye.length>1&&Me.length>1;)if(re(ye)==re(Me))ye.pop(),Me.pop(),te--;else if(ye[0]==Me[0])ye.shift(),Me.shift(),z++;else break;for(var De=0,We=0,Ye=ye[0],Ze=Me[0],rt=Math.min(Ye.length,Ze.length);Dei.ch&<.charCodeAt(lt.length-We-1)==it.charCodeAt(it.length-We-1);)De--,We++;ye[ye.length-1]=lt.slice(0,lt.length-We).replace(/^\u200b+/,""),ye[0]=ye[0].slice(De).replace(/\u200b+$/,"");var Tt=$e(z,De),vt=$e(te,Me.length?re(Me).length-We:0);if(ye.length>1||ye[0]||Ct(Tt,vt))return rn(e.doc,ye,Tt,vt,"+input"),!0},zt.prototype.ensurePolled=function(){this.forceCompositionEnd()},zt.prototype.reset=function(){this.forceCompositionEnd()},zt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},zt.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},zt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Wr(this.cm,function(){return Mr(e.cm)})},zt.prototype.setUneditable=function(e){e.contentEditable="false"},zt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||pr(this.cm,Ka)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},zt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},zt.prototype.onContextMenu=function(){},zt.prototype.resetPosition=function(){},zt.prototype.needsContentAttribute=!0;function Oo(e,t){var n=fa(e,t.line);if(!n||n.hidden)return null;var i=dt(e.doc,t.line),d=es(n,i,t.line),M=qe(i,e.doc.direction),z="left";if(M){var Q=Qe(M,t.ch);z=Q%2?"right":"left"}var q=is(d.map,t.ch,z);return q.offset=q.collapse=="right"?q.end:q.start,q}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function ln(e,t){return t&&(e.bad=!0),e}function tu(e,t,n,i,d){var M="",z=!1,Q=e.doc.lineSeparator(),q=!1;function te(De){return function(We){return We.id==De}}function pe(){z&&(M+=Q,q&&(M+=Q),z=q=!1)}function ye(De){De&&(pe(),M+=De)}function Me(De){if(De.nodeType==1){var We=De.getAttribute("cm-text");if(We){ye(We);return}var Ye=De.getAttribute("cm-marker"),Ze;if(Ye){var rt=e.findMarks($e(i,0),$e(d+1,0),te(+Ye));rt.length&&(Ze=rt[0].find(0))&&ye(Ur(e.doc,Ze.from,Ze.to).join(Q));return}if(De.getAttribute("contenteditable")=="false")return;var lt=/^(pre|div|p|li|table|br)$/i.test(De.nodeName);if(!/^br$/i.test(De.nodeName)&&De.textContent.length==0)return;lt&&pe();for(var it=0;it=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),Be(d,"paste",function(z){if(He(i,z)||To(z,i))return;i.state.pasteIncoming=+new Date,n.fastPoll()});function M(z){if(He(i,z))return;if(i.somethingSelected())sa({lineWise:!1,text:i.getSelections()});else if(i.options.lineWiseCopyCut){var Q=So(i);sa({lineWise:!0,text:Q.text}),z.type=="cut"?i.setSelections(Q.ranges,null,ve):(n.prevInput="",d.value=Q.text.join(` `),N(d))}else return;z.type=="cut"&&(i.state.cutIncoming=+new Date)}Be(d,"cut",M),Be(d,"copy",M),Be(e.scroller,"paste",function(z){if(ci(e,z)||He(i,z))return;if(!d.dispatchEvent){i.state.pasteIncoming=+new Date,n.focus();return}var Q=new Event("paste");Q.clipboardData=z.clipboardData,d.dispatchEvent(Q)}),Be(e.lineSpace,"selectstart",function(z){ci(e,z)||ae(z)}),Be(d,"compositionstart",function(){var z=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:z,range:i.markText(z,i.getCursor("to"),{className:"CodeMirror-composing"})}}),Be(d,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},nr.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},nr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},nr.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,i=ps(e);if(e.options.moveInputWithCursor){var d=ei(e,n.sel.primary().head,"div"),M=t.wrapper.getBoundingClientRect(),z=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,d.top+z.top-M.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,d.left+z.left-M.left))}return i},nr.prototype.showSelection=function(e){var t=this.cm,n=t.display;T(n.cursorDiv,e.cursors),T(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},nr.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&N(this.textarea),K&&G>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",K&&G>=9&&(this.hasSelection=null))},nr.prototype.getField=function(){return this.textarea},nr.prototype.supportsTouch=function(){return!1},nr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!u||U()!=this.textarea))try{this.textarea.focus()}catch(e){}},nr.prototype.blur=function(){this.textarea.blur()},nr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},nr.prototype.receivedFocus=function(){this.slowPoll()},nr.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},nr.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var i=t.poll();!i&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},nr.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||ct(n)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var d=n.value;if(d==i&&!t.somethingSelected())return!1;if(K&&G>=9&&this.hasSelection===d||a&&/[\uf700-\uf7ff]/.test(d))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var M=d.charCodeAt(0);if(M==8203&&!i&&(i="\u200B"),M==8666)return this.reset(),this.cm.execCommand("undo")}for(var z=0,Q=Math.min(i.length,d.length);z1e3||d.indexOf(` `)>-1?n.value=e.prevInput="":e.prevInput=d,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},nr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},nr.prototype.onKeyPress=function(){K&&G>=9&&(this.hasSelection=null),this.fastPoll()},nr.prototype.onContextMenu=function(e){var t=this,n=t.cm,i=n.display,d=t.textarea;t.contextMenuPending&&t.contextMenuPending();var M=Ni(n,e),z=i.scroller.scrollTop;if(!M||m)return;var Q=n.options.resetSelectionOnContextMenu;Q&&n.doc.sel.contains(M)==-1&&pr(n,wr)(n.doc,Si(M),ve);var q=d.style.cssText,te=t.wrapper.style.cssText,pe=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",d.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-pe.top-5)+"px; left: "+(e.clientX-pe.left-5)+`px; z-index: 1000; background: `+(K?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ye;r&&(ye=window.scrollY),i.input.focus(),r&&window.scrollTo(null,ye),i.input.reset(),n.somethingSelected()||(d.value=t.prevInput=" "),t.contextMenuPending=De,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll);function Me(){if(d.selectionStart!=null){var Ye=n.somethingSelected(),Ze="\u200B"+(Ye?d.value:"");d.value="\u21DA",d.value=Ze,t.prevInput=Ye?"":"\u200B",d.selectionStart=1,d.selectionEnd=Ze.length,i.selForContextMenu=n.doc.sel}}function De(){if(t.contextMenuPending!=De)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,d.style.cssText=q,K&&G<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=z),d.selectionStart!=null){(!K||K&&G<9)&&Me();var Ye=0,Ze=function(){i.selForContextMenu==n.doc.sel&&d.selectionStart==0&&d.selectionEnd>0&&t.prevInput=="\u200B"?pr(n,Vs)(n):Ye++<10?i.detectingSelectAll=setTimeout(Ze,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(Ze,200)}}if(K&&G>=9&&Me(),D){ge(e);var We=function(){ot(window,"mouseup",We),setTimeout(De,20)};Be(window,"mouseup",We)}else setTimeout(De,50)},nr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},nr.prototype.setUneditable=function(){},nr.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?g(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=U();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function i(){e.value=Q.getValue()}var d;if(e.form&&(Be(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var M=e.form;d=M.submit;try{var z=M.submit=function(){i(),M.submit=d,M.submit(),M.submit=z}}catch(q){}}t.finishInit=function(q){q.save=i,q.getTextArea=function(){return e},q.toTextArea=function(){q.toTextArea=isNaN,i(),e.parentNode.removeChild(q.getWrapperElement()),e.style.display="",e.form&&(ot(e.form,"submit",i),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=d))}},e.style.display="none";var Q=Zt(function(q){return e.parentNode.insertBefore(q,e.nextSibling)},t);return Q}function nu(e){e.off=ot,e.on=Be,e.wheelEventPixels=cl,e.Doc=Pr,e.splitLines=St,e.countColumn=H,e.findColumn=Oe,e.isWordChar=Pe,e.Pass=Ce,e.signal=Ue,e.Line=ki,e.changeEnd=Ci,e.scrollbarModel=xs,e.Pos=$e,e.cmpPos=Ct,e.modes=Qt,e.mimeModes=It,e.resolveMode=yt,e.getMode=Lr,e.modeExtensions=bt,e.extendMode=xt,e.copyState=Ft,e.startState=cr,e.innerMode=tr,e.commands=Pn,e.keyMap=di,e.keyName=lo,e.isModifierKey=so,e.lookupKey=an,e.normalizeKeyMap=kl,e.StringStream=Pt,e.SharedTextMarker=Dn,e.TextMarker=Ri,e.LineWidget=In,e.e_preventDefault=ae,e.e_stopPropagation=le,e.e_stop=ge,e.addClass=F,e.contains=b,e.rmClass=A,e.keyNames=Oi}$l(Zt),ql(Zt);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Pr.prototype)Pr.prototype.hasOwnProperty(la)&&ie(au,la)<0&&(Zt.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Pr.prototype[la]));return be(Pr),Zt.inputStyles={textarea:nr,contenteditable:zt},Zt.defineMode=function(e){!Zt.defaults.mode&&e!="null"&&(Zt.defaults.mode=e),Cr.apply(this,arguments)},Zt.defineMIME=Kr,Zt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Zt.defineMIME("text/plain","null"),Zt.defineExtension=function(e,t){Zt.prototype[e]=t},Zt.defineDocExtension=function(e,t){Pr.prototype[e]=t},Zt.fromTextArea=iu,nu(Zt),Zt.version="5.58.2",Zt})},Y1PL:function(nt,xe,Z){"use strict";Z.r(xe),Z.d(xe,"ResizableTextArea",function(){return ie});var ne=Z("wx14"),J=Z("1OyB"),P=Z("vuIU"),X=Z("Ji7U"),j=Z("LK+K"),B=Z("q1tI"),K=Z("VTBJ"),G=Z("rePB"),r=Z("Zm9Q"),L=Z("Kwbf"),v=Z("c+Xe"),m=Z("m+aA"),p=Z("bdgK"),h=new Map;function l(ve){ve.forEach(function(Se){var Ae,Oe=Se.target;(Ae=h.get(Oe))===null||Ae===void 0||Ae.forEach(function(he){return he(Oe)})})}var f=new p.default(l),o=null,u=null;function a(ve,Se){h.has(ve)||(h.set(ve,new Set),f.observe(ve)),h.get(ve).add(Se)}function s(ve,Se){h.has(ve)&&(h.get(ve).delete(Se),h.get(ve).size||(f.unobserve(ve),h.delete(ve)))}var R=function(ve){Object(X.a)(Ae,ve);var Se=Object(j.a)(Ae);function Ae(){return Object(J.a)(this,Ae),Se.apply(this,arguments)}return Object(P.a)(Ae,[{key:"render",value:function(){return this.props.children}}]),Ae}(B.Component),_=B.createContext(null);function C(ve){var Se=ve.children,Ae=ve.onBatchResize,Oe=B.useRef(0),he=B.useRef([]),ce=B.useContext(_),re=B.useCallback(function(fe,se,ke){Oe.current+=1;var Ne=Oe.current;he.current.push({size:fe,element:se,data:ke}),Promise.resolve().then(function(){Ne===Oe.current&&(Ae==null||Ae(he.current),he.current=[])}),ce==null||ce(fe,se,ke)},[Ae,ce]);return B.createElement(_.Provider,{value:re},Se)}function D(ve){var Se=ve.children,Ae=ve.disabled,Oe=B.useRef(null),he=B.useRef(null),ce=B.useContext(_),re=B.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),fe=B.isValidElement(Se)&&Object(v.c)(Se),se=fe?Se.ref:null,ke=B.useMemo(function(){return Object(v.a)(se,Oe)},[se,Oe]),Ne=B.useRef(ve);Ne.current=ve;var Re=B.useCallback(function(Pe){var je=Ne.current,ue=je.onResize,Ee=je.data,Le=Pe.getBoundingClientRect(),Ie=Le.width,Ge=Le.height,Xe=Pe.offsetWidth,Je=Pe.offsetHeight,Qe=Math.floor(Ie),at=Math.floor(Ge);if(re.current.width!==Qe||re.current.height!==at||re.current.offsetWidth!==Xe||re.current.offsetHeight!==Je){var qe={width:Qe,height:at,offsetWidth:Xe,offsetHeight:Je};re.current=qe;var tt=Xe===Math.round(Ie)?Ie:Xe,Be=Je===Math.round(Ge)?Ge:Je,ut=Object(K.a)(Object(K.a)({},qe),{},{offsetWidth:tt,offsetHeight:Be});ce==null||ce(ut,Pe,Ee),ue&&Promise.resolve().then(function(){ue(ut,Pe)})}},[]);return B.useEffect(function(){var Pe=Object(m.a)(Oe.current)||Object(m.a)(he.current);return Pe&&!Ae&&a(Pe,Re),function(){return s(Pe,Re)}},[Oe.current,Ae]),B.createElement(R,{ref:he},fe?B.cloneElement(Se,{ref:ke}):Se)}var O="rc-observer-key";function A(ve){var Se=ve.children,Ae=Object(r.a)(Se);return Ae.map(function(Oe,he){var ce=(Oe==null?void 0:Oe.key)||"".concat(O,"-").concat(he);return B.createElement(D,Object(ne.a)({},ve,{key:ce}),Oe)})}A.Collection=C;var S=A,T=Z("bT9E"),c=Z("TSYQ"),w=Z.n(c),y=` min-height:0 !important; max-height:none !important; height:0 !important; visibility:hidden !important; overflow:hidden !important; position:absolute !important; z-index:-1000 !important; top:0 !important; right:0 !important `,b=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],U={},F;function E(ve){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ae=ve.getAttribute("id")||ve.getAttribute("data-reactid")||ve.getAttribute("name");if(Se&&U[Ae])return U[Ae];var Oe=window.getComputedStyle(ve),he=Oe.getPropertyValue("box-sizing")||Oe.getPropertyValue("-moz-box-sizing")||Oe.getPropertyValue("-webkit-box-sizing"),ce=parseFloat(Oe.getPropertyValue("padding-bottom"))+parseFloat(Oe.getPropertyValue("padding-top")),re=parseFloat(Oe.getPropertyValue("border-bottom-width"))+parseFloat(Oe.getPropertyValue("border-top-width")),fe=b.map(function(ke){return"".concat(ke,":").concat(Oe.getPropertyValue(ke))}).join(";"),se={sizingStyle:fe,paddingSize:ce,borderSize:re,boxSizing:he};return Se&&Ae&&(U[Ae]=se),se}function N(ve){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Oe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;F||(F=document.createElement("textarea"),F.setAttribute("tab-index","-1"),F.setAttribute("aria-hidden","true"),document.body.appendChild(F)),ve.getAttribute("wrap")?F.setAttribute("wrap",ve.getAttribute("wrap")):F.removeAttribute("wrap");var he=E(ve,Se),ce=he.paddingSize,re=he.borderSize,fe=he.boxSizing,se=he.sizingStyle;F.setAttribute("style","".concat(se,";").concat(y)),F.value=ve.value||ve.placeholder||"";var ke=Number.MIN_SAFE_INTEGER,Ne=Number.MAX_SAFE_INTEGER,Re=F.scrollHeight,Pe;if(fe==="border-box"?Re+=re:fe==="content-box"&&(Re-=ce),Ae!==null||Oe!==null){F.value=" ";var je=F.scrollHeight-ce;Ae!==null&&(ke=je*Ae,fe==="border-box"&&(ke=ke+ce+re),Re=Math.max(ke,Re)),Oe!==null&&(Ne=je*Oe,fe==="border-box"&&(Ne=Ne+ce+re),Pe=Re>Ne?"":"hidden",Re=Math.min(Ne,Re))}return{height:Re,minHeight:ke,maxHeight:Ne,overflowY:Pe,resize:"none"}}var I=Z("Gytx"),g=Z.n(I),H;(function(ve){ve[ve.NONE=0]="NONE",ve[ve.RESIZING=1]="RESIZING",ve[ve.RESIZED=2]="RESIZED"})(H||(H={}));var $=function(ve){Object(X.a)(Ae,ve);var Se=Object(j.a)(Ae);function Ae(Oe){var he;return Object(J.a)(this,Ae),he=Se.call(this,Oe),he.nextFrameActionId=void 0,he.resizeFrameId=void 0,he.textArea=void 0,he.saveTextArea=function(ce){he.textArea=ce},he.handleResize=function(ce){var re=he.state.resizeStatus,fe=he.props,se=fe.autoSize,ke=fe.onResize;if(re!==H.NONE)return;typeof ke=="function"&&ke(ce),se&&he.resizeOnNextFrame()},he.resizeOnNextFrame=function(){cancelAnimationFrame(he.nextFrameActionId),he.nextFrameActionId=requestAnimationFrame(he.resizeTextarea)},he.resizeTextarea=function(){var ce=he.props.autoSize;if(!ce||!he.textArea)return;var re=ce.minRows,fe=ce.maxRows,se=N(he.textArea,!1,re,fe);he.setState({textareaStyles:se,resizeStatus:H.RESIZING},function(){cancelAnimationFrame(he.resizeFrameId),he.resizeFrameId=requestAnimationFrame(function(){he.setState({resizeStatus:H.RESIZED},function(){he.resizeFrameId=requestAnimationFrame(function(){he.setState({resizeStatus:H.NONE}),he.fixFirefoxAutoScroll()})})})})},he.renderTextArea=function(){var ce=he.props,re=ce.prefixCls,fe=re===void 0?"rc-textarea":re,se=ce.autoSize,ke=ce.onResize,Ne=ce.className,Re=ce.disabled,Pe=he.state,je=Pe.textareaStyles,ue=Pe.resizeStatus,Ee=Object(T.a)(he.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Le=w()(fe,Ne,Object(G.a)({},"".concat(fe,"-disabled"),Re));"value"in Ee&&(Ee.value=Ee.value||"");var Ie=Object(K.a)(Object(K.a)(Object(K.a)({},he.props.style),je),ue===H.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return B.createElement(S,{onResize:he.handleResize,disabled:!(se||ke)},B.createElement("textarea",Object(ne.a)({},Ee,{className:Le,style:Ie,ref:he.saveTextArea})))},he.state={textareaStyles:{},resizeStatus:H.NONE},he}return Object(P.a)(Ae,[{key:"componentDidUpdate",value:function(he){(he.value!==this.props.value||!g()(he.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var he=this.textArea.selectionStart,ce=this.textArea.selectionEnd;this.textArea.setSelectionRange(he,ce)}}catch(re){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ae}(B.Component),ie=$,oe=function(ve){Object(X.a)(Ae,ve);var Se=Object(j.a)(Ae);function Ae(Oe){var he;Object(J.a)(this,Ae),he=Se.call(this,Oe),he.resizableTextArea=void 0,he.focus=function(){he.resizableTextArea.textArea.focus()},he.saveTextArea=function(re){he.resizableTextArea=re},he.handleChange=function(re){var fe=he.props.onChange;he.setValue(re.target.value,function(){he.resizableTextArea.resizeTextarea()}),fe&&fe(re)},he.handleKeyDown=function(re){var fe=he.props,se=fe.onPressEnter,ke=fe.onKeyDown;re.keyCode===13&&se&&se(re),ke&&ke(re)};var ce=typeof Oe.value=="undefined"||Oe.value===null?Oe.defaultValue:Oe.value;return he.state={value:ce},he}return Object(P.a)(Ae,[{key:"setValue",value:function(he,ce){"value"in this.props||this.setState({value:he},ce)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return B.createElement(ie,Object(ne.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(he){return"value"in he?{value:he.value}:null}}]),Ae}(B.Component),Ce=xe.default=oe},ZW9T:function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return I});var ne=Z("k1fw"),J=Z("oBTY"),P=Z("miYZ"),X=Z("tsqr"),j=Z("rAM+"),B=Z("tJVT"),K=Z("PpiC"),G=Z("q1tI"),r=Z.n(G),L=Z("bdgK"),v=Z("9og8"),m=Z("WmNS"),p=Z.n(m),h={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},l={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(` `)},{label:"System.out.println",content:["System.out.println($0)"].join(` `)},{label:"System.out.print",content:["System.out.print($0)"].join(` `)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},f={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(` `)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(` `)},{label:"if",content:["if () {"," $0","}"].join(` `)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(` `)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(` `)},{label:"using namespace std;",content:["using namespace std;"].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)}]},o={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(` `)}]},u=Z("5VLF"),a=Z.n(u),s={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},R=function(H,$){return $.map(function(ie){return{label:ie,kind:H.languages.CompletionItemKind.Keyword,insertText:ie}})},_=function(H){return Object.keys(s.tables).map(function($){return{label:$,kind:H.languages.CompletionItemKind.Variable,insertText:$}})},C=function(H,$){var ie=s.tables[H];return ie?ie.map(function(oe){return{label:oe,kind:$.languages.CompletionItemKind.Field,insertText:oe}}):[]};function D(g,H,$,ie,oe){var Ce=H.getWordUntilPosition($),ve={startLineNumber:$.lineNumber,endLineNumber:$.lineNumber,startColumn:Ce.startColumn,endColumn:Ce.endColumn},Se=ie.map(function(Ae){return{label:Ae,kind:g.languages.CompletionItemKind.Keyword,insertText:Ae,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}});return oe.map(function(Ae){Se.push(Object(ne.a)(Object(ne.a)({},Ae),{},{range:ve}))}),Se}var O=function(g){s.languages.map(function(oe){return g.languages.registerDocumentFormattingEditProvider(oe,{provideDocumentFormattingEdits:function(ve,Se,Ae){return Object(v.a)(p.a.mark(function Oe(){var he;return p.a.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return he=a()(ve.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),re.abrupt("return",[{range:ve.getFullModelRange(),text:he}]);case 2:case"end":return re.stop()}},Oe)}))()}}),oe});var H=f.quickKey.map(function(oe){return{label:oe.label,kind:g.languages.CompletionItemKind.Method,insertText:oe.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),$=o.quickKey.map(function(oe){return{label:oe.label,kind:g.languages.CompletionItemKind.Method,insertText:oe.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ie=l.quickKey.map(function(oe){return{label:oe.label,kind:g.languages.CompletionItemKind.Method,insertText:oe.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}});g.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Ce,ve){var Se=Ce.getWordUntilPosition(ve),Ae={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:Se.startColumn,endColumn:Se.endColumn},Oe=Ce.getLineContent(ve.lineNumber).substring(Se.startColumn-2,Se.endColumn);return{suggestions:[].concat(Object(J.a)(f.keywords.map(function(he){return{label:he,kind:g.languages.CompletionItemKind.Function,documentation:he,insertText:he,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})),Object(J.a)(f.quickKey.map(function(he){return{label:he.label,kind:g.languages.CompletionItemKind.Function,documentation:he.content,insertText:Oe.startsWith("#")?he.content.replace(/#/,""):he.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})))}}}),g.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Ce,ve){var Se=Ce.getWordUntilPosition(ve),Ae={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:Se.startColumn,endColumn:Se.endColumn};return{suggestions:Object(J.a)(h.keywords.map(function(Oe){return{label:Oe,kind:g.languages.CompletionItemKind.Function,documentation:Oe,insertText:Oe,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}}))}}}),g.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Ce,ve){var Se=Ce.getWordUntilPosition(ve),Ae={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:Se.startColumn,endColumn:Se.endColumn},Oe=Ce.getLineContent(ve.lineNumber).substring(Se.startColumn-2,Se.endColumn);return{suggestions:[].concat(Object(J.a)(l.keywords.map(function(he){return{label:he,kind:g.languages.CompletionItemKind.Function,documentation:he,insertText:he,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})),Object(J.a)(l.quickKey.map(function(he){return{label:he.label,kind:g.languages.CompletionItemKind.Function,documentation:he.content,insertText:Oe.startsWith("#")?he.content.replace(/#/,""):he.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})))}}}),g.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Ce,ve){var Se=Ce.getWordUntilPosition(ve),Ae={startLineNumber:ve.lineNumber,endLineNumber:ve.lineNumber,startColumn:Se.startColumn,endColumn:Se.endColumn},Oe=Ce.getLineContent(ve.lineNumber).substring(Se.startColumn-2,Se.endColumn);return{suggestions:[].concat(Object(J.a)(o.keywords.map(function(he){return{label:he,kind:g.languages.CompletionItemKind.Function,documentation:he,insertText:he,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})),Object(J.a)(o.quickKey.map(function(he){return{label:he.label,kind:g.languages.CompletionItemKind.Function,documentation:he.content,insertText:Oe.startsWith("#")?he.content.replace(/#/,""):he.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})))}}})},A="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",S=Z("fjLI"),T=Z("LvDl"),c=Z("+ua5");function w(g){return/^\d+$/.test(g)?"".concat(g,"px"):g}function y(){}var b=!1,U={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function F(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],H=g;if(Array.isArray(g)){for(var $=0;$0||cr.target.offsetWidth>0)&&He.current.instance.layout()}}catch(Pt){Ft.e(Pt)}finally{Ft.f()}}),bt.observe(Ue.current)),bt}function ze(){X.b.warn(decodeURIComponent(A))}var st=function(){var xt=He.current.instance;if(Ce!=null&&xt&&ge){var Ft=xt.getModel();Ft&&Ce!==Ft.getValue()&&(b=!0,Ft.setValue(Ce),xt.layout(),b=!1)}};Object(G.useEffect)(function(){me.current&&clearTimeout(me.current),me.current=setTimeout(function(){st()},500)},[Ce,ge,He.current]),Object(G.useEffect)(function(){if(tt&&He.current&&He.current.instance){var bt=He.current.instance;bt.changeViewZones(function(Ft){var tr=document.createElement("div");tr.style.padding="10px 20px",tr.style.width="calc(100% - 20px)",tr.className="my-error-line-wrp",tr.innerHTML=ut,Ft.addZone({afterLineNumber:tt||11,heightInLines:3,domNode:tr})});var xt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};bt.addOverlayWidget(xt),bt.revealPositionInCenter({lineNumber:20,column:1})}},[tt,He.current,ge]);function mt(){var bt=He.current.instance;if(bt){var xt=bt.getSelection(),Ft=He.current.pastePos||{},tr=new E.Range(Ft.startLineNumber||xt.endLineNumber,Ft.startColumn||xt.endColumn,Ft.endLineNumber||xt.endLineNumber,Ft.endColumn||xt.endColumn);setTimeout(function(){bt.executeEdits("",[{range:tr,text:""}])},300)}}function ft(bt){(window.navigator.platform.match("Mac")?bt.metaKey:bt.ctrlKey)&&bt.keyCode==83&&(bt.preventDefault(),Re())}var wt=function(){if(je&&He.current.instance){var xt=He.current.instance.getContentHeight();yt(xt0||Ge.target.offsetWidth>0)&&je.layout()}}catch(Xe){Le.e(Xe)}finally{Le.f()}}),ue.observe(he.current)),ue}Object(G.useEffect)(function(){he.current&&Promise.all([Z.e(16),Z.e(28)]).then(Z.t.bind(null,"M/lh",7)).then(function(je){E=je;var ue=E.editor.createDiffEditor(he.current,Object(ne.a)(Object(ne.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Oe),{},{wordWrap:!0}));se(ue);var Ee=ke(ue);return function(){ue.dispose();var Le=ue.getModel();Le&&Le.dispose(),Ee.unobserve(he.current)}})},[]),Object(G.useEffect)(function(){fe&&fe.setModel({original:E.editor.createModel(Ce,Se),modified:E.editor.createModel(ve,Se)})},[Ce,ve,Se,fe]);var Ne=w($),Re=w(oe),Pe={width:Ne,height:Re};return r.a.createElement("div",{className:"my-diff-editor",ref:he,style:Pe})}},ZpRC:function(nt,xe,Z){"use strict";function ne(v){return typeof v=="object"&&v!=null&&v.nodeType===1}function J(v,m){return(!m||v!=="hidden")&&v!=="visible"&&v!=="clip"}function P(v,m){if(v.clientHeightm||f>v&&o=m&&u>=p?f-v-h:o>m&&up?o-m+l:0}var j=function(v,m){var p=window,h=m.scrollMode,l=m.block,f=m.inline,o=m.boundary,u=m.skipOverflowHiddenElements,a=typeof o=="function"?o:function(je){return je!==o};if(!ne(v))throw new TypeError("Invalid target");for(var s=document.scrollingElement||document.documentElement,R=[],_=v;ne(_)&&a(_);){if((_=_.parentElement)===s){R.push(_);break}_!=null&&_===document.body&&P(_)&&!P(document.documentElement)||_!=null&&P(_,u)&&R.push(_)}for(var C=p.visualViewport?p.visualViewport.width:innerWidth,D=p.visualViewport?p.visualViewport.height:innerHeight,O=window.scrollX||pageXOffset,A=window.scrollY||pageYOffset,S=v.getBoundingClientRect(),T=S.height,c=S.width,w=S.top,y=S.right,b=S.bottom,U=S.left,F=l==="start"||l==="nearest"?w:l==="end"?b:w+T/2,E=f==="center"?U+c/2:f==="end"?y:U,N=[],I=0;I=0&&U>=0&&b<=D&&y<=C&&w>=oe&&b<=ve&&U>=Se&&y<=Ce)return N;var Ae=getComputedStyle(g),Oe=parseInt(Ae.borderLeftWidth,10),he=parseInt(Ae.borderTopWidth,10),ce=parseInt(Ae.borderRightWidth,10),re=parseInt(Ae.borderBottomWidth,10),fe=0,se=0,ke="offsetWidth"in g?g.offsetWidth-g.clientWidth-Oe-ce:0,Ne="offsetHeight"in g?g.offsetHeight-g.clientHeight-he-re:0;if(s===g)fe=l==="start"?F:l==="end"?F-D:l==="nearest"?X(A,A+D,D,he,re,A+F,A+F+T,T):F-D/2,se=f==="start"?E:f==="center"?E-C/2:f==="end"?E-C:X(O,O+C,C,Oe,ce,O+E,O+E+c,c),fe=Math.max(0,fe+A),se=Math.max(0,se+O);else{fe=l==="start"?F-oe-he:l==="end"?F-ve+re+Ne:l==="nearest"?X(oe,ve,$,he,re+Ne,F,F+T,T):F-(oe+$/2)+Ne/2,se=f==="start"?E-Se-Oe:f==="center"?E-(Se+ie/2)+ke/2:f==="end"?E-Ce+ce+ke:X(Se,Ce,ie,Oe,ce+ke,E,E+c,c);var Re=g.scrollLeft,Pe=g.scrollTop;F+=Pe-(fe=Math.max(0,Math.min(Pe+fe,g.scrollHeight-$+Ne))),E+=Re-(se=Math.max(0,Math.min(Re+se,g.scrollWidth-ie+ke)))}N.push({el:g,top:fe,left:se})}return N};function B(v){return v===Object(v)&&Object.keys(v).length!==0}function K(v,m){m===void 0&&(m="auto");var p="scrollBehavior"in document.body.style;v.forEach(function(h){var l=h.el,f=h.top,o=h.left;l.scroll&&p?l.scroll({top:f,left:o,behavior:m}):(l.scrollTop=f,l.scrollLeft=o)})}function G(v){return v===!1?{block:"end",inline:"nearest"}:B(v)?v:{block:"start",inline:"nearest"}}function r(v,m){var p=!v.ownerDocument.documentElement.contains(v);if(B(m)&&typeof m.behavior=="function")return m.behavior(p?[]:j(v,m));if(p)return;var h=G(m);return K(j(v,h),h.behavior)}var L=xe.a=r},Zss7:function(nt,xe,Z){var ne;(function(J){var P=/^\s+/,X=/\s+$/,j=0,B=J.round,K=J.min,G=J.max,r=J.random;function L(re,fe){if(re=re||"",fe=fe||{},re instanceof L)return re;if(!(this instanceof L))return new L(re,fe);var se=v(re);this._originalInput=re,this._r=se.r,this._g=se.g,this._b=se.b,this._a=se.a,this._roundA=B(100*this._a)/100,this._format=fe.format||se.format,this._gradientType=fe.gradientType,this._r<1&&(this._r=B(this._r)),this._g<1&&(this._g=B(this._g)),this._b<1&&(this._b=B(this._b)),this._ok=se.ok,this._tc_id=j++}L.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var re=this.toRgb();return(re.r*299+re.g*587+re.b*114)/1e3},getLuminance:function(){var re=this.toRgb(),fe,se,ke,Ne,Re,Pe;return fe=re.r/255,se=re.g/255,ke=re.b/255,fe<=.03928?Ne=fe/12.92:Ne=J.pow((fe+.055)/1.055,2.4),se<=.03928?Re=se/12.92:Re=J.pow((se+.055)/1.055,2.4),ke<=.03928?Pe=ke/12.92:Pe=J.pow((ke+.055)/1.055,2.4),.2126*Ne+.7152*Re+.0722*Pe},setAlpha:function(re){return this._a=N(re),this._roundA=B(100*this._a)/100,this},toHsv:function(){var re=l(this._r,this._g,this._b);return{h:re.h*360,s:re.s,v:re.v,a:this._a}},toHsvString:function(){var re=l(this._r,this._g,this._b),fe=B(re.h*360),se=B(re.s*100),ke=B(re.v*100);return this._a==1?"hsv("+fe+", "+se+"%, "+ke+"%)":"hsva("+fe+", "+se+"%, "+ke+"%, "+this._roundA+")"},toHsl:function(){var re=p(this._r,this._g,this._b);return{h:re.h*360,s:re.s,l:re.l,a:this._a}},toHslString:function(){var re=p(this._r,this._g,this._b),fe=B(re.h*360),se=B(re.s*100),ke=B(re.l*100);return this._a==1?"hsl("+fe+", "+se+"%, "+ke+"%)":"hsla("+fe+", "+se+"%, "+ke+"%, "+this._roundA+")"},toHex:function(re){return o(this._r,this._g,this._b,re)},toHexString:function(re){return"#"+this.toHex(re)},toHex8:function(re){return u(this._r,this._g,this._b,this._a,re)},toHex8String:function(re){return"#"+this.toHex8(re)},toRgb:function(){return{r:B(this._r),g:B(this._g),b:B(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+B(this._r)+", "+B(this._g)+", "+B(this._b)+")":"rgba("+B(this._r)+", "+B(this._g)+", "+B(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:B(I(this._r,255)*100)+"%",g:B(I(this._g,255)*100)+"%",b:B(I(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+B(I(this._r,255)*100)+"%, "+B(I(this._g,255)*100)+"%, "+B(I(this._b,255)*100)+"%)":"rgba("+B(I(this._r,255)*100)+"%, "+B(I(this._g,255)*100)+"%, "+B(I(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:F[o(this._r,this._g,this._b,!0)]||!1},toFilter:function(re){var fe="#"+a(this._r,this._g,this._b,this._a),se=fe,ke=this._gradientType?"GradientType = 1, ":"";if(re){var Ne=L(re);se="#"+a(Ne._r,Ne._g,Ne._b,Ne._a)}return"progid:DXImageTransform.Microsoft.gradient("+ke+"startColorstr="+fe+",endColorstr="+se+")"},toString:function(re){var fe=!!re;re=re||this._format;var se=!1,ke=this._a<1&&this._a>=0,Ne=!fe&&ke&&(re==="hex"||re==="hex6"||re==="hex3"||re==="hex4"||re==="hex8"||re==="name");return Ne?re==="name"&&this._a===0?this.toName():this.toRgbString():(re==="rgb"&&(se=this.toRgbString()),re==="prgb"&&(se=this.toPercentageRgbString()),(re==="hex"||re==="hex6")&&(se=this.toHexString()),re==="hex3"&&(se=this.toHexString(!0)),re==="hex4"&&(se=this.toHex8String(!0)),re==="hex8"&&(se=this.toHex8String()),re==="name"&&(se=this.toName()),re==="hsl"&&(se=this.toHslString()),re==="hsv"&&(se=this.toHsvString()),se||this.toHexString())},clone:function(){return L(this.toString())},_applyModification:function(re,fe){var se=re.apply(null,[this].concat([].slice.call(fe)));return this._r=se._r,this._g=se._g,this._b=se._b,this.setAlpha(se._a),this},lighten:function(){return this._applyModification(C,arguments)},brighten:function(){return this._applyModification(D,arguments)},darken:function(){return this._applyModification(O,arguments)},desaturate:function(){return this._applyModification(s,arguments)},saturate:function(){return this._applyModification(R,arguments)},greyscale:function(){return this._applyModification(_,arguments)},spin:function(){return this._applyModification(A,arguments)},_applyCombination:function(re,fe){return re.apply(null,[this].concat([].slice.call(fe)))},analogous:function(){return this._applyCombination(y,arguments)},complement:function(){return this._applyCombination(S,arguments)},monochromatic:function(){return this._applyCombination(b,arguments)},splitcomplement:function(){return this._applyCombination(w,arguments)},triad:function(){return this._applyCombination(T,arguments)},tetrad:function(){return this._applyCombination(c,arguments)}},L.fromRatio=function(re,fe){if(typeof re=="object"){var se={};for(var ke in re)re.hasOwnProperty(ke)&&(ke==="a"?se[ke]=re[ke]:se[ke]=Ce(re[ke]));re=se}return L(re,fe)};function v(re){var fe={r:0,g:0,b:0},se=1,ke=null,Ne=null,Re=null,Pe=!1,je=!1;return typeof re=="string"&&(re=he(re)),typeof re=="object"&&(Oe(re.r)&&Oe(re.g)&&Oe(re.b)?(fe=m(re.r,re.g,re.b),Pe=!0,je=String(re.r).substr(-1)==="%"?"prgb":"rgb"):Oe(re.h)&&Oe(re.s)&&Oe(re.v)?(ke=Ce(re.s),Ne=Ce(re.v),fe=f(re.h,ke,Ne),Pe=!0,je="hsv"):Oe(re.h)&&Oe(re.s)&&Oe(re.l)&&(ke=Ce(re.s),Re=Ce(re.l),fe=h(re.h,ke,Re),Pe=!0,je="hsl"),re.hasOwnProperty("a")&&(se=re.a)),se=N(se),{ok:Pe,format:re.format||je,r:K(255,G(fe.r,0)),g:K(255,G(fe.g,0)),b:K(255,G(fe.b,0)),a:se}}function m(re,fe,se){return{r:I(re,255)*255,g:I(fe,255)*255,b:I(se,255)*255}}function p(re,fe,se){re=I(re,255),fe=I(fe,255),se=I(se,255);var ke=G(re,fe,se),Ne=K(re,fe,se),Re,Pe,je=(ke+Ne)/2;if(ke==Ne)Re=Pe=0;else{var ue=ke-Ne;Pe=je>.5?ue/(2-ke-Ne):ue/(ke+Ne);switch(ke){case re:Re=(fe-se)/ue+(fe1&&(Ie-=1),Ie<1/6?Ee+(Le-Ee)*6*Ie:Ie<1/2?Le:Ie<2/3?Ee+(Le-Ee)*(2/3-Ie)*6:Ee}if(fe===0)ke=Ne=Re=se;else{var je=se<.5?se*(1+fe):se+fe-se*fe,ue=2*se-je;ke=Pe(ue,je,re+1/3),Ne=Pe(ue,je,re),Re=Pe(ue,je,re-1/3)}return{r:ke*255,g:Ne*255,b:Re*255}}function l(re,fe,se){re=I(re,255),fe=I(fe,255),se=I(se,255);var ke=G(re,fe,se),Ne=K(re,fe,se),Re,Pe,je=ke,ue=ke-Ne;if(Pe=ke===0?0:ue/ke,ke==Ne)Re=0;else{switch(ke){case re:Re=(fe-se)/ue+(fe>1)+720)%360;--fe;)ke.h=(ke.h+Ne)%360,Re.push(L(ke));return Re}function b(re,fe){fe=fe||6;for(var se=L(re).toHsv(),ke=se.h,Ne=se.s,Re=se.v,Pe=[],je=1/fe;fe--;)Pe.push(L({h:ke,s:Ne,v:Re})),Re=(Re+je)%1;return Pe}L.mix=function(re,fe,se){se=se===0?0:se||50;var ke=L(re).toRgb(),Ne=L(fe).toRgb(),Re=se/100,Pe={r:(Ne.r-ke.r)*Re+ke.r,g:(Ne.g-ke.g)*Re+ke.g,b:(Ne.b-ke.b)*Re+ke.b,a:(Ne.a-ke.a)*Re+ke.a};return L(Pe)},L.readability=function(re,fe){var se=L(re),ke=L(fe);return(J.max(se.getLuminance(),ke.getLuminance())+.05)/(J.min(se.getLuminance(),ke.getLuminance())+.05)},L.isReadable=function(re,fe,se){var ke=L.readability(re,fe),Ne,Re;Re=!1,Ne=ce(se);switch(Ne.level+Ne.size){case"AAsmall":case"AAAlarge":Re=ke>=4.5;break;case"AAlarge":Re=ke>=3;break;case"AAAsmall":Re=ke>=7;break}return Re},L.mostReadable=function(re,fe,se){var ke=null,Ne=0,Re,Pe,je,ue;se=se||{},Pe=se.includeFallbackColors,je=se.level,ue=se.size;for(var Ee=0;EeNe&&(Ne=Re,ke=L(fe[Ee]));return L.isReadable(re,ke,{level:je,size:ue})||!Pe?ke:(se.includeFallbackColors=!1,L.mostReadable(re,["#fff","#000"],se))};var U=L.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},F=L.hexNames=E(U);function E(re){var fe={};for(var se in re)re.hasOwnProperty(se)&&(fe[re[se]]=se);return fe}function N(re){return re=parseFloat(re),(isNaN(re)||re<0||re>1)&&(re=1),re}function I(re,fe){$(re)&&(re="100%");var se=ie(re);return re=K(fe,G(0,parseFloat(re))),se&&(re=parseInt(re*fe,10)/100),J.abs(re-fe)<1e-6?1:re%fe/parseFloat(fe)}function g(re){return K(1,G(0,re))}function H(re){return parseInt(re,16)}function $(re){return typeof re=="string"&&re.indexOf(".")!=-1&&parseFloat(re)===1}function ie(re){return typeof re=="string"&&re.indexOf("%")!=-1}function oe(re){return re.length==1?"0"+re:""+re}function Ce(re){return re<=1&&(re=re*100+"%"),re}function ve(re){return J.round(parseFloat(re)*255).toString(16)}function Se(re){return H(re)/255}var Ae=function(){var re="[-\\+]?\\d+%?",fe="[-\\+]?\\d*\\.\\d+%?",se="(?:"+fe+")|(?:"+re+")",ke="[\\s|\\(]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")\\s*\\)?",Ne="[\\s|\\(]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")\\s*\\)?";return{CSS_UNIT:new RegExp(se),rgb:new RegExp("rgb"+ke),rgba:new RegExp("rgba"+Ne),hsl:new RegExp("hsl"+ke),hsla:new RegExp("hsla"+Ne),hsv:new RegExp("hsv"+ke),hsva:new RegExp("hsva"+Ne),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Oe(re){return!!Ae.CSS_UNIT.exec(re)}function he(re){re=re.replace(P,"").replace(X,"").toLowerCase();var fe=!1;if(U[re])re=U[re],fe=!0;else if(re=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var se;return(se=Ae.rgb.exec(re))?{r:se[1],g:se[2],b:se[3]}:(se=Ae.rgba.exec(re))?{r:se[1],g:se[2],b:se[3],a:se[4]}:(se=Ae.hsl.exec(re))?{h:se[1],s:se[2],l:se[3]}:(se=Ae.hsla.exec(re))?{h:se[1],s:se[2],l:se[3],a:se[4]}:(se=Ae.hsv.exec(re))?{h:se[1],s:se[2],v:se[3]}:(se=Ae.hsva.exec(re))?{h:se[1],s:se[2],v:se[3],a:se[4]}:(se=Ae.hex8.exec(re))?{r:H(se[1]),g:H(se[2]),b:H(se[3]),a:Se(se[4]),format:fe?"name":"hex8"}:(se=Ae.hex6.exec(re))?{r:H(se[1]),g:H(se[2]),b:H(se[3]),format:fe?"name":"hex"}:(se=Ae.hex4.exec(re))?{r:H(se[1]+""+se[1]),g:H(se[2]+""+se[2]),b:H(se[3]+""+se[3]),a:Se(se[4]+""+se[4]),format:fe?"name":"hex8"}:(se=Ae.hex3.exec(re))?{r:H(se[1]+""+se[1]),g:H(se[2]+""+se[2]),b:H(se[3]+""+se[3]),format:fe?"name":"hex"}:!1}function ce(re){var fe,se;return re=re||{level:"AA",size:"small"},fe=(re.level||"AA").toUpperCase(),se=(re.size||"small").toLowerCase(),fe!=="AA"&&fe!=="AAA"&&(fe="AA"),se!=="small"&&se!=="large"&&(se="small"),{level:fe,size:se}}nt.exports?nt.exports=L:!(ne=function(){return L}.call(xe,Z,xe,nt),ne!==void 0&&(nt.exports=ne))})(Math)},bT9E:function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return J});var ne=Z("VTBJ");function J(P,X){var j=Object(ne.a)({},P);return Array.isArray(X)&&X.forEach(function(B){delete j[B]}),j}},c5Ni:function(nt,xe,Z){},dejd:function(nt,xe,Z){},dmUQ:function(nt,xe,Z){"use strict";var ne=Z("Ff2n"),J=Z("rePB"),P=Z("1OyB"),X=Z("vuIU"),j=Z("Ji7U"),B=Z("md7G"),K=Z("foSv"),G=Z("q1tI"),r=Z.n(G),L=Z("TSYQ"),v=Z.n(L),m=Z("4IlW");function p(T,c){var w=Object.keys(T);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(T);c&&(y=y.filter(function(b){return Object.getOwnPropertyDescriptor(T,b).enumerable})),w.push.apply(w,y)}return w}function h(T){for(var c=1;c1?ie-1:0),Ce=1;Ce1?I-1:0),H=1;H=0)return parseInt(N.slice(N.indexOf("e-")+2),10);var I=0;return N.indexOf(".")>=0&&(I=N.length-N.indexOf(".")-1),I},b.getInputDisplayValue=function(E){var N=E||b.state,I=N.focused,g=N.inputValue,H=N.value,$;I?$=g:$=b.toPrecisionAsStep(H),$==null&&($="");var ie=b.formatWrapper($);return C(b.props.decimalSeparator)&&(ie=ie.toString().replace(".",b.props.decimalSeparator)),ie},b.recordCursorPosition=function(){try{b.cursorStart=b.input.selectionStart,b.cursorEnd=b.input.selectionEnd,b.currentValue=b.input.value,b.cursorBefore=b.input.value.substring(0,b.cursorStart),b.cursorAfter=b.input.value.substring(b.cursorEnd)}catch(E){}},b.restoreByAfter=function(E){if(E===void 0)return!1;var N=b.input.value,I=N.lastIndexOf(E);if(I===-1)return!1;var g=b.cursorBefore.length;return b.lastKeyCode===m.a.DELETE&&b.cursorBefore.charAt(g-1)===E[0]?(b.fixCaret(g,g),!0):I+E.length===N.length?(b.fixCaret(I,I),!0):!1},b.partRestoreByAfter=function(E){return E===void 0?!1:Array.prototype.some.call(E,function(N,I){var g=E.substring(I);return b.restoreByAfter(g)})},b.isNotCompleteNumber=function(E){return isNaN(E)||E===""||E===null||E&&E.toString().indexOf(".")===E.toString().length-1},b.stop=function(){b.autoStepTimer&&clearTimeout(b.autoStepTimer)},b.down=function(E,N,I){b.pressingUpOrDown=!0,b.step("down",E,N,I)},b.up=function(E,N,I){b.pressingUpOrDown=!0,b.step("up",E,N,I)},b.saveInput=function(E){b.input=E};var U=y.value;U===void 0&&(U=y.defaultValue),b.state={focused:y.autoFocus};var F=b.getValidValue(b.toNumber(U));return b.state=h(h({},b.state),{},{inputValue:b.toPrecisionAsStep(F),value:F}),b}return Object(X.a)(w,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(b){var U=this.props,F=U.value,E=U.onChange,N=U.max,I=U.min,g=this.state.focused;if(b){if(!D(b.value,F)||!D(b.max,N)||!D(b.min,I)){var H=g?F:this.getValidValue(F),$;this.pressingUpOrDown?$=H:this.inputting?$=this.rawInput:$=this.toPrecisionAsStep(H),this.setState({value:H,inputValue:$})}var ie="value"in this.props?F:this.state.value;"max"in this.props&&b.max!==N&&typeof ie=="number"&&ie>N&&E&&E(N),"min"in this.props&&b.min!==I&&typeof ie=="number"&&ie1&&arguments[1]!==void 0?arguments[1]:this.props.min,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,E=parseFloat(b);return isNaN(E)?b:(EF&&(E=F),E)}},{key:"setValue",value:function(b,U){var F=this.props.precision,E=this.isNotCompleteNumber(parseFloat(b))?null:parseFloat(b),N=this.state.value,I=N===void 0?null:N,g=this.state.inputValue,H=g===void 0?null:g,$=typeof E=="number"?E.toFixed(F):"".concat(E),ie=E!==I||$!=="".concat(H);return"value"in this.props?(H=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:H},U)):this.setState({value:E,inputValue:this.toPrecisionAsStep(b)},U),ie&&this.props.onChange(E),E}},{key:"getMaxPrecision",value:function(b){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,E=F.precision,N=F.step;if(C(E))return E;var I=this.getPrecision(U),g=this.getPrecision(N),H=this.getPrecision(b);return b?Math.max(H,I+g):I+g}},{key:"getPrecisionFactor",value:function(b){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(b,U);return Math.pow(10,F)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(b){return this.props.formatter?this.props.formatter(b):b}},{key:"toPrecisionAsStep",value:function(b){if(this.isNotCompleteNumber(b)||b==="")return b;var U=Math.abs(this.getMaxPrecision(b));return isNaN(U)?b.toString():Number(b).toFixed(U)}},{key:"toNumber",value:function(b){var U=this.props.precision,F=this.state.focused,E=b&&b.length>16&&F;return this.isNotCompleteNumber(b)||E?b:C(U)?Math.round(b*Math.pow(10,U))/Math.pow(10,U):Number(b)}},{key:"upStep",value:function(b,U){var F=this.props.step,E=this.getPrecisionFactor(b,U),N=Math.abs(this.getMaxPrecision(b,U)),I=((E*b+E*F*U)/E).toFixed(N);return this.toNumber(I)}},{key:"downStep",value:function(b,U){var F=this.props.step,E=this.getPrecisionFactor(b,U),N=Math.abs(this.getMaxPrecision(b,U)),I=((E*b-E*F*U)/E).toFixed(N);return this.toNumber(I)}},{key:"step",value:function(b,U){var F=this,E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,N=arguments.length>3?arguments[3]:void 0;this.stop(),U&&(U.persist(),U.preventDefault());var I=this.props;if(I.disabled)return;var g=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(g))return;var H=this["".concat(b,"Step")](g,E),$=H>I.max||HI.max?H=I.max:H=oe),He=(at||at===0)&&(isNaN(at)||Number(at)<=Ce),Te=Ue||E||N,me=He||E||N,be=v()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object(J.a)({},"".concat(F,"-handler-up-disabled"),Te)),ae=v()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object(J.a)({},"".concat(F,"-handler-down-disabled"),me)),le=I?{onTouchStart:Te?o:this.up,onTouchEnd:this.stop}:{onMouseDown:Te?o:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},de=I?{onTouchStart:me?o:this.down,onTouchEnd:this.stop}:{onMouseDown:me?o:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return r.a.createElement("div",{className:tt,style:ve,title:Se,onMouseEnter:Ae,onMouseLeave:Oe,onMouseOver:he,onMouseOut:ce,onFocus:function(){return null},onBlur:function(){return null}},r.a.createElement("div",{className:"".concat(F,"-handler-wrap")},r.a.createElement("span",Object.assign({unselectable:"on"},le,{role:"button","aria-label":"Increase Value","aria-disabled":Te,className:be}),H||r.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:u})),r.a.createElement("span",Object.assign({unselectable:"on"},de,{role:"button","aria-label":"Decrease Value","aria-disabled":me,className:ae}),$||r.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-down-inner"),onClick:u}))),r.a.createElement("div",{className:"".concat(F,"-input-wrap")},r.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ce,"aria-valuemax":oe,"aria-valuenow":at,required:re,type:ke,placeholder:Ne,onPaste:Ge,onClick:fe,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:se,autoComplete:g,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:ut?this.onKeyDown:o,onKeyUp:ut?this.onKeyUp:o,autoFocus:Le,maxLength:Ee,readOnly:N,disabled:E,max:oe,min:Ce,step:ue,name:Ie,title:Se,id:Re,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ot),pattern:je,inputMode:Pe,onInput:Xe},Be))))}}]),w}(r.a.Component);O.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:_,min:-_,step:1,style:{},onChange:o,onKeyDown:o,onPressEnter:o,onFocus:o,onBlur:o,parser:a,required:!1,autoComplete:"off"};var A=O,S=xe.a=A},fjLI:function(nt,xe,Z){"use strict";Z.d(xe,"f",function(){return p}),Z.d(xe,"b",function(){return h}),Z.d(xe,"a",function(){return l}),Z.d(xe,"d",function(){return f}),Z.d(xe,"e",function(){return o}),Z.d(xe,"c",function(){return u});var ne=Z("8HAY"),J=Z("Vhoy"),P=Z("MI8n"),X=Z("JYp7"),j=Z("pmY6"),B=Z("24hK"),K=Z("nnTU"),G=Z("T8No"),r=Z("Cg/j"),L=Z("t9D7"),v=function(a,s,R,_){var C=arguments.length,D=C<3?s:_===null?_=Object.getOwnPropertyDescriptor(s,R):_,O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(a,s,R,_);else for(var A=a.length-1;A>=0;A--)(O=a[A])&&(D=(C<3?O(D):C>3?O(s,R,D):O(s,R))||D);return C>3&&D&&Object.defineProperty(s,R,D),D},m=function(a,s){return function(R,_){s(R,_,a)}};function p(a){return a.command!==void 0}class h{constructor(a){this.id=h._idPool++,this._debugName=a}}h._idPool=0,h.CommandPalette=new h("CommandPalette"),h.EditorContext=new h("EditorContext"),h.SimpleEditorContext=new h("SimpleEditorContext"),h.EditorContextCopy=new h("EditorContextCopy"),h.EditorContextPeek=new h("EditorContextPeek"),h.MenubarEditMenu=new h("MenubarEditMenu"),h.MenubarCopy=new h("MenubarCopy"),h.MenubarGoMenu=new h("MenubarGoMenu"),h.MenubarSelectionMenu=new h("MenubarSelectionMenu"),h.InlineCompletionsActions=new h("InlineCompletionsActions");const l=Object(r.c)("menuService"),f=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new P.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:a=>a===h.CommandPalette}}addCommand(a){return this.addCommands(X.a.single(a))}addCommands(a){for(const s of a)this._commands.set(s.id,s);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(j.i)(()=>{let s=!1;for(const R of a)s=this._commands.delete(R.id)||s;s&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(a){return this._commands.get(a)}getCommands(){const a=new Map;return this._commands.forEach((s,R)=>a.set(R,s)),a}appendMenuItem(a,s){return this.appendMenuItems(X.a.single({id:a,item:s}))}appendMenuItems(a){const s=new Set,R=new B.a;for(const{id:_,item:C}of a){let D=this._menuItems.get(_);D||(D=new B.a,this._menuItems.set(_,D)),R.push(D.push(C)),s.add(_)}return this._onDidChangeMenu.fire(s),Object(j.i)(()=>{if(R.size>0){for(let _ of R)_();this._onDidChangeMenu.fire(s),R.clear()}})}getMenuItems(a){let s;return this._menuItems.has(a)?s=[...this._menuItems.get(a)]:s=[],a===h.CommandPalette&&this._appendImplicitItems(s),s}_appendImplicitItems(a){const s=new Set;for(const R of a)p(R)&&(s.add(R.command.id),R.alt&&s.add(R.alt.id));this._commands.forEach((R,_)=>{s.has(_)||a.push({command:R})})}};class o extends ne.e{constructor(a,s,R,_){super(`submenuitem.${a.submenu.id}`,typeof a.title=="string"?a.title:a.title.value,[],"submenu");this.item=a,this._menuService=s,this._contextKeyService=R,this._options=_}get actions(){const a=[],s=this._menuService.createMenu(this.item.submenu,this._contextKeyService),R=s.getActions(this._options);s.dispose();for(const[,_]of R)_.length>0&&(a.push(..._),a.push(new ne.d));return a.length&&a.pop(),a}}let u=class a{constructor(s,R,_,C,D){var O,A;if(this._commandService=D,this.id=s.id,this.label=(_==null?void 0:_.renderShortTitle)&&s.shortTitle?typeof s.shortTitle=="string"?s.shortTitle:s.shortTitle.value:typeof s.title=="string"?s.title:s.title.value,this.tooltip=(A=typeof s.tooltip=="string"?s.tooltip:(O=s.tooltip)===null||O===void 0?void 0:O.value)!==null&&A!==void 0?A:"",this.enabled=!s.precondition||C.contextMatchesRules(s.precondition),this.checked=void 0,s.toggled){const S=s.toggled.condition?s.toggled:{condition:s.toggled};this.checked=C.contextMatchesRules(S.condition),this.checked&&S.tooltip&&(this.tooltip=typeof S.tooltip=="string"?S.tooltip:S.tooltip.value),S.title&&(this.label=typeof S.title=="string"?S.title:S.title.value)}this.item=s,this.alt=R?new a(R,void 0,_,C,D):void 0,this._options=_,L.d.isThemeIcon(s.icon)&&(this.class=J.a.asClassName(s.icon))}dispose(){}run(...s){var R,_;let C=[];return((R=this._options)===null||R===void 0?void 0:R.arg)&&(C=[...C,this._options.arg]),((_=this._options)===null||_===void 0?void 0:_.shouldForwardArgs)&&(C=[...C,...s]),this._commandService.executeCommand(this.id,...C)}};u=v([m(3,G.b),m(4,K.b)],u)},h78n:function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return b});var ne=Z("q1tI"),J=Z.n(ne),P=Z("TSYQ"),X=Z.n(P),j={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},B=function(E){var N=E.map(function(){return Object(ne.useRef)()}),I=Object(ne.useRef)();return Object(ne.useEffect)(function(){var g=Date.now(),H=!1;Object.keys(N).forEach(function($){var ie=N[$].current;if(!ie)return;H=!0;var oe=ie.style;oe.transitionDuration=".3s, .3s, .3s, .06s",I.current&&g-I.current<100&&(oe.transitionDuration="0s, 0s")}),H&&(I.current=Date.now())}),[N]};function K(){return K=Object.assign||function(F){for(var E=1;EF.length)&&(E=F.length);for(var N=0,I=new Array(E);N=0)continue;if(!Object.prototype.propertyIsEnumerable.call(F,I))continue;N[I]=F[I]}}return N}function l(F,E){if(F==null)return{};var N={},I=Object.keys(F),g,H;for(H=0;H=0)continue;N[g]=F[g]}return N}var f=function(E){var N=E.className,I=E.percent,g=E.prefixCls,H=E.strokeColor,$=E.strokeLinecap,ie=E.strokeWidth,oe=E.style,Ce=E.trailColor,ve=E.trailWidth,Se=E.transition,Ae=h(E,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Ae.gapPosition;var Oe=Array.isArray(I)?I:[I],he=Array.isArray(H)?H:[H],ce=B(Oe),re=G(ce,1),fe=re[0],se=ie/2,ke=100-ie/2,Ne="M ".concat($==="round"?se:0,",").concat(se,` L `).concat($==="round"?ke:100,",").concat(se),Re="0 0 100 ".concat(ie),Pe=0;return J.a.createElement("svg",K({className:X()("".concat(g,"-line"),N),viewBox:Re,preserveAspectRatio:"none",style:oe},Ae),J.a.createElement("path",{className:"".concat(g,"-line-trail"),d:Ne,strokeLinecap:$,stroke:Ce,strokeWidth:ve||ie,fillOpacity:"0"}),Oe.map(function(je,ue){var Ee={strokeDasharray:"".concat(je,"px, 100px"),strokeDashoffset:"-".concat(Pe,"px"),transition:Se||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Le=he[ue]||he[he.length-1];return Pe+=je,J.a.createElement("path",{key:ue,className:"".concat(g,"-line-path"),d:Ne,strokeLinecap:$,stroke:Le,strokeWidth:ie,fillOpacity:"0",ref:fe[ue],style:Ee})}))};f.defaultProps=j;var o=f;function u(){return u=Object.assign||function(F){for(var E=1;EF.length)&&(E=F.length);for(var N=0,I=new Array(E);N=0)continue;if(!Object.prototype.propertyIsEnumerable.call(F,I))continue;N[I]=F[I]}}return N}function A(F,E){if(F==null)return{};var N={},I=Object.keys(F),g,H;for(H=0;H=0)continue;N[g]=F[g]}return N}var S=0;function T(F){return+F.replace("%","")}function c(F){return Array.isArray(F)?F:[F]}function w(F,E,N,I){var g=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,H=arguments.length>5?arguments[5]:void 0,$=50-I/2,ie=0,oe=-$,Ce=0,ve=-2*$;switch(H){case"left":ie=-$,oe=0,Ce=2*$,ve=0;break;case"right":ie=$,oe=0,Ce=-2*$,ve=0;break;case"bottom":oe=$,ve=2*$;break;default:}var Se="M 50,50 m ".concat(ie,",").concat(oe,` a `).concat($,",").concat($," 0 1 1 ").concat(Ce,",").concat(-ve,` a `).concat($,",").concat($," 0 1 1 ").concat(-Ce,",").concat(ve),Ae=Math.PI*2*$,Oe={stroke:N,strokeDasharray:"".concat(E/100*(Ae-g),"px ").concat(Ae,"px"),strokeDashoffset:"-".concat(g/2+F/100*(Ae-g),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Se,pathStyle:Oe}}var y=function(E){var N=E.prefixCls,I=E.strokeWidth,g=E.trailWidth,H=E.gapDegree,$=E.gapPosition,ie=E.trailColor,oe=E.strokeLinecap,Ce=E.style,ve=E.className,Se=E.strokeColor,Ae=E.percent,Oe=O(E,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),he=Object(ne.useMemo)(function(){return S+=1,S},[]),ce=w(0,100,ie,I,H,$),re=ce.pathString,fe=ce.pathStyle,se=c(Ae),ke=c(Se),Ne=ke.find(function(Ee){return Object.prototype.toString.call(Ee)==="[object Object]"}),Re=B(se),Pe=a(Re,1),je=Pe[0],ue=function(){var Le=0;return se.map(function(Ie,Ge){var Xe=ke[Ge]||ke[ke.length-1],Je=Object.prototype.toString.call(Xe)==="[object Object]"?"url(#".concat(N,"-gradient-").concat(he,")"):"",Qe=w(Le,Ie,Xe,I,H,$);return Le+=Ie,J.a.createElement("path",{key:Ge,className:"".concat(N,"-circle-path"),d:Qe.pathString,stroke:Je,strokeLinecap:oe,strokeWidth:I,opacity:Ie===0?0:1,fillOpacity:"0",style:Qe.pathStyle,ref:je[Ge]})})};return J.a.createElement("svg",u({className:X()("".concat(N,"-circle"),ve),viewBox:"0 0 100 100",style:Ce},Oe),Ne&&J.a.createElement("defs",null,J.a.createElement("linearGradient",{id:"".concat(N,"-gradient-").concat(he),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Ne).sort(function(Ee,Le){return T(Ee)-T(Le)}).map(function(Ee,Le){return J.a.createElement("stop",{key:Le,offset:Ee,stopColor:Ne[Ee]})}))),J.a.createElement("path",{className:"".concat(N,"-circle-trail"),d:re,stroke:ie,strokeLinecap:oe,strokeWidth:g||I,fillOpacity:"0",style:fe}),ue().reverse())};y.defaultProps=j;var b=y,U={Line:o,Circle:b}},ic2d:function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return X});var ne=Z("FWmy"),J=Z("746U");class P{constructor(){this.data=new Map}add(j,B){ne.a(J.l(j)),ne.a(J.k(B)),ne.a(!this.data.has(j),"There is already an extension with this id"),this.data.set(j,B)}as(j){return this.data.get(j)||null}}const X=new P},kSUc:function(nt,xe,Z){},lZu9:function(nt,xe,Z){(function(ne){ne(Z("VrN/"),Z("1eCo"),Z("8EBN"))})(function(ne){"use strict";ne.defineMode("markdown",function(J,P){var X=ne.getMode(J,"text/html"),j=X.name=="null";function B(I){if(ne.findModeByName){var g=ne.findModeByName(I);g&&(I=g.mime||g.mimes[0])}var H=ne.getMode(J,I);return H.name=="null"?null:H}P.highlightFormatting===void 0&&(P.highlightFormatting=!1),P.maxBlockquoteDepth===void 0&&(P.maxBlockquoteDepth=0),P.taskLists===void 0&&(P.taskLists=!1),P.strikethrough===void 0&&(P.strikethrough=!1),P.emoji===void 0&&(P.emoji=!1),P.fencedCodeBlockHighlighting===void 0&&(P.fencedCodeBlockHighlighting=!0),P.fencedCodeBlockDefaultMode===void 0&&(P.fencedCodeBlockDefaultMode="text/plain"),P.xml===void 0&&(P.xml=!0),P.tokenTypeOverrides===void 0&&(P.tokenTypeOverrides={});var K={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var G in K)K.hasOwnProperty(G)&&P.tokenTypeOverrides[G]&&(K[G]=P.tokenTypeOverrides[G]);var r=/^([*\-_])(?:\s*\1){2,}\s*$/,L=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,v=/^\[(x| )\](?=\s)/i,m=P.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ {0,3}(?:\={1,}|-{2,})\s*$/,h=/^[^#!\[\]*_\\<>` "'(~:]+/,l=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,f=/^\s*\[[^\]]+?\]:.*$/,o=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,u=" ";function a(I,g,H){return g.f=g.inline=H,H(I,g)}function s(I,g,H){return g.f=g.block=H,H(I,g)}function R(I){return!I||!/\S/.test(I.string)}function _(I){if(I.linkTitle=!1,I.linkHref=!1,I.linkText=!1,I.em=!1,I.strong=!1,I.strikethrough=!1,I.quote=0,I.indentedCode=!1,I.f==D){var g=j;if(!g){var H=ne.innerMode(X,I.htmlState);g=H.mode.name=="xml"&&H.state.tagStart===null&&!H.state.context&&H.state.tokenize.isInText}g&&(I.f=T,I.block=C,I.htmlState=null)}return I.trailingSpace=0,I.trailingSpaceNewLine=!1,I.prevLine=I.thisLine,I.thisLine={stream:null},null}function C(I,g){var H=I.column()===g.indentation,$=R(g.prevLine.stream),ie=g.indentedCode,oe=g.prevLine.hr,Ce=g.list!==!1,ve=(g.listStack[g.listStack.length-1]||0)+3;g.indentedCode=!1;var Se=g.indentation;if(g.indentationDiff===null&&(g.indentationDiff=g.indentation,Ce)){for(g.list=null;Se=4&&(ie||g.prevLine.fencedCodeEnd||g.prevLine.header||$))return I.skipToEnd(),g.indentedCode=!0,K.code;if(I.eatSpace())return null;if(H&&g.indentation<=ve&&(he=I.match(m))&&he[1].length<=6)return g.quote=0,g.header=he[1].length,g.thisLine.header=!0,P.highlightFormatting&&(g.formatting="header"),g.f=g.inline,A(g);if(g.indentation<=ve&&I.eat(">"))return g.quote=H?1:g.quote+1,P.highlightFormatting&&(g.formatting="quote"),I.eatSpace(),A(g);if(!Oe&&!g.setext&&H&&g.indentation<=ve&&(he=I.match(L))){var ce=he[1]?"ol":"ul";return g.indentation=Se+I.current().length,g.list=!0,g.quote=0,g.listStack.push(g.indentation),g.em=!1,g.strong=!1,g.code=!1,g.strikethrough=!1,P.taskLists&&I.match(v,!1)&&(g.taskList=!0),g.f=g.inline,P.highlightFormatting&&(g.formatting=["list","list-"+ce]),A(g)}else{if(H&&g.indentation<=ve&&(he=I.match(l,!0)))return g.quote=0,g.fencedEndRE=new RegExp(he[1]+"+ *$"),g.localMode=P.fencedCodeBlockHighlighting&&B(he[2]||P.fencedCodeBlockDefaultMode),g.localMode&&(g.localState=ne.startState(g.localMode)),g.f=g.block=O,P.highlightFormatting&&(g.formatting="code-block"),g.code=-1,A(g);if(g.setext||(!Ae||!Ce)&&!g.quote&&g.list===!1&&!g.code&&!Oe&&!f.test(I.string)&&(he=I.lookAhead(1))&&(he=he.match(p)))return g.setext?(g.header=g.setext,g.setext=0,I.skipToEnd(),P.highlightFormatting&&(g.formatting="header")):(g.header=he[0].charAt(0)=="="?1:2,g.setext=g.header),g.thisLine.header=!0,g.f=g.inline,A(g);if(Oe)return I.skipToEnd(),g.hr=!0,g.thisLine.hr=!0,K.hr;if(I.peek()==="[")return a(I,g,U)}return a(I,g,g.inline)}function D(I,g){var H=X.token(I,g.htmlState);if(!j){var $=ne.innerMode(X,g.htmlState);($.mode.name=="xml"&&$.state.tagStart===null&&!$.state.context&&$.state.tokenize.isInText||g.md_inside&&I.current().indexOf(">")>-1)&&(g.f=T,g.block=C,g.htmlState=null)}return H}function O(I,g){var H=g.listStack[g.listStack.length-1]||0,$=g.indentation=I.quote?g.push(K.formatting+"-"+I.formatting[H]+"-"+I.quote):g.push("error"))}if(I.taskOpen)return g.push("meta"),g.length?g.join(" "):null;if(I.taskClosed)return g.push("property"),g.length?g.join(" "):null;if(I.linkHref?g.push(K.linkHref,"url"):(I.strong&&g.push(K.strong),I.em&&g.push(K.em),I.strikethrough&&g.push(K.strikethrough),I.emoji&&g.push(K.emoji),I.linkText&&g.push(K.linkText),I.code&&g.push(K.code),I.image&&g.push(K.image),I.imageAltText&&g.push(K.imageAltText,"link"),I.imageMarker&&g.push(K.imageMarker)),I.header&&g.push(K.header,K.header+"-"+I.header),I.quote&&(g.push(K.quote),!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=I.quote?g.push(K.quote+"-"+I.quote):g.push(K.quote+"-"+P.maxBlockquoteDepth)),I.list!==!1){var $=(I.listStack.length-1)%3;$?$===1?g.push(K.list2):g.push(K.list3):g.push(K.list1)}return I.trailingSpaceNewLine?g.push("trailing-space-new-line"):I.trailingSpace&&g.push("trailing-space-"+(I.trailingSpace%2?"a":"b")),g.length?g.join(" "):null}function S(I,g){return I.match(h,!0)?A(g):void 0}function T(I,g){var H=g.text(I,g);if(typeof H!="undefined")return H;if(g.list)return g.list=null,A(g);if(g.taskList){var $=I.match(v,!0)[1]===" ";return $?g.taskOpen=!0:g.taskClosed=!0,P.highlightFormatting&&(g.formatting="task"),g.taskList=!1,A(g)}if(g.taskOpen=!1,g.taskClosed=!1,g.header&&I.match(/^#+$/,!0))return P.highlightFormatting&&(g.formatting="header"),A(g);var ie=I.next();if(g.linkTitle){g.linkTitle=!1;var oe=ie;ie==="("&&(oe=")"),oe=(oe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ce="^\\s*(?:[^"+oe+"\\\\]+|\\\\\\\\|\\\\.)"+oe;if(I.match(new RegExp(Ce),!0))return K.linkHref}if(ie==="`"){var ve=g.formatting;P.highlightFormatting&&(g.formatting="code"),I.eatWhile("`");var Se=I.current().length;if(g.code==0&&(!g.quote||Se==1))return g.code=Se,A(g);if(Se==g.code){var Ae=A(g);return g.code=0,Ae}else return g.formatting=ve,A(g)}else if(g.code)return A(g);if(ie==="\\"&&(I.next(),P.highlightFormatting)){var Oe=A(g),he=K.formatting+"-escape";return Oe?Oe+" "+he:he}if(ie==="!"&&I.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return g.imageMarker=!0,g.image=!0,P.highlightFormatting&&(g.formatting="image"),A(g);if(ie==="["&&g.imageMarker&&I.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return g.imageMarker=!1,g.imageAltText=!0,P.highlightFormatting&&(g.formatting="image"),A(g);if(ie==="]"&&g.imageAltText){P.highlightFormatting&&(g.formatting="image");var Oe=A(g);return g.imageAltText=!1,g.image=!1,g.inline=g.f=w,Oe}if(ie==="["&&!g.image)return g.linkText&&I.match(/^.*?\]/)||(g.linkText=!0,P.highlightFormatting&&(g.formatting="link")),A(g);if(ie==="]"&&g.linkText){P.highlightFormatting&&(g.formatting="link");var Oe=A(g);return g.linkText=!1,g.inline=g.f=I.match(/\(.*?\)| ?\[.*?\]/,!1)?w:T,Oe}if(ie==="<"&&I.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=c,P.highlightFormatting&&(g.formatting="link");var Oe=A(g);return Oe?Oe+=" ":Oe="",Oe+K.linkInline}if(ie==="<"&&I.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=c,P.highlightFormatting&&(g.formatting="link");var Oe=A(g);return Oe?Oe+=" ":Oe="",Oe+K.linkEmail}if(P.xml&&ie==="<"&&I.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ce=I.string.indexOf(">",I.pos);if(ce!=-1){var re=I.string.substring(I.start,ce);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(re)&&(g.md_inside=!0)}return I.backUp(1),g.htmlState=ne.startState(X),s(I,g,D)}if(P.xml&&ie==="<"&&I.match(/^\/\w*?>/))return g.md_inside=!1,"tag";if(ie==="*"||ie==="_"){for(var fe=1,se=I.pos==1?" ":I.string.charAt(I.pos-2);fe<3&&I.eat(ie);)fe++;var ke=I.peek()||" ",Ne=!/\s/.test(ke)&&(!o.test(ke)||/\s/.test(se)||o.test(se)),Re=!/\s/.test(se)&&(!o.test(se)||/\s/.test(ke)||o.test(ke)),Pe=null,je=null;if(fe%2&&(!g.em&&Ne&&(ie==="*"||!Re||o.test(se))?Pe=!0:g.em==ie&&Re&&(ie==="*"||!Ne||o.test(ke))&&(Pe=!1)),fe>1&&(!g.strong&&Ne&&(ie==="*"||!Re||o.test(se))?je=!0:g.strong==ie&&Re&&(ie==="*"||!Ne||o.test(ke))&&(je=!1)),je!=null||Pe!=null){P.highlightFormatting&&(g.formatting=Pe==null?"strong":je==null?"em":"strong em"),Pe===!0&&(g.em=ie),je===!0&&(g.strong=ie);var Ae=A(g);return Pe===!1&&(g.em=!1),je===!1&&(g.strong=!1),Ae}}else if(ie===" "&&(I.eat("*")||I.eat("_"))){if(I.peek()===" ")return A(g);I.backUp(1)}if(P.strikethrough){if(ie==="~"&&I.eatWhile(ie)){if(g.strikethrough){P.highlightFormatting&&(g.formatting="strikethrough");var Ae=A(g);return g.strikethrough=!1,Ae}else if(I.match(/^[^\s]/,!1))return g.strikethrough=!0,P.highlightFormatting&&(g.formatting="strikethrough"),A(g)}else if(ie===" "&&I.match(/^~~/,!0)){if(I.peek()===" ")return A(g);I.backUp(2)}}if(P.emoji&&ie===":"&&I.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){g.emoji=!0,P.highlightFormatting&&(g.formatting="emoji");var ue=A(g);return g.emoji=!1,ue}return ie===" "&&(I.match(/^ +$/,!1)?g.trailingSpace++:g.trailingSpace&&(g.trailingSpaceNewLine=!0)),A(g)}function c(I,g){var H=I.next();if(H===">"){g.f=g.inline=T,P.highlightFormatting&&(g.formatting="link");var $=A(g);return $?$+=" ":$="",$+K.linkInline}return I.match(/^[^>]+/,!0),K.linkInline}function w(I,g){if(I.eatSpace())return null;var H=I.next();return H==="("||H==="["?(g.f=g.inline=b(H==="("?")":"]"),P.highlightFormatting&&(g.formatting="link-string"),g.linkHref=!0,A(g)):"error"}var y={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function b(I){return function(g,H){var $=g.next();if($===I){H.f=H.inline=T,P.highlightFormatting&&(H.formatting="link-string");var ie=A(H);return H.linkHref=!1,ie}return g.match(y[I]),H.linkHref=!0,A(H)}}function U(I,g){return I.match(/^([^\]\\]|\\.)*\]:/,!1)?(g.f=F,I.next(),P.highlightFormatting&&(g.formatting="link"),g.linkText=!0,A(g)):a(I,g,T)}function F(I,g){if(I.match(/^\]:/,!0)){g.f=g.inline=E,P.highlightFormatting&&(g.formatting="link");var H=A(g);return g.linkText=!1,H}return I.match(/^([^\]\\]|\\.)+/,!0),K.linkText}function E(I,g){return I.eatSpace()?null:(I.match(/^[^\s]+/,!0),I.peek()===void 0?g.linkTitle=!0:I.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),g.f=g.inline=T,K.linkHref+" url")}var N={startState:function(){return{f:C,prevLine:{stream:null},thisLine:{stream:null},block:C,htmlState:null,indentation:0,inline:T,text:S,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(I){return{f:I.f,prevLine:I.prevLine,thisLine:I.thisLine,block:I.block,htmlState:I.htmlState&&ne.copyState(X,I.htmlState),indentation:I.indentation,localMode:I.localMode,localState:I.localMode?ne.copyState(I.localMode,I.localState):null,inline:I.inline,text:I.text,formatting:!1,linkText:I.linkText,linkTitle:I.linkTitle,linkHref:I.linkHref,code:I.code,em:I.em,strong:I.strong,strikethrough:I.strikethrough,emoji:I.emoji,header:I.header,setext:I.setext,hr:I.hr,taskList:I.taskList,list:I.list,listStack:I.listStack.slice(0),quote:I.quote,indentedCode:I.indentedCode,trailingSpace:I.trailingSpace,trailingSpaceNewLine:I.trailingSpaceNewLine,md_inside:I.md_inside,fencedEndRE:I.fencedEndRE}},token:function(I,g){if(g.formatting=!1,I!=g.thisLine.stream){if(g.header=0,g.hr=!1,I.match(/^\s*$/,!0))return _(g),null;if(g.prevLine=g.thisLine,g.thisLine={stream:I},g.taskList=!1,g.trailingSpace=0,g.trailingSpaceNewLine=!1,!g.localState&&(g.f=g.block,g.f!=D)){var H=I.match(/^\s*/,!0)[0].replace(/\t/g,u).length;if(g.indentation=H,g.indentationDiff=null,H>0)return null}}return g.f(I,g)},innerMode:function(I){return I.block==D?{state:I.htmlState,mode:X}:I.localState?{state:I.localState,mode:I.localMode}:{state:I,mode:N}},indent:function(I,g,H){return I.block==D&&X.indent?X.indent(I.htmlState,g,H):I.localState&&I.localMode.indent?I.localMode.indent(I.localState,g,H):ne.Pass},blankLine:_,getType:A,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return N},"xml"),ne.defineMIME("text/markdown","markdown"),ne.defineMIME("text/x-markdown","markdown")})},nEHx:function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return ne});var ne;(function(J){J.DARK="dark",J.LIGHT="light",J.HIGH_CONTRAST="hc"})(ne||(ne={}))},nnTU:function(nt,xe,Z){"use strict";Z.d(xe,"b",function(){return K}),Z.d(xe,"a",function(){return G});var ne=Z("MI8n"),J=Z("JYp7"),P=Z("pmY6"),X=Z("24hK"),j=Z("746U"),B=Z("Cg/j");const K=Object(B.c)("commandService"),G=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ne.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(r,L){if(!r)throw new Error("invalid command");if(typeof r=="string"){if(!L)throw new Error("invalid command");return this.registerCommand({id:r,handler:L})}if(r.description){const l=[];for(let o of r.description.args)l.push(o.constraint);const f=r.handler;r.handler=function(o,...u){return Object(j.o)(u,l),f(o,...u)}}const{id:v}=r;let m=this._commands.get(v);m||(m=new X.a,this._commands.set(v,m));let p=m.unshift(r),h=Object(P.i)(()=>{p();const l=this._commands.get(v);(l==null?void 0:l.isEmpty())&&this._commands.delete(v)});return this._onDidRegisterCommand.fire(v),h}registerCommandAlias(r,L){return G.registerCommand(r,(v,...m)=>v.get(K).executeCommand(L,...m))}getCommand(r){const L=this._commands.get(r);return!L||L.isEmpty()?void 0:J.a.first(L)}getCommands(){const r=new Map;for(const L of this._commands.keys()){const v=this.getCommand(L);v&&r.set(L,v)}return r}};G.registerCommand("noop",()=>{})},osHv:function(nt,xe,Z){(function(ne){ne(Z("VrN/"))})(function(ne){"use strict";var J=ne.Pos;function P(o,u){return o.line-u.line||o.ch-u.ch}var X="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",j=X+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",B=new RegExp("<(/?)(["+X+"]["+j+"]*)","g");function K(o,u,a,s){this.line=u,this.ch=a,this.cm=o,this.text=o.getLine(u),this.min=s?Math.max(s.from,o.firstLine()):o.firstLine(),this.max=s?Math.min(s.to-1,o.lastLine()):o.lastLine()}function G(o,u){var a=o.cm.getTokenTypeAt(J(o.line,u));return a&&/\btag\b/.test(a)}function r(o){return o.line>=o.max?void 0:(o.ch=0,o.text=o.cm.getLine(++o.line),!0)}function L(o){return o.line<=o.min?void 0:(o.text=o.cm.getLine(--o.line),o.ch=o.text.length,!0)}function v(o){for(;;){var u=o.text.indexOf(">",o.ch);if(u==-1){if(r(o))continue;return}if(!G(o,u+1)){o.ch=u+1;continue}var a=o.text.lastIndexOf("/",u),s=a>-1&&!/\S/.test(o.text.slice(a+1,u));return o.ch=u+1,s?"selfClose":"regular"}}function m(o){for(;;){var u=o.ch?o.text.lastIndexOf("<",o.ch-1):-1;if(u==-1){if(L(o))continue;return}if(!G(o,u+1)){o.ch=u;continue}B.lastIndex=u,o.ch=u;var a=B.exec(o.text);if(a&&a.index==u)return a}}function p(o){for(;;){B.lastIndex=o.ch;var u=B.exec(o.text);if(!u){if(r(o))continue;return}if(!G(o,u.index+1)){o.ch=u.index+1;continue}return o.ch=u.index+u[0].length,u}}function h(o){for(;;){var u=o.ch?o.text.lastIndexOf(">",o.ch-1):-1;if(u==-1){if(L(o))continue;return}if(!G(o,u+1)){o.ch=u;continue}var a=o.text.lastIndexOf("/",u),s=a>-1&&!/\S/.test(o.text.slice(a+1,u));return o.ch=u+1,s?"selfClose":"regular"}}function l(o,u){for(var a=[];;){var s=p(o),R,_=o.line,C=o.ch-(s?s[0].length:0);if(!s||!(R=v(o)))return;if(R=="selfClose")continue;if(s[1]){for(var D=a.length-1;D>=0;--D)if(a[D]==s[2]){a.length=D;break}if(D<0&&(!u||u==s[2]))return{tag:s[2],from:J(_,C),to:J(o.line,o.ch)}}else a.push(s[2])}}function f(o,u){for(var a=[];;){var s=h(o);if(!s)return;if(s=="selfClose"){m(o);continue}var R=o.line,_=o.ch,C=m(o);if(!C)return;if(C[1])a.push(C[2]);else{for(var D=a.length-1;D>=0;--D)if(a[D]==C[2]){a.length=D;break}if(D<0&&(!u||u==C[2]))return{tag:C[2],from:J(o.line,o.ch),to:J(R,_)}}}}ne.registerHelper("fold","xml",function(o,u){for(var a=new K(o,u.line,0);;){var s=p(a);if(!s||a.line!=u.line)return;var R=v(a);if(!R)return;if(!s[1]&&R!="selfClose"){var _=J(a.line,a.ch),C=l(a,s[2]);return C&&P(C.from,_)>0?{from:_,to:C.from}:null}}}),ne.findMatchingTag=function(o,u,a){var s=new K(o,u.line,u.ch,a);if(s.text.indexOf(">")==-1&&s.text.indexOf("<")==-1)return;var R=v(s),_=R&&J(s.line,s.ch),C=R&&m(s);if(!R||!C||P(s,u)>0)return;var D={from:J(s.line,s.ch),to:_,tag:C[2]};return R=="selfClose"?{open:D,close:null,at:"open"}:C[1]?{open:f(s,C[2]),close:D,at:"close"}:(s=new K(o,_.line,_.ch,a),{open:D,close:l(s,C[2]),at:"open"})},ne.findEnclosingTag=function(o,u,a,s){for(var R=new K(o,u.line,u.ch,a);;){var _=f(R,s);if(!_)break;var C=new K(o,u.line,u.ch,a),D=l(C,_.tag);if(D)return{open:_,close:D}}},ne.scanForClosingTag=function(o,u,a,s){var R=new K(o,u.line,u.ch,s?{from:0,to:s}:null);return l(R,a)}})},p5ED:function(nt,xe,Z){"use strict";var ne=Z("+L6B"),J=Z("2/Rp"),P=Z("5Dmo"),X=Z("3S7+"),j=Z("k1fw"),B=Z("9og8"),K=Z("tJVT"),G=Z("WmNS"),r=Z.n(G),L=Z("q1tI"),v=Z.n(L),m=Z("vHTk"),p=Z.n(m),h=Z("yEEn"),l=Z("ZW9T"),f=Z("1vsH"),o=Z("V0Rq"),u=Z("m3rI");xe.a=function(a){var s,R,_,C,D,O,A,S=a.editOffice,T=S===void 0?"view":S,c=a.data,w=a.theme,y=a.type,b=a.filename,U=a.monacoEditor,F=a.className,E=a.style,N=a.close,I=a.onClose,g=a.hasMask,H=a.disabledDownload,$=Object(L.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ie=Object(K.a)($,2),oe=ie[0],Ce=ie[1],ve=Object(L.useState)(""),Se=Object(K.a)(ve,2),Ae=Se[0],Oe=Se[1],he=Object(L.useState)(),ce=Object(K.a)(he,2),re=ce[0],fe=ce[1],se=window.ENV==="build"?"/react/build":"",ke=u.a.PROXY_SERVER||location.origin,Ne,Re=1024*1024,Pe=10*Re,je=Object(L.useRef)();(s=c)!==null&&s!==void 0&&s.startsWith("/api")&&y!=="txt"&&(c=u.a.API_SERVER+c),y==="office"&&(Ne=Object(f.T)(c).filesize,Ne>Pe&&(y="other")),b&&U&&(U.filename=b),Object(L.useEffect)(function(){var Ie,Ge,Xe=(Ie=document.cookie)===null||Ie===void 0||((Ge=Ie.replace(/\s/g,""))===null||Ge===void 0)?void 0:Ge.split(";");Xe==null||Xe.map(function(Je){var Qe=Je.split("=");Qe[0]==="_educoder_session"&&Oe(Qe[1])})},[]),Object(L.useEffect)(function(){y==="office"&&ue()},[y,c]);var ue=function(){var Ie=Object(B.a)(r.a.mark(function Ge(){var Xe,Je,Qe;return r.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:return console.log("data:",c),Xe=c,c.startsWith("http")||(Xe=location.origin+Xe),Je=new URL(Xe).pathname.split("/").pop(),qe.next=6,Object(o.V)({attachment_id:Je});case 6:Qe=qe.sent,fe(Qe);case 8:case"end":return qe.stop()}},Ge)}));return function(){return Ie.apply(this,arguments)}}(),Ee=function(){if(c.startsWith("http")||c.startsWith("blob:")){Le();return}Object(f.z)(b||"educoder",c,b)},Le=function(){Object(f.x)(b||"educoder",decodeURIComponent(c))};return v.a.createElement("div",{style:Object(j.a)({},E||{}),className:"".concat(g&&p.a.bgBlack," ").concat(y?p.a.wrp:"hide")},N&&v.a.createElement("div",{className:p.a.close,ref:je},!H&&v.a.createElement(X.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return je.current}},v.a.createElement("span",{onClick:Le},v.a.createElement("i",{className:"icon-quxiaozhiding"}))),v.a.createElement(X.a,{title:"\u5173\u95ED",getPopupContainer:function(){return je.current}},v.a.createElement("span",{className:"",onClick:I},v.a.createElement("i",{className:"icon-guanbi1"})))),v.a.createElement("div",{className:"".concat(p.a[F]," ").concat(F," ").concat(p.a.monaco," ").concat(y==="txt"?"show":"hide")},y==="txt"&&v.a.createElement(l.b,U)),y==="audio"&&v.a.createElement("audio",{src:"".concat(((R=c)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((_=c)===null||_===void 0?void 0:_.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(c),autoPlay:!0}),y==="video"&&v.a.createElement(v.a.Fragment,null,((C=c)===null||C===void 0?void 0:C.indexOf("http"))>-1?v.a.createElement("video",{controls:!0,src:"".concat(c),autoPlay:!0}):v.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(c),autoPlay:!0})),y==="office"&&re&&v.a.createElement("iframe",{src:"".concat(se,"/office.html?key=").concat(re.key,"&url=").concat(ke+re.url,"&callbackUrl=").concat(ke+re.callbackUrl,"&fileType=").concat(re.fileType,"&title=").concat(re.title,"&model=").concat(T,"&officeServer=").concat(u.a.OFFICE_SERVER,"&disabledDownload=").concat(!!H)}),y==="html"&&v.a.createElement("iframe",{src:c+"&disposition=inline"}),y==="pdf"&&v.a.createElement("iframe",{src:"".concat(se,"/js/pdfview/index.html?url=").concat(c,"&disabledDownload=").concat(!!H)}),y==="image"&&v.a.createElement("img",{src:"".concat(((D=c)===null||D===void 0?void 0:D.indexOf("http://"))>-1||((O=c)===null||O===void 0?void 0:O.indexOf("https://"))>-1||(A=c)!==null&&A!==void 0&&A.startsWith("/api")?"":"data:image/png;base64,").concat(c)}),y==="other"&&v.a.createElement("div",null,v.a.createElement(J.a,{type:"primary",size:"large",onClick:Ee},v.a.createElement(h.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),y==="download"&&v.a.createElement(J.a,{type:"primary",size:"large",onClick:Ee},v.a.createElement(h.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(nt,xe,Z){},pmY6:function(nt,xe,Z){"use strict";Z.d(xe,"h",function(){return L}),Z.d(xe,"g",function(){return m}),Z.d(xe,"f",function(){return p}),Z.d(xe,"e",function(){return h}),Z.d(xe,"i",function(){return l}),Z.d(xe,"b",function(){return f}),Z.d(xe,"a",function(){return o}),Z.d(xe,"d",function(){return u}),Z.d(xe,"c",function(){return a});var ne=Z("C/vA"),J=Z("JYp7");const P=!1;let X=null;function j(s){X=s}if(P){const s="__is_disposable_tracked__";j(new class{trackDisposable(R){const _=new Error("Potentially leaked disposable").stack;setTimeout(()=>{R[s]||console.log(_)},3e3)}setParent(R,_){if(R&&R!==o.None)try{R[s]=!0}catch(C){}}markAsDisposed(R){if(R&&R!==o.None)try{R[s]=!0}catch(_){}}markAsSingleton(R){}})}function B(s){return X==null||X.trackDisposable(s),s}function K(s){X==null||X.markAsDisposed(s)}function G(s,R){X==null||X.setParent(s,R)}function r(s,R){if(!X)return;for(const _ of s)X.setParent(_,R)}function L(s){return X==null||X.markAsSingleton(s),s}class v extends Error{constructor(s){super(`Encountered errors while disposing of store. Errors: [${s.join(", ")}]`);this.errors=s}}function m(s){return typeof s.dispose=="function"&&s.dispose.length===0}function p(s){if(J.a.is(s)){let R=[];for(const _ of s)if(_)try{_.dispose()}catch(C){R.push(C)}if(R.length===1)throw R[0];if(R.length>1)throw new v(R);return Array.isArray(s)?[]:s}else if(s)return s.dispose(),s}function h(...s){const R=l(()=>p(s));return r(s,R),R}function l(s){const R=B({dispose:Object(ne.a)(()=>{K(R),s()})});return R}class f{constructor(){this._toDispose=new Set,this._isDisposed=!1,B(this)}dispose(){if(this._isDisposed)return;K(this),this._isDisposed=!0,this.clear()}clear(){try{p(this._toDispose.values())}finally{this._toDispose.clear()}}add(s){if(!s)return s;if(s===this)throw new Error("Cannot register a disposable on itself!");return G(s,this),this._isDisposed?f.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(s),s}}f.DISABLE_DISPOSED_WARNING=!1;class o{constructor(){this._store=new f,B(this),G(this._store,this)}dispose(){K(this),this._store.dispose()}_register(s){if(s===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(s)}}o.None=Object.freeze({dispose(){}});class u{constructor(){this._isDisposed=!1,B(this)}get value(){return this._isDisposed?void 0:this._value}set value(s){var R;if(this._isDisposed||s===this._value)return;(R=this._value)===null||R===void 0||R.dispose(),s&&G(s,this),this._value=s}clear(){this.value=void 0}dispose(){var s;this._isDisposed=!0,K(this),(s=this._value)===null||s===void 0||s.dispose(),this._value=void 0}clearAndLeak(){const s=this._value;return this._value=void 0,s&&G(s,null),s}}class a{constructor(s){this.object=s}dispose(){}}},psGv:function(nt,xe,Z){var ne,J;(function(){var P;(function(){"use strict";var K=[,,function(v){function m(l){this.__parent=l,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}m.prototype.clone_empty=function(){var l=new m(this.__parent);return l.set_indent(this.__indent_count,this.__alignment_count),l},m.prototype.item=function(l){return l<0?this.__items[this.__items.length+l]:this.__items[l]},m.prototype.has_match=function(l){for(var f=this.__items.length-1;f>=0;f--)if(this.__items[f].match(l))return!0;return!1},m.prototype.set_indent=function(l,f){this.is_empty()&&(this.__indent_count=l||0,this.__alignment_count=f||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.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)},m.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},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var l=this.__parent.current_line;return l.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),l.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),l.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,l.__items[0]===" "&&(l.__items.splice(0,1),l.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(l){this.__items.push(l);var f=l.lastIndexOf(` `);f!==-1?this.__character_count=l.length-f:this.__character_count+=l.length},m.prototype.pop=function(){var l=null;return this.is_empty()||(l=this.__items.pop(),this.__character_count-=l.length),l},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var l="";return this.is_empty()?this.__parent.indent_empty_lines&&(l=this.__parent.get_indent_string(this.__indent_count)):(l=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),l+=this.__items.join("")),l};function p(l,f){this.__cache=[""],this.__indent_size=l.indent_size,this.__indent_string=l.indent_char,l.indent_with_tabs||(this.__indent_string=new Array(l.indent_size+1).join(l.indent_char)),f=f||"",l.indent_level>0&&(f=new Array(l.indent_level+1).join(this.__indent_string)),this.__base_string=f,this.__base_string_length=f.length}p.prototype.get_indent_size=function(l,f){var o=this.__base_string_length;return f=f||0,l<0&&(o=0),o+=l*this.__indent_size,o+=f,o},p.prototype.get_indent_string=function(l,f){var o=this.__base_string;return f=f||0,l<0&&(l=0,o=""),f+=l*this.__indent_size,this.__ensure_cache(f),o+=this.__cache[f],o},p.prototype.__ensure_cache=function(l){for(;l>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var l=this.__cache.length,f=0,o="";this.__indent_size&&l>=this.__indent_size&&(f=Math.floor(l/this.__indent_size),l-=f*this.__indent_size,o=new Array(f+1).join(this.__indent_string)),l&&(o+=new Array(l+1).join(" ")),this.__cache.push(o)};function h(l,f){this.__indent_cache=new p(l,f),this.raw=!1,this._end_with_newline=l.end_with_newline,this.indent_size=l.indent_size,this.wrap_line_length=l.wrap_line_length,this.indent_empty_lines=l.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}h.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},h.prototype.get_line_number=function(){return this.__lines.length},h.prototype.get_indent_string=function(l,f){return this.__indent_cache.get_indent_string(l,f)},h.prototype.get_indent_size=function(l,f){return this.__indent_cache.get_indent_size(l,f)},h.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},h.prototype.add_new_line=function(l){return this.is_empty()||!l&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},h.prototype.get_code=function(l){this.trim(!0);var f=this.current_line.pop();f&&(f[f.length-1]===` `&&(f=f.replace(/\n+$/g,"")),this.current_line.push(f)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(` `);return l!==` `&&(o=o.replace(/[\n]/g,l)),o},h.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},h.prototype.set_indent=function(l,f){return l=l||0,f=f||0,this.next_line.set_indent(l,f),this.__lines.length>1?(this.current_line.set_indent(l,f),!0):(this.current_line.set_indent(),!1)},h.prototype.add_raw_token=function(l){for(var f=0;f1&&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},h.prototype.just_added_newline=function(){return this.current_line.is_empty()},h.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},h.prototype.ensure_empty_line_above=function(l,f){for(var o=this.__lines.length-2;o>=0;){var u=this.__lines[o];if(u.is_empty())break;if(u.item(0).indexOf(l)!==0&&u.item(-1)!==f){this.__lines.splice(o+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},v.exports.Output=h},function(v){function m(p,h,l,f){this.type=p,this.text=h,this.comments_before=null,this.newlines=l||0,this.whitespace_before=f||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}v.exports.Token=m},,,function(v){function m(l,f){this.raw_options=p(l,f),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}m.prototype._get_array=function(l,f){var o=this.raw_options[l],u=f||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(u=o.concat()):typeof o=="string"&&(u=o.split(/[^a-zA-Z0-9_\/\-]+/)),u},m.prototype._get_boolean=function(l,f){var o=this.raw_options[l],u=o===void 0?!!f:!!o;return u},m.prototype._get_characters=function(l,f){var o=this.raw_options[l],u=f||"";return typeof o=="string"&&(u=o.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),u},m.prototype._get_number=function(l,f){var o=this.raw_options[l];f=parseInt(f,10),isNaN(f)&&(f=0);var u=parseInt(o,10);return isNaN(u)&&(u=f),u},m.prototype._get_selection=function(l,f,o){var u=this._get_selection_list(l,f,o);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+l+`' can only be one of the following values: `+f+` You passed in: '`+this.raw_options[l]+"'");return u[0]},m.prototype._get_selection_list=function(l,f,o){if(!f||f.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[f[0]],!this._is_valid_selection(o,f))throw new Error("Invalid Default Value!");var u=this._get_array(l,o);if(!this._is_valid_selection(u,f))throw new Error("Invalid Option Value: The option '"+l+`' can contain only the following values: `+f+` You passed in: '`+this.raw_options[l]+"'");return u},m.prototype._is_valid_selection=function(l,f){return l.length&&f.length&&!l.some(function(o){return f.indexOf(o)===-1})};function p(l,f){var o={};l=h(l);var u;for(u in l)u!==f&&(o[u]=l[u]);if(f&&l[f])for(u in l[f])o[u]=l[f][u];return o}function h(l){var f={},o;for(o in l){var u=o.replace(/-/g,"_");f[u]=l[o]}return f}v.exports.Options=m,v.exports.normalizeOpts=h,v.exports.mergeOpts=p},,function(v){var m=RegExp.prototype.hasOwnProperty("sticky");function p(h){this.__input=h||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position=0&&h=0&&l=h.length&&this.__input.substring(l-h.length,l).toLowerCase()===h},v.exports.InputScanner=p},function(v,m,p){var h=p(8).InputScanner,l=p(3).Token,f=p(10).TokenStream,o=p(11).WhitespacePattern,u={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},a=function(s,R){this._input=new h(s),this._options=R||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};a.prototype.tokenize=function(){this._input.restart(),this.__tokens=new f,this._reset();for(var s,R=new l(u.START,""),_=null,C=[],D=new f;R.type!==u.EOF;){for(s=this._get_next_token(R,_);this._is_comment(s);)D.add(s),s=this._get_next_token(R,_);D.isEmpty()||(s.comments_before=D,D=new f),s.parent=_,this._is_opening(s)?(C.push(_),_=s):_&&this._is_closing(s,_)&&(s.opened=_,_.closed=s,_=C.pop(),s.parent=_),s.previous=R,R.next=s,this.__tokens.add(s),R=s}return this.__tokens},a.prototype._is_first_token=function(){return this.__tokens.isEmpty()},a.prototype._reset=function(){},a.prototype._get_next_token=function(s,R){this._readWhitespace();var _=this._input.read(/.+/g);return _?this._create_token(u.RAW,_):this._create_token(u.EOF,"")},a.prototype._is_comment=function(s){return!1},a.prototype._is_opening=function(s){return!1},a.prototype._is_closing=function(s,R){return!1},a.prototype._create_token=function(s,R){var _=new l(s,R,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return _},a.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},v.exports.Tokenizer=a,v.exports.TOKEN=u},function(v){function m(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position=0&&p/),erb:a.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:a.starting_with(/{%/).until_after(/%}/),django_value:a.starting_with(/{{/).until_after(/}}/),django_comment:a.starting_with(/{#/).until_after(/#}/),smarty:a.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:a.starting_with(/{\*/).until_after(/\*}/),smarty_literal:a.starting_with(/{literal}/).until_after(/{\/literal}/)}}f.prototype=new h,f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){this.__set_templated_pattern()},f.prototype.disable=function(o){var u=this._create();return u._disabled[o]=!0,u._update(),u},f.prototype.read_options=function(o){var u=this._create();for(var a in l)u._disabled[a]=o.templating.indexOf(a)===-1;return u._update(),u},f.prototype.exclude=function(o){var u=this._create();return u._excluded[o]=!0,u._update(),u},f.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=this._input.read(this._starting_pattern,this.__template_pattern);for(var u=this._read_template();u;)this._match_pattern?u+=this._input.read(this._match_pattern):u+=this._input.readUntil(this.__template_pattern),o+=u,u=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},f.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},f.prototype._read_template=function(){var o="",u=this._input.peek();if(u==="<"){var a=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&a==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&a==="%"&&(o=o||this.__patterns.erb.read())}else u==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},v.exports.TemplatablePattern=f},,,,function(v,m,p){var h=p(19).Beautifier,l=p(20).Options;function f(o,u,a,s){var R=new h(o,u,a,s);return R.beautify()}v.exports=f,v.exports.defaultOptions=function(){return new l}},function(v,m,p){var h=p(20).Options,l=p(2).Output,f=p(21).Tokenizer,o=p(21).TOKEN,u=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,s=function(w,y){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=w.max_preserve_newlines,this.preserve_newlines=w.preserve_newlines,this._output=new l(w,y)};s.prototype.current_line_has_match=function(w){return this._output.current_line.has_match(w)},s.prototype.set_space_before_token=function(w,y){this._output.space_before_token=w,this._output.non_breaking_space=y},s.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},s.prototype.add_raw_token=function(w){this._output.add_raw_token(w)},s.prototype.print_preserved_newlines=function(w){var y=0;w.type!==o.TEXT&&w.previous.type!==o.TEXT&&(y=w.newlines?1:0),this.preserve_newlines&&(y=w.newlines0);return y!==0},s.prototype.traverse_whitespace=function(w){return w.whitespace_before||w.newlines?(this.print_preserved_newlines(w)||(this._output.space_before_token=!0),!0):!1},s.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},s.prototype.print_newline=function(w){this._output.add_new_line(w)},s.prototype.print_token=function(w){w.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(w.text))},s.prototype.indent=function(){this.indent_level++},s.prototype.get_full_indent=function(w){return w=this.indent_level+(w||0),w<1?"":this._output.get_indent_string(w)};var R=function(w){for(var y=null,b=w.next;b.type!==o.EOF&&w.closed!==b;){if(b.type===o.ATTRIBUTE&&b.text==="type"){b.next&&b.next.type===o.EQUALS&&b.next.next&&b.next.next.type===o.VALUE&&(y=b.next.next.text);break}b=b.next}return y},_=function(w,y){var b=null,U=null;return y.closed?(w==="script"?b="text/javascript":w==="style"&&(b="text/css"),b=R(y)||b,b.search("text/css")>-1?U="css":b.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?U="javascript":b.search(/(text|application|dojo)\/(x-)?(html)/)>-1?U="html":b.search(/test\/null/)>-1&&(U="null"),U):null};function C(w,y){return y.indexOf(w)!==-1}function D(w,y,b){this.parent=w||null,this.tag=y?y.tag_name:"",this.indent_level=b||0,this.parser_token=y||null}function O(w){this._printer=w,this._current_frame=null}O.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},O.prototype.record_tag=function(w){var y=new D(this._current_frame,w,this._printer.indent_level);this._current_frame=y},O.prototype._try_pop_frame=function(w){var y=null;return w&&(y=w.parser_token,this._printer.indent_level=w.indent_level,this._current_frame=w.parent),y},O.prototype._get_frame=function(w,y){for(var b=this._current_frame;b&&!(w.indexOf(b.tag)!==-1);){if(y&&y.indexOf(b.tag)!==-1){b=null;break}b=b.parent}return b},O.prototype.try_pop=function(w,y){var b=this._get_frame([w],y);return this._try_pop_frame(b)},O.prototype.indent_to_tag=function(w){var y=this._get_frame(w);y&&(this._printer.indent_level=y.indent_level)};function A(w,y,b,U){this._source_text=w||"",y=y||{},this._js_beautify=b,this._css_beautify=U,this._tag_stack=null;var F=new h(y,"html");this._options=F,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}A.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var w=this._source_text,y=this._options.eol;this._options.eol==="auto"&&(y=` `,w&&u.test(w)&&(y=w.match(u)[0])),w=w.replace(a,` `);var b=w.match(/^[\t ]*/)[0],U={text:"",type:""},F=new S,E=new s(this._options,b),N=new f(w,this._options).tokenize();this._tag_stack=new O(E);for(var I=null,g=N.next();g.type!==o.EOF;)g.type===o.TAG_OPEN||g.type===o.COMMENT?(I=this._handle_tag_open(E,g,F,U),F=I):g.type===o.ATTRIBUTE||g.type===o.EQUALS||g.type===o.VALUE||g.type===o.TEXT&&!F.tag_complete?I=this._handle_inside_tag(E,g,F,N):g.type===o.TAG_CLOSE?I=this._handle_tag_close(E,g,F):g.type===o.TEXT?I=this._handle_text(E,g,F):E.add_raw_token(g),U=I,g=N.next();var H=E._output.get_code(y);return H},A.prototype._handle_tag_close=function(w,y,b){var U={text:y.text,type:y.type};return w.alignment_size=0,b.tag_complete=!0,w.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),b.is_unformatted?w.add_raw_token(y):(b.tag_start_char==="<"&&(w.set_space_before_token(y.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&b.has_wrapped_attrs&&w.print_newline(!1)),w.print_token(y)),b.indent_content&&!(b.is_unformatted||b.is_content_unformatted)&&(w.indent(),b.indent_content=!1),!b.is_inline_element&&!(b.is_unformatted||b.is_content_unformatted)&&w.set_wrap_point(),U},A.prototype._handle_inside_tag=function(w,y,b,U){var F=b.has_wrapped_attrs,E={text:y.text,type:y.type};if(w.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),b.is_unformatted)w.add_raw_token(y);else if(b.tag_start_char==="{"&&y.type===o.TEXT)w.print_preserved_newlines(y)?(y.newlines=0,w.add_raw_token(y)):w.print_token(y);else{if(y.type===o.ATTRIBUTE?(w.set_space_before_token(!0),b.attr_count+=1):(y.type===o.EQUALS||y.type===o.VALUE&&y.previous.type===o.EQUALS)&&w.set_space_before_token(!1),y.type===o.ATTRIBUTE&&b.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(w.traverse_whitespace(y),F=F||y.newlines!==0),this._is_wrap_attributes_force)){var N=b.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&b.attr_count===1){var I=!0,g=0,H;do{if(H=U.peek(g),H.type===o.ATTRIBUTE){I=!1;break}g+=1}while(g<4&&H.type!==o.EOF&&H.type!==o.TAG_CLOSE);N=!I}N&&(w.print_newline(!1),F=!0)}w.print_token(y),F=F||w.previous_token_wrapped(),b.has_wrapped_attrs=F}return E},A.prototype._handle_text=function(w,y,b){var U={text:y.text,type:"TK_CONTENT"};return b.custom_beautifier_name?this._print_custom_beatifier_text(w,y,b):b.is_unformatted||b.is_content_unformatted?w.add_raw_token(y):(w.traverse_whitespace(y),w.print_token(y)),U},A.prototype._print_custom_beatifier_text=function(w,y,b){var U=this;if(y.text!==""){var F=y.text,E,N=1,I="",g="";b.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?E=this._js_beautify:b.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?E=this._css_beautify:b.custom_beautifier_name==="html"&&(E=function(ve,Se){var Ae=new A(ve,Se,U._js_beautify,U._css_beautify);return Ae.beautify()}),this._options.indent_scripts==="keep"?N=0:this._options.indent_scripts==="separate"&&(N=-w.indent_level);var H=w.get_full_indent(N);if(F=F.replace(/\n[ \t]*$/,""),b.custom_beautifier_name!=="html"&&F[0]==="<"&&F.match(/^(|]]>)$/.exec(F);if(!$){w.add_raw_token(y);return}I=H+$[1]+` `,F=$[4],$[5]&&(g=H+$[5]),F=F.replace(/\n[ \t]*$/,""),($[2]||$[3].indexOf(` `)!==-1)&&($=$[3].match(/[ \t]+$/),$&&(y.whitespace_before=$[0]))}if(F)if(E){var ie=function(){this.eol=` `};ie.prototype=this._options.raw_options;var oe=new ie;F=E(H+F,oe)}else{var Ce=y.whitespace_before;Ce&&(F=F.replace(new RegExp(` (`+Ce+")?","g"),` `)),F=H+F.replace(/\n/g,` `+H)}I&&(F?F=I+F+` `+g:F=I+g),w.print_newline(!1),F&&(y.text=F,y.whitespace_before="",y.newlines=0,w.add_raw_token(y),w.print_newline(!0))}},A.prototype._handle_tag_open=function(w,y,b,U){var F=this._get_tag_open_token(y);return(b.is_unformatted||b.is_content_unformatted)&&!b.is_empty_element&&y.type===o.TAG_OPEN&&y.text.indexOf("]*)/),this.tag_check=b?b[1]:""):(b=y.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=b?b[1]:"",(y.text.startsWith("{{#>")||y.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&y.next!==null?this.tag_check=y.next.text.split(" ")[0]:this.tag_check=y.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),y.type===o.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||y.closed&&y.closed.text==="/>";var U=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(U=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(U)))}};A.prototype._get_tag_open_token=function(w){var y=new S(this._tag_stack.get_parser_token(),w);return y.alignment_size=this._options.wrap_attributes_indent_size,y.is_end_tag=y.is_end_tag||C(y.tag_check,this._options.void_elements),y.is_empty_element=y.tag_complete||y.is_start_tag&&y.is_end_tag,y.is_unformatted=!y.tag_complete&&C(y.tag_check,this._options.unformatted),y.is_content_unformatted=!y.is_empty_element&&C(y.tag_check,this._options.content_unformatted),y.is_inline_element=C(y.tag_name,this._options.inline)||y.tag_name.includes("-")||y.tag_start_char==="{",y},A.prototype._set_tag_position=function(w,y,b,U,F){if(b.is_empty_element||(b.is_end_tag?b.start_tag_token=this._tag_stack.try_pop(b.tag_name):(this._do_optional_end_element(b)&&(b.is_inline_element||w.print_newline(!1)),this._tag_stack.record_tag(b),(b.tag_name==="script"||b.tag_name==="style")&&!(b.is_unformatted||b.is_content_unformatted)&&(b.custom_beautifier_name=_(b.tag_check,y)))),C(b.tag_check,this._options.extra_liners)&&(w.print_newline(!1),w._output.just_added_blankline()||w.print_newline(!0)),b.is_empty_element){if(b.tag_start_char==="{"&&b.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),b.indent_content=!0;var E=w.current_line_has_match(/{{#if/);E||w.print_newline(!1)}b.tag_name==="!--"&&F.type===o.TAG_CLOSE&&U.is_end_tag&&b.text.indexOf(` `)===-1||(b.is_inline_element||b.is_unformatted||w.print_newline(!1),this._calcluate_parent_multiline(w,b))}else if(b.is_end_tag){var N=!1;N=b.start_tag_token&&b.start_tag_token.multiline_content,N=N||!b.is_inline_element&&!(U.is_inline_element||U.is_unformatted)&&!(F.type===o.TAG_CLOSE&&b.start_tag_token===U)&&F.type!=="TK_CONTENT",(b.is_content_unformatted||b.is_unformatted)&&(N=!1),N&&w.print_newline(!1)}else b.indent_content=!b.custom_beautifier_name,b.tag_start_char==="<"&&(b.tag_name==="html"?b.indent_content=this._options.indent_inner_html:b.tag_name==="head"?b.indent_content=this._options.indent_head_inner_html:b.tag_name==="body"&&(b.indent_content=this._options.indent_body_inner_html)),!(b.is_inline_element||b.is_unformatted)&&(F.type!=="TK_CONTENT"||b.is_content_unformatted)&&w.print_newline(!1),this._calcluate_parent_multiline(w,b)},A.prototype._calcluate_parent_multiline=function(w,y){y.parent&&w._output.just_added_newline()&&!((y.is_inline_element||y.is_unformatted)&&y.parent.is_inline_element)&&(y.parent.multiline_content=!0)};var T=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],c=["a","audio","del","ins","map","noscript","video"];A.prototype._do_optional_end_element=function(w){var y=null;if(w.is_empty_element||!w.is_start_tag||!w.parent)return;if(w.tag_name==="body")y=y||this._tag_stack.try_pop("head");else if(w.tag_name==="li")y=y||this._tag_stack.try_pop("li",["ol","ul"]);else if(w.tag_name==="dd"||w.tag_name==="dt")y=y||this._tag_stack.try_pop("dt",["dl"]),y=y||this._tag_stack.try_pop("dd",["dl"]);else if(w.parent.tag_name==="p"&&T.indexOf(w.tag_name)!==-1){var b=w.parent.parent;(!b||c.indexOf(b.tag_name)===-1)&&(y=y||this._tag_stack.try_pop("p"))}else w.tag_name==="rp"||w.tag_name==="rt"?(y=y||this._tag_stack.try_pop("rt",["ruby","rtc"]),y=y||this._tag_stack.try_pop("rp",["ruby","rtc"])):w.tag_name==="optgroup"?y=y||this._tag_stack.try_pop("optgroup",["select"]):w.tag_name==="option"?y=y||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):w.tag_name==="colgroup"?y=y||this._tag_stack.try_pop("caption",["table"]):w.tag_name==="thead"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"])):w.tag_name==="tbody"||w.tag_name==="tfoot"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("thead",["table"]),y=y||this._tag_stack.try_pop("tbody",["table"])):w.tag_name==="tr"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(w.tag_name==="th"||w.tag_name==="td")&&(y=y||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),y=y||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return w.parent=this._tag_stack.get_parser_token(),y},v.exports.Beautifier=A},function(v,m,p){var h=p(6).Options;function l(f){h.call(this,f,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}l.prototype=new h,v.exports.Options=l},function(v,m,p){var h=p(9).Tokenizer,l=p(9).TOKEN,f=p(13).Directives,o=p(14).TemplatablePattern,u=p(12).Pattern,a={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:l.START,RAW:l.RAW,EOF:l.EOF},s=new f(/<\!--/,/-->/),R=function(_,C){h.call(this,_,C),this._current_tag_name="";var D=new o(this._input).read_options(this._options),O=new u(this._input);if(this.__patterns={word:D.until(/[\n\r\t <]/),single_quote:D.until_after(/'/),double_quote:D.until_after(/"/),attribute:D.until(/[\n\r\t =>]|\/>/),element_name:D.until(/[\n\r\t >\/]/),handlebars_comment:O.starting_with(/{{!--/).until_after(/--}}/),handlebars:O.starting_with(/{{/).until_after(/}}/),handlebars_open:O.until(/[\n\r\t }]/),handlebars_raw_close:O.until(/}}/),comment:O.starting_with(//),cdata:O.starting_with(//),conditional_comment:O.starting_with(//),processing:O.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var A=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=O.matching(A).until_after(A)}};R.prototype=new h,R.prototype._is_comment=function(_){return!1},R.prototype._is_opening=function(_){return _.type===a.TAG_OPEN},R.prototype._is_closing=function(_,C){return _.type===a.TAG_CLOSE&&C&&((_.text===">"||_.text==="/>")&&C.text[0]==="<"||_.text==="}}"&&C.text[0]==="{"&&C.text[1]==="{")},R.prototype._reset=function(){this._current_tag_name=""},R.prototype._get_next_token=function(_,C){var D=null;this._readWhitespace();var O=this._input.peek();return O===null?this._create_token(a.EOF,""):(D=D||this._read_open_handlebars(O,C),D=D||this._read_attribute(O,_,C),D=D||this._read_close(O,C),D=D||this._read_raw_content(O,_,C),D=D||this._read_content_word(O),D=D||this._read_comment_or_cdata(O),D=D||this._read_processing(O),D=D||this._read_open(O,C),D=D||this._create_token(a.UNKNOWN,this._input.next()),D)},R.prototype._read_comment_or_cdata=function(_){var C=null,D=null,O=null;if(_==="<"){var A=this._input.peek(1);A==="!"&&(D=this.__patterns.comment.read(),D?(O=s.get_directives(D),O&&O.ignore==="start"&&(D+=s.readIgnored(this._input))):D=this.__patterns.cdata.read()),D&&(C=this._create_token(a.COMMENT,D),C.directives=O)}return C},R.prototype._read_processing=function(_){var C=null,D=null,O=null;if(_==="<"){var A=this._input.peek(1);(A==="!"||A==="?")&&(D=this.__patterns.conditional_comment.read(),D=D||this.__patterns.processing.read()),D&&(C=this._create_token(a.COMMENT,D),C.directives=O)}return C},R.prototype._read_open=function(_,C){var D=null,O=null;return C||_==="<"&&(D=this._input.next(),this._input.peek()==="/"&&(D+=this._input.next()),D+=this.__patterns.element_name.read(),O=this._create_token(a.TAG_OPEN,D)),O},R.prototype._read_open_handlebars=function(_,C){var D=null,O=null;return C||this._options.indent_handlebars&&_==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(D=this.__patterns.handlebars_comment.read(),D=D||this.__patterns.handlebars.read(),O=this._create_token(a.COMMENT,D)):(D=this.__patterns.handlebars_open.read(),O=this._create_token(a.TAG_OPEN,D))),O},R.prototype._read_close=function(_,C){var D=null,O=null;return C&&(C.text[0]==="<"&&(_===">"||_==="/"&&this._input.peek(1)===">")?(D=this._input.next(),_==="/"&&(D+=this._input.next()),O=this._create_token(a.TAG_CLOSE,D)):C.text[0]==="{"&&_==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),O=this._create_token(a.TAG_CLOSE,"}}"))),O},R.prototype._read_attribute=function(_,C,D){var O=null,A="";if(D&&D.text[0]==="<")if(_==="=")O=this._create_token(a.EQUALS,this._input.next());else if(_==='"'||_==="'"){var S=this._input.next();_==='"'?S+=this.__patterns.double_quote.read():S+=this.__patterns.single_quote.read(),O=this._create_token(a.VALUE,S)}else A=this.__patterns.attribute.read(),A&&(C.type===a.EQUALS?O=this._create_token(a.VALUE,A):O=this._create_token(a.ATTRIBUTE,A));return O},R.prototype._is_content_unformatted=function(_){return this._options.void_elements.indexOf(_)===-1&&(this._options.content_unformatted.indexOf(_)!==-1||this._options.unformatted.indexOf(_)!==-1)},R.prototype._read_raw_content=function(_,C,D){var O="";if(D&&D.text[0]==="{")O=this.__patterns.handlebars_raw_close.read();else if(C.type===a.TAG_CLOSE&&C.opened.text[0]==="<"&&C.text[0]!=="/"){var A=C.opened.text.substr(1).toLowerCase();if(A==="script"||A==="style"){var S=this._read_comment_or_cdata(_);if(S)return S.type=a.TEXT,S;O=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(A)&&(O=this._input.readUntil(new RegExp("","ig")))}return O?this._create_token(a.TEXT,O):null},R.prototype._read_content_word=function(_){var C="";if(this._options.unformatted_content_delimiter&&(_===this._options.unformatted_content_delimiter[0]&&(C=this.__patterns.unformatted_content_delimiter.read())),C||(C=this.__patterns.word.read()),C)return this._create_token(a.TEXT,C)},v.exports.Tokenizer=R,v.exports.TOKEN=a}],G={};function r(v){var m=G[v];if(m!==void 0)return m.exports;var p=G[v]={exports:{}};return K[v](p,p.exports,r),p.exports}var L=r(18);P=L})();var X=P;if(!0)!(ne=[Z,Z("6UM0"),Z("TXwP")],J=function(K){var G=Z("6UM0"),r=Z("TXwP");return{html_beautify:function(L,v){return X(L,v,G.js_beautify,r.css_beautify)}}}.apply(xe,ne),J!==void 0&&(nt.exports=J));else var j,B})()},"rAM+":function(nt,xe,Z){"use strict";Z.d(xe,"a",function(){return J});var ne=Z("Qw5x");function J(P,X){var j;if(typeof Symbol=="undefined"||P[Symbol.iterator]==null){if(Array.isArray(P)||(j=Object(ne.a)(P))||X&&P&&typeof P.length=="number"){j&&(P=j);var B=0,K=function(){};return{s:K,n:function(){return B>=P.length?{done:!0}:{done:!1,value:P[B++]}},e:function(m){throw m},f:K}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var G=!0,r=!1,L;return{s:function(){j=P[Symbol.iterator]()},n:function(){var m=j.next();return G=m.done,m},e:function(m){r=!0,L=m},f:function(){try{!G&&j.return!=null&&j.return()}finally{if(r)throw L}}}}},rUJ1:function(nt,xe){const Z=/[&<>"']/,ne=/[&<>"']/g,J=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,X={"&":"&","<":"<",">":">",'"':""","'":"'"},j=O=>X[O];function B(O,A){if(A){if(Z.test(O))return O.replace(ne,j)}else if(J.test(O))return O.replace(P,j);return O}const K=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function G(O){return O.replace(K,(A,S)=>(S=S.toLowerCase(),S==="colon"?":":S.charAt(0)==="#"?S.charAt(1)==="x"?String.fromCharCode(parseInt(S.substring(2),16)):String.fromCharCode(+S.substring(1)):""))}const r=/(^|[^\[])\^/g;function L(O,A){O=O.source||O,A=A||"";const S={replace:(T,c)=>(c=c.source||c,c=c.replace(r,"$1"),O=O.replace(T,c),S),getRegex:()=>new RegExp(O,A)};return S}const v=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(O,A,S){if(O){let T;try{T=decodeURIComponent(G(S)).replace(v,"").toLowerCase()}catch(c){return null}if(T.indexOf("javascript:")===0||T.indexOf("vbscript:")===0||T.indexOf("data:")===0)return null}A&&!m.test(S)&&(S=u(A,S));try{S=encodeURI(S).replace(/%25/g,"%")}catch(T){return null}return S}const h={},l=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,o=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(O,A){h[" "+O]||(l.test(O)?h[" "+O]=O+"/":h[" "+O]=_(O,"/",!0)),O=h[" "+O];const S=O.indexOf(":")===-1;return A.substring(0,2)==="//"?S?A:O.replace(f,"$1")+A:A.charAt(0)==="/"?S?A:O.replace(o,"$1")+A:O+A}const a={exec:function(){}};function s(O){let A=1,S,T;for(;A{let U=!1,F=y;for(;--F>=0&&b[F]==="\\";)U=!U;return U?"|":" |"}),T=S.split(/ \|/);let c=0;if(T.length>A)T.splice(A);else for(;T.length{const u=this.themingParticipants.indexOf(o);this.themingParticipants.splice(u,1)})}getThemingParticipants(){return this.themingParticipants}}let h=new p;j.a.add(m.ThemingContribution,h);function l(o){return h.onColorThemeChange(o)}class f extends P.a{constructor(o){super();this.themeService=o,this.theme=o.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(u=>this.onThemeChange(u)))}onThemeChange(o){this.theme=o,this.updateStyles()}updateStyles(){}}},ulZh:function(nt,xe,Z){typeof window!="undefined"&&function(J,P){nt.exports=P()}(this,function(){return function(ne){var J={};function P(X){if(J[X])return J[X].exports;var j=J[X]={i:X,l:!1,exports:{}};return ne[X].call(j.exports,j,j.exports,P),j.l=!0,j.exports}return P.m=ne,P.c=J,P.d=function(X,j,B){P.o(X,j)||Object.defineProperty(X,j,{enumerable:!0,get:B})},P.r=function(X){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(X,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(X,"__esModule",{value:!0})},P.t=function(X,j){if(j&1&&(X=P(X)),j&8)return X;if(j&4&&typeof X=="object"&&X&&X.__esModule)return X;var B=Object.create(null);if(P.r(B),Object.defineProperty(B,"default",{enumerable:!0,value:X}),j&2&&typeof X!="string")for(var K in X)P.d(B,K,function(G){return X[G]}.bind(null,K));return B},P.n=function(X){var j=X&&X.__esModule?function(){return X.default}:function(){return X};return P.d(j,"a",j),j},P.o=function(X,j){return Object.prototype.hasOwnProperty.call(X,j)},P.p="/dist/",P(P.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ne,J,P){"use strict";var X=Object.prototype.hasOwnProperty,j="~";function B(){}Object.create&&(B.prototype=Object.create(null),new B().__proto__||(j=!1));function K(v,m,p){this.fn=v,this.context=m,this.once=p||!1}function G(v,m,p,h,l){if(typeof p!="function")throw new TypeError("The listener must be a function");var f=new K(p,h||v,l),o=j?j+m:m;return v._events[o]?v._events[o].fn?v._events[o]=[v._events[o],f]:v._events[o].push(f):(v._events[o]=f,v._eventsCount++),v}function r(v,m){--v._eventsCount===0?v._events=new B:delete v._events[m]}function L(){this._events=new B,this._eventsCount=0}L.prototype.eventNames=function(){var m=[],p,h;if(this._eventsCount===0)return m;for(h in p=this._events)X.call(p,h)&&m.push(j?h.slice(1):h);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(p)):m},L.prototype.listeners=function(m){var p=j?j+m:m,h=this._events[p];if(!h)return[];if(h.fn)return[h.fn];for(var l=0,f=h.length,o=new Array(f);l0},!1)}function v(m,p){for(var h={main:[p]},l={main:[]},f={main:{}};L(h);)for(var o=Object.keys(h),u=0;u=2*D/A||b<=F)return;var E=Number.POSITIVE_INFINITY,N;for(N=o.level-1;N>T;N--){var I=S[N].maxBitrate;if(E=D*I/(8*.8*y),E=b)return;var g=this.bwEstimator.getEstimate();L.logger.warn("Fragment "+o.sn+(u?" part "+u.index:"")+" of level "+o.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+N+` Current BW estimate: `+(Object(X.isFiniteNumber)(g)?(g/1024).toFixed(3):"Unknown")+` Kb/s Estimated load time for current fragment: `+b.toFixed(3)+` s Estimated load time for the next fragment: `+E.toFixed(3)+` s Time to underbuffer: `+F.toFixed(3)+" s"),a.nextLoadLevel=N,this.bwEstimator.sample(O,C.loaded),this.clearTimer(),o.loader&&(this.fragCurrent=this.partCurrent=null,o.loader.abort()),a.trigger(B.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:o,part:u,stats:C})},l.onFragLoaded=function(o,u){var a=u.frag,s=u.part;if(a.type===r.PlaylistLevelType.MAIN&&Object(X.isFiniteNumber)(a.sn)){var R=s?s.stats:a.stats,_=s?s.duration:a.duration;if(this.clearTimer(),this.lastLoadedFragLevel=a.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var C=this.hls.levels[a.level],D=(C.loaded?C.loaded.bytes:0)+R.loaded,O=(C.loaded?C.loaded.duration:0)+_;C.loaded={bytes:D,duration:O},C.realBitrate=Math.round(8*D/O)}if(a.bitrateTest){var A={stats:R,frag:a,part:s,id:a.type};this.onFragBuffered(B.Events.FRAG_BUFFERED,A),a.bitrateTest=!1}}},l.onFragBuffered=function(o,u){var a=u.frag,s=u.part,R=s?s.stats:a.stats;if(R.aborted)return;if(a.type!==r.PlaylistLevelType.MAIN||a.sn==="initSegment")return;var _=R.parsing.end-R.loading.start;this.bwEstimator.sample(_,R.loaded),R.bwEstimate=this.bwEstimator.getEstimate(),a.bitrateTest?this.bitrateTestDelay=_/1e3:this.bitrateTestDelay=0},l.onError=function(o,u){switch(u.details){case G.ErrorDetails.FRAG_LOAD_ERROR:case G.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},l.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},l.getNextABRAutoLevel=function(){var o=this.fragCurrent,u=this.partCurrent,a=this.hls,s=a.maxAutoLevel,R=a.config,_=a.minAutoLevel,C=a.media,D=u?u.duration:o?o.duration:0,O=C?C.currentTime:0,A=C&&C.playbackRate!==0?Math.abs(C.playbackRate):1,S=this.bwEstimator?this.bwEstimator.getEstimate():R.abrEwmaDefaultEstimate,T=(K.BufferHelper.bufferInfo(C,O,R.maxBufferHole).end-O)/A,c=this.findBestLevel(S,_,s,T,R.abrBandWidthFactor,R.abrBandWidthUpFactor);if(c>=0)return c;L.logger.trace((T?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var w=D?Math.min(D,R.maxStarvationDelay):R.maxStarvationDelay,y=R.abrBandWidthFactor,b=R.abrBandWidthUpFactor;if(!T){var U=this.bitrateTestDelay;if(U){var F=D?Math.min(D,R.maxLoadingDelay):R.maxLoadingDelay;w=F-U,L.logger.trace("bitrate test took "+Math.round(1e3*U)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*w)+" ms"),y=b=1}}return c=this.findBestLevel(S,_,s,T+w,y,b),Math.max(c,0)},l.findBestLevel=function(o,u,a,s,R,_){for(var C,D=this.fragCurrent,O=this.partCurrent,A=this.lastLoadedFragLevel,S=this.hls.levels,T=S[A],c=!!(T!=null&&(C=T.details)!==null&&C!==void 0&&C.live),w=T==null?void 0:T.codecSet,y=O?O.duration:D?D.duration:0,b=a;b>=u;b--){var U=S[b];if(!U||w&&U.codecSet!==w)continue;var F=U.details,E=(O?F==null?void 0:F.partTarget:F==null?void 0:F.averagetargetduration)||y,N=void 0;b<=A?N=R*o:N=_*o;var I=S[b].maxBitrate,g=I*E/N;if(L.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+b+"/"+Math.round(N)+"/"+I+"/"+E+"/"+s+"/"+g),N>I&&(!g||c&&!this.bitrateTestDelay||g0&&T===-1?(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),this.state=j.State.IDLE):(this.loadedmetadata=!1,this.state=j.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=T,this.tick()},A.doTick=function(){switch(this.state){case j.State.IDLE:this.doTickIdle();break;case j.State.WAITING_TRACK:{var T,c=this.levels,w=this.trackId,y=c==null||((T=c[w])===null||T===void 0)?void 0:T.details;if(y){if(this.waitForCdnTuneIn(y))break;this.state=j.State.WAITING_INIT_PTS}break}case j.State.FRAG_LOADING_WAITING_RETRY:{var b,U=performance.now(),F=this.retryDate;(!F||U>=F||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=j.State.IDLE);break}case j.State.WAITING_INIT_PTS:{var E=this.waitingData;if(E){var N=E.frag,I=E.part,g=E.cache,H=E.complete;if(this.initPTS[N.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=j.State.FRAG_LOADING;var $=g.flush(),ie={frag:N,part:I,payload:$,networkDetails:null};this._handleFragmentLoadProgress(ie),H&&D.prototype._handleFragmentLoadComplete.call(this,ie)}else if(this.videoTrackCC!==this.waitingVideoCC)u.logger.log("Waiting fragment cc ("+N.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var oe=this.getLoadPosition(),Ce=K.BufferHelper.bufferInfo(this.mediaBuffer,oe,this.config.maxBufferHole),ve=Object(l.fragmentWithinToleranceTest)(Ce.end,this.config.maxFragLookUpTolerance,N);ve<0&&(u.logger.log("Waiting fragment cc ("+N.cc+") @ "+N.start+" cancelled because another fragment at "+Ce.end+" is needed"),this.clearWaitingFragment())}}else this.state=j.State.IDLE}}this.onTickEnd()},A.clearWaitingFragment=function(){var T=this.waitingData;T&&(this.fragmentTracker.removeFragment(T.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=j.State.IDLE)},A.onTickEnd=function(){var T=this.media;if(!T||!T.readyState)return;var c=this.mediaBuffer?this.mediaBuffer:T,w=c.buffered;!this.loadedmetadata&&w.length&&(this.loadedmetadata=!0),this.lastCurrentTime=T.currentTime},A.doTickIdle=function(){var T,c,w=this.hls,y=this.levels,b=this.media,U=this.trackId,F=w.config;if(!y||!y[U])return;if(!b&&(this.startFragRequested||!F.startFragPrefetch))return;var E=y[U],N=E.details;if(!N||N.live&&this.levelLastLoaded!==U||this.waitForCdnTuneIn(N)){this.state=j.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,v.ElementaryStreamTypes.AUDIO,L.PlaylistLevelType.AUDIO));var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,L.PlaylistLevelType.AUDIO);if(I===null)return;var g=I.len,H=this.getMaxBufferLength(),$=this.audioSwitch;if(g>=H&&!$)return;if(!$&&this._streamEnded(I,N)){w.trigger(B.Events.BUFFER_EOS,{type:"audio"}),this.state=j.State.ENDED;return}var ie=N.fragments,oe=ie[0].start,Ce=I.end;if($){var ve=this.getLoadPosition();Ce=ve,N.PTSKnown&&veoe||I.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),b.currentTime=oe+.05))}var Se=this.getNextFragment(Ce,N);if(!Se){this.bufferFlushed=!0;return}((T=Se.decryptdata)===null||T===void 0?void 0:T.keyFormat)==="identity"&&!((c=Se.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(Se,N):this.loadFragment(Se,N,Ce)},A.getMaxBufferLength=function(){var T=D.prototype.getMaxBufferLength.call(this),c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,L.PlaylistLevelType.MAIN);return c===null?T:Math.max(T,c.len)},A.onMediaDetaching=function(){this.videoBuffer=null,D.prototype.onMediaDetaching.call(this)},A.onAudioTracksUpdated=function(T,c){var w=c.audioTracks;this.resetTransmuxer(),this.levels=w.map(function(y){return new r.Level(y)})},A.onAudioTrackSwitching=function(T,c){var w=!!c.url;this.trackId=c.id;var y=this.fragCurrent;y!=null&&y.loader&&y.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),w?this.setInterval(_):this.resetTransmuxer(),w?(this.audioSwitch=!0,this.state=j.State.IDLE):this.state=j.State.STOPPED,this.tick()},A.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},A.onLevelLoaded=function(T,c){this.mainDetails=c.details},A.onAudioTrackLoaded=function(T,c){var w,y=this.levels,b=c.details,U=c.id;if(!y){this.warn("Audio tracks were reset while loading level "+U);return}this.log("Track "+U+" loaded ["+b.startSN+","+b.endSN+"],duration:"+b.totalduration);var F=y[U],E=0;if(b.live||(w=F.details)!==null&&w!==void 0&&w.live){var N=this.mainDetails;if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed||!N)return;!F.details&&b.hasProgramDateTime&&N.hasProgramDateTime?(Object(f.alignMediaPlaylistByPDT)(b,N),E=b.fragments[0].start):E=this.alignPlaylists(b,F.details)}F.details=b,this.levelLastLoaded=U,!this.startFragRequested&&(this.mainDetails||!b.live)&&this.setStartPosition(F.details,E),this.state===j.State.WAITING_TRACK&&!this.waitForCdnTuneIn(b)&&(this.state=j.State.IDLE),this.tick()},A._handleFragmentLoadProgress=function(T){var c,w=T.frag,y=T.part,b=T.payload,U=this.config,F=this.trackId,E=this.levels;if(!E){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+w.sn+" of level "+w.level+" will not be buffered");return}var N=E[F];console.assert(N,"Audio track is defined on fragment load progress");var I=N.details;console.assert(I,"Audio track details are defined on fragment load progress");var g=U.defaultAudioCodec||N.audioCodec||"mp4a.40.2",H=this.transmuxer;H||(H=this.transmuxer=new p.default(this.hls,L.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var $=this.initPTS[w.cc],ie=(c=w.initSegment)===null||c===void 0?void 0:c.data;if($!==void 0){var oe=!1,Ce=y?y.index:-1,ve=Ce!==-1,Se=new h.ChunkMetadata(w.level,w.sn,w.stats.chunkCount,b.byteLength,Ce,ve);H.push(b,ie,g,"",w,y,I.totalduration,oe,Se,$)}else{u.logger.log("Unknown video PTS for cc "+w.cc+", waiting for video PTS before demuxing audio frag "+w.sn+" of ["+I.startSN+" ,"+I.endSN+"],track "+F);var Ae=this.waitingData=this.waitingData||{frag:w,part:y,cache:new m.default,complete:!1},Oe=Ae.cache;Oe.push(new Uint8Array(b)),this.waitingVideoCC=this.videoTrackCC,this.state=j.State.WAITING_INIT_PTS}},A._handleFragmentLoadComplete=function(T){if(this.waitingData){this.waitingData.complete=!0;return}D.prototype._handleFragmentLoadComplete.call(this,T)},A.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},A.onBufferCreated=function(T,c){var w=c.tracks.audio;w&&(this.mediaBuffer=w.buffer),c.tracks.video&&(this.videoBuffer=c.tracks.video.buffer)},A.onFragBuffered=function(T,c){var w=c.frag,y=c.part;if(w.type!==L.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(w)){this.warn("Fragment "+w.sn+(y?" p: "+y.index:"")+" of level "+w.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}w.sn!=="initSegment"&&(this.fragPrevious=w,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(w,y)},A.onError=function(T,c){switch(c.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.AUDIO,c);break;case o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==j.State.ERROR&&this.state!==j.State.STOPPED&&(this.state=c.fatal?j.State.ERROR:j.State.IDLE,this.warn(c.details+" while loading frag, switching to "+this.state+" state"));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="audio"&&(this.state===j.State.PARSING||this.state===j.State.PARSED)){var w=!0,y=this.getFwdBufferInfo(this.mediaBuffer,L.PlaylistLevelType.AUDIO);y&&y.len>.5&&(w=!this.reduceMaxBufferLength(y.len)),w&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},A.onBufferFlushed=function(T,c){var w=c.type;w===v.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},A._handleTransmuxComplete=function(T){var c,w="audio",y=this.hls,b=T.remuxResult,U=T.chunkMeta,F=this.getCurrentContext(U);if(!F){this.warn("The loading context changed while buffering fragment "+U.sn+" of level "+U.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(U.level);return}var E=F.frag,N=F.part,I=b.audio,g=b.text,H=b.id3,$=b.initSegment;if(this.fragContextChanged(E))return;if(this.state=j.State.PARSING,this.audioSwitch&&I&&this.completeAudioSwitch(),$!=null&&$.tracks&&(this._bufferInitSegment($.tracks,E,U),y.trigger(B.Events.FRAG_PARSING_INIT_SEGMENT,{frag:E,id:w,tracks:$.tracks})),I){var ie=I.startPTS,oe=I.endPTS,Ce=I.startDTS,ve=I.endDTS;N&&(N.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:ie,endPTS:oe,startDTS:Ce,endDTS:ve}),E.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,ie,oe,Ce,ve),this.bufferFragmentData(I,E,N,U)}if(H!=null&&(c=H.samples)!==null&&c!==void 0&&c.length){var Se=a({frag:E,id:w},H);y.trigger(B.Events.FRAG_PARSING_METADATA,Se)}if(g){var Ae=a({frag:E,id:w},g);y.trigger(B.Events.FRAG_PARSING_USERDATA,Ae)}},A._bufferInitSegment=function(T,c,w){if(this.state!==j.State.PARSING)return;T.video&&delete T.video;var y=T.audio;if(!y)return;y.levelCodec=y.codec,y.id="audio",this.log("Init audio buffer, container:"+y.container+", codecs[parsed]=["+y.codec+"]"),this.hls.trigger(B.Events.BUFFER_CODECS,T);var b=y.initSegment;if(b!=null&&b.byteLength){var U={type:"audio",frag:c,part:null,chunkMeta:w,parent:c.type,data:b};this.hls.trigger(B.Events.BUFFER_APPENDING,U)}this.tick()},A.loadFragment=function(T,c,w){var y=this.fragmentTracker.getState(T);this.fragCurrent=T,(this.audioSwitch||y===G.FragmentState.NOT_LOADED||y===G.FragmentState.PARTIAL)&&(T.sn==="initSegment"?this._loadInitSegment(T):c.live&&!Object(X.isFiniteNumber)(this.initPTS[T.cc])?(this.log("Waiting for video PTS in continuity counter "+T.cc+" of live stream before loading audio fragment "+T.sn+" of level "+this.trackId),this.state=j.State.WAITING_INIT_PTS):(this.startFragRequested=!0,D.prototype.loadFragment.call(this,T,c,w)))},A.completeAudioSwitch=function(){var T=this.hls,c=this.media,w=this.trackId;c&&(this.log("Switching audio track : flushing all audio"),D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,T.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:w})},O}(j.default);J.default=C},"./src/controller/audio-track-controller.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/events.ts"),j=P("./src/errors.ts"),B=P("./src/controller/base-playlist-controller.ts"),K=P("./src/types/loader.ts");function G(p,h){for(var l=0;l=u.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var a=u[this.trackId];this.log("Now switching to audio-track index "+o);var s=u[o],R=s.id,_=s.groupId,C=_===void 0?"":_,D=s.name,O=s.type,A=s.url;if(this.trackId=o,this.trackName=D,this.selectDefaultTrack=!1,this.hls.trigger(X.Events.AUDIO_TRACK_SWITCHING,{id:R,groupId:C,name:D,type:O,url:A}),s.details&&!s.details.live)return;var S=this.switchParams(s.url,a==null?void 0:a.details);this.loadPlaylist(S)},l.selectInitialTrack=function(){var o=this.tracksInGroup;console.assert(o.length,"Initial audio track should be selected when tracks are known");var u=this.trackName,a=this.findTrackId(u)||this.findTrackId();a!==-1?this.setAudioTrack(a):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},l.findTrackId=function(o){for(var u=this.tracksInGroup,a=0;ah.partTarget&&(s+=1)}if(Object(X.isFiniteNumber)(a))return new j.HlsUrlParameters(a,Object(X.isFiniteNumber)(s)?s:void 0,j.HlsSkip.No)}}},v.loadPlaylist=function(p){},v.shouldLoadTrack=function(p){return this.canLoad&&p&&!!p.url&&(!p.details||p.details.live)},v.playlistLoaded=function(p,h,l){var f=this,o=h.details,u=h.stats,a=u.loading.end?Math.max(0,self.performance.now()-u.loading.end):0;if(o.advancedDateTime=Date.now()-a,o.live||l!=null&&l.live){if(o.reloaded(l),l&&this.log("live playlist "+p+" "+(o.advanced?"REFRESHED "+o.lastPartSn+"-"+o.lastPartIndex:"MISSED")),l&&o.fragments.length>0&&Object(B.mergeDetails)(l,o),!this.canLoad||!o.live)return;var s,R=void 0,_=void 0;if(o.canBlockReload&&o.endSN&&o.advanced){var C=this.hls.config.lowLatencyMode,D=o.lastPartSn,O=o.endSN,A=o.lastPartIndex,S=A!==-1,T=D===O,c=C?0:A;S?(R=T?O+1:D,_=T?c:A+1):R=O+1;var w=o.age,y=w+o.ageHeader,b=Math.min(y-o.partTarget,o.targetduration*1.5);if(b>0){if(l&&b>l.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+l.tuneInGoal+" to: "+b+" with playlist age: "+o.age),b=0;else{var U=Math.floor(b/o.targetduration);if(R+=U,_!==void 0){var F=Math.round(b%o.targetduration/o.partTarget);_+=F}this.log("CDN Tune-in age: "+o.ageHeader+"s last advanced "+w.toFixed(2)+"s goal: "+b+" skip sn "+U+" to part "+_)}o.tuneInGoal=b}if(s=this.getDeliveryDirectives(o,h.deliveryDirectives,R,_),C||!T){this.loadPlaylist(s);return}}else s=this.getDeliveryDirectives(o,h.deliveryDirectives,R,_);var E=Object(B.computeReloadInterval)(o,u);R!==void 0&&o.canBlockReload&&(E-=o.partTarget||1),this.log("reload live playlist "+p+" in "+Math.round(E)+" ms"),this.timer=self.setTimeout(function(){return f.loadPlaylist(s)},E)}else this.clearTimer()},v.getDeliveryDirectives=function(p,h,l,f){var o=Object(j.getSkipValue)(p,l);return h!=null&&h.skip&&p.deltaUpdateFailed&&(l=h.msn,f=h.part,o=j.HlsSkip.No),new j.HlsUrlParameters(l,f,o)},v.retryLoadingOrFail=function(p){var h=this,l=this.hls.config,f=this.retryCount-1&&(o=p.context)!==null&&o!==void 0&&o.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+p.details+'"'),this.loadPlaylist();else{var u=Math.min(Math.pow(2,this.retryCount)*l.levelLoadingRetryDelay,l.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return h.loadPlaylist()},u),this.warn("retry playlist loading #"+this.retryCount+" in "+u+' ms after "'+p.details+'"')}}else this.warn('cannot recover from error "'+p.details+'"'),this.clearTimer(),p.fatal=!0;return f},L}()},"./src/controller/base-stream-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"State",function(){return O}),P.d(J,"default",function(){return A});var X=P("./src/polyfills/number.ts"),j=P("./src/task-loop.ts"),B=P("./src/controller/fragment-tracker.ts"),K=P("./src/utils/buffer-helper.ts"),G=P("./src/utils/logger.ts"),r=P("./src/events.ts"),L=P("./src/errors.ts"),v=P("./src/types/transmuxer.ts"),m=P("./src/utils/mp4-tools.ts"),p=P("./src/utils/discontinuities.ts"),h=P("./src/controller/fragment-finders.ts"),l=P("./src/controller/level-helper.ts"),f=P("./src/loader/fragment-loader.ts"),o=P("./src/crypt/decrypter.ts"),u=P("./src/utils/time-ranges.ts"),a=P("./src/types/loader.ts");function s(S,T){for(var c=0;c$;(N0&&N&&N.key&&N.iv&&N.method==="AES-128"){var I=self.performance.now();return b.decrypter.webCryptoDecrypt(new Uint8Array(E),N.key.buffer,N.iv.buffer).then(function(g){var H=self.performance.now();return F.trigger(r.Events.FRAG_DECRYPTED,{frag:y,payload:g,stats:{tstart:I,tdecrypt:H}}),U.payload=g,U})}return U}).then(function(U){var F=b.fragCurrent,E=b.hls,N=b.levels;if(!N)throw new Error("init load aborted, missing levels");var I=N[y.level].details;console.assert(I,"Level details are defined when init segment is loaded");var g=y.stats;b.state=O.IDLE,b.fragLoadError=0,y.data=new Uint8Array(U.payload),g.parsing.start=g.buffering.start=self.performance.now(),g.parsing.end=g.buffering.end=self.performance.now(),U.frag===F&&E.trigger(r.Events.FRAG_BUFFERED,{stats:g,frag:F,part:null,id:y.type}),b.tick()}).catch(function(U){b.warn(U),b.resetFragmentLoading(y)})},c.fragContextChanged=function(y){var b=this.fragCurrent;return!y||!b||y.level!==b.level||y.sn!==b.sn||y.urlId!==b.urlId},c.fragBufferedComplete=function(y,b){var U=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+y.type+" sn: "+y.sn+(b?" part: "+b.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level+" "+u.default.toString(K.BufferHelper.getBuffered(U))),this.state=O.IDLE,this.tick()},c._handleFragmentLoadComplete=function(y){var b=this.transmuxer;if(!b)return;var U=y.frag,F=y.part,E=y.partsLoaded,N=!E||E.length===0||E.some(function(g){return!g}),I=new v.ChunkMetadata(U.level,U.sn,U.stats.chunkCount+1,0,F?F.index:-1,!N);b.flush(I)},c._handleFragmentLoadProgress=function(y){},c._doFragLoad=function(y,b,U,F){var E=this;if(U===void 0&&(U=null),!this.levels)throw new Error("frag load aborted, missing levels");if(U=Math.max(y.start,U||0),this.config.lowLatencyMode&&b){var N=b.partList;if(N&&F){U>y.end&&b.fragmentHint&&(y=b.fragmentHint);var I=this.getNextPart(N,y,U);if(I>-1){var g=N[I];return this.log("Loading part sn: "+y.sn+" p: "+g.index+" cc: "+y.cc+" of playlist ["+b.startSN+"-"+b.endSN+"] parts [0-"+I+"-"+(N.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(U.toFixed(3))),this.nextLoadPosition=g.start+g.duration,this.state=O.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:y,part:N[I],targetBufferTime:U}),this.doFragPartsLoad(y,N,I,F).catch(function(H){return E.handleFragLoadError(H)})}else if(!y.url||this.loadedEndOfParts(N,U))return Promise.resolve(null)}}return this.log("Loading fragment "+y.sn+" cc: "+y.cc+" "+(b?"of ["+b.startSN+"-"+b.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(U.toFixed(3))),Object(X.isFiniteNumber)(y.sn)&&!this.bitrateTest&&(this.nextLoadPosition=y.start+y.duration),this.state=O.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:y,targetBufferTime:U}),this.fragmentLoader.load(y,F).catch(function(H){return E.handleFragLoadError(H)})},c.doFragPartsLoad=function(y,b,U,F){var E=this;return new Promise(function(N,I){var g=[],H=function $(ie){var oe=b[ie];E.fragmentLoader.loadPart(y,oe,F).then(function(Ce){g[oe.index]=Ce;var ve=Ce.part;E.hls.trigger(r.Events.FRAG_LOADED,Ce);var Se=b[ie+1];if(Se&&Se.fragment===y)$(ie+1);else return N({frag:y,part:ve,partsLoaded:g})}).catch(I)};H(U)})},c.handleFragLoadError=function(y){var b=y.data;return b&&b.details===L.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(b.frag,b.part):this.hls.trigger(r.Events.ERROR,b),null},c._handleTransmuxerFlush=function(y){var b=this.getCurrentContext(y);if(!b||this.state!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var U=b.frag,F=b.part,E=b.level,N=self.performance.now();U.stats.parsing.end=N,F&&(F.stats.parsing.end=N),this.updateLevelTiming(U,F,E,y.partial)},c.getCurrentContext=function(y){var b=this.levels,U=y.level,F=y.sn,E=y.part;if(!b||!b[U])return this.warn("Levels object was unset while buffering fragment "+F+" of level "+U+". The current chunk will not be buffered."),null;var N=b[U],I=E>-1?Object(l.getPartWith)(N,F,E):null,g=I?I.fragment:Object(l.getFragmentWithSN)(N,F,this.fragCurrent);return g?{frag:g,part:I,level:N}:null},c.bufferFragmentData=function(y,b,U,F){if(!y||this.state!==O.PARSING)return;var E=y.data1,N=y.data2,I=E;if(E&&N&&(I=Object(m.appendUint8Array)(E,N)),!I||!I.length)return;var g={type:y.type,frag:b,part:U,chunkMeta:F,parent:b.type,data:I};this.hls.trigger(r.Events.BUFFER_APPENDING,g),y.dropped&&y.independent&&!U&&this.flushBufferGap(b)},c.flushBufferGap=function(y){var b=this.media;if(!b)return;if(!K.BufferHelper.isBuffered(b,b.currentTime)){this.flushMainBuffer(0,y.start);return}var U=b.currentTime,F=K.BufferHelper.bufferInfo(b,U,0),E=y.duration,N=Math.min(this.config.maxFragLookUpTolerance*2,E*.25),I=Math.max(Math.min(y.start-N,F.end-N),U+N);y.start-I>N&&this.flushMainBuffer(I,y.start)},c.getFwdBufferInfo=function(y,b){var U=this.config,F=this.getLoadPosition();if(!Object(X.isFiniteNumber)(F))return null;var E=K.BufferHelper.bufferInfo(y,F,U.maxBufferHole);if(E.len===0&&E.nextStart!==void 0){var N=this.fragmentTracker.getBufferedFrag(F,b);if(N&&E.nextStart=U?(b.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+b.maxMaxBufferLength+"s"),!0):!1},c.getNextFragment=function(y,b){var U,F,E=b.fragments,N=E.length;if(!N)return null;var I=this.config,g=E[0].start,H;if(b.live){var $=I.initialLiveManifestSize;if(N<$)return this.warn("Not enough fragments to start playback (have: "+N+", need: "+$+")"),null;!b.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(H=this.getInitialLiveFragment(b,E),this.startPosition=H?this.hls.liveSyncPosition||H.start:y)}else y<=g&&(H=E[0]);if(!H){var ie=I.lowLatencyMode?b.partEnd:b.fragmentEnd;H=this.getFragmentAtPosition(y,ie,b)}return(U=H)!==null&&U!==void 0&&U.initSegment&&!((F=H)!==null&&F!==void 0&&F.initSegment.data)&&!this.bitrateTest&&(H=H.initSegment),H},c.getNextPart=function(y,b,U){for(var F=-1,E=!1,N=!0,I=0,g=y.length;I-1&&UU.start&&U.loaded},c.getInitialLiveFragment=function(y,b){var U=this.fragPrevious,F=null;if(U){if(y.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+U.programDateTime),F=Object(h.findFragmentByPDT)(b,U.endProgramDateTime,this.config.maxFragLookUpTolerance)),!F){var E=U.sn+1;if(E>=y.startSN&&E<=y.endSN){var N=b[E-y.startSN];U.cc===N.cc&&(F=N,this.log("Live playlist, switching playlist, load frag with next SN: "+F.sn))}F||(F=Object(h.findFragWithCC)(b,U.cc),F&&this.log("Live playlist, switching playlist, load frag with same CC: "+F.sn))}}else{var I=this.hls.liveSyncPosition;I!==null&&(F=this.getFragmentAtPosition(I,this.bitrateTest?y.fragmentEnd:y.edge,y))}return F},c.getFragmentAtPosition=function(y,b,U){var F=this.config,E=this.fragPrevious,N=U.fragments,I=U.endSN,g=U.fragmentHint,H=F.maxFragLookUpTolerance,$=!!(F.lowLatencyMode&&U.partList&&g);$&&g&&!this.bitrateTest&&(N=N.concat(g),I=g.sn);var ie;if(yb-H?0:H;ie=Object(h.findFragmentByPTS)(E,N,y,oe)}else ie=N[N.length-1];if(ie){var Ce=ie.sn-U.startSN,ve=E&&ie.level===E.level,Se=N[Ce+1],Ae=this.fragmentTracker.getState(ie);if(Ae===B.FragmentState.BACKTRACKED){ie=null;for(var Oe=Ce;N[Oe]&&this.fragmentTracker.getState(N[Oe])===B.FragmentState.BACKTRACKED;)E?ie=N[Oe--]:ie=N[--Oe];ie||(ie=Se)}else E&&ie.sn===E.sn&&!$&&(ve&&(ie.sn=N-b.maxFragLookUpTolerance&&E<=I;if(F!==null&&U.duration>F&&(E"+y.startSN+" prev-sn: "+(E?E.sn:"na")+" fragments: "+I),ie}return g},c.waitForCdnTuneIn=function(y){var b=3;return y.live&&y.canBlockReload&&y.tuneInGoal>Math.max(y.partHoldBack,y.partTarget*b)},c.setStartPosition=function(y,b){var U=this.startPosition;if(U"+y))}}]),T}(j.default)},"./src/controller/buffer-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return h});var X=P("./src/polyfills/number.ts"),j=P("./src/events.ts"),B=P("./src/utils/logger.ts"),K=P("./src/errors.ts"),G=P("./src/utils/buffer-helper.ts"),r=P("./src/utils/mediasource-helper.ts"),L=P("./src/loader/fragment.ts"),v=P("./src/controller/buffer-operation-queue.ts"),m=Object(r.getMediaSource)(),p=/([ha]vc.)(?:\.[^.,]+)+/,h=function(){function l(o){var u=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var a=u.hls,s=u.media,R=u.mediaSource;B.logger.log("[buffer-controller]: Media source opened"),s&&(u.updateMediaElementDuration(),a.trigger(j.Events.MEDIA_ATTACHED,{media:s})),R&&R.removeEventListener("sourceopen",u._onMediaSourceOpen),u.checkPendingTracks()},this._onMediaSourceClose=function(){B.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){B.logger.log("[buffer-controller]: Media source ended")},this.hls=o,this._initSourceBuffer(),this.registerListeners()}var f=l.prototype;return f.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},f.destroy=function(){this.unregisterListeners(),this.details=null},f.registerListeners=function(){var u=this.hls;u.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(j.Events.BUFFER_RESET,this.onBufferReset,this),u.on(j.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.on(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.on(j.Events.BUFFER_EOS,this.onBufferEos,this),u.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.on(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.on(j.Events.FRAG_PARSED,this.onFragParsed,this),u.on(j.Events.FRAG_CHANGED,this.onFragChanged,this)},f.unregisterListeners=function(){var u=this.hls;u.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(j.Events.BUFFER_RESET,this.onBufferReset,this),u.off(j.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.off(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.off(j.Events.BUFFER_EOS,this.onBufferEos,this),u.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.off(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.off(j.Events.FRAG_PARSED,this.onFragParsed,this),u.off(j.Events.FRAG_CHANGED,this.onFragChanged,this)},f._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new v.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},f.onManifestParsed=function(u,a){var s=2;(a.audio&&!a.video||!a.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.details=null,B.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},f.onMediaAttaching=function(u,a){var s=this.media=a.media;if(s&&m){var R=this.mediaSource=new m;R.addEventListener("sourceopen",this._onMediaSourceOpen),R.addEventListener("sourceended",this._onMediaSourceEnded),R.addEventListener("sourceclose",this._onMediaSourceClose),s.src=self.URL.createObjectURL(R),this._objectUrl=s.src}},f.onMediaDetaching=function(){var u=this.media,a=this.mediaSource,s=this._objectUrl;if(a){if(B.logger.log("[buffer-controller]: media source detaching"),a.readyState==="open")try{a.endOfStream()}catch(R){B.logger.warn("[buffer-controller]: onMediaDetaching: "+R.message+" while calling endOfStream")}this.onBufferReset(),a.removeEventListener("sourceopen",this._onMediaSourceOpen),a.removeEventListener("sourceended",this._onMediaSourceEnded),a.removeEventListener("sourceclose",this._onMediaSourceClose),u&&(s&&self.URL.revokeObjectURL(s),u.src===s?(u.removeAttribute("src"),u.load()):B.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(j.Events.MEDIA_DETACHED,void 0)},f.onBufferReset=function(){var u=this;this.getSourceBufferTypes().forEach(function(a){var s=u.sourceBuffer[a];try{s&&(u.removeBufferListeners(a),u.mediaSource&&u.mediaSource.removeSourceBuffer(s),u.sourceBuffer[a]=void 0)}catch(R){B.logger.warn("[buffer-controller]: Failed to reset the "+a+" buffer",R)}}),this._initSourceBuffer()},f.onBufferCodecs=function(u,a){var s=this,R=this.getSourceBufferTypes().length;if(Object.keys(a).forEach(function(_){if(R){var C=s.tracks[_];if(C&&typeof C.buffer.changeType=="function"){var D=a[_],O=D.codec,A=D.levelCodec,S=D.container,T=(C.levelCodec||C.codec).replace(p,"$1"),c=(A||O).replace(p,"$1");if(T!==c){var w=S+";codecs="+(A||O);s.appendChangeType(_,w)}}}else s.pendingTracks[_]=a[_]}),R)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},f.appendChangeType=function(u,a){var s=this,R=this.operationQueue,_={execute:function(){var D=s.sourceBuffer[u];D&&(B.logger.log("[buffer-controller]: changing "+u+" sourceBuffer type to "+a),D.changeType(a)),R.shiftAndExecuteNext(u)},onStart:function(){},onComplete:function(){},onError:function(D){B.logger.warn("[buffer-controller]: Failed to change "+u+" SourceBuffer type",D)}};R.append(_,u)},f.onBufferAppending=function(u,a){var s=this,R=this.hls,_=this.operationQueue,C=this.tracks,D=a.data,O=a.type,A=a.frag,S=a.part,T=a.chunkMeta,c=T.buffering[O],w=self.performance.now();c.start=w;var y=A.stats.buffering,b=S?S.stats.buffering:null;y.start===0&&(y.start=w),b&&b.start===0&&(b.start=w);var U=C.audio,F=O==="audio"&&T.id===1&&(U==null?void 0:U.container)==="audio/mpeg",E={execute:function(){if(c.executeStart=self.performance.now(),F){var I=s.sourceBuffer[O];if(I){var g=A.start-I.timestampOffset;Math.abs(g)>=.1&&(B.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+A.start+" (delta: "+g+") sn: "+A.sn+")"),I.timestampOffset=A.start)}}s.appendExecutor(D,O)},onStart:function(){},onComplete:function(){var I=self.performance.now();c.executeEnd=c.end=I,y.first===0&&(y.first=I),b&&b.first===0&&(b.first=I);var g=s.sourceBuffer,H={};for(var $ in g)H[$]=G.BufferHelper.getBuffered(g[$]);s.appendError=0,s.hls.trigger(j.Events.BUFFER_APPENDED,{type:O,frag:A,part:S,chunkMeta:T,parent:A.type,timeRanges:H})},onError:function(I){B.logger.error("[buffer-controller]: Error encountered while trying to append to the "+O+" SourceBuffer",I);var g={type:K.ErrorTypes.MEDIA_ERROR,parent:A.type,details:K.ErrorDetails.BUFFER_APPEND_ERROR,err:I,fatal:!1};I.code===DOMException.QUOTA_EXCEEDED_ERR?g.details=K.ErrorDetails.BUFFER_FULL_ERROR:(s.appendError++,g.details=K.ErrorDetails.BUFFER_APPEND_ERROR,s.appendError>R.config.appendErrorMaxRetry&&(B.logger.error("[buffer-controller]: Failed "+R.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),g.fatal=!0)),R.trigger(j.Events.ERROR,g)}};_.append(E,O)},f.onBufferFlushing=function(u,a){var s=this,R=this.operationQueue,_=function(D){return{execute:s.removeExecutor.bind(s,D,a.startOffset,a.endOffset),onStart:function(){},onComplete:function(){s.hls.trigger(j.Events.BUFFER_FLUSHED,{type:D})},onError:function(A){B.logger.warn("[buffer-controller]: Failed to remove from "+D+" SourceBuffer",A)}}};a.type?R.append(_(a.type),a.type):this.getSourceBufferTypes().forEach(function(C){R.append(_(C),C)})},f.onFragParsed=function(u,a){var s=this,R=a.frag,_=a.part,C=[],D=_?_.elementaryStreams:R.elementaryStreams;D[L.ElementaryStreamTypes.AUDIOVIDEO]?C.push("audiovideo"):(D[L.ElementaryStreamTypes.AUDIO]&&C.push("audio"),D[L.ElementaryStreamTypes.VIDEO]&&C.push("video"));var O=function(){var S=self.performance.now();R.stats.buffering.end=S,_&&(_.stats.buffering.end=S);var T=_?_.stats:R.stats;s.hls.trigger(j.Events.FRAG_BUFFERED,{frag:R,part:_,stats:T,id:R.type})};C.length===0&&B.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+R.type+" level: "+R.level+" sn: "+R.sn),this.blockBuffers(O,C)},f.onFragChanged=function(u,a){this.flushBackBuffer()},f.onBufferEos=function(u,a){var s=this,R=this.getSourceBufferTypes().reduce(function(_,C){var D=s.sourceBuffer[C];return(!a.type||a.type===C)&&(D&&!D.ended&&(D.ended=!0,B.logger.log("[buffer-controller]: "+C+" sourceBuffer now EOS"))),_&&!!(!D||D.ended)},!0);R&&this.blockBuffers(function(){var _=s.mediaSource;if(!_||_.readyState!=="open")return;_.endOfStream()})},f.onLevelUpdated=function(u,a){var s=a.details;if(!s.fragments.length)return;this.details=s,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},f.flushBackBuffer=function(){var u=this.hls,a=this.details,s=this.media,R=this.sourceBuffer;if(!s||a===null)return;var _=this.getSourceBufferTypes();if(!_.length)return;var C=a.live&&u.config.liveBackBufferLength!==null?u.config.liveBackBufferLength:u.config.backBufferLength;if(!Object(X.isFiniteNumber)(C)||C<0)return;var D=s.currentTime,O=a.levelTargetDuration,A=Math.max(C,O),S=Math.floor(D/O)*O-A;_.forEach(function(T){var c=R[T];if(c){var w=G.BufferHelper.getBuffered(c);w.length>0&&S>w.start(0)&&(u.trigger(j.Events.BACK_BUFFER_REACHED,{bufferEnd:S}),a.live&&u.trigger(j.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:S}),u.trigger(j.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:S,type:T}))}})},f.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var u=this.details,a=this.hls,s=this.media,R=this.mediaSource,_=u.fragments[0].start+u.totalduration,C=s.duration,D=Object(X.isFiniteNumber)(R.duration)?R.duration:0;u.live&&a.config.liveDurationInfinity?(B.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),R.duration=Infinity,this.updateSeekableRange(u)):(_>D&&_>C||!Object(X.isFiniteNumber)(C))&&(B.logger.log("[buffer-controller]: Updating Media Source duration to "+_.toFixed(3)),R.duration=_)},f.updateSeekableRange=function(u){var a=this.mediaSource,s=u.fragments,R=s.length;if(R&&u.live&&a!==null&&a!==void 0&&a.setLiveSeekableRange){var _=Math.max(0,s[0].start),C=Math.max(_,_+u.totalduration);a.setLiveSeekableRange(_,C)}},f.checkPendingTracks=function(){var u=this.bufferCodecEventsExpected,a=this.operationQueue,s=this.pendingTracks,R=Object.keys(s).length;if(R&&!u||R===2){this.createSourceBuffers(s),this.pendingTracks={};var _=this.getSourceBufferTypes();if(_.length===0){this.hls.trigger(j.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}_.forEach(function(C){a.executeNext(C)})}},f.createSourceBuffers=function(u){var a=this.sourceBuffer,s=this.mediaSource;if(!s)throw Error("createSourceBuffers called when mediaSource was null");var R=0;for(var _ in u)if(!a[_]){var C=u[_];if(!C)throw Error("source buffer exists for track "+_+", however track does not");var D=C.levelCodec||C.codec,O=C.container+";codecs="+D;B.logger.log("[buffer-controller]: creating sourceBuffer("+O+")");try{var A=a[_]=s.addSourceBuffer(O),S=_;this.addBufferListener(S,"updatestart",this._onSBUpdateStart),this.addBufferListener(S,"updateend",this._onSBUpdateEnd),this.addBufferListener(S,"error",this._onSBUpdateError),this.tracks[_]={buffer:A,codec:D,container:C.container,levelCodec:C.levelCodec,id:C.id},R++}catch(T){B.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+T.message),this.hls.trigger(j.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:T,mimeType:O})}}R&&this.hls.trigger(j.Events.BUFFER_CREATED,{tracks:this.tracks})},f._onSBUpdateStart=function(u){var a=this.operationQueue,s=a.current(u);s.onStart()},f._onSBUpdateEnd=function(u){var a=this.operationQueue,s=a.current(u);s.onComplete(),a.shiftAndExecuteNext(u)},f._onSBUpdateError=function(u,a){B.logger.error("[buffer-controller]: "+u+" SourceBuffer error",a),this.hls.trigger(j.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var s=this.operationQueue.current(u);s&&s.onError(a)},f.removeExecutor=function(u,a,s){var R=this.media,_=this.mediaSource,C=this.operationQueue,D=this.sourceBuffer,O=D[u];if(!R||!_||!O){B.logger.warn("[buffer-controller]: Attempting to remove from the "+u+" SourceBuffer, but it does not exist"),C.shiftAndExecuteNext(u);return}var A=Object(X.isFiniteNumber)(R.duration)?R.duration:Infinity,S=Object(X.isFiniteNumber)(_.duration)?_.duration:Infinity,T=Math.max(0,a),c=Math.min(s,A,S);c>T?(B.logger.log("[buffer-controller]: Removing ["+T+","+c+"] from the "+u+" SourceBuffer"),console.assert(!O.updating,u+" sourceBuffer must not be updating"),O.remove(T,c)):C.shiftAndExecuteNext(u)},f.appendExecutor=function(u,a){var s=this.operationQueue,R=this.sourceBuffer,_=R[a];if(!_){B.logger.warn("[buffer-controller]: Attempting to append to the "+a+" SourceBuffer, but it does not exist"),s.shiftAndExecuteNext(a);return}_.ended=!1,console.assert(!_.updating,a+" sourceBuffer must not be updating"),_.appendBuffer(u)},f.blockBuffers=function(u,a){var s=this;if(a===void 0&&(a=this.getSourceBufferTypes()),!a.length){B.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(u);return}var R=this.operationQueue,_=a.map(function(C){return R.appendBlocker(C)});Promise.all(_).then(function(){u(),a.forEach(function(C){var D=s.sourceBuffer[C];(!D||!D.updating)&&R.shiftAndExecuteNext(C)})})},f.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},f.addBufferListener=function(u,a,s){var R=this.sourceBuffer[u];if(!R)return;var _=s.bind(this,u);this.listeners[u].push({event:a,listener:_}),R.addEventListener(a,_)},f.removeBufferListeners=function(u){var a=this.sourceBuffer[u];if(!a)return;this.listeners[u].forEach(function(s){a.removeEventListener(s.event,s.listener)})},l}()},"./src/controller/buffer-operation-queue.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return j});var X=P("./src/utils/logger.ts"),j=function(){function B(G){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=G}var K=B.prototype;return K.append=function(r,L){var v=this.queues[L];v.push(r),v.length===1&&this.buffers[L]&&this.executeNext(L)},K.insertAbort=function(r,L){var v=this.queues[L];v.unshift(r),this.executeNext(L)},K.appendBlocker=function(r){var L,v=new Promise(function(p){L=p}),m={execute:L,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,r),v},K.executeNext=function(r){var L=this.buffers,v=this.queues,m=L[r],p=v[r];if(p.length){var h=p[0];try{h.execute()}catch(l){X.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),h.onError(l),(!m||!m.updating)&&(p.shift(),this.executeNext(r))}}},K.shiftAndExecuteNext=function(r){this.queues[r].shift(),this.executeNext(r)},K.current=function(r){return this.queues[r][0]},B}()},"./src/controller/cap-level-controller.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/events.ts");function j(G,r){for(var L=0;L0&&this.mediaWidth>0){var v=this.hls.levels;if(v.length){var m=this.hls;m.autoLevelCapping=this.getMaxLevel(v.length-1),m.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=m.autoLevelCapping}}},r.getMaxLevel=function(v){var m=this,p=this.hls.levels;if(!p.length)return-1;var h=p.filter(function(l,f){return G.isLevelAllowed(f,m.restrictedLevels)&&f<=v});return this.clientRect=null,G.getMaxLevelByMediaSize(h,this.mediaWidth,this.mediaHeight)},r.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},r.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},r.getDimensions=function(){if(this.clientRect)return this.clientRect;var v=this.media,m={width:0,height:0};if(v){var p=v.getBoundingClientRect();m.width=p.width,m.height=p.height,!m.width&&!m.height&&(m.width=p.right-p.left||v.width||0,m.height=p.bottom-p.top||v.height||0)}return this.clientRect=m,m},G.isLevelAllowed=function(v,m){return m===void 0&&(m=[]),m.indexOf(v)===-1},G.getMaxLevelByMediaSize=function(v,m,p){if(!v||!v.length)return-1;for(var h=function(a,s){return s?a.width!==s.width||a.height!==s.height:!0},l=v.length-1,f=0;f=m||o.height>=p)&&h(o,v[f+1])){l=f;break}}return l},B(G,[{key:"mediaWidth",get:function(){return this.getDimensions().width*G.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*G.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var v=1;try{v=self.devicePixelRatio}catch(m){}return v}}]),G}();J.default=K},"./src/controller/cmcd-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return h});var X=P("./src/events.ts"),j=P("./src/types/cmcd.ts"),B=P("./src/utils/buffer-helper.ts"),K=P("./src/utils/logger.ts");function G(l,f){for(var o=0;o=l.length?{done:!0}:{done:!1,value:l[u++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v(l,f){if(!l)return;if(typeof l=="string")return m(l,f);var o=Object.prototype.toString.call(l).slice(8,-1);if(o==="Object"&&l.constructor&&(o=l.constructor.name),o==="Map"||o==="Set")return Array.from(l);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return m(l,f)}function m(l,f){(f==null||f>l.length)&&(f=l.length);for(var o=0,u=new Array(f);oa&&(a=C.bitrate)}return a>0?a:NaN},f.getBufferLength=function(u){var a=this.hls.media,s=u===j.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!s||!a)return NaN;var R=B.BufferHelper.bufferInfo(s,a.currentTime,this.config.maxBufferHole);return R.len*1e3},f.createPlaylistLoader=function(){var u=this.config.pLoader,a=this.applyPlaylistData,s=u||this.config.loader;return function(){function R(C){this.loader=void 0,this.loader=new s(C)}var _=R.prototype;return _.destroy=function(){this.loader.destroy()},_.abort=function(){this.loader.abort()},_.load=function(D,O,A){a(D),this.loader.load(D,O,A)},r(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},f.createFragmentLoader=function(){var u=this.config.fLoader,a=this.applyFragmentData,s=u||this.config.loader;return function(){function R(C){this.loader=void 0,this.loader=new s(C)}var _=R.prototype;return _.destroy=function(){this.loader.destroy()},_.abort=function(){this.loader.abort()},_.load=function(D,O,A){a(D),this.loader.load(D,O,A)},r(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},l.uuid=function(){var u=URL.createObjectURL(new Blob),a=u.toString();return URL.revokeObjectURL(u),a.substr(a.lastIndexOf("/")+1)},l.serialize=function(u){for(var a=[],s=function(F){return!Number.isNaN(F)&&F!=null&&F!==""&&F!==!1},R=function(F){return Math.round(F)},_=function(F){return R(F/100)*100},C=function(F){return encodeURIComponent(F)},D={br:R,d:R,bl:_,dl:_,mtp:_,nor:C,rtp:_,tb:R},O=Object.keys(u||{}).sort(),A=L(O),S;!(S=A()).done;){var T=S.value,c=u[T];if(!s(c))continue;if(T==="v"&&c===1)continue;if(T=="pr"&&c===1)continue;var w=D[T];w&&(c=w(c));var y=typeof c,b=void 0;T==="ot"||T==="sf"||T==="st"?b=T+"="+c:y==="boolean"?b=T:y==="number"?b=T+"="+c:b=T+"="+JSON.stringify(c),a.push(b)}return a.join(",")},l.toHeaders=function(u){for(var a=Object.keys(u),s={},R=["Object","Request","Session","Status"],_=[{},{},{},{}],C={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},D=0,O=a;DL){this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var C=L-this._requestLicenseFailureCount+1;B.logger.warn("Retrying license request, "+C+" attempts left"),this._requestLicense(a,s)}break}},l._generateLicenseRequestChallenge=function(o,u){switch(o.mediaKeySystemDomain){case K.KeySystems.WIDEVINE:return u}throw new Error("unsupported key-system: "+o.mediaKeySystemDomain)},l._requestLicense=function(o,u){B.logger.log("Requesting content license for key-system");var a=this._mediaKeysList[0];if(!a){B.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var s=this.getLicenseServerUrl(a.mediaKeySystemDomain),R=this._createLicenseXhr(s,o,u);B.logger.log("Sending license request to URL: "+s);var _=this._generateLicenseRequestChallenge(a,o);R.send(_)}catch(C){B.logger.error("Failure requesting DRM license: "+C),this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},l.onMediaAttached=function(o,u){if(!this._emeEnabled)return;var a=u.media;this._media=a,a.addEventListener("encrypted",this._onMediaEncrypted)},l.onMediaDetached=function(){var o=this._media,u=this._mediaKeysList;if(!o)return;o.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(u.map(function(a){if(a.mediaKeysSession)return a.mediaKeysSession.close().catch(function(){})})).then(function(){return o.setMediaKeys(null)}).catch(function(){})},l.onManifestParsed=function(o,u){if(!this._emeEnabled)return;var a=u.levels.map(function(R){return R.audioCodec}).filter(function(R){return!!R}),s=u.levels.map(function(R){return R.videoCodec}).filter(function(R){return!!R});this._attemptKeySystemAccess(K.KeySystems.WIDEVINE,a,s)},r(h,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),h}();J.default=p},"./src/controller/fps-controller.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/events.ts"),j=P("./src/utils/logger.ts"),B=function(){function K(r){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=r,this.registerListeners()}var G=K.prototype;return G.setStreamController=function(L){this.streamController=L},G.registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},G.unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching)},G.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},G.onMediaAttaching=function(L,v){var m=this.hls.config;if(m.capLevelOnFPSDrop){var p=v.media instanceof self.HTMLVideoElement?v.media:null;this.media=p,p&&typeof p.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},G.checkFPS=function(L,v,m){var p=performance.now();if(v){if(this.lastTime){var h=p-this.lastTime,l=m-this.lastDroppedFrames,f=v-this.lastDecodedFrames,o=1e3*l/h,u=this.hls;if(u.trigger(X.Events.FPS_DROP,{currentDropped:l,currentDecoded:f,totalDroppedFrames:m}),o>0&&l>u.config.fpsDroppedMonitoringThreshold*f){var a=u.currentLevel;j.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+a),a>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=a)&&(a=a-1,u.trigger(X.Events.FPS_DROP_LEVEL_CAPPING,{level:a,droppedLevel:u.currentLevel}),u.autoLevelCapping=a,this.streamController.nextLevelSwitch())}}this.lastTime=p,this.lastDroppedFrames=m,this.lastDecodedFrames=v}},G.checkFPSInterval=function(){var L=this.media;if(L)if(this.isVideoPlaybackQualityAvailable){var v=L.getVideoPlaybackQuality();this.checkFPS(L,v.totalVideoFrames,v.droppedVideoFrames)}else this.checkFPS(L,L.webkitDecodedFrameCount,L.webkitDroppedFrameCount)},K}();J.default=B},"./src/controller/fragment-finders.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"findFragmentByPDT",function(){return B}),P.d(J,"findFragmentByPTS",function(){return K}),P.d(J,"fragmentWithinToleranceTest",function(){return G}),P.d(J,"pdtWithinToleranceTest",function(){return r}),P.d(J,"findFragWithCC",function(){return L});var X=P("./src/polyfills/number.ts"),j=P("./src/utils/binary-search.ts");function B(v,m,p){if(m===null||!Array.isArray(v)||!v.length||!Object(X.isFiniteNumber)(m))return null;var h=v[0].programDateTime;if(m<(h||0))return null;var l=v[v.length-1].endProgramDateTime;if(m>=(l||0))return null;p=p||0;for(var f=0;fv&&p.start?-1:0}function r(v,m,p){var h=Math.min(m,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3,l=p.endProgramDateTime||0;return l-h>v}function L(v,m){return j.default.search(v,function(p){return p.ccm?-1:0})}},"./src/controller/fragment-tracker.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"FragmentState",function(){return B}),P.d(J,"FragmentTracker",function(){return K});var X=P("./src/events.ts"),j=P("./src/types/loader.ts"),B;(function(L){L.NOT_LOADED="NOT_LOADED",L.BACKTRACKED="BACKTRACKED",L.APPENDING="APPENDING",L.PARTIAL="PARTIAL",L.OK="OK"})(B||(B={}));var K=function(){function L(m){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=m,this._registerListeners()}var v=L.prototype;return v._registerListeners=function(){var p=this.hls;p.on(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.on(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.on(X.Events.FRAG_LOADED,this.onFragLoaded,this)},v._unregisterListeners=function(){var p=this.hls;p.off(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.off(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.off(X.Events.FRAG_LOADED,this.onFragLoaded,this)},v.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},v.getAppendedFrag=function(p,h){if(h===j.PlaylistLevelType.MAIN){var l=this.activeFragment,f=this.activeParts;if(!l)return null;if(f)for(var o=f.length;o--;){var u=f[o],a=u?u.end:l.appendedPTS;if(u.start<=p&&a!==void 0&&p<=a)return o>9&&(this.activeParts=f.slice(o-9)),u}else if(l.start<=p&&l.appendedPTS!==void 0&&p<=l.appendedPTS)return l}return this.getBufferedFrag(p,h)},v.getBufferedFrag=function(p,h){for(var l=this.fragments,f=Object.keys(l),o=f.length;o--;){var u=l[f[o]];if((u==null?void 0:u.body.type)===h&&u.buffered){var a=u.body;if(a.start<=p&&p<=a.end)return a}}return null},v.detectEvictedFragments=function(p,h,l){var f=this;Object.keys(this.fragments).forEach(function(o){var u=f.fragments[o];if(!u)return;if(!u.buffered){u.body.type===l&&f.removeFragment(u.body);return}var a=u.range[p];if(!a)return;a.time.some(function(s){var R=!f.isTimeBuffered(s.startPTS,s.endPTS,h);return R&&f.removeFragment(u.body),R})})},v.detectPartialFragments=function(p){var h=this,l=this.timeRanges,f=p.frag,o=p.part;if(!l||f.sn==="initSegment")return;var u=r(f),a=this.fragments[u];if(!a)return;Object.keys(l).forEach(function(s){var R=f.elementaryStreams[s];if(!R)return;var _=l[s],C=o!==null||R.partial===!0;a.range[s]=h.getBufferedTimes(f,o,C,_)}),a.backtrack=a.loaded=null,Object.keys(a.range).length?a.buffered=!0:this.removeFragment(a.body)},v.fragBuffered=function(p){var h=r(p),l=this.fragments[h];l&&(l.backtrack=l.loaded=null,l.buffered=!0)},v.getBufferedTimes=function(p,h,l,f){for(var o={time:[],partial:l},u=h?h.start:p.start,a=h?h.end:p.end,s=p.minEndPTS||a,R=p.maxStartPTS||u,_=0;_=C&&s<=D){o.time.push({startPTS:Math.max(u,f.start(_)),endPTS:Math.min(a,f.end(_))});break}else if(uC)o.partial=!0,o.time.push({startPTS:Math.max(u,f.start(_)),endPTS:Math.min(a,f.end(_))});else if(a<=C)break}return o},v.getPartialFragment=function(p){var h=null,l,f,o,u=0,a=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach(function(R){var _=s[R];if(!_)return;G(_)&&(f=_.body.start-a,o=_.body.end+a,p>=f&&p<=o&&(l=Math.min(p-f,o-p),u<=l&&(h=_.body,u=l)))}),h},v.getState=function(p){var h=r(p),l=this.fragments[h];return l?l.buffered?G(l)?B.PARTIAL:B.OK:l.backtrack?B.BACKTRACKED:B.APPENDING:B.NOT_LOADED},v.backtrack=function(p,h){var l=r(p),f=this.fragments[l];if(!f||f.backtrack)return null;var o=f.backtrack=h||f.loaded;return f.loaded=null,o},v.getBacktrackData=function(p){var h=r(p),l=this.fragments[h];if(l){var f,o=l.backtrack;if(o!=null&&(f=o.payload)!==null&&f!==void 0&&f.byteLength)return o;this.removeFragment(p)}return null},v.isTimeBuffered=function(p,h,l){for(var f,o,u=0;u=f&&h<=o)return!0;if(h<=f)return!1}return!1},v.onFragLoaded=function(p,h){var l=h.frag,f=h.part;if(l.sn==="initSegment"||l.bitrateTest||f)return;var o=r(l);this.fragments[o]={body:l,loaded:h,backtrack:null,buffered:!1,range:Object.create(null)}},v.onBufferAppended=function(p,h){var l=this,f=h.frag,o=h.part,u=h.timeRanges;if(f.type===j.PlaylistLevelType.MAIN)if(this.activeFragment=f,o){var a=this.activeParts;a||(this.activeParts=a=[]),a.push(o)}else this.activeParts=null;this.timeRanges=u,Object.keys(u).forEach(function(s){var R=u[s];if(l.detectEvictedFragments(s,R),!o)for(var _=0;_p&&f.removeFragment(a)}})},v.removeFragment=function(p){var h=r(p);p.stats.loaded=0,p.clearElementaryStreamInfo(),delete this.fragments[h]},v.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},L}();function G(L){var v,m;return L.buffered&&(((v=L.range.video)===null||v===void 0?void 0:v.partial)||((m=L.range.audio)===null||m===void 0?void 0:m.partial))}function r(L){return L.type+"_"+L.level+"_"+L.urlId+"_"+L.sn}},"./src/controller/gap-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"STALL_MINIMUM_DURATION_MS",function(){return G}),P.d(J,"MAX_START_GAP_JUMP",function(){return r}),P.d(J,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return L}),P.d(J,"SKIP_BUFFER_RANGE_START",function(){return v}),P.d(J,"default",function(){return m});var X=P("./src/utils/buffer-helper.ts"),j=P("./src/errors.ts"),B=P("./src/events.ts"),K=P("./src/utils/logger.ts"),G=250,r=2,L=.1,v=.05,m=function(){function p(l,f,o,u){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=l,this.media=f,this.fragmentTracker=o,this.hls=u}var h=p.prototype;return h.destroy=function(){this.hls=this.fragmentTracker=this.media=null},h.poll=function(f){var o=this.config,u=this.media,a=this.stalled,s=u.currentTime,R=u.seeking,_=this.seeking&&!R,C=!this.seeking&&R;if(this.seeking=R,s!==f){if(this.moved=!0,a!==null){if(this.stallReported){var D=self.performance.now()-a;K.logger.warn("playback not stuck anymore @"+s+", after "+Math.round(D)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((C||_)&&(this.stalled=null),u.paused||u.ended||u.playbackRate===0||!X.BufferHelper.getBuffered(u).length)return;var O=X.BufferHelper.bufferInfo(u,s,0),A=O.len>0,S=O.nextStart||0;if(!A&&!S)return;if(R){var T=O.len>r,c=!S||S-s>r&&!this.fragmentTracker.getPartialFragment(s);if(T||c)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var w,y=Math.max(S,O.start||0)-s,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,U=b==null||((w=b.details)===null||w===void 0)?void 0:w.live,F=U?b.details.targetduration*2:r;if(y>0&&y<=F){this._trySkipBufferHole(null);return}}var E=self.performance.now();if(a===null){this.stalled=E;return}var N=E-a;!R&&N>=G&&this._reportStall(O.len);var I=X.BufferHelper.bufferInfo(u,s,o.maxBufferHole);this._tryFixBufferStall(I,N)},h._tryFixBufferStall=function(f,o){var u=this.config,a=this.fragmentTracker,s=this.media,R=s.currentTime,_=a.getPartialFragment(R);if(_){var C=this._trySkipBufferHole(_);if(C)return}f.len>u.maxBufferHole&&o>u.highBufferWatchdogPeriod*1e3&&(K.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},h._reportStall=function(f){var o=this.hls,u=this.media,a=this.stallReported;a||(this.stallReported=!0,K.logger.warn("Playback stalling at @"+u.currentTime+" due to low buffer (buffer="+f+")"),o.trigger(B.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:f}))},h._trySkipBufferHole=function(f){for(var o=this.config,u=this.hls,a=this.media,s=a.currentTime,R=0,_=X.BufferHelper.getBuffered(a),C=0;C<_.length;C++){var D=_.start(C);if(s+o.maxBufferHole>=R&&s.05&&this.forwardBufferLength>1){var C=Math.min(2,Math.max(1,u)),D=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20;p.playbackRate=Math.min(C,Math.max(1,D))}else p.playbackRate!==1&&p.playbackRate!==0&&(p.playbackRate=1)},v.estimateLiveEdge=function(){var p=this.levelDetails;return p===null?null:p.edge+p.age},v.computeLatency=function(){var p=this.estimateLiveEdge();return p===null?null:p-this.currentTime},G(L,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var p=this.config,h=this.levelDetails;return p.liveMaxLatencyDuration!==void 0?p.liveMaxLatencyDuration:h?p.liveMaxLatencyDurationCount*h.targetduration:0}},{key:"targetLatency",get:function(){var p=this.levelDetails;if(p===null)return null;var h=p.holdBack,l=p.partHoldBack,f=p.targetduration,o=this.config,u=o.liveSyncDuration,a=o.liveSyncDurationCount,s=o.lowLatencyMode,R=this.hls.userConfig,_=s&&l||h;(R.liveSyncDuration||R.liveSyncDurationCount||_===0)&&(_=u!==void 0?u:a*f);var C=f,D=1;return _+Math.min(this.stallCount*D,C)}},{key:"liveSyncPosition",get:function(){var p=this.estimateLiveEdge(),h=this.targetLatency,l=this.levelDetails;if(p===null||h===null||l===null)return null;var f=l.edge,o=p-h-this.edgeStalled,u=f-l.totalduration,a=f-(this.config.lowLatencyMode&&l.partTarget||l.targetduration);return Math.min(Math.max(u,o),a)}},{key:"drift",get:function(){var p=this.levelDetails;return p===null?1:p.drift}},{key:"edgeStalled",get:function(){var p=this.levelDetails;if(p===null)return 0;var h=(this.config.lowLatencyMode&&p.partTarget||p.targetduration)*3;return Math.max(p.age-h,0)}},{key:"forwardBufferLength",get:function(){var p=this.media,h=this.levelDetails;if(!p||!h)return 0;var l=p.buffered.length;return l?p.buffered.end(l-1):h.edge-this.currentTime}}]),L}()},"./src/controller/level-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return o});var X=P("./src/types/level.ts"),j=P("./src/events.ts"),B=P("./src/errors.ts"),K=P("./src/utils/codecs.ts"),G=P("./src/controller/level-helper.ts"),r=P("./src/controller/base-playlist-controller.ts"),L=P("./src/types/loader.ts");function v(){return v=Object.assign||function(u){for(var a=1;a0){S=D[0].bitrate,D.sort(function(N,I){return N.bitrate-I.bitrate}),this._levels=D;for(var U=0;Uthis.hls.config.fragLoadingMaxRetry&&(T=C.frag.level)):T=C.frag.level}break;case B.ErrorDetails.LEVEL_LOAD_ERROR:case B.ErrorDetails.LEVEL_LOAD_TIMEOUT:D&&(D.deliveryDirectives&&(S=!1),T=D.level),A=!0;break;case B.ErrorDetails.REMUX_ALLOC_ERROR:T=C.level,A=!0;break}T!==void 0&&this.recoverLevel(C,T,A,S)},s.recoverLevel=function(_,C,D,O){var A=_.details,S=this._levels[C];if(S.loadError++,D){var T=this.retryLoadingOrFail(_);if(T)_.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){var c=S.url.length;if(c>1&&S.loadError1){var O=(C.urlId+1)%D;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(A){A.urlId=O}),this.level=_}},s.onFragLoaded=function(_,C){var D=C.frag;if(D!==void 0&&D.type===L.PlaylistLevelType.MAIN){var O=this._levels[D.level];O!==void 0&&(O.fragmentError=0,O.loadError=0)}},s.onLevelLoaded=function(_,C){var D,O=C.level,A=C.details,S=this._levels[O];if(!S){var T;this.warn("Invalid level index "+O),(T=C.deliveryDirectives)!==null&&T!==void 0&&T.skip&&(A.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(S.fragmentError===0&&(S.loadError=0,this.retryCount=0),this.playlistLoaded(O,C,S.details)):(D=C.deliveryDirectives)!==null&&D!==void 0&&D.skip&&(A.deltaUpdateFailed=!0)},s.onAudioTrackSwitched=function(_,C){var D=this.hls.levels[this.currentLevelIndex];if(!D)return;if(D.audioGroupIds){for(var O=-1,A=this.hls.audioTracks[C.id].groupId,S=0;S0){var O=D.urlId,A=D.url[O];if(_)try{A=_.addDirectives(A)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("Attempt loading level index "+C+(_?" at sn "+_.msn+" part "+_.part:"")+" with URL-id "+O+" "+A),this.clearTimer(),this.hls.trigger(j.Events.LEVEL_LOADING,{url:A,level:C,id:O,deliveryDirectives:_||null})}},s.removeLevel=function(_,C){var D=function(S,T){return T!==C},O=this._levels.filter(function(A,S){return S!==_?!0:A.url.length>1&&C!==void 0?(A.url=A.url.filter(D),A.audioGroupIds&&(A.audioGroupIds=A.audioGroupIds.filter(D)),A.textGroupIds&&(A.textGroupIds=A.textGroupIds.filter(D)),A.urlId=0,!0):!1}).map(function(A,S){var T=A.details;return T!=null&&T.fragments&&T.fragments.forEach(function(c){c.level=S}),A});this._levels=O,this.hls.trigger(j.Events.LEVELS_UPDATED,{levels:O})},p(a,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(_){var C,D=this._levels;if(D.length===0)return;if(this.currentLevelIndex===_&&(C=D[_])!==null&&C!==void 0&&C.details)return;if(_<0||_>=D.length){var O=_<0;if(this.hls.trigger(j.Events.ERROR,{type:B.ErrorTypes.OTHER_ERROR,details:B.ErrorDetails.LEVEL_SWITCH_ERROR,level:_,fatal:O,reason:"invalid level idx"}),O)return;_=Math.min(_,D.length-1)}this.clearTimer();var A=this.currentLevelIndex,S=D[A],T=D[_];this.log("switching to level "+_+" from "+A),this.currentLevelIndex=_;var c=v({},T,{level:_,maxBitrate:T.maxBitrate,uri:T.uri,urlId:T.urlId});delete c._urlId,this.hls.trigger(j.Events.LEVEL_SWITCHING,c);var w=T.details;if(!w||w.live){var y=this.switchParams(T.uri,S==null?void 0:S.details);this.loadPlaylist(y)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(_){this.manualLevelIndex=_,this._startLevel===void 0&&(this._startLevel=_),_!==-1&&(this.level=_)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(_){this._firstLevel=_}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var _=this.hls.config.startLevel;return _!==void 0?_:this._firstLevel}else return this._startLevel},set:function(_){this._startLevel=_}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(_){this.level=_,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=_)}}]),a}(r.default)},"./src/controller/level-helper.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"addGroupId",function(){return B}),P.d(J,"assignTrackIdsByGroup",function(){return K}),P.d(J,"updatePTS",function(){return G}),P.d(J,"updateFragPTSDTS",function(){return L}),P.d(J,"mergeDetails",function(){return v}),P.d(J,"mapPartIntersection",function(){return m}),P.d(J,"mapFragmentIntersection",function(){return p}),P.d(J,"adjustSliding",function(){return h}),P.d(J,"addSliding",function(){return l}),P.d(J,"computeReloadInterval",function(){return f}),P.d(J,"getFragmentWithSN",function(){return o}),P.d(J,"getPartWith",function(){return u});var X=P("./src/polyfills/number.ts"),j=P("./src/utils/logger.ts");function B(a,s,R){switch(s){case"audio":a.audioGroupIds||(a.audioGroupIds=[]),a.audioGroupIds.push(R);break;case"text":a.textGroupIds||(a.textGroupIds=[]),a.textGroupIds.push(R);break}}function K(a){var s={};a.forEach(function(R){var _=R.groupId||"";R.id=s[_]=s[_]||0,s[_]++})}function G(a,s,R){var _=a[s],C=a[R];r(_,C)}function r(a,s){var R=s.startPTS;if(Object(X.isFiniteNumber)(R)){var _=0,C;s.sn>a.sn?(_=R-a.start,C=a):(_=a.start-R,C=s),C.duration!==_&&(C.duration=_)}else if(s.sn>a.sn){var D=a.cc===s.cc;D&&a.minEndPTS?s.start=a.start+(a.minEndPTS-a.start):s.start=a.start+a.duration}else s.start=Math.max(a.start-s.duration,0)}function L(a,s,R,_,C,D){var O=_-R;O<=0&&(j.logger.warn("Fragment should have a positive duration",s),_=R+s.duration,D=C+s.duration);var A=R,S=_,T=s.startPTS,c=s.endPTS;if(Object(X.isFiniteNumber)(T)){var w=Math.abs(T-R);Object(X.isFiniteNumber)(s.deltaPTS)?s.deltaPTS=Math.max(w,s.deltaPTS):s.deltaPTS=w,A=Math.max(R,T),R=Math.min(R,T),C=Math.min(C,s.startDTS),S=Math.min(_,c),_=Math.max(_,c),D=Math.max(D,s.endDTS)}s.duration=_-R;var y=R-s.start;s.appendedPTS=_,s.start=s.startPTS=R,s.maxStartPTS=A,s.startDTS=C,s.endPTS=_,s.minEndPTS=S,s.endDTS=D;var b=s.sn;if(!a||ba.endSN)return 0;var U,F=b-a.startSN,E=a.fragments;for(E[F]=s,U=F;U>0;U--)r(E[U],E[U-1]);for(U=F;U=0;C--){var D=_[C].initSegment;if(D){R=D;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;var O=0,A;if(p(a,s,function(U,F){U.relurl&&(O=U.cc-F.cc),Object(X.isFiniteNumber)(U.startPTS)&&Object(X.isFiniteNumber)(U.endPTS)&&(F.start=F.startPTS=U.startPTS,F.startDTS=U.startDTS,F.appendedPTS=U.appendedPTS,F.maxStartPTS=U.maxStartPTS,F.endPTS=U.endPTS,F.endDTS=U.endDTS,F.minEndPTS=U.minEndPTS,F.duration=U.endPTS-U.startPTS,F.duration&&(A=F),s.PTSKnown=s.alignedSliding=!0),F.elementaryStreams=U.elementaryStreams,F.loader=U.loader,F.stats=U.stats,F.urlId=U.urlId,U.initSegment&&(F.initSegment=U.initSegment,R=U.initSegment)}),R){var S=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments;S.forEach(function(U){var F;(!U.initSegment||U.initSegment.relurl===((F=R)===null||F===void 0?void 0:F.relurl))&&(U.initSegment=R)})}if(s.skippedSegments&&(s.deltaUpdateFailed=s.fragments.some(function(U){return!U}),s.deltaUpdateFailed)){j.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var T=s.skippedSegments;T--;)s.fragments.shift();s.startSN=s.fragments[0].sn,s.startCC=s.fragments[0].cc}var c=s.fragments;if(O){j.logger.warn("discontinuity sliding from playlist, take drift into account");for(var w=0;w=_.length)return;l(s,_[R].start)}function l(a,s){if(s){for(var R=a.fragments,_=a.skippedSegments;_0&&C0&&S===-1&&(this.log("Override startPosition with lastCurrentTime @"+T.toFixed(3)),S=T),this.state=j.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=S,this.tick()}else this._forceStartLoad=!0,this.state=j.State.STOPPED},O.stopLoad=function(){this._forceStartLoad=!1,C.prototype.stopLoad.call(this)},O.doTick=function(){switch(this.state){case j.State.IDLE:this.doTickIdle();break;case j.State.WAITING_LEVEL:{var S,T=this.levels,c=this.level,w=T==null||((S=T[c])===null||S===void 0)?void 0:S.details;if(w&&(!w.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(w))break;this.state=j.State.IDLE;break}break}case j.State.FRAG_LOADING_WAITING_RETRY:{var y,b=self.performance.now(),U=this.retryDate;(!U||b>=U||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=j.State.IDLE)}break;default:break}this.onTickEnd()},O.onTickEnd=function(){C.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},O.doTickIdle=function(){var S,T,c=this.hls,w=this.levelLastLoaded,y=this.levels,b=this.media,U=c.config,F=c.nextLoadLevel;if(w===null||!b&&(this.startFragRequested||!U.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!y||!y[F])return;var E=y[F];this.level=c.nextLoadLevel=F;var N=E.details;if(!N||this.state===j.State.WAITING_LEVEL||N.live&&this.levelLastLoaded!==F){this.state=j.State.WAITING_LEVEL;return}var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:b,L.PlaylistLevelType.MAIN);if(I===null)return;var g=I.len,H=this.getMaxBufferLength(E.maxBitrate);if(g>=H)return;if(this._streamEnded(I,N)){var $={};this.altAudio&&($.type="video"),this.hls.trigger(K.Events.BUFFER_EOS,$),this.state=j.State.ENDED;return}var ie=I.end,oe=this.getNextFragment(ie,N);if(this.couldBacktrack&&!this.fragPrevious&&oe&&oe.sn!=="initSegment"){var Ce=oe.sn-N.startSN;Ce>1&&(oe=N.fragments[Ce-1],this.fragmentTracker.removeFragment(oe))}if(oe&&this.fragmentTracker.getState(oe)===r.FragmentState.OK&&this.nextLoadPosition>ie){var ve=this.audioOnly&&!this.altAudio?v.ElementaryStreamTypes.AUDIO:v.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(b,ve,L.PlaylistLevelType.MAIN),oe=this.getNextFragment(this.nextLoadPosition,N)}if(!oe)return;oe.initSegment&&!oe.initSegment.data&&!this.bitrateTest&&(oe=oe.initSegment),((S=oe.decryptdata)===null||S===void 0?void 0:S.keyFormat)==="identity"&&!((T=oe.decryptdata)!==null&&T!==void 0&&T.key)?this.loadKey(oe,N):this.loadFragment(oe,N,ie)},O.loadFragment=function(S,T,c){var w,y=this.fragmentTracker.getState(S);if(this.fragCurrent=S,y===r.FragmentState.BACKTRACKED){var b=this.fragmentTracker.getBacktrackData(S);if(b){this._handleFragmentLoadProgress(b),this._handleFragmentLoadComplete(b);return}else y=r.FragmentState.NOT_LOADED}y===r.FragmentState.NOT_LOADED||y===r.FragmentState.PARTIAL?S.sn==="initSegment"?this._loadInitSegment(S):this.bitrateTest?(S.bitrateTest=!0,this.log("Fragment "+S.sn+" of level "+S.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(S)):(this.startFragRequested=!0,C.prototype.loadFragment.call(this,S,T,c)):y===r.FragmentState.APPENDING?this.reduceMaxBufferLength(S.duration)&&this.fragmentTracker.removeFragment(S):((w=this.media)===null||w===void 0?void 0:w.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},O.getAppendedFrag=function(S){var T=this.fragmentTracker.getAppendedFrag(S,L.PlaylistLevelType.MAIN);return T&&"fragment"in T?T.fragment:T},O.getBufferedFrag=function(S){return this.fragmentTracker.getBufferedFrag(S,L.PlaylistLevelType.MAIN)},O.followingBufferedFrag=function(S){return S?this.getBufferedFrag(S.end+.5):null},O.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},O.nextLevelSwitch=function(){var S=this.levels,T=this.media;if(T!=null&&T.readyState){var c,w=this.getAppendedFrag(T.currentTime);if(w&&w.start>1&&this.flushMainBuffer(0,w.start-1),!T.paused&&S){var y=this.hls.nextLoadLevel,b=S[y],U=this.fragLastKbps;U&&this.fragCurrent?c=this.fragCurrent.duration*b.maxBitrate/(1e3*U)+1:c=0}else c=0;var F=this.getBufferedFrag(T.currentTime+c);if(F){var E=this.followingBufferedFrag(F);if(E){this.abortCurrentFrag();var N=E.maxStartPTS?E.maxStartPTS:E.start,I=E.duration,g=Math.max(F.end,N+Math.min(Math.max(I-this.config.maxFragLookUpTolerance,I*.5),I*.75));this.flushMainBuffer(g,Number.POSITIVE_INFINITY)}}}},O.abortCurrentFrag=function(){var S=this.fragCurrent;this.fragCurrent=null,S!=null&&S.loader&&S.loader.abort(),this.state===j.State.KEY_LOADING&&(this.state=j.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},O.flushMainBuffer=function(S,T){C.prototype.flushMainBuffer.call(this,S,T,this.altAudio?"video":null)},O.onMediaAttached=function(S,T){C.prototype.onMediaAttached.call(this,S,T);var c=T.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),c.addEventListener("playing",this.onvplaying),c.addEventListener("seeked",this.onvseeked),this.gapController=new h.default(this.config,c,this.fragmentTracker,this.hls)},O.onMediaDetaching=function(){var S=this.media;S&&(S.removeEventListener("playing",this.onvplaying),S.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),C.prototype.onMediaDetaching.call(this)},O.onMediaPlaying=function(){this.tick()},O.onMediaSeeked=function(){var S=this.media,T=S?S.currentTime:null;Object(X.isFiniteNumber)(T)&&this.log("Media seeked to "+T.toFixed(3)),this.tick()},O.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(K.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},O.onManifestParsed=function(S,T){var c=!1,w=!1,y;T.levels.forEach(function(b){y=b.audioCodec,y&&(y.indexOf("mp4a.40.2")!==-1&&(c=!0),y.indexOf("mp4a.40.5")!==-1&&(w=!0))}),this.audioCodecSwitch=c&&w&&!Object(B.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=T.levels,this.startFragRequested=!1},O.onLevelLoading=function(S,T){var c=this.levels;if(!c||this.state!==j.State.IDLE)return;var w=c[T.level];(!w.details||w.details.live&&this.levelLastLoaded!==T.level||this.waitForCdnTuneIn(w.details))&&(this.state=j.State.WAITING_LEVEL)},O.onLevelLoaded=function(S,T){var c,w=this.levels,y=T.level,b=T.details,U=b.totalduration;if(!w){this.warn("Levels were reset while loading level "+y);return}this.log("Level "+y+" loaded ["+b.startSN+","+b.endSN+"], cc ["+b.startCC+", "+b.endCC+"] duration:"+U);var F=this.fragCurrent;F&&(this.state===j.State.FRAG_LOADING||this.state===j.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==T.level&&F.loader&&(this.state=j.State.IDLE,F.loader.abort()));var E=w[y],N=0;if(b.live||(c=E.details)!==null&&c!==void 0&&c.live){if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed)return;N=this.alignPlaylists(b,E.details)}if(E.details=b,this.levelLastLoaded=y,this.hls.trigger(K.Events.LEVEL_UPDATED,{details:b,level:y}),this.state===j.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(b))return;this.state=j.State.IDLE}this.startFragRequested?b.live&&this.synchronizeToLiveEdge(b):this.setStartPosition(b,N),this.tick()},O._handleFragmentLoadProgress=function(S){var T,c=S.frag,w=S.part,y=S.payload,b=this.levels;if(!b){this.warn("Levels were reset while fragment load was in progress. Fragment "+c.sn+" of level "+c.level+" will not be buffered");return}var U=b[c.level],F=U.details;if(!F){this.warn("Dropping fragment "+c.sn+" of level "+c.level+" after level details were reset");return}var E=U.videoCodec,N=F.PTSKnown||!F.live,I=(T=c.initSegment)===null||T===void 0?void 0:T.data,g=this._getAudioCodec(U),H=this.transmuxer=this.transmuxer||new m.default(this.hls,L.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),$=w?w.index:-1,ie=$!==-1,oe=new p.ChunkMetadata(c.level,c.sn,c.stats.chunkCount,y.byteLength,$,ie),Ce=this.initPTS[c.cc];H.push(y,I,g,E,c,w,F.totalduration,N,oe,Ce)},O.onAudioTrackSwitching=function(S,T){var c=this.altAudio,w=!!T.url,y=T.id;if(!w){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var b=this.fragCurrent;b!=null&&b.loader&&(this.log("Switching to main audio track, cancel main fragment load"),b.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var U=this.hls;c&&U.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),U.trigger(K.Events.AUDIO_TRACK_SWITCHED,{id:y})}},O.onAudioTrackSwitched=function(S,T){var c=T.id,w=!!this.hls.audioTracks[c].url;if(w){var y=this.videoBuffer;y&&this.mediaBuffer!==y&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=y)}this.altAudio=w,this.tick()},O.onBufferCreated=function(S,T){var c=T.tracks,w,y,b=!1;for(var U in c){var F=c[U];if(F.id==="main"){if(y=U,w=F,U==="video"){var E=c[U];E&&(this.videoBuffer=E.buffer)}}else b=!0}b&&w?(this.log("Alternate track found, use "+y+".buffered to schedule main fragment loading"),this.mediaBuffer=w.buffer):this.mediaBuffer=this.media},O.onFragBuffered=function(S,T){var c=T.frag,w=T.part;if(c&&c.type!==L.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(c)){this.warn("Fragment "+c.sn+(w?" p: "+w.index:"")+" of level "+c.level+" finished buffering, but was aborted. state: "+this.state),this.state===j.State.PARSED&&(this.state=j.State.IDLE);return}var y=w?w.stats:c.stats;this.fragLastKbps=Math.round(8*y.total/(y.buffering.end-y.loading.first)),c.sn!=="initSegment"&&(this.fragPrevious=c),this.fragBufferedComplete(c,w)},O.onError=function(S,T){switch(T.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.MAIN,T);break;case l.ErrorDetails.LEVEL_LOAD_ERROR:case l.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==j.State.ERROR&&(T.fatal?(this.warn(""+T.details),this.state=j.State.ERROR):!T.levelRetry&&this.state===j.State.WAITING_LEVEL&&(this.state=j.State.IDLE));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(T.parent==="main"&&(this.state===j.State.PARSING||this.state===j.State.PARSED)){var c=!0,w=this.getFwdBufferInfo(this.media,L.PlaylistLevelType.MAIN);w&&w.len>.5&&(c=!this.reduceMaxBufferLength(w.len)),c&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},O.checkBuffer=function(){var S=this.media,T=this.gapController;if(!S||!T||!S.readyState)return;var c=G.BufferHelper.getBuffered(S);!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this.seekToStartPos()):T.poll(this.lastCurrentTime),this.lastCurrentTime=S.currentTime},O.onFragLoadEmergencyAborted=function(){this.state=j.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},O.onBufferFlushed=function(S,T){var c=T.type;if(c!==v.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var w=(c===v.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(w,c,L.PlaylistLevelType.MAIN)}},O.onLevelsUpdated=function(S,T){this.levels=T.levels},O.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},O.seekToStartPos=function(){var S=this.media,T=S.currentTime,c=this.startPosition;if(c>=0&&T0&&(b1&&S.seeking===!1){var c=S.currentTime;if(G.BufferHelper.isBuffered(S,c)?T=this.getAppendedFrag(c):G.BufferHelper.isBuffered(S,c+.1)&&(T=this.getAppendedFrag(c+.1)),T){var w=this.fragPlaying,y=T.level;(!w||T.sn!==w.sn||w.level!==y||T.urlId!==w.urlId)&&(this.hls.trigger(K.Events.FRAG_CHANGED,{frag:T}),(!w||w.level!==y)&&this.hls.trigger(K.Events.LEVEL_SWITCHED,{level:y}),this.fragPlaying=T)}}},u(D,[{key:"nextLevel",get:function(){var S=this.nextBufferedFrag;return S?S.level:-1}},{key:"currentLevel",get:function(){var S=this.media;if(S){var T=this.getAppendedFrag(S.currentTime);if(T)return T.level}return-1}},{key:"nextBufferedFrag",get:function(){var S=this.media;if(S){var T=this.getAppendedFrag(S.currentTime);return this.followingBufferedFrag(T)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),D}(j.default)},"./src/controller/subtitle-stream-controller.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"SubtitleStreamController",function(){return a});var X=P("./src/events.ts"),j=P("./src/utils/logger.ts"),B=P("./src/utils/buffer-helper.ts"),K=P("./src/controller/fragment-finders.ts"),G=P("./src/utils/discontinuities.ts"),r=P("./src/controller/level-helper.ts"),L=P("./src/controller/fragment-tracker.ts"),v=P("./src/controller/base-stream-controller.ts"),m=P("./src/types/loader.ts"),p=P("./src/types/level.ts");function h(s,R){for(var _=0;_=T[y].start&&w<=T[y].end){c=T[y];break}var b=A.start+A.duration;c?c.end=b:(c={start:w,end:b},T.push(c)),this.fragmentTracker.fragBuffered(A)},_.onBufferFlushing=function(D,O){var A=O.startOffset,S=O.endOffset;if(A===0&&S!==Number.POSITIVE_INFINITY){var T=this.currentTrackId,c=this.levels;if(!c.length||!c[T]||!c[T].details)return;var w=c[T].details,y=w.targetduration,b=S-y;if(b<=0)return;O.endOffsetSubtitles=Math.max(0,b),this.tracksBuffered.forEach(function(U){for(var F=0;F=w.length||T!==c||!y)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,S.live||(A=y.details)!==null&&A!==void 0&&A.live){var b=this.mainDetails;if(S.deltaUpdateFailed||!b)return;var U=b.fragments[0];if(!y.details)S.hasProgramDateTime&&b.hasProgramDateTime?Object(G.alignMediaPlaylistByPDT)(S,b):U&&Object(r.addSliding)(S,U.start);else{var F=this.alignPlaylists(S,y.details);F===0&&U&&Object(r.addSliding)(S,U.start)}}if(y.details=S,this.levelLastLoaded=T,this.tick(),S.live&&!this.fragCurrent&&this.media&&this.state===v.State.IDLE){var E=Object(K.findFragmentByPTS)(null,S.fragments,this.media.currentTime,0);E||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)}},_._handleFragmentLoadComplete=function(D){var O=D.frag,A=D.payload,S=O.decryptdata,T=this.hls;if(this.fragContextChanged(O))return;if(A&&A.byteLength>0&&S&&S.key&&S.iv&&S.method==="AES-128"){var c=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(A),S.key.buffer,S.iv.buffer).then(function(w){var y=performance.now();T.trigger(X.Events.FRAG_DECRYPTED,{frag:O,payload:w,stats:{tstart:c,tdecrypt:y}})})}},_.doTick=function(){if(!this.media){this.state=v.State.IDLE;return}if(this.state===v.State.IDLE){var D,O=this.currentTrackId,A=this.levels;if(!A.length||!A[O]||!A[O].details)return;var S=A[O].details,T=S.targetduration,c=this.config,w=this.media,y=B.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,w.currentTime-T,c.maxBufferHole),b=y.end,U=y.len,F=this.getMaxBufferLength()+T;if(U>F)return;console.assert(S,"Subtitle track details are defined on idle subtitle stream controller tick");var E=S.fragments,N=E.length,I=S.edge,g,H=this.fragPrevious;if(b-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},f.pollTrackChange=function(u){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,u)},f.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var u=p(this.media.textTracks);u.forEach(function(a){Object(j.clearCurrentCues)(a)}),this.subtitleTrack=-1,this.media=null},f.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},f.onManifestParsed=function(u,a){this.tracks=a.subtitleTracks},f.onSubtitleTrackLoaded=function(u,a){var s=a.id,R=a.details,_=this.trackId,C=this.tracksInGroup[_];if(!C){this.warn("Invalid subtitle track id "+s);return}var D=C.details;C.details=a.details,this.log("subtitle track "+s+" loaded ["+R.startSN+"-"+R.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,a,D))},f.onLevelLoading=function(u,a){this.switchLevel(a.level)},f.onLevelSwitching=function(u,a){this.switchLevel(a.level)},f.switchLevel=function(u){var a=this.hls.levels[u];if(!(a!=null&&a.textGroupIds))return;var s=a.textGroupIds[a.urlId];if(this.groupId!==s){var R=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,_=this.tracks.filter(function(O){return!s||O.groupId===s});this.tracksInGroup=_;var C=this.findTrackId(R==null?void 0:R.name)||this.findTrackId();this.groupId=s;var D={subtitleTracks:_};this.log("Updating subtitle tracks, "+_.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(X.Events.SUBTITLE_TRACKS_UPDATED,D),C!==-1&&this.setSubtitleTrack(C,R)}},f.findTrackId=function(u){for(var a=this.tracksInGroup,s=0;s=R.length)return;this.clearTimer();var _=R[u];if(this.log("Switching to subtitle track "+u),this.trackId=u,_){var C=_.id,D=_.groupId,O=D===void 0?"":D,A=_.name,S=_.type,T=_.url;this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:C,groupId:O,name:A,type:S,url:T});var c=this.switchParams(_.url,a==null?void 0:a.details);this.loadPlaylist(c)}else this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:u})},f.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var u=-1,a=p(this.media.textTracks),s=0;s=0&&(S[0]=Math.min(S[0],R),S[1]=Math.max(S[1],_),O=!0,T/(_-R)>.5))return}if(O||D.push([R,_]),this.config.renderTextTracksNatively){var c=this.captionsTracks[s];this.Cues.newCue(c,R,_,C)}else{var w=this.Cues.newCue(null,R,_,C);this.hls.trigger(j.Events.CUES_PARSED,{type:"captions",cues:w,track:s})}},u.onInitPtsFound=function(s,R){var _=this,C=R.frag,D=R.id,O=R.initPTS,A=R.timescale,S=this.unparsedVttFrags;D==="main"&&(this.initPTS[C.cc]=O,this.timescale[C.cc]=A),S.length&&(this.unparsedVttFrags=[],S.forEach(function(T){_.onFragLoaded(j.Events.FRAG_LOADED,T)}))},u.getExistingTrack=function(s){var R=this.media;if(R)for(var _=0;_>>8^A&255^99,L[C]=A,v[A]=C;var S=_[C],T=_[S],c=_[T],w=_[A]*257^A*16843008;p[C]=w<<24|w>>>8,h[C]=w<<16|w>>>16,l[C]=w<<8|w>>>24,f[C]=w,w=c*16843009^T*65537^S*257^C*16843008,u[A]=w<<24|w>>>8,a[A]=w<<16|w>>>16,s[A]=w<<8|w>>>24,R[A]=w,C?(C=S^_[_[_[c^S]]],D^=_[_[D]]):C=D=1}},G.expandKey=function(L){for(var v=this.uint8ArrayToUint32Array_(L),m=!0,p=0;p>>6)+1;var w=(s[R+2]&60)>>>2;if(w>c.length-1){a.trigger(B.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+w});return}return O=(s[R+2]&1)<<2,O|=(s[R+3]&192)>>>6,X.logger.log("manifest codec:"+_+", ADTS type:"+C+", samplingIndex:"+w),/firefox/i.test(S)?w>=6?(C=5,A=new Array(4),D=w-3):(C=2,A=new Array(2),D=w):S.indexOf("android")!==-1?(C=2,A=new Array(2),D=w):(C=5,A=new Array(4),_&&(_.indexOf("mp4a.40.29")!==-1||_.indexOf("mp4a.40.5")!==-1)||!_&&w>=6?D=w-3:((_&&_.indexOf("mp4a.40.2")!==-1&&(w>=6&&O===1||/vivaldi/i.test(S))||!_&&O===1)&&(C=2,A=new Array(2)),D=w)),A[0]=C<<3,A[0]|=(w&14)>>1,A[1]|=(w&1)<<7,A[1]|=O<<3,C===5&&(A[1]|=(D&14)>>1,A[2]=(D&1)<<7,A[2]|=2<<2,A[3]=0),{config:A,samplerate:c[w],channelCount:O,codec:"mp4a.40."+C,manifestCodec:T}}function G(a,s){return a[s]===255&&(a[s+1]&246)===240}function r(a,s){return a[s+1]&1?7:9}function L(a,s){return(a[s+3]&3)<<11|a[s+4]<<3|(a[s+5]&224)>>>5}function v(a,s){return s+5=a.length)return!1;var _=L(a,s);if(_<=R)return!1;var C=s+_;return C===a.length||m(a,C)}return!1}function l(a,s,R,_,C){if(!a.samplerate){var D=K(s,R,_,C);if(!D)return;a.config=D.config,a.samplerate=D.samplerate,a.channelCount=D.channelCount,a.codec=D.codec,a.manifestCodec=D.manifestCodec,X.logger.log("parsed codec:"+a.codec+", rate:"+D.samplerate+", channels:"+D.channelCount)}}function f(a){return 1024*9e4/a}function o(a,s,R,_,C){var D=r(a,s),O=L(a,s);if(O-=D,O>0){var A=R+_*C;return{headerLength:D,frameLength:O,stamp:A}}}function u(a,s,R,_,C){var D=f(a.samplerate),O=o(s,R,_,C,D);if(O){var A=O.frameLength,S=O.headerLength,T=O.stamp,c=S+A,w=Math.max(0,R+c-s.length),y;w?(y=new Uint8Array(c-S),y.set(s.subarray(R+S,s.length),0)):y=s.subarray(R+S,R+c);var b={unit:y,pts:T};return w||a.samples.push(b),{sample:b,length:c,missing:w}}}},"./src/demux/base-audio-demuxer.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"initPTSFn",function(){return L});var X=P("./src/polyfills/number.ts"),j=P("./src/demux/id3.ts"),B=P("./src/demux/dummy-demuxed-track.ts"),K=P("./src/utils/mp4-tools.ts"),G=P("./src/utils/typed-array.ts"),r=function(){function v(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var m=v.prototype;return m.resetInitSegment=function(h,l,f){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},m.resetTimeStamp=function(){},m.resetContiguity=function(){},m.canParse=function(h,l){return!1},m.appendFrame=function(h,l,f){},m.demux=function(h,l){this.cachedData&&(h=Object(K.appendUint8Array)(this.cachedData,h),this.cachedData=null);var f=j.getID3Data(h,0),o=f?f.length:0,u,a,s=this._audioTrack,R=this._id3Track,_=f?j.getTimeStamp(f):void 0,C=h.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=L(_,l)),f&&f.length>0&&R.samples.push({pts:this.initPTS,dts:this.initPTS,data:f}),a=this.initPTS;or?(this.word<<=r,this.bitsAvailable-=r):(r-=this.bitsAvailable,L=r>>3,r-=L>>3,this.bytesAvailable-=L,this.loadWord(),this.word<<=r,this.bitsAvailable-=r)},K.readBits=function(r){var L=Math.min(this.bitsAvailable,r),v=this.word>>>32-L;return r>32&&X.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=L,this.bitsAvailable>0?this.word<<=L:this.bytesAvailable>0&&this.loadWord(),L=r-L,L>0&&this.bitsAvailable?v<>>r)!==0)return this.word<<=r,this.bitsAvailable-=r,r;return this.loadWord(),r+this.skipLZ()},K.skipUEG=function(){this.skipBits(1+this.skipLZ())},K.skipEG=function(){this.skipBits(1+this.skipLZ())},K.readUEG=function(){var r=this.skipLZ();return this.readBits(r+1)-1},K.readEG=function(){var r=this.readUEG();return 1&r?1+r>>>1:-1*(r>>>1)},K.readBoolean=function(){return this.readBits(1)===1},K.readUByte=function(){return this.readBits(8)},K.readUShort=function(){return this.readBits(16)},K.readUInt=function(){return this.readBits(32)},K.skipScalingList=function(r){for(var L=8,v=8,m,p=0;p0?C.subarray(O,O+A):void 0},K=function(C,D){var O=0;return O=(C[D]&127)<<21,O|=(C[D+1]&127)<<14,O|=(C[D+2]&127)<<7,O|=C[D+3]&127,O},G=function(C,D){return X(C,D)&&K(C,D+6)+10<=C.length-D},r=function(C){for(var D=m(C),O=0;O>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:b+=String.fromCharCode(c);break;case 12:case 13:w=C[U++],b+=String.fromCharCode((c&31)<<6|w&63);break;case 14:w=C[U++],y=C[U++],b+=String.fromCharCode((c&15)<<12|(w&63)<<6|(y&63)<<0);break;default:}}return b},a={decodeTextFrame:l},s;function R(){return!s&&typeof self.TextDecoder!="undefined"&&(s=new self.TextDecoder("utf-8")),s}},"./src/demux/mp3demuxer.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/demux/base-audio-demuxer.ts"),j=P("./src/demux/id3.ts"),B=P("./src/utils/logger.ts"),K=P("./src/demux/mpegaudio.ts");function G(v,m){v.prototype=Object.create(m.prototype),v.prototype.constructor=v,r(v,m)}function r(v,m){return r=Object.setPrototypeOf||function(h,l){return h.__proto__=l,h},r(v,m)}var L=function(v){G(m,v);function m(){return v.apply(this,arguments)||this}var p=m.prototype;return p.resetInitSegment=function(l,f,o){v.prototype.resetInitSegment.call(this,l,f,o),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:l,duration:o,inputTimeScale:9e4,dropped:0}},m.probe=function(l){if(!l)return!1;for(var f=j.getID3Data(l,0)||[],o=f.length,u=l.length;o0},G.demux=function(L){var v=L,m=Object(j.dummyTrack)();if(this.config.progressive){this.remainderData&&(v=Object(X.appendUint8Array)(this.remainderData,L));var p=Object(X.segmentValidRange)(v);this.remainderData=p.remainder,m.samples=p.valid||new Uint8Array}else m.samples=v;return{audioTrack:Object(j.dummyTrack)(),avcTrack:m,id3Track:Object(j.dummyTrack)(),textTrack:Object(j.dummyTrack)()}},G.flush=function(){var L=Object(j.dummyTrack)();return L.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(j.dummyTrack)(),avcTrack:L,id3Track:Object(j.dummyTrack)(),textTrack:Object(j.dummyTrack)()}},G.demuxSampleAes=function(L,v,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},G.destroy=function(){},K}();B.minProbeByteLength=1024,J.default=B},"./src/demux/mpegaudio.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"appendFrame",function(){return r}),P.d(J,"parseHeader",function(){return L}),P.d(J,"isHeaderPattern",function(){return v}),P.d(J,"isHeader",function(){return m}),P.d(J,"canParse",function(){return p}),P.d(J,"probe",function(){return h});var X=null,j=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],B=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],K=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],G=[0,1,1,4];function r(l,f,o,u,a){if(o+24>f.length)return;var s=L(f,o);if(s&&o+s.frameLength<=f.length){var R=s.samplesPerFrame*9e4/s.sampleRate,_=u+a*R,C={unit:f.subarray(o,o+s.frameLength),pts:_,dts:_};return l.config=[],l.channelCount=s.channelCount,l.samplerate=s.sampleRate,l.samples.push(C),{sample:C,length:s.frameLength,missing:0}}}function L(l,f){var o=l[f+1]>>3&3,u=l[f+1]>>1&3,a=l[f+2]>>4&15,s=l[f+2]>>2&3;if(o!==1&&a!==0&&a!==15&&s!==3){var R=l[f+2]>>1&1,_=l[f+3]>>6,C=o===3?3-u:u===3?3:4,D=j[C*14+a-1]*1e3,O=o===3?0:o===2?1:2,A=B[O*3+s],S=_===3?1:2,T=K[o][u],c=G[u],w=T*8*c,y=Math.floor(T*D/A+R)*c;if(X===null){var b=navigator.userAgent||"",U=b.match(/Chrome\/(\d+)/i);X=U?parseInt(U[1]):0}var F=!!X&&X<=87;return F&&u===2&&D>=224e3&&_===0&&(l[f+3]=l[f+3]|128),{sampleRate:A,channelCount:S,frameLength:y,samplesPerFrame:w}}}function v(l,f){return l[f]===255&&(l[f+1]&224)===224&&(l[f+1]&6)!==0}function m(l,f){return f+1=L.length){m();return}if(L[v].unit.length<32)continue;var p=this.decrypter.isSync();if(this.decryptAacSample(L,v,m,p),!p)return}},G.getAvcEncryptedData=function(L){for(var v=Math.floor((L.length-48)/160)*16+16,m=new Int8Array(v),p=0,h=32;h<=L.length-16;h+=160,p+=16)m.set(L.subarray(h,h+16),p);return m},G.getAvcDecryptedUnit=function(L,v){for(var m=new Uint8Array(v),p=0,h=32;h<=L.length-16;h+=160,p+=16)L.set(m.subarray(p,p+16),h);return L},G.decryptAvcSample=function(L,v,m,p,h,l){var f=Object(j.discardEPB)(h.data),o=this.getAvcEncryptedData(f),u=this;this.decryptBuffer(o.buffer,function(a){h.data=u.getAvcDecryptedUnit(f,a),l||u.decryptAvcSamples(L,v,m+1,p)})},G.decryptAvcSamples=function(L,v,m,p){if(L instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;v++,m=0){if(v>=L.length){p();return}for(var h=L[v].units;!(m>=h.length);m++){var l=h[m];if(l.data.length<=48||l.type!==1&&l.type!==5)continue;var f=this.decrypter.isSync();if(this.decryptAvcSample(L,v,m,p,l,f),!f)return}}},K}();J.default=B},"./src/demux/transmuxer-interface.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return h});var X=P("./node_modules/webworkify-webpack/index.js"),j=P.n(X),B=P("./src/events.ts"),K=P("./src/demux/transmuxer.ts"),G=P("./src/utils/logger.ts"),r=P("./src/errors.ts"),L=P("./src/utils/mediasource-helper.ts"),v=P("./node_modules/eventemitter3/index.js"),m=P.n(v),p=Object(L.getMediaSource)()||{isTypeSupported:function(){return!1}},h=function(){function l(o,u,a,s){var R=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=o,this.id=u,this.onTransmuxComplete=a,this.onFlush=s;var _=o.config,C=function(T,c){c=c||{},c.frag=R.frag,c.id=R.id,o.trigger(T,c)};this.observer=new v.EventEmitter,this.observer.on(B.Events.FRAG_DECRYPTED,C),this.observer.on(B.Events.ERROR,C);var D={mp4:p.isTypeSupported("video/mp4"),mpeg:p.isTypeSupported("audio/mpeg"),mp3:p.isTypeSupported('audio/mp4; codecs="mp3"')},O=navigator.vendor;if(_.enableWorker&&typeof Worker!="undefined"){G.logger.log("demuxing in webworker");var A;try{A=this.worker=X("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),A.addEventListener("message",this.onwmsg),A.onerror=function(S){o.trigger(B.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(S.message+" ("+S.filename+":"+S.lineno+")")})},A.postMessage({cmd:"init",typeSupported:D,vendor:O,id:u,config:JSON.stringify(_)})}catch(S){G.logger.warn("Error in worker:",S),G.logger.error("Error while initializing DemuxerWorker, fallback to inline"),A&&self.URL.revokeObjectURL(A.objectURL),this.transmuxer=new K.default(this.observer,D,_,O,u),this.worker=null}}else this.transmuxer=new K.default(this.observer,D,_,O,u)}var f=l.prototype;return f.destroy=function(){var u=this.worker;if(u)u.removeEventListener("message",this.onwmsg),u.terminate(),this.worker=null;else{var a=this.transmuxer;a&&(a.destroy(),this.transmuxer=null)}var s=this.observer;s&&s.removeAllListeners(),this.observer=null},f.push=function(u,a,s,R,_,C,D,O,A,S){var T=this;A.transmuxing.start=self.performance.now();var c=this.transmuxer,w=this.worker,y=C?C.start:_.start,b=_.decryptdata,U=this.frag,F=!(U&&_.cc===U.cc),E=!(U&&A.level===U.level),N=U?A.sn-U.sn:-1,I=this.part?A.part-this.part.index:1,g=!E&&(N===1||N===0&&I===1),H=self.performance.now();(E||N||_.stats.parsing.start===0)&&(_.stats.parsing.start=H),C&&(I||!g)&&(C.stats.parsing.start=H);var $=new K.TransmuxState(F,g,O,E,y);if(!g||F){G.logger.log("[transmuxer-interface, "+_.type+"]: Starting new transmux session for sn: "+A.sn+" p: "+A.part+" level: "+A.level+" id: "+A.id+` discontinuity: `+F+` trackSwitch: `+E+` contiguous: `+g+` accurateTimeOffset: `+O+` timeOffset: `+y);var ie=new K.TransmuxConfig(s,R,a,D,S);this.configureTransmuxer(ie)}if(this.frag=_,this.part=C,w)w.postMessage({cmd:"demux",data:u,decryptdata:b,chunkMeta:A,state:$},u instanceof ArrayBuffer?[u]:[]);else if(c){var oe=c.push(u,b,A,$);Object(K.isPromise)(oe)?oe.then(function(Ce){T.handleTransmuxComplete(Ce)}):this.handleTransmuxComplete(oe)}},f.flush=function(u){var a=this;u.transmuxing.start=self.performance.now();var s=this.transmuxer,R=this.worker;if(R)R.postMessage({cmd:"flush",chunkMeta:u});else if(s){var _=s.flush(u);Object(K.isPromise)(_)?_.then(function(C){a.handleFlushResult(C,u)}):this.handleFlushResult(_,u)}},f.handleFlushResult=function(u,a){var s=this;u.forEach(function(R){s.handleTransmuxComplete(R)}),this.onFlush(a)},f.onWorkerMessage=function(u){var a=u.data,s=this.hls;switch(a.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(a.data);break}case"flush":{this.onFlush(a.data);break}default:{a.data=a.data||{},a.data.frag=this.frag,a.data.id=this.id,s.trigger(a.event,a.data);break}}},f.configureTransmuxer=function(u){var a=this.worker,s=this.transmuxer;a?a.postMessage({cmd:"configure",config:u}):s&&s.configure(u)},f.handleTransmuxComplete=function(u){u.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(u)},l}()},"./src/demux/transmuxer-worker.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return r});var X=P("./src/demux/transmuxer.ts"),j=P("./src/events.ts"),B=P("./src/utils/logger.ts"),K=P("./node_modules/eventemitter3/index.js"),G=P.n(K);function r(h){var l=new K.EventEmitter,f=function(u,a){h.postMessage({event:u,data:a})};l.on(j.Events.FRAG_DECRYPTED,f),l.on(j.Events.ERROR,f),h.addEventListener("message",function(o){var u=o.data;switch(u.cmd){case"init":{var a=JSON.parse(u.config);h.transmuxer=new X.default(l,u.typeSupported,a,u.vendor,u.id),Object(B.enableLogs)(a.debug),f("init",null);break}case"configure":{h.transmuxer.configure(u.config);break}case"demux":{var s=h.transmuxer.push(u.data,u.decryptdata,u.chunkMeta,u.state);Object(X.isPromise)(s)?s.then(function(C){L(h,C)}):L(h,s);break}case"flush":{var R=u.chunkMeta,_=h.transmuxer.flush(R);Object(X.isPromise)(_)?_.then(function(C){m(h,C,R)}):m(h,_,R);break}default:break}})}function L(h,l){if(p(l.remuxResult))return;var f=[],o=l.remuxResult,u=o.audio,a=o.video;u&&v(f,u),a&&v(f,a),h.postMessage({event:"transmuxComplete",data:l},f)}function v(h,l){l.data1&&h.push(l.data1.buffer),l.data2&&h.push(l.data2.buffer)}function m(h,l,f){l.forEach(function(o){L(h,o)}),h.postMessage({event:"flush",data:f})}function p(h){return!h.audio&&!h.video&&!h.text&&!h.id3&&!h.initSegment}},"./src/demux/transmuxer.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return a}),P.d(J,"isPromise",function(){return _}),P.d(J,"TransmuxConfig",function(){return C}),P.d(J,"TransmuxState",function(){return D});var X=P("./src/events.ts"),j=P("./src/errors.ts"),B=P("./src/crypt/decrypter.ts"),K=P("./src/demux/aacdemuxer.ts"),G=P("./src/demux/mp4demuxer.ts"),r=P("./src/demux/tsdemuxer.ts"),L=P("./src/demux/mp3demuxer.ts"),v=P("./src/remux/mp4-remuxer.ts"),m=P("./src/remux/passthrough-remuxer.ts"),p=P("./src/demux/chunk-cache.ts"),h=P("./src/utils/mp4-tools.ts"),l=P("./src/utils/logger.ts"),f;try{f=self.performance.now.bind(self.performance)}catch(O){l.logger.debug("Unable to use Performance API on this environment"),f=self.Date.now}var o=[{demux:r.default,remux:v.default},{demux:G.default,remux:m.default},{demux:K.default,remux:v.default},{demux:L.default,remux:v.default}],u=1024;o.forEach(function(O){var A=O.demux;u=Math.max(u,A.minProbeByteLength)});var a=function(){function O(S,T,c,w,y){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new p.default,this.observer=S,this.typeSupported=T,this.config=c,this.vendor=w,this.id=y}var A=O.prototype;return A.configure=function(T){this.transmuxConfig=T,this.decrypter&&this.decrypter.reset()},A.push=function(T,c,w,y){var b=this,U=w.transmuxing;U.executeStart=f();var F=new Uint8Array(T),E=this.cache,N=this.config,I=this.currentTransmuxState,g=this.transmuxConfig;y&&(this.currentTransmuxState=y);var H=s(F,c);if(H&&H.method==="AES-128"){var $=this.getDecrypter();if(N.enableSoftwareAES){var ie=$.softwareDecrypt(F,H.key.buffer,H.iv.buffer);if(!ie)return U.executeEnd=f(),R(w);F=new Uint8Array(ie)}else return this.decryptionPromise=$.webCryptoDecrypt(F,H.key.buffer,H.iv.buffer).then(function(Pe){var je=b.push(Pe,null,w);return b.decryptionPromise=null,je}),this.decryptionPromise}var oe=y||I,Ce=oe.contiguous,ve=oe.discontinuity,Se=oe.trackSwitch,Ae=oe.accurateTimeOffset,Oe=oe.timeOffset,he=g.audioCodec,ce=g.videoCodec,re=g.defaultInitPts,fe=g.duration,se=g.initSegmentData;if((ve||Se)&&this.resetInitSegment(se,he,ce,fe),ve&&this.resetInitialTimestamp(re),Ce||this.resetContiguity(),this.needsProbing(F,ve,Se)){if(E.dataLength){var ke=E.flush();F=Object(h.appendUint8Array)(ke,F)}this.configureTransmuxer(F,g)}var Ne=this.transmux(F,H,Oe,Ae,w),Re=this.currentTransmuxState;return Re.contiguous=!0,Re.discontinuity=!1,Re.trackSwitch=!1,U.executeEnd=f(),Ne},A.flush=function(T){var c=this,w=T.transmuxing;w.executeStart=f();var y=this.decrypter,b=this.cache,U=this.currentTransmuxState,F=this.decryptionPromise;if(F)return F.then(function(){return c.flush(T)});var E=[],N=U.timeOffset;if(y){var I=y.flush();I&&E.push(this.push(I,null,T))}var g=b.dataLength;b.reset();var H=this.demuxer,$=this.remuxer;if(!H||!$)return g>=u&&this.observer.emit(X.Events.ERROR,X.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),w.executeEnd=f(),[R(T)];var ie=H.flush(N);return _(ie)?ie.then(function(oe){return c.flushRemux(E,oe,T),E}):(this.flushRemux(E,ie,T),E)},A.flushRemux=function(T,c,w){var y=c.audioTrack,b=c.avcTrack,U=c.id3Track,F=c.textTrack,E=this.currentTransmuxState,N=E.accurateTimeOffset,I=E.timeOffset;l.logger.log("[transmuxer.ts]: Flushed fragment "+w.sn+(w.part>-1?" p: "+w.part:"")+" of level "+w.level);var g=this.remuxer.remux(y,b,U,F,I,N,!0,this.id);T.push({remuxResult:g,chunkMeta:w}),w.transmuxing.executeEnd=f()},A.resetInitialTimestamp=function(T){var c=this.demuxer,w=this.remuxer;if(!c||!w)return;c.resetTimeStamp(T),w.resetTimeStamp(T)},A.resetContiguity=function(){var T=this.demuxer,c=this.remuxer;if(!T||!c)return;T.resetContiguity(),c.resetNextTimestamp()},A.resetInitSegment=function(T,c,w,y){var b=this.demuxer,U=this.remuxer;if(!b||!U)return;b.resetInitSegment(c,w,y),U.resetInitSegment(T,c,w)},A.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},A.transmux=function(T,c,w,y,b){var U;return c&&c.method==="SAMPLE-AES"?U=this.transmuxSampleAes(T,c,w,y,b):U=this.transmuxUnencrypted(T,w,y,b),U},A.transmuxUnencrypted=function(T,c,w,y){var b=this.demuxer.demux(T,c,!1,!this.config.progressive),U=b.audioTrack,F=b.avcTrack,E=b.id3Track,N=b.textTrack,I=this.remuxer.remux(U,F,E,N,c,w,!1,this.id);return{remuxResult:I,chunkMeta:y}},A.transmuxSampleAes=function(T,c,w,y,b){var U=this;return this.demuxer.demuxSampleAes(T,c,w).then(function(F){var E=U.remuxer.remux(F.audioTrack,F.avcTrack,F.id3Track,F.textTrack,w,y,!1,U.id);return{remuxResult:E,chunkMeta:b}})},A.configureTransmuxer=function(T,c){for(var w=this.config,y=this.observer,b=this.typeSupported,U=this.vendor,F=c.audioCodec,E=c.defaultInitPts,N=c.duration,I=c.initSegmentData,g=c.videoCodec,H,$=0,ie=o.length;$0&&A!=null&&A.key!=null&&A.iv!==null&&A.method!=null&&(S=A),S}var R=function(A){return{remuxResult:{},chunkMeta:A}};function _(O){return"then"in O&&O.then instanceof Function}var C=function(A,S,T,c,w){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=A,this.videoCodec=S,this.initSegmentData=T,this.duration=c,this.defaultInitPts=w},D=function(A,S,T,c,w){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=A,this.contiguous=S,this.accurateTimeOffset=T,this.trackSwitch=c,this.timeOffset=w}},"./src/demux/tsdemuxer.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"discardEPB",function(){return R});var X=P("./src/demux/adts.ts"),j=P("./src/demux/mpegaudio.ts"),B=P("./src/demux/exp-golomb.ts"),K=P("./src/demux/id3.ts"),G=P("./src/demux/sample-aes.ts"),r=P("./src/events.ts"),L=P("./src/utils/mp4-tools.ts"),v=P("./src/utils/logger.ts"),m=P("./src/errors.ts"),p={video:1,audio:2,id3:3,text:4},h=function(){function _(D,O,A){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=D,this.config=O,this.typeSupported=A}_.probe=function(O){var A=_.syncOffset(O);return A<0?!1:(A&&v.logger.warn("MPEG2-TS detected but first sync word found @ offset "+A+", junk ahead ?"),!0)},_.syncOffset=function(O){for(var A=Math.min(1e3,O.length-3*188),S=0;S>4,he=void 0;if(Oe>1){if(he=ve+5+O[ve+4],he===ve+188)continue}else he=ve+4;switch(Ae){case U:Se&&(F&&(c=u(F))&&this.parseAVCPES(c,!1),F={data:[],size:0}),F&&(F.data.push(O.subarray(he,ve+188)),F.size+=ve+188-he);break;case E:Se&&(I&&(c=u(I))&&(y.isAAC?this.parseAACPES(c):this.parseMPEGPES(c)),I={data:[],size:0}),I&&(I.data.push(O.subarray(he,ve+188)),I.size+=ve+188-he);break;case N:Se&&(g&&(c=u(g))&&this.parseID3PES(c),g={data:[],size:0}),g&&(g.data.push(O.subarray(he,ve+188)),g.size+=ve+188-he);break;case 0:Se&&(he+=O[he]+1),ie=this._pmtId=f(O,he);break;case ie:{Se&&(he+=O[he]+1);var ce=o(O,he,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,S);U=ce.avc,U>0&&(w.pid=U),E=ce.audio,E>0&&(y.pid=E,y.isAAC=ce.isAAC),N=ce.id3,N>0&&(b.pid=N),H&&!$&&(v.logger.log("reparse from beginning"),H=!1,ve=Ce-188),$=this.pmtParsed=!0;break}case 17:case 8191:break;default:H=!0;break}}else this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});w.pesData=F,y.pesData=I,b.pesData=g;var re={audioTrack:y,avcTrack:w,id3Track:b,textTrack:this._txtTrack};return T&&this.extractRemainingSamples(re),re},C.flush=function(){var O=this.remainderData;this.remainderData=null;var A;return O?A=this.demux(O,-1,!1,!0):A={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(A),this.sampleAes?this.decrypt(A,this.sampleAes):A},C.extractRemainingSamples=function(O){var A=O.audioTrack,S=O.avcTrack,T=O.id3Track,c=S.pesData,w=A.pesData,y=T.pesData,b;c&&(b=u(c))?(this.parseAVCPES(b,!0),S.pesData=null):S.pesData=c,w&&(b=u(w))?(A.isAAC?this.parseAACPES(b):this.parseMPEGPES(b),A.pesData=null):(w!=null&&w.size&&v.logger.log("last AAC PES packet truncated,might overlap between fragments"),A.pesData=w),y&&(b=u(y))?(this.parseID3PES(b),T.pesData=null):T.pesData=y},C.demuxSampleAes=function(O,A,S){var T=this.demux(O,S,!0,!this.config.progressive),c=this.sampleAes=new G.default(this.observer,this.config,A);return this.decrypt(T,c)},C.decrypt=function(O,A){return new Promise(function(S){var T=O.audioTrack,c=O.avcTrack;T.samples&&T.isAAC?A.decryptAacSamples(T.samples,0,function(){c.samples?A.decryptAvcSamples(c.samples,0,0,function(){S(O)}):S(O)}):c.samples&&A.decryptAvcSamples(c.samples,0,0,function(){S(O)})})},C.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},C.parseAVCPES=function(O,A){var S=this,T=this._avcTrack,c=this.parseAVCNALu(O.data),w=!1,y=this.avcSample,b,U=!1;O.data=null,y&&c.length&&!T.audFound&&(a(y,T),y=this.avcSample=l(!1,O.pts,O.dts,"")),c.forEach(function(F){switch(F.type){case 1:{b=!0,y||(y=S.avcSample=l(!0,O.pts,O.dts,"")),w&&(y.debug+="NDR "),y.frame=!0;var E=F.data;if(U&&E.length>4){var N=new B.default(E).readSliceType();(N===2||N===4||N===7||N===9)&&(y.key=!0)}break}case 5:b=!0,y||(y=S.avcSample=l(!0,O.pts,O.dts,"")),w&&(y.debug+="IDR "),y.key=!0,y.frame=!0;break;case 6:{b=!0,w&&y&&(y.debug+="SEI ");var I=new B.default(R(F.data));I.readUByte();for(var g=0,H=0,$=!1,ie=0;!$&&I.bytesAvailable>1;){g=0;do ie=I.readUByte(),g+=ie;while(ie===255);H=0;do ie=I.readUByte(),H+=ie;while(ie===255);if(g===4&&I.bytesAvailable!==0){$=!0;var oe=I.readUByte();if(oe===181){var Ce=I.readUShort();if(Ce===49){var ve=I.readUInt();if(ve===1195456820){var Se=I.readUByte();if(Se===3){for(var Ae=I.readUByte(),Oe=I.readUByte(),he=31&Ae,ce=[Ae,Oe],re=0;re16){for(var fe=[],se=0;se<16;se++)fe.push(I.readUByte().toString(16)),(se===3||se===5||se===7||se===9)&&fe.push("-");for(var ke=H-16,Ne=new Uint8Array(ke),Re=0;Re=0){var I={data:O.subarray(E,y-T-1),type:N};w.push(I)}else{var g=this.getLastNalUnit();if(g&&(c&&y<=4-c&&(g.state&&(g.data=g.data.subarray(0,g.data.byteLength-c))),U=y-T-1,U>0)){var H=new Uint8Array(g.data.byteLength+U);H.set(g.data,0),H.set(O.subarray(0,U),g.data.byteLength),g.data=H,g.state=0}}y=0&&T>=0){var $={data:O.subarray(E,A),type:N,state:T};w.push($)}if(w.length===0){var ie=this.getLastNalUnit();if(ie){var oe=new Uint8Array(ie.data.byteLength+O.byteLength);oe.set(ie.data,0),oe.set(O,ie.data.byteLength),ie.data=oe}}return S.naluState=T,w},C.parseAACPES=function(O){var A=0,S=this._audioTrack,T=this.aacOverFlow,c=O.data;if(T){this.aacOverFlow=null;var w=T.sample.unit.byteLength,y=Math.min(T.missing,w),b=w-y;T.sample.unit.set(c.subarray(0,y),b),S.samples.push(T.sample),A=T.missing}var U,F;for(U=A,F=c.length;U1;){var w=new Uint8Array(c[0].length+c[1].length);w.set(c[0]),w.set(c[1],c[0].length),c[0]=w,c.splice(1,1)}D=c[0];var y=(D[0]<<16)+(D[1]<<8)+D[2];if(y===1){if(O=(D[4]<<8)+D[5],O&&O>_.size-6)return null;var b=D[7];b&192&&(S=(D[9]&14)*536870912+(D[10]&255)*4194304+(D[11]&254)*16384+(D[12]&255)*128+(D[13]&254)/2,b&64?(T=(D[14]&14)*536870912+(D[15]&255)*4194304+(D[16]&254)*16384+(D[17]&255)*128+(D[18]&254)/2,S-T>60*9e4&&(v.logger.warn(Math.round((S-T)/9e4)+"s delta between PTS and DTS, align them"),S=T)):T=S),A=D[8];var U=A+9;if(_.size<=U)return null;_.size-=U;for(var F=new Uint8Array(_.size),E=0,N=c.length;EI){U-=I;continue}else D=D.subarray(U),I-=U,U=0;F.set(D,C),C+=I}return O&&(O-=A+3),{data:F,pts:S,dts:T,len:O}}return null}function a(_,C){if(_.units.length&&_.frame){if(_.pts===void 0){var D=C.samples,O=D.length;if(O){var A=D[O-1];_.pts=A.pts,_.dts=A.dts}else{C.dropped++;return}}C.samples.push(_)}_.debug.length&&v.logger.log(_.pts+"/"+_.dts+":"+_.debug)}function s(_,C){var D=_.length;if(D>0){if(C.pts>=_[D-1].pts)_.push(C);else for(var O=D-1;O>=0;O--)if(C.pts<_[O].pts){_.splice(O,0,C);break}}else _.push(C)}function R(_){for(var C=_.byteLength,D=[],O=1;OS)return c;return 0}},{key:"maxAutoLevel",get:function(){var A=this.levels,S=this.autoLevelCapping,T;return S===-1&&A&&A.length?T=A.length-1:T=S,T}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(A){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,A)}},{key:"audioTracks",get:function(){var A=this.audioTrackController;return A?A.audioTracks:[]}},{key:"audioTrack",get:function(){var A=this.audioTrackController;return A?A.audioTrack:-1},set:function(A){var S=this.audioTrackController;S&&(S.audioTrack=A)}},{key:"subtitleTracks",get:function(){var A=this.subtitleTrackController;return A?A.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var A=this.subtitleTrackController;return A?A.subtitleTrack:-1},set:function(A){var S=this.subtitleTrackController;S&&(S.subtitleTrack=A)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var A=this.subtitleTrackController;return A?A.subtitleDisplay:!1},set:function(A){var S=this.subtitleTrackController;S&&(S.subtitleDisplay=A)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(A){this.config.lowLatencyMode=A}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return u.Events}},{key:"ErrorTypes",get:function(){return a.ErrorTypes}},{key:"ErrorDetails",get:function(){return a.ErrorDetails}},{key:"DefaultConfig",get:function(){return C.defaultConfig?C.defaultConfig:l.hlsDefaultConfig},set:function(A){C.defaultConfig=A}}]),C}();_.defaultConfig=void 0},"./src/is-supported.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"isSupported",function(){return B}),P.d(J,"changeTypeSupported",function(){return K});var X=P("./src/utils/mediasource-helper.ts");function j(){return self.SourceBuffer||self.WebKitSourceBuffer}function B(){var G=Object(X.getMediaSource)();if(!G)return!1;var r=j(),L=G&&typeof G.isTypeSupported=="function"&&G.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),v=!r||r.prototype&&typeof r.prototype.appendBuffer=="function"&&typeof r.prototype.remove=="function";return!!L&&!!v}function K(){var G,r=j();return typeof(r==null||((G=r.prototype)===null||G===void 0)?void 0:G.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return h}),P.d(J,"LoadError",function(){return f});var X=P("./src/polyfills/number.ts"),j=P("./src/errors.ts");function B(o,u){o.prototype=Object.create(u.prototype),o.prototype.constructor=o,v(o,u)}function K(o){var u=typeof Map=="function"?new Map:void 0;return K=function(s){if(s===null||!L(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof u!="undefined"){if(u.has(s))return u.get(s);u.set(s,R)}function R(){return G(s,arguments,m(this).constructor)}return R.prototype=Object.create(s.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),v(R,s)},K(o)}function G(o,u,a){return r()?G=Reflect.construct:G=function(R,_,C){var D=[null];D.push.apply(D,_);var O=Function.bind.apply(R,D),A=new O;return C&&v(A,C.prototype),A},G.apply(null,arguments)}function r(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(o){return!1}}function L(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function v(o,u){return v=Object.setPrototypeOf||function(s,R){return s.__proto__=R,s},v(o,u)}function m(o){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},m(o)}var p=Math.pow(2,17),h=function(){function o(a){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=a}var u=o.prototype;return u.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},u.abort=function(){this.loader&&this.loader.abort()},u.load=function(s,R){var _=this,C=s.url;if(!C)return Promise.reject(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,networkDetails:null},"Fragment does not have a "+(C?"part list":"url")));this.abort();var D=this.config,O=D.fLoader,A=D.loader;return new Promise(function(S,T){_.loader&&_.loader.destroy();var c=_.loader=s.loader=O?new O(D):new A(D),w=l(s),y={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:p};s.stats=c.stats,c.load(w,y,{onSuccess:function(U,F,E,N){_.resetLoader(s,c),S({frag:s,part:null,payload:U.data,networkDetails:N})},onError:function(U,F,E){_.resetLoader(s,c),T(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,response:U,networkDetails:E}))},onAbort:function(U,F,E){_.resetLoader(s,c),T(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,networkDetails:E}))},onTimeout:function(U,F,E){_.resetLoader(s,c),T(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,networkDetails:E}))},onProgress:function(U,F,E,N){R&&R({frag:s,part:null,payload:E,networkDetails:N})}})})},u.loadPart=function(s,R,_){var C=this;this.abort();var D=this.config,O=D.fLoader,A=D.loader;return new Promise(function(S,T){C.loader&&C.loader.destroy();var c=C.loader=s.loader=O?new O(D):new A(D),w=l(s,R),y={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:p};R.stats=c.stats,c.load(w,y,{onSuccess:function(U,F,E,N){C.resetLoader(s,c),C.updateStatsFromPart(s,R);var I={frag:s,part:R,payload:U.data,networkDetails:N};_(I),S(I)},onError:function(U,F,E){C.resetLoader(s,c),T(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,part:R,response:U,networkDetails:E}))},onAbort:function(U,F,E){s.stats.aborted=R.stats.aborted,C.resetLoader(s,c),T(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,part:R,networkDetails:E}))},onTimeout:function(U,F,E){C.resetLoader(s,c),T(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,part:R,networkDetails:E}))}})})},u.updateStatsFromPart=function(s,R){var _=s.stats,C=R.stats,D=C.total;if(_.loaded+=C.loaded,D){var O=Math.round(s.duration/R.duration),A=Math.min(Math.round(_.loaded/D),O),S=O-A,T=S*Math.round(_.loaded/A);_.total=_.loaded+T}else _.total=Math.max(_.loaded,_.total);var c=_.loading,w=C.loading;c.start?c.first+=w.first-w.start:(c.start=w.start,c.first=w.first),c.end=w.end},u.resetLoader=function(s,R){s.loader=null,this.loader===R&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),R.destroy()},o}();function l(o,u){u===void 0&&(u=null);var a=u||o,s={frag:o,part:u,responseType:"arraybuffer",url:a.url,headers:{},rangeStart:0,rangeEnd:0},R=a.byteRangeStartOffset,_=a.byteRangeEndOffset;return Object(X.isFiniteNumber)(R)&&Object(X.isFiniteNumber)(_)&&(s.rangeStart=R,s.rangeEnd=_),s}var f=function(o){B(u,o);function u(a){for(var s,R=arguments.length,_=new Array(R>1?R-1:0),C=1;C>8*(15-D)&255;return C},s.setDecryptDataFromLevelKey=function(_,C){var D=_;return(_==null?void 0:_.method)==="AES-128"&&_.uri&&!_.iv&&(D=G.LevelKey.fromURI(_.uri),D.method=_.method,D.iv=this.createInitializationVector(C),D.keyFormat="identity"),D},s.setElementaryStreamInfo=function(_,C,D,O,A,S){S===void 0&&(S=!1);var T=this.elementaryStreams,c=T[_];if(!c){T[_]={startPTS:C,endPTS:D,startDTS:O,endDTS:A,partial:S};return}c.startPTS=Math.min(c.startPTS,C),c.endPTS=Math.max(c.endPTS,D),c.startDTS=Math.min(c.startDTS,O),c.endDTS=Math.max(c.endDTS,A)},s.clearElementaryStreamInfo=function(){var _=this.elementaryStreams;_[h.AUDIO]=null,_[h.VIDEO]=null,_[h.AUDIOVIDEO]=null},p(a,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var _=this.sn;typeof _!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&K.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),_=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,_)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(X.isFiniteNumber)(this.programDateTime))return null;var _=Object(X.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+_*1e3}},{key:"encrypted",get:function(){var _;return!!((_=this.decryptdata)!==null&&_!==void 0&&_.keyFormat&&this.decryptdata.uri)}}]),a}(l),o=function(u){L(a,u);function a(s,R,_,C,D){var O;O=u.call(this,_)||this,O.fragOffset=0,O.duration=0,O.gap=!1,O.independent=!1,O.relurl=void 0,O.fragment=void 0,O.index=void 0,O.stats=new r.LoadStats,O.duration=s.decimalFloatingPoint("DURATION"),O.gap=s.bool("GAP"),O.independent=s.bool("INDEPENDENT"),O.relurl=s.enumeratedString("URI"),O.fragment=R,O.index=C;var A=s.enumeratedString("BYTERANGE");return A&&O.setByteRange(A,D),D&&(O.fragOffset=D.fragOffset+D.duration),O}return p(a,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var R=this.elementaryStreams;return!!(R.audio||R.video||R.audiovideo)}}]),a}(l)},"./src/loader/key-loader.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return K});var X=P("./src/events.ts"),j=P("./src/errors.ts"),B=P("./src/utils/logger.ts"),K=function(){function G(L){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=L,this._registerListeners()}var r=G.prototype;return r._registerListeners=function(){this.hls.on(X.Events.KEY_LOADING,this.onKeyLoading,this)},r._unregisterListeners=function(){this.hls.off(X.Events.KEY_LOADING,this.onKeyLoading)},r.destroy=function(){this._unregisterListeners();for(var v in this.loaders){var m=this.loaders[v];m&&m.destroy()}this.loaders={}},r.onKeyLoading=function(v,m){var p=m.frag,h=p.type,l=this.loaders[h];if(!p.decryptdata){B.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var f=p.decryptdata.uri;if(f!==this.decrypturl||this.decryptkey===null){var o=this.hls.config;if(l&&(B.logger.warn("abort previous key loader for type:"+h),l.abort()),!f){B.logger.warn("key uri is falsy");return}var u=o.loader,a=p.loader=this.loaders[h]=new u(o);this.decrypturl=f,this.decryptkey=null;var s={url:f,frag:p,responseType:"arraybuffer"},R={timeout:o.fragLoadingTimeOut,maxRetry:0,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout,highWaterMark:0},_={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};a.load(s,R,_)}else this.decryptkey&&(p.decryptdata.key=this.decryptkey,this.hls.trigger(X.Events.KEY_LOADED,{frag:p}))},r.loadsuccess=function(v,m,p){var h=p.frag;if(!h.decryptdata){B.logger.error("after key load, decryptdata unset");return}this.decryptkey=h.decryptdata.key=new Uint8Array(v.data),h.loader=null,delete this.loaders[h.type],this.hls.trigger(X.Events.KEY_LOADED,{frag:h})},r.loaderror=function(v,m){var p=m.frag,h=p.loader;h&&h.abort(),delete this.loaders[p.type],this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:p,response:v})},r.loadtimeout=function(v,m){var p=m.frag,h=p.loader;h&&h.abort(),delete this.loaders[p.type],this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:p})},G}()},"./src/loader/level-details.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"LevelDetails",function(){return G});var X=P("./src/polyfills/number.ts");function j(r,L){for(var v=0;vm.endSN||p>0||p===0&&h>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.availabilityDelay},B(r,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(X.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||K}},{key:"drift",get:function(){var m=this.driftEndTime-this.driftStartTime;if(m>0){var p=this.driftEnd-this.driftStart;return p*1e3/m}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var m;return(m=this.fragments)!==null&&m!==void 0&&m.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),r}()},"./src/loader/level-key.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"LevelKey",function(){return G});var X=P("./node_modules/url-toolkit/src/url-toolkit.js"),j=P.n(X);function B(r,L){for(var v=0;v2){var T=S.shift()+".";return T+=parseInt(S.shift()).toString(16),T+=("000"+parseInt(S.shift()).toString(16)).substr(-4),T}return A},D.resolve=function(A,S){return j.buildAbsoluteURL(S,A,{alwaysNormalize:!0})},D.parseMasterPlaylist=function(A,S){var T=[],c={},w=!1;p.lastIndex=0;for(var y;(y=p.exec(A))!=null;)if(y[1]){var b=new L.AttrList(y[1]),U={attrs:b,bitrate:b.decimalInteger("AVERAGE-BANDWIDTH")||b.decimalInteger("BANDWIDTH"),name:b.NAME,url:D.resolve(y[2],S)},F=b.decimalResolution("RESOLUTION");F&&(U.width=F.width,U.height=F.height),s((b.CODECS||"").split(/[ ,]+/).filter(function(N){return N}),U),U.videoCodec&&U.videoCodec.indexOf("avc1")!==-1&&(U.videoCodec=D.convertAVC1ToAVCOTI(U.videoCodec)),T.push(U)}else if(y[3]){var E=new L.AttrList(y[3]);E["DATA-ID"]&&(w=!0,c[E["DATA-ID"]]=E)}return{levels:T,sessionData:w?c:null}},D.parseMasterPlaylistMedia=function(A,S,T,c){c===void 0&&(c=[]);var w,y=[],b=0;for(h.lastIndex=0;(w=h.exec(A))!==null;){var U=new L.AttrList(w[1]);if(U.TYPE===T){var F={attrs:U,bitrate:0,id:b++,groupId:U["GROUP-ID"],instreamId:U["INSTREAM-ID"],name:U.NAME||U.LANGUAGE||"",type:T,default:U.bool("DEFAULT"),autoselect:U.bool("AUTOSELECT"),forced:U.bool("FORCED"),lang:U.LANGUAGE,url:U.URI?D.resolve(U.URI,S):""};if(c.length){var E=D.findGroup(c,F.groupId)||c[0];R(F,E,"audioCodec"),R(F,E,"textCodec")}y.push(F)}}return y},D.parseLevelPlaylist=function(A,S,T,c,w){var y=new G.LevelDetails(S),b=y.fragments,U=null,F=0,E=0,N=0,I=0,g=null,H=new K.Fragment(c,S),$,ie,oe,Ce=-1,ve=!1;for(l.lastIndex=0,y.m3u8=A;($=l.exec(A))!==null;){ve&&(ve=!1,H=new K.Fragment(c,S),H.start=N,H.sn=F,H.cc=I,H.level=T,U&&(H.initSegment=U,H.rawProgramDateTime=U.rawProgramDateTime));var Se=$[1];if(Se){H.duration=parseFloat(Se);var Ae=(" "+$[2]).slice(1);H.title=Ae||null,H.tagList.push(Ae?["INF",Se,Ae]:["INF",Se])}else if($[3])Object(X.isFiniteNumber)(H.duration)&&(H.start=N,oe&&(H.levelkey=oe),H.sn=F,H.level=T,H.cc=I,H.urlId=w,b.push(H),H.relurl=(" "+$[3]).slice(1),C(H,g),g=H,N+=H.duration,F++,E=0,ve=!0);else if($[4]){var Oe=(" "+$[4]).slice(1);g?H.setByteRange(Oe,g):H.setByteRange(Oe)}else if($[5])H.rawProgramDateTime=(" "+$[5]).slice(1),H.tagList.push(["PROGRAM-DATE-TIME",H.rawProgramDateTime]),Ce===-1&&(Ce=b.length);else{if($=$[0].match(f),!$){v.logger.warn("No matches on slow regex match for level playlist!");continue}for(ie=1;ie<$.length&&!(typeof $[ie]!="undefined");ie++);var he=(" "+$[ie]).slice(1),ce=(" "+$[ie+1]).slice(1),re=$[ie+2]?(" "+$[ie+2]).slice(1):"";switch(he){case"PLAYLIST-TYPE":y.type=ce.toUpperCase();break;case"MEDIA-SEQUENCE":F=y.startSN=parseInt(ce);break;case"SKIP":{var fe=new L.AttrList(ce),se=fe.decimalInteger("SKIPPED-SEGMENTS");if(Object(X.isFiniteNumber)(se)){y.skippedSegments=se;for(var ke=se;ke--;)b.unshift(null);F+=se}var Ne=fe.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ne&&(y.recentlyRemovedDateranges=Ne.split(" "));break}case"TARGETDURATION":y.targetduration=parseFloat(ce);break;case"VERSION":y.version=parseInt(ce);break;case"EXTM3U":break;case"ENDLIST":y.live=!1;break;case"#":(ce||re)&&H.tagList.push(re?[ce,re]:[ce]);break;case"DIS":I++;case"GAP":H.tagList.push([he]);break;case"BITRATE":H.tagList.push([he,ce]);break;case"DISCONTINUITY-SEQ":I=parseInt(ce);break;case"KEY":{var Re,Pe=new L.AttrList(ce),je=Pe.enumeratedString("METHOD"),ue=Pe.URI,Ee=Pe.hexadecimalInteger("IV"),Le=Pe.enumeratedString("KEYFORMATVERSIONS"),Ie=Pe.enumeratedString("KEYID"),Ge=(Re=Pe.enumeratedString("KEYFORMAT"))!=null?Re:"identity",Xe=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Xe.indexOf(Ge)>-1){v.logger.warn("Keyformat "+Ge+" is not supported from the manifest");continue}else if(Ge!=="identity")continue;je&&(oe=r.LevelKey.fromURL(S,ue),ue&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(je)>=0&&(oe.method=je,oe.keyFormat=Ge,Ie&&(oe.keyID=Ie),Le&&(oe.keyFormatVersions=Le),oe.iv=Ee));break}case"START":{var Je=new L.AttrList(ce),Qe=Je.decimalFloatingPoint("TIME-OFFSET");Object(X.isFiniteNumber)(Qe)&&(y.startTimeOffset=Qe);break}case"MAP":{var at=new L.AttrList(ce);H.relurl=at.URI,at.BYTERANGE&&H.setByteRange(at.BYTERANGE),H.level=T,H.sn="initSegment",oe&&(H.levelkey=oe),H.initSegment=null,U=H,ve=!0;break}case"SERVER-CONTROL":{var qe=new L.AttrList(ce);y.canBlockReload=qe.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=qe.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&qe.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=qe.optionalFloat("PART-HOLD-BACK",0),y.holdBack=qe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var tt=new L.AttrList(ce);y.partTarget=tt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Be=y.partList;Be||(Be=y.partList=[]);var ut=E>0?Be[Be.length-1]:void 0,ot=E++,Ue=new K.Part(new L.AttrList(ce),H,S,ot,ut);Be.push(Ue),H.duration+=Ue.duration;break}case"PRELOAD-HINT":{var He=new L.AttrList(ce);y.preloadHint=He;break}case"RENDITION-REPORT":{var Te=new L.AttrList(ce);y.renditionReports=y.renditionReports||[],y.renditionReports.push(Te);break}default:v.logger.warn("line parsed but not handled: "+$);break}}}g&&!g.relurl?(b.pop(),N-=g.duration,y.partList&&(y.fragmentHint=g)):y.partList&&(C(H,g),H.cc=I,y.fragmentHint=H);var me=b.length,be=b[0],ae=b[me-1];if(N+=y.skippedSegments*y.targetduration,N>0&&me&&ae){y.averagetargetduration=N/me;var le=ae.sn;y.endSN=le!=="initSegment"?le:0,be&&(y.startCC=be.cc,be.initSegment||y.fragments.every(function(de){return de.relurl&&u(de.relurl)})&&(v.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),H=new K.Fragment(c,S),H.relurl=ae.relurl,H.level=T,H.sn="initSegment",be.initSegment=H,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(N+=y.fragmentHint.duration),y.totalduration=N,y.endCC=I,Ce>0&&_(b,Ce),y},D}();function s(D,O){["video","audio","text"].forEach(function(A){var S=D.filter(function(c){return Object(m.isCodecType)(c,A)});if(S.length){var T=S.filter(function(c){return c.lastIndexOf("avc1",0)===0||c.lastIndexOf("mp4a",0)===0});O[A+"Codec"]=T.length>0?T[0]:S[0],D=D.filter(function(c){return S.indexOf(c)===-1})}}),O.unknownCodecs=D}function R(D,O,A){var S=O[A];S&&(D[A]=S)}function _(D,O){for(var A=D[O],S=O;S--;){var T=D[S];if(!T)return;T.programDateTime=A.programDateTime-T.duration*1e3,A=T}}function C(D,O){D.rawProgramDateTime?D.programDateTime=Date.parse(D.rawProgramDateTime):O!=null&&O.programDateTime&&(D.programDateTime=O.endProgramDateTime),Object(X.isFiniteNumber)(D.programDateTime)||(D.programDateTime=null,D.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/polyfills/number.ts"),j=P("./src/events.ts"),B=P("./src/errors.ts"),K=P("./src/utils/logger.ts"),G=P("./src/utils/mp4-tools.ts"),r=P("./src/loader/m3u8-parser.ts"),L=P("./src/types/loader.ts"),v=P("./src/utils/attr-list.ts");function m(l){var f=l.type;switch(f){case L.PlaylistContextType.AUDIO_TRACK:return L.PlaylistLevelType.AUDIO;case L.PlaylistContextType.SUBTITLE_TRACK:return L.PlaylistLevelType.SUBTITLE;default:return L.PlaylistLevelType.MAIN}}function p(l,f){var o=l.url;return(o===void 0||o.indexOf("data:")===0)&&(o=f.url),o}var h=function(){function l(o){this.hls=void 0,this.loaders=Object.create(null),this.hls=o,this.registerListeners()}var f=l.prototype;return f.registerListeners=function(){var u=this.hls;u.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(j.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.on(j.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.unregisterListeners=function(){var u=this.hls;u.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(j.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(j.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.off(j.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.createInternalLoader=function(u){var a=this.hls.config,s=a.pLoader,R=a.loader,_=s||R,C=new _(a);return u.loader=C,this.loaders[u.type]=C,C},f.getInternalLoader=function(u){return this.loaders[u.type]},f.resetInternalLoader=function(u){this.loaders[u]&&delete this.loaders[u]},f.destroyInternalLoaders=function(){for(var u in this.loaders){var a=this.loaders[u];a&&a.destroy(),this.resetInternalLoader(u)}},f.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},f.onManifestLoading=function(u,a){var s=a.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:L.PlaylistContextType.MANIFEST,url:s,deliveryDirectives:null})},f.onLevelLoading=function(u,a){var s=a.id,R=a.level,_=a.url,C=a.deliveryDirectives;this.load({id:s,groupId:null,level:R,responseType:"text",type:L.PlaylistContextType.LEVEL,url:_,deliveryDirectives:C})},f.onAudioTrackLoading=function(u,a){var s=a.id,R=a.groupId,_=a.url,C=a.deliveryDirectives;this.load({id:s,groupId:R,level:null,responseType:"text",type:L.PlaylistContextType.AUDIO_TRACK,url:_,deliveryDirectives:C})},f.onSubtitleTrackLoading=function(u,a){var s=a.id,R=a.groupId,_=a.url,C=a.deliveryDirectives;this.load({id:s,groupId:R,level:null,responseType:"text",type:L.PlaylistContextType.SUBTITLE_TRACK,url:_,deliveryDirectives:C})},f.load=function(u){var a,s=this.hls.config,R=this.getInternalLoader(u);if(R){var _=R.context;if(_&&_.url===u.url){K.logger.trace("[playlist-loader]: playlist request ongoing");return}K.logger.log("[playlist-loader]: aborting previous loader for type: "+u.type),R.abort()}var C,D,O,A;switch(u.type){case L.PlaylistContextType.MANIFEST:C=s.manifestLoadingMaxRetry,D=s.manifestLoadingTimeOut,O=s.manifestLoadingRetryDelay,A=s.manifestLoadingMaxRetryTimeout;break;case L.PlaylistContextType.LEVEL:case L.PlaylistContextType.AUDIO_TRACK:case L.PlaylistContextType.SUBTITLE_TRACK:C=0,D=s.levelLoadingTimeOut;break;default:C=s.levelLoadingMaxRetry,D=s.levelLoadingTimeOut,O=s.levelLoadingRetryDelay,A=s.levelLoadingMaxRetryTimeout;break}if(R=this.createInternalLoader(u),(a=u.deliveryDirectives)!==null&&a!==void 0&&a.part){var S;if(u.type===L.PlaylistContextType.LEVEL&&u.level!==null?S=this.hls.levels[u.level].details:u.type===L.PlaylistContextType.AUDIO_TRACK&&u.id!==null?S=this.hls.audioTracks[u.id].details:u.type===L.PlaylistContextType.SUBTITLE_TRACK&&u.id!==null&&(S=this.hls.subtitleTracks[u.id].details),S){var T=S.partTarget,c=S.targetduration;T&&c&&(D=Math.min(Math.max(T*3,c*.8)*1e3,D))}}var w={timeout:D,maxRetry:C,retryDelay:O,maxRetryDelay:A,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};R.load(u,w,y)},f.loadsuccess=function(u,a,s,R){if(R===void 0&&(R=null),s.isSidxRequest){this.handleSidxRequest(u,s),this.handlePlaylistLoaded(u,a,s,R);return}this.resetInternalLoader(s.type);var _=u.data;if(_.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,s,"no EXTM3U delimiter",R);return}a.parsing.start=performance.now(),_.indexOf("#EXTINF:")>0||_.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(u,a,s,R):this.handleMasterPlaylist(u,a,s,R)},f.loaderror=function(u,a,s){s===void 0&&(s=null),this.handleNetworkError(a,s,!1,u)},f.loadtimeout=function(u,a,s){s===void 0&&(s=null),this.handleNetworkError(a,s,!0)},f.handleMasterPlaylist=function(u,a,s,R){var _=this.hls,C=u.data,D=p(u,s),O=r.default.parseMasterPlaylist(C,D),A=O.levels,S=O.sessionData;if(!A.length){this.handleManifestParsingError(u,s,"no level found in manifest",R);return}var T=A.map(function(F){return{id:F.attrs.AUDIO,audioCodec:F.audioCodec}}),c=A.map(function(F){return{id:F.attrs.SUBTITLES,textCodec:F.textCodec}}),w=r.default.parseMasterPlaylistMedia(C,D,"AUDIO",T),y=r.default.parseMasterPlaylistMedia(C,D,"SUBTITLES",c),b=r.default.parseMasterPlaylistMedia(C,D,"CLOSED-CAPTIONS");if(w.length){var U=w.some(function(F){return!F.url});!U&&A[0].audioCodec&&!A[0].attrs.AUDIO&&(K.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),w.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new v.AttrList({}),bitrate:0,url:""}))}_.trigger(j.Events.MANIFEST_LOADED,{levels:A,audioTracks:w,subtitles:y,captions:b,url:D,stats:a,networkDetails:R,sessionData:S})},f.handleTrackOrLevelPlaylist=function(u,a,s,R){var _=this.hls,C=s.id,D=s.level,O=s.type,A=p(u,s),S=Object(X.isFiniteNumber)(C)?C:0,T=Object(X.isFiniteNumber)(D)?D:S,c=m(s),w=r.default.parseLevelPlaylist(u.data,A,T,c,S);if(!w.fragments.length){_.trigger(j.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:A,reason:"no fragments found in level",level:typeof s.level=="number"?s.level:void 0});return}if(O===L.PlaylistContextType.MANIFEST){var y={attrs:new v.AttrList({}),bitrate:0,details:w,name:"",url:A};_.trigger(j.Events.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:A,stats:a,networkDetails:R,sessionData:null})}if(a.parsing.end=performance.now(),w.needSidxRanges){var b,U=(b=w.fragments[0].initSegment)===null||b===void 0?void 0:b.url;this.load({url:U,isSidxRequest:!0,type:O,level:D,levelDetails:w,id:C,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}s.levelDetails=w,this.handlePlaylistLoaded(u,a,s,R)},f.handleSidxRequest=function(u,a){var s=Object(G.parseSegmentIndex)(new Uint8Array(u.data));if(!s)return;var R=s.references,_=a.levelDetails;R.forEach(function(C,D){var O=C.info,A=_.fragments[D];A.byteRange.length===0&&A.setByteRange(String(1+O.end-O.start)+"@"+String(O.start)),A.initSegment&&A.initSegment.setByteRange(String(s.moovEndOffset)+"@0")})},f.handleManifestParsingError=function(u,a,s,R){this.hls.trigger(j.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:a.type===L.PlaylistContextType.MANIFEST,url:u.url,reason:s,response:u,context:a,networkDetails:R})},f.handleNetworkError=function(u,a,s,R){s===void 0&&(s=!1),K.logger.warn("[playlist-loader]: A network "+(s?"timeout":"error")+" occurred while loading "+u.type+" level: "+u.level+" id: "+u.id+' group-id: "'+u.groupId+'"');var _=B.ErrorDetails.UNKNOWN,C=!1,D=this.getInternalLoader(u);switch(u.type){case L.PlaylistContextType.MANIFEST:_=s?B.ErrorDetails.MANIFEST_LOAD_TIMEOUT:B.ErrorDetails.MANIFEST_LOAD_ERROR,C=!0;break;case L.PlaylistContextType.LEVEL:_=s?B.ErrorDetails.LEVEL_LOAD_TIMEOUT:B.ErrorDetails.LEVEL_LOAD_ERROR,C=!1;break;case L.PlaylistContextType.AUDIO_TRACK:_=s?B.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:B.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,C=!1;break;case L.PlaylistContextType.SUBTITLE_TRACK:_=s?B.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:B.ErrorDetails.SUBTITLE_LOAD_ERROR,C=!1;break}D&&this.resetInternalLoader(u.type);var O={type:B.ErrorTypes.NETWORK_ERROR,details:_,fatal:C,url:u.url,loader:D,context:u,networkDetails:a};R&&(O.response=R),this.hls.trigger(j.Events.ERROR,O)},f.handlePlaylistLoaded=function(u,a,s,R){var _=s.type,C=s.level,D=s.id,O=s.groupId,A=s.loader,S=s.levelDetails,T=s.deliveryDirectives;if(!(S!=null&&S.targetduration)){this.handleManifestParsingError(u,s,"invalid target duration",R);return}if(!A)return;S.live&&(A.getCacheAge&&(S.ageHeader=A.getCacheAge()||0),(!A.getCacheAge||isNaN(S.ageHeader))&&(S.ageHeader=0));switch(_){case L.PlaylistContextType.MANIFEST:case L.PlaylistContextType.LEVEL:this.hls.trigger(j.Events.LEVEL_LOADED,{details:S,level:C||0,id:D||0,stats:a,networkDetails:R,deliveryDirectives:T});break;case L.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(j.Events.AUDIO_TRACK_LOADED,{details:S,id:D||0,groupId:O||"",stats:a,networkDetails:R,deliveryDirectives:T});break;case L.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(j.Events.SUBTITLE_TRACK_LOADED,{details:S,id:D||0,groupId:O||"",stats:a,networkDetails:R,deliveryDirectives:T});break}},l}();J.default=h},"./src/polyfills/number.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"isFiniteNumber",function(){return X}),P.d(J,"MAX_SAFE_INTEGER",function(){return j});var X=Number.isFinite||function(B){return typeof B=="number"&&isFinite(B)},j=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ne,J,P){"use strict";P.r(J);var X=function(){function j(){}return j.getSilentFrame=function(K,G){switch(K){case"mp4a.40.2":if(G===1)return new Uint8Array([0,200,0,128,35,128]);if(G===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(G===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(G===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(G===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(G===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(G===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(G===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(G===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},j}();J.default=X},"./src/remux/mp4-generator.ts":function(ne,J,P){"use strict";P.r(J);var X=Math.pow(2,32)-1,j=function(){function B(){}return B.init=function(){B.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var G;for(G in B.types)B.types.hasOwnProperty(G)&&(B.types[G]=[G.charCodeAt(0),G.charCodeAt(1),G.charCodeAt(2),G.charCodeAt(3)]);var r=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),L=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);B.HDLR_TYPES={video:r,audio:L};var v=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),m=new Uint8Array([0,0,0,0,0,0,0,0]);B.STTS=B.STSC=B.STCO=m,B.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),B.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),B.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),B.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var p=new Uint8Array([105,115,111,109]),h=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);B.FTYP=B.box(B.types.ftyp,p,l,p,h),B.DINF=B.box(B.types.dinf,B.box(B.types.dref,v))},B.box=function(G){for(var r=8,L=arguments.length,v=new Array(L>1?L-1:0),m=1;m>24&255,l[1]=r>>16&255,l[2]=r>>8&255,l[3]=r&255,l.set(G,4),p=0,r=8;p>24&255,G>>16&255,G>>8&255,G&255,L>>24,L>>16&255,L>>8&255,L&255,v>>24,v>>16&255,v>>8&255,v&255,85,196,0,0]))},B.mdia=function(G){return B.box(B.types.mdia,B.mdhd(G.timescale,G.duration),B.hdlr(G.type),B.minf(G))},B.mfhd=function(G){return B.box(B.types.mfhd,new Uint8Array([0,0,0,0,G>>24,G>>16&255,G>>8&255,G&255]))},B.minf=function(G){return G.type==="audio"?B.box(B.types.minf,B.box(B.types.smhd,B.SMHD),B.DINF,B.stbl(G)):B.box(B.types.minf,B.box(B.types.vmhd,B.VMHD),B.DINF,B.stbl(G))},B.moof=function(G,r,L){return B.box(B.types.moof,B.mfhd(G),B.traf(L,r))},B.moov=function(G){for(var r=G.length,L=[];r--;)L[r]=B.trak(G[r]);return B.box.apply(null,[B.types.moov,B.mvhd(G[0].timescale,G[0].duration)].concat(L).concat(B.mvex(G)))},B.mvex=function(G){for(var r=G.length,L=[];r--;)L[r]=B.trex(G[r]);return B.box.apply(null,[B.types.mvex].concat(L))},B.mvhd=function(G,r){r*=G;var L=Math.floor(r/(X+1)),v=Math.floor(r%(X+1)),m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,G>>24&255,G>>16&255,G>>8&255,G&255,L>>24,L>>16&255,L>>8&255,L&255,v>>24,v>>16&255,v>>8&255,v&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return B.box(B.types.mvhd,m)},B.sdtp=function(G){var r=G.samples||[],L=new Uint8Array(4+r.length),v,m;for(v=0;v>>8&255),r.push(p&255),r=r.concat(Array.prototype.slice.call(m));for(v=0;v>>8&255),L.push(p&255),L=L.concat(Array.prototype.slice.call(m));var h=B.box(B.types.avcC,new Uint8Array([1,r[3],r[4],r[5],252|3,224|G.sps.length].concat(r).concat([G.pps.length]).concat(L))),l=G.width,f=G.height,o=G.pixelRatio[0],u=G.pixelRatio[1];return B.box(B.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,l&255,f>>8&255,f&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),h,B.box(B.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),B.box(B.types.pasp,new Uint8Array([o>>24,o>>16&255,o>>8&255,o&255,u>>24,u>>16&255,u>>8&255,u&255])))},B.esds=function(G){var r=G.config.length;return new Uint8Array([0,0,0,0,3,23+r,0,1,0,4,15+r,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([r]).concat(G.config).concat([6,1,2]))},B.mp4a=function(G){var r=G.samplerate;return B.box(B.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,G.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]),B.box(B.types.esds,B.esds(G)))},B.mp3=function(G){var r=G.samplerate;return B.box(B.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,G.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]))},B.stsd=function(G){return G.type==="audio"?!G.isAAC&&G.codec==="mp3"?B.box(B.types.stsd,B.STSD,B.mp3(G)):B.box(B.types.stsd,B.STSD,B.mp4a(G)):B.box(B.types.stsd,B.STSD,B.avc1(G))},B.tkhd=function(G){var r=G.id,L=G.duration*G.timescale,v=G.width,m=G.height,p=Math.floor(L/(X+1)),h=Math.floor(L%(X+1));return B.box(B.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,r&255,0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,h>>24,h>>16&255,h>>8&255,h&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,v>>8&255,v&255,0,0,m>>8&255,m&255,0,0]))},B.traf=function(G,r){var L=B.sdtp(G),v=G.id,m=Math.floor(r/(X+1)),p=Math.floor(r%(X+1));return B.box(B.types.traf,B.box(B.types.tfhd,new Uint8Array([0,0,0,0,v>>24,v>>16&255,v>>8&255,v&255])),B.box(B.types.tfdt,new Uint8Array([1,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,p>>24,p>>16&255,p>>8&255,p&255])),B.trun(G,L.length+16+20+8+16+8+8),L)},B.trak=function(G){return G.duration=G.duration||4294967295,B.box(B.types.trak,B.tkhd(G),B.mdia(G))},B.trex=function(G){var r=G.id;return B.box(B.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},B.trun=function(G,r){var L=G.samples||[],v=L.length,m=12+16*v,p=new Uint8Array(m),h,l,f,o,u,a;for(r+=8+m,p.set([0,0,15,1,v>>>24&255,v>>>16&255,v>>>8&255,v&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255],0),h=0;h>>24&255,f>>>16&255,f>>>8&255,f&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&240<<8,u.degradPrio&15,a>>>24&255,a>>>16&255,a>>>8&255,a&255],12+16*h);return B.box(B.types.trun,p)},B.initSegment=function(G){B.types||B.init();var r=B.moov(G),L=new Uint8Array(B.FTYP.byteLength+r.byteLength);return L.set(B.FTYP),L.set(r,B.FTYP.byteLength),L},B}();j.types=void 0,j.HDLR_TYPES=void 0,j.STTS=void 0,j.STSC=void 0,j.STCO=void 0,j.STSZ=void 0,j.VMHD=void 0,j.SMHD=void 0,j.STSD=void 0,j.FTYP=void 0,j.DINF=void 0,J.default=j},"./src/remux/mp4-remuxer.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return a}),P.d(J,"normalizePts",function(){return s});var X=P("./src/polyfills/number.ts"),j=P("./src/remux/aac-helper.ts"),B=P("./src/remux/mp4-generator.ts"),K=P("./src/events.ts"),G=P("./src/errors.ts"),r=P("./src/utils/logger.ts"),L=P("./src/types/loader.ts"),v=P("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(D){for(var O=1;O0?w:y.pts},S[0].pts);return T&&r.logger.debug("PTS rollover detected"),c},O.remux=function(S,T,c,w,y,b,U,F){var E,N,I,g,H,$,ie=y,oe=y,Ce=S.pid>-1,ve=T.pid>-1,Se=T.samples.length,Ae=S.samples.length>0,Oe=Se>1,he=(!Ce||Ae)&&(!ve||Oe)||this.ISGenerated||U;if(he){this.ISGenerated||(I=this.generateIS(S,T,y));var ce=this.isVideoContiguous,re=-1;if(Oe&&(re=R(T.samples),!ce&&this.config.forceKeyFrameOnDiscontinuity))if($=!0,re>0){r.logger.warn("[mp4-remuxer]: Dropped "+re+" out of "+Se+" video samples due to a missing keyframe");var fe=this.getVideoStartPts(T.samples);T.samples=T.samples.slice(re),T.dropped+=re,oe+=(T.samples[0].pts-fe)/(T.timescale||9e4)}else re===-1&&(r.logger.warn("[mp4-remuxer]: No keyframe found out of "+Se+" video samples"),$=!1);if(this.ISGenerated){if(Ae&&Oe){var se=this.getVideoStartPts(T.samples),ke=s(S.samples[0].pts,se)-se,Ne=ke/T.inputTimeScale;ie+=Math.max(0,Ne),oe+=Math.max(0,-Ne)}if(Ae){if(S.samplerate||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),I=this.generateIS(S,T,y)),N=this.remuxAudio(S,ie,this.isAudioContiguous,b,ve||Oe||F===L.PlaylistLevelType.AUDIO?oe:void 0),Oe){var Re=N?N.endPTS-N.startPTS:0;T.inputTimeScale||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),I=this.generateIS(S,T,y)),E=this.remuxVideo(T,oe,ce,Re)}}else Oe&&(E=this.remuxVideo(T,oe,ce,0));E&&(E.firstKeyFrame=re,E.independent=re!==-1)}}return this.ISGenerated&&(c.samples.length&&(H=this.remuxID3(c,y)),w.samples.length&&(g=this.remuxText(w,y))),{audio:N,video:E,initSegment:I,independent:$,text:g,id3:H}},O.generateIS=function(S,T,c){var w=S.samples,y=T.samples,b=this.typeSupported,U={},F=!Object(X.isFiniteNumber)(this._initPTS),E="audio/mp4",N,I,g;if(F&&(N=I=Infinity),S.config&&w.length&&(S.timescale=S.samplerate,S.isAAC||(b.mpeg?(E="audio/mpeg",S.codec=""):b.mp3&&(S.codec="mp3")),U.audio={id:"audio",container:E,codec:S.codec,initSegment:!S.isAAC&&b.mpeg?new Uint8Array(0):B.default.initSegment([S]),metadata:{channelCount:S.channelCount}},F&&(g=S.inputTimeScale,N=I=w[0].pts-Math.round(g*c))),T.sps&&T.pps&&y.length&&(T.timescale=T.inputTimeScale,U.video={id:"main",container:"video/mp4",codec:T.codec,initSegment:B.default.initSegment([T]),metadata:{width:T.width,height:T.height}},F)){g=T.inputTimeScale;var H=this.getVideoStartPts(y),$=Math.round(g*c);I=Math.min(I,s(y[0].dts,H)-$),N=Math.min(N,H-$)}if(Object.keys(U).length)return this.ISGenerated=!0,F&&(this._initPTS=N,this._initDTS=I),{tracks:U,initPTS:N,timescale:g}},O.remuxVideo=function(S,T,c,w){var y=S.inputTimeScale,b=S.samples,U=[],F=b.length,E=this._initPTS,N=this.nextAvcDts,I=8,g,H,$,ie=Number.POSITIVE_INFINITY,oe=Number.NEGATIVE_INFINITY,Ce=0,ve=!1;if(!c||N===null){var Se=T*y,Ae=b[0].pts-s(b[0].dts,b[0].pts);N=Se-Ae}for(var Oe=0;Oehe.pts){var ce=9e4*.2;Ce=Math.max(Math.min(Ce,he.pts-he.dts),-1*ce)}he.dts0?Oe-1:Oe].dts&&(ve=!0)}ve&&b.sort(function(wt,St){var ct=wt.dts-St.dts,Ut=wt.pts-St.pts;return ct||Ut}),H=b[0].dts,$=b[b.length-1].dts;var re=Math.round(($-H)/(F-1));if(Ce<0){if(Cere,Pe=Ne<-1;if(Re||Pe){Re?r.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(Ne,!0)+" ms ("+Ne+"dts) hole between fragments detected, filling it"):r.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(-Ne,!0)+" ms ("+Ne+"dts) overlapping between fragments detected"),H=N;var je=b[0].pts-Ne;b[0].dts=H,b[0].pts=je,r.logger.log("Video: First PTS/DTS adjusted: "+Object(v.toMsFromMpegTsClock)(je,!0)+"/"+Object(v.toMsFromMpegTsClock)(H,!0)+", delta: "+Object(v.toMsFromMpegTsClock)(Ne,!0)+" ms")}}u&&(H=Math.max(0,H));for(var ue=0,Ee=0,Le=0;Le0?Be-1:Be].dts;if(le.stretchShortVideoTrack&&this.nextAudioPts!==null){var ge=Math.floor(le.maxBufferHole*y),we=(w?ie+w*y:this.nextAudioPts)-ut.pts;we>ge?(g=we-de,g<0&&(g=de),r.logger.log("[mp4-remuxer]: It is approximately "+we/90+" ms to the next segment; using duration "+g/90+" ms for the last video frame.")):g=de}else g=de}var Fe=Math.round(ut.pts-ut.dts);U.push(new _(ut.key,g,Ue,Fe))}if(U.length&&f&&f<70){var ze=U[0].flags;ze.dependsOn=2,ze.isNonSync=0}console.assert(g!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=N=$+g,this.isVideoContiguous=!0;var st=B.default.moof(S.sequenceNumber++,H,m({},S,{samples:U})),mt="video",ft={data1:st,data2:qe,startPTS:ie/y,endPTS:(oe+g)/y,startDTS:H/y,endDTS:N/y,type:mt,hasAudio:!1,hasVideo:!0,nb:U.length,dropped:S.dropped};return S.samples=[],S.dropped=0,console.assert(qe.length,"MDAT length must not be zero"),ft},O.remuxAudio=function(S,T,c,w,y){var b=S.inputTimeScale,U=S.samplerate?S.samplerate:b,F=b/U,E=S.isAAC?h:l,N=E*F,I=this._initPTS,g=!S.isAAC&&this.typeSupported.mpeg,H=[],$=S.samples,ie=g?0:8,oe=this.nextAudioPts||-1,Ce=T*b;if(this.isAudioContiguous=c=c||$.length&&oe>0&&(w&&Math.abs(Ce-oe)<9e3||Math.abs(s($[0].pts-I,Ce)-oe)<20*N),$.forEach(function(be){be.pts=s(be.pts-I,Ce)}),!c||oe<0){if($=$.filter(function(be){return be.pts>=0}),!$.length)return;y===0?oe=0:w?oe=Math.max(0,Ce):oe=$[0].pts}if(S.isAAC)for(var ve=y!==void 0,Se=this.config.maxAudioFramesDrift,Ae=0,Oe=oe;Ae<$.length;Ae++){var he=$[Ae],ce=he.pts,re=ce-Oe,fe=Math.abs(1e3*re/b);if(re<=-Se*N&&ve)Ae===0&&(r.logger.warn("Audio frame @ "+(ce/b).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*re/b)+" ms."),this.nextAudioPts=oe=Oe=ce);else if(re>=Se*N&&fe0){Ee+=ie;try{ue=new Uint8Array(Ee)}catch(be){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:G.ErrorTypes.MUX_ERROR,details:G.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ee,reason:"fail allocating audio mdat "+Ee});return}if(!g){var qe=new DataView(ue.buffer);qe.setUint32(0,Ee),ue.set(B.default.types.mdat,4)}}else return;ue.set(Je,ie);var tt=Je.byteLength;ie+=tt,H.push(new _(!0,E,tt,0)),je=Qe}var Be=H.length;if(!Be)return;var ut=H[H.length-1];this.nextAudioPts=oe=je+F*ut.duration;var ot=g?new Uint8Array(0):B.default.moof(S.sequenceNumber++,Pe/F,m({},S,{samples:H}));S.samples=[];var Ue=Pe/b,He=oe/b,Te="audio",me={data1:ot,data2:ue,startPTS:Ue,endPTS:He,startDTS:Ue,endDTS:He,type:Te,hasAudio:!0,hasVideo:!1,nb:Be};return this.isAudioContiguous=!0,console.assert(ue.length,"MDAT length must not be zero"),me},O.remuxEmptyAudio=function(S,T,c,w){var y=S.inputTimeScale,b=S.samplerate?S.samplerate:y,U=y/b,F=this.nextAudioPts,E=(F!==null?F:w.startDTS*y)+this._initDTS,N=w.endDTS*y+this._initDTS,I=U*h,g=Math.ceil((N-E)/I),H=j.default.getSilentFrame(S.manifestCodec||S.codec,S.channelCount);if(r.logger.warn("[mp4-remuxer]: remux empty Audio"),!H){r.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var $=[],ie=0;ie4294967296;)D+=A;return D}function R(D){for(var O=0;O0?this.lastEndDTS=S:(K.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var T=!!D.audio,c=!!D.video,w="";T&&(w+="audio"),c&&(w+="video");var y={data1:_,startPTS:A,startDTS:A,endPTS:S,endDTS:S,type:w,hasAudio:T,hasVideo:c,nb:1,dropped:0};return R.audio=y.type==="audio"?y:void 0,R.video=y.type!=="audio"?y:void 0,R.text=o,R.id3=f,R.initSegment=C,R},v}(),r=function(m,p,h){return Object(j.getStartDTS)(m,p)-h};function L(v,m){var p=v==null?void 0:v.codec;return p&&p.length>4?p:p==="hvc1"?"hvc1.1.c.L120.90":p==="av01"?"av01.0.04M.08":p==="avc1"||m===B.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}J.default=G},"./src/task-loop.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"default",function(){return X});var X=function(){function j(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var B=j.prototype;return B.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},B.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},B.onHandlerDestroyed=function(){},B.hasInterval=function(){return!!this._tickInterval},B.hasNextTick=function(){return!!this._tickTimer},B.setInterval=function(G){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,G),!0)},B.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},B.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},B.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},B.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},B.doTick=function(){},j}()},"./src/types/cmcd.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"CMCDVersion",function(){return X}),P.d(J,"CMCDObjectType",function(){return j}),P.d(J,"CMCDStreamingFormat",function(){return B}),P.d(J,"CMCDStreamType",function(){return K});var X=1,j;(function(G){G.MANIFEST="m",G.AUDIO="a",G.VIDEO="v",G.MUXED="av",G.INIT="i",G.CAPTION="c",G.TIMED_TEXT="tt",G.KEY="k",G.OTHER="o"})(j||(j={}));var B;(function(G){G.DASH="d",G.HLS="h",G.SMOOTH="s",G.OTHER="o"})(B||(B={}));var K;(function(G){G.VOD="v",G.LIVE="l"})(K||(K={}))},"./src/types/level.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"HlsSkip",function(){return B}),P.d(J,"getSkipValue",function(){return K}),P.d(J,"HlsUrlParameters",function(){return G}),P.d(J,"Level",function(){return r});function X(L,v){for(var m=0;mNumber.MAX_SAFE_INTEGER?Infinity:v},G.hexadecimalInteger=function(L){if(this[L]){var v=(this[L]||"0x").slice(2);v=(v.length&1?"0":"")+v;for(var m=new Uint8Array(v.length/2),p=0;pNumber.MAX_SAFE_INTEGER?Infinity:v},G.decimalFloatingPoint=function(L){return parseFloat(this[L])},G.optionalFloat=function(L,v){var m=this[L];return m?parseFloat(m):v},G.enumeratedString=function(L){return this[L]},G.bool=function(L){return this[L]==="YES"},G.decimalResolution=function(L){var v=X.exec(this[L]);return v===null?void 0:{width:parseInt(v[1],10),height:parseInt(v[2],10)}},K.parseAttrList=function(L){var v,m={},p='"';for(j.lastIndex=0;(v=j.exec(L))!==null;){var h=v[2];h.indexOf(p)===0&&h.lastIndexOf(p)===h.length-1&&(h=h.slice(1,-1)),m[v[1]]=h}return m},K}()},"./src/utils/binary-search.ts":function(ne,J,P){"use strict";P.r(J);var X={search:function(B,K){for(var G=0,r=B.length-1,L=null,v=null;G<=r;){L=(G+r)/2|0,v=B[L];var m=K(v);if(m>0)G=L+1;else if(m<0)r=L-1;else return v}return null}};J.default=X},"./src/utils/buffer-helper.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"BufferHelper",function(){return B});var X=P("./src/utils/logger.ts"),j={length:0,start:function(){return 0},end:function(){return 0}},B=function(){function K(){}return K.isBuffered=function(r,L){try{if(r){for(var v=K.getBuffered(r),m=0;m=v.start(m)&&L<=v.end(m))return!0}}catch(p){}return!1},K.bufferInfo=function(r,L,v){try{if(r){var m=K.getBuffered(r),p=[],h;for(h=0;hl&&(m[h-1].end=r[p].end):m.push(r[p])}else m.push(r[p])}else m=r;for(var f=0,o,u=L,a=L,s=0;s=R&&L<_)u=R,a=_,f=a-L;else if(L+v=c&&X.logger.log(this.time+" ["+c+"] "+w)},A}(),f=function(S){for(var T=[],c=0;cG&&(this.logger.log(h.DEBUG,"Too large cursor position "+this.pos),this.pos=G)},S.moveCursor=function(c){var w=this.pos+c;if(c>1)for(var y=this.pos+1;y=144&&this.backSpace();var w=B(c);if(this.pos>=G){this.logger.log(h.ERROR,"Cannot insert "+c.toString(16)+" ("+w+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(w,this.currPenState),this.moveCursor(1)},S.clearFromPos=function(c){var w;for(w=c;w0&&(c?y="["+w.join(" | ")+"]":y=w.join(` `)),y},S.getTextAndFormat=function(){return this.rows},A}(),R=function(){function A(T,c,w){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=T,this.outputFilter=c,this.mode=null,this.verbose=0,this.displayedMemory=new s(w),this.nonDisplayedMemory=new s(w),this.lastOutputScreen=new s(w),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=w}var S=A.prototype;return S.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},S.getHandler=function(){return this.outputFilter},S.setHandler=function(c){this.outputFilter=c},S.setPAC=function(c){this.writeScreen.setPAC(c)},S.setBkgData=function(c){this.writeScreen.setBkgData(c)},S.setMode=function(c){if(c===this.mode)return;this.mode=c,this.logger.log(h.INFO,"MODE="+c),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=c},S.insertChars=function(c){for(var w=0;w=46,w.italics)w.foreground="white";else{var y=Math.floor(c/2)-16,b=["white","green","blue","cyan","red","yellow","magenta"];w.foreground=b[y]}this.logger.log(h.INFO,"MIDROW: "+JSON.stringify(w)),this.writeScreen.setPen(w)},S.outputDataUpdate=function(c){c===void 0&&(c=!1);var w=this.logger.time;if(w===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=w:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,w,this.lastOutputScreen),c&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:w),this.lastOutputScreen.copy(this.displayedMemory))},S.cueSplitAtTime=function(c){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,c,this.displayedMemory),this.cueStartTime=c))},A}(),_=function(){function A(T,c,w){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var y=new l;this.channels=[null,new R(T,c,y),new R(T+1,w,y)],this.cmdHistory=O(),this.logger=y}var S=A.prototype;return S.getHandler=function(c){return this.channels[c].getHandler()},S.setHandler=function(c,w){this.channels[c].setHandler(w)},S.addData=function(c,w){var y,b,U,F=!1;this.logger.time=c;for(var E=0;E ("+f([b,U])+")"),y=this.parseCmd(b,U),y||(y=this.parseMidrow(b,U)),y||(y=this.parsePAC(b,U)),y||(y=this.parseBackgroundAttributes(b,U)),!y&&(F=this.parseChars(b,U),F)){var N=this.currentChannel;if(N&&N>0){var I=this.channels[N];I.insertChars(F)}else this.logger.log(h.WARNING,"No channel found yet. TEXT-MODE?")}!y&&!F&&this.logger.log(h.WARNING,"Couldn't parse cleaned data "+f([b,U])+" orig: "+f([w[E],w[E+1]]))}},S.parseCmd=function(c,w){var y=this.cmdHistory,b=(c===20||c===28||c===21||c===29)&&w>=32&&w<=47,U=(c===23||c===31)&&w>=33&&w<=35;if(!(b||U))return!1;if(D(c,w,y))return C(null,null,y),this.logger.log(h.DEBUG,"Repeated command ("+f([c,w])+") is dropped"),!0;var F=c===20||c===21||c===23?1:2,E=this.channels[F];return c===20||c===21||c===28||c===29?w===32?E.ccRCL():w===33?E.ccBS():w===34?E.ccAOF():w===35?E.ccAON():w===36?E.ccDER():w===37?E.ccRU(2):w===38?E.ccRU(3):w===39?E.ccRU(4):w===40?E.ccFON():w===41?E.ccRDC():w===42?E.ccTR():w===43?E.ccRTD():w===44?E.ccEDM():w===45?E.ccCR():w===46?E.ccENM():w===47&&E.ccEOC():E.ccTO(w-32),C(c,w,y),this.currentChannel=F,!0},S.parseMidrow=function(c,w){var y=0;if((c===17||c===25)&&w>=32&&w<=47){if(c===17?y=1:y=2,y!==this.currentChannel)return this.logger.log(h.ERROR,"Mismatch channel in midrow parsing"),!1;var b=this.channels[y];return b?(b.ccMIDROW(w),this.logger.log(h.DEBUG,"MIDROW ("+f([c,w])+")"),!0):!1}return!1},S.parsePAC=function(c,w){var y,b=this.cmdHistory,U=(c>=17&&c<=23||c>=25&&c<=31)&&w>=64&&w<=127,F=(c===16||c===24)&&w>=64&&w<=95;if(!(U||F))return!1;if(D(c,w,b))return C(null,null,b),!0;var E=c<=23?1:2;w>=64&&w<=95?y=E===1?r[c]:v[c]:y=E===1?L[c]:m[c];var N=this.channels[E];return N?(N.setPAC(this.interpretPAC(y,w)),C(c,w,b),this.currentChannel=E,!0):!1},S.interpretPAC=function(c,w){var y,b={color:null,italics:!1,indent:null,underline:!1,row:c};return w>95?y=w-96:y=w-64,b.underline=(y&1)===1,y<=13?b.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(y/2)]:y<=15?(b.italics=!0,b.color="white"):b.indent=Math.floor((y-16)/2)*4,b},S.parseChars=function(c,w){var y,b=null,U=null;if(c>=25?(y=2,U=c-8):(y=1,U=c),U>=17&&U<=19){var F;U===17?F=w+80:U===18?F=w+112:F=w+144,this.logger.log(h.INFO,"Special char '"+B(F)+"' in channel "+y),b=[F]}else c>=32&&c<=127&&(b=w===0?[c]:[c,w]);if(b){var E=f(b);this.logger.log(h.DEBUG,"Char codes = "+E.join(",")),C(c,w,this.cmdHistory)}return b},S.parseBackgroundAttributes=function(c,w){var y=(c===16||c===24)&&w>=32&&w<=47,b=(c===23||c===31)&&w>=45&&w<=47;if(!(y||b))return!1;var U,F={};c===16||c===24?(U=Math.floor((w-32)/2),F.background=p[U],w%2===1&&(F.background=F.background+"_semi")):w===45?F.background="transparent":(F.foreground="black",w===47&&(F.underline=!0));var E=c<=23?1:2,N=this.channels[E];return N.setBkgData(F),C(c,w,this.cmdHistory),!0},S.reset=function(){for(var c=0;c=16?u--:u++;var C=Object(X.fixLineBreaks)(a.trim()),D=Object(j.generateCueId)(v,m,C);(!L||!L.cues||!L.cues.getCueById(D))&&(f=new s(v,m,C),f.id=D,f.line=R+1,f.align="left",f.position=10+Math.min(80,Math.floor(u*8/32)*10),h.push(f))}return L&&h.length&&(h.sort(function(O,A){return O.line==="auto"||A.line==="auto"?0:O.line>8&&A.line>8?A.line-O.line:O.line-A.line}),h.forEach(function(O){return Object(B.addCueToTrack)(L,O)})),h}};J.default=G},"./src/utils/discontinuities.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"findFirstFragWithCC",function(){return K}),P.d(J,"shouldAlignOnDiscontinuities",function(){return G}),P.d(J,"findDiscontinuousReferenceFrag",function(){return r}),P.d(J,"adjustSlidingStart",function(){return v}),P.d(J,"alignStream",function(){return m}),P.d(J,"alignPDT",function(){return h}),P.d(J,"alignFragmentByPDTDelta",function(){return l}),P.d(J,"alignMediaPlaylistByPDT",function(){return f});var X=P("./src/polyfills/number.ts"),j=P("./src/utils/logger.ts"),B=P("./src/controller/level-helper.ts");function K(o,u){for(var a=null,s=0,R=o.length;sa.startCC||o&&o.cc=this.minWeight_},K.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},K.destroy=function(){},B}();J.default=j},"./src/utils/ewma.ts":function(ne,J,P){"use strict";P.r(J);var X=function(){function j(K,G,r){G===void 0&&(G=0),r===void 0&&(r=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=K,this.alpha_=K?Math.exp(Math.log(.5)/K):0,this.estimate_=G,this.totalWeight_=r}var B=j.prototype;return B.sample=function(G,r){var L=Math.pow(this.alpha_,G);this.estimate_=r*(1-L)+L*this.estimate_,this.totalWeight_+=G},B.getTotalWeight=function(){return this.totalWeight_},B.getEstimate=function(){if(this.alpha_){var G=1-Math.pow(this.alpha_,this.totalWeight_);if(G)return this.estimate_/G}return this.estimate_},j}();J.default=X},"./src/utils/fetch-loader.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"fetchSupported",function(){return l});var X=P("./src/polyfills/number.ts"),j=P("./src/loader/load-stats.ts"),B=P("./src/demux/chunk-cache.ts");function K(s,R){s.prototype=Object.create(R.prototype),s.prototype.constructor=s,m(s,R)}function G(s){var R=typeof Map=="function"?new Map:void 0;return G=function(C){if(C===null||!v(C))return C;if(typeof C!="function")throw new TypeError("Super expression must either be null or a function");if(typeof R!="undefined"){if(R.has(C))return R.get(C);R.set(C,D)}function D(){return r(C,arguments,p(this).constructor)}return D.prototype=Object.create(C.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),m(D,C)},G(s)}function r(s,R,_){return L()?r=Reflect.construct:r=function(D,O,A){var S=[null];S.push.apply(S,O);var T=Function.bind.apply(D,S),c=new T;return A&&m(c,A.prototype),c},r.apply(null,arguments)}function L(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function v(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function m(s,R){return m=Object.setPrototypeOf||function(C,D){return C.__proto__=D,C},m(s,R)}function p(s){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(_){return _.__proto__||Object.getPrototypeOf(_)},p(s)}function h(){return h=Object.assign||function(s){for(var R=1;R=A&&S(D,O,T.flush(),C)):S(D,O,U,C),y()}).catch(function(){return Promise.reject()})};return w()},s}();function o(s,R){var _={method:"GET",mode:"cors",credentials:"same-origin",signal:R,headers:new self.Headers(h({},s.headers))};return s.rangeEnd&&_.headers.set("Range","bytes="+s.rangeStart+"-"+String(s.rangeEnd-1)),_}function u(s,R){return new self.Request(s.url,R)}var a=function(s){K(R,s);function R(_,C,D){var O;return O=s.call(this,_)||this,O.code=void 0,O.details=void 0,O.code=C,O.details=D,O}return R}(G(Error));J.default=f},"./src/utils/imsc1-ttml-parser.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"IMSC1_CODEC",function(){return v}),P.d(J,"parseIMSC1",function(){return l});var X=P("./src/utils/mp4-tools.ts"),j=P("./src/utils/vttparser.ts"),B=P("./src/utils/vttcue.ts"),K=P("./src/demux/id3.ts"),G=P("./src/utils/timescale-conversion.ts"),r=P("./src/utils/webvtt-parser.ts");function L(){return L=Object.assign||function(A){for(var S=1;S"):X}function G(v){for(var m=arguments.length,p=new Array(m>1?m-1:0),h=1;h>24,R[_+1]=C>>16&255,R[_+2]=C>>8&255,R[_+3]=C&255}function m(R,_){var C=[];if(!_.length)return C;var D,O,A;"data"in R?(D=R.data,O=R.start,A=R.end):(D=R,O=0,A=D.byteLength);for(var S=O;S1?S+T:A;if(c===_[0])if(_.length===1)C.push({data:D,start:S+8,end:w});else{var y=m({data:D,start:S+8,end:w},_.slice(1));y.length&&K.apply(C,y)}S=w}return C}function p(R){var _=m(R,["moov"]),C=_[0],D=C?C.end:null,O=m(R,["sidx"]);if(!O||!O[0])return null;var A=[],S=O[0],T=S.data[0],c=T===0?8:16,w=L(S,c);c+=4;var y=0,b=0;T===0?c+=8:c+=16,c+=2;var U=S.end+b,F=r(S,c);c+=2;for(var E=0;E>>31;if(H===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var $=L(S,N);N+=4,A.push({referenceSize:g,subsegmentDuration:$,info:{duration:$/w,start:U,end:U+g-1}}),U+=g,N+=4,c=N}return{earliestPresentationTime:y,timescale:w,version:T,referencesCount:F,references:A,moovEndOffset:D}}function h(R){for(var _=[],C=m(R,["moov","trak"]),D=0;DG)&&(this.startTime=G),this.endTime=r,this.screen=L,this.timelineController.createCaptionsTrack(this.trackName)},B.reset=function(){this.cueRanges=[]},j}()},"./src/utils/texttrack-utils.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"sendAddTrackEvent",function(){return j}),P.d(J,"addCueToTrack",function(){return B}),P.d(J,"clearCurrentCues",function(){return K}),P.d(J,"removeCuesInRange",function(){return G}),P.d(J,"getCuesInRange",function(){return L});var X=P("./src/utils/logger.ts");function j(v,m){var p;try{p=new Event("addtrack")}catch(h){p=document.createEvent("Event"),p.initEvent("addtrack",!1,!1)}p.track=v,m.dispatchEvent(p)}function B(v,m){var p=v.mode;if(p==="disabled"&&(v.mode="hidden"),v.cues&&!v.cues.getCueById(m.id))try{if(v.addCue(m),!v.cues.getCueById(m.id))throw new Error("addCue is failed for: "+m)}catch(l){X.logger.debug("[texttrack-utils]: "+l);var h=new self.TextTrackCue(m.startTime,m.endTime,m.text);h.id=m.id,v.addCue(h)}p==="disabled"&&(v.mode=p)}function K(v){var m=v.mode;if(m==="disabled"&&(v.mode="hidden"),v.cues)for(var p=v.cues.length;p--;)v.removeCue(v.cues[p]);m==="disabled"&&(v.mode=m)}function G(v,m,p){var h=v.mode;if(h==="disabled"&&(v.mode="hidden"),v.cues&&v.cues.length>0)for(var l=L(v.cues,m,p),f=0;fv[p].endTime)return-1;for(var h=0,l=p;h<=l;){var f=Math.floor((l+h)/2);if(mv[f].startTime&&h-1)for(var f=l,o=v.length;f=m&&u.endTime<=p)h.push(u);else if(u.startTime>p)return h}return h}},"./src/utils/time-ranges.ts":function(ne,J,P){"use strict";P.r(J);var X={toString:function(B){for(var K="",G=B.length,r=0;r1?m-1:0),h=1;h100)throw new Error("Position must be between 0 and 100.");A=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",r({},l,{get:function(){return S},set:function(y){var b=G(y);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");S=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",r({},l,{get:function(){return T},set:function(y){if(y<0||y>100)throw new Error("Size must be between 0 and 100.");T=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",r({},l,{get:function(){return c},set:function(y){var b=G(y);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");c=b,this.hasBeenReset=!0}})),h.displayState=void 0}return L.prototype.getCueAsHTML=function(){var v=self.WebVTT;return v.convertCueToDOMTree(self,this.text)},L}()},"./src/utils/vttparser.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"parseTimeStamp",function(){return B}),P.d(J,"fixLineBreaks",function(){return m}),P.d(J,"VTTParser",function(){return p});var X=P("./src/utils/vttcue.ts"),j=function(){function h(){}var l=h.prototype;return l.decode=function(o,u){if(!o)return"";if(typeof o!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(o))},h}();function B(h){function l(o,u,a,s){return(o|0)*3600+(u|0)*60+(a|0)+parseFloat(s||0)}var f=h.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return f?parseFloat(f[2])>59?l(f[2],f[3],0,f[4]):l(f[1],f[2],f[3],f[4]):null}var K=function(){function h(){this.values=Object.create(null)}var l=h.prototype;return l.set=function(o,u){!this.get(o)&&u!==""&&(this.values[o]=u)},l.get=function(o,u,a){return a?this.has(o)?this.values[o]:u[a]:this.has(o)?this.values[o]:u},l.has=function(o){return o in this.values},l.alt=function(o,u,a){for(var s=0;s=0&&a<=100)return this.set(o,a),!0}return!1},h}();function G(h,l,f,o){var u=o?h.split(o):[h];for(var a in u){if(typeof u[a]!="string")continue;var s=u[a].split(f);if(s.length!==2)continue;var R=s[0],_=s[1];l(R,_)}}var r=new X.default(0,0,""),L=r.align==="middle"?"middle":"center";function v(h,l,f){var o=h;function u(){var R=B(h);if(R===null)throw new Error("Malformed timestamp: "+o);return h=h.replace(/^[^\sa-zA-Z-]+/,""),R}function a(R,_){var C=new K;G(R,function(A,S){var T;switch(A){case"region":for(var c=f.length-1;c>=0;c--)if(f[c].id===S){C.set(A,f[c].region);break}break;case"vertical":C.alt(A,S,["rl","lr"]);break;case"line":T=S.split(","),C.integer(A,T[0]),C.percent(A,T[0])&&C.set("snapToLines",!1),C.alt(A,T[0],["auto"]),T.length===2&&C.alt("lineAlign",T[1],["start",L,"end"]);break;case"position":T=S.split(","),C.percent(A,T[0]),T.length===2&&C.alt("positionAlign",T[1],["start",L,"end","line-left","line-right","auto"]);break;case"size":C.percent(A,S);break;case"align":C.alt(A,S,["start",L,"end","left","right"]);break}},/:/,/\s/),_.region=C.get("region",null),_.vertical=C.get("vertical","");var D=C.get("line","auto");D==="auto"&&r.line===-1&&(D=-1),_.line=D,_.lineAlign=C.get("lineAlign","start"),_.snapToLines=C.get("snapToLines",!0),_.size=C.get("size",100),_.align=C.get("align",L);var O=C.get("position","auto");O==="auto"&&r.position===50&&(O=_.align==="start"||_.align==="left"?0:_.align==="end"||_.align==="right"?100:50),_.position=O}function s(){h=h.replace(/^\s+/,"")}if(s(),l.startTime=u(),s(),h.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);h=h.substr(3),s(),l.endTime=u(),s(),a(h,l)}function m(h){return h.replace(//gi,` `)}var p=function(){function h(){this.state="INITIAL",this.buffer="",this.decoder=new j,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var l=h.prototype;return l.parse=function(o){var u=this;o&&(u.buffer+=u.decoder.decode(o,{stream:!0}));function a(){var O=u.buffer,A=0;for(O=m(O);A")===-1){u.cue.id=R;continue}case"CUE":if(!u.cue){u.state="BADCUE";continue}try{v(R,u.cue,u.regionList)}catch(O){u.cue=null,u.state="BADCUE";continue}u.state="CUETEXT";continue;case"CUETEXT":{var D=R.indexOf("-->")!==-1;if(!R||D&&(C=!0)){u.oncue&&u.cue&&u.oncue(u.cue),u.cue=null,u.state="ID";continue}if(u.cue===null)continue;u.cue.text&&(u.cue.text+=` `),u.cue.text+=R}continue;case"BADCUE":R||(u.state="ID")}}}catch(O){u.state==="CUETEXT"&&u.cue&&u.oncue&&u.oncue(u.cue),u.cue=null,u.state=u.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},l.flush=function(){var o=this;try{if((o.cue||o.state==="HEADER")&&(o.buffer+=` `,o.parse()),o.state==="INITIAL"||o.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(u){o.onparsingerror&&o.onparsingerror(u)}return o.onflush&&o.onflush(),this},h}()},"./src/utils/webvtt-parser.ts":function(ne,J,P){"use strict";P.r(J),P.d(J,"generateCueId",function(){return p}),P.d(J,"parseWebVTT",function(){return l});var X=P("./src/polyfills/number.ts"),j=P("./src/utils/vttparser.ts"),B=P("./src/demux/id3.ts"),K=P("./src/utils/timescale-conversion.ts"),G=P("./src/remux/mp4-remuxer.ts"),r=/\r\n|\n\r|\n|\r/g,L=function(o,u,a){return a===void 0&&(a=0),o.substr(a,u.length)===u},v=function(o){var u=parseInt(o.substr(-3)),a=parseInt(o.substr(-6,2)),s=parseInt(o.substr(-9,2)),R=o.length>9?parseInt(o.substr(0,o.indexOf(":"))):0;if(!Object(X.isFiniteNumber)(u)||!Object(X.isFiniteNumber)(a)||!Object(X.isFiniteNumber)(s)||!Object(X.isFiniteNumber)(R))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+o);return u+=1e3*a,u+=60*1e3*s,u+=60*60*1e3*R,u},m=function(o){for(var u=5381,a=o.length;a;)u=u*33^o.charCodeAt(--a);return(u>>>0).toString()};function p(f,o,u){return m(f.toString())+m(o.toString())+m(u)}var h=function(o,u,a){var s=o[u],R=o[s.prevCC];if(!R||!R.new&&s.new){o.ccOffset=o.presentationOffset=s.start,s.new=!1;return}for(;(_=R)!==null&&_!==void 0&&_.new;){var _;o.ccOffset+=s.start-R.start,s.new=!1,s=R,R=o[s.prevCC]}o.presentationOffset=a};function l(f,o,u,a,s,R,_,C){var D=new j.VTTParser,O=Object(B.utf8ArrayToStr)(new Uint8Array(f)).trim().replace(r,` `).split(` `),A=[],S=Object(K.toMpegTsClockFromTimescale)(o,u),T="00:00.000",c=0,w=0,y,b=!0,U=!1;D.oncue=function(F){var E=a[s],N=a.ccOffset,I=(c-S)/9e4;if(E!=null&&E.new&&(w!==void 0?N=a.ccOffset=E.start:h(a,s,I)),I&&(N=I-a.presentationOffset),U){var g=F.endTime-F.startTime,H=Object(G.normalizePts)((F.startTime+N-w)*9e4,R*9e4)/9e4;F.startTime=H,F.endTime=H+g}var $=F.text.trim();F.text=decodeURIComponent(encodeURIComponent($)),F.id||(F.id=p(F.startTime,F.endTime,$)),F.endTime>0&&A.push(F)},D.onparsingerror=function(F){y=F},D.onflush=function(){if(y){C(y);return}_(A)},O.forEach(function(F){if(b)if(L(F,"X-TIMESTAMP-MAP=")){b=!1,U=!0,F.substr(16).split(",").forEach(function(E){L(E,"LOCAL:")?T=E.substr(6):L(E,"MPEGTS:")&&(c=parseInt(E.substr(7)))});try{w=v(T)/1e3}catch(E){U=!1,y=E}return}else F===""&&(b=!1);D.parse(F+` `)}),D.flush()}},"./src/utils/xhr-loader.ts":function(ne,J,P){"use strict";P.r(J);var X=P("./src/utils/logger.ts"),j=P("./src/loader/load-stats.ts"),B=/^age:\s*[\d.]+\s*$/m,K=function(){function G(L){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=L?L.xhrSetup:null,this.stats=new j.LoadStats,this.retryDelay=0}var r=G.prototype;return r.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},r.abortInternal=function(){var v=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),v&&(v.onreadystatechange=null,v.onprogress=null,v.readyState!==4&&(this.stats.aborted=!0,v.abort()))},r.abort=function(){var v;this.abortInternal(),(v=this.callbacks)!==null&&v!==void 0&&v.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},r.load=function(v,m,p){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=v,this.config=m,this.callbacks=p,this.retryDelay=m.retryDelay,this.loadInternal()},r.loadInternal=function(){var v=this.config,m=this.context;if(!v)return;var p=this.loader=new self.XMLHttpRequest,h=this.stats;h.loading.first=0,h.loaded=0;var l=this.xhrSetup;try{if(l)try{l(p,m.url)}catch(u){p.open("GET",m.url,!0),l(p,m.url)}p.readyState||p.open("GET",m.url,!0);var f=this.context.headers;if(f)for(var o in f)p.setRequestHeader(o,f[o])}catch(u){this.callbacks.onError({code:p.status,text:u.message},m,p);return}m.rangeEnd&&p.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),p.onreadystatechange=this.readystatechange.bind(this),p.onprogress=this.loadprogress.bind(this),p.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),v.timeout),p.send()},r.readystatechange=function(){var v=this.context,m=this.loader,p=this.stats;if(!v||!m)return;var h=m.readyState,l=this.config;if(p.aborted)return;if(h>=2)if(self.clearTimeout(this.requestTimeout),p.loading.first===0&&(p.loading.first=Math.max(self.performance.now(),p.loading.start)),h===4){m.onreadystatechange=null,m.onprogress=null;var f=m.status;if(f>=200&&f<300){p.loading.end=Math.max(self.performance.now(),p.loading.first);var o,u;if(v.responseType==="arraybuffer"?(o=m.response,u=o.byteLength):(o=m.responseText,u=o.length),p.loaded=p.total=u,!this.callbacks)return;var a=this.callbacks.onProgress;if(a&&a(p,v,o,m),!this.callbacks)return;var s={url:m.responseURL,data:o};this.callbacks.onSuccess(s,p,v,m)}else p.retry>=l.maxRetry||f>=400&&f<499?(X.logger.error(f+" while loading "+v.url),this.callbacks.onError({code:f,text:m.statusText},v,m)):(X.logger.warn(f+" while loading "+v.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,l.maxRetryDelay),p.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),l.timeout)},r.loadtimeout=function(){X.logger.warn("timeout while loading "+this.context.url);var v=this.callbacks;v&&(this.abortInternal(),v.onTimeout(this.stats,this.context,this.loader))},r.loadprogress=function(v){var m=this.stats;m.loaded=v.loaded,v.lengthComputable&&(m.total=v.total)},r.getCacheAge=function(){var v=null;if(this.loader&&B.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");v=m?parseFloat(m):null}return v},G}();J.default=K}}).default})},vHTk:function(nt,xe,Z){nt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);